From 0b5ad6f1fc0c832ad1216ba37b72b0d4ab6d99de Mon Sep 17 00:00:00 2001 From: Fern Support <126544928+fern-support@users.noreply.github.com> Date: Mon, 18 Aug 2025 11:29:22 -0400 Subject: [PATCH 01/31] do not merge: Square Ruby SDK From 80687f47f3055074bd40c0801e107a330bc05746 Mon Sep 17 00:00:00 2001 From: Fern Support <126544928+fern-support@users.noreply.github.com> Date: Mon, 18 Aug 2025 11:55:26 -0400 Subject: [PATCH 02/31] Current gen status + initial integration tests (#159) * ignore claude * intiial test helpers file * strongly type obj creation in helpers.rb * add more test files * bulk convert tests with cursor * use typeful .new() factory methods * regenerate with ruby v2 * restore gemfile and rakefile to main * fix relative imports * square.rb file * find/replace 'module square' --> 'module Square' * replace square::Internal --> Square::Internal * replace ' Internal::' --> ' Square::Internal::' * simplify square.rb * add end statements to else blocks * fix incorrect end statements in request types * change square::internal::json::serializable from class to module * update requirements in helpers.rb * fix test helpers imports * fix missing end after else in clients * ensure request and response types extend model * more requests extend model * remove bad extensions * fix bad class end formatting * fix more bad class end formatting * fix enum files * migrate extends syntax * update type references to error enums * temp commit lib/squre.rb * change tab size to 2 * fix internal lowercase square * fix empty class end syntax * regen * fix else ends * update type mapping * revert type mapping change * manually update gemfile, rakefile, and rubocop file from demo sdk * remove generated code * regen sdk * remove square.rb file * update module file * remove ghost types * fix enum include to extend * disable tests --------- Co-authored-by: jsklan --- .fernignore | 4 +- .gitignore | 3 +- .rubocop.yml | 43 +- Gemfile | 20 +- Rakefile | 19 +- lib/square.rb | 1671 +++++++++++++++++ lib/square/apple_pay/client.rb | 40 + .../types/register_domain_request.rb | 11 + lib/square/bank_accounts/client.rb | 54 + .../types/get_bank_accounts_request.rb | 11 + .../get_by_v_1_id_bank_accounts_request.rb | 11 + .../types/list_bank_accounts_request.rb | 13 + lib/square/bookings/client.rb | 181 ++ .../custom_attribute_definitions/client.rb | 105 ++ ...ing_custom_attribute_definition_request.rb | 14 + ...te_custom_attribute_definitions_request.rb | 13 + ...et_custom_attribute_definitions_request.rb | 14 + ...st_custom_attribute_definitions_request.rb | 14 + ...ing_custom_attribute_definition_request.rb | 15 + .../bookings/custom_attributes/client.rb | 124 ++ ...elete_booking_custom_attributes_request.rb | 13 + ...psert_booking_custom_attributes_request.rb | 13 + .../types/delete_custom_attributes_request.rb | 14 + .../types/get_custom_attributes_request.rb | 16 + .../types/list_custom_attributes_request.rb | 16 + ...upsert_booking_custom_attribute_request.rb | 16 + .../bookings/location_profiles/client.rb | 29 + .../types/list_location_profiles_request.rb | 14 + .../bookings/team_member_profiles/client.rb | 42 + .../types/get_team_member_profiles_request.rb | 13 + .../list_team_member_profiles_request.rb | 16 + .../types/bulk_retrieve_bookings_request.rb | 11 + ...ve_team_member_booking_profiles_request.rb | 11 + .../bookings/types/cancel_booking_request.rb | 13 + .../bookings/types/create_booking_request.rb | 12 + .../bookings/types/get_bookings_request.rb | 11 + .../bookings/types/list_bookings_request.rb | 17 + ...trieve_location_booking_profile_request.rb | 11 + .../types/search_availability_request.rb | 11 + .../bookings/types/update_booking_request.rb | 13 + lib/square/cards/client.rb | 68 + lib/square/cards/types/create_card_request.rb | 14 + .../cards/types/disable_cards_request.rb | 11 + lib/square/cards/types/get_cards_request.rb | 11 + lib/square/cards/types/list_cards_request.rb | 15 + lib/square/cash_drawers/client.rb | 14 + lib/square/cash_drawers/shifts/client.rb | 57 + .../shifts/types/get_shifts_request.rb | 14 + .../types/list_events_shifts_request.rb | 16 + .../shifts/types/list_shifts_request.rb | 18 + lib/square/catalog/client.rb | 191 ++ lib/square/catalog/images/client.rb | 50 + .../images/types/create_images_request.rb | 10 + .../images/types/update_images_request.rb | 13 + lib/square/catalog/object/client.rb | 74 + .../object/types/delete_object_request.rb | 13 + .../object/types/get_object_request.rb | 16 + .../types/upsert_catalog_object_request.rb | 14 + .../batch_delete_catalog_objects_request.rb | 11 + .../batch_get_catalog_objects_request.rb | 15 + .../batch_upsert_catalog_objects_request.rb | 12 + .../catalog/types/list_catalog_request.rb | 13 + .../types/search_catalog_items_request.rb | 20 + .../types/search_catalog_objects_request.rb | 18 + .../update_item_modifier_lists_request.rb | 13 + .../types/update_item_taxes_request.rb | 13 + lib/square/checkout/client.rb | 66 + lib/square/checkout/payment_links/client.rb | 83 + .../types/create_payment_link_request.rb | 19 + .../types/delete_payment_links_request.rb | 13 + .../types/get_payment_links_request.rb | 13 + .../types/list_payment_links_request.rb | 14 + .../types/update_payment_link_request.rb | 14 + .../retrieve_location_settings_request.rb | 11 + .../types/update_location_settings_request.rb | 12 + .../types/update_merchant_settings_request.rb | 11 + lib/square/client.rb | 152 ++ lib/square/customers/cards/client.rb | 46 + .../types/create_customer_card_request.rb | 17 + .../cards/types/delete_cards_request.rb | 14 + lib/square/customers/client.rb | 186 ++ .../custom_attribute_definitions/client.rb | 137 ++ ...sert_customer_custom_attributes_request.rb | 13 + ...mer_custom_attribute_definition_request.rb | 14 + ...te_custom_attribute_definitions_request.rb | 13 + ...et_custom_attribute_definitions_request.rb | 14 + ...st_custom_attribute_definitions_request.rb | 14 + ...mer_custom_attribute_definition_request.rb | 15 + .../customers/custom_attributes/client.rb | 94 + .../types/delete_custom_attributes_request.rb | 14 + .../types/get_custom_attributes_request.rb | 16 + .../types/list_custom_attributes_request.rb | 16 + ...psert_customer_custom_attribute_request.rb | 16 + lib/square/customers/groups/client.rb | 115 ++ .../groups/types/add_groups_request.rb | 14 + .../types/create_customer_group_request.rb | 14 + .../groups/types/delete_groups_request.rb | 13 + .../groups/types/get_groups_request.rb | 13 + .../groups/types/list_groups_request.rb | 14 + .../groups/types/remove_groups_request.rb | 14 + .../types/update_customer_group_request.rb | 14 + lib/square/customers/segments/client.rb | 42 + .../segments/types/get_segments_request.rb | 13 + .../segments/types/list_segments_request.rb | 14 + .../types/bulk_create_customers_request.rb | 11 + .../types/bulk_delete_customers_request.rb | 11 + .../types/bulk_retrieve_customers_request.rb | 11 + .../types/bulk_update_customers_request.rb | 11 + .../types/create_customer_request.rb | 22 + .../types/delete_customers_request.rb | 12 + .../customers/types/get_customers_request.rb | 11 + .../customers/types/list_customers_request.rb | 15 + .../types/search_customers_request.rb | 14 + .../types/update_customer_request.rb | 23 + lib/square/devices/client.rb | 41 + lib/square/devices/codes/client.rb | 56 + .../codes/types/create_device_code_request.rb | 14 + .../devices/codes/types/get_codes_request.rb | 13 + .../devices/codes/types/list_codes_request.rb | 16 + .../devices/types/get_devices_request.rb | 11 + .../devices/types/list_devices_request.rb | 14 + lib/square/disputes/client.rb | 103 + lib/square/disputes/evidence/client.rb | 58 + .../evidence/types/delete_evidence_request.rb | 14 + .../evidence/types/get_evidence_request.rb | 14 + .../evidence/types/list_evidence_request.rb | 14 + .../disputes/types/accept_disputes_request.rb | 11 + .../create_dispute_evidence_text_request.rb | 14 + .../create_evidence_file_disputes_request.rb | 11 + .../disputes/types/get_disputes_request.rb | 11 + .../disputes/types/list_disputes_request.rb | 13 + .../types/submit_evidence_disputes_request.rb | 11 + lib/square/employees/client.rb | 36 + .../employees/types/get_employees_request.rb | 11 + .../employees/types/list_employees_request.rb | 14 + lib/square/environment.rb | 9 + lib/square/events/client.rb | 68 + .../events/types/list_event_types_request.rb | 11 + .../events/types/search_events_request.rb | 13 + lib/square/gift_cards/activities/client.rb | 46 + .../create_gift_card_activity_request.rb | 14 + .../types/list_activities_request.rb | 20 + lib/square/gift_cards/client.rb | 110 ++ .../types/create_gift_card_request.rb | 13 + .../types/get_gift_card_from_gan_request.rb | 11 + .../types/get_gift_card_from_nonce_request.rb | 11 + .../types/get_gift_cards_request.rb | 11 + .../link_customer_to_gift_card_request.rb | 12 + .../types/list_gift_cards_request.rb | 15 + .../unlink_customer_from_gift_card_request.rb | 12 + .../internal/errors/constraint_error.rb | 10 + lib/square/internal/errors/type_error.rb | 10 + lib/square/internal/http/base_request.rb | 31 + lib/square/internal/http/raw_client.rb | 105 ++ lib/square/internal/json/request.rb | 38 + lib/square/internal/json/serializable.rb | 25 + .../internal/multipart/multipart_encoder.rb | 141 ++ .../internal/multipart/multipart_form_data.rb | 78 + .../multipart/multipart_form_data_part.rb | 51 + .../internal/multipart/multipart_request.rb | 37 + lib/square/internal/types/array.rb | 47 + lib/square/internal/types/boolean.rb | 34 + lib/square/internal/types/enum.rb | 48 + lib/square/internal/types/hash.rb | 36 + lib/square/internal/types/model.rb | 192 ++ lib/square/internal/types/model/field.rb | 27 + lib/square/internal/types/type.rb | 35 + lib/square/internal/types/union.rb | 82 + lib/square/internal/types/unknown.rb | 15 + lib/square/internal/types/utils.rb | 100 + lib/square/inventory/client.rb | 245 +++ .../types/changes_inventory_request.rb | 13 + ...ecated_get_adjustment_inventory_request.rb | 11 + ...ed_get_physical_count_inventory_request.rb | 11 + .../types/get_adjustment_inventory_request.rb | 11 + .../inventory/types/get_inventory_request.rb | 13 + .../get_physical_count_inventory_request.rb | 11 + .../types/get_transfer_inventory_request.rb | 11 + lib/square/invoices/client.rb | 185 ++ .../invoices/types/cancel_invoice_request.rb | 12 + .../create_invoice_attachment_request.rb | 11 + .../invoices/types/create_invoice_request.rb | 12 + .../delete_invoice_attachment_request.rb | 12 + .../invoices/types/delete_invoices_request.rb | 12 + .../invoices/types/get_invoices_request.rb | 11 + .../invoices/types/list_invoices_request.rb | 13 + .../invoices/types/publish_invoice_request.rb | 13 + .../invoices/types/search_invoices_request.rb | 13 + .../invoices/types/update_invoice_request.rb | 14 + lib/square/labor/break_types/client.rb | 96 + .../types/create_break_type_request.rb | 14 + .../types/delete_break_types_request.rb | 13 + .../types/get_break_types_request.rb | 13 + .../types/list_break_types_request.rb | 15 + .../types/update_break_type_request.rb | 14 + lib/square/labor/client.rb | 216 +++ lib/square/labor/employee_wages/client.rb | 42 + .../types/get_employee_wages_request.rb | 13 + .../types/list_employee_wages_request.rb | 15 + lib/square/labor/shifts/client.rb | 117 ++ .../shifts/types/create_shift_request.rb | 14 + .../shifts/types/delete_shifts_request.rb | 13 + .../labor/shifts/types/get_shifts_request.rb | 13 + .../shifts/types/search_shifts_request.rb | 15 + .../shifts/types/update_shift_request.rb | 14 + lib/square/labor/team_member_wages/client.rb | 42 + .../types/get_team_member_wages_request.rb | 13 + .../types/list_team_member_wages_request.rb | 15 + .../bulk_publish_scheduled_shifts_request.rb | 12 + .../types/create_scheduled_shift_request.rb | 12 + .../labor/types/create_timecard_request.rb | 12 + .../labor/types/delete_timecard_request.rb | 11 + .../types/publish_scheduled_shift_request.rb | 14 + .../types/retrieve_scheduled_shift_request.rb | 11 + .../labor/types/retrieve_timecard_request.rb | 11 + .../types/search_scheduled_shifts_request.rb | 13 + .../labor/types/search_timecards_request.rb | 13 + .../types/update_scheduled_shift_request.rb | 12 + .../labor/types/update_timecard_request.rb | 12 + lib/square/labor/workweek_configs/client.rb | 42 + .../types/list_workweek_configs_request.rb | 14 + .../types/update_workweek_config_request.rb | 14 + lib/square/locations/client.rb | 93 + .../custom_attribute_definitions/client.rb | 98 + ...ion_custom_attribute_definition_request.rb | 14 + ...te_custom_attribute_definitions_request.rb | 13 + ...et_custom_attribute_definitions_request.rb | 14 + ...st_custom_attribute_definitions_request.rb | 15 + ...ion_custom_attribute_definition_request.rb | 15 + .../locations/custom_attributes/client.rb | 121 ++ ...lete_location_custom_attributes_request.rb | 13 + ...sert_location_custom_attributes_request.rb | 13 + .../types/delete_custom_attributes_request.rb | 14 + .../types/get_custom_attributes_request.rb | 16 + .../types/list_custom_attributes_request.rb | 17 + ...psert_location_custom_attribute_request.rb | 16 + lib/square/locations/transactions/client.rb | 83 + .../types/capture_transactions_request.rb | 14 + .../types/get_transactions_request.rb | 14 + .../types/list_transactions_request.rb | 17 + .../types/void_transactions_request.rb | 14 + .../types/create_checkout_request.rb | 20 + .../types/create_location_request.rb | 11 + .../locations/types/get_locations_request.rb | 11 + .../types/update_location_request.rb | 12 + lib/square/loyalty/accounts/client.rb | 102 + .../accumulate_loyalty_points_request.rb | 16 + .../types/adjust_loyalty_points_request.rb | 16 + .../types/create_loyalty_account_request.rb | 14 + .../accounts/types/get_accounts_request.rb | 13 + .../types/search_loyalty_accounts_request.rb | 15 + lib/square/loyalty/client.rb | 34 + lib/square/loyalty/programs/client.rb | 75 + .../loyalty/programs/promotions/client.rb | 81 + .../types/cancel_promotions_request.rb | 16 + .../types/create_loyalty_promotion_request.rb | 17 + .../types/get_promotions_request.rb | 16 + .../types/list_promotions_request.rb | 18 + .../types/calculate_loyalty_points_request.rb | 16 + .../programs/types/get_programs_request.rb | 13 + lib/square/loyalty/rewards/client.rb | 112 ++ .../types/create_loyalty_reward_request.rb | 14 + .../rewards/types/delete_rewards_request.rb | 13 + .../rewards/types/get_rewards_request.rb | 13 + .../types/redeem_loyalty_reward_request.rb | 15 + .../types/search_loyalty_rewards_request.rb | 15 + .../types/search_loyalty_events_request.rb | 13 + lib/square/merchants/client.rb | 49 + .../custom_attribute_definitions/client.rb | 98 + ...ant_custom_attribute_definition_request.rb | 14 + ...te_custom_attribute_definitions_request.rb | 13 + ...et_custom_attribute_definitions_request.rb | 14 + ...st_custom_attribute_definitions_request.rb | 15 + ...ant_custom_attribute_definition_request.rb | 15 + .../merchants/custom_attributes/client.rb | 121 ++ ...lete_merchant_custom_attributes_request.rb | 13 + ...sert_merchant_custom_attributes_request.rb | 13 + .../types/delete_custom_attributes_request.rb | 14 + .../types/get_custom_attributes_request.rb | 16 + .../types/list_custom_attributes_request.rb | 17 + ...psert_merchant_custom_attribute_request.rb | 16 + .../merchants/types/get_merchants_request.rb | 11 + .../merchants/types/list_merchants_request.rb | 11 + lib/square/mobile/client.rb | 41 + ...reate_mobile_authorization_code_request.rb | 11 + lib/square/o_auth/client.rb | 110 ++ .../o_auth/types/obtain_token_request.rb | 20 + .../o_auth/types/revoke_token_request.rb | 14 + lib/square/orders/client.rb | 173 ++ .../custom_attribute_definitions/client.rb | 98 + ...der_custom_attribute_definition_request.rb | 14 + ...te_custom_attribute_definitions_request.rb | 13 + ...et_custom_attribute_definitions_request.rb | 14 + ...st_custom_attribute_definitions_request.rb | 15 + ...der_custom_attribute_definition_request.rb | 15 + lib/square/orders/custom_attributes/client.rb | 146 ++ ..._delete_order_custom_attributes_request.rb | 13 + ..._upsert_order_custom_attributes_request.rb | 13 + .../types/delete_custom_attributes_request.rb | 14 + .../types/get_custom_attributes_request.rb | 16 + .../types/list_custom_attributes_request.rb | 17 + .../upsert_order_custom_attribute_request.rb | 16 + .../orders/types/batch_get_orders_request.rb | 12 + .../orders/types/calculate_order_request.rb | 12 + .../orders/types/clone_order_request.rb | 13 + lib/square/orders/types/get_orders_request.rb | 11 + lib/square/orders/types/pay_order_request.rb | 14 + .../orders/types/search_orders_request.rb | 15 + .../orders/types/update_order_request.rb | 14 + lib/square/payments/client.rb | 132 ++ ...ncel_payment_by_idempotency_key_request.rb | 11 + .../payments/types/cancel_payments_request.rb | 11 + .../types/complete_payment_request.rb | 12 + .../payments/types/create_payment_request.rb | 35 + .../payments/types/get_payments_request.rb | 11 + .../payments/types/list_payments_request.rb | 25 + .../payments/types/update_payment_request.rb | 13 + lib/square/payouts/client.rb | 57 + .../payouts/types/get_payouts_request.rb | 11 + .../types/list_entries_payouts_request.rb | 14 + .../payouts/types/list_payouts_request.rb | 17 + lib/square/refunds/client.rb | 61 + .../refunds/types/get_refunds_request.rb | 11 + .../refunds/types/list_refunds_request.rb | 21 + .../refunds/types/refund_payment_request.rb | 23 + lib/square/sites/client.rb | 30 + lib/square/snippets/client.rb | 69 + .../snippets/types/delete_snippets_request.rb | 11 + .../snippets/types/get_snippets_request.rb | 11 + .../snippets/types/upsert_snippet_request.rb | 12 + lib/square/subscriptions/client.rb | 196 ++ .../types/bulk_swap_plan_request.rb | 13 + .../types/cancel_subscriptions_request.rb | 11 + .../change_billing_anchor_date_request.rb | 13 + .../types/create_subscription_request.rb | 23 + .../delete_action_subscriptions_request.rb | 12 + .../types/get_subscriptions_request.rb | 12 + .../list_events_subscriptions_request.rb | 13 + .../types/pause_subscription_request.rb | 16 + .../types/resume_subscription_request.rb | 13 + .../types/search_subscriptions_request.rb | 14 + .../subscriptions/types/swap_plan_request.rb | 13 + .../types/update_subscription_request.rb | 12 + lib/square/team/client.rb | 69 + lib/square/team/types/create_job_request.rb | 12 + lib/square/team/types/list_jobs_request.rb | 11 + lib/square/team/types/retrieve_job_request.rb | 11 + lib/square/team/types/update_job_request.rb | 12 + lib/square/team_members/client.rb | 113 ++ .../batch_create_team_members_request.rb | 11 + .../batch_update_team_members_request.rb | 11 + .../types/get_team_members_request.rb | 11 + .../types/search_team_members_request.rb | 13 + .../types/update_team_members_request.rb | 12 + .../team_members/wage_setting/client.rb | 54 + .../types/get_wage_setting_request.rb | 13 + .../types/update_wage_setting_request.rb | 14 + lib/square/terminal/actions/client.rb | 68 + .../actions/types/cancel_actions_request.rb | 13 + .../types/create_terminal_action_request.rb | 14 + .../actions/types/get_actions_request.rb | 13 + .../types/search_terminal_actions_request.rb | 15 + lib/square/terminal/checkouts/client.rb | 69 + .../types/cancel_checkouts_request.rb | 13 + .../types/create_terminal_checkout_request.rb | 14 + .../checkouts/types/get_checkouts_request.rb | 13 + .../search_terminal_checkouts_request.rb | 15 + lib/square/terminal/client.rb | 55 + lib/square/terminal/refunds/client.rb | 68 + .../refunds/types/cancel_refunds_request.rb | 13 + .../types/create_terminal_refund_request.rb | 14 + .../refunds/types/get_refunds_request.rb | 13 + .../types/search_terminal_refunds_request.rb | 15 + .../types/dismiss_terminal_action_request.rb | 11 + .../dismiss_terminal_checkout_request.rb | 11 + .../types/dismiss_terminal_refund_request.rb | 11 + lib/square/types/accept_dispute_response.rb | 12 + lib/square/types/accepted_payment_methods.rb | 13 + .../accumulate_loyalty_points_response.rb | 13 + lib/square/types/ach_details.rb | 13 + lib/square/types/action_cancel_reason.rb | 11 + lib/square/types/activity_type.rb | 66 + .../types/add_group_to_customer_response.rb | 12 + lib/square/types/additional_recipient.rb | 14 + lib/square/types/address.rb | 25 + .../types/adjust_loyalty_points_response.rb | 12 + lib/square/types/afterpay_details.rb | 11 + lib/square/types/application_details.rb | 12 + ...ication_details_external_square_product.rb | 18 + lib/square/types/appointment_segment.rb | 17 + lib/square/types/archived_state.rb | 11 + lib/square/types/availability.rb | 13 + lib/square/types/bank_account.rb | 29 + .../types/bank_account_created_event.rb | 18 + .../types/bank_account_created_event_data.rb | 12 + .../bank_account_created_event_object.rb | 10 + .../types/bank_account_disabled_event.rb | 17 + .../types/bank_account_disabled_event_data.rb | 12 + .../bank_account_disabled_event_object.rb | 10 + .../types/bank_account_payment_details.rb | 18 + lib/square/types/bank_account_status.rb | 11 + lib/square/types/bank_account_type.rb | 13 + .../types/bank_account_verified_event.rb | 17 + .../types/bank_account_verified_event_data.rb | 12 + .../bank_account_verified_event_object.rb | 10 + .../types/batch_change_inventory_request.rb | 12 + .../types/batch_change_inventory_response.rb | 12 + .../batch_create_team_members_response.rb | 12 + .../types/batch_create_vendors_response.rb | 12 + .../batch_delete_catalog_objects_response.rb | 12 + .../batch_get_catalog_objects_response.rb | 12 + .../batch_get_inventory_changes_response.rb | 12 + .../batch_get_inventory_counts_request.rb | 15 + .../batch_get_inventory_counts_response.rb | 12 + lib/square/types/batch_get_orders_response.rb | 13 + .../types/batch_get_vendors_response.rb | 12 + ...atch_retrieve_inventory_changes_request.rb | 17 + .../batch_update_team_members_response.rb | 12 + .../types/batch_update_vendors_response.rb | 12 + .../batch_upsert_catalog_objects_response.rb | 13 + ...ustomer_custom_attribute_upsert_request.rb | 15 + ...ert_customer_custom_attributes_response.rb | 13 + ...stomer_custom_attribute_upsert_response.rb | 13 + lib/square/types/booking.rb | 28 + lib/square/types/booking_booking_source.rb | 12 + lib/square/types/booking_created_event.rb | 18 + .../types/booking_created_event_data.rb | 12 + .../types/booking_created_event_object.rb | 10 + lib/square/types/booking_creator_details.rb | 13 + .../booking_creator_details_creator_type.rb | 10 + ...ttribute_definition_owned_created_event.rb | 17 + ...ttribute_definition_owned_deleted_event.rb | 17 + ...ttribute_definition_owned_updated_event.rb | 17 + ...ribute_definition_visible_created_event.rb | 18 + ...ribute_definition_visible_deleted_event.rb | 18 + ...ribute_definition_visible_updated_event.rb | 18 + ...booking_custom_attribute_delete_request.rb | 13 + ...ooking_custom_attribute_delete_response.rb | 12 + ...ng_custom_attribute_owned_deleted_event.rb | 19 + ...ng_custom_attribute_owned_updated_event.rb | 17 + ...booking_custom_attribute_upsert_request.rb | 15 + ...ooking_custom_attribute_upsert_response.rb | 13 + ..._custom_attribute_visible_deleted_event.rb | 18 + ..._custom_attribute_visible_updated_event.rb | 18 + lib/square/types/booking_status.rb | 14 + lib/square/types/booking_updated_event.rb | 18 + .../types/booking_updated_event_data.rb | 12 + .../types/booking_updated_event_object.rb | 10 + lib/square/types/break_.rb | 17 + lib/square/types/break_type.rb | 19 + lib/square/types/bulk_create_customer_data.rb | 22 + .../types/bulk_create_customers_response.rb | 13 + ...lete_booking_custom_attributes_response.rb | 13 + .../types/bulk_delete_customers_response.rb | 13 + ...ocation_custom_attribute_delete_request.rb | 13 + ...ete_location_custom_attributes_response.rb | 13 + ...cation_custom_attribute_delete_response.rb | 13 + ...erchant_custom_attribute_delete_request.rb | 13 + ...ete_merchant_custom_attributes_response.rb | 13 + ...rchant_custom_attribute_delete_response.rb | 12 + ...ributes_request_delete_custom_attribute.rb | 12 + ...delete_order_custom_attributes_response.rb | 12 + .../bulk_publish_scheduled_shifts_data.rb | 13 + .../bulk_publish_scheduled_shifts_response.rb | 13 + .../types/bulk_retrieve_bookings_response.rb | 12 + .../types/bulk_retrieve_customers_response.rb | 13 + ...e_team_member_booking_profiles_response.rb | 12 + lib/square/types/bulk_swap_plan_response.rb | 13 + lib/square/types/bulk_update_customer_data.rb | 23 + .../types/bulk_update_customers_response.rb | 13 + ...sert_booking_custom_attributes_response.rb | 13 + ...ocation_custom_attribute_upsert_request.rb | 15 + ...ert_location_custom_attributes_response.rb | 13 + ...cation_custom_attribute_upsert_response.rb | 13 + ...erchant_custom_attribute_upsert_request.rb | 15 + ...ert_merchant_custom_attributes_response.rb | 13 + ...rchant_custom_attribute_upsert_response.rb | 13 + ...ributes_request_upsert_custom_attribute.rb | 13 + ...upsert_order_custom_attributes_response.rb | 12 + .../types/business_appointment_settings.rb | 23 + ...ess_appointment_settings_alignment_time.rb | 12 + ...ointment_settings_booking_location_type.rb | 11 + ...ppointment_settings_cancellation_policy.rb | 10 + ...ngs_max_appointments_per_day_limit_type.rb | 10 + lib/square/types/business_booking_profile.rb | 18 + ...business_booking_profile_booking_policy.rb | 10 + ...ooking_profile_customer_timezone_choice.rb | 10 + lib/square/types/business_hours.rb | 11 + lib/square/types/business_hours_period.rb | 13 + lib/square/types/buy_now_pay_later_details.rb | 13 + .../calculate_loyalty_points_response.rb | 13 + lib/square/types/calculate_order_response.rb | 11 + lib/square/types/cancel_booking_response.rb | 11 + lib/square/types/cancel_invoice_response.rb | 12 + .../cancel_loyalty_promotion_response.rb | 13 + ...cel_payment_by_idempotency_key_response.rb | 13 + lib/square/types/cancel_payment_response.rb | 12 + .../types/cancel_subscription_response.rb | 14 + .../types/cancel_terminal_action_response.rb | 11 + .../cancel_terminal_checkout_response.rb | 11 + .../types/cancel_terminal_refund_response.rb | 11 + .../types/capture_transaction_response.rb | 12 + lib/square/types/card.rb | 31 + .../types/card_automatically_updated_event.rb | 16 + .../card_automatically_updated_event_data.rb | 12 + ...card_automatically_updated_event_object.rb | 10 + lib/square/types/card_brand.rb | 22 + lib/square/types/card_co_brand.rb | 11 + lib/square/types/card_created_event.rb | 15 + lib/square/types/card_created_event_data.rb | 12 + lib/square/types/card_created_event_object.rb | 10 + lib/square/types/card_disabled_event.rb | 15 + lib/square/types/card_disabled_event_data.rb | 12 + .../types/card_disabled_event_object.rb | 10 + lib/square/types/card_forgotten_event.rb | 15 + lib/square/types/card_forgotten_event_card.rb | 15 + lib/square/types/card_forgotten_event_data.rb | 12 + .../types/card_forgotten_event_object.rb | 10 + lib/square/types/card_payment_details.rb | 26 + lib/square/types/card_payment_timeline.rb | 13 + lib/square/types/card_prepaid_type.rb | 11 + lib/square/types/card_type.rb | 11 + lib/square/types/card_updated_event.rb | 15 + lib/square/types/card_updated_event_data.rb | 12 + lib/square/types/card_updated_event_object.rb | 10 + lib/square/types/cash_app_details.rb | 13 + lib/square/types/cash_drawer_device.rb | 11 + lib/square/types/cash_drawer_event_type.rb | 17 + lib/square/types/cash_drawer_shift.rb | 34 + lib/square/types/cash_drawer_shift_event.rb | 15 + lib/square/types/cash_drawer_shift_state.rb | 11 + lib/square/types/cash_drawer_shift_summary.rb | 25 + lib/square/types/cash_payment_details.rb | 13 + .../types/catalog_availability_period.rb | 13 + lib/square/types/catalog_category.rb | 21 + lib/square/types/catalog_category_type.rb | 11 + .../catalog_custom_attribute_definition.rb | 26 + ...tom_attribute_definition_app_visibility.rb | 11 + ...stom_attribute_definition_number_config.rb | 10 + ...m_attribute_definition_selection_config.rb | 12 + ...ction_config_custom_attribute_selection.rb | 12 + ..._attribute_definition_seller_visibility.rb | 10 + ...stom_attribute_definition_string_config.rb | 11 + ...atalog_custom_attribute_definition_type.rb | 12 + .../types/catalog_custom_attribute_value.rb | 20 + lib/square/types/catalog_discount.rb | 18 + .../catalog_discount_modify_tax_basis.rb | 10 + lib/square/types/catalog_discount_type.rb | 12 + lib/square/types/catalog_ecom_seo_data.rb | 13 + lib/square/types/catalog_id_mapping.rb | 22 + lib/square/types/catalog_image.rb | 19 + lib/square/types/catalog_info_response.rb | 12 + .../types/catalog_info_response_limits.rb | 20 + lib/square/types/catalog_item.rb | 35 + .../catalog_item_food_and_beverage_details.rb | 13 + ...and_beverage_details_dietary_preference.rb | 13 + ..._preference_standard_dietary_preference.rb | 15 + ...everage_details_dietary_preference_type.rb | 10 + ...em_food_and_beverage_details_ingredient.rb | 13 + ..._details_ingredient_standard_ingredient.rb | 22 + .../types/catalog_item_modifier_list_info.rb | 20 + lib/square/types/catalog_item_option.rb | 15 + .../types/catalog_item_option_for_item.rb | 12 + lib/square/types/catalog_item_option_value.rb | 17 + ...og_item_option_value_for_item_variation.rb | 15 + lib/square/types/catalog_item_product_type.rb | 17 + lib/square/types/catalog_item_variation.rb | 40 + lib/square/types/catalog_measurement_unit.rb | 13 + lib/square/types/catalog_modifier.rb | 18 + lib/square/types/catalog_modifier_list.rb | 28 + .../catalog_modifier_list_modifier_type.rb | 10 + .../catalog_modifier_list_selection_type.rb | 10 + lib/square/types/catalog_modifier_override.rb | 14 + .../catalog_object_availability_period.rb | 21 + lib/square/types/catalog_object_base.rb | 20 + lib/square/types/catalog_object_batch.rb | 11 + lib/square/types/catalog_object_category.rb | 25 + ...alog_object_custom_attribute_definition.rb | 21 + lib/square/types/catalog_object_discount.rb | 21 + lib/square/types/catalog_object_image.rb | 21 + lib/square/types/catalog_object_item.rb | 21 + .../types/catalog_object_item_option.rb | 21 + .../types/catalog_object_item_option_value.rb | 21 + .../types/catalog_object_item_variation.rb | 21 + .../types/catalog_object_measurement_unit.rb | 21 + lib/square/types/catalog_object_modifier.rb | 21 + .../types/catalog_object_modifier_list.rb | 21 + .../types/catalog_object_pricing_rule.rb | 21 + .../types/catalog_object_product_set.rb | 21 + .../catalog_object_quick_amounts_settings.rb | 21 + lib/square/types/catalog_object_reference.rb | 14 + .../types/catalog_object_subscription_plan.rb | 21 + ...alog_object_subscription_plan_variation.rb | 21 + lib/square/types/catalog_object_tax.rb | 21 + .../types/catalog_object_time_period.rb | 21 + lib/square/types/catalog_object_type.rb | 27 + lib/square/types/catalog_pricing_rule.rb | 24 + lib/square/types/catalog_pricing_type.rb | 10 + lib/square/types/catalog_product_set.rb | 21 + lib/square/types/catalog_query.rb | 45 + lib/square/types/catalog_query_exact.rb | 12 + ..._item_variations_for_item_option_values.rb | 11 + .../catalog_query_items_for_item_options.rb | 11 + .../catalog_query_items_for_modifier_list.rb | 11 + .../types/catalog_query_items_for_tax.rb | 11 + lib/square/types/catalog_query_prefix.rb | 12 + lib/square/types/catalog_query_range.rb | 13 + lib/square/types/catalog_query_set.rb | 13 + .../types/catalog_query_sorted_attribute.rb | 13 + lib/square/types/catalog_query_text.rb | 11 + lib/square/types/catalog_quick_amount.rb | 14 + lib/square/types/catalog_quick_amount_type.rb | 10 + .../types/catalog_quick_amounts_settings.rb | 13 + .../catalog_quick_amounts_settings_option.rb | 11 + lib/square/types/catalog_stock_conversion.rb | 15 + lib/square/types/catalog_subscription_plan.rb | 17 + .../catalog_subscription_plan_variation.rb | 17 + lib/square/types/catalog_tax.rb | 17 + lib/square/types/catalog_time_period.rb | 11 + lib/square/types/catalog_v_1_id.rb | 12 + .../types/catalog_version_updated_event.rb | 15 + ...g_version_updated_event_catalog_version.rb | 10 + .../catalog_version_updated_event_data.rb | 11 + .../catalog_version_updated_event_object.rb | 10 + .../types/category_path_to_root_node.rb | 12 + .../change_billing_anchor_date_response.rb | 14 + lib/square/types/change_timing.rb | 10 + .../charge_request_additional_recipient.rb | 14 + lib/square/types/checkout.rb | 21 + .../types/checkout_location_settings.rb | 16 + .../checkout_location_settings_branding.rb | 12 + ...location_settings_branding_button_shape.rb | 11 + ..._location_settings_branding_header_type.rb | 11 + .../checkout_location_settings_coupons.rb | 10 + .../checkout_location_settings_policy.rb | 12 + .../checkout_location_settings_tipping.rb | 14 + .../types/checkout_merchant_settings.rb | 11 + ...ckout_merchant_settings_payment_methods.rb | 13 + ...tings_payment_methods_afterpay_clearpay.rb | 13 + ...ods_afterpay_clearpay_eligibility_range.rb | 12 + ...settings_payment_methods_payment_method.rb | 11 + lib/square/types/checkout_options.rb | 20 + .../types/checkout_options_payment_type.rb | 16 + lib/square/types/clearpay_details.rb | 11 + lib/square/types/clone_order_response.rb | 13 + lib/square/types/collected_data.rb | 10 + lib/square/types/complete_payment_response.rb | 12 + lib/square/types/component.rb | 16 + lib/square/types/component_component_type.rb | 14 + lib/square/types/confirmation_decision.rb | 10 + lib/square/types/confirmation_options.rb | 14 + lib/square/types/coordinates.rb | 12 + lib/square/types/country.rb | 258 +++ ...ng_custom_attribute_definition_response.rb | 13 + lib/square/types/create_booking_response.rb | 11 + .../types/create_break_type_response.rb | 14 + lib/square/types/create_card_response.rb | 16 + .../types/create_catalog_image_request.rb | 13 + .../types/create_catalog_image_response.rb | 11 + lib/square/types/create_checkout_response.rb | 13 + .../types/create_customer_card_response.rb | 15 + ...er_custom_attribute_definition_response.rb | 13 + .../types/create_customer_group_response.rb | 15 + lib/square/types/create_customer_response.rb | 16 + .../types/create_device_code_response.rb | 11 + .../create_dispute_evidence_file_request.rb | 13 + .../create_dispute_evidence_file_response.rb | 12 + .../create_dispute_evidence_text_response.rb | 12 + .../create_gift_card_activity_response.rb | 13 + lib/square/types/create_gift_card_response.rb | 13 + .../create_invoice_attachment_request_data.rb | 12 + .../create_invoice_attachment_response.rb | 12 + lib/square/types/create_invoice_response.rb | 12 + lib/square/types/create_job_response.rb | 13 + ...on_custom_attribute_definition_response.rb | 13 + lib/square/types/create_location_response.rb | 12 + .../types/create_loyalty_account_response.rb | 12 + .../create_loyalty_promotion_response.rb | 13 + .../types/create_loyalty_reward_response.rb | 12 + ...nt_custom_attribute_definition_response.rb | 13 + ...eate_mobile_authorization_code_response.rb | 14 + ...er_custom_attribute_definition_response.rb | 12 + lib/square/types/create_order_request.rb | 11 + lib/square/types/create_order_response.rb | 15 + .../types/create_payment_link_response.rb | 12 + lib/square/types/create_payment_response.rb | 15 + .../types/create_scheduled_shift_response.rb | 13 + lib/square/types/create_shift_response.rb | 14 + .../types/create_subscription_response.rb | 13 + .../types/create_team_member_request.rb | 12 + .../types/create_team_member_response.rb | 12 + .../types/create_terminal_action_response.rb | 11 + .../create_terminal_checkout_response.rb | 11 + .../types/create_terminal_refund_response.rb | 11 + lib/square/types/create_timecard_response.rb | 14 + lib/square/types/create_vendor_response.rb | 12 + .../create_webhook_subscription_response.rb | 16 + lib/square/types/currency.rb | 191 ++ lib/square/types/custom_attribute.rb | 18 + .../types/custom_attribute_definition.rb | 19 + .../custom_attribute_definition_event_data.rb | 14 + ..._attribute_definition_event_data_object.rb | 10 + .../custom_attribute_definition_visibility.rb | 11 + .../types/custom_attribute_event_data.rb | 12 + .../custom_attribute_event_data_object.rb | 10 + lib/square/types/custom_attribute_filter.rb | 18 + lib/square/types/custom_field.rb | 13 + lib/square/types/customer.rb | 29 + lib/square/types/customer_address_filter.rb | 13 + lib/square/types/customer_created_event.rb | 18 + .../types/customer_created_event_data.rb | 13 + .../customer_created_event_event_context.rb | 11 + ...tomer_created_event_event_context_merge.rb | 12 + .../types/customer_created_event_object.rb | 12 + lib/square/types/customer_creation_source.rb | 27 + .../types/customer_creation_source_filter.rb | 15 + ...stom_attribute_definition_created_event.rb | 19 + ...tribute_definition_created_public_event.rb | 21 + ...stom_attribute_definition_deleted_event.rb | 20 + ...tribute_definition_deleted_public_event.rb | 21 + ...ttribute_definition_owned_created_event.rb | 16 + ...ttribute_definition_owned_deleted_event.rb | 17 + ...ttribute_definition_owned_updated_event.rb | 17 + ...stom_attribute_definition_updated_event.rb | 20 + ...tribute_definition_updated_public_event.rb | 21 + ...ribute_definition_visible_created_event.rb | 18 + ...ribute_definition_visible_deleted_event.rb | 19 + ...ribute_definition_visible_updated_event.rb | 19 + ...customer_custom_attribute_deleted_event.rb | 21 + ...r_custom_attribute_deleted_public_event.rb | 21 + .../types/customer_custom_attribute_filter.rb | 14 + .../customer_custom_attribute_filter_value.rb | 19 + .../customer_custom_attribute_filters.rb | 13 + ...er_custom_attribute_owned_deleted_event.rb | 18 + ...er_custom_attribute_owned_updated_event.rb | 18 + ...customer_custom_attribute_updated_event.rb | 21 + ...r_custom_attribute_updated_public_event.rb | 21 + ..._custom_attribute_visible_deleted_event.rb | 23 + ..._custom_attribute_visible_updated_event.rb | 23 + lib/square/types/customer_deleted_event.rb | 17 + .../types/customer_deleted_event_data.rb | 13 + .../customer_deleted_event_event_context.rb | 11 + ...tomer_deleted_event_event_context_merge.rb | 12 + .../types/customer_deleted_event_object.rb | 12 + lib/square/types/customer_details.rb | 12 + lib/square/types/customer_filter.rb | 20 + lib/square/types/customer_group.rb | 17 + .../types/customer_inclusion_exclusion.rb | 10 + lib/square/types/customer_preferences.rb | 11 + lib/square/types/customer_query.rb | 12 + lib/square/types/customer_segment.rb | 17 + lib/square/types/customer_sort.rb | 13 + lib/square/types/customer_sort_field.rb | 10 + lib/square/types/customer_tax_ids.rb | 12 + lib/square/types/customer_text_filter.rb | 14 + lib/square/types/customer_updated_event.rb | 17 + .../types/customer_updated_event_data.rb | 13 + .../types/customer_updated_event_object.rb | 11 + lib/square/types/data_collection_options.rb | 13 + .../data_collection_options_input_type.rb | 10 + lib/square/types/date_range.rb | 13 + lib/square/types/day_of_week.rb | 15 + ...ng_custom_attribute_definition_response.rb | 12 + ...elete_booking_custom_attribute_response.rb | 12 + .../types/delete_break_type_response.rb | 12 + .../types/delete_catalog_object_response.rb | 12 + .../types/delete_customer_card_response.rb | 12 + ...er_custom_attribute_definition_response.rb | 11 + ...lete_customer_custom_attribute_response.rb | 12 + .../types/delete_customer_group_response.rb | 12 + lib/square/types/delete_customer_response.rb | 12 + .../types/delete_dispute_evidence_response.rb | 11 + .../delete_invoice_attachment_response.rb | 11 + lib/square/types/delete_invoice_response.rb | 11 + ...on_custom_attribute_definition_response.rb | 11 + ...lete_location_custom_attribute_response.rb | 12 + .../types/delete_loyalty_reward_response.rb | 11 + ...nt_custom_attribute_definition_response.rb | 11 + ...lete_merchant_custom_attribute_response.rb | 12 + ...er_custom_attribute_definition_response.rb | 11 + .../delete_order_custom_attribute_response.rb | 11 + .../types/delete_payment_link_response.rb | 12 + lib/square/types/delete_shift_response.rb | 12 + lib/square/types/delete_snippet_response.rb | 11 + .../delete_subscription_action_response.rb | 13 + lib/square/types/delete_timecard_response.rb | 12 + .../delete_webhook_subscription_response.rb | 12 + lib/square/types/destination.rb | 12 + lib/square/types/destination_details.rb | 13 + ...destination_details_card_refund_details.rb | 12 + ...destination_details_cash_refund_details.rb | 12 + ...ination_details_external_refund_details.rb | 13 + lib/square/types/destination_type.rb | 12 + lib/square/types/device.rb | 13 + lib/square/types/device_attributes.rb | 17 + lib/square/types/device_checkout_options.rb | 14 + lib/square/types/device_code.rb | 20 + lib/square/types/device_code_paired_event.rb | 18 + .../types/device_code_paired_event_data.rb | 12 + .../types/device_code_paired_event_object.rb | 10 + lib/square/types/device_code_status.rb | 12 + ...e_component_details_application_details.rb | 13 + ...evice_component_details_battery_details.rb | 11 + ...e_component_details_card_reader_details.rb | 10 + ...vice_component_details_ethernet_details.rb | 11 + ...device_component_details_external_power.rb | 12 + .../device_component_details_measurement.rb | 11 + .../device_component_details_wi_fi_details.rb | 14 + lib/square/types/device_created_event.rb | 15 + lib/square/types/device_created_event_data.rb | 12 + .../types/device_created_event_object.rb | 10 + lib/square/types/device_details.rb | 13 + lib/square/types/device_metadata.rb | 21 + lib/square/types/device_status.rb | 10 + lib/square/types/device_status_category.rb | 11 + lib/square/types/digital_wallet_details.rb | 13 + lib/square/types/disable_card_response.rb | 16 + lib/square/types/disable_events_response.rb | 15 + .../types/dismiss_terminal_action_response.rb | 11 + .../dismiss_terminal_checkout_response.rb | 11 + .../types/dismiss_terminal_refund_response.rb | 11 + lib/square/types/dispute.rb | 26 + lib/square/types/dispute_created_event.rb | 16 + .../types/dispute_created_event_data.rb | 12 + .../types/dispute_created_event_object.rb | 10 + lib/square/types/dispute_evidence.rb | 16 + .../types/dispute_evidence_added_event.rb | 18 + .../dispute_evidence_added_event_data.rb | 12 + .../dispute_evidence_added_event_object.rb | 10 + .../types/dispute_evidence_created_event.rb | 18 + .../dispute_evidence_created_event_data.rb | 12 + .../dispute_evidence_created_event_object.rb | 10 + .../types/dispute_evidence_deleted_event.rb | 18 + .../dispute_evidence_deleted_event_data.rb | 12 + .../dispute_evidence_deleted_event_object.rb | 10 + lib/square/types/dispute_evidence_file.rb | 12 + .../types/dispute_evidence_removed_event.rb | 18 + .../dispute_evidence_removed_event_data.rb | 12 + .../dispute_evidence_removed_event_object.rb | 10 + lib/square/types/dispute_evidence_type.rb | 23 + lib/square/types/dispute_reason.rb | 17 + lib/square/types/dispute_state.rb | 16 + .../types/dispute_state_changed_event.rb | 18 + .../types/dispute_state_changed_event_data.rb | 12 + .../dispute_state_changed_event_object.rb | 10 + .../types/dispute_state_updated_event.rb | 18 + .../types/dispute_state_updated_event_data.rb | 12 + .../dispute_state_updated_event_object.rb | 10 + lib/square/types/disputed_payment.rb | 11 + lib/square/types/ecom_visibility.rb | 12 + lib/square/types/employee.rb | 22 + lib/square/types/employee_status.rb | 10 + lib/square/types/employee_wage.rb | 14 + lib/square/types/enable_events_response.rb | 15 + lib/square/types/error.rb | 16 + lib/square/types/error_category.rb | 16 + lib/square/types/error_code.rb | 161 ++ lib/square/types/event.rb | 15 + lib/square/types/event_data.rb | 13 + lib/square/types/event_metadata.rb | 12 + lib/square/types/event_type_metadata.rb | 13 + lib/square/types/exclude_strategy.rb | 10 + lib/square/types/external_payment_details.rb | 16 + lib/square/types/filter_value.rb | 17 + lib/square/types/float_number_range.rb | 12 + lib/square/types/fulfillment.rb | 21 + .../types/fulfillment_delivery_details.rb | 33 + ...fillment_delivery_details_schedule_type.rb | 10 + .../types/fulfillment_fulfillment_entry.rb | 16 + ...lment_fulfillment_line_item_application.rb | 10 + .../types/fulfillment_pickup_details.rb | 28 + ..._pickup_details_curbside_pickup_details.rb | 12 + ...ulfillment_pickup_details_schedule_type.rb | 10 + lib/square/types/fulfillment_recipient.rb | 15 + .../types/fulfillment_shipment_details.rb | 25 + lib/square/types/fulfillment_state.rb | 14 + lib/square/types/fulfillment_type.rb | 11 + .../get_bank_account_by_v_1_id_response.rb | 12 + lib/square/types/get_bank_account_response.rb | 12 + lib/square/types/get_booking_response.rb | 11 + lib/square/types/get_break_type_response.rb | 14 + .../get_business_booking_profile_response.rb | 11 + lib/square/types/get_card_response.rb | 16 + .../types/get_cash_drawer_shift_response.rb | 11 + .../types/get_catalog_object_response.rb | 12 + ...er_custom_attribute_definition_response.rb | 13 + .../get_customer_custom_attribute_response.rb | 13 + .../types/get_customer_group_response.rb | 15 + lib/square/types/get_customer_response.rb | 15 + .../types/get_customer_segment_response.rb | 14 + lib/square/types/get_device_code_response.rb | 11 + lib/square/types/get_device_response.rb | 11 + .../types/get_dispute_evidence_response.rb | 12 + lib/square/types/get_dispute_response.rb | 12 + lib/square/types/get_employee_response.rb | 11 + .../types/get_employee_wage_response.rb | 14 + .../types/get_gift_card_from_gan_response.rb | 13 + .../get_gift_card_from_nonce_response.rb | 13 + lib/square/types/get_gift_card_response.rb | 13 + .../get_inventory_adjustment_response.rb | 11 + .../types/get_inventory_changes_response.rb | 12 + .../types/get_inventory_count_response.rb | 12 + .../get_inventory_physical_count_response.rb | 11 + .../types/get_inventory_transfer_response.rb | 11 + lib/square/types/get_invoice_response.rb | 12 + lib/square/types/get_location_response.rb | 13 + .../types/get_loyalty_account_response.rb | 12 + .../types/get_loyalty_program_response.rb | 12 + .../types/get_loyalty_promotion_response.rb | 12 + .../types/get_loyalty_reward_response.rb | 12 + lib/square/types/get_merchant_response.rb | 12 + lib/square/types/get_order_response.rb | 11 + lib/square/types/get_payment_link_response.rb | 11 + .../types/get_payment_refund_response.rb | 15 + lib/square/types/get_payment_response.rb | 12 + lib/square/types/get_payout_response.rb | 11 + lib/square/types/get_shift_response.rb | 14 + lib/square/types/get_snippet_response.rb | 12 + lib/square/types/get_subscription_response.rb | 13 + ...et_team_member_booking_profile_response.rb | 11 + lib/square/types/get_team_member_response.rb | 12 + .../types/get_team_member_wage_response.rb | 14 + .../types/get_terminal_action_response.rb | 11 + .../types/get_terminal_checkout_response.rb | 11 + .../types/get_terminal_refund_response.rb | 11 + lib/square/types/get_transaction_response.rb | 15 + lib/square/types/get_vendor_response.rb | 12 + lib/square/types/get_wage_setting_response.rb | 12 + .../get_webhook_subscription_response.rb | 16 + lib/square/types/gift_card.rb | 18 + lib/square/types/gift_card_activity.rb | 34 + .../types/gift_card_activity_activate.rb | 15 + .../gift_card_activity_adjust_decrement.rb | 12 + ...t_card_activity_adjust_decrement_reason.rb | 12 + .../gift_card_activity_adjust_increment.rb | 12 + ...t_card_activity_adjust_increment_reason.rb | 11 + lib/square/types/gift_card_activity_block.rb | 11 + .../types/gift_card_activity_clear_balance.rb | 11 + ...gift_card_activity_clear_balance_reason.rb | 11 + .../types/gift_card_activity_created_event.rb | 15 + .../gift_card_activity_created_event_data.rb | 13 + ...gift_card_activity_created_event_object.rb | 12 + .../types/gift_card_activity_deactivate.rb | 11 + .../gift_card_activity_deactivate_reason.rb | 11 + lib/square/types/gift_card_activity_import.rb | 13 + .../gift_card_activity_import_reversal.rb | 11 + lib/square/types/gift_card_activity_load.rb | 15 + lib/square/types/gift_card_activity_redeem.rb | 14 + .../types/gift_card_activity_redeem_status.rb | 11 + lib/square/types/gift_card_activity_refund.rb | 14 + ...ift_card_activity_transfer_balance_from.rb | 12 + .../gift_card_activity_transfer_balance_to.rb | 12 + lib/square/types/gift_card_activity_type.rb | 23 + .../types/gift_card_activity_unblock.rb | 11 + ..._card_activity_unlinked_activity_refund.rb | 13 + .../types/gift_card_activity_updated_event.rb | 19 + .../gift_card_activity_updated_event_data.rb | 13 + ...gift_card_activity_updated_event_object.rb | 12 + lib/square/types/gift_card_created_event.rb | 15 + .../types/gift_card_created_event_data.rb | 13 + .../types/gift_card_created_event_object.rb | 11 + .../types/gift_card_customer_linked_event.rb | 15 + .../gift_card_customer_linked_event_data.rb | 13 + .../gift_card_customer_linked_event_object.rb | 13 + .../gift_card_customer_unlinked_event.rb | 15 + .../gift_card_customer_unlinked_event_data.rb | 13 + ...ift_card_customer_unlinked_event_object.rb | 13 + lib/square/types/gift_card_gan_source.rb | 10 + lib/square/types/gift_card_status.rb | 12 + lib/square/types/gift_card_type.rb | 10 + lib/square/types/gift_card_updated_event.rb | 16 + .../types/gift_card_updated_event_data.rb | 13 + .../types/gift_card_updated_event_object.rb | 11 + lib/square/types/inventory_adjustment.rb | 30 + .../types/inventory_adjustment_group.rb | 13 + lib/square/types/inventory_alert_type.rb | 10 + lib/square/types/inventory_change.rb | 18 + lib/square/types/inventory_change_type.rb | 11 + lib/square/types/inventory_count.rb | 19 + .../types/inventory_count_updated_event.rb | 16 + .../inventory_count_updated_event_data.rb | 12 + .../inventory_count_updated_event_object.rb | 10 + lib/square/types/inventory_physical_count.rb | 25 + lib/square/types/inventory_state.rb | 24 + lib/square/types/inventory_transfer.rb | 24 + lib/square/types/invoice.rb | 36 + .../types/invoice_accepted_payment_methods.rb | 15 + lib/square/types/invoice_attachment.rb | 17 + .../types/invoice_automatic_payment_source.rb | 11 + lib/square/types/invoice_canceled_event.rb | 15 + .../types/invoice_canceled_event_data.rb | 12 + .../types/invoice_canceled_event_object.rb | 10 + lib/square/types/invoice_created_event.rb | 15 + .../types/invoice_created_event_data.rb | 12 + .../types/invoice_created_event_object.rb | 10 + lib/square/types/invoice_custom_field.rb | 17 + .../types/invoice_custom_field_placement.rb | 10 + lib/square/types/invoice_deleted_event.rb | 15 + .../types/invoice_deleted_event_data.rb | 12 + lib/square/types/invoice_delivery_method.rb | 11 + lib/square/types/invoice_filter.rb | 12 + .../types/invoice_payment_made_event.rb | 16 + .../types/invoice_payment_made_event_data.rb | 12 + .../invoice_payment_made_event_object.rb | 10 + lib/square/types/invoice_payment_reminder.rb | 17 + .../types/invoice_payment_reminder_status.rb | 11 + lib/square/types/invoice_payment_request.rb | 28 + lib/square/types/invoice_published_event.rb | 15 + .../types/invoice_published_event_data.rb | 12 + .../types/invoice_published_event_object.rb | 10 + lib/square/types/invoice_query.rb | 12 + lib/square/types/invoice_recipient.rb | 23 + lib/square/types/invoice_recipient_tax_ids.rb | 13 + lib/square/types/invoice_refunded_event.rb | 16 + .../types/invoice_refunded_event_data.rb | 12 + .../types/invoice_refunded_event_object.rb | 10 + lib/square/types/invoice_request_method.rb | 15 + lib/square/types/invoice_request_type.rb | 11 + .../invoice_scheduled_charge_failed_event.rb | 15 + ...oice_scheduled_charge_failed_event_data.rb | 12 + ...ce_scheduled_charge_failed_event_object.rb | 10 + lib/square/types/invoice_sort.rb | 12 + lib/square/types/invoice_status.rb | 18 + lib/square/types/invoice_updated_event.rb | 15 + .../types/invoice_updated_event_data.rb | 12 + .../types/invoice_updated_event_object.rb | 10 + .../item_variation_location_overrides.rb | 18 + lib/square/types/job.rb | 18 + lib/square/types/job_assignment.rb | 17 + lib/square/types/job_assignment_pay_type.rb | 11 + lib/square/types/job_created_event.rb | 15 + lib/square/types/job_created_event_data.rb | 12 + lib/square/types/job_created_event_object.rb | 10 + lib/square/types/job_updated_event.rb | 15 + lib/square/types/job_updated_event_data.rb | 12 + lib/square/types/job_updated_event_object.rb | 10 + .../labor_scheduled_shift_created_event.rb | 16 + ...abor_scheduled_shift_created_event_data.rb | 12 + ...or_scheduled_shift_created_event_object.rb | 10 + .../labor_scheduled_shift_deleted_event.rb | 16 + ...abor_scheduled_shift_deleted_event_data.rb | 12 + .../labor_scheduled_shift_published_event.rb | 16 + ...or_scheduled_shift_published_event_data.rb | 12 + ..._scheduled_shift_published_event_object.rb | 10 + .../labor_scheduled_shift_updated_event.rb | 16 + ...abor_scheduled_shift_updated_event_data.rb | 12 + ...or_scheduled_shift_updated_event_object.rb | 10 + lib/square/types/labor_shift_created_event.rb | 17 + .../types/labor_shift_created_event_data.rb | 12 + .../types/labor_shift_created_event_object.rb | 10 + lib/square/types/labor_shift_deleted_event.rb | 17 + .../types/labor_shift_deleted_event_data.rb | 12 + lib/square/types/labor_shift_updated_event.rb | 17 + .../types/labor_shift_updated_event_data.rb | 12 + .../types/labor_shift_updated_event_object.rb | 10 + .../types/labor_timecard_created_event.rb | 15 + .../labor_timecard_created_event_data.rb | 12 + .../labor_timecard_created_event_object.rb | 10 + .../types/labor_timecard_deleted_event.rb | 15 + .../labor_timecard_deleted_event_data.rb | 12 + .../types/labor_timecard_updated_event.rb | 15 + .../labor_timecard_updated_event_data.rb | 12 + .../labor_timecard_updated_event_object.rb | 10 + .../link_customer_to_gift_card_response.rb | 13 + .../types/list_bank_accounts_response.rb | 13 + ...g_custom_attribute_definitions_response.rb | 15 + ...list_booking_custom_attributes_response.rb | 15 + lib/square/types/list_bookings_response.rb | 12 + lib/square/types/list_break_types_response.rb | 15 + lib/square/types/list_cards_response.rb | 17 + .../list_cash_drawer_shift_events_response.rb | 12 + .../types/list_cash_drawer_shifts_response.rb | 12 + lib/square/types/list_catalog_response.rb | 12 + ...r_custom_attribute_definitions_response.rb | 15 + ...ist_customer_custom_attributes_response.rb | 15 + .../types/list_customer_groups_response.rb | 16 + .../types/list_customer_segments_response.rb | 15 + lib/square/types/list_customers_response.rb | 17 + .../types/list_device_codes_response.rb | 12 + lib/square/types/list_devices_response.rb | 12 + .../types/list_dispute_evidence_response.rb | 13 + lib/square/types/list_disputes_response.rb | 13 + .../types/list_employee_wages_response.rb | 14 + lib/square/types/list_employees_response.rb | 12 + lib/square/types/list_event_types_response.rb | 17 + .../list_gift_card_activities_response.rb | 14 + lib/square/types/list_gift_cards_response.rb | 14 + lib/square/types/list_invoices_response.rb | 13 + lib/square/types/list_jobs_response.rb | 14 + ...list_location_booking_profiles_response.rb | 12 + ...n_custom_attribute_definitions_response.rb | 15 + ...ist_location_custom_attributes_response.rb | 15 + lib/square/types/list_locations_response.rb | 15 + .../types/list_loyalty_programs_response.rb | 12 + .../types/list_loyalty_promotions_response.rb | 15 + ...t_custom_attribute_definitions_response.rb | 15 + ...ist_merchant_custom_attributes_response.rb | 15 + lib/square/types/list_merchants_response.rb | 13 + ...r_custom_attribute_definitions_response.rb | 13 + .../list_order_custom_attributes_response.rb | 13 + .../types/list_payment_links_response.rb | 12 + ...list_payment_refunds_request_sort_field.rb | 10 + .../types/list_payment_refunds_response.rb | 15 + .../types/list_payments_request_sort_field.rb | 11 + lib/square/types/list_payments_response.rb | 13 + .../types/list_payout_entries_response.rb | 13 + lib/square/types/list_payouts_response.rb | 13 + lib/square/types/list_sites_response.rb | 12 + .../list_subscription_events_response.rb | 14 + ...t_team_member_booking_profiles_response.rb | 12 + .../types/list_team_member_wages_response.rb | 14 + .../types/list_transactions_response.rb | 16 + .../list_webhook_event_types_response.rb | 17 + .../list_webhook_subscriptions_response.rb | 17 + .../types/list_workweek_configs_response.rb | 15 + lib/square/types/location.rb | 37 + lib/square/types/location_booking_profile.rb | 13 + lib/square/types/location_capability.rb | 11 + lib/square/types/location_created_event.rb | 16 + .../types/location_created_event_data.rb | 11 + ...ttribute_definition_owned_created_event.rb | 16 + ...ttribute_definition_owned_deleted_event.rb | 17 + ...ttribute_definition_owned_updated_event.rb | 17 + ...ribute_definition_visible_created_event.rb | 18 + ...ribute_definition_visible_deleted_event.rb | 19 + ...ribute_definition_visible_updated_event.rb | 19 + ...on_custom_attribute_owned_deleted_event.rb | 18 + ...on_custom_attribute_owned_updated_event.rb | 18 + ..._custom_attribute_visible_deleted_event.rb | 23 + ..._custom_attribute_visible_updated_event.rb | 23 + .../types/location_settings_updated_event.rb | 15 + .../location_settings_updated_event_data.rb | 12 + .../location_settings_updated_event_object.rb | 10 + lib/square/types/location_status.rb | 10 + lib/square/types/location_type.rb | 10 + lib/square/types/location_updated_event.rb | 16 + .../types/location_updated_event_data.rb | 11 + lib/square/types/loyalty_account.rb | 21 + .../types/loyalty_account_created_event.rb | 15 + .../loyalty_account_created_event_data.rb | 13 + .../loyalty_account_created_event_object.rb | 10 + .../types/loyalty_account_deleted_event.rb | 15 + .../loyalty_account_deleted_event_data.rb | 13 + .../loyalty_account_deleted_event_object.rb | 10 + ...loyalty_account_expiring_point_deadline.rb | 12 + lib/square/types/loyalty_account_mapping.rb | 16 + .../types/loyalty_account_updated_event.rb | 15 + .../loyalty_account_updated_event_data.rb | 13 + .../loyalty_account_updated_event_object.rb | 10 + lib/square/types/loyalty_event.rb | 25 + .../types/loyalty_event_accumulate_points.rb | 13 + ...yalty_event_accumulate_promotion_points.rb | 14 + .../types/loyalty_event_adjust_points.rb | 13 + .../types/loyalty_event_create_reward.rb | 13 + .../types/loyalty_event_created_event.rb | 15 + .../types/loyalty_event_created_event_data.rb | 13 + .../loyalty_event_created_event_object.rb | 10 + .../types/loyalty_event_date_time_filter.rb | 11 + .../types/loyalty_event_delete_reward.rb | 13 + .../types/loyalty_event_expire_points.rb | 12 + lib/square/types/loyalty_event_filter.rb | 16 + .../types/loyalty_event_location_filter.rb | 11 + .../loyalty_event_loyalty_account_filter.rb | 11 + .../types/loyalty_event_order_filter.rb | 11 + lib/square/types/loyalty_event_other.rb | 12 + lib/square/types/loyalty_event_query.rb | 11 + .../types/loyalty_event_redeem_reward.rb | 13 + lib/square/types/loyalty_event_source.rb | 10 + lib/square/types/loyalty_event_type.rb | 16 + lib/square/types/loyalty_event_type_filter.rb | 11 + lib/square/types/loyalty_program.rb | 21 + .../types/loyalty_program_accrual_rule.rb | 16 + ...alty_program_accrual_rule_category_data.rb | 11 + ...rogram_accrual_rule_item_variation_data.rb | 11 + ...loyalty_program_accrual_rule_spend_data.rb | 14 + .../loyalty_program_accrual_rule_tax_mode.rb | 10 + .../loyalty_program_accrual_rule_type.rb | 12 + ...loyalty_program_accrual_rule_visit_data.rb | 12 + .../types/loyalty_program_created_event.rb | 15 + .../loyalty_program_created_event_data.rb | 13 + .../loyalty_program_created_event_object.rb | 11 + .../loyalty_program_expiration_policy.rb | 11 + .../types/loyalty_program_reward_tier.rb | 15 + lib/square/types/loyalty_program_status.rb | 10 + .../types/loyalty_program_terminology.rb | 12 + .../types/loyalty_program_updated_event.rb | 15 + .../loyalty_program_updated_event_data.rb | 13 + .../loyalty_program_updated_event_object.rb | 11 + lib/square/types/loyalty_promotion.rb | 26 + .../loyalty_promotion_available_time_data.rb | 14 + .../types/loyalty_promotion_created_event.rb | 15 + .../loyalty_promotion_created_event_data.rb | 13 + .../loyalty_promotion_created_event_object.rb | 11 + .../types/loyalty_promotion_incentive.rb | 15 + ...romotion_incentive_points_addition_data.rb | 11 + ...motion_incentive_points_multiplier_data.rb | 12 + .../types/loyalty_promotion_incentive_type.rb | 10 + lib/square/types/loyalty_promotion_status.rb | 12 + .../types/loyalty_promotion_trigger_limit.rb | 16 + ...oyalty_promotion_trigger_limit_interval.rb | 10 + .../types/loyalty_promotion_updated_event.rb | 16 + .../loyalty_promotion_updated_event_data.rb | 13 + .../loyalty_promotion_updated_event_object.rb | 11 + lib/square/types/loyalty_reward.rb | 20 + lib/square/types/loyalty_reward_status.rb | 11 + lib/square/types/measurement_unit.rb | 20 + lib/square/types/measurement_unit_area.rb | 16 + lib/square/types/measurement_unit_custom.rb | 12 + lib/square/types/measurement_unit_length.rb | 16 + lib/square/types/measurement_unit_time.rb | 13 + .../types/measurement_unit_unit_type.rb | 14 + lib/square/types/measurement_unit_volume.rb | 19 + lib/square/types/measurement_unit_weight.rb | 14 + lib/square/types/merchant.rb | 18 + ...ttribute_definition_owned_created_event.rb | 17 + ...ttribute_definition_owned_deleted_event.rb | 17 + ...ttribute_definition_owned_updated_event.rb | 17 + ...ribute_definition_visible_created_event.rb | 18 + ...ribute_definition_visible_deleted_event.rb | 18 + ...ribute_definition_visible_updated_event.rb | 18 + ...nt_custom_attribute_owned_deleted_event.rb | 18 + ...nt_custom_attribute_owned_updated_event.rb | 18 + ..._custom_attribute_visible_deleted_event.rb | 18 + ..._custom_attribute_visible_updated_event.rb | 18 + .../types/merchant_settings_updated_event.rb | 15 + .../merchant_settings_updated_event_data.rb | 12 + .../merchant_settings_updated_event_object.rb | 10 + lib/square/types/merchant_status.rb | 10 + .../types/modifier_location_overrides.rb | 13 + lib/square/types/money.rb | 17 + .../oauth_authorization_revoked_event.rb | 15 + .../oauth_authorization_revoked_event_data.rb | 12 + ...auth_authorization_revoked_event_object.rb | 10 + ...ization_revoked_event_revocation_object.rb | 11 + ...uthorization_revoked_event_revoker_type.rb | 11 + lib/square/types/obtain_token_response.rb | 21 + lib/square/types/offline_payment_details.rb | 11 + lib/square/types/order.rb | 46 + lib/square/types/order_created.rb | 14 + lib/square/types/order_created_event.rb | 18 + lib/square/types/order_created_event_data.rb | 12 + lib/square/types/order_created_object.rb | 10 + ...ttribute_definition_owned_created_event.rb | 15 + ...ttribute_definition_owned_deleted_event.rb | 15 + ...ttribute_definition_owned_updated_event.rb | 15 + ...ribute_definition_visible_created_event.rb | 15 + ...ribute_definition_visible_deleted_event.rb | 15 + ...ribute_definition_visible_updated_event.rb | 15 + ...er_custom_attribute_owned_deleted_event.rb | 15 + ...er_custom_attribute_owned_updated_event.rb | 15 + ..._custom_attribute_visible_deleted_event.rb | 15 + ..._custom_attribute_visible_updated_event.rb | 15 + lib/square/types/order_entry.rb | 14 + ...fillment_delivery_details_schedule_type.rb | 10 + ...lment_fulfillment_line_item_application.rb | 10 + ...ulfillment_pickup_details_schedule_type.rb | 10 + lib/square/types/order_fulfillment_state.rb | 14 + lib/square/types/order_fulfillment_type.rb | 11 + lib/square/types/order_fulfillment_updated.rb | 16 + .../types/order_fulfillment_updated_event.rb | 17 + .../order_fulfillment_updated_event_data.rb | 12 + .../types/order_fulfillment_updated_object.rb | 10 + .../types/order_fulfillment_updated_update.rb | 13 + lib/square/types/order_line_item.rb | 33 + .../types/order_line_item_applied_discount.rb | 18 + .../order_line_item_applied_service_charge.rb | 12 + .../types/order_line_item_applied_tax.rb | 18 + lib/square/types/order_line_item_discount.rb | 27 + .../types/order_line_item_discount_scope.rb | 11 + .../types/order_line_item_discount_type.rb | 13 + lib/square/types/order_line_item_item_type.rb | 11 + lib/square/types/order_line_item_modifier.rb | 18 + .../order_line_item_pricing_blocklists.rb | 14 + ...tem_pricing_blocklists_blocked_discount.rb | 14 + ...ine_item_pricing_blocklists_blocked_tax.rb | 14 + lib/square/types/order_line_item_tax.rb | 24 + lib/square/types/order_line_item_tax_scope.rb | 11 + lib/square/types/order_line_item_tax_type.rb | 11 + lib/square/types/order_money_amounts.rb | 15 + lib/square/types/order_pricing_options.rb | 14 + lib/square/types/order_quantity_unit.rb | 15 + lib/square/types/order_return.rb | 19 + lib/square/types/order_return_discount.rb | 25 + lib/square/types/order_return_line_item.rb | 31 + .../types/order_return_line_item_modifier.rb | 18 + .../types/order_return_service_charge.rb | 25 + lib/square/types/order_return_tax.rb | 23 + lib/square/types/order_return_tip.rb | 14 + lib/square/types/order_reward.rb | 13 + lib/square/types/order_rounding_adjustment.rb | 14 + lib/square/types/order_service_charge.rb | 26 + .../order_service_charge_calculation_phase.rb | 12 + .../types/order_service_charge_scope.rb | 11 + .../order_service_charge_treatment_type.rb | 10 + lib/square/types/order_service_charge_type.rb | 10 + lib/square/types/order_source.rb | 11 + lib/square/types/order_state.rb | 12 + lib/square/types/order_updated.rb | 15 + lib/square/types/order_updated_event.rb | 17 + lib/square/types/order_updated_event_data.rb | 12 + lib/square/types/order_updated_object.rb | 10 + .../types/pause_subscription_response.rb | 14 + lib/square/types/pay_order_response.rb | 13 + lib/square/types/payment.rb | 54 + ..._balance_activity_app_fee_refund_detail.rb | 12 + ...balance_activity_app_fee_revenue_detail.rb | 11 + ...lance_activity_automatic_savings_detail.rb | 11 + ...ivity_automatic_savings_reversed_detail.rb | 11 + .../payment_balance_activity_charge_detail.rb | 10 + ...ent_balance_activity_deposit_fee_detail.rb | 10 + ...ce_activity_deposit_fee_reversed_detail.rb | 10 + ...payment_balance_activity_dispute_detail.rb | 11 + .../payment_balance_activity_fee_detail.rb | 10 + ...balance_activity_free_processing_detail.rb | 10 + ...balance_activity_hold_adjustment_detail.rb | 10 + ...nt_balance_activity_open_dispute_detail.rb | 11 + ...alance_activity_other_adjustment_detail.rb | 10 + .../payment_balance_activity_other_detail.rb | 10 + .../payment_balance_activity_refund_detail.rb | 11 + ...ance_activity_release_adjustment_detail.rb | 10 + ...nt_balance_activity_reserve_hold_detail.rb | 10 + ...balance_activity_reserve_release_detail.rb | 10 + ..._activity_square_capital_payment_detail.rb | 10 + ..._square_capital_reversed_payment_detail.rb | 10 + ...activity_square_payroll_transfer_detail.rb | 10 + ...square_payroll_transfer_reversed_detail.rb | 10 + ...ment_balance_activity_tax_on_fee_detail.rb | 11 + ...balance_activity_third_party_fee_detail.rb | 10 + ..._activity_third_party_fee_refund_detail.rb | 11 + lib/square/types/payment_created_event.rb | 15 + .../types/payment_created_event_data.rb | 12 + .../types/payment_created_event_object.rb | 10 + lib/square/types/payment_link.rb | 20 + .../types/payment_link_related_resources.rb | 11 + lib/square/types/payment_options.rb | 13 + .../types/payment_options_delay_action.rb | 10 + lib/square/types/payment_refund.rb | 27 + lib/square/types/payment_updated_event.rb | 17 + .../types/payment_updated_event_data.rb | 12 + .../types/payment_updated_event_object.rb | 10 + lib/square/types/payout.rb | 23 + lib/square/types/payout_entry.rb | 43 + lib/square/types/payout_failed_event.rb | 16 + lib/square/types/payout_failed_event_data.rb | 12 + .../types/payout_failed_event_object.rb | 10 + lib/square/types/payout_fee.rb | 13 + lib/square/types/payout_fee_type.rb | 10 + lib/square/types/payout_paid_event.rb | 16 + lib/square/types/payout_paid_event_data.rb | 12 + lib/square/types/payout_paid_event_object.rb | 10 + lib/square/types/payout_sent_event.rb | 16 + lib/square/types/payout_sent_event_data.rb | 12 + lib/square/types/payout_sent_event_object.rb | 10 + lib/square/types/payout_status.rb | 11 + lib/square/types/payout_type.rb | 10 + lib/square/types/phase.rb | 14 + lib/square/types/phase_input.rb | 12 + lib/square/types/pre_populated_data.rb | 15 + lib/square/types/processing_fee.rb | 13 + lib/square/types/product.rb | 18 + lib/square/types/publish_invoice_response.rb | 12 + .../types/publish_scheduled_shift_response.rb | 13 + lib/square/types/qr_code_options.rb | 13 + lib/square/types/quick_pay.rb | 15 + lib/square/types/range.rb | 12 + lib/square/types/receipt_options.rb | 13 + .../types/redeem_loyalty_reward_response.rb | 12 + lib/square/types/refund.rb | 20 + lib/square/types/refund_created_event.rb | 15 + lib/square/types/refund_created_event_data.rb | 12 + .../types/refund_created_event_object.rb | 10 + lib/square/types/refund_payment_response.rb | 16 + lib/square/types/refund_status.rb | 12 + lib/square/types/refund_updated_event.rb | 16 + lib/square/types/refund_updated_event_data.rb | 12 + .../types/refund_updated_event_object.rb | 10 + lib/square/types/register_domain_response.rb | 15 + .../types/register_domain_response_status.rb | 10 + .../remove_group_from_customer_response.rb | 13 + .../types/resume_subscription_response.rb | 14 + ...ng_custom_attribute_definition_response.rb | 13 + ...rieve_booking_custom_attribute_response.rb | 13 + lib/square/types/retrieve_job_response.rb | 13 + ...rieve_location_booking_profile_response.rb | 11 + ...on_custom_attribute_definition_response.rb | 13 + ...ieve_location_custom_attribute_response.rb | 13 + .../retrieve_location_settings_response.rb | 11 + ...nt_custom_attribute_definition_response.rb | 13 + ...ieve_merchant_custom_attribute_response.rb | 13 + .../retrieve_merchant_settings_response.rb | 11 + ...er_custom_attribute_definition_response.rb | 12 + ...etrieve_order_custom_attribute_response.rb | 12 + .../retrieve_scheduled_shift_response.rb | 13 + .../types/retrieve_timecard_response.rb | 14 + .../types/retrieve_token_status_response.rb | 16 + lib/square/types/revoke_token_response.rb | 11 + lib/square/types/risk_evaluation.rb | 17 + .../types/risk_evaluation_risk_level.rb | 12 + lib/square/types/save_card_options.rb | 13 + lib/square/types/scheduled_shift.rb | 18 + lib/square/types/scheduled_shift_details.rb | 19 + lib/square/types/scheduled_shift_filter.rb | 18 + ...cheduled_shift_filter_assignment_status.rb | 10 + ...led_shift_filter_scheduled_shift_status.rb | 10 + .../scheduled_shift_notification_audience.rb | 11 + lib/square/types/scheduled_shift_query.rb | 13 + lib/square/types/scheduled_shift_sort.rb | 13 + .../types/scheduled_shift_sort_field.rb | 12 + lib/square/types/scheduled_shift_workday.rb | 14 + .../types/scheduled_shift_workday_matcher.rb | 11 + .../types/search_availability_filter.rb | 14 + lib/square/types/search_availability_query.rb | 11 + .../types/search_availability_response.rb | 11 + ...earch_catalog_items_request_stock_level.rb | 10 + .../types/search_catalog_items_response.rb | 14 + .../types/search_catalog_objects_response.rb | 14 + lib/square/types/search_customers_response.rb | 17 + lib/square/types/search_events_filter.rb | 14 + lib/square/types/search_events_query.rb | 12 + lib/square/types/search_events_response.rb | 18 + lib/square/types/search_events_sort.rb | 12 + lib/square/types/search_invoices_response.rb | 13 + ..._accounts_request_loyalty_account_query.rb | 12 + .../types/search_loyalty_accounts_response.rb | 13 + .../types/search_loyalty_events_response.rb | 14 + ...ty_rewards_request_loyalty_reward_query.rb | 12 + .../types/search_loyalty_rewards_response.rb | 13 + .../types/search_orders_customer_filter.rb | 13 + .../types/search_orders_date_time_filter.rb | 26 + lib/square/types/search_orders_filter.rb | 16 + .../types/search_orders_fulfillment_filter.rb | 12 + lib/square/types/search_orders_query.rb | 12 + lib/square/types/search_orders_response.rb | 15 + lib/square/types/search_orders_sort.rb | 13 + lib/square/types/search_orders_sort_field.rb | 11 + .../types/search_orders_source_filter.rb | 11 + .../types/search_orders_state_filter.rb | 11 + .../types/search_scheduled_shifts_response.rb | 14 + lib/square/types/search_shifts_response.rb | 15 + .../types/search_subscriptions_filter.rb | 14 + .../types/search_subscriptions_query.rb | 11 + .../types/search_subscriptions_response.rb | 14 + .../types/search_team_members_filter.rb | 19 + lib/square/types/search_team_members_query.rb | 11 + .../types/search_team_members_response.rb | 13 + .../types/search_terminal_actions_response.rb | 12 + .../search_terminal_checkouts_response.rb | 12 + .../types/search_terminal_refunds_response.rb | 12 + lib/square/types/search_timecards_response.rb | 15 + .../types/search_vendors_request_filter.rb | 12 + .../types/search_vendors_request_sort.rb | 12 + .../search_vendors_request_sort_field.rb | 10 + lib/square/types/search_vendors_response.rb | 13 + lib/square/types/segment_filter.rb | 12 + lib/square/types/select_option.rb | 11 + lib/square/types/select_options.rb | 13 + lib/square/types/shift.rb | 29 + lib/square/types/shift_filter.rb | 20 + lib/square/types/shift_filter_status.rb | 10 + lib/square/types/shift_query.rb | 14 + lib/square/types/shift_sort.rb | 14 + lib/square/types/shift_sort_field.rb | 12 + lib/square/types/shift_status.rb | 10 + lib/square/types/shift_wage.rb | 16 + lib/square/types/shift_workday.rb | 16 + lib/square/types/shift_workday_matcher.rb | 11 + lib/square/types/shipping_fee.rb | 11 + lib/square/types/signature_image.rb | 11 + lib/square/types/signature_options.rb | 12 + lib/square/types/site.rb | 16 + lib/square/types/snippet.rb | 15 + lib/square/types/sort_order.rb | 10 + lib/square/types/source_application.rb | 13 + lib/square/types/square_account_details.rb | 12 + lib/square/types/standard_unit_description.rb | 13 + .../types/standard_unit_description_group.rb | 12 + lib/square/types/submit_evidence_response.rb | 12 + lib/square/types/subscription.rb | 32 + lib/square/types/subscription_action.rb | 16 + lib/square/types/subscription_action_type.rb | 13 + lib/square/types/subscription_cadence.rb | 21 + .../types/subscription_created_event.rb | 15 + .../types/subscription_created_event_data.rb | 12 + .../subscription_created_event_object.rb | 10 + lib/square/types/subscription_event.rb | 17 + lib/square/types/subscription_event_info.rb | 12 + .../types/subscription_event_info_code.rb | 14 + ...scription_event_subscription_event_type.rb | 15 + lib/square/types/subscription_phase.rb | 16 + lib/square/types/subscription_pricing.rb | 13 + lib/square/types/subscription_pricing_type.rb | 10 + lib/square/types/subscription_source.rb | 11 + lib/square/types/subscription_status.rb | 13 + lib/square/types/subscription_test_result.rb | 16 + .../types/subscription_updated_event.rb | 17 + .../types/subscription_updated_event_data.rb | 12 + .../subscription_updated_event_object.rb | 10 + lib/square/types/swap_plan_response.rb | 14 + lib/square/types/tax_calculation_phase.rb | 10 + lib/square/types/tax_ids.rb | 15 + lib/square/types/tax_inclusion_type.rb | 10 + lib/square/types/team_member.rb | 22 + .../types/team_member_assigned_locations.rb | 12 + ...mber_assigned_locations_assignment_type.rb | 10 + .../types/team_member_booking_profile.rb | 15 + lib/square/types/team_member_created_event.rb | 15 + .../types/team_member_created_event_data.rb | 12 + .../types/team_member_created_event_object.rb | 10 + .../types/team_member_invitation_status.rb | 11 + lib/square/types/team_member_status.rb | 10 + lib/square/types/team_member_updated_event.rb | 15 + .../types/team_member_updated_event_data.rb | 12 + .../types/team_member_updated_event_object.rb | 10 + lib/square/types/team_member_wage.rb | 18 + .../team_member_wage_setting_updated_event.rb | 15 + ..._member_wage_setting_updated_event_data.rb | 12 + ...ember_wage_setting_updated_event_object.rb | 10 + lib/square/types/tender.rb | 27 + .../types/tender_bank_account_details.rb | 14 + .../tender_bank_account_details_status.rb | 11 + .../types/tender_buy_now_pay_later_details.rb | 12 + .../tender_buy_now_pay_later_details_brand.rb | 10 + ...tender_buy_now_pay_later_details_status.rb | 12 + lib/square/types/tender_card_details.rb | 13 + .../types/tender_card_details_entry_method.rb | 13 + .../types/tender_card_details_status.rb | 12 + lib/square/types/tender_cash_details.rb | 12 + .../types/tender_square_account_details.rb | 11 + .../tender_square_account_details_status.rb | 12 + lib/square/types/tender_type.rb | 18 + lib/square/types/terminal_action.rb | 30 + .../types/terminal_action_action_type.rb | 16 + .../types/terminal_action_created_event.rb | 15 + .../terminal_action_created_event_data.rb | 12 + .../terminal_action_created_event_object.rb | 10 + lib/square/types/terminal_action_query.rb | 11 + .../types/terminal_action_query_filter.rb | 13 + .../types/terminal_action_query_sort.rb | 10 + .../types/terminal_action_updated_event.rb | 15 + .../terminal_action_updated_event_data.rb | 12 + .../terminal_action_updated_event_object.rb | 10 + lib/square/types/terminal_checkout.rb | 31 + .../types/terminal_checkout_created_event.rb | 15 + .../terminal_checkout_created_event_data.rb | 12 + .../terminal_checkout_created_event_object.rb | 10 + lib/square/types/terminal_checkout_query.rb | 11 + .../types/terminal_checkout_query_filter.rb | 12 + .../types/terminal_checkout_query_sort.rb | 10 + .../types/terminal_checkout_updated_event.rb | 15 + .../terminal_checkout_updated_event_data.rb | 12 + .../terminal_checkout_updated_event_object.rb | 10 + lib/square/types/terminal_refund.rb | 24 + .../types/terminal_refund_created_event.rb | 15 + .../terminal_refund_created_event_data.rb | 12 + .../terminal_refund_created_event_object.rb | 10 + lib/square/types/terminal_refund_query.rb | 11 + .../types/terminal_refund_query_filter.rb | 12 + .../types/terminal_refund_query_sort.rb | 10 + .../types/terminal_refund_updated_event.rb | 15 + .../terminal_refund_updated_event_data.rb | 12 + .../terminal_refund_updated_event_object.rb | 10 + .../test_webhook_subscription_response.rb | 16 + lib/square/types/time_range.rb | 16 + lib/square/types/timecard.rb | 25 + lib/square/types/timecard_filter.rb | 17 + lib/square/types/timecard_filter_status.rb | 10 + lib/square/types/timecard_query.rb | 12 + lib/square/types/timecard_sort.rb | 12 + lib/square/types/timecard_sort_field.rb | 12 + lib/square/types/timecard_status.rb | 10 + lib/square/types/timecard_wage.rb | 14 + lib/square/types/timecard_workday.rb | 14 + lib/square/types/timecard_workday_matcher.rb | 11 + lib/square/types/tip_settings.rb | 14 + lib/square/types/transaction.rb | 24 + lib/square/types/transaction_product.rb | 16 + lib/square/types/transaction_type.rb | 10 + ...unlink_customer_from_gift_card_response.rb | 13 + ...ng_custom_attribute_definition_response.rb | 13 + lib/square/types/update_booking_response.rb | 11 + .../types/update_break_type_response.rb | 14 + .../types/update_catalog_image_request.rb | 10 + .../types/update_catalog_image_response.rb | 11 + ...er_custom_attribute_definition_response.rb | 13 + .../types/update_customer_group_response.rb | 15 + lib/square/types/update_customer_response.rb | 16 + lib/square/types/update_invoice_response.rb | 12 + .../update_item_modifier_lists_response.rb | 11 + .../types/update_item_taxes_response.rb | 11 + lib/square/types/update_job_response.rb | 13 + ...on_custom_attribute_definition_response.rb | 13 + lib/square/types/update_location_response.rb | 12 + .../update_location_settings_response.rb | 11 + ...nt_custom_attribute_definition_response.rb | 13 + .../update_merchant_settings_response.rb | 11 + ...er_custom_attribute_definition_response.rb | 12 + lib/square/types/update_order_response.rb | 13 + .../types/update_payment_link_response.rb | 11 + lib/square/types/update_payment_response.rb | 13 + .../types/update_scheduled_shift_response.rb | 13 + lib/square/types/update_shift_response.rb | 14 + .../types/update_subscription_response.rb | 13 + .../types/update_team_member_request.rb | 11 + .../types/update_team_member_response.rb | 12 + lib/square/types/update_timecard_response.rb | 14 + lib/square/types/update_vendor_request.rb | 12 + lib/square/types/update_vendor_response.rb | 12 + .../types/update_wage_setting_response.rb | 13 + .../update_webhook_subscription_response.rb | 16 + ...ook_subscription_signature_key_response.rb | 16 + .../types/update_workweek_config_response.rb | 14 + ...psert_booking_custom_attribute_response.rb | 13 + .../types/upsert_catalog_object_response.rb | 12 + ...sert_customer_custom_attribute_response.rb | 13 + ...sert_location_custom_attribute_response.rb | 13 + ...sert_merchant_custom_attribute_response.rb | 13 + .../upsert_order_custom_attribute_response.rb | 12 + lib/square/types/upsert_snippet_response.rb | 12 + lib/square/types/v_1_money.rb | 11 + lib/square/types/v_1_order.rb | 35 + lib/square/types/v_1_order_history_entry.rb | 12 + .../types/v_1_order_history_entry_action.rb | 15 + lib/square/types/v_1_order_state.rb | 14 + lib/square/types/v_1_tender.rb | 47 + lib/square/types/v_1_tender_card_brand.rb | 17 + lib/square/types/v_1_tender_entry_method.rb | 15 + lib/square/types/v_1_tender_type.rb | 16 + .../types/v_1_update_order_request_action.rb | 11 + lib/square/types/vendor.rb | 20 + lib/square/types/vendor_contact.rb | 16 + lib/square/types/vendor_created_event.rb | 16 + lib/square/types/vendor_created_event_data.rb | 13 + .../types/vendor_created_event_object.rb | 11 + lib/square/types/vendor_status.rb | 10 + lib/square/types/vendor_updated_event.rb | 16 + lib/square/types/vendor_updated_event_data.rb | 13 + .../types/vendor_updated_event_object.rb | 11 + lib/square/types/visibility_filter.rb | 11 + lib/square/types/void_transaction_response.rb | 12 + lib/square/types/wage_setting.rb | 17 + lib/square/types/webhook_subscription.rb | 20 + lib/square/types/weekday.rb | 15 + lib/square/types/workweek_config.rb | 17 + lib/square/v_1_transactions/client.rb | 53 + .../types/v_1_list_orders_request.rb | 14 + .../types/v_1_retrieve_order_request.rb | 12 + .../types/v_1_update_order_request.rb | 17 + lib/square/vendors/client.rb | 105 ++ .../types/batch_create_vendors_request.rb | 11 + .../types/batch_get_vendors_request.rb | 11 + .../types/batch_update_vendors_request.rb | 11 + .../vendors/types/create_vendor_request.rb | 12 + .../vendors/types/get_vendors_request.rb | 11 + .../vendors/types/search_vendors_request.rb | 13 + .../vendors/types/update_vendors_request.rb | 12 + lib/square/webhooks/client.rb | 14 + lib/square/webhooks/event_types/client.rb | 29 + .../types/list_event_types_request.rb | 13 + lib/square/webhooks/subscriptions/client.rb | 107 ++ .../create_webhook_subscription_request.rb | 14 + .../types/delete_subscriptions_request.rb | 13 + .../types/get_subscriptions_request.rb | 13 + .../types/list_subscriptions_request.rb | 16 + .../test_webhook_subscription_request.rb | 14 + .../update_webhook_subscription_request.rb | 14 + ...hook_subscription_signature_key_request.rb | 14 + test/integration/helpers.rb | 115 ++ test/integration/integration_test_base.rb | 16 + test/integration/test_cash_drawers.rb | 22 + test/integration/test_catalog_serial.rb | 368 ++++ test/integration/test_client_utils.rb | 30 + test/integration/test_customer_groups.rb | 89 + test/integration/test_customer_segments.rb | 25 + test/integration/test_devices.rb | 42 + test/integration/test_legacy.rb | 15 + test/integration/test_locations.rb | 15 + test/integration/test_merchants.rb | 25 + test/integration/test_mobile_authorization.rb | 17 + test/integration/test_orders.rb | 130 ++ test/integration/test_payments.rb | 114 ++ test/integration/test_refunds.rb | 84 + test/integration/test_teams.rb | 84 + test/integration/test_terminal.rb | 64 + test/integration/testdata/image.jpeg | Bin 0 -> 53611 bytes 1684 files changed, 33192 insertions(+), 40 deletions(-) create mode 100644 lib/square.rb create mode 100644 lib/square/apple_pay/client.rb create mode 100644 lib/square/apple_pay/types/register_domain_request.rb create mode 100644 lib/square/bank_accounts/client.rb create mode 100644 lib/square/bank_accounts/types/get_bank_accounts_request.rb create mode 100644 lib/square/bank_accounts/types/get_by_v_1_id_bank_accounts_request.rb create mode 100644 lib/square/bank_accounts/types/list_bank_accounts_request.rb create mode 100644 lib/square/bookings/client.rb create mode 100644 lib/square/bookings/custom_attribute_definitions/client.rb create mode 100644 lib/square/bookings/custom_attribute_definitions/types/create_booking_custom_attribute_definition_request.rb create mode 100644 lib/square/bookings/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb create mode 100644 lib/square/bookings/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb create mode 100644 lib/square/bookings/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb create mode 100644 lib/square/bookings/custom_attribute_definitions/types/update_booking_custom_attribute_definition_request.rb create mode 100644 lib/square/bookings/custom_attributes/client.rb create mode 100644 lib/square/bookings/custom_attributes/types/bulk_delete_booking_custom_attributes_request.rb create mode 100644 lib/square/bookings/custom_attributes/types/bulk_upsert_booking_custom_attributes_request.rb create mode 100644 lib/square/bookings/custom_attributes/types/delete_custom_attributes_request.rb create mode 100644 lib/square/bookings/custom_attributes/types/get_custom_attributes_request.rb create mode 100644 lib/square/bookings/custom_attributes/types/list_custom_attributes_request.rb create mode 100644 lib/square/bookings/custom_attributes/types/upsert_booking_custom_attribute_request.rb create mode 100644 lib/square/bookings/location_profiles/client.rb create mode 100644 lib/square/bookings/location_profiles/types/list_location_profiles_request.rb create mode 100644 lib/square/bookings/team_member_profiles/client.rb create mode 100644 lib/square/bookings/team_member_profiles/types/get_team_member_profiles_request.rb create mode 100644 lib/square/bookings/team_member_profiles/types/list_team_member_profiles_request.rb create mode 100644 lib/square/bookings/types/bulk_retrieve_bookings_request.rb create mode 100644 lib/square/bookings/types/bulk_retrieve_team_member_booking_profiles_request.rb create mode 100644 lib/square/bookings/types/cancel_booking_request.rb create mode 100644 lib/square/bookings/types/create_booking_request.rb create mode 100644 lib/square/bookings/types/get_bookings_request.rb create mode 100644 lib/square/bookings/types/list_bookings_request.rb create mode 100644 lib/square/bookings/types/retrieve_location_booking_profile_request.rb create mode 100644 lib/square/bookings/types/search_availability_request.rb create mode 100644 lib/square/bookings/types/update_booking_request.rb create mode 100644 lib/square/cards/client.rb create mode 100644 lib/square/cards/types/create_card_request.rb create mode 100644 lib/square/cards/types/disable_cards_request.rb create mode 100644 lib/square/cards/types/get_cards_request.rb create mode 100644 lib/square/cards/types/list_cards_request.rb create mode 100644 lib/square/cash_drawers/client.rb create mode 100644 lib/square/cash_drawers/shifts/client.rb create mode 100644 lib/square/cash_drawers/shifts/types/get_shifts_request.rb create mode 100644 lib/square/cash_drawers/shifts/types/list_events_shifts_request.rb create mode 100644 lib/square/cash_drawers/shifts/types/list_shifts_request.rb create mode 100644 lib/square/catalog/client.rb create mode 100644 lib/square/catalog/images/client.rb create mode 100644 lib/square/catalog/images/types/create_images_request.rb create mode 100644 lib/square/catalog/images/types/update_images_request.rb create mode 100644 lib/square/catalog/object/client.rb create mode 100644 lib/square/catalog/object/types/delete_object_request.rb create mode 100644 lib/square/catalog/object/types/get_object_request.rb create mode 100644 lib/square/catalog/object/types/upsert_catalog_object_request.rb create mode 100644 lib/square/catalog/types/batch_delete_catalog_objects_request.rb create mode 100644 lib/square/catalog/types/batch_get_catalog_objects_request.rb create mode 100644 lib/square/catalog/types/batch_upsert_catalog_objects_request.rb create mode 100644 lib/square/catalog/types/list_catalog_request.rb create mode 100644 lib/square/catalog/types/search_catalog_items_request.rb create mode 100644 lib/square/catalog/types/search_catalog_objects_request.rb create mode 100644 lib/square/catalog/types/update_item_modifier_lists_request.rb create mode 100644 lib/square/catalog/types/update_item_taxes_request.rb create mode 100644 lib/square/checkout/client.rb create mode 100644 lib/square/checkout/payment_links/client.rb create mode 100644 lib/square/checkout/payment_links/types/create_payment_link_request.rb create mode 100644 lib/square/checkout/payment_links/types/delete_payment_links_request.rb create mode 100644 lib/square/checkout/payment_links/types/get_payment_links_request.rb create mode 100644 lib/square/checkout/payment_links/types/list_payment_links_request.rb create mode 100644 lib/square/checkout/payment_links/types/update_payment_link_request.rb create mode 100644 lib/square/checkout/types/retrieve_location_settings_request.rb create mode 100644 lib/square/checkout/types/update_location_settings_request.rb create mode 100644 lib/square/checkout/types/update_merchant_settings_request.rb create mode 100644 lib/square/client.rb create mode 100644 lib/square/customers/cards/client.rb create mode 100644 lib/square/customers/cards/types/create_customer_card_request.rb create mode 100644 lib/square/customers/cards/types/delete_cards_request.rb create mode 100644 lib/square/customers/client.rb create mode 100644 lib/square/customers/custom_attribute_definitions/client.rb create mode 100644 lib/square/customers/custom_attribute_definitions/types/batch_upsert_customer_custom_attributes_request.rb create mode 100644 lib/square/customers/custom_attribute_definitions/types/create_customer_custom_attribute_definition_request.rb create mode 100644 lib/square/customers/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb create mode 100644 lib/square/customers/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb create mode 100644 lib/square/customers/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb create mode 100644 lib/square/customers/custom_attribute_definitions/types/update_customer_custom_attribute_definition_request.rb create mode 100644 lib/square/customers/custom_attributes/client.rb create mode 100644 lib/square/customers/custom_attributes/types/delete_custom_attributes_request.rb create mode 100644 lib/square/customers/custom_attributes/types/get_custom_attributes_request.rb create mode 100644 lib/square/customers/custom_attributes/types/list_custom_attributes_request.rb create mode 100644 lib/square/customers/custom_attributes/types/upsert_customer_custom_attribute_request.rb create mode 100644 lib/square/customers/groups/client.rb create mode 100644 lib/square/customers/groups/types/add_groups_request.rb create mode 100644 lib/square/customers/groups/types/create_customer_group_request.rb create mode 100644 lib/square/customers/groups/types/delete_groups_request.rb create mode 100644 lib/square/customers/groups/types/get_groups_request.rb create mode 100644 lib/square/customers/groups/types/list_groups_request.rb create mode 100644 lib/square/customers/groups/types/remove_groups_request.rb create mode 100644 lib/square/customers/groups/types/update_customer_group_request.rb create mode 100644 lib/square/customers/segments/client.rb create mode 100644 lib/square/customers/segments/types/get_segments_request.rb create mode 100644 lib/square/customers/segments/types/list_segments_request.rb create mode 100644 lib/square/customers/types/bulk_create_customers_request.rb create mode 100644 lib/square/customers/types/bulk_delete_customers_request.rb create mode 100644 lib/square/customers/types/bulk_retrieve_customers_request.rb create mode 100644 lib/square/customers/types/bulk_update_customers_request.rb create mode 100644 lib/square/customers/types/create_customer_request.rb create mode 100644 lib/square/customers/types/delete_customers_request.rb create mode 100644 lib/square/customers/types/get_customers_request.rb create mode 100644 lib/square/customers/types/list_customers_request.rb create mode 100644 lib/square/customers/types/search_customers_request.rb create mode 100644 lib/square/customers/types/update_customer_request.rb create mode 100644 lib/square/devices/client.rb create mode 100644 lib/square/devices/codes/client.rb create mode 100644 lib/square/devices/codes/types/create_device_code_request.rb create mode 100644 lib/square/devices/codes/types/get_codes_request.rb create mode 100644 lib/square/devices/codes/types/list_codes_request.rb create mode 100644 lib/square/devices/types/get_devices_request.rb create mode 100644 lib/square/devices/types/list_devices_request.rb create mode 100644 lib/square/disputes/client.rb create mode 100644 lib/square/disputes/evidence/client.rb create mode 100644 lib/square/disputes/evidence/types/delete_evidence_request.rb create mode 100644 lib/square/disputes/evidence/types/get_evidence_request.rb create mode 100644 lib/square/disputes/evidence/types/list_evidence_request.rb create mode 100644 lib/square/disputes/types/accept_disputes_request.rb create mode 100644 lib/square/disputes/types/create_dispute_evidence_text_request.rb create mode 100644 lib/square/disputes/types/create_evidence_file_disputes_request.rb create mode 100644 lib/square/disputes/types/get_disputes_request.rb create mode 100644 lib/square/disputes/types/list_disputes_request.rb create mode 100644 lib/square/disputes/types/submit_evidence_disputes_request.rb create mode 100644 lib/square/employees/client.rb create mode 100644 lib/square/employees/types/get_employees_request.rb create mode 100644 lib/square/employees/types/list_employees_request.rb create mode 100644 lib/square/environment.rb create mode 100644 lib/square/events/client.rb create mode 100644 lib/square/events/types/list_event_types_request.rb create mode 100644 lib/square/events/types/search_events_request.rb create mode 100644 lib/square/gift_cards/activities/client.rb create mode 100644 lib/square/gift_cards/activities/types/create_gift_card_activity_request.rb create mode 100644 lib/square/gift_cards/activities/types/list_activities_request.rb create mode 100644 lib/square/gift_cards/client.rb create mode 100644 lib/square/gift_cards/types/create_gift_card_request.rb create mode 100644 lib/square/gift_cards/types/get_gift_card_from_gan_request.rb create mode 100644 lib/square/gift_cards/types/get_gift_card_from_nonce_request.rb create mode 100644 lib/square/gift_cards/types/get_gift_cards_request.rb create mode 100644 lib/square/gift_cards/types/link_customer_to_gift_card_request.rb create mode 100644 lib/square/gift_cards/types/list_gift_cards_request.rb create mode 100644 lib/square/gift_cards/types/unlink_customer_from_gift_card_request.rb create mode 100644 lib/square/internal/errors/constraint_error.rb create mode 100644 lib/square/internal/errors/type_error.rb create mode 100644 lib/square/internal/http/base_request.rb create mode 100644 lib/square/internal/http/raw_client.rb create mode 100644 lib/square/internal/json/request.rb create mode 100644 lib/square/internal/json/serializable.rb create mode 100644 lib/square/internal/multipart/multipart_encoder.rb create mode 100644 lib/square/internal/multipart/multipart_form_data.rb create mode 100644 lib/square/internal/multipart/multipart_form_data_part.rb create mode 100644 lib/square/internal/multipart/multipart_request.rb create mode 100644 lib/square/internal/types/array.rb create mode 100644 lib/square/internal/types/boolean.rb create mode 100644 lib/square/internal/types/enum.rb create mode 100644 lib/square/internal/types/hash.rb create mode 100644 lib/square/internal/types/model.rb create mode 100644 lib/square/internal/types/model/field.rb create mode 100644 lib/square/internal/types/type.rb create mode 100644 lib/square/internal/types/union.rb create mode 100644 lib/square/internal/types/unknown.rb create mode 100644 lib/square/internal/types/utils.rb create mode 100644 lib/square/inventory/client.rb create mode 100644 lib/square/inventory/types/changes_inventory_request.rb create mode 100644 lib/square/inventory/types/deprecated_get_adjustment_inventory_request.rb create mode 100644 lib/square/inventory/types/deprecated_get_physical_count_inventory_request.rb create mode 100644 lib/square/inventory/types/get_adjustment_inventory_request.rb create mode 100644 lib/square/inventory/types/get_inventory_request.rb create mode 100644 lib/square/inventory/types/get_physical_count_inventory_request.rb create mode 100644 lib/square/inventory/types/get_transfer_inventory_request.rb create mode 100644 lib/square/invoices/client.rb create mode 100644 lib/square/invoices/types/cancel_invoice_request.rb create mode 100644 lib/square/invoices/types/create_invoice_attachment_request.rb create mode 100644 lib/square/invoices/types/create_invoice_request.rb create mode 100644 lib/square/invoices/types/delete_invoice_attachment_request.rb create mode 100644 lib/square/invoices/types/delete_invoices_request.rb create mode 100644 lib/square/invoices/types/get_invoices_request.rb create mode 100644 lib/square/invoices/types/list_invoices_request.rb create mode 100644 lib/square/invoices/types/publish_invoice_request.rb create mode 100644 lib/square/invoices/types/search_invoices_request.rb create mode 100644 lib/square/invoices/types/update_invoice_request.rb create mode 100644 lib/square/labor/break_types/client.rb create mode 100644 lib/square/labor/break_types/types/create_break_type_request.rb create mode 100644 lib/square/labor/break_types/types/delete_break_types_request.rb create mode 100644 lib/square/labor/break_types/types/get_break_types_request.rb create mode 100644 lib/square/labor/break_types/types/list_break_types_request.rb create mode 100644 lib/square/labor/break_types/types/update_break_type_request.rb create mode 100644 lib/square/labor/client.rb create mode 100644 lib/square/labor/employee_wages/client.rb create mode 100644 lib/square/labor/employee_wages/types/get_employee_wages_request.rb create mode 100644 lib/square/labor/employee_wages/types/list_employee_wages_request.rb create mode 100644 lib/square/labor/shifts/client.rb create mode 100644 lib/square/labor/shifts/types/create_shift_request.rb create mode 100644 lib/square/labor/shifts/types/delete_shifts_request.rb create mode 100644 lib/square/labor/shifts/types/get_shifts_request.rb create mode 100644 lib/square/labor/shifts/types/search_shifts_request.rb create mode 100644 lib/square/labor/shifts/types/update_shift_request.rb create mode 100644 lib/square/labor/team_member_wages/client.rb create mode 100644 lib/square/labor/team_member_wages/types/get_team_member_wages_request.rb create mode 100644 lib/square/labor/team_member_wages/types/list_team_member_wages_request.rb create mode 100644 lib/square/labor/types/bulk_publish_scheduled_shifts_request.rb create mode 100644 lib/square/labor/types/create_scheduled_shift_request.rb create mode 100644 lib/square/labor/types/create_timecard_request.rb create mode 100644 lib/square/labor/types/delete_timecard_request.rb create mode 100644 lib/square/labor/types/publish_scheduled_shift_request.rb create mode 100644 lib/square/labor/types/retrieve_scheduled_shift_request.rb create mode 100644 lib/square/labor/types/retrieve_timecard_request.rb create mode 100644 lib/square/labor/types/search_scheduled_shifts_request.rb create mode 100644 lib/square/labor/types/search_timecards_request.rb create mode 100644 lib/square/labor/types/update_scheduled_shift_request.rb create mode 100644 lib/square/labor/types/update_timecard_request.rb create mode 100644 lib/square/labor/workweek_configs/client.rb create mode 100644 lib/square/labor/workweek_configs/types/list_workweek_configs_request.rb create mode 100644 lib/square/labor/workweek_configs/types/update_workweek_config_request.rb create mode 100644 lib/square/locations/client.rb create mode 100644 lib/square/locations/custom_attribute_definitions/client.rb create mode 100644 lib/square/locations/custom_attribute_definitions/types/create_location_custom_attribute_definition_request.rb create mode 100644 lib/square/locations/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb create mode 100644 lib/square/locations/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb create mode 100644 lib/square/locations/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb create mode 100644 lib/square/locations/custom_attribute_definitions/types/update_location_custom_attribute_definition_request.rb create mode 100644 lib/square/locations/custom_attributes/client.rb create mode 100644 lib/square/locations/custom_attributes/types/bulk_delete_location_custom_attributes_request.rb create mode 100644 lib/square/locations/custom_attributes/types/bulk_upsert_location_custom_attributes_request.rb create mode 100644 lib/square/locations/custom_attributes/types/delete_custom_attributes_request.rb create mode 100644 lib/square/locations/custom_attributes/types/get_custom_attributes_request.rb create mode 100644 lib/square/locations/custom_attributes/types/list_custom_attributes_request.rb create mode 100644 lib/square/locations/custom_attributes/types/upsert_location_custom_attribute_request.rb create mode 100644 lib/square/locations/transactions/client.rb create mode 100644 lib/square/locations/transactions/types/capture_transactions_request.rb create mode 100644 lib/square/locations/transactions/types/get_transactions_request.rb create mode 100644 lib/square/locations/transactions/types/list_transactions_request.rb create mode 100644 lib/square/locations/transactions/types/void_transactions_request.rb create mode 100644 lib/square/locations/types/create_checkout_request.rb create mode 100644 lib/square/locations/types/create_location_request.rb create mode 100644 lib/square/locations/types/get_locations_request.rb create mode 100644 lib/square/locations/types/update_location_request.rb create mode 100644 lib/square/loyalty/accounts/client.rb create mode 100644 lib/square/loyalty/accounts/types/accumulate_loyalty_points_request.rb create mode 100644 lib/square/loyalty/accounts/types/adjust_loyalty_points_request.rb create mode 100644 lib/square/loyalty/accounts/types/create_loyalty_account_request.rb create mode 100644 lib/square/loyalty/accounts/types/get_accounts_request.rb create mode 100644 lib/square/loyalty/accounts/types/search_loyalty_accounts_request.rb create mode 100644 lib/square/loyalty/client.rb create mode 100644 lib/square/loyalty/programs/client.rb create mode 100644 lib/square/loyalty/programs/promotions/client.rb create mode 100644 lib/square/loyalty/programs/promotions/types/cancel_promotions_request.rb create mode 100644 lib/square/loyalty/programs/promotions/types/create_loyalty_promotion_request.rb create mode 100644 lib/square/loyalty/programs/promotions/types/get_promotions_request.rb create mode 100644 lib/square/loyalty/programs/promotions/types/list_promotions_request.rb create mode 100644 lib/square/loyalty/programs/types/calculate_loyalty_points_request.rb create mode 100644 lib/square/loyalty/programs/types/get_programs_request.rb create mode 100644 lib/square/loyalty/rewards/client.rb create mode 100644 lib/square/loyalty/rewards/types/create_loyalty_reward_request.rb create mode 100644 lib/square/loyalty/rewards/types/delete_rewards_request.rb create mode 100644 lib/square/loyalty/rewards/types/get_rewards_request.rb create mode 100644 lib/square/loyalty/rewards/types/redeem_loyalty_reward_request.rb create mode 100644 lib/square/loyalty/rewards/types/search_loyalty_rewards_request.rb create mode 100644 lib/square/loyalty/types/search_loyalty_events_request.rb create mode 100644 lib/square/merchants/client.rb create mode 100644 lib/square/merchants/custom_attribute_definitions/client.rb create mode 100644 lib/square/merchants/custom_attribute_definitions/types/create_merchant_custom_attribute_definition_request.rb create mode 100644 lib/square/merchants/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb create mode 100644 lib/square/merchants/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb create mode 100644 lib/square/merchants/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb create mode 100644 lib/square/merchants/custom_attribute_definitions/types/update_merchant_custom_attribute_definition_request.rb create mode 100644 lib/square/merchants/custom_attributes/client.rb create mode 100644 lib/square/merchants/custom_attributes/types/bulk_delete_merchant_custom_attributes_request.rb create mode 100644 lib/square/merchants/custom_attributes/types/bulk_upsert_merchant_custom_attributes_request.rb create mode 100644 lib/square/merchants/custom_attributes/types/delete_custom_attributes_request.rb create mode 100644 lib/square/merchants/custom_attributes/types/get_custom_attributes_request.rb create mode 100644 lib/square/merchants/custom_attributes/types/list_custom_attributes_request.rb create mode 100644 lib/square/merchants/custom_attributes/types/upsert_merchant_custom_attribute_request.rb create mode 100644 lib/square/merchants/types/get_merchants_request.rb create mode 100644 lib/square/merchants/types/list_merchants_request.rb create mode 100644 lib/square/mobile/client.rb create mode 100644 lib/square/mobile/types/create_mobile_authorization_code_request.rb create mode 100644 lib/square/o_auth/client.rb create mode 100644 lib/square/o_auth/types/obtain_token_request.rb create mode 100644 lib/square/o_auth/types/revoke_token_request.rb create mode 100644 lib/square/orders/client.rb create mode 100644 lib/square/orders/custom_attribute_definitions/client.rb create mode 100644 lib/square/orders/custom_attribute_definitions/types/create_order_custom_attribute_definition_request.rb create mode 100644 lib/square/orders/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb create mode 100644 lib/square/orders/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb create mode 100644 lib/square/orders/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb create mode 100644 lib/square/orders/custom_attribute_definitions/types/update_order_custom_attribute_definition_request.rb create mode 100644 lib/square/orders/custom_attributes/client.rb create mode 100644 lib/square/orders/custom_attributes/types/bulk_delete_order_custom_attributes_request.rb create mode 100644 lib/square/orders/custom_attributes/types/bulk_upsert_order_custom_attributes_request.rb create mode 100644 lib/square/orders/custom_attributes/types/delete_custom_attributes_request.rb create mode 100644 lib/square/orders/custom_attributes/types/get_custom_attributes_request.rb create mode 100644 lib/square/orders/custom_attributes/types/list_custom_attributes_request.rb create mode 100644 lib/square/orders/custom_attributes/types/upsert_order_custom_attribute_request.rb create mode 100644 lib/square/orders/types/batch_get_orders_request.rb create mode 100644 lib/square/orders/types/calculate_order_request.rb create mode 100644 lib/square/orders/types/clone_order_request.rb create mode 100644 lib/square/orders/types/get_orders_request.rb create mode 100644 lib/square/orders/types/pay_order_request.rb create mode 100644 lib/square/orders/types/search_orders_request.rb create mode 100644 lib/square/orders/types/update_order_request.rb create mode 100644 lib/square/payments/client.rb create mode 100644 lib/square/payments/types/cancel_payment_by_idempotency_key_request.rb create mode 100644 lib/square/payments/types/cancel_payments_request.rb create mode 100644 lib/square/payments/types/complete_payment_request.rb create mode 100644 lib/square/payments/types/create_payment_request.rb create mode 100644 lib/square/payments/types/get_payments_request.rb create mode 100644 lib/square/payments/types/list_payments_request.rb create mode 100644 lib/square/payments/types/update_payment_request.rb create mode 100644 lib/square/payouts/client.rb create mode 100644 lib/square/payouts/types/get_payouts_request.rb create mode 100644 lib/square/payouts/types/list_entries_payouts_request.rb create mode 100644 lib/square/payouts/types/list_payouts_request.rb create mode 100644 lib/square/refunds/client.rb create mode 100644 lib/square/refunds/types/get_refunds_request.rb create mode 100644 lib/square/refunds/types/list_refunds_request.rb create mode 100644 lib/square/refunds/types/refund_payment_request.rb create mode 100644 lib/square/sites/client.rb create mode 100644 lib/square/snippets/client.rb create mode 100644 lib/square/snippets/types/delete_snippets_request.rb create mode 100644 lib/square/snippets/types/get_snippets_request.rb create mode 100644 lib/square/snippets/types/upsert_snippet_request.rb create mode 100644 lib/square/subscriptions/client.rb create mode 100644 lib/square/subscriptions/types/bulk_swap_plan_request.rb create mode 100644 lib/square/subscriptions/types/cancel_subscriptions_request.rb create mode 100644 lib/square/subscriptions/types/change_billing_anchor_date_request.rb create mode 100644 lib/square/subscriptions/types/create_subscription_request.rb create mode 100644 lib/square/subscriptions/types/delete_action_subscriptions_request.rb create mode 100644 lib/square/subscriptions/types/get_subscriptions_request.rb create mode 100644 lib/square/subscriptions/types/list_events_subscriptions_request.rb create mode 100644 lib/square/subscriptions/types/pause_subscription_request.rb create mode 100644 lib/square/subscriptions/types/resume_subscription_request.rb create mode 100644 lib/square/subscriptions/types/search_subscriptions_request.rb create mode 100644 lib/square/subscriptions/types/swap_plan_request.rb create mode 100644 lib/square/subscriptions/types/update_subscription_request.rb create mode 100644 lib/square/team/client.rb create mode 100644 lib/square/team/types/create_job_request.rb create mode 100644 lib/square/team/types/list_jobs_request.rb create mode 100644 lib/square/team/types/retrieve_job_request.rb create mode 100644 lib/square/team/types/update_job_request.rb create mode 100644 lib/square/team_members/client.rb create mode 100644 lib/square/team_members/types/batch_create_team_members_request.rb create mode 100644 lib/square/team_members/types/batch_update_team_members_request.rb create mode 100644 lib/square/team_members/types/get_team_members_request.rb create mode 100644 lib/square/team_members/types/search_team_members_request.rb create mode 100644 lib/square/team_members/types/update_team_members_request.rb create mode 100644 lib/square/team_members/wage_setting/client.rb create mode 100644 lib/square/team_members/wage_setting/types/get_wage_setting_request.rb create mode 100644 lib/square/team_members/wage_setting/types/update_wage_setting_request.rb create mode 100644 lib/square/terminal/actions/client.rb create mode 100644 lib/square/terminal/actions/types/cancel_actions_request.rb create mode 100644 lib/square/terminal/actions/types/create_terminal_action_request.rb create mode 100644 lib/square/terminal/actions/types/get_actions_request.rb create mode 100644 lib/square/terminal/actions/types/search_terminal_actions_request.rb create mode 100644 lib/square/terminal/checkouts/client.rb create mode 100644 lib/square/terminal/checkouts/types/cancel_checkouts_request.rb create mode 100644 lib/square/terminal/checkouts/types/create_terminal_checkout_request.rb create mode 100644 lib/square/terminal/checkouts/types/get_checkouts_request.rb create mode 100644 lib/square/terminal/checkouts/types/search_terminal_checkouts_request.rb create mode 100644 lib/square/terminal/client.rb create mode 100644 lib/square/terminal/refunds/client.rb create mode 100644 lib/square/terminal/refunds/types/cancel_refunds_request.rb create mode 100644 lib/square/terminal/refunds/types/create_terminal_refund_request.rb create mode 100644 lib/square/terminal/refunds/types/get_refunds_request.rb create mode 100644 lib/square/terminal/refunds/types/search_terminal_refunds_request.rb create mode 100644 lib/square/terminal/types/dismiss_terminal_action_request.rb create mode 100644 lib/square/terminal/types/dismiss_terminal_checkout_request.rb create mode 100644 lib/square/terminal/types/dismiss_terminal_refund_request.rb create mode 100644 lib/square/types/accept_dispute_response.rb create mode 100644 lib/square/types/accepted_payment_methods.rb create mode 100644 lib/square/types/accumulate_loyalty_points_response.rb create mode 100644 lib/square/types/ach_details.rb create mode 100644 lib/square/types/action_cancel_reason.rb create mode 100644 lib/square/types/activity_type.rb create mode 100644 lib/square/types/add_group_to_customer_response.rb create mode 100644 lib/square/types/additional_recipient.rb create mode 100644 lib/square/types/address.rb create mode 100644 lib/square/types/adjust_loyalty_points_response.rb create mode 100644 lib/square/types/afterpay_details.rb create mode 100644 lib/square/types/application_details.rb create mode 100644 lib/square/types/application_details_external_square_product.rb create mode 100644 lib/square/types/appointment_segment.rb create mode 100644 lib/square/types/archived_state.rb create mode 100644 lib/square/types/availability.rb create mode 100644 lib/square/types/bank_account.rb create mode 100644 lib/square/types/bank_account_created_event.rb create mode 100644 lib/square/types/bank_account_created_event_data.rb create mode 100644 lib/square/types/bank_account_created_event_object.rb create mode 100644 lib/square/types/bank_account_disabled_event.rb create mode 100644 lib/square/types/bank_account_disabled_event_data.rb create mode 100644 lib/square/types/bank_account_disabled_event_object.rb create mode 100644 lib/square/types/bank_account_payment_details.rb create mode 100644 lib/square/types/bank_account_status.rb create mode 100644 lib/square/types/bank_account_type.rb create mode 100644 lib/square/types/bank_account_verified_event.rb create mode 100644 lib/square/types/bank_account_verified_event_data.rb create mode 100644 lib/square/types/bank_account_verified_event_object.rb create mode 100644 lib/square/types/batch_change_inventory_request.rb create mode 100644 lib/square/types/batch_change_inventory_response.rb create mode 100644 lib/square/types/batch_create_team_members_response.rb create mode 100644 lib/square/types/batch_create_vendors_response.rb create mode 100644 lib/square/types/batch_delete_catalog_objects_response.rb create mode 100644 lib/square/types/batch_get_catalog_objects_response.rb create mode 100644 lib/square/types/batch_get_inventory_changes_response.rb create mode 100644 lib/square/types/batch_get_inventory_counts_request.rb create mode 100644 lib/square/types/batch_get_inventory_counts_response.rb create mode 100644 lib/square/types/batch_get_orders_response.rb create mode 100644 lib/square/types/batch_get_vendors_response.rb create mode 100644 lib/square/types/batch_retrieve_inventory_changes_request.rb create mode 100644 lib/square/types/batch_update_team_members_response.rb create mode 100644 lib/square/types/batch_update_vendors_response.rb create mode 100644 lib/square/types/batch_upsert_catalog_objects_response.rb create mode 100644 lib/square/types/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.rb create mode 100644 lib/square/types/batch_upsert_customer_custom_attributes_response.rb create mode 100644 lib/square/types/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.rb create mode 100644 lib/square/types/booking.rb create mode 100644 lib/square/types/booking_booking_source.rb create mode 100644 lib/square/types/booking_created_event.rb create mode 100644 lib/square/types/booking_created_event_data.rb create mode 100644 lib/square/types/booking_created_event_object.rb create mode 100644 lib/square/types/booking_creator_details.rb create mode 100644 lib/square/types/booking_creator_details_creator_type.rb create mode 100644 lib/square/types/booking_custom_attribute_definition_owned_created_event.rb create mode 100644 lib/square/types/booking_custom_attribute_definition_owned_deleted_event.rb create mode 100644 lib/square/types/booking_custom_attribute_definition_owned_updated_event.rb create mode 100644 lib/square/types/booking_custom_attribute_definition_visible_created_event.rb create mode 100644 lib/square/types/booking_custom_attribute_definition_visible_deleted_event.rb create mode 100644 lib/square/types/booking_custom_attribute_definition_visible_updated_event.rb create mode 100644 lib/square/types/booking_custom_attribute_delete_request.rb create mode 100644 lib/square/types/booking_custom_attribute_delete_response.rb create mode 100644 lib/square/types/booking_custom_attribute_owned_deleted_event.rb create mode 100644 lib/square/types/booking_custom_attribute_owned_updated_event.rb create mode 100644 lib/square/types/booking_custom_attribute_upsert_request.rb create mode 100644 lib/square/types/booking_custom_attribute_upsert_response.rb create mode 100644 lib/square/types/booking_custom_attribute_visible_deleted_event.rb create mode 100644 lib/square/types/booking_custom_attribute_visible_updated_event.rb create mode 100644 lib/square/types/booking_status.rb create mode 100644 lib/square/types/booking_updated_event.rb create mode 100644 lib/square/types/booking_updated_event_data.rb create mode 100644 lib/square/types/booking_updated_event_object.rb create mode 100644 lib/square/types/break_.rb create mode 100644 lib/square/types/break_type.rb create mode 100644 lib/square/types/bulk_create_customer_data.rb create mode 100644 lib/square/types/bulk_create_customers_response.rb create mode 100644 lib/square/types/bulk_delete_booking_custom_attributes_response.rb create mode 100644 lib/square/types/bulk_delete_customers_response.rb create mode 100644 lib/square/types/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.rb create mode 100644 lib/square/types/bulk_delete_location_custom_attributes_response.rb create mode 100644 lib/square/types/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.rb create mode 100644 lib/square/types/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.rb create mode 100644 lib/square/types/bulk_delete_merchant_custom_attributes_response.rb create mode 100644 lib/square/types/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.rb create mode 100644 lib/square/types/bulk_delete_order_custom_attributes_request_delete_custom_attribute.rb create mode 100644 lib/square/types/bulk_delete_order_custom_attributes_response.rb create mode 100644 lib/square/types/bulk_publish_scheduled_shifts_data.rb create mode 100644 lib/square/types/bulk_publish_scheduled_shifts_response.rb create mode 100644 lib/square/types/bulk_retrieve_bookings_response.rb create mode 100644 lib/square/types/bulk_retrieve_customers_response.rb create mode 100644 lib/square/types/bulk_retrieve_team_member_booking_profiles_response.rb create mode 100644 lib/square/types/bulk_swap_plan_response.rb create mode 100644 lib/square/types/bulk_update_customer_data.rb create mode 100644 lib/square/types/bulk_update_customers_response.rb create mode 100644 lib/square/types/bulk_upsert_booking_custom_attributes_response.rb create mode 100644 lib/square/types/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.rb create mode 100644 lib/square/types/bulk_upsert_location_custom_attributes_response.rb create mode 100644 lib/square/types/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.rb create mode 100644 lib/square/types/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.rb create mode 100644 lib/square/types/bulk_upsert_merchant_custom_attributes_response.rb create mode 100644 lib/square/types/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.rb create mode 100644 lib/square/types/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.rb create mode 100644 lib/square/types/bulk_upsert_order_custom_attributes_response.rb create mode 100644 lib/square/types/business_appointment_settings.rb create mode 100644 lib/square/types/business_appointment_settings_alignment_time.rb create mode 100644 lib/square/types/business_appointment_settings_booking_location_type.rb create mode 100644 lib/square/types/business_appointment_settings_cancellation_policy.rb create mode 100644 lib/square/types/business_appointment_settings_max_appointments_per_day_limit_type.rb create mode 100644 lib/square/types/business_booking_profile.rb create mode 100644 lib/square/types/business_booking_profile_booking_policy.rb create mode 100644 lib/square/types/business_booking_profile_customer_timezone_choice.rb create mode 100644 lib/square/types/business_hours.rb create mode 100644 lib/square/types/business_hours_period.rb create mode 100644 lib/square/types/buy_now_pay_later_details.rb create mode 100644 lib/square/types/calculate_loyalty_points_response.rb create mode 100644 lib/square/types/calculate_order_response.rb create mode 100644 lib/square/types/cancel_booking_response.rb create mode 100644 lib/square/types/cancel_invoice_response.rb create mode 100644 lib/square/types/cancel_loyalty_promotion_response.rb create mode 100644 lib/square/types/cancel_payment_by_idempotency_key_response.rb create mode 100644 lib/square/types/cancel_payment_response.rb create mode 100644 lib/square/types/cancel_subscription_response.rb create mode 100644 lib/square/types/cancel_terminal_action_response.rb create mode 100644 lib/square/types/cancel_terminal_checkout_response.rb create mode 100644 lib/square/types/cancel_terminal_refund_response.rb create mode 100644 lib/square/types/capture_transaction_response.rb create mode 100644 lib/square/types/card.rb create mode 100644 lib/square/types/card_automatically_updated_event.rb create mode 100644 lib/square/types/card_automatically_updated_event_data.rb create mode 100644 lib/square/types/card_automatically_updated_event_object.rb create mode 100644 lib/square/types/card_brand.rb create mode 100644 lib/square/types/card_co_brand.rb create mode 100644 lib/square/types/card_created_event.rb create mode 100644 lib/square/types/card_created_event_data.rb create mode 100644 lib/square/types/card_created_event_object.rb create mode 100644 lib/square/types/card_disabled_event.rb create mode 100644 lib/square/types/card_disabled_event_data.rb create mode 100644 lib/square/types/card_disabled_event_object.rb create mode 100644 lib/square/types/card_forgotten_event.rb create mode 100644 lib/square/types/card_forgotten_event_card.rb create mode 100644 lib/square/types/card_forgotten_event_data.rb create mode 100644 lib/square/types/card_forgotten_event_object.rb create mode 100644 lib/square/types/card_payment_details.rb create mode 100644 lib/square/types/card_payment_timeline.rb create mode 100644 lib/square/types/card_prepaid_type.rb create mode 100644 lib/square/types/card_type.rb create mode 100644 lib/square/types/card_updated_event.rb create mode 100644 lib/square/types/card_updated_event_data.rb create mode 100644 lib/square/types/card_updated_event_object.rb create mode 100644 lib/square/types/cash_app_details.rb create mode 100644 lib/square/types/cash_drawer_device.rb create mode 100644 lib/square/types/cash_drawer_event_type.rb create mode 100644 lib/square/types/cash_drawer_shift.rb create mode 100644 lib/square/types/cash_drawer_shift_event.rb create mode 100644 lib/square/types/cash_drawer_shift_state.rb create mode 100644 lib/square/types/cash_drawer_shift_summary.rb create mode 100644 lib/square/types/cash_payment_details.rb create mode 100644 lib/square/types/catalog_availability_period.rb create mode 100644 lib/square/types/catalog_category.rb create mode 100644 lib/square/types/catalog_category_type.rb create mode 100644 lib/square/types/catalog_custom_attribute_definition.rb create mode 100644 lib/square/types/catalog_custom_attribute_definition_app_visibility.rb create mode 100644 lib/square/types/catalog_custom_attribute_definition_number_config.rb create mode 100644 lib/square/types/catalog_custom_attribute_definition_selection_config.rb create mode 100644 lib/square/types/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.rb create mode 100644 lib/square/types/catalog_custom_attribute_definition_seller_visibility.rb create mode 100644 lib/square/types/catalog_custom_attribute_definition_string_config.rb create mode 100644 lib/square/types/catalog_custom_attribute_definition_type.rb create mode 100644 lib/square/types/catalog_custom_attribute_value.rb create mode 100644 lib/square/types/catalog_discount.rb create mode 100644 lib/square/types/catalog_discount_modify_tax_basis.rb create mode 100644 lib/square/types/catalog_discount_type.rb create mode 100644 lib/square/types/catalog_ecom_seo_data.rb create mode 100644 lib/square/types/catalog_id_mapping.rb create mode 100644 lib/square/types/catalog_image.rb create mode 100644 lib/square/types/catalog_info_response.rb create mode 100644 lib/square/types/catalog_info_response_limits.rb create mode 100644 lib/square/types/catalog_item.rb create mode 100644 lib/square/types/catalog_item_food_and_beverage_details.rb create mode 100644 lib/square/types/catalog_item_food_and_beverage_details_dietary_preference.rb create mode 100644 lib/square/types/catalog_item_food_and_beverage_details_dietary_preference_standard_dietary_preference.rb create mode 100644 lib/square/types/catalog_item_food_and_beverage_details_dietary_preference_type.rb create mode 100644 lib/square/types/catalog_item_food_and_beverage_details_ingredient.rb create mode 100644 lib/square/types/catalog_item_food_and_beverage_details_ingredient_standard_ingredient.rb create mode 100644 lib/square/types/catalog_item_modifier_list_info.rb create mode 100644 lib/square/types/catalog_item_option.rb create mode 100644 lib/square/types/catalog_item_option_for_item.rb create mode 100644 lib/square/types/catalog_item_option_value.rb create mode 100644 lib/square/types/catalog_item_option_value_for_item_variation.rb create mode 100644 lib/square/types/catalog_item_product_type.rb create mode 100644 lib/square/types/catalog_item_variation.rb create mode 100644 lib/square/types/catalog_measurement_unit.rb create mode 100644 lib/square/types/catalog_modifier.rb create mode 100644 lib/square/types/catalog_modifier_list.rb create mode 100644 lib/square/types/catalog_modifier_list_modifier_type.rb create mode 100644 lib/square/types/catalog_modifier_list_selection_type.rb create mode 100644 lib/square/types/catalog_modifier_override.rb create mode 100644 lib/square/types/catalog_object_availability_period.rb create mode 100644 lib/square/types/catalog_object_base.rb create mode 100644 lib/square/types/catalog_object_batch.rb create mode 100644 lib/square/types/catalog_object_category.rb create mode 100644 lib/square/types/catalog_object_custom_attribute_definition.rb create mode 100644 lib/square/types/catalog_object_discount.rb create mode 100644 lib/square/types/catalog_object_image.rb create mode 100644 lib/square/types/catalog_object_item.rb create mode 100644 lib/square/types/catalog_object_item_option.rb create mode 100644 lib/square/types/catalog_object_item_option_value.rb create mode 100644 lib/square/types/catalog_object_item_variation.rb create mode 100644 lib/square/types/catalog_object_measurement_unit.rb create mode 100644 lib/square/types/catalog_object_modifier.rb create mode 100644 lib/square/types/catalog_object_modifier_list.rb create mode 100644 lib/square/types/catalog_object_pricing_rule.rb create mode 100644 lib/square/types/catalog_object_product_set.rb create mode 100644 lib/square/types/catalog_object_quick_amounts_settings.rb create mode 100644 lib/square/types/catalog_object_reference.rb create mode 100644 lib/square/types/catalog_object_subscription_plan.rb create mode 100644 lib/square/types/catalog_object_subscription_plan_variation.rb create mode 100644 lib/square/types/catalog_object_tax.rb create mode 100644 lib/square/types/catalog_object_time_period.rb create mode 100644 lib/square/types/catalog_object_type.rb create mode 100644 lib/square/types/catalog_pricing_rule.rb create mode 100644 lib/square/types/catalog_pricing_type.rb create mode 100644 lib/square/types/catalog_product_set.rb create mode 100644 lib/square/types/catalog_query.rb create mode 100644 lib/square/types/catalog_query_exact.rb create mode 100644 lib/square/types/catalog_query_item_variations_for_item_option_values.rb create mode 100644 lib/square/types/catalog_query_items_for_item_options.rb create mode 100644 lib/square/types/catalog_query_items_for_modifier_list.rb create mode 100644 lib/square/types/catalog_query_items_for_tax.rb create mode 100644 lib/square/types/catalog_query_prefix.rb create mode 100644 lib/square/types/catalog_query_range.rb create mode 100644 lib/square/types/catalog_query_set.rb create mode 100644 lib/square/types/catalog_query_sorted_attribute.rb create mode 100644 lib/square/types/catalog_query_text.rb create mode 100644 lib/square/types/catalog_quick_amount.rb create mode 100644 lib/square/types/catalog_quick_amount_type.rb create mode 100644 lib/square/types/catalog_quick_amounts_settings.rb create mode 100644 lib/square/types/catalog_quick_amounts_settings_option.rb create mode 100644 lib/square/types/catalog_stock_conversion.rb create mode 100644 lib/square/types/catalog_subscription_plan.rb create mode 100644 lib/square/types/catalog_subscription_plan_variation.rb create mode 100644 lib/square/types/catalog_tax.rb create mode 100644 lib/square/types/catalog_time_period.rb create mode 100644 lib/square/types/catalog_v_1_id.rb create mode 100644 lib/square/types/catalog_version_updated_event.rb create mode 100644 lib/square/types/catalog_version_updated_event_catalog_version.rb create mode 100644 lib/square/types/catalog_version_updated_event_data.rb create mode 100644 lib/square/types/catalog_version_updated_event_object.rb create mode 100644 lib/square/types/category_path_to_root_node.rb create mode 100644 lib/square/types/change_billing_anchor_date_response.rb create mode 100644 lib/square/types/change_timing.rb create mode 100644 lib/square/types/charge_request_additional_recipient.rb create mode 100644 lib/square/types/checkout.rb create mode 100644 lib/square/types/checkout_location_settings.rb create mode 100644 lib/square/types/checkout_location_settings_branding.rb create mode 100644 lib/square/types/checkout_location_settings_branding_button_shape.rb create mode 100644 lib/square/types/checkout_location_settings_branding_header_type.rb create mode 100644 lib/square/types/checkout_location_settings_coupons.rb create mode 100644 lib/square/types/checkout_location_settings_policy.rb create mode 100644 lib/square/types/checkout_location_settings_tipping.rb create mode 100644 lib/square/types/checkout_merchant_settings.rb create mode 100644 lib/square/types/checkout_merchant_settings_payment_methods.rb create mode 100644 lib/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay.rb create mode 100644 lib/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range.rb create mode 100644 lib/square/types/checkout_merchant_settings_payment_methods_payment_method.rb create mode 100644 lib/square/types/checkout_options.rb create mode 100644 lib/square/types/checkout_options_payment_type.rb create mode 100644 lib/square/types/clearpay_details.rb create mode 100644 lib/square/types/clone_order_response.rb create mode 100644 lib/square/types/collected_data.rb create mode 100644 lib/square/types/complete_payment_response.rb create mode 100644 lib/square/types/component.rb create mode 100644 lib/square/types/component_component_type.rb create mode 100644 lib/square/types/confirmation_decision.rb create mode 100644 lib/square/types/confirmation_options.rb create mode 100644 lib/square/types/coordinates.rb create mode 100644 lib/square/types/country.rb create mode 100644 lib/square/types/create_booking_custom_attribute_definition_response.rb create mode 100644 lib/square/types/create_booking_response.rb create mode 100644 lib/square/types/create_break_type_response.rb create mode 100644 lib/square/types/create_card_response.rb create mode 100644 lib/square/types/create_catalog_image_request.rb create mode 100644 lib/square/types/create_catalog_image_response.rb create mode 100644 lib/square/types/create_checkout_response.rb create mode 100644 lib/square/types/create_customer_card_response.rb create mode 100644 lib/square/types/create_customer_custom_attribute_definition_response.rb create mode 100644 lib/square/types/create_customer_group_response.rb create mode 100644 lib/square/types/create_customer_response.rb create mode 100644 lib/square/types/create_device_code_response.rb create mode 100644 lib/square/types/create_dispute_evidence_file_request.rb create mode 100644 lib/square/types/create_dispute_evidence_file_response.rb create mode 100644 lib/square/types/create_dispute_evidence_text_response.rb create mode 100644 lib/square/types/create_gift_card_activity_response.rb create mode 100644 lib/square/types/create_gift_card_response.rb create mode 100644 lib/square/types/create_invoice_attachment_request_data.rb create mode 100644 lib/square/types/create_invoice_attachment_response.rb create mode 100644 lib/square/types/create_invoice_response.rb create mode 100644 lib/square/types/create_job_response.rb create mode 100644 lib/square/types/create_location_custom_attribute_definition_response.rb create mode 100644 lib/square/types/create_location_response.rb create mode 100644 lib/square/types/create_loyalty_account_response.rb create mode 100644 lib/square/types/create_loyalty_promotion_response.rb create mode 100644 lib/square/types/create_loyalty_reward_response.rb create mode 100644 lib/square/types/create_merchant_custom_attribute_definition_response.rb create mode 100644 lib/square/types/create_mobile_authorization_code_response.rb create mode 100644 lib/square/types/create_order_custom_attribute_definition_response.rb create mode 100644 lib/square/types/create_order_request.rb create mode 100644 lib/square/types/create_order_response.rb create mode 100644 lib/square/types/create_payment_link_response.rb create mode 100644 lib/square/types/create_payment_response.rb create mode 100644 lib/square/types/create_scheduled_shift_response.rb create mode 100644 lib/square/types/create_shift_response.rb create mode 100644 lib/square/types/create_subscription_response.rb create mode 100644 lib/square/types/create_team_member_request.rb create mode 100644 lib/square/types/create_team_member_response.rb create mode 100644 lib/square/types/create_terminal_action_response.rb create mode 100644 lib/square/types/create_terminal_checkout_response.rb create mode 100644 lib/square/types/create_terminal_refund_response.rb create mode 100644 lib/square/types/create_timecard_response.rb create mode 100644 lib/square/types/create_vendor_response.rb create mode 100644 lib/square/types/create_webhook_subscription_response.rb create mode 100644 lib/square/types/currency.rb create mode 100644 lib/square/types/custom_attribute.rb create mode 100644 lib/square/types/custom_attribute_definition.rb create mode 100644 lib/square/types/custom_attribute_definition_event_data.rb create mode 100644 lib/square/types/custom_attribute_definition_event_data_object.rb create mode 100644 lib/square/types/custom_attribute_definition_visibility.rb create mode 100644 lib/square/types/custom_attribute_event_data.rb create mode 100644 lib/square/types/custom_attribute_event_data_object.rb create mode 100644 lib/square/types/custom_attribute_filter.rb create mode 100644 lib/square/types/custom_field.rb create mode 100644 lib/square/types/customer.rb create mode 100644 lib/square/types/customer_address_filter.rb create mode 100644 lib/square/types/customer_created_event.rb create mode 100644 lib/square/types/customer_created_event_data.rb create mode 100644 lib/square/types/customer_created_event_event_context.rb create mode 100644 lib/square/types/customer_created_event_event_context_merge.rb create mode 100644 lib/square/types/customer_created_event_object.rb create mode 100644 lib/square/types/customer_creation_source.rb create mode 100644 lib/square/types/customer_creation_source_filter.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_created_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_created_public_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_deleted_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_deleted_public_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_owned_created_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_owned_deleted_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_owned_updated_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_updated_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_updated_public_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_visible_created_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_visible_deleted_event.rb create mode 100644 lib/square/types/customer_custom_attribute_definition_visible_updated_event.rb create mode 100644 lib/square/types/customer_custom_attribute_deleted_event.rb create mode 100644 lib/square/types/customer_custom_attribute_deleted_public_event.rb create mode 100644 lib/square/types/customer_custom_attribute_filter.rb create mode 100644 lib/square/types/customer_custom_attribute_filter_value.rb create mode 100644 lib/square/types/customer_custom_attribute_filters.rb create mode 100644 lib/square/types/customer_custom_attribute_owned_deleted_event.rb create mode 100644 lib/square/types/customer_custom_attribute_owned_updated_event.rb create mode 100644 lib/square/types/customer_custom_attribute_updated_event.rb create mode 100644 lib/square/types/customer_custom_attribute_updated_public_event.rb create mode 100644 lib/square/types/customer_custom_attribute_visible_deleted_event.rb create mode 100644 lib/square/types/customer_custom_attribute_visible_updated_event.rb create mode 100644 lib/square/types/customer_deleted_event.rb create mode 100644 lib/square/types/customer_deleted_event_data.rb create mode 100644 lib/square/types/customer_deleted_event_event_context.rb create mode 100644 lib/square/types/customer_deleted_event_event_context_merge.rb create mode 100644 lib/square/types/customer_deleted_event_object.rb create mode 100644 lib/square/types/customer_details.rb create mode 100644 lib/square/types/customer_filter.rb create mode 100644 lib/square/types/customer_group.rb create mode 100644 lib/square/types/customer_inclusion_exclusion.rb create mode 100644 lib/square/types/customer_preferences.rb create mode 100644 lib/square/types/customer_query.rb create mode 100644 lib/square/types/customer_segment.rb create mode 100644 lib/square/types/customer_sort.rb create mode 100644 lib/square/types/customer_sort_field.rb create mode 100644 lib/square/types/customer_tax_ids.rb create mode 100644 lib/square/types/customer_text_filter.rb create mode 100644 lib/square/types/customer_updated_event.rb create mode 100644 lib/square/types/customer_updated_event_data.rb create mode 100644 lib/square/types/customer_updated_event_object.rb create mode 100644 lib/square/types/data_collection_options.rb create mode 100644 lib/square/types/data_collection_options_input_type.rb create mode 100644 lib/square/types/date_range.rb create mode 100644 lib/square/types/day_of_week.rb create mode 100644 lib/square/types/delete_booking_custom_attribute_definition_response.rb create mode 100644 lib/square/types/delete_booking_custom_attribute_response.rb create mode 100644 lib/square/types/delete_break_type_response.rb create mode 100644 lib/square/types/delete_catalog_object_response.rb create mode 100644 lib/square/types/delete_customer_card_response.rb create mode 100644 lib/square/types/delete_customer_custom_attribute_definition_response.rb create mode 100644 lib/square/types/delete_customer_custom_attribute_response.rb create mode 100644 lib/square/types/delete_customer_group_response.rb create mode 100644 lib/square/types/delete_customer_response.rb create mode 100644 lib/square/types/delete_dispute_evidence_response.rb create mode 100644 lib/square/types/delete_invoice_attachment_response.rb create mode 100644 lib/square/types/delete_invoice_response.rb create mode 100644 lib/square/types/delete_location_custom_attribute_definition_response.rb create mode 100644 lib/square/types/delete_location_custom_attribute_response.rb create mode 100644 lib/square/types/delete_loyalty_reward_response.rb create mode 100644 lib/square/types/delete_merchant_custom_attribute_definition_response.rb create mode 100644 lib/square/types/delete_merchant_custom_attribute_response.rb create mode 100644 lib/square/types/delete_order_custom_attribute_definition_response.rb create mode 100644 lib/square/types/delete_order_custom_attribute_response.rb create mode 100644 lib/square/types/delete_payment_link_response.rb create mode 100644 lib/square/types/delete_shift_response.rb create mode 100644 lib/square/types/delete_snippet_response.rb create mode 100644 lib/square/types/delete_subscription_action_response.rb create mode 100644 lib/square/types/delete_timecard_response.rb create mode 100644 lib/square/types/delete_webhook_subscription_response.rb create mode 100644 lib/square/types/destination.rb create mode 100644 lib/square/types/destination_details.rb create mode 100644 lib/square/types/destination_details_card_refund_details.rb create mode 100644 lib/square/types/destination_details_cash_refund_details.rb create mode 100644 lib/square/types/destination_details_external_refund_details.rb create mode 100644 lib/square/types/destination_type.rb create mode 100644 lib/square/types/device.rb create mode 100644 lib/square/types/device_attributes.rb create mode 100644 lib/square/types/device_checkout_options.rb create mode 100644 lib/square/types/device_code.rb create mode 100644 lib/square/types/device_code_paired_event.rb create mode 100644 lib/square/types/device_code_paired_event_data.rb create mode 100644 lib/square/types/device_code_paired_event_object.rb create mode 100644 lib/square/types/device_code_status.rb create mode 100644 lib/square/types/device_component_details_application_details.rb create mode 100644 lib/square/types/device_component_details_battery_details.rb create mode 100644 lib/square/types/device_component_details_card_reader_details.rb create mode 100644 lib/square/types/device_component_details_ethernet_details.rb create mode 100644 lib/square/types/device_component_details_external_power.rb create mode 100644 lib/square/types/device_component_details_measurement.rb create mode 100644 lib/square/types/device_component_details_wi_fi_details.rb create mode 100644 lib/square/types/device_created_event.rb create mode 100644 lib/square/types/device_created_event_data.rb create mode 100644 lib/square/types/device_created_event_object.rb create mode 100644 lib/square/types/device_details.rb create mode 100644 lib/square/types/device_metadata.rb create mode 100644 lib/square/types/device_status.rb create mode 100644 lib/square/types/device_status_category.rb create mode 100644 lib/square/types/digital_wallet_details.rb create mode 100644 lib/square/types/disable_card_response.rb create mode 100644 lib/square/types/disable_events_response.rb create mode 100644 lib/square/types/dismiss_terminal_action_response.rb create mode 100644 lib/square/types/dismiss_terminal_checkout_response.rb create mode 100644 lib/square/types/dismiss_terminal_refund_response.rb create mode 100644 lib/square/types/dispute.rb create mode 100644 lib/square/types/dispute_created_event.rb create mode 100644 lib/square/types/dispute_created_event_data.rb create mode 100644 lib/square/types/dispute_created_event_object.rb create mode 100644 lib/square/types/dispute_evidence.rb create mode 100644 lib/square/types/dispute_evidence_added_event.rb create mode 100644 lib/square/types/dispute_evidence_added_event_data.rb create mode 100644 lib/square/types/dispute_evidence_added_event_object.rb create mode 100644 lib/square/types/dispute_evidence_created_event.rb create mode 100644 lib/square/types/dispute_evidence_created_event_data.rb create mode 100644 lib/square/types/dispute_evidence_created_event_object.rb create mode 100644 lib/square/types/dispute_evidence_deleted_event.rb create mode 100644 lib/square/types/dispute_evidence_deleted_event_data.rb create mode 100644 lib/square/types/dispute_evidence_deleted_event_object.rb create mode 100644 lib/square/types/dispute_evidence_file.rb create mode 100644 lib/square/types/dispute_evidence_removed_event.rb create mode 100644 lib/square/types/dispute_evidence_removed_event_data.rb create mode 100644 lib/square/types/dispute_evidence_removed_event_object.rb create mode 100644 lib/square/types/dispute_evidence_type.rb create mode 100644 lib/square/types/dispute_reason.rb create mode 100644 lib/square/types/dispute_state.rb create mode 100644 lib/square/types/dispute_state_changed_event.rb create mode 100644 lib/square/types/dispute_state_changed_event_data.rb create mode 100644 lib/square/types/dispute_state_changed_event_object.rb create mode 100644 lib/square/types/dispute_state_updated_event.rb create mode 100644 lib/square/types/dispute_state_updated_event_data.rb create mode 100644 lib/square/types/dispute_state_updated_event_object.rb create mode 100644 lib/square/types/disputed_payment.rb create mode 100644 lib/square/types/ecom_visibility.rb create mode 100644 lib/square/types/employee.rb create mode 100644 lib/square/types/employee_status.rb create mode 100644 lib/square/types/employee_wage.rb create mode 100644 lib/square/types/enable_events_response.rb create mode 100644 lib/square/types/error.rb create mode 100644 lib/square/types/error_category.rb create mode 100644 lib/square/types/error_code.rb create mode 100644 lib/square/types/event.rb create mode 100644 lib/square/types/event_data.rb create mode 100644 lib/square/types/event_metadata.rb create mode 100644 lib/square/types/event_type_metadata.rb create mode 100644 lib/square/types/exclude_strategy.rb create mode 100644 lib/square/types/external_payment_details.rb create mode 100644 lib/square/types/filter_value.rb create mode 100644 lib/square/types/float_number_range.rb create mode 100644 lib/square/types/fulfillment.rb create mode 100644 lib/square/types/fulfillment_delivery_details.rb create mode 100644 lib/square/types/fulfillment_delivery_details_order_fulfillment_delivery_details_schedule_type.rb create mode 100644 lib/square/types/fulfillment_fulfillment_entry.rb create mode 100644 lib/square/types/fulfillment_fulfillment_line_item_application.rb create mode 100644 lib/square/types/fulfillment_pickup_details.rb create mode 100644 lib/square/types/fulfillment_pickup_details_curbside_pickup_details.rb create mode 100644 lib/square/types/fulfillment_pickup_details_schedule_type.rb create mode 100644 lib/square/types/fulfillment_recipient.rb create mode 100644 lib/square/types/fulfillment_shipment_details.rb create mode 100644 lib/square/types/fulfillment_state.rb create mode 100644 lib/square/types/fulfillment_type.rb create mode 100644 lib/square/types/get_bank_account_by_v_1_id_response.rb create mode 100644 lib/square/types/get_bank_account_response.rb create mode 100644 lib/square/types/get_booking_response.rb create mode 100644 lib/square/types/get_break_type_response.rb create mode 100644 lib/square/types/get_business_booking_profile_response.rb create mode 100644 lib/square/types/get_card_response.rb create mode 100644 lib/square/types/get_cash_drawer_shift_response.rb create mode 100644 lib/square/types/get_catalog_object_response.rb create mode 100644 lib/square/types/get_customer_custom_attribute_definition_response.rb create mode 100644 lib/square/types/get_customer_custom_attribute_response.rb create mode 100644 lib/square/types/get_customer_group_response.rb create mode 100644 lib/square/types/get_customer_response.rb create mode 100644 lib/square/types/get_customer_segment_response.rb create mode 100644 lib/square/types/get_device_code_response.rb create mode 100644 lib/square/types/get_device_response.rb create mode 100644 lib/square/types/get_dispute_evidence_response.rb create mode 100644 lib/square/types/get_dispute_response.rb create mode 100644 lib/square/types/get_employee_response.rb create mode 100644 lib/square/types/get_employee_wage_response.rb create mode 100644 lib/square/types/get_gift_card_from_gan_response.rb create mode 100644 lib/square/types/get_gift_card_from_nonce_response.rb create mode 100644 lib/square/types/get_gift_card_response.rb create mode 100644 lib/square/types/get_inventory_adjustment_response.rb create mode 100644 lib/square/types/get_inventory_changes_response.rb create mode 100644 lib/square/types/get_inventory_count_response.rb create mode 100644 lib/square/types/get_inventory_physical_count_response.rb create mode 100644 lib/square/types/get_inventory_transfer_response.rb create mode 100644 lib/square/types/get_invoice_response.rb create mode 100644 lib/square/types/get_location_response.rb create mode 100644 lib/square/types/get_loyalty_account_response.rb create mode 100644 lib/square/types/get_loyalty_program_response.rb create mode 100644 lib/square/types/get_loyalty_promotion_response.rb create mode 100644 lib/square/types/get_loyalty_reward_response.rb create mode 100644 lib/square/types/get_merchant_response.rb create mode 100644 lib/square/types/get_order_response.rb create mode 100644 lib/square/types/get_payment_link_response.rb create mode 100644 lib/square/types/get_payment_refund_response.rb create mode 100644 lib/square/types/get_payment_response.rb create mode 100644 lib/square/types/get_payout_response.rb create mode 100644 lib/square/types/get_shift_response.rb create mode 100644 lib/square/types/get_snippet_response.rb create mode 100644 lib/square/types/get_subscription_response.rb create mode 100644 lib/square/types/get_team_member_booking_profile_response.rb create mode 100644 lib/square/types/get_team_member_response.rb create mode 100644 lib/square/types/get_team_member_wage_response.rb create mode 100644 lib/square/types/get_terminal_action_response.rb create mode 100644 lib/square/types/get_terminal_checkout_response.rb create mode 100644 lib/square/types/get_terminal_refund_response.rb create mode 100644 lib/square/types/get_transaction_response.rb create mode 100644 lib/square/types/get_vendor_response.rb create mode 100644 lib/square/types/get_wage_setting_response.rb create mode 100644 lib/square/types/get_webhook_subscription_response.rb create mode 100644 lib/square/types/gift_card.rb create mode 100644 lib/square/types/gift_card_activity.rb create mode 100644 lib/square/types/gift_card_activity_activate.rb create mode 100644 lib/square/types/gift_card_activity_adjust_decrement.rb create mode 100644 lib/square/types/gift_card_activity_adjust_decrement_reason.rb create mode 100644 lib/square/types/gift_card_activity_adjust_increment.rb create mode 100644 lib/square/types/gift_card_activity_adjust_increment_reason.rb create mode 100644 lib/square/types/gift_card_activity_block.rb create mode 100644 lib/square/types/gift_card_activity_clear_balance.rb create mode 100644 lib/square/types/gift_card_activity_clear_balance_reason.rb create mode 100644 lib/square/types/gift_card_activity_created_event.rb create mode 100644 lib/square/types/gift_card_activity_created_event_data.rb create mode 100644 lib/square/types/gift_card_activity_created_event_object.rb create mode 100644 lib/square/types/gift_card_activity_deactivate.rb create mode 100644 lib/square/types/gift_card_activity_deactivate_reason.rb create mode 100644 lib/square/types/gift_card_activity_import.rb create mode 100644 lib/square/types/gift_card_activity_import_reversal.rb create mode 100644 lib/square/types/gift_card_activity_load.rb create mode 100644 lib/square/types/gift_card_activity_redeem.rb create mode 100644 lib/square/types/gift_card_activity_redeem_status.rb create mode 100644 lib/square/types/gift_card_activity_refund.rb create mode 100644 lib/square/types/gift_card_activity_transfer_balance_from.rb create mode 100644 lib/square/types/gift_card_activity_transfer_balance_to.rb create mode 100644 lib/square/types/gift_card_activity_type.rb create mode 100644 lib/square/types/gift_card_activity_unblock.rb create mode 100644 lib/square/types/gift_card_activity_unlinked_activity_refund.rb create mode 100644 lib/square/types/gift_card_activity_updated_event.rb create mode 100644 lib/square/types/gift_card_activity_updated_event_data.rb create mode 100644 lib/square/types/gift_card_activity_updated_event_object.rb create mode 100644 lib/square/types/gift_card_created_event.rb create mode 100644 lib/square/types/gift_card_created_event_data.rb create mode 100644 lib/square/types/gift_card_created_event_object.rb create mode 100644 lib/square/types/gift_card_customer_linked_event.rb create mode 100644 lib/square/types/gift_card_customer_linked_event_data.rb create mode 100644 lib/square/types/gift_card_customer_linked_event_object.rb create mode 100644 lib/square/types/gift_card_customer_unlinked_event.rb create mode 100644 lib/square/types/gift_card_customer_unlinked_event_data.rb create mode 100644 lib/square/types/gift_card_customer_unlinked_event_object.rb create mode 100644 lib/square/types/gift_card_gan_source.rb create mode 100644 lib/square/types/gift_card_status.rb create mode 100644 lib/square/types/gift_card_type.rb create mode 100644 lib/square/types/gift_card_updated_event.rb create mode 100644 lib/square/types/gift_card_updated_event_data.rb create mode 100644 lib/square/types/gift_card_updated_event_object.rb create mode 100644 lib/square/types/inventory_adjustment.rb create mode 100644 lib/square/types/inventory_adjustment_group.rb create mode 100644 lib/square/types/inventory_alert_type.rb create mode 100644 lib/square/types/inventory_change.rb create mode 100644 lib/square/types/inventory_change_type.rb create mode 100644 lib/square/types/inventory_count.rb create mode 100644 lib/square/types/inventory_count_updated_event.rb create mode 100644 lib/square/types/inventory_count_updated_event_data.rb create mode 100644 lib/square/types/inventory_count_updated_event_object.rb create mode 100644 lib/square/types/inventory_physical_count.rb create mode 100644 lib/square/types/inventory_state.rb create mode 100644 lib/square/types/inventory_transfer.rb create mode 100644 lib/square/types/invoice.rb create mode 100644 lib/square/types/invoice_accepted_payment_methods.rb create mode 100644 lib/square/types/invoice_attachment.rb create mode 100644 lib/square/types/invoice_automatic_payment_source.rb create mode 100644 lib/square/types/invoice_canceled_event.rb create mode 100644 lib/square/types/invoice_canceled_event_data.rb create mode 100644 lib/square/types/invoice_canceled_event_object.rb create mode 100644 lib/square/types/invoice_created_event.rb create mode 100644 lib/square/types/invoice_created_event_data.rb create mode 100644 lib/square/types/invoice_created_event_object.rb create mode 100644 lib/square/types/invoice_custom_field.rb create mode 100644 lib/square/types/invoice_custom_field_placement.rb create mode 100644 lib/square/types/invoice_deleted_event.rb create mode 100644 lib/square/types/invoice_deleted_event_data.rb create mode 100644 lib/square/types/invoice_delivery_method.rb create mode 100644 lib/square/types/invoice_filter.rb create mode 100644 lib/square/types/invoice_payment_made_event.rb create mode 100644 lib/square/types/invoice_payment_made_event_data.rb create mode 100644 lib/square/types/invoice_payment_made_event_object.rb create mode 100644 lib/square/types/invoice_payment_reminder.rb create mode 100644 lib/square/types/invoice_payment_reminder_status.rb create mode 100644 lib/square/types/invoice_payment_request.rb create mode 100644 lib/square/types/invoice_published_event.rb create mode 100644 lib/square/types/invoice_published_event_data.rb create mode 100644 lib/square/types/invoice_published_event_object.rb create mode 100644 lib/square/types/invoice_query.rb create mode 100644 lib/square/types/invoice_recipient.rb create mode 100644 lib/square/types/invoice_recipient_tax_ids.rb create mode 100644 lib/square/types/invoice_refunded_event.rb create mode 100644 lib/square/types/invoice_refunded_event_data.rb create mode 100644 lib/square/types/invoice_refunded_event_object.rb create mode 100644 lib/square/types/invoice_request_method.rb create mode 100644 lib/square/types/invoice_request_type.rb create mode 100644 lib/square/types/invoice_scheduled_charge_failed_event.rb create mode 100644 lib/square/types/invoice_scheduled_charge_failed_event_data.rb create mode 100644 lib/square/types/invoice_scheduled_charge_failed_event_object.rb create mode 100644 lib/square/types/invoice_sort.rb create mode 100644 lib/square/types/invoice_status.rb create mode 100644 lib/square/types/invoice_updated_event.rb create mode 100644 lib/square/types/invoice_updated_event_data.rb create mode 100644 lib/square/types/invoice_updated_event_object.rb create mode 100644 lib/square/types/item_variation_location_overrides.rb create mode 100644 lib/square/types/job.rb create mode 100644 lib/square/types/job_assignment.rb create mode 100644 lib/square/types/job_assignment_pay_type.rb create mode 100644 lib/square/types/job_created_event.rb create mode 100644 lib/square/types/job_created_event_data.rb create mode 100644 lib/square/types/job_created_event_object.rb create mode 100644 lib/square/types/job_updated_event.rb create mode 100644 lib/square/types/job_updated_event_data.rb create mode 100644 lib/square/types/job_updated_event_object.rb create mode 100644 lib/square/types/labor_scheduled_shift_created_event.rb create mode 100644 lib/square/types/labor_scheduled_shift_created_event_data.rb create mode 100644 lib/square/types/labor_scheduled_shift_created_event_object.rb create mode 100644 lib/square/types/labor_scheduled_shift_deleted_event.rb create mode 100644 lib/square/types/labor_scheduled_shift_deleted_event_data.rb create mode 100644 lib/square/types/labor_scheduled_shift_published_event.rb create mode 100644 lib/square/types/labor_scheduled_shift_published_event_data.rb create mode 100644 lib/square/types/labor_scheduled_shift_published_event_object.rb create mode 100644 lib/square/types/labor_scheduled_shift_updated_event.rb create mode 100644 lib/square/types/labor_scheduled_shift_updated_event_data.rb create mode 100644 lib/square/types/labor_scheduled_shift_updated_event_object.rb create mode 100644 lib/square/types/labor_shift_created_event.rb create mode 100644 lib/square/types/labor_shift_created_event_data.rb create mode 100644 lib/square/types/labor_shift_created_event_object.rb create mode 100644 lib/square/types/labor_shift_deleted_event.rb create mode 100644 lib/square/types/labor_shift_deleted_event_data.rb create mode 100644 lib/square/types/labor_shift_updated_event.rb create mode 100644 lib/square/types/labor_shift_updated_event_data.rb create mode 100644 lib/square/types/labor_shift_updated_event_object.rb create mode 100644 lib/square/types/labor_timecard_created_event.rb create mode 100644 lib/square/types/labor_timecard_created_event_data.rb create mode 100644 lib/square/types/labor_timecard_created_event_object.rb create mode 100644 lib/square/types/labor_timecard_deleted_event.rb create mode 100644 lib/square/types/labor_timecard_deleted_event_data.rb create mode 100644 lib/square/types/labor_timecard_updated_event.rb create mode 100644 lib/square/types/labor_timecard_updated_event_data.rb create mode 100644 lib/square/types/labor_timecard_updated_event_object.rb create mode 100644 lib/square/types/link_customer_to_gift_card_response.rb create mode 100644 lib/square/types/list_bank_accounts_response.rb create mode 100644 lib/square/types/list_booking_custom_attribute_definitions_response.rb create mode 100644 lib/square/types/list_booking_custom_attributes_response.rb create mode 100644 lib/square/types/list_bookings_response.rb create mode 100644 lib/square/types/list_break_types_response.rb create mode 100644 lib/square/types/list_cards_response.rb create mode 100644 lib/square/types/list_cash_drawer_shift_events_response.rb create mode 100644 lib/square/types/list_cash_drawer_shifts_response.rb create mode 100644 lib/square/types/list_catalog_response.rb create mode 100644 lib/square/types/list_customer_custom_attribute_definitions_response.rb create mode 100644 lib/square/types/list_customer_custom_attributes_response.rb create mode 100644 lib/square/types/list_customer_groups_response.rb create mode 100644 lib/square/types/list_customer_segments_response.rb create mode 100644 lib/square/types/list_customers_response.rb create mode 100644 lib/square/types/list_device_codes_response.rb create mode 100644 lib/square/types/list_devices_response.rb create mode 100644 lib/square/types/list_dispute_evidence_response.rb create mode 100644 lib/square/types/list_disputes_response.rb create mode 100644 lib/square/types/list_employee_wages_response.rb create mode 100644 lib/square/types/list_employees_response.rb create mode 100644 lib/square/types/list_event_types_response.rb create mode 100644 lib/square/types/list_gift_card_activities_response.rb create mode 100644 lib/square/types/list_gift_cards_response.rb create mode 100644 lib/square/types/list_invoices_response.rb create mode 100644 lib/square/types/list_jobs_response.rb create mode 100644 lib/square/types/list_location_booking_profiles_response.rb create mode 100644 lib/square/types/list_location_custom_attribute_definitions_response.rb create mode 100644 lib/square/types/list_location_custom_attributes_response.rb create mode 100644 lib/square/types/list_locations_response.rb create mode 100644 lib/square/types/list_loyalty_programs_response.rb create mode 100644 lib/square/types/list_loyalty_promotions_response.rb create mode 100644 lib/square/types/list_merchant_custom_attribute_definitions_response.rb create mode 100644 lib/square/types/list_merchant_custom_attributes_response.rb create mode 100644 lib/square/types/list_merchants_response.rb create mode 100644 lib/square/types/list_order_custom_attribute_definitions_response.rb create mode 100644 lib/square/types/list_order_custom_attributes_response.rb create mode 100644 lib/square/types/list_payment_links_response.rb create mode 100644 lib/square/types/list_payment_refunds_request_sort_field.rb create mode 100644 lib/square/types/list_payment_refunds_response.rb create mode 100644 lib/square/types/list_payments_request_sort_field.rb create mode 100644 lib/square/types/list_payments_response.rb create mode 100644 lib/square/types/list_payout_entries_response.rb create mode 100644 lib/square/types/list_payouts_response.rb create mode 100644 lib/square/types/list_sites_response.rb create mode 100644 lib/square/types/list_subscription_events_response.rb create mode 100644 lib/square/types/list_team_member_booking_profiles_response.rb create mode 100644 lib/square/types/list_team_member_wages_response.rb create mode 100644 lib/square/types/list_transactions_response.rb create mode 100644 lib/square/types/list_webhook_event_types_response.rb create mode 100644 lib/square/types/list_webhook_subscriptions_response.rb create mode 100644 lib/square/types/list_workweek_configs_response.rb create mode 100644 lib/square/types/location.rb create mode 100644 lib/square/types/location_booking_profile.rb create mode 100644 lib/square/types/location_capability.rb create mode 100644 lib/square/types/location_created_event.rb create mode 100644 lib/square/types/location_created_event_data.rb create mode 100644 lib/square/types/location_custom_attribute_definition_owned_created_event.rb create mode 100644 lib/square/types/location_custom_attribute_definition_owned_deleted_event.rb create mode 100644 lib/square/types/location_custom_attribute_definition_owned_updated_event.rb create mode 100644 lib/square/types/location_custom_attribute_definition_visible_created_event.rb create mode 100644 lib/square/types/location_custom_attribute_definition_visible_deleted_event.rb create mode 100644 lib/square/types/location_custom_attribute_definition_visible_updated_event.rb create mode 100644 lib/square/types/location_custom_attribute_owned_deleted_event.rb create mode 100644 lib/square/types/location_custom_attribute_owned_updated_event.rb create mode 100644 lib/square/types/location_custom_attribute_visible_deleted_event.rb create mode 100644 lib/square/types/location_custom_attribute_visible_updated_event.rb create mode 100644 lib/square/types/location_settings_updated_event.rb create mode 100644 lib/square/types/location_settings_updated_event_data.rb create mode 100644 lib/square/types/location_settings_updated_event_object.rb create mode 100644 lib/square/types/location_status.rb create mode 100644 lib/square/types/location_type.rb create mode 100644 lib/square/types/location_updated_event.rb create mode 100644 lib/square/types/location_updated_event_data.rb create mode 100644 lib/square/types/loyalty_account.rb create mode 100644 lib/square/types/loyalty_account_created_event.rb create mode 100644 lib/square/types/loyalty_account_created_event_data.rb create mode 100644 lib/square/types/loyalty_account_created_event_object.rb create mode 100644 lib/square/types/loyalty_account_deleted_event.rb create mode 100644 lib/square/types/loyalty_account_deleted_event_data.rb create mode 100644 lib/square/types/loyalty_account_deleted_event_object.rb create mode 100644 lib/square/types/loyalty_account_expiring_point_deadline.rb create mode 100644 lib/square/types/loyalty_account_mapping.rb create mode 100644 lib/square/types/loyalty_account_updated_event.rb create mode 100644 lib/square/types/loyalty_account_updated_event_data.rb create mode 100644 lib/square/types/loyalty_account_updated_event_object.rb create mode 100644 lib/square/types/loyalty_event.rb create mode 100644 lib/square/types/loyalty_event_accumulate_points.rb create mode 100644 lib/square/types/loyalty_event_accumulate_promotion_points.rb create mode 100644 lib/square/types/loyalty_event_adjust_points.rb create mode 100644 lib/square/types/loyalty_event_create_reward.rb create mode 100644 lib/square/types/loyalty_event_created_event.rb create mode 100644 lib/square/types/loyalty_event_created_event_data.rb create mode 100644 lib/square/types/loyalty_event_created_event_object.rb create mode 100644 lib/square/types/loyalty_event_date_time_filter.rb create mode 100644 lib/square/types/loyalty_event_delete_reward.rb create mode 100644 lib/square/types/loyalty_event_expire_points.rb create mode 100644 lib/square/types/loyalty_event_filter.rb create mode 100644 lib/square/types/loyalty_event_location_filter.rb create mode 100644 lib/square/types/loyalty_event_loyalty_account_filter.rb create mode 100644 lib/square/types/loyalty_event_order_filter.rb create mode 100644 lib/square/types/loyalty_event_other.rb create mode 100644 lib/square/types/loyalty_event_query.rb create mode 100644 lib/square/types/loyalty_event_redeem_reward.rb create mode 100644 lib/square/types/loyalty_event_source.rb create mode 100644 lib/square/types/loyalty_event_type.rb create mode 100644 lib/square/types/loyalty_event_type_filter.rb create mode 100644 lib/square/types/loyalty_program.rb create mode 100644 lib/square/types/loyalty_program_accrual_rule.rb create mode 100644 lib/square/types/loyalty_program_accrual_rule_category_data.rb create mode 100644 lib/square/types/loyalty_program_accrual_rule_item_variation_data.rb create mode 100644 lib/square/types/loyalty_program_accrual_rule_spend_data.rb create mode 100644 lib/square/types/loyalty_program_accrual_rule_tax_mode.rb create mode 100644 lib/square/types/loyalty_program_accrual_rule_type.rb create mode 100644 lib/square/types/loyalty_program_accrual_rule_visit_data.rb create mode 100644 lib/square/types/loyalty_program_created_event.rb create mode 100644 lib/square/types/loyalty_program_created_event_data.rb create mode 100644 lib/square/types/loyalty_program_created_event_object.rb create mode 100644 lib/square/types/loyalty_program_expiration_policy.rb create mode 100644 lib/square/types/loyalty_program_reward_tier.rb create mode 100644 lib/square/types/loyalty_program_status.rb create mode 100644 lib/square/types/loyalty_program_terminology.rb create mode 100644 lib/square/types/loyalty_program_updated_event.rb create mode 100644 lib/square/types/loyalty_program_updated_event_data.rb create mode 100644 lib/square/types/loyalty_program_updated_event_object.rb create mode 100644 lib/square/types/loyalty_promotion.rb create mode 100644 lib/square/types/loyalty_promotion_available_time_data.rb create mode 100644 lib/square/types/loyalty_promotion_created_event.rb create mode 100644 lib/square/types/loyalty_promotion_created_event_data.rb create mode 100644 lib/square/types/loyalty_promotion_created_event_object.rb create mode 100644 lib/square/types/loyalty_promotion_incentive.rb create mode 100644 lib/square/types/loyalty_promotion_incentive_points_addition_data.rb create mode 100644 lib/square/types/loyalty_promotion_incentive_points_multiplier_data.rb create mode 100644 lib/square/types/loyalty_promotion_incentive_type.rb create mode 100644 lib/square/types/loyalty_promotion_status.rb create mode 100644 lib/square/types/loyalty_promotion_trigger_limit.rb create mode 100644 lib/square/types/loyalty_promotion_trigger_limit_interval.rb create mode 100644 lib/square/types/loyalty_promotion_updated_event.rb create mode 100644 lib/square/types/loyalty_promotion_updated_event_data.rb create mode 100644 lib/square/types/loyalty_promotion_updated_event_object.rb create mode 100644 lib/square/types/loyalty_reward.rb create mode 100644 lib/square/types/loyalty_reward_status.rb create mode 100644 lib/square/types/measurement_unit.rb create mode 100644 lib/square/types/measurement_unit_area.rb create mode 100644 lib/square/types/measurement_unit_custom.rb create mode 100644 lib/square/types/measurement_unit_length.rb create mode 100644 lib/square/types/measurement_unit_time.rb create mode 100644 lib/square/types/measurement_unit_unit_type.rb create mode 100644 lib/square/types/measurement_unit_volume.rb create mode 100644 lib/square/types/measurement_unit_weight.rb create mode 100644 lib/square/types/merchant.rb create mode 100644 lib/square/types/merchant_custom_attribute_definition_owned_created_event.rb create mode 100644 lib/square/types/merchant_custom_attribute_definition_owned_deleted_event.rb create mode 100644 lib/square/types/merchant_custom_attribute_definition_owned_updated_event.rb create mode 100644 lib/square/types/merchant_custom_attribute_definition_visible_created_event.rb create mode 100644 lib/square/types/merchant_custom_attribute_definition_visible_deleted_event.rb create mode 100644 lib/square/types/merchant_custom_attribute_definition_visible_updated_event.rb create mode 100644 lib/square/types/merchant_custom_attribute_owned_deleted_event.rb create mode 100644 lib/square/types/merchant_custom_attribute_owned_updated_event.rb create mode 100644 lib/square/types/merchant_custom_attribute_visible_deleted_event.rb create mode 100644 lib/square/types/merchant_custom_attribute_visible_updated_event.rb create mode 100644 lib/square/types/merchant_settings_updated_event.rb create mode 100644 lib/square/types/merchant_settings_updated_event_data.rb create mode 100644 lib/square/types/merchant_settings_updated_event_object.rb create mode 100644 lib/square/types/merchant_status.rb create mode 100644 lib/square/types/modifier_location_overrides.rb create mode 100644 lib/square/types/money.rb create mode 100644 lib/square/types/oauth_authorization_revoked_event.rb create mode 100644 lib/square/types/oauth_authorization_revoked_event_data.rb create mode 100644 lib/square/types/oauth_authorization_revoked_event_object.rb create mode 100644 lib/square/types/oauth_authorization_revoked_event_revocation_object.rb create mode 100644 lib/square/types/oauth_authorization_revoked_event_revoker_type.rb create mode 100644 lib/square/types/obtain_token_response.rb create mode 100644 lib/square/types/offline_payment_details.rb create mode 100644 lib/square/types/order.rb create mode 100644 lib/square/types/order_created.rb create mode 100644 lib/square/types/order_created_event.rb create mode 100644 lib/square/types/order_created_event_data.rb create mode 100644 lib/square/types/order_created_object.rb create mode 100644 lib/square/types/order_custom_attribute_definition_owned_created_event.rb create mode 100644 lib/square/types/order_custom_attribute_definition_owned_deleted_event.rb create mode 100644 lib/square/types/order_custom_attribute_definition_owned_updated_event.rb create mode 100644 lib/square/types/order_custom_attribute_definition_visible_created_event.rb create mode 100644 lib/square/types/order_custom_attribute_definition_visible_deleted_event.rb create mode 100644 lib/square/types/order_custom_attribute_definition_visible_updated_event.rb create mode 100644 lib/square/types/order_custom_attribute_owned_deleted_event.rb create mode 100644 lib/square/types/order_custom_attribute_owned_updated_event.rb create mode 100644 lib/square/types/order_custom_attribute_visible_deleted_event.rb create mode 100644 lib/square/types/order_custom_attribute_visible_updated_event.rb create mode 100644 lib/square/types/order_entry.rb create mode 100644 lib/square/types/order_fulfillment_delivery_details_schedule_type.rb create mode 100644 lib/square/types/order_fulfillment_fulfillment_line_item_application.rb create mode 100644 lib/square/types/order_fulfillment_pickup_details_schedule_type.rb create mode 100644 lib/square/types/order_fulfillment_state.rb create mode 100644 lib/square/types/order_fulfillment_type.rb create mode 100644 lib/square/types/order_fulfillment_updated.rb create mode 100644 lib/square/types/order_fulfillment_updated_event.rb create mode 100644 lib/square/types/order_fulfillment_updated_event_data.rb create mode 100644 lib/square/types/order_fulfillment_updated_object.rb create mode 100644 lib/square/types/order_fulfillment_updated_update.rb create mode 100644 lib/square/types/order_line_item.rb create mode 100644 lib/square/types/order_line_item_applied_discount.rb create mode 100644 lib/square/types/order_line_item_applied_service_charge.rb create mode 100644 lib/square/types/order_line_item_applied_tax.rb create mode 100644 lib/square/types/order_line_item_discount.rb create mode 100644 lib/square/types/order_line_item_discount_scope.rb create mode 100644 lib/square/types/order_line_item_discount_type.rb create mode 100644 lib/square/types/order_line_item_item_type.rb create mode 100644 lib/square/types/order_line_item_modifier.rb create mode 100644 lib/square/types/order_line_item_pricing_blocklists.rb create mode 100644 lib/square/types/order_line_item_pricing_blocklists_blocked_discount.rb create mode 100644 lib/square/types/order_line_item_pricing_blocklists_blocked_tax.rb create mode 100644 lib/square/types/order_line_item_tax.rb create mode 100644 lib/square/types/order_line_item_tax_scope.rb create mode 100644 lib/square/types/order_line_item_tax_type.rb create mode 100644 lib/square/types/order_money_amounts.rb create mode 100644 lib/square/types/order_pricing_options.rb create mode 100644 lib/square/types/order_quantity_unit.rb create mode 100644 lib/square/types/order_return.rb create mode 100644 lib/square/types/order_return_discount.rb create mode 100644 lib/square/types/order_return_line_item.rb create mode 100644 lib/square/types/order_return_line_item_modifier.rb create mode 100644 lib/square/types/order_return_service_charge.rb create mode 100644 lib/square/types/order_return_tax.rb create mode 100644 lib/square/types/order_return_tip.rb create mode 100644 lib/square/types/order_reward.rb create mode 100644 lib/square/types/order_rounding_adjustment.rb create mode 100644 lib/square/types/order_service_charge.rb create mode 100644 lib/square/types/order_service_charge_calculation_phase.rb create mode 100644 lib/square/types/order_service_charge_scope.rb create mode 100644 lib/square/types/order_service_charge_treatment_type.rb create mode 100644 lib/square/types/order_service_charge_type.rb create mode 100644 lib/square/types/order_source.rb create mode 100644 lib/square/types/order_state.rb create mode 100644 lib/square/types/order_updated.rb create mode 100644 lib/square/types/order_updated_event.rb create mode 100644 lib/square/types/order_updated_event_data.rb create mode 100644 lib/square/types/order_updated_object.rb create mode 100644 lib/square/types/pause_subscription_response.rb create mode 100644 lib/square/types/pay_order_response.rb create mode 100644 lib/square/types/payment.rb create mode 100644 lib/square/types/payment_balance_activity_app_fee_refund_detail.rb create mode 100644 lib/square/types/payment_balance_activity_app_fee_revenue_detail.rb create mode 100644 lib/square/types/payment_balance_activity_automatic_savings_detail.rb create mode 100644 lib/square/types/payment_balance_activity_automatic_savings_reversed_detail.rb create mode 100644 lib/square/types/payment_balance_activity_charge_detail.rb create mode 100644 lib/square/types/payment_balance_activity_deposit_fee_detail.rb create mode 100644 lib/square/types/payment_balance_activity_deposit_fee_reversed_detail.rb create mode 100644 lib/square/types/payment_balance_activity_dispute_detail.rb create mode 100644 lib/square/types/payment_balance_activity_fee_detail.rb create mode 100644 lib/square/types/payment_balance_activity_free_processing_detail.rb create mode 100644 lib/square/types/payment_balance_activity_hold_adjustment_detail.rb create mode 100644 lib/square/types/payment_balance_activity_open_dispute_detail.rb create mode 100644 lib/square/types/payment_balance_activity_other_adjustment_detail.rb create mode 100644 lib/square/types/payment_balance_activity_other_detail.rb create mode 100644 lib/square/types/payment_balance_activity_refund_detail.rb create mode 100644 lib/square/types/payment_balance_activity_release_adjustment_detail.rb create mode 100644 lib/square/types/payment_balance_activity_reserve_hold_detail.rb create mode 100644 lib/square/types/payment_balance_activity_reserve_release_detail.rb create mode 100644 lib/square/types/payment_balance_activity_square_capital_payment_detail.rb create mode 100644 lib/square/types/payment_balance_activity_square_capital_reversed_payment_detail.rb create mode 100644 lib/square/types/payment_balance_activity_square_payroll_transfer_detail.rb create mode 100644 lib/square/types/payment_balance_activity_square_payroll_transfer_reversed_detail.rb create mode 100644 lib/square/types/payment_balance_activity_tax_on_fee_detail.rb create mode 100644 lib/square/types/payment_balance_activity_third_party_fee_detail.rb create mode 100644 lib/square/types/payment_balance_activity_third_party_fee_refund_detail.rb create mode 100644 lib/square/types/payment_created_event.rb create mode 100644 lib/square/types/payment_created_event_data.rb create mode 100644 lib/square/types/payment_created_event_object.rb create mode 100644 lib/square/types/payment_link.rb create mode 100644 lib/square/types/payment_link_related_resources.rb create mode 100644 lib/square/types/payment_options.rb create mode 100644 lib/square/types/payment_options_delay_action.rb create mode 100644 lib/square/types/payment_refund.rb create mode 100644 lib/square/types/payment_updated_event.rb create mode 100644 lib/square/types/payment_updated_event_data.rb create mode 100644 lib/square/types/payment_updated_event_object.rb create mode 100644 lib/square/types/payout.rb create mode 100644 lib/square/types/payout_entry.rb create mode 100644 lib/square/types/payout_failed_event.rb create mode 100644 lib/square/types/payout_failed_event_data.rb create mode 100644 lib/square/types/payout_failed_event_object.rb create mode 100644 lib/square/types/payout_fee.rb create mode 100644 lib/square/types/payout_fee_type.rb create mode 100644 lib/square/types/payout_paid_event.rb create mode 100644 lib/square/types/payout_paid_event_data.rb create mode 100644 lib/square/types/payout_paid_event_object.rb create mode 100644 lib/square/types/payout_sent_event.rb create mode 100644 lib/square/types/payout_sent_event_data.rb create mode 100644 lib/square/types/payout_sent_event_object.rb create mode 100644 lib/square/types/payout_status.rb create mode 100644 lib/square/types/payout_type.rb create mode 100644 lib/square/types/phase.rb create mode 100644 lib/square/types/phase_input.rb create mode 100644 lib/square/types/pre_populated_data.rb create mode 100644 lib/square/types/processing_fee.rb create mode 100644 lib/square/types/product.rb create mode 100644 lib/square/types/publish_invoice_response.rb create mode 100644 lib/square/types/publish_scheduled_shift_response.rb create mode 100644 lib/square/types/qr_code_options.rb create mode 100644 lib/square/types/quick_pay.rb create mode 100644 lib/square/types/range.rb create mode 100644 lib/square/types/receipt_options.rb create mode 100644 lib/square/types/redeem_loyalty_reward_response.rb create mode 100644 lib/square/types/refund.rb create mode 100644 lib/square/types/refund_created_event.rb create mode 100644 lib/square/types/refund_created_event_data.rb create mode 100644 lib/square/types/refund_created_event_object.rb create mode 100644 lib/square/types/refund_payment_response.rb create mode 100644 lib/square/types/refund_status.rb create mode 100644 lib/square/types/refund_updated_event.rb create mode 100644 lib/square/types/refund_updated_event_data.rb create mode 100644 lib/square/types/refund_updated_event_object.rb create mode 100644 lib/square/types/register_domain_response.rb create mode 100644 lib/square/types/register_domain_response_status.rb create mode 100644 lib/square/types/remove_group_from_customer_response.rb create mode 100644 lib/square/types/resume_subscription_response.rb create mode 100644 lib/square/types/retrieve_booking_custom_attribute_definition_response.rb create mode 100644 lib/square/types/retrieve_booking_custom_attribute_response.rb create mode 100644 lib/square/types/retrieve_job_response.rb create mode 100644 lib/square/types/retrieve_location_booking_profile_response.rb create mode 100644 lib/square/types/retrieve_location_custom_attribute_definition_response.rb create mode 100644 lib/square/types/retrieve_location_custom_attribute_response.rb create mode 100644 lib/square/types/retrieve_location_settings_response.rb create mode 100644 lib/square/types/retrieve_merchant_custom_attribute_definition_response.rb create mode 100644 lib/square/types/retrieve_merchant_custom_attribute_response.rb create mode 100644 lib/square/types/retrieve_merchant_settings_response.rb create mode 100644 lib/square/types/retrieve_order_custom_attribute_definition_response.rb create mode 100644 lib/square/types/retrieve_order_custom_attribute_response.rb create mode 100644 lib/square/types/retrieve_scheduled_shift_response.rb create mode 100644 lib/square/types/retrieve_timecard_response.rb create mode 100644 lib/square/types/retrieve_token_status_response.rb create mode 100644 lib/square/types/revoke_token_response.rb create mode 100644 lib/square/types/risk_evaluation.rb create mode 100644 lib/square/types/risk_evaluation_risk_level.rb create mode 100644 lib/square/types/save_card_options.rb create mode 100644 lib/square/types/scheduled_shift.rb create mode 100644 lib/square/types/scheduled_shift_details.rb create mode 100644 lib/square/types/scheduled_shift_filter.rb create mode 100644 lib/square/types/scheduled_shift_filter_assignment_status.rb create mode 100644 lib/square/types/scheduled_shift_filter_scheduled_shift_status.rb create mode 100644 lib/square/types/scheduled_shift_notification_audience.rb create mode 100644 lib/square/types/scheduled_shift_query.rb create mode 100644 lib/square/types/scheduled_shift_sort.rb create mode 100644 lib/square/types/scheduled_shift_sort_field.rb create mode 100644 lib/square/types/scheduled_shift_workday.rb create mode 100644 lib/square/types/scheduled_shift_workday_matcher.rb create mode 100644 lib/square/types/search_availability_filter.rb create mode 100644 lib/square/types/search_availability_query.rb create mode 100644 lib/square/types/search_availability_response.rb create mode 100644 lib/square/types/search_catalog_items_request_stock_level.rb create mode 100644 lib/square/types/search_catalog_items_response.rb create mode 100644 lib/square/types/search_catalog_objects_response.rb create mode 100644 lib/square/types/search_customers_response.rb create mode 100644 lib/square/types/search_events_filter.rb create mode 100644 lib/square/types/search_events_query.rb create mode 100644 lib/square/types/search_events_response.rb create mode 100644 lib/square/types/search_events_sort.rb create mode 100644 lib/square/types/search_invoices_response.rb create mode 100644 lib/square/types/search_loyalty_accounts_request_loyalty_account_query.rb create mode 100644 lib/square/types/search_loyalty_accounts_response.rb create mode 100644 lib/square/types/search_loyalty_events_response.rb create mode 100644 lib/square/types/search_loyalty_rewards_request_loyalty_reward_query.rb create mode 100644 lib/square/types/search_loyalty_rewards_response.rb create mode 100644 lib/square/types/search_orders_customer_filter.rb create mode 100644 lib/square/types/search_orders_date_time_filter.rb create mode 100644 lib/square/types/search_orders_filter.rb create mode 100644 lib/square/types/search_orders_fulfillment_filter.rb create mode 100644 lib/square/types/search_orders_query.rb create mode 100644 lib/square/types/search_orders_response.rb create mode 100644 lib/square/types/search_orders_sort.rb create mode 100644 lib/square/types/search_orders_sort_field.rb create mode 100644 lib/square/types/search_orders_source_filter.rb create mode 100644 lib/square/types/search_orders_state_filter.rb create mode 100644 lib/square/types/search_scheduled_shifts_response.rb create mode 100644 lib/square/types/search_shifts_response.rb create mode 100644 lib/square/types/search_subscriptions_filter.rb create mode 100644 lib/square/types/search_subscriptions_query.rb create mode 100644 lib/square/types/search_subscriptions_response.rb create mode 100644 lib/square/types/search_team_members_filter.rb create mode 100644 lib/square/types/search_team_members_query.rb create mode 100644 lib/square/types/search_team_members_response.rb create mode 100644 lib/square/types/search_terminal_actions_response.rb create mode 100644 lib/square/types/search_terminal_checkouts_response.rb create mode 100644 lib/square/types/search_terminal_refunds_response.rb create mode 100644 lib/square/types/search_timecards_response.rb create mode 100644 lib/square/types/search_vendors_request_filter.rb create mode 100644 lib/square/types/search_vendors_request_sort.rb create mode 100644 lib/square/types/search_vendors_request_sort_field.rb create mode 100644 lib/square/types/search_vendors_response.rb create mode 100644 lib/square/types/segment_filter.rb create mode 100644 lib/square/types/select_option.rb create mode 100644 lib/square/types/select_options.rb create mode 100644 lib/square/types/shift.rb create mode 100644 lib/square/types/shift_filter.rb create mode 100644 lib/square/types/shift_filter_status.rb create mode 100644 lib/square/types/shift_query.rb create mode 100644 lib/square/types/shift_sort.rb create mode 100644 lib/square/types/shift_sort_field.rb create mode 100644 lib/square/types/shift_status.rb create mode 100644 lib/square/types/shift_wage.rb create mode 100644 lib/square/types/shift_workday.rb create mode 100644 lib/square/types/shift_workday_matcher.rb create mode 100644 lib/square/types/shipping_fee.rb create mode 100644 lib/square/types/signature_image.rb create mode 100644 lib/square/types/signature_options.rb create mode 100644 lib/square/types/site.rb create mode 100644 lib/square/types/snippet.rb create mode 100644 lib/square/types/sort_order.rb create mode 100644 lib/square/types/source_application.rb create mode 100644 lib/square/types/square_account_details.rb create mode 100644 lib/square/types/standard_unit_description.rb create mode 100644 lib/square/types/standard_unit_description_group.rb create mode 100644 lib/square/types/submit_evidence_response.rb create mode 100644 lib/square/types/subscription.rb create mode 100644 lib/square/types/subscription_action.rb create mode 100644 lib/square/types/subscription_action_type.rb create mode 100644 lib/square/types/subscription_cadence.rb create mode 100644 lib/square/types/subscription_created_event.rb create mode 100644 lib/square/types/subscription_created_event_data.rb create mode 100644 lib/square/types/subscription_created_event_object.rb create mode 100644 lib/square/types/subscription_event.rb create mode 100644 lib/square/types/subscription_event_info.rb create mode 100644 lib/square/types/subscription_event_info_code.rb create mode 100644 lib/square/types/subscription_event_subscription_event_type.rb create mode 100644 lib/square/types/subscription_phase.rb create mode 100644 lib/square/types/subscription_pricing.rb create mode 100644 lib/square/types/subscription_pricing_type.rb create mode 100644 lib/square/types/subscription_source.rb create mode 100644 lib/square/types/subscription_status.rb create mode 100644 lib/square/types/subscription_test_result.rb create mode 100644 lib/square/types/subscription_updated_event.rb create mode 100644 lib/square/types/subscription_updated_event_data.rb create mode 100644 lib/square/types/subscription_updated_event_object.rb create mode 100644 lib/square/types/swap_plan_response.rb create mode 100644 lib/square/types/tax_calculation_phase.rb create mode 100644 lib/square/types/tax_ids.rb create mode 100644 lib/square/types/tax_inclusion_type.rb create mode 100644 lib/square/types/team_member.rb create mode 100644 lib/square/types/team_member_assigned_locations.rb create mode 100644 lib/square/types/team_member_assigned_locations_assignment_type.rb create mode 100644 lib/square/types/team_member_booking_profile.rb create mode 100644 lib/square/types/team_member_created_event.rb create mode 100644 lib/square/types/team_member_created_event_data.rb create mode 100644 lib/square/types/team_member_created_event_object.rb create mode 100644 lib/square/types/team_member_invitation_status.rb create mode 100644 lib/square/types/team_member_status.rb create mode 100644 lib/square/types/team_member_updated_event.rb create mode 100644 lib/square/types/team_member_updated_event_data.rb create mode 100644 lib/square/types/team_member_updated_event_object.rb create mode 100644 lib/square/types/team_member_wage.rb create mode 100644 lib/square/types/team_member_wage_setting_updated_event.rb create mode 100644 lib/square/types/team_member_wage_setting_updated_event_data.rb create mode 100644 lib/square/types/team_member_wage_setting_updated_event_object.rb create mode 100644 lib/square/types/tender.rb create mode 100644 lib/square/types/tender_bank_account_details.rb create mode 100644 lib/square/types/tender_bank_account_details_status.rb create mode 100644 lib/square/types/tender_buy_now_pay_later_details.rb create mode 100644 lib/square/types/tender_buy_now_pay_later_details_brand.rb create mode 100644 lib/square/types/tender_buy_now_pay_later_details_status.rb create mode 100644 lib/square/types/tender_card_details.rb create mode 100644 lib/square/types/tender_card_details_entry_method.rb create mode 100644 lib/square/types/tender_card_details_status.rb create mode 100644 lib/square/types/tender_cash_details.rb create mode 100644 lib/square/types/tender_square_account_details.rb create mode 100644 lib/square/types/tender_square_account_details_status.rb create mode 100644 lib/square/types/tender_type.rb create mode 100644 lib/square/types/terminal_action.rb create mode 100644 lib/square/types/terminal_action_action_type.rb create mode 100644 lib/square/types/terminal_action_created_event.rb create mode 100644 lib/square/types/terminal_action_created_event_data.rb create mode 100644 lib/square/types/terminal_action_created_event_object.rb create mode 100644 lib/square/types/terminal_action_query.rb create mode 100644 lib/square/types/terminal_action_query_filter.rb create mode 100644 lib/square/types/terminal_action_query_sort.rb create mode 100644 lib/square/types/terminal_action_updated_event.rb create mode 100644 lib/square/types/terminal_action_updated_event_data.rb create mode 100644 lib/square/types/terminal_action_updated_event_object.rb create mode 100644 lib/square/types/terminal_checkout.rb create mode 100644 lib/square/types/terminal_checkout_created_event.rb create mode 100644 lib/square/types/terminal_checkout_created_event_data.rb create mode 100644 lib/square/types/terminal_checkout_created_event_object.rb create mode 100644 lib/square/types/terminal_checkout_query.rb create mode 100644 lib/square/types/terminal_checkout_query_filter.rb create mode 100644 lib/square/types/terminal_checkout_query_sort.rb create mode 100644 lib/square/types/terminal_checkout_updated_event.rb create mode 100644 lib/square/types/terminal_checkout_updated_event_data.rb create mode 100644 lib/square/types/terminal_checkout_updated_event_object.rb create mode 100644 lib/square/types/terminal_refund.rb create mode 100644 lib/square/types/terminal_refund_created_event.rb create mode 100644 lib/square/types/terminal_refund_created_event_data.rb create mode 100644 lib/square/types/terminal_refund_created_event_object.rb create mode 100644 lib/square/types/terminal_refund_query.rb create mode 100644 lib/square/types/terminal_refund_query_filter.rb create mode 100644 lib/square/types/terminal_refund_query_sort.rb create mode 100644 lib/square/types/terminal_refund_updated_event.rb create mode 100644 lib/square/types/terminal_refund_updated_event_data.rb create mode 100644 lib/square/types/terminal_refund_updated_event_object.rb create mode 100644 lib/square/types/test_webhook_subscription_response.rb create mode 100644 lib/square/types/time_range.rb create mode 100644 lib/square/types/timecard.rb create mode 100644 lib/square/types/timecard_filter.rb create mode 100644 lib/square/types/timecard_filter_status.rb create mode 100644 lib/square/types/timecard_query.rb create mode 100644 lib/square/types/timecard_sort.rb create mode 100644 lib/square/types/timecard_sort_field.rb create mode 100644 lib/square/types/timecard_status.rb create mode 100644 lib/square/types/timecard_wage.rb create mode 100644 lib/square/types/timecard_workday.rb create mode 100644 lib/square/types/timecard_workday_matcher.rb create mode 100644 lib/square/types/tip_settings.rb create mode 100644 lib/square/types/transaction.rb create mode 100644 lib/square/types/transaction_product.rb create mode 100644 lib/square/types/transaction_type.rb create mode 100644 lib/square/types/unlink_customer_from_gift_card_response.rb create mode 100644 lib/square/types/update_booking_custom_attribute_definition_response.rb create mode 100644 lib/square/types/update_booking_response.rb create mode 100644 lib/square/types/update_break_type_response.rb create mode 100644 lib/square/types/update_catalog_image_request.rb create mode 100644 lib/square/types/update_catalog_image_response.rb create mode 100644 lib/square/types/update_customer_custom_attribute_definition_response.rb create mode 100644 lib/square/types/update_customer_group_response.rb create mode 100644 lib/square/types/update_customer_response.rb create mode 100644 lib/square/types/update_invoice_response.rb create mode 100644 lib/square/types/update_item_modifier_lists_response.rb create mode 100644 lib/square/types/update_item_taxes_response.rb create mode 100644 lib/square/types/update_job_response.rb create mode 100644 lib/square/types/update_location_custom_attribute_definition_response.rb create mode 100644 lib/square/types/update_location_response.rb create mode 100644 lib/square/types/update_location_settings_response.rb create mode 100644 lib/square/types/update_merchant_custom_attribute_definition_response.rb create mode 100644 lib/square/types/update_merchant_settings_response.rb create mode 100644 lib/square/types/update_order_custom_attribute_definition_response.rb create mode 100644 lib/square/types/update_order_response.rb create mode 100644 lib/square/types/update_payment_link_response.rb create mode 100644 lib/square/types/update_payment_response.rb create mode 100644 lib/square/types/update_scheduled_shift_response.rb create mode 100644 lib/square/types/update_shift_response.rb create mode 100644 lib/square/types/update_subscription_response.rb create mode 100644 lib/square/types/update_team_member_request.rb create mode 100644 lib/square/types/update_team_member_response.rb create mode 100644 lib/square/types/update_timecard_response.rb create mode 100644 lib/square/types/update_vendor_request.rb create mode 100644 lib/square/types/update_vendor_response.rb create mode 100644 lib/square/types/update_wage_setting_response.rb create mode 100644 lib/square/types/update_webhook_subscription_response.rb create mode 100644 lib/square/types/update_webhook_subscription_signature_key_response.rb create mode 100644 lib/square/types/update_workweek_config_response.rb create mode 100644 lib/square/types/upsert_booking_custom_attribute_response.rb create mode 100644 lib/square/types/upsert_catalog_object_response.rb create mode 100644 lib/square/types/upsert_customer_custom_attribute_response.rb create mode 100644 lib/square/types/upsert_location_custom_attribute_response.rb create mode 100644 lib/square/types/upsert_merchant_custom_attribute_response.rb create mode 100644 lib/square/types/upsert_order_custom_attribute_response.rb create mode 100644 lib/square/types/upsert_snippet_response.rb create mode 100644 lib/square/types/v_1_money.rb create mode 100644 lib/square/types/v_1_order.rb create mode 100644 lib/square/types/v_1_order_history_entry.rb create mode 100644 lib/square/types/v_1_order_history_entry_action.rb create mode 100644 lib/square/types/v_1_order_state.rb create mode 100644 lib/square/types/v_1_tender.rb create mode 100644 lib/square/types/v_1_tender_card_brand.rb create mode 100644 lib/square/types/v_1_tender_entry_method.rb create mode 100644 lib/square/types/v_1_tender_type.rb create mode 100644 lib/square/types/v_1_update_order_request_action.rb create mode 100644 lib/square/types/vendor.rb create mode 100644 lib/square/types/vendor_contact.rb create mode 100644 lib/square/types/vendor_created_event.rb create mode 100644 lib/square/types/vendor_created_event_data.rb create mode 100644 lib/square/types/vendor_created_event_object.rb create mode 100644 lib/square/types/vendor_status.rb create mode 100644 lib/square/types/vendor_updated_event.rb create mode 100644 lib/square/types/vendor_updated_event_data.rb create mode 100644 lib/square/types/vendor_updated_event_object.rb create mode 100644 lib/square/types/visibility_filter.rb create mode 100644 lib/square/types/void_transaction_response.rb create mode 100644 lib/square/types/wage_setting.rb create mode 100644 lib/square/types/webhook_subscription.rb create mode 100644 lib/square/types/weekday.rb create mode 100644 lib/square/types/workweek_config.rb create mode 100644 lib/square/v_1_transactions/client.rb create mode 100644 lib/square/v_1_transactions/types/v_1_list_orders_request.rb create mode 100644 lib/square/v_1_transactions/types/v_1_retrieve_order_request.rb create mode 100644 lib/square/v_1_transactions/types/v_1_update_order_request.rb create mode 100644 lib/square/vendors/client.rb create mode 100644 lib/square/vendors/types/batch_create_vendors_request.rb create mode 100644 lib/square/vendors/types/batch_get_vendors_request.rb create mode 100644 lib/square/vendors/types/batch_update_vendors_request.rb create mode 100644 lib/square/vendors/types/create_vendor_request.rb create mode 100644 lib/square/vendors/types/get_vendors_request.rb create mode 100644 lib/square/vendors/types/search_vendors_request.rb create mode 100644 lib/square/vendors/types/update_vendors_request.rb create mode 100644 lib/square/webhooks/client.rb create mode 100644 lib/square/webhooks/event_types/client.rb create mode 100644 lib/square/webhooks/event_types/types/list_event_types_request.rb create mode 100644 lib/square/webhooks/subscriptions/client.rb create mode 100644 lib/square/webhooks/subscriptions/types/create_webhook_subscription_request.rb create mode 100644 lib/square/webhooks/subscriptions/types/delete_subscriptions_request.rb create mode 100644 lib/square/webhooks/subscriptions/types/get_subscriptions_request.rb create mode 100644 lib/square/webhooks/subscriptions/types/list_subscriptions_request.rb create mode 100644 lib/square/webhooks/subscriptions/types/test_webhook_subscription_request.rb create mode 100644 lib/square/webhooks/subscriptions/types/update_webhook_subscription_request.rb create mode 100644 lib/square/webhooks/subscriptions/types/update_webhook_subscription_signature_key_request.rb create mode 100644 test/integration/helpers.rb create mode 100644 test/integration/integration_test_base.rb create mode 100644 test/integration/test_cash_drawers.rb create mode 100644 test/integration/test_catalog_serial.rb create mode 100644 test/integration/test_client_utils.rb create mode 100644 test/integration/test_customer_groups.rb create mode 100644 test/integration/test_customer_segments.rb create mode 100644 test/integration/test_devices.rb create mode 100644 test/integration/test_legacy.rb create mode 100644 test/integration/test_locations.rb create mode 100644 test/integration/test_merchants.rb create mode 100644 test/integration/test_mobile_authorization.rb create mode 100644 test/integration/test_orders.rb create mode 100644 test/integration/test_payments.rb create mode 100644 test/integration/test_refunds.rb create mode 100644 test/integration/test_teams.rb create mode 100644 test/integration/test_terminal.rb create mode 100644 test/integration/testdata/image.jpeg diff --git a/.fernignore b/.fernignore index 2f4007699..75d1cd07f 100644 --- a/.fernignore +++ b/.fernignore @@ -1,2 +1,4 @@ lib/square_legacy/ -lib/square_legacy.rb \ No newline at end of file +lib/square_legacy.rb +Gemfile +Rakefile \ No newline at end of file diff --git a/.gitignore b/.gitignore index d63133a3b..28be072ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ Gemfile.lock pkg -*.gem \ No newline at end of file +*.gem +CLAUDE.md diff --git a/.rubocop.yml b/.rubocop.yml index f01384699..64b5b1565 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,46 +1,39 @@ -Metrics/ClassLength: - Enabled: false - -Metrics/MethodLength: - Enabled: false +plugins: + - rubocop-minitest -Metrics/BlockLength: - Enabled: false +AllCops: + TargetRubyVersion: 3.1 + NewCops: enable -Metrics/ParameterLists: - Enabled: false +Style/StringLiterals: + EnforcedStyle: double_quotes -Metrics/AbcSize: - Enabled: false +Style/StringLiteralsInInterpolation: + EnforcedStyle: double_quotes -Metrics/CyclomaticComplexity: +Style/AccessModifierDeclarations: Enabled: false -Metrics/PerceivedComplexity: +Lint/ConstantDefinitionInBlock: Enabled: false -Metrics/LineLength: +Metrics/AbcSize: Enabled: false -Lint/UnderscorePrefixedVariableName: +Metrics/BlockLength: Enabled: false -Naming/AccessorMethodName: +Metrics/ClassLength: Enabled: false -Naming/UncommunicativeMethodParamName: +Metrics/MethodLength: Enabled: false -Style/AsciiComments: +Metrics/ParameterLists: Enabled: false -Style/StringLiterals: +Metrics/PerceivedComplexity: Enabled: false -Style/FrozenStringLiteralComment: +Style/Documentation: Enabled: false - -AllCops: - Exclude: - - './test/**/*' - - './*' \ No newline at end of file diff --git a/Gemfile b/Gemfile index e0d55aa9a..62e0d3a70 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,19 @@ -source 'https://rubygems.org' +# frozen_string_literal: true -group :test do - gem 'rake' -end +source "https://rubygems.org" gemspec + +group :test, :development do + gem "rake", "~> 13.0" + + gem "minitest", "~> 5.16" + gem "minitest-rg" + + gem "rubocop", "~> 1.21" + gem "rubocop-minitest" + + gem "pry" + + gem "webmock" +end diff --git a/Rakefile b/Rakefile index 420fa09f5..fa395a88f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,13 +1,14 @@ -lib = File.expand_path('../lib', __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +# frozen_string_literal: true require "bundler/gem_tasks" -require 'rake/testtask' +require "minitest/test_task" -Rake::TestTask.new(:test) do |t| - t.libs << "test" - t.test_files = FileList['test/**/test_*.rb', 'spec/**/*_spec.rb'] - t.warning = false -end +# Minitest::TestTask.create -task :default => :test +# require "rubocop/rake_task" + +# RuboCop::RakeTask.new + +# task default: %i[test] + +# task lint: %i[rubocop] diff --git a/lib/square.rb b/lib/square.rb new file mode 100644 index 000000000..0e11618fe --- /dev/null +++ b/lib/square.rb @@ -0,0 +1,1671 @@ +# frozen_string_literal: true + +require "json" +require "net/http" +require "securerandom" + +# Internal Types +require_relative 'square/internal/json/serializable' +require_relative 'square/internal/types/type' +require_relative 'square/internal/types/utils' +require_relative 'square/internal/types/union' +require_relative 'square/internal/errors/constraint_error' +require_relative 'square/internal/errors/type_error' +require_relative 'square/internal/http/base_request' +require_relative 'square/internal/json/request' +require_relative 'square/internal/http/raw_client' +require_relative 'square/internal/multipart/multipart_encoder' +require_relative 'square/internal/multipart/multipart_form_data_part' +require_relative 'square/internal/multipart/multipart_form_data' +require_relative 'square/internal/multipart/multipart_request' +require_relative 'square/internal/types/model/field' +require_relative 'square/internal/types/model' +require_relative 'square/internal/types/array' +require_relative 'square/internal/types/boolean' +require_relative 'square/internal/types/enum' +require_relative 'square/internal/types/hash' +require_relative 'square/internal/types/unknown' + +# API Types +require_relative 'square/types/ach_details' +require_relative 'square/types/card_brand' +require_relative 'square/types/currency' +require_relative 'square/types/dispute_reason' +require_relative 'square/types/dispute_state' +require_relative 'square/types/disputed_payment' +require_relative 'square/types/money' +require_relative 'square/types/dispute' +require_relative 'square/types/error_category' +require_relative 'square/types/error_code' +require_relative 'square/types/error' +require_relative 'square/types/accept_dispute_response' +require_relative 'square/types/accepted_payment_methods' +require_relative 'square/types/loyalty_event_accumulate_points' +require_relative 'square/types/loyalty_event_accumulate_promotion_points' +require_relative 'square/types/loyalty_event_adjust_points' +require_relative 'square/types/loyalty_event_create_reward' +require_relative 'square/types/loyalty_event_delete_reward' +require_relative 'square/types/loyalty_event_expire_points' +require_relative 'square/types/loyalty_event_other' +require_relative 'square/types/loyalty_event_redeem_reward' +require_relative 'square/types/loyalty_event_source' +require_relative 'square/types/loyalty_event_type' +require_relative 'square/types/loyalty_event' +require_relative 'square/types/accumulate_loyalty_points_response' +require_relative 'square/types/action_cancel_reason' +require_relative 'square/types/activity_type' +require_relative 'square/types/add_group_to_customer_response' +require_relative 'square/types/additional_recipient' +require_relative 'square/types/country' +require_relative 'square/types/address' +require_relative 'square/types/adjust_loyalty_points_response' +require_relative 'square/types/afterpay_details' +require_relative 'square/types/application_details_external_square_product' +require_relative 'square/types/application_details' +require_relative 'square/types/appointment_segment' +require_relative 'square/types/archived_state' +require_relative 'square/types/availability' +require_relative 'square/types/bank_account_status' +require_relative 'square/types/bank_account_type' +require_relative 'square/types/bank_account' +require_relative 'square/types/bank_account_created_event_object' +require_relative 'square/types/bank_account_created_event_data' +require_relative 'square/types/bank_account_created_event' +require_relative 'square/types/bank_account_disabled_event_object' +require_relative 'square/types/bank_account_disabled_event_data' +require_relative 'square/types/bank_account_disabled_event' +require_relative 'square/types/bank_account_payment_details' +require_relative 'square/types/bank_account_verified_event_object' +require_relative 'square/types/bank_account_verified_event_data' +require_relative 'square/types/bank_account_verified_event' +require_relative 'square/types/measurement_unit_area' +require_relative 'square/types/measurement_unit_custom' +require_relative 'square/types/measurement_unit_length' +require_relative 'square/types/measurement_unit_time' +require_relative 'square/types/measurement_unit_unit_type' +require_relative 'square/types/measurement_unit_volume' +require_relative 'square/types/measurement_unit_weight' +require_relative 'square/types/measurement_unit' +require_relative 'square/types/catalog_measurement_unit' +require_relative 'square/types/inventory_state' +require_relative 'square/types/inventory_adjustment_group' +require_relative 'square/types/product' +require_relative 'square/types/source_application' +require_relative 'square/types/inventory_adjustment' +require_relative 'square/types/inventory_change_type' +require_relative 'square/types/inventory_physical_count' +require_relative 'square/types/inventory_transfer' +require_relative 'square/types/inventory_change' +require_relative 'square/types/batch_change_inventory_request' +require_relative 'square/types/inventory_count' +require_relative 'square/types/batch_change_inventory_response' +require_relative 'square/types/batch_delete_catalog_objects_response' +require_relative 'square/types/day_of_week' +require_relative 'square/types/catalog_availability_period' +require_relative 'square/types/catalog_category_type' +require_relative 'square/types/catalog_custom_attribute_definition_type' +require_relative 'square/types/catalog_custom_attribute_value' +require_relative 'square/types/catalog_ecom_seo_data' +require_relative 'square/types/catalog_v_1_id' +require_relative 'square/types/category_path_to_root_node' +require_relative 'square/types/catalog_object_category' +require_relative 'square/types/catalog_category' +require_relative 'square/types/catalog_custom_attribute_definition_app_visibility' +require_relative 'square/types/catalog_custom_attribute_definition_number_config' +require_relative 'square/types/catalog_custom_attribute_definition_selection_config_custom_attribute_selection' +require_relative 'square/types/catalog_custom_attribute_definition_selection_config' +require_relative 'square/types/catalog_custom_attribute_definition_seller_visibility' +require_relative 'square/types/catalog_custom_attribute_definition_string_config' +require_relative 'square/types/catalog_object_type' +require_relative 'square/types/catalog_custom_attribute_definition' +require_relative 'square/types/catalog_discount_modify_tax_basis' +require_relative 'square/types/catalog_discount_type' +require_relative 'square/types/catalog_discount' +require_relative 'square/types/catalog_image' +require_relative 'square/types/catalog_item_food_and_beverage_details_dietary_preference_standard_dietary_preference' +require_relative 'square/types/catalog_item_food_and_beverage_details_dietary_preference_type' +require_relative 'square/types/catalog_item_food_and_beverage_details_dietary_preference' +require_relative 'square/types/catalog_item_food_and_beverage_details_ingredient_standard_ingredient' +require_relative 'square/types/catalog_item_food_and_beverage_details_ingredient' +require_relative 'square/types/catalog_item_food_and_beverage_details' +require_relative 'square/types/catalog_modifier_override' +require_relative 'square/types/catalog_item_modifier_list_info' +require_relative 'square/types/catalog_item_option_for_item' +require_relative 'square/types/catalog_item_option_value' +require_relative 'square/types/catalog_item_option_value_for_item_variation' +require_relative 'square/types/catalog_item_product_type' +require_relative 'square/types/catalog_pricing_type' +require_relative 'square/types/catalog_stock_conversion' +require_relative 'square/types/inventory_alert_type' +require_relative 'square/types/item_variation_location_overrides' +require_relative 'square/types/catalog_item_variation' +require_relative 'square/types/modifier_location_overrides' +require_relative 'square/types/catalog_modifier' +require_relative 'square/types/catalog_modifier_list_modifier_type' +require_relative 'square/types/catalog_modifier_list_selection_type' +require_relative 'square/types/exclude_strategy' +require_relative 'square/types/catalog_pricing_rule' +require_relative 'square/types/catalog_product_set' +require_relative 'square/types/catalog_quick_amount_type' +require_relative 'square/types/catalog_quick_amount' +require_relative 'square/types/catalog_quick_amounts_settings_option' +require_relative 'square/types/catalog_quick_amounts_settings' +require_relative 'square/types/subscription_cadence' +require_relative 'square/types/subscription_pricing_type' +require_relative 'square/types/subscription_pricing' +require_relative 'square/types/subscription_phase' +require_relative 'square/types/catalog_subscription_plan_variation' +require_relative 'square/types/tax_calculation_phase' +require_relative 'square/types/tax_inclusion_type' +require_relative 'square/types/catalog_tax' +require_relative 'square/types/catalog_time_period' +require_relative 'square/types/catalog_object_image' +require_relative 'square/types/catalog_object_item_variation' +require_relative 'square/types/catalog_object_tax' +require_relative 'square/types/catalog_object_discount' +require_relative 'square/types/catalog_object_modifier' +require_relative 'square/types/catalog_object_pricing_rule' +require_relative 'square/types/catalog_object_product_set' +require_relative 'square/types/catalog_object_time_period' +require_relative 'square/types/catalog_object_measurement_unit' +require_relative 'square/types/catalog_object_subscription_plan_variation' +require_relative 'square/types/catalog_object_item_option_value' +require_relative 'square/types/catalog_object_custom_attribute_definition' +require_relative 'square/types/catalog_object_quick_amounts_settings' +require_relative 'square/types/catalog_object_availability_period' +require_relative 'square/types/catalog_object_subscription_plan' +require_relative 'square/types/catalog_object_item_option' +require_relative 'square/types/catalog_object_modifier_list' +require_relative 'square/types/catalog_object_item' +require_relative 'square/types/catalog_subscription_plan' +require_relative 'square/types/catalog_modifier_list' +require_relative 'square/types/catalog_item_option' +require_relative 'square/types/catalog_item' +require_relative 'square/types/batch_get_catalog_objects_response' +require_relative 'square/types/batch_retrieve_inventory_changes_request' +require_relative 'square/types/batch_get_inventory_changes_response' +require_relative 'square/types/batch_get_inventory_counts_request' +require_relative 'square/types/batch_get_inventory_counts_response' +require_relative 'square/types/card_co_brand' +require_relative 'square/types/card_prepaid_type' +require_relative 'square/types/card_type' +require_relative 'square/types/card' +require_relative 'square/types/fulfillment_delivery_details_order_fulfillment_delivery_details_schedule_type' +require_relative 'square/types/fulfillment_recipient' +require_relative 'square/types/fulfillment_delivery_details' +require_relative 'square/types/fulfillment_fulfillment_entry' +require_relative 'square/types/fulfillment_fulfillment_line_item_application' +require_relative 'square/types/fulfillment_pickup_details_curbside_pickup_details' +require_relative 'square/types/fulfillment_pickup_details_schedule_type' +require_relative 'square/types/fulfillment_pickup_details' +require_relative 'square/types/fulfillment_shipment_details' +require_relative 'square/types/fulfillment_state' +require_relative 'square/types/fulfillment_type' +require_relative 'square/types/fulfillment' +require_relative 'square/types/order_line_item_applied_discount' +require_relative 'square/types/order_line_item_applied_service_charge' +require_relative 'square/types/order_line_item_applied_tax' +require_relative 'square/types/order_line_item_item_type' +require_relative 'square/types/order_line_item_modifier' +require_relative 'square/types/order_line_item_pricing_blocklists_blocked_discount' +require_relative 'square/types/order_line_item_pricing_blocklists_blocked_tax' +require_relative 'square/types/order_line_item_pricing_blocklists' +require_relative 'square/types/order_quantity_unit' +require_relative 'square/types/order_line_item' +require_relative 'square/types/order_line_item_discount_scope' +require_relative 'square/types/order_line_item_discount_type' +require_relative 'square/types/order_line_item_discount' +require_relative 'square/types/order_line_item_tax_scope' +require_relative 'square/types/order_line_item_tax_type' +require_relative 'square/types/order_line_item_tax' +require_relative 'square/types/order_money_amounts' +require_relative 'square/types/order_pricing_options' +require_relative 'square/types/order_return_discount' +require_relative 'square/types/order_return_line_item_modifier' +require_relative 'square/types/order_return_line_item' +require_relative 'square/types/order_service_charge_calculation_phase' +require_relative 'square/types/order_service_charge_scope' +require_relative 'square/types/order_service_charge_treatment_type' +require_relative 'square/types/order_return_service_charge' +require_relative 'square/types/order_return_tax' +require_relative 'square/types/order_return_tip' +require_relative 'square/types/order_rounding_adjustment' +require_relative 'square/types/order_return' +require_relative 'square/types/order_reward' +require_relative 'square/types/order_service_charge_type' +require_relative 'square/types/order_service_charge' +require_relative 'square/types/order_source' +require_relative 'square/types/order_state' +require_relative 'square/types/refund_status' +require_relative 'square/types/refund' +require_relative 'square/types/tender_bank_account_details_status' +require_relative 'square/types/tender_bank_account_details' +require_relative 'square/types/tender_buy_now_pay_later_details_brand' +require_relative 'square/types/tender_buy_now_pay_later_details_status' +require_relative 'square/types/tender_buy_now_pay_later_details' +require_relative 'square/types/tender_card_details_entry_method' +require_relative 'square/types/tender_card_details_status' +require_relative 'square/types/tender_card_details' +require_relative 'square/types/tender_cash_details' +require_relative 'square/types/tender_square_account_details_status' +require_relative 'square/types/tender_square_account_details' +require_relative 'square/types/tender_type' +require_relative 'square/types/tender' +require_relative 'square/types/order' +require_relative 'square/types/batch_get_orders_response' +require_relative 'square/types/catalog_id_mapping' +require_relative 'square/types/batch_upsert_catalog_objects_response' +require_relative 'square/types/booking_booking_source' +require_relative 'square/types/booking_creator_details_creator_type' +require_relative 'square/types/booking_creator_details' +require_relative 'square/types/booking_status' +require_relative 'square/types/business_appointment_settings_booking_location_type' +require_relative 'square/types/booking' +require_relative 'square/types/booking_created_event_object' +require_relative 'square/types/booking_created_event_data' +require_relative 'square/types/booking_created_event' +require_relative 'square/types/custom_attribute_definition_visibility' +require_relative 'square/types/custom_attribute_definition' +require_relative 'square/types/custom_attribute_definition_event_data_object' +require_relative 'square/types/custom_attribute_definition_event_data' +require_relative 'square/types/booking_custom_attribute_definition_owned_created_event' +require_relative 'square/types/booking_custom_attribute_definition_owned_deleted_event' +require_relative 'square/types/booking_custom_attribute_definition_owned_updated_event' +require_relative 'square/types/booking_custom_attribute_definition_visible_created_event' +require_relative 'square/types/booking_custom_attribute_definition_visible_deleted_event' +require_relative 'square/types/booking_custom_attribute_definition_visible_updated_event' +require_relative 'square/types/booking_custom_attribute_delete_request' +require_relative 'square/types/booking_custom_attribute_delete_response' +require_relative 'square/types/custom_attribute' +require_relative 'square/types/custom_attribute_event_data_object' +require_relative 'square/types/custom_attribute_event_data' +require_relative 'square/types/booking_custom_attribute_owned_deleted_event' +require_relative 'square/types/booking_custom_attribute_owned_updated_event' +require_relative 'square/types/booking_custom_attribute_upsert_request' +require_relative 'square/types/booking_custom_attribute_upsert_response' +require_relative 'square/types/booking_custom_attribute_visible_deleted_event' +require_relative 'square/types/booking_custom_attribute_visible_updated_event' +require_relative 'square/types/booking_updated_event_object' +require_relative 'square/types/booking_updated_event_data' +require_relative 'square/types/booking_updated_event' +require_relative 'square/types/break_' +require_relative 'square/types/break_type' +require_relative 'square/types/customer_tax_ids' +require_relative 'square/types/bulk_create_customer_data' +require_relative 'square/types/customer_creation_source' +require_relative 'square/types/customer_preferences' +require_relative 'square/types/customer' +require_relative 'square/types/create_customer_response' +require_relative 'square/types/bulk_create_customers_response' +require_relative 'square/types/job_assignment_pay_type' +require_relative 'square/types/job_assignment' +require_relative 'square/types/team_member_assigned_locations_assignment_type' +require_relative 'square/types/team_member_assigned_locations' +require_relative 'square/types/team_member_status' +require_relative 'square/types/wage_setting' +require_relative 'square/types/team_member' +require_relative 'square/types/create_team_member_response' +require_relative 'square/types/batch_create_team_members_response' +require_relative 'square/types/vendor_contact' +require_relative 'square/types/vendor_status' +require_relative 'square/types/vendor' +require_relative 'square/types/create_vendor_response' +require_relative 'square/types/batch_create_vendors_response' +require_relative 'square/types/bulk_delete_booking_custom_attributes_response' +require_relative 'square/types/delete_customer_response' +require_relative 'square/types/bulk_delete_customers_response' +require_relative 'square/types/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request' +require_relative 'square/types/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response' +require_relative 'square/types/bulk_delete_location_custom_attributes_response' +require_relative 'square/types/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request' +require_relative 'square/types/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response' +require_relative 'square/types/bulk_delete_merchant_custom_attributes_response' +require_relative 'square/types/bulk_delete_order_custom_attributes_request_delete_custom_attribute' +require_relative 'square/types/delete_order_custom_attribute_response' +require_relative 'square/types/bulk_delete_order_custom_attributes_response' +require_relative 'square/types/bulk_publish_scheduled_shifts_data' +require_relative 'square/types/scheduled_shift_details' +require_relative 'square/types/scheduled_shift' +require_relative 'square/types/publish_scheduled_shift_response' +require_relative 'square/types/bulk_publish_scheduled_shifts_response' +require_relative 'square/types/get_booking_response' +require_relative 'square/types/bulk_retrieve_bookings_response' +require_relative 'square/types/get_customer_response' +require_relative 'square/types/bulk_retrieve_customers_response' +require_relative 'square/types/team_member_booking_profile' +require_relative 'square/types/get_team_member_booking_profile_response' +require_relative 'square/types/bulk_retrieve_team_member_booking_profiles_response' +require_relative 'square/types/get_vendor_response' +require_relative 'square/types/batch_get_vendors_response' +require_relative 'square/types/bulk_swap_plan_response' +require_relative 'square/types/bulk_update_customer_data' +require_relative 'square/types/update_customer_response' +require_relative 'square/types/bulk_update_customers_response' +require_relative 'square/types/update_team_member_response' +require_relative 'square/types/batch_update_team_members_response' +require_relative 'square/types/update_vendor_response' +require_relative 'square/types/batch_update_vendors_response' +require_relative 'square/types/bulk_upsert_booking_custom_attributes_response' +require_relative 'square/types/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request' +require_relative 'square/types/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response' +require_relative 'square/types/batch_upsert_customer_custom_attributes_response' +require_relative 'square/types/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request' +require_relative 'square/types/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response' +require_relative 'square/types/bulk_upsert_location_custom_attributes_response' +require_relative 'square/types/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request' +require_relative 'square/types/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response' +require_relative 'square/types/bulk_upsert_merchant_custom_attributes_response' +require_relative 'square/types/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute' +require_relative 'square/types/upsert_order_custom_attribute_response' +require_relative 'square/types/bulk_upsert_order_custom_attributes_response' +require_relative 'square/types/business_appointment_settings_alignment_time' +require_relative 'square/types/business_appointment_settings_cancellation_policy' +require_relative 'square/types/business_appointment_settings_max_appointments_per_day_limit_type' +require_relative 'square/types/business_appointment_settings' +require_relative 'square/types/business_booking_profile_booking_policy' +require_relative 'square/types/business_booking_profile_customer_timezone_choice' +require_relative 'square/types/business_booking_profile' +require_relative 'square/types/business_hours_period' +require_relative 'square/types/business_hours' +require_relative 'square/types/clearpay_details' +require_relative 'square/types/buy_now_pay_later_details' +require_relative 'square/types/calculate_loyalty_points_response' +require_relative 'square/types/calculate_order_response' +require_relative 'square/types/cancel_booking_response' +require_relative 'square/types/invoice_accepted_payment_methods' +require_relative 'square/types/invoice_attachment' +require_relative 'square/types/invoice_automatic_payment_source' +require_relative 'square/types/invoice_custom_field_placement' +require_relative 'square/types/invoice_custom_field' +require_relative 'square/types/invoice_delivery_method' +require_relative 'square/types/invoice_payment_reminder_status' +require_relative 'square/types/invoice_payment_reminder' +require_relative 'square/types/invoice_request_method' +require_relative 'square/types/invoice_request_type' +require_relative 'square/types/invoice_payment_request' +require_relative 'square/types/invoice_recipient_tax_ids' +require_relative 'square/types/invoice_recipient' +require_relative 'square/types/invoice_status' +require_relative 'square/types/invoice' +require_relative 'square/types/cancel_invoice_response' +require_relative 'square/types/loyalty_promotion_available_time_data' +require_relative 'square/types/loyalty_promotion_incentive_points_addition_data' +require_relative 'square/types/loyalty_promotion_incentive_points_multiplier_data' +require_relative 'square/types/loyalty_promotion_incentive_type' +require_relative 'square/types/loyalty_promotion_incentive' +require_relative 'square/types/loyalty_promotion_status' +require_relative 'square/types/loyalty_promotion_trigger_limit_interval' +require_relative 'square/types/loyalty_promotion_trigger_limit' +require_relative 'square/types/loyalty_promotion' +require_relative 'square/types/cancel_loyalty_promotion_response' +require_relative 'square/types/cancel_payment_by_idempotency_key_response' +require_relative 'square/types/card_payment_timeline' +require_relative 'square/types/device_details' +require_relative 'square/types/card_payment_details' +require_relative 'square/types/cash_app_details' +require_relative 'square/types/cash_payment_details' +require_relative 'square/types/digital_wallet_details' +require_relative 'square/types/external_payment_details' +require_relative 'square/types/offline_payment_details' +require_relative 'square/types/processing_fee' +require_relative 'square/types/risk_evaluation_risk_level' +require_relative 'square/types/risk_evaluation' +require_relative 'square/types/square_account_details' +require_relative 'square/types/payment' +require_relative 'square/types/cancel_payment_response' +require_relative 'square/types/phase' +require_relative 'square/types/subscription_action_type' +require_relative 'square/types/subscription_action' +require_relative 'square/types/subscription_source' +require_relative 'square/types/subscription_status' +require_relative 'square/types/subscription' +require_relative 'square/types/cancel_subscription_response' +require_relative 'square/types/collected_data' +require_relative 'square/types/confirmation_decision' +require_relative 'square/types/confirmation_options' +require_relative 'square/types/data_collection_options_input_type' +require_relative 'square/types/data_collection_options' +require_relative 'square/types/device_metadata' +require_relative 'square/types/qr_code_options' +require_relative 'square/types/receipt_options' +require_relative 'square/types/save_card_options' +require_relative 'square/types/select_option' +require_relative 'square/types/select_options' +require_relative 'square/types/signature_image' +require_relative 'square/types/signature_options' +require_relative 'square/types/terminal_action_action_type' +require_relative 'square/types/terminal_action' +require_relative 'square/types/cancel_terminal_action_response' +require_relative 'square/types/checkout_options_payment_type' +require_relative 'square/types/tip_settings' +require_relative 'square/types/device_checkout_options' +require_relative 'square/types/payment_options_delay_action' +require_relative 'square/types/payment_options' +require_relative 'square/types/terminal_checkout' +require_relative 'square/types/cancel_terminal_checkout_response' +require_relative 'square/types/terminal_refund' +require_relative 'square/types/cancel_terminal_refund_response' +require_relative 'square/types/capture_transaction_response' +require_relative 'square/types/card_automatically_updated_event_object' +require_relative 'square/types/card_automatically_updated_event_data' +require_relative 'square/types/card_automatically_updated_event' +require_relative 'square/types/card_created_event_object' +require_relative 'square/types/card_created_event_data' +require_relative 'square/types/card_created_event' +require_relative 'square/types/card_disabled_event_object' +require_relative 'square/types/card_disabled_event_data' +require_relative 'square/types/card_disabled_event' +require_relative 'square/types/card_forgotten_event_card' +require_relative 'square/types/card_forgotten_event_object' +require_relative 'square/types/card_forgotten_event_data' +require_relative 'square/types/card_forgotten_event' +require_relative 'square/types/card_updated_event_object' +require_relative 'square/types/card_updated_event_data' +require_relative 'square/types/card_updated_event' +require_relative 'square/types/cash_drawer_device' +require_relative 'square/types/cash_drawer_event_type' +require_relative 'square/types/cash_drawer_shift_state' +require_relative 'square/types/cash_drawer_shift' +require_relative 'square/types/cash_drawer_shift_event' +require_relative 'square/types/cash_drawer_shift_summary' +require_relative 'square/types/catalog_info_response_limits' +require_relative 'square/types/standard_unit_description' +require_relative 'square/types/standard_unit_description_group' +require_relative 'square/types/catalog_info_response' +require_relative 'square/types/catalog_object_batch' +require_relative 'square/types/catalog_object_reference' +require_relative 'square/types/catalog_query_exact' +require_relative 'square/types/catalog_query_item_variations_for_item_option_values' +require_relative 'square/types/catalog_query_items_for_item_options' +require_relative 'square/types/catalog_query_items_for_modifier_list' +require_relative 'square/types/catalog_query_items_for_tax' +require_relative 'square/types/catalog_query_prefix' +require_relative 'square/types/catalog_query_range' +require_relative 'square/types/catalog_query_set' +require_relative 'square/types/sort_order' +require_relative 'square/types/catalog_query_sorted_attribute' +require_relative 'square/types/catalog_query_text' +require_relative 'square/types/catalog_query' +require_relative 'square/types/catalog_version_updated_event_catalog_version' +require_relative 'square/types/catalog_version_updated_event_object' +require_relative 'square/types/catalog_version_updated_event_data' +require_relative 'square/types/catalog_version_updated_event' +require_relative 'square/types/change_billing_anchor_date_response' +require_relative 'square/types/change_timing' +require_relative 'square/types/charge_request_additional_recipient' +require_relative 'square/types/checkout' +require_relative 'square/types/checkout_location_settings_branding_button_shape' +require_relative 'square/types/checkout_location_settings_branding_header_type' +require_relative 'square/types/checkout_location_settings_branding' +require_relative 'square/types/checkout_location_settings_coupons' +require_relative 'square/types/checkout_location_settings_policy' +require_relative 'square/types/checkout_location_settings_tipping' +require_relative 'square/types/checkout_location_settings' +require_relative 'square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range' +require_relative 'square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay' +require_relative 'square/types/checkout_merchant_settings_payment_methods_payment_method' +require_relative 'square/types/checkout_merchant_settings_payment_methods' +require_relative 'square/types/checkout_merchant_settings' +require_relative 'square/types/custom_field' +require_relative 'square/types/shipping_fee' +require_relative 'square/types/checkout_options' +require_relative 'square/types/clone_order_response' +require_relative 'square/types/complete_payment_response' +require_relative 'square/types/component_component_type' +require_relative 'square/types/device_component_details_application_details' +require_relative 'square/types/device_component_details_external_power' +require_relative 'square/types/device_component_details_battery_details' +require_relative 'square/types/device_component_details_card_reader_details' +require_relative 'square/types/device_component_details_ethernet_details' +require_relative 'square/types/device_component_details_measurement' +require_relative 'square/types/device_component_details_wi_fi_details' +require_relative 'square/types/component' +require_relative 'square/types/coordinates' +require_relative 'square/types/create_booking_custom_attribute_definition_response' +require_relative 'square/types/create_booking_response' +require_relative 'square/types/create_break_type_response' +require_relative 'square/types/create_card_response' +require_relative 'square/types/create_catalog_image_request' +require_relative 'square/types/create_catalog_image_response' +require_relative 'square/types/create_checkout_response' +require_relative 'square/types/create_customer_card_response' +require_relative 'square/types/create_customer_custom_attribute_definition_response' +require_relative 'square/types/customer_group' +require_relative 'square/types/create_customer_group_response' +require_relative 'square/types/device_code_status' +require_relative 'square/types/device_code' +require_relative 'square/types/create_device_code_response' +require_relative 'square/types/dispute_evidence_type' +require_relative 'square/types/create_dispute_evidence_file_request' +require_relative 'square/types/dispute_evidence_file' +require_relative 'square/types/dispute_evidence' +require_relative 'square/types/create_dispute_evidence_file_response' +require_relative 'square/types/create_dispute_evidence_text_response' +require_relative 'square/types/gift_card_activity_activate' +require_relative 'square/types/gift_card_activity_adjust_decrement_reason' +require_relative 'square/types/gift_card_activity_adjust_decrement' +require_relative 'square/types/gift_card_activity_adjust_increment_reason' +require_relative 'square/types/gift_card_activity_adjust_increment' +require_relative 'square/types/gift_card_activity_block' +require_relative 'square/types/gift_card_activity_clear_balance_reason' +require_relative 'square/types/gift_card_activity_clear_balance' +require_relative 'square/types/gift_card_activity_deactivate_reason' +require_relative 'square/types/gift_card_activity_deactivate' +require_relative 'square/types/gift_card_activity_import' +require_relative 'square/types/gift_card_activity_import_reversal' +require_relative 'square/types/gift_card_activity_load' +require_relative 'square/types/gift_card_activity_redeem_status' +require_relative 'square/types/gift_card_activity_redeem' +require_relative 'square/types/gift_card_activity_refund' +require_relative 'square/types/gift_card_activity_transfer_balance_from' +require_relative 'square/types/gift_card_activity_transfer_balance_to' +require_relative 'square/types/gift_card_activity_type' +require_relative 'square/types/gift_card_activity_unblock' +require_relative 'square/types/gift_card_activity_unlinked_activity_refund' +require_relative 'square/types/gift_card_activity' +require_relative 'square/types/create_gift_card_activity_response' +require_relative 'square/types/gift_card_gan_source' +require_relative 'square/types/gift_card_status' +require_relative 'square/types/gift_card_type' +require_relative 'square/types/gift_card' +require_relative 'square/types/create_gift_card_response' +require_relative 'square/types/create_invoice_attachment_request_data' +require_relative 'square/types/create_invoice_attachment_response' +require_relative 'square/types/create_invoice_response' +require_relative 'square/types/job' +require_relative 'square/types/create_job_response' +require_relative 'square/types/create_location_custom_attribute_definition_response' +require_relative 'square/types/location_capability' +require_relative 'square/types/location_status' +require_relative 'square/types/location_type' +require_relative 'square/types/tax_ids' +require_relative 'square/types/location' +require_relative 'square/types/create_location_response' +require_relative 'square/types/loyalty_account_expiring_point_deadline' +require_relative 'square/types/loyalty_account_mapping' +require_relative 'square/types/loyalty_account' +require_relative 'square/types/create_loyalty_account_response' +require_relative 'square/types/create_loyalty_promotion_response' +require_relative 'square/types/loyalty_reward_status' +require_relative 'square/types/loyalty_reward' +require_relative 'square/types/create_loyalty_reward_response' +require_relative 'square/types/create_merchant_custom_attribute_definition_response' +require_relative 'square/types/create_mobile_authorization_code_response' +require_relative 'square/types/create_order_custom_attribute_definition_response' +require_relative 'square/types/create_order_request' +require_relative 'square/types/create_order_response' +require_relative 'square/types/pre_populated_data' +require_relative 'square/types/payment_link' +require_relative 'square/types/payment_link_related_resources' +require_relative 'square/types/create_payment_link_response' +require_relative 'square/types/create_payment_response' +require_relative 'square/types/create_scheduled_shift_response' +require_relative 'square/types/shift_status' +require_relative 'square/types/shift_wage' +require_relative 'square/types/shift' +require_relative 'square/types/create_shift_response' +require_relative 'square/types/create_subscription_response' +require_relative 'square/types/create_team_member_request' +require_relative 'square/types/create_terminal_action_response' +require_relative 'square/types/create_terminal_checkout_response' +require_relative 'square/types/create_terminal_refund_response' +require_relative 'square/types/timecard_status' +require_relative 'square/types/timecard_wage' +require_relative 'square/types/timecard' +require_relative 'square/types/create_timecard_response' +require_relative 'square/types/webhook_subscription' +require_relative 'square/types/create_webhook_subscription_response' +require_relative 'square/types/range' +require_relative 'square/types/custom_attribute_filter' +require_relative 'square/types/customer_text_filter' +require_relative 'square/types/customer_address_filter' +require_relative 'square/types/customer_created_event_event_context_merge' +require_relative 'square/types/customer_created_event_event_context' +require_relative 'square/types/customer_created_event_object' +require_relative 'square/types/customer_created_event_data' +require_relative 'square/types/customer_created_event' +require_relative 'square/types/customer_inclusion_exclusion' +require_relative 'square/types/customer_creation_source_filter' +require_relative 'square/types/customer_custom_attribute_definition_created_event' +require_relative 'square/types/customer_custom_attribute_definition_created_public_event' +require_relative 'square/types/customer_custom_attribute_definition_deleted_event' +require_relative 'square/types/customer_custom_attribute_definition_deleted_public_event' +require_relative 'square/types/customer_custom_attribute_definition_owned_created_event' +require_relative 'square/types/customer_custom_attribute_definition_owned_deleted_event' +require_relative 'square/types/customer_custom_attribute_definition_owned_updated_event' +require_relative 'square/types/customer_custom_attribute_definition_updated_event' +require_relative 'square/types/customer_custom_attribute_definition_updated_public_event' +require_relative 'square/types/customer_custom_attribute_definition_visible_created_event' +require_relative 'square/types/customer_custom_attribute_definition_visible_deleted_event' +require_relative 'square/types/customer_custom_attribute_definition_visible_updated_event' +require_relative 'square/types/customer_custom_attribute_deleted_event' +require_relative 'square/types/customer_custom_attribute_deleted_public_event' +require_relative 'square/types/filter_value' +require_relative 'square/types/float_number_range' +require_relative 'square/types/time_range' +require_relative 'square/types/customer_custom_attribute_filter_value' +require_relative 'square/types/customer_custom_attribute_filter' +require_relative 'square/types/customer_custom_attribute_filters' +require_relative 'square/types/customer_custom_attribute_owned_deleted_event' +require_relative 'square/types/customer_custom_attribute_owned_updated_event' +require_relative 'square/types/customer_custom_attribute_updated_event' +require_relative 'square/types/customer_custom_attribute_updated_public_event' +require_relative 'square/types/customer_custom_attribute_visible_deleted_event' +require_relative 'square/types/customer_custom_attribute_visible_updated_event' +require_relative 'square/types/customer_deleted_event_event_context_merge' +require_relative 'square/types/customer_deleted_event_event_context' +require_relative 'square/types/customer_deleted_event_object' +require_relative 'square/types/customer_deleted_event_data' +require_relative 'square/types/customer_deleted_event' +require_relative 'square/types/customer_details' +require_relative 'square/types/customer_filter' +require_relative 'square/types/customer_sort_field' +require_relative 'square/types/customer_sort' +require_relative 'square/types/customer_query' +require_relative 'square/types/customer_segment' +require_relative 'square/types/customer_updated_event_object' +require_relative 'square/types/customer_updated_event_data' +require_relative 'square/types/customer_updated_event' +require_relative 'square/types/date_range' +require_relative 'square/types/delete_booking_custom_attribute_definition_response' +require_relative 'square/types/delete_booking_custom_attribute_response' +require_relative 'square/types/delete_break_type_response' +require_relative 'square/types/delete_catalog_object_response' +require_relative 'square/types/delete_customer_card_response' +require_relative 'square/types/delete_customer_custom_attribute_definition_response' +require_relative 'square/types/delete_customer_custom_attribute_response' +require_relative 'square/types/delete_customer_group_response' +require_relative 'square/types/delete_dispute_evidence_response' +require_relative 'square/types/delete_invoice_attachment_response' +require_relative 'square/types/delete_invoice_response' +require_relative 'square/types/delete_location_custom_attribute_definition_response' +require_relative 'square/types/delete_location_custom_attribute_response' +require_relative 'square/types/delete_loyalty_reward_response' +require_relative 'square/types/delete_merchant_custom_attribute_definition_response' +require_relative 'square/types/delete_merchant_custom_attribute_response' +require_relative 'square/types/delete_order_custom_attribute_definition_response' +require_relative 'square/types/delete_payment_link_response' +require_relative 'square/types/delete_shift_response' +require_relative 'square/types/delete_snippet_response' +require_relative 'square/types/delete_subscription_action_response' +require_relative 'square/types/delete_timecard_response' +require_relative 'square/types/delete_webhook_subscription_response' +require_relative 'square/types/destination_type' +require_relative 'square/types/destination' +require_relative 'square/types/destination_details_card_refund_details' +require_relative 'square/types/destination_details_cash_refund_details' +require_relative 'square/types/destination_details_external_refund_details' +require_relative 'square/types/destination_details' +require_relative 'square/types/device_attributes' +require_relative 'square/types/device_status_category' +require_relative 'square/types/device_status' +require_relative 'square/types/device' +require_relative 'square/types/device_code_paired_event_object' +require_relative 'square/types/device_code_paired_event_data' +require_relative 'square/types/device_code_paired_event' +require_relative 'square/types/device_created_event_object' +require_relative 'square/types/device_created_event_data' +require_relative 'square/types/device_created_event' +require_relative 'square/types/disable_card_response' +require_relative 'square/types/disable_events_response' +require_relative 'square/types/dismiss_terminal_action_response' +require_relative 'square/types/dismiss_terminal_checkout_response' +require_relative 'square/types/dismiss_terminal_refund_response' +require_relative 'square/types/dispute_created_event_object' +require_relative 'square/types/dispute_created_event_data' +require_relative 'square/types/dispute_created_event' +require_relative 'square/types/dispute_evidence_added_event_object' +require_relative 'square/types/dispute_evidence_added_event_data' +require_relative 'square/types/dispute_evidence_added_event' +require_relative 'square/types/dispute_evidence_created_event_object' +require_relative 'square/types/dispute_evidence_created_event_data' +require_relative 'square/types/dispute_evidence_created_event' +require_relative 'square/types/dispute_evidence_deleted_event_object' +require_relative 'square/types/dispute_evidence_deleted_event_data' +require_relative 'square/types/dispute_evidence_deleted_event' +require_relative 'square/types/dispute_evidence_removed_event_object' +require_relative 'square/types/dispute_evidence_removed_event_data' +require_relative 'square/types/dispute_evidence_removed_event' +require_relative 'square/types/dispute_state_changed_event_object' +require_relative 'square/types/dispute_state_changed_event_data' +require_relative 'square/types/dispute_state_changed_event' +require_relative 'square/types/dispute_state_updated_event_object' +require_relative 'square/types/dispute_state_updated_event_data' +require_relative 'square/types/dispute_state_updated_event' +require_relative 'square/types/ecom_visibility' +require_relative 'square/types/employee_status' +require_relative 'square/types/employee' +require_relative 'square/types/employee_wage' +require_relative 'square/types/enable_events_response' +require_relative 'square/types/event_data' +require_relative 'square/types/event' +require_relative 'square/types/event_metadata' +require_relative 'square/types/event_type_metadata' +require_relative 'square/types/get_bank_account_by_v_1_id_response' +require_relative 'square/types/get_bank_account_response' +require_relative 'square/types/get_break_type_response' +require_relative 'square/types/get_device_code_response' +require_relative 'square/types/get_device_response' +require_relative 'square/types/get_employee_wage_response' +require_relative 'square/types/get_invoice_response' +require_relative 'square/types/payment_refund' +require_relative 'square/types/get_payment_refund_response' +require_relative 'square/types/get_payment_response' +require_relative 'square/types/payout_fee_type' +require_relative 'square/types/payout_fee' +require_relative 'square/types/payout_status' +require_relative 'square/types/payout_type' +require_relative 'square/types/payout' +require_relative 'square/types/get_payout_response' +require_relative 'square/types/get_shift_response' +require_relative 'square/types/team_member_wage' +require_relative 'square/types/get_team_member_wage_response' +require_relative 'square/types/get_terminal_action_response' +require_relative 'square/types/get_terminal_checkout_response' +require_relative 'square/types/get_terminal_refund_response' +require_relative 'square/types/gift_card_activity_created_event_object' +require_relative 'square/types/gift_card_activity_created_event_data' +require_relative 'square/types/gift_card_activity_created_event' +require_relative 'square/types/gift_card_activity_updated_event_object' +require_relative 'square/types/gift_card_activity_updated_event_data' +require_relative 'square/types/gift_card_activity_updated_event' +require_relative 'square/types/gift_card_created_event_object' +require_relative 'square/types/gift_card_created_event_data' +require_relative 'square/types/gift_card_created_event' +require_relative 'square/types/gift_card_customer_linked_event_object' +require_relative 'square/types/gift_card_customer_linked_event_data' +require_relative 'square/types/gift_card_customer_linked_event' +require_relative 'square/types/gift_card_customer_unlinked_event_object' +require_relative 'square/types/gift_card_customer_unlinked_event_data' +require_relative 'square/types/gift_card_customer_unlinked_event' +require_relative 'square/types/gift_card_updated_event_object' +require_relative 'square/types/gift_card_updated_event_data' +require_relative 'square/types/gift_card_updated_event' +require_relative 'square/types/inventory_count_updated_event_object' +require_relative 'square/types/inventory_count_updated_event_data' +require_relative 'square/types/inventory_count_updated_event' +require_relative 'square/types/invoice_canceled_event_object' +require_relative 'square/types/invoice_canceled_event_data' +require_relative 'square/types/invoice_canceled_event' +require_relative 'square/types/invoice_created_event_object' +require_relative 'square/types/invoice_created_event_data' +require_relative 'square/types/invoice_created_event' +require_relative 'square/types/invoice_deleted_event_data' +require_relative 'square/types/invoice_deleted_event' +require_relative 'square/types/invoice_filter' +require_relative 'square/types/invoice_payment_made_event_object' +require_relative 'square/types/invoice_payment_made_event_data' +require_relative 'square/types/invoice_payment_made_event' +require_relative 'square/types/invoice_published_event_object' +require_relative 'square/types/invoice_published_event_data' +require_relative 'square/types/invoice_published_event' +require_relative 'square/types/invoice_sort' +require_relative 'square/types/invoice_query' +require_relative 'square/types/invoice_refunded_event_object' +require_relative 'square/types/invoice_refunded_event_data' +require_relative 'square/types/invoice_refunded_event' +require_relative 'square/types/invoice_scheduled_charge_failed_event_object' +require_relative 'square/types/invoice_scheduled_charge_failed_event_data' +require_relative 'square/types/invoice_scheduled_charge_failed_event' +require_relative 'square/types/invoice_updated_event_object' +require_relative 'square/types/invoice_updated_event_data' +require_relative 'square/types/invoice_updated_event' +require_relative 'square/types/job_created_event_object' +require_relative 'square/types/job_created_event_data' +require_relative 'square/types/job_created_event' +require_relative 'square/types/job_updated_event_object' +require_relative 'square/types/job_updated_event_data' +require_relative 'square/types/job_updated_event' +require_relative 'square/types/labor_scheduled_shift_created_event_object' +require_relative 'square/types/labor_scheduled_shift_created_event_data' +require_relative 'square/types/labor_scheduled_shift_created_event' +require_relative 'square/types/labor_scheduled_shift_deleted_event_data' +require_relative 'square/types/labor_scheduled_shift_deleted_event' +require_relative 'square/types/labor_scheduled_shift_published_event_object' +require_relative 'square/types/labor_scheduled_shift_published_event_data' +require_relative 'square/types/labor_scheduled_shift_published_event' +require_relative 'square/types/labor_scheduled_shift_updated_event_object' +require_relative 'square/types/labor_scheduled_shift_updated_event_data' +require_relative 'square/types/labor_scheduled_shift_updated_event' +require_relative 'square/types/labor_shift_created_event_object' +require_relative 'square/types/labor_shift_created_event_data' +require_relative 'square/types/labor_shift_created_event' +require_relative 'square/types/labor_shift_deleted_event_data' +require_relative 'square/types/labor_shift_deleted_event' +require_relative 'square/types/labor_shift_updated_event_object' +require_relative 'square/types/labor_shift_updated_event_data' +require_relative 'square/types/labor_shift_updated_event' +require_relative 'square/types/labor_timecard_created_event_object' +require_relative 'square/types/labor_timecard_created_event_data' +require_relative 'square/types/labor_timecard_created_event' +require_relative 'square/types/labor_timecard_deleted_event_data' +require_relative 'square/types/labor_timecard_deleted_event' +require_relative 'square/types/labor_timecard_updated_event_object' +require_relative 'square/types/labor_timecard_updated_event_data' +require_relative 'square/types/labor_timecard_updated_event' +require_relative 'square/types/link_customer_to_gift_card_response' +require_relative 'square/types/list_bank_accounts_response' +require_relative 'square/types/list_booking_custom_attribute_definitions_response' +require_relative 'square/types/list_booking_custom_attributes_response' +require_relative 'square/types/list_bookings_response' +require_relative 'square/types/list_break_types_response' +require_relative 'square/types/list_cards_response' +require_relative 'square/types/list_cash_drawer_shift_events_response' +require_relative 'square/types/list_cash_drawer_shifts_response' +require_relative 'square/types/list_catalog_response' +require_relative 'square/types/list_customer_custom_attribute_definitions_response' +require_relative 'square/types/list_customer_custom_attributes_response' +require_relative 'square/types/list_customer_groups_response' +require_relative 'square/types/list_customer_segments_response' +require_relative 'square/types/list_customers_response' +require_relative 'square/types/list_device_codes_response' +require_relative 'square/types/list_devices_response' +require_relative 'square/types/list_dispute_evidence_response' +require_relative 'square/types/list_disputes_response' +require_relative 'square/types/list_employee_wages_response' +require_relative 'square/types/list_employees_response' +require_relative 'square/types/list_event_types_response' +require_relative 'square/types/list_gift_card_activities_response' +require_relative 'square/types/list_gift_cards_response' +require_relative 'square/types/list_invoices_response' +require_relative 'square/types/list_jobs_response' +require_relative 'square/types/location_booking_profile' +require_relative 'square/types/list_location_booking_profiles_response' +require_relative 'square/types/list_location_custom_attribute_definitions_response' +require_relative 'square/types/list_location_custom_attributes_response' +require_relative 'square/types/list_locations_response' +require_relative 'square/types/loyalty_program_accrual_rule_category_data' +require_relative 'square/types/loyalty_program_accrual_rule_item_variation_data' +require_relative 'square/types/loyalty_program_accrual_rule_tax_mode' +require_relative 'square/types/loyalty_program_accrual_rule_spend_data' +require_relative 'square/types/loyalty_program_accrual_rule_type' +require_relative 'square/types/loyalty_program_accrual_rule_visit_data' +require_relative 'square/types/loyalty_program_accrual_rule' +require_relative 'square/types/loyalty_program_expiration_policy' +require_relative 'square/types/loyalty_program_reward_tier' +require_relative 'square/types/loyalty_program_status' +require_relative 'square/types/loyalty_program_terminology' +require_relative 'square/types/loyalty_program' +require_relative 'square/types/list_loyalty_programs_response' +require_relative 'square/types/list_loyalty_promotions_response' +require_relative 'square/types/list_merchant_custom_attribute_definitions_response' +require_relative 'square/types/list_merchant_custom_attributes_response' +require_relative 'square/types/merchant_status' +require_relative 'square/types/merchant' +require_relative 'square/types/list_merchants_response' +require_relative 'square/types/list_order_custom_attribute_definitions_response' +require_relative 'square/types/list_order_custom_attributes_response' +require_relative 'square/types/list_payment_links_response' +require_relative 'square/types/list_payment_refunds_request_sort_field' +require_relative 'square/types/list_payment_refunds_response' +require_relative 'square/types/list_payments_request_sort_field' +require_relative 'square/types/list_payments_response' +require_relative 'square/types/payment_balance_activity_app_fee_refund_detail' +require_relative 'square/types/payment_balance_activity_app_fee_revenue_detail' +require_relative 'square/types/payment_balance_activity_automatic_savings_detail' +require_relative 'square/types/payment_balance_activity_automatic_savings_reversed_detail' +require_relative 'square/types/payment_balance_activity_charge_detail' +require_relative 'square/types/payment_balance_activity_deposit_fee_detail' +require_relative 'square/types/payment_balance_activity_deposit_fee_reversed_detail' +require_relative 'square/types/payment_balance_activity_dispute_detail' +require_relative 'square/types/payment_balance_activity_fee_detail' +require_relative 'square/types/payment_balance_activity_free_processing_detail' +require_relative 'square/types/payment_balance_activity_hold_adjustment_detail' +require_relative 'square/types/payment_balance_activity_open_dispute_detail' +require_relative 'square/types/payment_balance_activity_other_adjustment_detail' +require_relative 'square/types/payment_balance_activity_other_detail' +require_relative 'square/types/payment_balance_activity_refund_detail' +require_relative 'square/types/payment_balance_activity_release_adjustment_detail' +require_relative 'square/types/payment_balance_activity_reserve_hold_detail' +require_relative 'square/types/payment_balance_activity_reserve_release_detail' +require_relative 'square/types/payment_balance_activity_square_capital_payment_detail' +require_relative 'square/types/payment_balance_activity_square_capital_reversed_payment_detail' +require_relative 'square/types/payment_balance_activity_square_payroll_transfer_detail' +require_relative 'square/types/payment_balance_activity_square_payroll_transfer_reversed_detail' +require_relative 'square/types/payment_balance_activity_tax_on_fee_detail' +require_relative 'square/types/payment_balance_activity_third_party_fee_detail' +require_relative 'square/types/payment_balance_activity_third_party_fee_refund_detail' +require_relative 'square/types/payout_entry' +require_relative 'square/types/list_payout_entries_response' +require_relative 'square/types/list_payouts_response' +require_relative 'square/types/site' +require_relative 'square/types/list_sites_response' +require_relative 'square/types/subscription_event_info_code' +require_relative 'square/types/subscription_event_info' +require_relative 'square/types/subscription_event_subscription_event_type' +require_relative 'square/types/subscription_event' +require_relative 'square/types/list_subscription_events_response' +require_relative 'square/types/list_team_member_booking_profiles_response' +require_relative 'square/types/list_team_member_wages_response' +require_relative 'square/types/transaction_product' +require_relative 'square/types/transaction' +require_relative 'square/types/list_transactions_response' +require_relative 'square/types/list_webhook_event_types_response' +require_relative 'square/types/list_webhook_subscriptions_response' +require_relative 'square/types/weekday' +require_relative 'square/types/workweek_config' +require_relative 'square/types/list_workweek_configs_response' +require_relative 'square/types/location_created_event_data' +require_relative 'square/types/location_created_event' +require_relative 'square/types/location_custom_attribute_definition_owned_created_event' +require_relative 'square/types/location_custom_attribute_definition_owned_deleted_event' +require_relative 'square/types/location_custom_attribute_definition_owned_updated_event' +require_relative 'square/types/location_custom_attribute_definition_visible_created_event' +require_relative 'square/types/location_custom_attribute_definition_visible_deleted_event' +require_relative 'square/types/location_custom_attribute_definition_visible_updated_event' +require_relative 'square/types/location_custom_attribute_owned_deleted_event' +require_relative 'square/types/location_custom_attribute_owned_updated_event' +require_relative 'square/types/location_custom_attribute_visible_deleted_event' +require_relative 'square/types/location_custom_attribute_visible_updated_event' +require_relative 'square/types/location_settings_updated_event_object' +require_relative 'square/types/location_settings_updated_event_data' +require_relative 'square/types/location_settings_updated_event' +require_relative 'square/types/location_updated_event_data' +require_relative 'square/types/location_updated_event' +require_relative 'square/types/loyalty_account_created_event_object' +require_relative 'square/types/loyalty_account_created_event_data' +require_relative 'square/types/loyalty_account_created_event' +require_relative 'square/types/loyalty_account_deleted_event_object' +require_relative 'square/types/loyalty_account_deleted_event_data' +require_relative 'square/types/loyalty_account_deleted_event' +require_relative 'square/types/loyalty_account_updated_event_object' +require_relative 'square/types/loyalty_account_updated_event_data' +require_relative 'square/types/loyalty_account_updated_event' +require_relative 'square/types/loyalty_event_created_event_object' +require_relative 'square/types/loyalty_event_created_event_data' +require_relative 'square/types/loyalty_event_created_event' +require_relative 'square/types/loyalty_event_date_time_filter' +require_relative 'square/types/loyalty_event_location_filter' +require_relative 'square/types/loyalty_event_loyalty_account_filter' +require_relative 'square/types/loyalty_event_order_filter' +require_relative 'square/types/loyalty_event_type_filter' +require_relative 'square/types/loyalty_event_filter' +require_relative 'square/types/loyalty_event_query' +require_relative 'square/types/loyalty_program_created_event_object' +require_relative 'square/types/loyalty_program_created_event_data' +require_relative 'square/types/loyalty_program_created_event' +require_relative 'square/types/loyalty_program_updated_event_object' +require_relative 'square/types/loyalty_program_updated_event_data' +require_relative 'square/types/loyalty_program_updated_event' +require_relative 'square/types/loyalty_promotion_created_event_object' +require_relative 'square/types/loyalty_promotion_created_event_data' +require_relative 'square/types/loyalty_promotion_created_event' +require_relative 'square/types/loyalty_promotion_updated_event_object' +require_relative 'square/types/loyalty_promotion_updated_event_data' +require_relative 'square/types/loyalty_promotion_updated_event' +require_relative 'square/types/merchant_custom_attribute_definition_owned_created_event' +require_relative 'square/types/merchant_custom_attribute_definition_owned_deleted_event' +require_relative 'square/types/merchant_custom_attribute_definition_owned_updated_event' +require_relative 'square/types/merchant_custom_attribute_definition_visible_created_event' +require_relative 'square/types/merchant_custom_attribute_definition_visible_deleted_event' +require_relative 'square/types/merchant_custom_attribute_definition_visible_updated_event' +require_relative 'square/types/merchant_custom_attribute_owned_deleted_event' +require_relative 'square/types/merchant_custom_attribute_owned_updated_event' +require_relative 'square/types/merchant_custom_attribute_visible_deleted_event' +require_relative 'square/types/merchant_custom_attribute_visible_updated_event' +require_relative 'square/types/merchant_settings_updated_event_object' +require_relative 'square/types/merchant_settings_updated_event_data' +require_relative 'square/types/merchant_settings_updated_event' +require_relative 'square/types/oauth_authorization_revoked_event_revoker_type' +require_relative 'square/types/oauth_authorization_revoked_event_revocation_object' +require_relative 'square/types/oauth_authorization_revoked_event_object' +require_relative 'square/types/oauth_authorization_revoked_event_data' +require_relative 'square/types/oauth_authorization_revoked_event' +require_relative 'square/types/obtain_token_response' +require_relative 'square/types/order_created' +require_relative 'square/types/order_created_object' +require_relative 'square/types/order_created_event_data' +require_relative 'square/types/order_created_event' +require_relative 'square/types/order_custom_attribute_definition_owned_created_event' +require_relative 'square/types/order_custom_attribute_definition_owned_deleted_event' +require_relative 'square/types/order_custom_attribute_definition_owned_updated_event' +require_relative 'square/types/order_custom_attribute_definition_visible_created_event' +require_relative 'square/types/order_custom_attribute_definition_visible_deleted_event' +require_relative 'square/types/order_custom_attribute_definition_visible_updated_event' +require_relative 'square/types/order_custom_attribute_owned_deleted_event' +require_relative 'square/types/order_custom_attribute_owned_updated_event' +require_relative 'square/types/order_custom_attribute_visible_deleted_event' +require_relative 'square/types/order_custom_attribute_visible_updated_event' +require_relative 'square/types/order_entry' +require_relative 'square/types/order_fulfillment_delivery_details_schedule_type' +require_relative 'square/types/order_fulfillment_fulfillment_line_item_application' +require_relative 'square/types/order_fulfillment_pickup_details_schedule_type' +require_relative 'square/types/order_fulfillment_state' +require_relative 'square/types/order_fulfillment_type' +require_relative 'square/types/order_fulfillment_updated_update' +require_relative 'square/types/order_fulfillment_updated' +require_relative 'square/types/order_fulfillment_updated_object' +require_relative 'square/types/order_fulfillment_updated_event_data' +require_relative 'square/types/order_fulfillment_updated_event' +require_relative 'square/types/order_updated' +require_relative 'square/types/order_updated_object' +require_relative 'square/types/order_updated_event_data' +require_relative 'square/types/order_updated_event' +require_relative 'square/types/pause_subscription_response' +require_relative 'square/types/pay_order_response' +require_relative 'square/types/payment_created_event_object' +require_relative 'square/types/payment_created_event_data' +require_relative 'square/types/payment_created_event' +require_relative 'square/types/payment_updated_event_object' +require_relative 'square/types/payment_updated_event_data' +require_relative 'square/types/payment_updated_event' +require_relative 'square/types/payout_failed_event_object' +require_relative 'square/types/payout_failed_event_data' +require_relative 'square/types/payout_failed_event' +require_relative 'square/types/payout_paid_event_object' +require_relative 'square/types/payout_paid_event_data' +require_relative 'square/types/payout_paid_event' +require_relative 'square/types/payout_sent_event_object' +require_relative 'square/types/payout_sent_event_data' +require_relative 'square/types/payout_sent_event' +require_relative 'square/types/phase_input' +require_relative 'square/types/publish_invoice_response' +require_relative 'square/types/quick_pay' +require_relative 'square/types/redeem_loyalty_reward_response' +require_relative 'square/types/refund_created_event_object' +require_relative 'square/types/refund_created_event_data' +require_relative 'square/types/refund_created_event' +require_relative 'square/types/refund_payment_response' +require_relative 'square/types/refund_updated_event_object' +require_relative 'square/types/refund_updated_event_data' +require_relative 'square/types/refund_updated_event' +require_relative 'square/types/register_domain_response_status' +require_relative 'square/types/register_domain_response' +require_relative 'square/types/remove_group_from_customer_response' +require_relative 'square/types/resume_subscription_response' +require_relative 'square/types/retrieve_booking_custom_attribute_definition_response' +require_relative 'square/types/retrieve_booking_custom_attribute_response' +require_relative 'square/types/get_business_booking_profile_response' +require_relative 'square/types/get_card_response' +require_relative 'square/types/get_cash_drawer_shift_response' +require_relative 'square/types/get_catalog_object_response' +require_relative 'square/types/get_customer_custom_attribute_definition_response' +require_relative 'square/types/get_customer_custom_attribute_response' +require_relative 'square/types/get_customer_group_response' +require_relative 'square/types/get_customer_segment_response' +require_relative 'square/types/get_dispute_evidence_response' +require_relative 'square/types/get_dispute_response' +require_relative 'square/types/get_employee_response' +require_relative 'square/types/get_gift_card_from_gan_response' +require_relative 'square/types/get_gift_card_from_nonce_response' +require_relative 'square/types/get_gift_card_response' +require_relative 'square/types/get_inventory_adjustment_response' +require_relative 'square/types/get_inventory_changes_response' +require_relative 'square/types/get_inventory_count_response' +require_relative 'square/types/get_inventory_physical_count_response' +require_relative 'square/types/get_inventory_transfer_response' +require_relative 'square/types/retrieve_job_response' +require_relative 'square/types/retrieve_location_booking_profile_response' +require_relative 'square/types/retrieve_location_custom_attribute_definition_response' +require_relative 'square/types/retrieve_location_custom_attribute_response' +require_relative 'square/types/get_location_response' +require_relative 'square/types/retrieve_location_settings_response' +require_relative 'square/types/get_loyalty_account_response' +require_relative 'square/types/get_loyalty_program_response' +require_relative 'square/types/get_loyalty_promotion_response' +require_relative 'square/types/get_loyalty_reward_response' +require_relative 'square/types/retrieve_merchant_custom_attribute_definition_response' +require_relative 'square/types/retrieve_merchant_custom_attribute_response' +require_relative 'square/types/get_merchant_response' +require_relative 'square/types/retrieve_merchant_settings_response' +require_relative 'square/types/retrieve_order_custom_attribute_definition_response' +require_relative 'square/types/retrieve_order_custom_attribute_response' +require_relative 'square/types/get_order_response' +require_relative 'square/types/get_payment_link_response' +require_relative 'square/types/retrieve_scheduled_shift_response' +require_relative 'square/types/snippet' +require_relative 'square/types/get_snippet_response' +require_relative 'square/types/get_subscription_response' +require_relative 'square/types/get_team_member_response' +require_relative 'square/types/retrieve_timecard_response' +require_relative 'square/types/retrieve_token_status_response' +require_relative 'square/types/get_transaction_response' +require_relative 'square/types/get_wage_setting_response' +require_relative 'square/types/get_webhook_subscription_response' +require_relative 'square/types/revoke_token_response' +require_relative 'square/types/scheduled_shift_filter_assignment_status' +require_relative 'square/types/scheduled_shift_filter_scheduled_shift_status' +require_relative 'square/types/scheduled_shift_workday_matcher' +require_relative 'square/types/scheduled_shift_workday' +require_relative 'square/types/scheduled_shift_filter' +require_relative 'square/types/scheduled_shift_notification_audience' +require_relative 'square/types/scheduled_shift_sort_field' +require_relative 'square/types/scheduled_shift_sort' +require_relative 'square/types/scheduled_shift_query' +require_relative 'square/types/segment_filter' +require_relative 'square/types/search_availability_filter' +require_relative 'square/types/search_availability_query' +require_relative 'square/types/search_availability_response' +require_relative 'square/types/search_catalog_items_request_stock_level' +require_relative 'square/types/search_catalog_items_response' +require_relative 'square/types/search_catalog_objects_response' +require_relative 'square/types/search_customers_response' +require_relative 'square/types/search_events_filter' +require_relative 'square/types/search_events_sort' +require_relative 'square/types/search_events_query' +require_relative 'square/types/search_events_response' +require_relative 'square/types/search_invoices_response' +require_relative 'square/types/search_loyalty_accounts_request_loyalty_account_query' +require_relative 'square/types/search_loyalty_accounts_response' +require_relative 'square/types/search_loyalty_events_response' +require_relative 'square/types/search_loyalty_rewards_request_loyalty_reward_query' +require_relative 'square/types/search_loyalty_rewards_response' +require_relative 'square/types/search_orders_customer_filter' +require_relative 'square/types/search_orders_date_time_filter' +require_relative 'square/types/search_orders_fulfillment_filter' +require_relative 'square/types/search_orders_source_filter' +require_relative 'square/types/search_orders_state_filter' +require_relative 'square/types/search_orders_filter' +require_relative 'square/types/search_orders_sort_field' +require_relative 'square/types/search_orders_sort' +require_relative 'square/types/search_orders_query' +require_relative 'square/types/search_orders_response' +require_relative 'square/types/search_scheduled_shifts_response' +require_relative 'square/types/search_shifts_response' +require_relative 'square/types/search_subscriptions_filter' +require_relative 'square/types/search_subscriptions_query' +require_relative 'square/types/search_subscriptions_response' +require_relative 'square/types/search_team_members_filter' +require_relative 'square/types/search_team_members_query' +require_relative 'square/types/search_team_members_response' +require_relative 'square/types/search_terminal_actions_response' +require_relative 'square/types/search_terminal_checkouts_response' +require_relative 'square/types/search_terminal_refunds_response' +require_relative 'square/types/search_timecards_response' +require_relative 'square/types/search_vendors_request_filter' +require_relative 'square/types/search_vendors_request_sort_field' +require_relative 'square/types/search_vendors_request_sort' +require_relative 'square/types/search_vendors_response' +require_relative 'square/types/shift_filter_status' +require_relative 'square/types/shift_workday_matcher' +require_relative 'square/types/shift_workday' +require_relative 'square/types/shift_filter' +require_relative 'square/types/shift_sort_field' +require_relative 'square/types/shift_sort' +require_relative 'square/types/shift_query' +require_relative 'square/types/submit_evidence_response' +require_relative 'square/types/subscription_created_event_object' +require_relative 'square/types/subscription_created_event_data' +require_relative 'square/types/subscription_created_event' +require_relative 'square/types/subscription_test_result' +require_relative 'square/types/subscription_updated_event_object' +require_relative 'square/types/subscription_updated_event_data' +require_relative 'square/types/subscription_updated_event' +require_relative 'square/types/swap_plan_response' +require_relative 'square/types/team_member_created_event_object' +require_relative 'square/types/team_member_created_event_data' +require_relative 'square/types/team_member_created_event' +require_relative 'square/types/team_member_invitation_status' +require_relative 'square/types/team_member_updated_event_object' +require_relative 'square/types/team_member_updated_event_data' +require_relative 'square/types/team_member_updated_event' +require_relative 'square/types/team_member_wage_setting_updated_event_object' +require_relative 'square/types/team_member_wage_setting_updated_event_data' +require_relative 'square/types/team_member_wage_setting_updated_event' +require_relative 'square/types/terminal_action_created_event_object' +require_relative 'square/types/terminal_action_created_event_data' +require_relative 'square/types/terminal_action_created_event' +require_relative 'square/types/terminal_action_query_filter' +require_relative 'square/types/terminal_action_query_sort' +require_relative 'square/types/terminal_action_query' +require_relative 'square/types/terminal_action_updated_event_object' +require_relative 'square/types/terminal_action_updated_event_data' +require_relative 'square/types/terminal_action_updated_event' +require_relative 'square/types/terminal_checkout_created_event_object' +require_relative 'square/types/terminal_checkout_created_event_data' +require_relative 'square/types/terminal_checkout_created_event' +require_relative 'square/types/terminal_checkout_query_filter' +require_relative 'square/types/terminal_checkout_query_sort' +require_relative 'square/types/terminal_checkout_query' +require_relative 'square/types/terminal_checkout_updated_event_object' +require_relative 'square/types/terminal_checkout_updated_event_data' +require_relative 'square/types/terminal_checkout_updated_event' +require_relative 'square/types/terminal_refund_created_event_object' +require_relative 'square/types/terminal_refund_created_event_data' +require_relative 'square/types/terminal_refund_created_event' +require_relative 'square/types/terminal_refund_query_filter' +require_relative 'square/types/terminal_refund_query_sort' +require_relative 'square/types/terminal_refund_query' +require_relative 'square/types/terminal_refund_updated_event_object' +require_relative 'square/types/terminal_refund_updated_event_data' +require_relative 'square/types/terminal_refund_updated_event' +require_relative 'square/types/test_webhook_subscription_response' +require_relative 'square/types/timecard_filter_status' +require_relative 'square/types/timecard_workday_matcher' +require_relative 'square/types/timecard_workday' +require_relative 'square/types/timecard_filter' +require_relative 'square/types/timecard_sort_field' +require_relative 'square/types/timecard_sort' +require_relative 'square/types/timecard_query' +require_relative 'square/types/transaction_type' +require_relative 'square/types/unlink_customer_from_gift_card_response' +require_relative 'square/types/update_booking_custom_attribute_definition_response' +require_relative 'square/types/update_booking_response' +require_relative 'square/types/update_break_type_response' +require_relative 'square/types/update_catalog_image_request' +require_relative 'square/types/update_catalog_image_response' +require_relative 'square/types/update_customer_custom_attribute_definition_response' +require_relative 'square/types/update_customer_group_response' +require_relative 'square/types/update_invoice_response' +require_relative 'square/types/update_item_modifier_lists_response' +require_relative 'square/types/update_item_taxes_response' +require_relative 'square/types/update_job_response' +require_relative 'square/types/update_location_custom_attribute_definition_response' +require_relative 'square/types/update_location_response' +require_relative 'square/types/update_location_settings_response' +require_relative 'square/types/update_merchant_custom_attribute_definition_response' +require_relative 'square/types/update_merchant_settings_response' +require_relative 'square/types/update_order_custom_attribute_definition_response' +require_relative 'square/types/update_order_response' +require_relative 'square/types/update_payment_link_response' +require_relative 'square/types/update_payment_response' +require_relative 'square/types/update_scheduled_shift_response' +require_relative 'square/types/update_shift_response' +require_relative 'square/types/update_subscription_response' +require_relative 'square/types/update_team_member_request' +require_relative 'square/types/update_timecard_response' +require_relative 'square/types/update_vendor_request' +require_relative 'square/types/update_wage_setting_response' +require_relative 'square/types/update_webhook_subscription_response' +require_relative 'square/types/update_webhook_subscription_signature_key_response' +require_relative 'square/types/update_workweek_config_response' +require_relative 'square/types/upsert_booking_custom_attribute_response' +require_relative 'square/types/upsert_catalog_object_response' +require_relative 'square/types/upsert_customer_custom_attribute_response' +require_relative 'square/types/upsert_location_custom_attribute_response' +require_relative 'square/types/upsert_merchant_custom_attribute_response' +require_relative 'square/types/upsert_snippet_response' +require_relative 'square/types/v_1_money' +require_relative 'square/types/v_1_order_history_entry_action' +require_relative 'square/types/v_1_order_history_entry' +require_relative 'square/types/v_1_order_state' +require_relative 'square/types/v_1_tender_card_brand' +require_relative 'square/types/v_1_tender_entry_method' +require_relative 'square/types/v_1_tender_type' +require_relative 'square/types/v_1_tender' +require_relative 'square/types/v_1_order' +require_relative 'square/types/v_1_update_order_request_action' +require_relative 'square/types/vendor_created_event_object' +require_relative 'square/types/vendor_created_event_data' +require_relative 'square/types/vendor_created_event' +require_relative 'square/types/vendor_updated_event_object' +require_relative 'square/types/vendor_updated_event_data' +require_relative 'square/types/vendor_updated_event' +require_relative 'square/types/visibility_filter' +require_relative 'square/types/void_transaction_response' +require_relative 'square/types/catalog_object_base' + +# Client Types +require_relative 'square/client' +require_relative 'square/mobile/client' +require_relative 'square/mobile/types/create_mobile_authorization_code_request' +require_relative 'square/o_auth/client' +require_relative 'square/o_auth/types/revoke_token_request' +require_relative 'square/o_auth/types/obtain_token_request' +require_relative 'square/v_1_transactions/client' +require_relative 'square/v_1_transactions/types/v_1_list_orders_request' +require_relative 'square/v_1_transactions/types/v_1_retrieve_order_request' +require_relative 'square/v_1_transactions/types/v_1_update_order_request' +require_relative 'square/apple_pay/client' +require_relative 'square/apple_pay/types/register_domain_request' +require_relative 'square/bank_accounts/client' +require_relative 'square/bank_accounts/types/list_bank_accounts_request' +require_relative 'square/bank_accounts/types/get_by_v_1_id_bank_accounts_request' +require_relative 'square/bank_accounts/types/get_bank_accounts_request' +require_relative 'square/bookings/client' +require_relative 'square/bookings/types/list_bookings_request' +require_relative 'square/bookings/types/create_booking_request' +require_relative 'square/bookings/types/search_availability_request' +require_relative 'square/bookings/types/bulk_retrieve_bookings_request' +require_relative 'square/bookings/types/retrieve_location_booking_profile_request' +require_relative 'square/bookings/types/bulk_retrieve_team_member_booking_profiles_request' +require_relative 'square/bookings/types/get_bookings_request' +require_relative 'square/bookings/types/update_booking_request' +require_relative 'square/bookings/types/cancel_booking_request' +require_relative 'square/cards/client' +require_relative 'square/cards/types/list_cards_request' +require_relative 'square/cards/types/create_card_request' +require_relative 'square/cards/types/get_cards_request' +require_relative 'square/cards/types/disable_cards_request' +require_relative 'square/catalog/client' +require_relative 'square/catalog/types/batch_delete_catalog_objects_request' +require_relative 'square/catalog/types/batch_get_catalog_objects_request' +require_relative 'square/catalog/types/batch_upsert_catalog_objects_request' +require_relative 'square/catalog/types/list_catalog_request' +require_relative 'square/catalog/types/search_catalog_objects_request' +require_relative 'square/catalog/types/search_catalog_items_request' +require_relative 'square/catalog/types/update_item_modifier_lists_request' +require_relative 'square/catalog/types/update_item_taxes_request' +require_relative 'square/customers/client' +require_relative 'square/customers/types/list_customers_request' +require_relative 'square/customers/types/create_customer_request' +require_relative 'square/customers/types/bulk_create_customers_request' +require_relative 'square/customers/types/bulk_delete_customers_request' +require_relative 'square/customers/types/bulk_retrieve_customers_request' +require_relative 'square/customers/types/bulk_update_customers_request' +require_relative 'square/customers/types/search_customers_request' +require_relative 'square/customers/types/get_customers_request' +require_relative 'square/customers/types/update_customer_request' +require_relative 'square/customers/types/delete_customers_request' +require_relative 'square/devices/client' +require_relative 'square/devices/types/list_devices_request' +require_relative 'square/devices/types/get_devices_request' +require_relative 'square/disputes/client' +require_relative 'square/disputes/types/list_disputes_request' +require_relative 'square/disputes/types/get_disputes_request' +require_relative 'square/disputes/types/accept_disputes_request' +require_relative 'square/disputes/types/create_evidence_file_disputes_request' +require_relative 'square/disputes/types/create_dispute_evidence_text_request' +require_relative 'square/disputes/types/submit_evidence_disputes_request' +require_relative 'square/employees/client' +require_relative 'square/employees/types/list_employees_request' +require_relative 'square/employees/types/get_employees_request' +require_relative 'square/events/client' +require_relative 'square/events/types/search_events_request' +require_relative 'square/events/types/list_event_types_request' +require_relative 'square/gift_cards/client' +require_relative 'square/gift_cards/types/list_gift_cards_request' +require_relative 'square/gift_cards/types/create_gift_card_request' +require_relative 'square/gift_cards/types/get_gift_card_from_gan_request' +require_relative 'square/gift_cards/types/get_gift_card_from_nonce_request' +require_relative 'square/gift_cards/types/link_customer_to_gift_card_request' +require_relative 'square/gift_cards/types/unlink_customer_from_gift_card_request' +require_relative 'square/gift_cards/types/get_gift_cards_request' +require_relative 'square/inventory/client' +require_relative 'square/inventory/types/deprecated_get_adjustment_inventory_request' +require_relative 'square/inventory/types/get_adjustment_inventory_request' +require_relative 'square/inventory/types/deprecated_get_physical_count_inventory_request' +require_relative 'square/inventory/types/get_physical_count_inventory_request' +require_relative 'square/inventory/types/get_transfer_inventory_request' +require_relative 'square/inventory/types/get_inventory_request' +require_relative 'square/inventory/types/changes_inventory_request' +require_relative 'square/invoices/client' +require_relative 'square/invoices/types/list_invoices_request' +require_relative 'square/invoices/types/create_invoice_request' +require_relative 'square/invoices/types/search_invoices_request' +require_relative 'square/invoices/types/get_invoices_request' +require_relative 'square/invoices/types/update_invoice_request' +require_relative 'square/invoices/types/delete_invoices_request' +require_relative 'square/invoices/types/create_invoice_attachment_request' +require_relative 'square/invoices/types/delete_invoice_attachment_request' +require_relative 'square/invoices/types/cancel_invoice_request' +require_relative 'square/invoices/types/publish_invoice_request' +require_relative 'square/labor/client' +require_relative 'square/labor/types/create_scheduled_shift_request' +require_relative 'square/labor/types/bulk_publish_scheduled_shifts_request' +require_relative 'square/labor/types/search_scheduled_shifts_request' +require_relative 'square/labor/types/retrieve_scheduled_shift_request' +require_relative 'square/labor/types/update_scheduled_shift_request' +require_relative 'square/labor/types/publish_scheduled_shift_request' +require_relative 'square/labor/types/create_timecard_request' +require_relative 'square/labor/types/search_timecards_request' +require_relative 'square/labor/types/retrieve_timecard_request' +require_relative 'square/labor/types/update_timecard_request' +require_relative 'square/labor/types/delete_timecard_request' +require_relative 'square/locations/client' +require_relative 'square/locations/types/create_location_request' +require_relative 'square/locations/types/get_locations_request' +require_relative 'square/locations/types/update_location_request' +require_relative 'square/locations/types/create_checkout_request' +require_relative 'square/loyalty/client' +require_relative 'square/loyalty/types/search_loyalty_events_request' +require_relative 'square/merchants/client' +require_relative 'square/merchants/types/list_merchants_request' +require_relative 'square/merchants/types/get_merchants_request' +require_relative 'square/checkout/client' +require_relative 'square/checkout/types/retrieve_location_settings_request' +require_relative 'square/checkout/types/update_location_settings_request' +require_relative 'square/checkout/types/update_merchant_settings_request' +require_relative 'square/orders/client' +require_relative 'square/orders/types/batch_get_orders_request' +require_relative 'square/orders/types/calculate_order_request' +require_relative 'square/orders/types/clone_order_request' +require_relative 'square/orders/types/search_orders_request' +require_relative 'square/orders/types/get_orders_request' +require_relative 'square/orders/types/update_order_request' +require_relative 'square/orders/types/pay_order_request' +require_relative 'square/payments/client' +require_relative 'square/payments/types/list_payments_request' +require_relative 'square/payments/types/create_payment_request' +require_relative 'square/payments/types/cancel_payment_by_idempotency_key_request' +require_relative 'square/payments/types/get_payments_request' +require_relative 'square/payments/types/update_payment_request' +require_relative 'square/payments/types/cancel_payments_request' +require_relative 'square/payments/types/complete_payment_request' +require_relative 'square/payouts/client' +require_relative 'square/payouts/types/list_payouts_request' +require_relative 'square/payouts/types/get_payouts_request' +require_relative 'square/payouts/types/list_entries_payouts_request' +require_relative 'square/refunds/client' +require_relative 'square/refunds/types/list_refunds_request' +require_relative 'square/refunds/types/refund_payment_request' +require_relative 'square/refunds/types/get_refunds_request' +require_relative 'square/sites/client' +require_relative 'square/snippets/client' +require_relative 'square/snippets/types/get_snippets_request' +require_relative 'square/snippets/types/upsert_snippet_request' +require_relative 'square/snippets/types/delete_snippets_request' +require_relative 'square/subscriptions/client' +require_relative 'square/subscriptions/types/create_subscription_request' +require_relative 'square/subscriptions/types/bulk_swap_plan_request' +require_relative 'square/subscriptions/types/search_subscriptions_request' +require_relative 'square/subscriptions/types/get_subscriptions_request' +require_relative 'square/subscriptions/types/update_subscription_request' +require_relative 'square/subscriptions/types/delete_action_subscriptions_request' +require_relative 'square/subscriptions/types/change_billing_anchor_date_request' +require_relative 'square/subscriptions/types/cancel_subscriptions_request' +require_relative 'square/subscriptions/types/list_events_subscriptions_request' +require_relative 'square/subscriptions/types/pause_subscription_request' +require_relative 'square/subscriptions/types/resume_subscription_request' +require_relative 'square/subscriptions/types/swap_plan_request' +require_relative 'square/team_members/client' +require_relative 'square/team_members/types/batch_create_team_members_request' +require_relative 'square/team_members/types/batch_update_team_members_request' +require_relative 'square/team_members/types/search_team_members_request' +require_relative 'square/team_members/types/get_team_members_request' +require_relative 'square/team_members/types/update_team_members_request' +require_relative 'square/team/client' +require_relative 'square/team/types/list_jobs_request' +require_relative 'square/team/types/create_job_request' +require_relative 'square/team/types/retrieve_job_request' +require_relative 'square/team/types/update_job_request' +require_relative 'square/terminal/client' +require_relative 'square/terminal/types/dismiss_terminal_action_request' +require_relative 'square/terminal/types/dismiss_terminal_checkout_request' +require_relative 'square/terminal/types/dismiss_terminal_refund_request' +require_relative 'square/vendors/client' +require_relative 'square/vendors/types/batch_create_vendors_request' +require_relative 'square/vendors/types/batch_get_vendors_request' +require_relative 'square/vendors/types/batch_update_vendors_request' +require_relative 'square/vendors/types/create_vendor_request' +require_relative 'square/vendors/types/search_vendors_request' +require_relative 'square/vendors/types/get_vendors_request' +require_relative 'square/vendors/types/update_vendors_request' +require_relative 'square/bookings/custom_attribute_definitions/client' +require_relative 'square/bookings/custom_attribute_definitions/types/list_custom_attribute_definitions_request' +require_relative 'square/bookings/custom_attribute_definitions/types/create_booking_custom_attribute_definition_request' +require_relative 'square/bookings/custom_attribute_definitions/types/get_custom_attribute_definitions_request' +require_relative 'square/bookings/custom_attribute_definitions/types/update_booking_custom_attribute_definition_request' +require_relative 'square/bookings/custom_attribute_definitions/types/delete_custom_attribute_definitions_request' +require_relative 'square/bookings/custom_attributes/client' +require_relative 'square/bookings/custom_attributes/types/bulk_delete_booking_custom_attributes_request' +require_relative 'square/bookings/custom_attributes/types/bulk_upsert_booking_custom_attributes_request' +require_relative 'square/bookings/custom_attributes/types/list_custom_attributes_request' +require_relative 'square/bookings/custom_attributes/types/get_custom_attributes_request' +require_relative 'square/bookings/custom_attributes/types/upsert_booking_custom_attribute_request' +require_relative 'square/bookings/custom_attributes/types/delete_custom_attributes_request' +require_relative 'square/bookings/location_profiles/client' +require_relative 'square/bookings/location_profiles/types/list_location_profiles_request' +require_relative 'square/bookings/team_member_profiles/client' +require_relative 'square/bookings/team_member_profiles/types/list_team_member_profiles_request' +require_relative 'square/bookings/team_member_profiles/types/get_team_member_profiles_request' +require_relative 'square/cash_drawers/client' +require_relative 'square/cash_drawers/shifts/client' +require_relative 'square/cash_drawers/shifts/types/list_shifts_request' +require_relative 'square/cash_drawers/shifts/types/get_shifts_request' +require_relative 'square/cash_drawers/shifts/types/list_events_shifts_request' +require_relative 'square/catalog/images/client' +require_relative 'square/catalog/images/types/create_images_request' +require_relative 'square/catalog/images/types/update_images_request' +require_relative 'square/catalog/object/client' +require_relative 'square/catalog/object/types/upsert_catalog_object_request' +require_relative 'square/catalog/object/types/get_object_request' +require_relative 'square/catalog/object/types/delete_object_request' +require_relative 'square/checkout/payment_links/client' +require_relative 'square/checkout/payment_links/types/list_payment_links_request' +require_relative 'square/checkout/payment_links/types/create_payment_link_request' +require_relative 'square/checkout/payment_links/types/get_payment_links_request' +require_relative 'square/checkout/payment_links/types/update_payment_link_request' +require_relative 'square/checkout/payment_links/types/delete_payment_links_request' +require_relative 'square/customers/custom_attribute_definitions/client' +require_relative 'square/customers/custom_attribute_definitions/types/list_custom_attribute_definitions_request' +require_relative 'square/customers/custom_attribute_definitions/types/create_customer_custom_attribute_definition_request' +require_relative 'square/customers/custom_attribute_definitions/types/get_custom_attribute_definitions_request' +require_relative 'square/customers/custom_attribute_definitions/types/update_customer_custom_attribute_definition_request' +require_relative 'square/customers/custom_attribute_definitions/types/delete_custom_attribute_definitions_request' +require_relative 'square/customers/custom_attribute_definitions/types/batch_upsert_customer_custom_attributes_request' +require_relative 'square/customers/groups/client' +require_relative 'square/customers/groups/types/list_groups_request' +require_relative 'square/customers/groups/types/create_customer_group_request' +require_relative 'square/customers/groups/types/get_groups_request' +require_relative 'square/customers/groups/types/update_customer_group_request' +require_relative 'square/customers/groups/types/delete_groups_request' +require_relative 'square/customers/groups/types/add_groups_request' +require_relative 'square/customers/groups/types/remove_groups_request' +require_relative 'square/customers/segments/client' +require_relative 'square/customers/segments/types/list_segments_request' +require_relative 'square/customers/segments/types/get_segments_request' +require_relative 'square/customers/cards/client' +require_relative 'square/customers/cards/types/create_customer_card_request' +require_relative 'square/customers/cards/types/delete_cards_request' +require_relative 'square/customers/custom_attributes/client' +require_relative 'square/customers/custom_attributes/types/list_custom_attributes_request' +require_relative 'square/customers/custom_attributes/types/get_custom_attributes_request' +require_relative 'square/customers/custom_attributes/types/upsert_customer_custom_attribute_request' +require_relative 'square/customers/custom_attributes/types/delete_custom_attributes_request' +require_relative 'square/devices/codes/client' +require_relative 'square/devices/codes/types/list_codes_request' +require_relative 'square/devices/codes/types/create_device_code_request' +require_relative 'square/devices/codes/types/get_codes_request' +require_relative 'square/disputes/evidence/client' +require_relative 'square/disputes/evidence/types/list_evidence_request' +require_relative 'square/disputes/evidence/types/get_evidence_request' +require_relative 'square/disputes/evidence/types/delete_evidence_request' +require_relative 'square/gift_cards/activities/client' +require_relative 'square/gift_cards/activities/types/list_activities_request' +require_relative 'square/gift_cards/activities/types/create_gift_card_activity_request' +require_relative 'square/labor/break_types/client' +require_relative 'square/labor/break_types/types/list_break_types_request' +require_relative 'square/labor/break_types/types/create_break_type_request' +require_relative 'square/labor/break_types/types/get_break_types_request' +require_relative 'square/labor/break_types/types/update_break_type_request' +require_relative 'square/labor/break_types/types/delete_break_types_request' +require_relative 'square/labor/employee_wages/client' +require_relative 'square/labor/employee_wages/types/list_employee_wages_request' +require_relative 'square/labor/employee_wages/types/get_employee_wages_request' +require_relative 'square/labor/shifts/client' +require_relative 'square/labor/shifts/types/create_shift_request' +require_relative 'square/labor/shifts/types/search_shifts_request' +require_relative 'square/labor/shifts/types/get_shifts_request' +require_relative 'square/labor/shifts/types/update_shift_request' +require_relative 'square/labor/shifts/types/delete_shifts_request' +require_relative 'square/labor/team_member_wages/client' +require_relative 'square/labor/team_member_wages/types/list_team_member_wages_request' +require_relative 'square/labor/team_member_wages/types/get_team_member_wages_request' +require_relative 'square/labor/workweek_configs/client' +require_relative 'square/labor/workweek_configs/types/list_workweek_configs_request' +require_relative 'square/labor/workweek_configs/types/update_workweek_config_request' +require_relative 'square/locations/custom_attribute_definitions/client' +require_relative 'square/locations/custom_attribute_definitions/types/list_custom_attribute_definitions_request' +require_relative 'square/locations/custom_attribute_definitions/types/create_location_custom_attribute_definition_request' +require_relative 'square/locations/custom_attribute_definitions/types/get_custom_attribute_definitions_request' +require_relative 'square/locations/custom_attribute_definitions/types/update_location_custom_attribute_definition_request' +require_relative 'square/locations/custom_attribute_definitions/types/delete_custom_attribute_definitions_request' +require_relative 'square/locations/custom_attributes/client' +require_relative 'square/locations/custom_attributes/types/bulk_delete_location_custom_attributes_request' +require_relative 'square/locations/custom_attributes/types/bulk_upsert_location_custom_attributes_request' +require_relative 'square/locations/custom_attributes/types/list_custom_attributes_request' +require_relative 'square/locations/custom_attributes/types/get_custom_attributes_request' +require_relative 'square/locations/custom_attributes/types/upsert_location_custom_attribute_request' +require_relative 'square/locations/custom_attributes/types/delete_custom_attributes_request' +require_relative 'square/locations/transactions/client' +require_relative 'square/locations/transactions/types/list_transactions_request' +require_relative 'square/locations/transactions/types/get_transactions_request' +require_relative 'square/locations/transactions/types/capture_transactions_request' +require_relative 'square/locations/transactions/types/void_transactions_request' +require_relative 'square/loyalty/accounts/client' +require_relative 'square/loyalty/accounts/types/create_loyalty_account_request' +require_relative 'square/loyalty/accounts/types/search_loyalty_accounts_request' +require_relative 'square/loyalty/accounts/types/get_accounts_request' +require_relative 'square/loyalty/accounts/types/accumulate_loyalty_points_request' +require_relative 'square/loyalty/accounts/types/adjust_loyalty_points_request' +require_relative 'square/loyalty/programs/client' +require_relative 'square/loyalty/programs/types/get_programs_request' +require_relative 'square/loyalty/programs/types/calculate_loyalty_points_request' +require_relative 'square/loyalty/rewards/client' +require_relative 'square/loyalty/rewards/types/create_loyalty_reward_request' +require_relative 'square/loyalty/rewards/types/search_loyalty_rewards_request' +require_relative 'square/loyalty/rewards/types/get_rewards_request' +require_relative 'square/loyalty/rewards/types/delete_rewards_request' +require_relative 'square/loyalty/rewards/types/redeem_loyalty_reward_request' +require_relative 'square/loyalty/programs/promotions/client' +require_relative 'square/loyalty/programs/promotions/types/list_promotions_request' +require_relative 'square/loyalty/programs/promotions/types/create_loyalty_promotion_request' +require_relative 'square/loyalty/programs/promotions/types/get_promotions_request' +require_relative 'square/loyalty/programs/promotions/types/cancel_promotions_request' +require_relative 'square/merchants/custom_attribute_definitions/client' +require_relative 'square/merchants/custom_attribute_definitions/types/list_custom_attribute_definitions_request' +require_relative 'square/merchants/custom_attribute_definitions/types/create_merchant_custom_attribute_definition_request' +require_relative 'square/merchants/custom_attribute_definitions/types/get_custom_attribute_definitions_request' +require_relative 'square/merchants/custom_attribute_definitions/types/update_merchant_custom_attribute_definition_request' +require_relative 'square/merchants/custom_attribute_definitions/types/delete_custom_attribute_definitions_request' +require_relative 'square/merchants/custom_attributes/client' +require_relative 'square/merchants/custom_attributes/types/bulk_delete_merchant_custom_attributes_request' +require_relative 'square/merchants/custom_attributes/types/bulk_upsert_merchant_custom_attributes_request' +require_relative 'square/merchants/custom_attributes/types/list_custom_attributes_request' +require_relative 'square/merchants/custom_attributes/types/get_custom_attributes_request' +require_relative 'square/merchants/custom_attributes/types/upsert_merchant_custom_attribute_request' +require_relative 'square/merchants/custom_attributes/types/delete_custom_attributes_request' +require_relative 'square/orders/custom_attribute_definitions/client' +require_relative 'square/orders/custom_attribute_definitions/types/list_custom_attribute_definitions_request' +require_relative 'square/orders/custom_attribute_definitions/types/create_order_custom_attribute_definition_request' +require_relative 'square/orders/custom_attribute_definitions/types/get_custom_attribute_definitions_request' +require_relative 'square/orders/custom_attribute_definitions/types/update_order_custom_attribute_definition_request' +require_relative 'square/orders/custom_attribute_definitions/types/delete_custom_attribute_definitions_request' +require_relative 'square/orders/custom_attributes/client' +require_relative 'square/orders/custom_attributes/types/bulk_delete_order_custom_attributes_request' +require_relative 'square/orders/custom_attributes/types/bulk_upsert_order_custom_attributes_request' +require_relative 'square/orders/custom_attributes/types/list_custom_attributes_request' +require_relative 'square/orders/custom_attributes/types/get_custom_attributes_request' +require_relative 'square/orders/custom_attributes/types/upsert_order_custom_attribute_request' +require_relative 'square/orders/custom_attributes/types/delete_custom_attributes_request' +require_relative 'square/team_members/wage_setting/client' +require_relative 'square/team_members/wage_setting/types/get_wage_setting_request' +require_relative 'square/team_members/wage_setting/types/update_wage_setting_request' +require_relative 'square/terminal/actions/client' +require_relative 'square/terminal/actions/types/create_terminal_action_request' +require_relative 'square/terminal/actions/types/search_terminal_actions_request' +require_relative 'square/terminal/actions/types/get_actions_request' +require_relative 'square/terminal/actions/types/cancel_actions_request' +require_relative 'square/terminal/checkouts/client' +require_relative 'square/terminal/checkouts/types/create_terminal_checkout_request' +require_relative 'square/terminal/checkouts/types/search_terminal_checkouts_request' +require_relative 'square/terminal/checkouts/types/get_checkouts_request' +require_relative 'square/terminal/checkouts/types/cancel_checkouts_request' +require_relative 'square/terminal/refunds/client' +require_relative 'square/terminal/refunds/types/create_terminal_refund_request' +require_relative 'square/terminal/refunds/types/search_terminal_refunds_request' +require_relative 'square/terminal/refunds/types/get_refunds_request' +require_relative 'square/terminal/refunds/types/cancel_refunds_request' +require_relative 'square/webhooks/client' +require_relative 'square/webhooks/event_types/client' +require_relative 'square/webhooks/event_types/types/list_event_types_request' +require_relative 'square/webhooks/subscriptions/client' +require_relative 'square/webhooks/subscriptions/types/list_subscriptions_request' +require_relative 'square/webhooks/subscriptions/types/create_webhook_subscription_request' +require_relative 'square/webhooks/subscriptions/types/get_subscriptions_request' +require_relative 'square/webhooks/subscriptions/types/update_webhook_subscription_request' +require_relative 'square/webhooks/subscriptions/types/delete_subscriptions_request' +require_relative 'square/webhooks/subscriptions/types/update_webhook_subscription_signature_key_request' +require_relative 'square/webhooks/subscriptions/types/test_webhook_subscription_request' +require_relative 'square/environment' \ No newline at end of file diff --git a/lib/square/apple_pay/client.rb b/lib/square/apple_pay/client.rb new file mode 100644 index 000000000..484be8098 --- /dev/null +++ b/lib/square/apple_pay/client.rb @@ -0,0 +1,40 @@ + +module Square + module ApplePay + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::ApplePay::Client] + def initialize(client) + @client = client + end + + # 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). + # + # @return [Square::Types::RegisterDomainResponse] + def register_domain(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RegisterDomainResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/apple_pay/types/register_domain_request.rb b/lib/square/apple_pay/types/register_domain_request.rb new file mode 100644 index 000000000..f7399ecc8 --- /dev/null +++ b/lib/square/apple_pay/types/register_domain_request.rb @@ -0,0 +1,11 @@ + +module Square + module ApplePay + module Types + class RegisterDomainRequest < Internal::Types::Model + field :domain_name, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/bank_accounts/client.rb b/lib/square/bank_accounts/client.rb new file mode 100644 index 000000000..910b59a8a --- /dev/null +++ b/lib/square/bank_accounts/client.rb @@ -0,0 +1,54 @@ + +module Square + module BankAccounts + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::BankAccounts::Client] + def initialize(client) + @client = client + end + + # Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. + # + # @return [Square::Types::ListBankAccountsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListBankAccountsResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank account ID. + # + # @return [Square::Types::GetBankAccountByV1IdResponse] + def get_by_v_1_id(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetBankAccountByV1IdResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns details of a [BankAccount](entity:BankAccount) + # linked to a Square account. + # + # @return [Square::Types::GetBankAccountResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetBankAccountResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/bank_accounts/types/get_bank_accounts_request.rb b/lib/square/bank_accounts/types/get_bank_accounts_request.rb new file mode 100644 index 000000000..44373698a --- /dev/null +++ b/lib/square/bank_accounts/types/get_bank_accounts_request.rb @@ -0,0 +1,11 @@ + +module Square + module BankAccounts + module Types + class GetBankAccountsRequest < Internal::Types::Model + field :bank_account_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/bank_accounts/types/get_by_v_1_id_bank_accounts_request.rb b/lib/square/bank_accounts/types/get_by_v_1_id_bank_accounts_request.rb new file mode 100644 index 000000000..988095356 --- /dev/null +++ b/lib/square/bank_accounts/types/get_by_v_1_id_bank_accounts_request.rb @@ -0,0 +1,11 @@ + +module Square + module BankAccounts + module Types + class GetByV1IdBankAccountsRequest < Internal::Types::Model + field :v_1_bank_account_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/bank_accounts/types/list_bank_accounts_request.rb b/lib/square/bank_accounts/types/list_bank_accounts_request.rb new file mode 100644 index 000000000..0e267f040 --- /dev/null +++ b/lib/square/bank_accounts/types/list_bank_accounts_request.rb @@ -0,0 +1,13 @@ + +module Square + module BankAccounts + module Types + class ListBankAccountsRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/bookings/client.rb b/lib/square/bookings/client.rb new file mode 100644 index 000000000..ef5aa20e6 --- /dev/null +++ b/lib/square/bookings/client.rb @@ -0,0 +1,181 @@ + +module Square + module Bookings + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Bookings::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::ListBookingsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListBookingsResponse.load(_response.body) + else + raise _response.body + end + end + + # 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*. + # + # @return [Square::Types::CreateBookingResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateBookingResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::SearchAvailabilityResponse] + def search_availability(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchAvailabilityResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::BulkRetrieveBookingsResponse] + def bulk_retrieve_bookings(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkRetrieveBookingsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a seller's booking profile. + # + # @return [Square::Types::GetBusinessBookingProfileResponse] + def get_business_profile(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetBusinessBookingProfileResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a seller's location booking profile. + # + # @return [Square::Types::RetrieveLocationBookingProfileResponse] + def retrieve_location_booking_profile(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveLocationBookingProfileResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves one or more team members' booking profiles. + # + # @return [Square::Types::BulkRetrieveTeamMemberBookingProfilesResponse] + def bulk_retrieve_team_member_booking_profiles(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkRetrieveTeamMemberBookingProfilesResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::GetBookingResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetBookingResponse.load(_response.body) + else + raise _response.body + end + end + + # 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*. + # + # @return [Square::Types::UpdateBookingResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateBookingResponse.load(_response.body) + else + raise _response.body + end + end + + # 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*. + # + # @return [Square::Types::CancelBookingResponse] + def cancel(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CancelBookingResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/bookings/custom_attribute_definitions/client.rb b/lib/square/bookings/custom_attribute_definitions/client.rb new file mode 100644 index 000000000..9eca1f4f8 --- /dev/null +++ b/lib/square/bookings/custom_attribute_definitions/client.rb @@ -0,0 +1,105 @@ + +module Square + module Bookings + module CustomAttributeDefinitions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Bookings::CustomAttributeDefinitions::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::ListBookingCustomAttributeDefinitionsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListBookingCustomAttributeDefinitionsResponse.load(_response.body) + else + raise _response.body + end + end + + # 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*. + # + # @return [Square::Types::CreateBookingCustomAttributeDefinitionResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateBookingCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::RetrieveBookingCustomAttributeDefinitionResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveBookingCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # 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*. + # + # @return [Square::Types::UpdateBookingCustomAttributeDefinitionResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateBookingCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # 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*. + # + # @return [Square::Types::DeleteBookingCustomAttributeDefinitionResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteBookingCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/bookings/custom_attribute_definitions/types/create_booking_custom_attribute_definition_request.rb b/lib/square/bookings/custom_attribute_definitions/types/create_booking_custom_attribute_definition_request.rb new file mode 100644 index 000000000..bdc6ffd94 --- /dev/null +++ b/lib/square/bookings/custom_attribute_definitions/types/create_booking_custom_attribute_definition_request.rb @@ -0,0 +1,14 @@ + +module Square + module Bookings + module CustomAttributeDefinitions + module Types + class CreateBookingCustomAttributeDefinitionRequest < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb b/lib/square/bookings/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..a29648516 --- /dev/null +++ b/lib/square/bookings/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb @@ -0,0 +1,13 @@ + +module Square + module Bookings + module CustomAttributeDefinitions + module Types + class DeleteCustomAttributeDefinitionsRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb b/lib/square/bookings/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..d83e87e5e --- /dev/null +++ b/lib/square/bookings/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Bookings + module CustomAttributeDefinitions + module Types + class GetCustomAttributeDefinitionsRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb b/lib/square/bookings/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..328fc8e31 --- /dev/null +++ b/lib/square/bookings/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Bookings + module CustomAttributeDefinitions + module Types + class ListCustomAttributeDefinitionsRequest < Internal::Types::Model + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/custom_attribute_definitions/types/update_booking_custom_attribute_definition_request.rb b/lib/square/bookings/custom_attribute_definitions/types/update_booking_custom_attribute_definition_request.rb new file mode 100644 index 000000000..f6dbdf6c2 --- /dev/null +++ b/lib/square/bookings/custom_attribute_definitions/types/update_booking_custom_attribute_definition_request.rb @@ -0,0 +1,15 @@ + +module Square + module Bookings + module CustomAttributeDefinitions + module Types + class UpdateBookingCustomAttributeDefinitionRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/custom_attributes/client.rb b/lib/square/bookings/custom_attributes/client.rb new file mode 100644 index 000000000..b9779f648 --- /dev/null +++ b/lib/square/bookings/custom_attributes/client.rb @@ -0,0 +1,124 @@ + +module Square + module Bookings + module CustomAttributes + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Bookings::CustomAttributes::Client] + def initialize(client) + @client = client + end + + # 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*. + # + # @return [Square::Types::BulkDeleteBookingCustomAttributesResponse] + def batch_delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkDeleteBookingCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # 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*. + # + # @return [Square::Types::BulkUpsertBookingCustomAttributesResponse] + def batch_upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkUpsertBookingCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::ListBookingCustomAttributesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListBookingCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::RetrieveBookingCustomAttributeResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveBookingCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + # 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*. + # + # @return [Square::Types::UpsertBookingCustomAttributeResponse] + def upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpsertBookingCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + # 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*. + # + # @return [Square::Types::DeleteBookingCustomAttributeResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteBookingCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/bookings/custom_attributes/types/bulk_delete_booking_custom_attributes_request.rb b/lib/square/bookings/custom_attributes/types/bulk_delete_booking_custom_attributes_request.rb new file mode 100644 index 000000000..e08536fc7 --- /dev/null +++ b/lib/square/bookings/custom_attributes/types/bulk_delete_booking_custom_attributes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Bookings + module CustomAttributes + module Types + class BulkDeleteBookingCustomAttributesRequest < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BookingCustomAttributeDeleteRequest], optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/custom_attributes/types/bulk_upsert_booking_custom_attributes_request.rb b/lib/square/bookings/custom_attributes/types/bulk_upsert_booking_custom_attributes_request.rb new file mode 100644 index 000000000..55700a895 --- /dev/null +++ b/lib/square/bookings/custom_attributes/types/bulk_upsert_booking_custom_attributes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Bookings + module CustomAttributes + module Types + class BulkUpsertBookingCustomAttributesRequest < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BookingCustomAttributeUpsertRequest], optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/custom_attributes/types/delete_custom_attributes_request.rb b/lib/square/bookings/custom_attributes/types/delete_custom_attributes_request.rb new file mode 100644 index 000000000..fda73c838 --- /dev/null +++ b/lib/square/bookings/custom_attributes/types/delete_custom_attributes_request.rb @@ -0,0 +1,14 @@ + +module Square + module Bookings + module CustomAttributes + module Types + class DeleteCustomAttributesRequest < Internal::Types::Model + field :booking_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/custom_attributes/types/get_custom_attributes_request.rb b/lib/square/bookings/custom_attributes/types/get_custom_attributes_request.rb new file mode 100644 index 000000000..6cab54b1f --- /dev/null +++ b/lib/square/bookings/custom_attributes/types/get_custom_attributes_request.rb @@ -0,0 +1,16 @@ + +module Square + module Bookings + module CustomAttributes + module Types + class GetCustomAttributesRequest < Internal::Types::Model + field :booking_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + field :with_definition, Internal::Types::Boolean, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/custom_attributes/types/list_custom_attributes_request.rb b/lib/square/bookings/custom_attributes/types/list_custom_attributes_request.rb new file mode 100644 index 000000000..e299e1906 --- /dev/null +++ b/lib/square/bookings/custom_attributes/types/list_custom_attributes_request.rb @@ -0,0 +1,16 @@ + +module Square + module Bookings + module CustomAttributes + module Types + class ListCustomAttributesRequest < Internal::Types::Model + field :booking_id, String, optional: false, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :with_definitions, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/custom_attributes/types/upsert_booking_custom_attribute_request.rb b/lib/square/bookings/custom_attributes/types/upsert_booking_custom_attribute_request.rb new file mode 100644 index 000000000..1ed08057f --- /dev/null +++ b/lib/square/bookings/custom_attributes/types/upsert_booking_custom_attribute_request.rb @@ -0,0 +1,16 @@ + +module Square + module Bookings + module CustomAttributes + module Types + class UpsertBookingCustomAttributeRequest < Internal::Types::Model + field :booking_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/location_profiles/client.rb b/lib/square/bookings/location_profiles/client.rb new file mode 100644 index 000000000..7a0909f40 --- /dev/null +++ b/lib/square/bookings/location_profiles/client.rb @@ -0,0 +1,29 @@ + +module Square + module Bookings + module LocationProfiles + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Bookings::LocationProfiles::Client] + def initialize(client) + @client = client + end + + # Lists location booking profiles of a seller. + # + # @return [Square::Types::ListLocationBookingProfilesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListLocationBookingProfilesResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/bookings/location_profiles/types/list_location_profiles_request.rb b/lib/square/bookings/location_profiles/types/list_location_profiles_request.rb new file mode 100644 index 000000000..a282cde1f --- /dev/null +++ b/lib/square/bookings/location_profiles/types/list_location_profiles_request.rb @@ -0,0 +1,14 @@ + +module Square + module Bookings + module LocationProfiles + module Types + class ListLocationProfilesRequest < Internal::Types::Model + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/team_member_profiles/client.rb b/lib/square/bookings/team_member_profiles/client.rb new file mode 100644 index 000000000..7439747b9 --- /dev/null +++ b/lib/square/bookings/team_member_profiles/client.rb @@ -0,0 +1,42 @@ + +module Square + module Bookings + module TeamMemberProfiles + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Bookings::TeamMemberProfiles::Client] + def initialize(client) + @client = client + end + + # Lists booking profiles for team members. + # + # @return [Square::Types::ListTeamMemberBookingProfilesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListTeamMemberBookingProfilesResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a team member's booking profile. + # + # @return [Square::Types::GetTeamMemberBookingProfileResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetTeamMemberBookingProfileResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/bookings/team_member_profiles/types/get_team_member_profiles_request.rb b/lib/square/bookings/team_member_profiles/types/get_team_member_profiles_request.rb new file mode 100644 index 000000000..32ca5c55c --- /dev/null +++ b/lib/square/bookings/team_member_profiles/types/get_team_member_profiles_request.rb @@ -0,0 +1,13 @@ + +module Square + module Bookings + module TeamMemberProfiles + module Types + class GetTeamMemberProfilesRequest < Internal::Types::Model + field :team_member_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/team_member_profiles/types/list_team_member_profiles_request.rb b/lib/square/bookings/team_member_profiles/types/list_team_member_profiles_request.rb new file mode 100644 index 000000000..c500a7b9f --- /dev/null +++ b/lib/square/bookings/team_member_profiles/types/list_team_member_profiles_request.rb @@ -0,0 +1,16 @@ + +module Square + module Bookings + module TeamMemberProfiles + module Types + class ListTeamMemberProfilesRequest < Internal::Types::Model + field :bookable_only, Internal::Types::Boolean, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/bookings/types/bulk_retrieve_bookings_request.rb b/lib/square/bookings/types/bulk_retrieve_bookings_request.rb new file mode 100644 index 000000000..fa64ffec6 --- /dev/null +++ b/lib/square/bookings/types/bulk_retrieve_bookings_request.rb @@ -0,0 +1,11 @@ + +module Square + module Bookings + module Types + class BulkRetrieveBookingsRequest < Internal::Types::Model + field :booking_ids, Internal::Types::Array[String], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/bookings/types/bulk_retrieve_team_member_booking_profiles_request.rb b/lib/square/bookings/types/bulk_retrieve_team_member_booking_profiles_request.rb new file mode 100644 index 000000000..ec6a7d66c --- /dev/null +++ b/lib/square/bookings/types/bulk_retrieve_team_member_booking_profiles_request.rb @@ -0,0 +1,11 @@ + +module Square + module Bookings + module Types + class BulkRetrieveTeamMemberBookingProfilesRequest < Internal::Types::Model + field :team_member_ids, Internal::Types::Array[String], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/bookings/types/cancel_booking_request.rb b/lib/square/bookings/types/cancel_booking_request.rb new file mode 100644 index 000000000..6d68d7ebf --- /dev/null +++ b/lib/square/bookings/types/cancel_booking_request.rb @@ -0,0 +1,13 @@ + +module Square + module Bookings + module Types + class CancelBookingRequest < Internal::Types::Model + field :booking_id, String, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + field :booking_version, Integer, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/bookings/types/create_booking_request.rb b/lib/square/bookings/types/create_booking_request.rb new file mode 100644 index 000000000..365cff967 --- /dev/null +++ b/lib/square/bookings/types/create_booking_request.rb @@ -0,0 +1,12 @@ + +module Square + module Bookings + module Types + class CreateBookingRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :booking, Square::Types::Booking, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/bookings/types/get_bookings_request.rb b/lib/square/bookings/types/get_bookings_request.rb new file mode 100644 index 000000000..f0adb430d --- /dev/null +++ b/lib/square/bookings/types/get_bookings_request.rb @@ -0,0 +1,11 @@ + +module Square + module Bookings + module Types + class GetBookingsRequest < Internal::Types::Model + field :booking_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/bookings/types/list_bookings_request.rb b/lib/square/bookings/types/list_bookings_request.rb new file mode 100644 index 000000000..18ee87b7a --- /dev/null +++ b/lib/square/bookings/types/list_bookings_request.rb @@ -0,0 +1,17 @@ + +module Square + module Bookings + module Types + class ListBookingsRequest < Internal::Types::Model + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :start_at_min, String, optional: true, nullable: false + field :start_at_max, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/bookings/types/retrieve_location_booking_profile_request.rb b/lib/square/bookings/types/retrieve_location_booking_profile_request.rb new file mode 100644 index 000000000..deabe3051 --- /dev/null +++ b/lib/square/bookings/types/retrieve_location_booking_profile_request.rb @@ -0,0 +1,11 @@ + +module Square + module Bookings + module Types + class RetrieveLocationBookingProfileRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/bookings/types/search_availability_request.rb b/lib/square/bookings/types/search_availability_request.rb new file mode 100644 index 000000000..144b6d22b --- /dev/null +++ b/lib/square/bookings/types/search_availability_request.rb @@ -0,0 +1,11 @@ + +module Square + module Bookings + module Types + class SearchAvailabilityRequest < Internal::Types::Model + field :query, Square::Types::SearchAvailabilityQuery, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/bookings/types/update_booking_request.rb b/lib/square/bookings/types/update_booking_request.rb new file mode 100644 index 000000000..e26b6db80 --- /dev/null +++ b/lib/square/bookings/types/update_booking_request.rb @@ -0,0 +1,13 @@ + +module Square + module Bookings + module Types + class UpdateBookingRequest < Internal::Types::Model + field :booking_id, String, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + field :booking, Square::Types::Booking, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/cards/client.rb b/lib/square/cards/client.rb new file mode 100644 index 000000000..1ad0cd73f --- /dev/null +++ b/lib/square/cards/client.rb @@ -0,0 +1,68 @@ + +module Square + module Cards + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Cards::Client] + def initialize(client) + @client = client + end + + # Retrieves a list of cards owned by the account making the request. + # A max of 25 cards will be returned. + # + # @return [Square::Types::ListCardsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListCardsResponse.load(_response.body) + else + raise _response.body + end + end + + # Adds a card on file to an existing merchant. + # + # @return [Square::Types::CreateCardResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateCardResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves details for a specific Card. + # + # @return [Square::Types::GetCardResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetCardResponse.load(_response.body) + else + raise _response.body + end + end + + # Disables the card, preventing any further updates or charges. + # Disabling an already disabled card is allowed but has no effect. + # + # @return [Square::Types::DisableCardResponse] + def disable(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DisableCardResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/cards/types/create_card_request.rb b/lib/square/cards/types/create_card_request.rb new file mode 100644 index 000000000..88b89f70e --- /dev/null +++ b/lib/square/cards/types/create_card_request.rb @@ -0,0 +1,14 @@ + +module Square + module Cards + module Types + class CreateCardRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :source_id, String, optional: false, nullable: false + field :verification_token, String, optional: true, nullable: false + field :card, Square::Types::Card, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/cards/types/disable_cards_request.rb b/lib/square/cards/types/disable_cards_request.rb new file mode 100644 index 000000000..64952c9ab --- /dev/null +++ b/lib/square/cards/types/disable_cards_request.rb @@ -0,0 +1,11 @@ + +module Square + module Cards + module Types + class DisableCardsRequest < Internal::Types::Model + field :card_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/cards/types/get_cards_request.rb b/lib/square/cards/types/get_cards_request.rb new file mode 100644 index 000000000..37635253f --- /dev/null +++ b/lib/square/cards/types/get_cards_request.rb @@ -0,0 +1,11 @@ + +module Square + module Cards + module Types + class GetCardsRequest < Internal::Types::Model + field :card_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/cards/types/list_cards_request.rb b/lib/square/cards/types/list_cards_request.rb new file mode 100644 index 000000000..ce2973eed --- /dev/null +++ b/lib/square/cards/types/list_cards_request.rb @@ -0,0 +1,15 @@ + +module Square + module Cards + module Types + class ListCardsRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :include_disabled, Internal::Types::Boolean, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/cash_drawers/client.rb b/lib/square/cash_drawers/client.rb new file mode 100644 index 000000000..fe352b083 --- /dev/null +++ b/lib/square/cash_drawers/client.rb @@ -0,0 +1,14 @@ + +module Square + module CashDrawers + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::CashDrawers::Client] + def initialize(client) + @client = client + end + + end + end +end diff --git a/lib/square/cash_drawers/shifts/client.rb b/lib/square/cash_drawers/shifts/client.rb new file mode 100644 index 000000000..5cd1c3a3f --- /dev/null +++ b/lib/square/cash_drawers/shifts/client.rb @@ -0,0 +1,57 @@ + +module Square + module CashDrawers + module Shifts + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::CashDrawers::Shifts::Client] + def initialize(client) + @client = client + end + + # Provides the details for all of the cash drawer shifts for a location + # in a date range. + # + # @return [Square::Types::ListCashDrawerShiftsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListCashDrawerShiftsResponse.load(_response.body) + else + raise _response.body + end + end + + # Provides the summary details for a single cash drawer shift. See + # [ListCashDrawerShiftEvents](api-endpoint:CashDrawers-ListCashDrawerShiftEvents) for a list of cash drawer shift events. + # + # @return [Square::Types::GetCashDrawerShiftResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetCashDrawerShiftResponse.load(_response.body) + else + raise _response.body + end + end + + # Provides a paginated list of events for a single cash drawer shift. + # + # @return [Square::Types::ListCashDrawerShiftEventsResponse] + def list_events(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListCashDrawerShiftEventsResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/cash_drawers/shifts/types/get_shifts_request.rb b/lib/square/cash_drawers/shifts/types/get_shifts_request.rb new file mode 100644 index 000000000..0df930719 --- /dev/null +++ b/lib/square/cash_drawers/shifts/types/get_shifts_request.rb @@ -0,0 +1,14 @@ + +module Square + module CashDrawers + module Shifts + module Types + class GetShiftsRequest < Internal::Types::Model + field :shift_id, String, optional: false, nullable: false + field :location_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/cash_drawers/shifts/types/list_events_shifts_request.rb b/lib/square/cash_drawers/shifts/types/list_events_shifts_request.rb new file mode 100644 index 000000000..9be68a699 --- /dev/null +++ b/lib/square/cash_drawers/shifts/types/list_events_shifts_request.rb @@ -0,0 +1,16 @@ + +module Square + module CashDrawers + module Shifts + module Types + class ListEventsShiftsRequest < Internal::Types::Model + field :shift_id, String, optional: false, nullable: false + field :location_id, String, optional: false, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/cash_drawers/shifts/types/list_shifts_request.rb b/lib/square/cash_drawers/shifts/types/list_shifts_request.rb new file mode 100644 index 000000000..31ec275a2 --- /dev/null +++ b/lib/square/cash_drawers/shifts/types/list_shifts_request.rb @@ -0,0 +1,18 @@ + +module Square + module CashDrawers + module Shifts + module Types + class ListShiftsRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + field :begin_time, String, optional: true, nullable: false + field :end_time, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/catalog/client.rb b/lib/square/catalog/client.rb new file mode 100644 index 000000000..a44310f88 --- /dev/null +++ b/lib/square/catalog/client.rb @@ -0,0 +1,191 @@ + +module Square + module Catalog + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Catalog::Client] + def initialize(client) + @client = client + end + + # Deletes a set of [CatalogItem](entity:CatalogItem)s based on the + # provided list of target IDs and returns a set of successfully deleted IDs in + # the response. Deletion is a cascading event such that all children of the + # targeted object are also deleted. For example, deleting a CatalogItem will + # also delete all of its [CatalogItemVariation](entity:CatalogItemVariation) + # children. + # + # `BatchDeleteCatalogObjects` succeeds even if only a portion of the targeted + # IDs can be deleted. The response will only include IDs that were + # actually deleted. + # + # To ensure consistency, only one delete request is processed at a time per seller account. + # While one (batch or non-batch) delete request is being processed, other (batched and non-batched) + # delete requests are rejected with the `429` error code. + # + # @return [Square::Types::BatchDeleteCatalogObjectsResponse] + def batch_delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchDeleteCatalogObjectsResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns a set of objects based on the provided ID. + # Each [CatalogItem](entity:CatalogItem) returned in the set includes all of its + # child information including: all of its + # [CatalogItemVariation](entity:CatalogItemVariation) objects, references to + # its [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of + # any [CatalogTax](entity:CatalogTax) objects that apply to it. + # + # @return [Square::Types::BatchGetCatalogObjectsResponse] + def batch_get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchGetCatalogObjectsResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::BatchUpsertCatalogObjectsResponse] + def batch_upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchUpsertCatalogObjectsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves information about the Square Catalog API, such as batch size + # limits that can be used by the `BatchUpsertCatalogObjects` endpoint. + # + # @return [Square::Types::CatalogInfoResponse] + def info(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CatalogInfoResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. + # + # The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](entity:CatalogObjectType) values, + # for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". + # + # __Important:__ ListCatalog does not return deleted catalog items. To retrieve + # deleted catalog items, use [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) + # and set the `include_deleted_objects` attribute value to `true`. + # + # @return [Square::Types::ListCatalogResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListCatalogResponse.load(_response.body) + else + raise _response.body + end + end + + # Searches for [CatalogObject](entity:CatalogObject) of any type by matching supported search attribute values, + # excluding custom attribute values on items or item variations, against one or more of the specified query filters. + # + # This (`SearchCatalogObjects`) endpoint differs from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + # endpoint in the following aspects: + # + # - `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects. + # - `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. + # - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. + # - The both endpoints have different call conventions, including the query filter formats. + # + # @return [Square::Types::SearchCatalogObjectsResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchCatalogObjectsResponse.load(_response.body) + else + raise _response.body + end + end + + # Searches for catalog items or item variations by matching supported search attribute values, including + # custom attribute values, against one or more of the specified query filters. + # + # This (`SearchCatalogItems`) endpoint differs from the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) + # endpoint in the following aspects: + # + # - `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects. + # - `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. + # - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. + # - The both endpoints use different call conventions, including the query filter formats. + # + # @return [Square::Types::SearchCatalogItemsResponse] + def search_items(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchCatalogItemsResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates the [CatalogModifierList](entity:CatalogModifierList) objects + # that apply to the targeted [CatalogItem](entity:CatalogItem) without having + # to perform an upsert on the entire item. + # + # @return [Square::Types::UpdateItemModifierListsResponse] + def update_item_modifier_lists(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateItemModifierListsResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates the [CatalogTax](entity:CatalogTax) objects that apply to the + # targeted [CatalogItem](entity:CatalogItem) without having to perform an + # upsert on the entire item. + # + # @return [Square::Types::UpdateItemTaxesResponse] + def update_item_taxes(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateItemTaxesResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/catalog/images/client.rb b/lib/square/catalog/images/client.rb new file mode 100644 index 000000000..361598537 --- /dev/null +++ b/lib/square/catalog/images/client.rb @@ -0,0 +1,50 @@ + +module Square + module Catalog + module Images + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Catalog::Images::Client] + def initialize(client) + @client = client + end + + # Uploads an image file to be represented by a [CatalogImage](entity:CatalogImage) object that can be linked to an existing + # [CatalogObject](entity:CatalogObject) instance. The resulting `CatalogImage` is unattached to any `CatalogObject` if the `object_id` + # is not specified. + # + # This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in + # JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. + # + # @return [Square::Types::CreateCatalogImageResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateCatalogImageResponse.load(_response.body) + else + raise _response.body + end + end + + # Uploads a new image file to replace the existing one in the specified [CatalogImage](entity:CatalogImage) object. + # + # This `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in + # JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. + # + # @return [Square::Types::UpdateCatalogImageResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateCatalogImageResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/catalog/images/types/create_images_request.rb b/lib/square/catalog/images/types/create_images_request.rb new file mode 100644 index 000000000..3b3922883 --- /dev/null +++ b/lib/square/catalog/images/types/create_images_request.rb @@ -0,0 +1,10 @@ + +module Square + module Catalog + module Images + module Types + class CreateImagesRequest < Internal::Types::Model; end + end + end + end +end diff --git a/lib/square/catalog/images/types/update_images_request.rb b/lib/square/catalog/images/types/update_images_request.rb new file mode 100644 index 000000000..2e11b6fe8 --- /dev/null +++ b/lib/square/catalog/images/types/update_images_request.rb @@ -0,0 +1,13 @@ + +module Square + module Catalog + module Images + module Types + class UpdateImagesRequest < Internal::Types::Model + field :image_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/catalog/object/client.rb b/lib/square/catalog/object/client.rb new file mode 100644 index 000000000..7cb8ae535 --- /dev/null +++ b/lib/square/catalog/object/client.rb @@ -0,0 +1,74 @@ + +module Square + module Catalog + module Object_ + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Catalog::Object_::Client] + def initialize(client) + @client = client + end + + # Creates a new or updates the specified [CatalogObject](entity:CatalogObject). + # + # To ensure consistency, only one update request is processed at a time per seller account. + # While one (batch or non-batch) update request is being processed, other (batched and non-batched) + # update requests are rejected with the `429` error code. + # + # @return [Square::Types::UpsertCatalogObjectResponse] + def upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpsertCatalogObjectResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns a single [CatalogItem](entity:CatalogItem) as a + # [CatalogObject](entity:CatalogObject) based on the provided ID. The returned + # object includes all of the relevant [CatalogItem](entity:CatalogItem) + # information including: [CatalogItemVariation](entity:CatalogItemVariation) + # children, references to its + # [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of + # any [CatalogTax](entity:CatalogTax) objects that apply to it. + # + # @return [Square::Types::GetCatalogObjectResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetCatalogObjectResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a single [CatalogObject](entity:CatalogObject) based on the + # provided ID and returns the set of successfully deleted IDs in the response. + # Deletion is a cascading event such that all children of the targeted object + # are also deleted. For example, deleting a [CatalogItem](entity:CatalogItem) + # will also delete all of its + # [CatalogItemVariation](entity:CatalogItemVariation) children. + # + # To ensure consistency, only one delete request is processed at a time per seller account. + # While one (batch or non-batch) delete request is being processed, other (batched and non-batched) + # delete requests are rejected with the `429` error code. + # + # @return [Square::Types::DeleteCatalogObjectResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteCatalogObjectResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/catalog/object/types/delete_object_request.rb b/lib/square/catalog/object/types/delete_object_request.rb new file mode 100644 index 000000000..db8dc1ea0 --- /dev/null +++ b/lib/square/catalog/object/types/delete_object_request.rb @@ -0,0 +1,13 @@ + +module Square + module Catalog + module Object_ + module Types + class DeleteObjectRequest < Internal::Types::Model + field :object_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/catalog/object/types/get_object_request.rb b/lib/square/catalog/object/types/get_object_request.rb new file mode 100644 index 000000000..ae8747bad --- /dev/null +++ b/lib/square/catalog/object/types/get_object_request.rb @@ -0,0 +1,16 @@ + +module Square + module Catalog + module Object_ + module Types + class GetObjectRequest < Internal::Types::Model + field :object_id, String, optional: false, nullable: false + field :include_related_objects, Internal::Types::Boolean, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :include_category_path_to_root, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/catalog/object/types/upsert_catalog_object_request.rb b/lib/square/catalog/object/types/upsert_catalog_object_request.rb new file mode 100644 index 000000000..521b76602 --- /dev/null +++ b/lib/square/catalog/object/types/upsert_catalog_object_request.rb @@ -0,0 +1,14 @@ + +module Square + module Catalog + module Object_ + module Types + class UpsertCatalogObjectRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :object, Square::Types::CatalogObject, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/catalog/types/batch_delete_catalog_objects_request.rb b/lib/square/catalog/types/batch_delete_catalog_objects_request.rb new file mode 100644 index 000000000..aae79f360 --- /dev/null +++ b/lib/square/catalog/types/batch_delete_catalog_objects_request.rb @@ -0,0 +1,11 @@ + +module Square + module Catalog + module Types + class BatchDeleteCatalogObjectsRequest < Internal::Types::Model + field :object_ids, Internal::Types::Array[String], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/catalog/types/batch_get_catalog_objects_request.rb b/lib/square/catalog/types/batch_get_catalog_objects_request.rb new file mode 100644 index 000000000..7a2af4b56 --- /dev/null +++ b/lib/square/catalog/types/batch_get_catalog_objects_request.rb @@ -0,0 +1,15 @@ + +module Square + module Catalog + module Types + class BatchGetCatalogObjectsRequest < Internal::Types::Model + field :object_ids, Internal::Types::Array[String], optional: false, nullable: false + field :include_related_objects, Internal::Types::Boolean, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :include_deleted_objects, Internal::Types::Boolean, optional: true, nullable: false + field :include_category_path_to_root, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/catalog/types/batch_upsert_catalog_objects_request.rb b/lib/square/catalog/types/batch_upsert_catalog_objects_request.rb new file mode 100644 index 000000000..fb690befb --- /dev/null +++ b/lib/square/catalog/types/batch_upsert_catalog_objects_request.rb @@ -0,0 +1,12 @@ + +module Square + module Catalog + module Types + class BatchUpsertCatalogObjectsRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :batches, Internal::Types::Array[Square::Types::CatalogObjectBatch], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/catalog/types/list_catalog_request.rb b/lib/square/catalog/types/list_catalog_request.rb new file mode 100644 index 000000000..a7172e0ee --- /dev/null +++ b/lib/square/catalog/types/list_catalog_request.rb @@ -0,0 +1,13 @@ + +module Square + module Catalog + module Types + class ListCatalogRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :types, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/catalog/types/search_catalog_items_request.rb b/lib/square/catalog/types/search_catalog_items_request.rb new file mode 100644 index 000000000..a9d14db2d --- /dev/null +++ b/lib/square/catalog/types/search_catalog_items_request.rb @@ -0,0 +1,20 @@ + +module Square + module Catalog + module Types + class SearchCatalogItemsRequest < Internal::Types::Model + field :text_filter, String, optional: true, nullable: false + field :category_ids, Internal::Types::Array[String], optional: true, nullable: false + field :stock_levels, Internal::Types::Array[Square::Types::SearchCatalogItemsRequestStockLevel], optional: true, nullable: false + field :enabled_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + field :product_types, Internal::Types::Array[Square::Types::CatalogItemProductType], optional: true, nullable: false + field :custom_attribute_filters, Internal::Types::Array[Square::Types::CustomAttributeFilter], optional: true, nullable: false + field :archived_state, Square::Types::ArchivedState, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/catalog/types/search_catalog_objects_request.rb b/lib/square/catalog/types/search_catalog_objects_request.rb new file mode 100644 index 000000000..8ecd58d34 --- /dev/null +++ b/lib/square/catalog/types/search_catalog_objects_request.rb @@ -0,0 +1,18 @@ + +module Square + module Catalog + module Types + class SearchCatalogObjectsRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :object_types, Internal::Types::Array[Square::Types::CatalogObjectType], optional: true, nullable: false + field :include_deleted_objects, Internal::Types::Boolean, optional: true, nullable: false + field :include_related_objects, Internal::Types::Boolean, optional: true, nullable: false + field :begin_time, String, optional: true, nullable: false + field :query, Square::Types::CatalogQuery, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :include_category_path_to_root, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/catalog/types/update_item_modifier_lists_request.rb b/lib/square/catalog/types/update_item_modifier_lists_request.rb new file mode 100644 index 000000000..97414a247 --- /dev/null +++ b/lib/square/catalog/types/update_item_modifier_lists_request.rb @@ -0,0 +1,13 @@ + +module Square + module Catalog + module Types + class UpdateItemModifierListsRequest < Internal::Types::Model + field :item_ids, Internal::Types::Array[String], optional: false, nullable: false + field :modifier_lists_to_enable, Internal::Types::Array[String], optional: true, nullable: false + field :modifier_lists_to_disable, Internal::Types::Array[String], optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/catalog/types/update_item_taxes_request.rb b/lib/square/catalog/types/update_item_taxes_request.rb new file mode 100644 index 000000000..d4e55e4c1 --- /dev/null +++ b/lib/square/catalog/types/update_item_taxes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Catalog + module Types + class UpdateItemTaxesRequest < Internal::Types::Model + field :item_ids, Internal::Types::Array[String], optional: false, nullable: false + field :taxes_to_enable, Internal::Types::Array[String], optional: true, nullable: false + field :taxes_to_disable, Internal::Types::Array[String], optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/checkout/client.rb b/lib/square/checkout/client.rb new file mode 100644 index 000000000..6bb2521b4 --- /dev/null +++ b/lib/square/checkout/client.rb @@ -0,0 +1,66 @@ + +module Square + module Checkout + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Checkout::Client] + def initialize(client) + @client = client + end + + # Retrieves the location-level settings for a Square-hosted checkout page. + # + # @return [Square::Types::RetrieveLocationSettingsResponse] + def retrieve_location_settings(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveLocationSettingsResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates the location-level settings for a Square-hosted checkout page. + # + # @return [Square::Types::UpdateLocationSettingsResponse] + def update_location_settings(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateLocationSettingsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves the merchant-level settings for a Square-hosted checkout page. + # + # @return [Square::Types::RetrieveMerchantSettingsResponse] + def retrieve_merchant_settings(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveMerchantSettingsResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates the merchant-level settings for a Square-hosted checkout page. + # + # @return [Square::Types::UpdateMerchantSettingsResponse] + def update_merchant_settings(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateMerchantSettingsResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/checkout/payment_links/client.rb b/lib/square/checkout/payment_links/client.rb new file mode 100644 index 000000000..7a216d0b0 --- /dev/null +++ b/lib/square/checkout/payment_links/client.rb @@ -0,0 +1,83 @@ + +module Square + module Checkout + module PaymentLinks + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Checkout::PaymentLinks::Client] + def initialize(client) + @client = client + end + + # Lists all payment links. + # + # @return [Square::Types::ListPaymentLinksResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListPaymentLinksResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a Square-hosted checkout page. Applications can share the resulting payment link with their buyer to pay for goods and services. + # + # @return [Square::Types::CreatePaymentLinkResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreatePaymentLinkResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a payment link. + # + # @return [Square::Types::GetPaymentLinkResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetPaymentLinkResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::UpdatePaymentLinkResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdatePaymentLinkResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a payment link. + # + # @return [Square::Types::DeletePaymentLinkResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeletePaymentLinkResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/checkout/payment_links/types/create_payment_link_request.rb b/lib/square/checkout/payment_links/types/create_payment_link_request.rb new file mode 100644 index 000000000..1fa939ef3 --- /dev/null +++ b/lib/square/checkout/payment_links/types/create_payment_link_request.rb @@ -0,0 +1,19 @@ + +module Square + module Checkout + module PaymentLinks + module Types + class CreatePaymentLinkRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :quick_pay, Square::Types::QuickPay, optional: true, nullable: false + field :order, Square::Types::Order, optional: true, nullable: false + field :checkout_options, Square::Types::CheckoutOptions, optional: true, nullable: false + field :pre_populated_data, Square::Types::PrePopulatedData, optional: true, nullable: false + field :payment_note, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/checkout/payment_links/types/delete_payment_links_request.rb b/lib/square/checkout/payment_links/types/delete_payment_links_request.rb new file mode 100644 index 000000000..f9fedb1b7 --- /dev/null +++ b/lib/square/checkout/payment_links/types/delete_payment_links_request.rb @@ -0,0 +1,13 @@ + +module Square + module Checkout + module PaymentLinks + module Types + class DeletePaymentLinksRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/checkout/payment_links/types/get_payment_links_request.rb b/lib/square/checkout/payment_links/types/get_payment_links_request.rb new file mode 100644 index 000000000..60036564c --- /dev/null +++ b/lib/square/checkout/payment_links/types/get_payment_links_request.rb @@ -0,0 +1,13 @@ + +module Square + module Checkout + module PaymentLinks + module Types + class GetPaymentLinksRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/checkout/payment_links/types/list_payment_links_request.rb b/lib/square/checkout/payment_links/types/list_payment_links_request.rb new file mode 100644 index 000000000..1a08d510c --- /dev/null +++ b/lib/square/checkout/payment_links/types/list_payment_links_request.rb @@ -0,0 +1,14 @@ + +module Square + module Checkout + module PaymentLinks + module Types + class ListPaymentLinksRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/checkout/payment_links/types/update_payment_link_request.rb b/lib/square/checkout/payment_links/types/update_payment_link_request.rb new file mode 100644 index 000000000..046d83b4a --- /dev/null +++ b/lib/square/checkout/payment_links/types/update_payment_link_request.rb @@ -0,0 +1,14 @@ + +module Square + module Checkout + module PaymentLinks + module Types + class UpdatePaymentLinkRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :payment_link, Square::Types::PaymentLink, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/checkout/types/retrieve_location_settings_request.rb b/lib/square/checkout/types/retrieve_location_settings_request.rb new file mode 100644 index 000000000..41e6a7d4f --- /dev/null +++ b/lib/square/checkout/types/retrieve_location_settings_request.rb @@ -0,0 +1,11 @@ + +module Square + module Checkout + module Types + class RetrieveLocationSettingsRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/checkout/types/update_location_settings_request.rb b/lib/square/checkout/types/update_location_settings_request.rb new file mode 100644 index 000000000..39144b0c2 --- /dev/null +++ b/lib/square/checkout/types/update_location_settings_request.rb @@ -0,0 +1,12 @@ + +module Square + module Checkout + module Types + class UpdateLocationSettingsRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :location_settings, Square::Types::CheckoutLocationSettings, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/checkout/types/update_merchant_settings_request.rb b/lib/square/checkout/types/update_merchant_settings_request.rb new file mode 100644 index 000000000..919b27e30 --- /dev/null +++ b/lib/square/checkout/types/update_merchant_settings_request.rb @@ -0,0 +1,11 @@ + +module Square + module Checkout + module Types + class UpdateMerchantSettingsRequest < Internal::Types::Model + field :merchant_settings, Square::Types::CheckoutMerchantSettings, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/client.rb b/lib/square/client.rb new file mode 100644 index 000000000..4140dc64c --- /dev/null +++ b/lib/square/client.rb @@ -0,0 +1,152 @@ + + +module Square + class Client + # @return [Square::Client] + def initialize(base_url:, token: ENV.fetch("SQUARE_TOKEN", nil)) + @raw_client = Square::Internal::Http::RawClient.new( + base_url: base_url, + headers: { + 'X-Fern-Language':'Ruby', + Authorization:"Bearer #{token}" + } + ) + end + # @return [Square::Mobile::Client] + def mobile + @mobile ||= Square::Mobile::Client.new(client: @raw_client) + end + # @return [Square::OAuth::Client] + def oAuth + @oAuth ||= Square::OAuth::Client.new(client: @raw_client) + end + # @return [Square::V1Transactions::Client] + def v1Transactions + @v1Transactions ||= Square::V1Transactions::Client.new(client: @raw_client) + end + # @return [Square::ApplePay::Client] + def applePay + @applePay ||= Square::ApplePay::Client.new(client: @raw_client) + end + # @return [Square::BankAccounts::Client] + def bankAccounts + @bankAccounts ||= Square::BankAccounts::Client.new(client: @raw_client) + end + # @return [Square::Bookings::Client] + def bookings + @bookings ||= Square::Bookings::Client.new(client: @raw_client) + end + # @return [Square::Cards::Client] + def cards + @cards ||= Square::Cards::Client.new(client: @raw_client) + end + # @return [Square::Catalog::Client] + def catalog + @catalog ||= Square::Catalog::Client.new(client: @raw_client) + end + # @return [Square::Customers::Client] + def customers + @customers ||= Square::Customers::Client.new(client: @raw_client) + end + # @return [Square::Devices::Client] + def devices + @devices ||= Square::Devices::Client.new(client: @raw_client) + end + # @return [Square::Disputes::Client] + def disputes + @disputes ||= Square::Disputes::Client.new(client: @raw_client) + end + # @return [Square::Employees::Client] + def employees + @employees ||= Square::Employees::Client.new(client: @raw_client) + end + # @return [Square::Events::Client] + def events + @events ||= Square::Events::Client.new(client: @raw_client) + end + # @return [Square::GiftCards::Client] + def giftCards + @giftCards ||= Square::GiftCards::Client.new(client: @raw_client) + end + # @return [Square::Inventory::Client] + def inventory + @inventory ||= Square::Inventory::Client.new(client: @raw_client) + end + # @return [Square::Invoices::Client] + def invoices + @invoices ||= Square::Invoices::Client.new(client: @raw_client) + end + # @return [Square::Labor::Client] + def labor + @labor ||= Square::Labor::Client.new(client: @raw_client) + end + # @return [Square::Locations::Client] + def locations + @locations ||= Square::Locations::Client.new(client: @raw_client) + end + # @return [Square::Loyalty::Client] + def loyalty + @loyalty ||= Square::Loyalty::Client.new(client: @raw_client) + end + # @return [Square::Merchants::Client] + def merchants + @merchants ||= Square::Merchants::Client.new(client: @raw_client) + end + # @return [Square::Checkout::Client] + def checkout + @checkout ||= Square::Checkout::Client.new(client: @raw_client) + end + # @return [Square::Orders::Client] + def orders + @orders ||= Square::Orders::Client.new(client: @raw_client) + end + # @return [Square::Payments::Client] + def payments + @payments ||= Square::Payments::Client.new(client: @raw_client) + end + # @return [Square::Payouts::Client] + def payouts + @payouts ||= Square::Payouts::Client.new(client: @raw_client) + end + # @return [Square::Refunds::Client] + def refunds + @refunds ||= Square::Refunds::Client.new(client: @raw_client) + end + # @return [Square::Sites::Client] + def sites + @sites ||= Square::Sites::Client.new(client: @raw_client) + end + # @return [Square::Snippets::Client] + def snippets + @snippets ||= Square::Snippets::Client.new(client: @raw_client) + end + # @return [Square::Subscriptions::Client] + def subscriptions + @subscriptions ||= Square::Subscriptions::Client.new(client: @raw_client) + end + # @return [Square::TeamMembers::Client] + def teamMembers + @teamMembers ||= Square::TeamMembers::Client.new(client: @raw_client) + end + # @return [Square::Team::Client] + def team + @team ||= Square::Team::Client.new(client: @raw_client) + end + # @return [Square::Terminal::Client] + def terminal + @terminal ||= Square::Terminal::Client.new(client: @raw_client) + end + # @return [Square::Vendors::Client] + def vendors + @vendors ||= Square::Vendors::Client.new(client: @raw_client) + end + # @return [Square::CashDrawers::Client] + def cashDrawers + @cashDrawers ||= Square::CashDrawers::Client.new(client: @raw_client) + end + # @return [Square::Webhooks::Client] + def webhooks + @webhooks ||= Square::Webhooks::Client.new(client: @raw_client) + end + end +end diff --git a/lib/square/customers/cards/client.rb b/lib/square/customers/cards/client.rb new file mode 100644 index 000000000..399da0833 --- /dev/null +++ b/lib/square/customers/cards/client.rb @@ -0,0 +1,46 @@ + +module Square + module Customers + module Cards + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Customers::Cards::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::CreateCustomerCardResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateCustomerCardResponse.load(_response.body) + else + raise _response.body + end + end + + # Removes a card on file from a customer. + # + # @return [Square::Types::DeleteCustomerCardResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteCustomerCardResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/customers/cards/types/create_customer_card_request.rb b/lib/square/customers/cards/types/create_customer_card_request.rb new file mode 100644 index 000000000..00a7b2ddb --- /dev/null +++ b/lib/square/customers/cards/types/create_customer_card_request.rb @@ -0,0 +1,17 @@ + +module Square + module Customers + module Cards + module Types + class CreateCustomerCardRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :card_nonce, String, optional: false, nullable: false + field :billing_address, Square::Types::Address, optional: true, nullable: false + field :cardholder_name, String, optional: true, nullable: false + field :verification_token, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/cards/types/delete_cards_request.rb b/lib/square/customers/cards/types/delete_cards_request.rb new file mode 100644 index 000000000..00443ae3a --- /dev/null +++ b/lib/square/customers/cards/types/delete_cards_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module Cards + module Types + class DeleteCardsRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :card_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/client.rb b/lib/square/customers/client.rb new file mode 100644 index 000000000..06549bef6 --- /dev/null +++ b/lib/square/customers/client.rb @@ -0,0 +1,186 @@ + +module Square + module Customers + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Customers::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::ListCustomersResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListCustomersResponse.load(_response.body) + else + raise _response.body + end + end + + # 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` + # + # @return [Square::Types::CreateCustomerResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateCustomerResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates multiple [customer profiles](entity:Customer) for a business. + # + # This endpoint takes a map of individual create requests and returns a map of responses. + # + # You must provide at least one of the following values in each create request: + # + # - `given_name` + # - `family_name` + # - `company_name` + # - `email_address` + # - `phone_number` + # + # @return [Square::Types::BulkCreateCustomersResponse] + def batch_create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkCreateCustomersResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes multiple customer profiles. + # + # The endpoint takes a list of customer IDs and returns a map of responses. + # + # @return [Square::Types::BulkDeleteCustomersResponse] + def bulk_delete_customers(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkDeleteCustomersResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves multiple customer profiles. + # + # This endpoint takes a list of customer IDs and returns a map of responses. + # + # @return [Square::Types::BulkRetrieveCustomersResponse] + def bulk_retrieve_customers(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkRetrieveCustomersResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates multiple customer profiles. + # + # This endpoint takes a map of individual update requests and returns a map of responses. + # + # @return [Square::Types::BulkUpdateCustomersResponse] + def bulk_update_customers(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkUpdateCustomersResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::SearchCustomersResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchCustomersResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns details for a single customer. + # + # @return [Square::Types::GetCustomerResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetCustomerResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::UpdateCustomerResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateCustomerResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a customer profile from a business. + # + # To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. + # + # @return [Square::Types::DeleteCustomerResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteCustomerResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/customers/custom_attribute_definitions/client.rb b/lib/square/customers/custom_attribute_definitions/client.rb new file mode 100644 index 000000000..9d555fe92 --- /dev/null +++ b/lib/square/customers/custom_attribute_definitions/client.rb @@ -0,0 +1,137 @@ + +module Square + module Customers + module CustomAttributeDefinitions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Customers::CustomAttributeDefinitions::Client] + def initialize(client) + @client = client + end + + # Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + # + # When all response pages are retrieved, the results include all custom attribute definitions + # that are visible to the requesting application, including those that are created by other + # applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that + # seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::ListCustomerCustomAttributeDefinitionsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListCustomerCustomAttributeDefinitionsResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a customer-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + # Use this endpoint to define a custom attribute that can be associated with customer profiles. + # + # A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties + # for a custom attribute. After the definition is created, you can call + # [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) or + # [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + # to set the custom attribute for customer profiles in the seller's Customer Directory. + # + # Sellers can view all custom attributes in exported customer data, including those set to + # `VISIBILITY_HIDDEN`. + # + # @return [Square::Types::CreateCustomerCustomAttributeDefinitionResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateCustomerCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a customer-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + # + # To retrieve a custom attribute definition created by another application, the `visibility` + # setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::GetCustomerCustomAttributeDefinitionResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetCustomerCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates a customer-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + # + # Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the + # `schema` for a `Selection` data type. + # + # Only the definition owner can update a custom attribute definition. Note that sellers can view + # all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. + # + # @return [Square::Types::UpdateCustomerCustomAttributeDefinitionResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateCustomerCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a customer-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + # + # Deleting a custom attribute definition also deletes the corresponding custom attribute from + # all customer profiles in the seller's Customer Directory. + # + # Only the definition owner can delete a custom attribute definition. + # + # @return [Square::Types::DeleteCustomerCustomAttributeDefinitionResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteCustomerCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates or updates [custom attributes](entity:CustomAttribute) for customer profiles as a bulk operation. + # + # Use this endpoint to set the value of one or more custom attributes for one or more customer profiles. + # A custom attribute is based on a custom attribute definition in a Square seller account, which is + # created using the [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) endpoint. + # + # This `BulkUpsertCustomerCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert + # requests and returns a map of individual upsert responses. Each upsert request has a unique ID + # and provides a customer ID and custom attribute. Each upsert response is returned with the ID + # of the corresponding request. + # + # To create or update a custom attribute owned by another application, the `visibility` setting + # must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::BatchUpsertCustomerCustomAttributesResponse] + def batch_upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchUpsertCustomerCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/customers/custom_attribute_definitions/types/batch_upsert_customer_custom_attributes_request.rb b/lib/square/customers/custom_attribute_definitions/types/batch_upsert_customer_custom_attributes_request.rb new file mode 100644 index 000000000..aafaf32cc --- /dev/null +++ b/lib/square/customers/custom_attribute_definitions/types/batch_upsert_customer_custom_attributes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Customers + module CustomAttributeDefinitions + module Types + class BatchUpsertCustomerCustomAttributesRequest < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest], optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/custom_attribute_definitions/types/create_customer_custom_attribute_definition_request.rb b/lib/square/customers/custom_attribute_definitions/types/create_customer_custom_attribute_definition_request.rb new file mode 100644 index 000000000..8db3c29a8 --- /dev/null +++ b/lib/square/customers/custom_attribute_definitions/types/create_customer_custom_attribute_definition_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module CustomAttributeDefinitions + module Types + class CreateCustomerCustomAttributeDefinitionRequest < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb b/lib/square/customers/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..7a2dcaf15 --- /dev/null +++ b/lib/square/customers/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb @@ -0,0 +1,13 @@ + +module Square + module Customers + module CustomAttributeDefinitions + module Types + class DeleteCustomAttributeDefinitionsRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb b/lib/square/customers/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..d44d53be1 --- /dev/null +++ b/lib/square/customers/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module CustomAttributeDefinitions + module Types + class GetCustomAttributeDefinitionsRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb b/lib/square/customers/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..87a5fa063 --- /dev/null +++ b/lib/square/customers/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module CustomAttributeDefinitions + module Types + class ListCustomAttributeDefinitionsRequest < Internal::Types::Model + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/custom_attribute_definitions/types/update_customer_custom_attribute_definition_request.rb b/lib/square/customers/custom_attribute_definitions/types/update_customer_custom_attribute_definition_request.rb new file mode 100644 index 000000000..6bea9614d --- /dev/null +++ b/lib/square/customers/custom_attribute_definitions/types/update_customer_custom_attribute_definition_request.rb @@ -0,0 +1,15 @@ + +module Square + module Customers + module CustomAttributeDefinitions + module Types + class UpdateCustomerCustomAttributeDefinitionRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/custom_attributes/client.rb b/lib/square/customers/custom_attributes/client.rb new file mode 100644 index 000000000..5739ab53c --- /dev/null +++ b/lib/square/customers/custom_attributes/client.rb @@ -0,0 +1,94 @@ + +module Square + module Customers + module CustomAttributes + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Customers::CustomAttributes::Client] + def initialize(client) + @client = client + end + + # Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. + # + # You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + # in the same call. + # + # When all response pages are retrieved, the results include all custom attributes that are + # visible to the requesting application, including those that are owned by other applications + # and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::ListCustomerCustomAttributesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListCustomerCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a [custom attribute](entity:CustomAttribute) associated with a customer profile. + # + # You can use the `with_definition` query parameter to also retrieve the custom attribute definition + # in the same call. + # + # To retrieve a custom attribute owned by another application, the `visibility` setting must be + # `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::GetCustomerCustomAttributeResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetCustomerCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates or updates a [custom attribute](entity:CustomAttribute) for a customer profile. + # + # Use this endpoint to set the value of a custom attribute for a specified customer profile. + # A custom attribute is based on a custom attribute definition in a Square seller account, which + # is created using the [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) endpoint. + # + # To create or update a custom attribute owned by another application, the `visibility` setting + # must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::UpsertCustomerCustomAttributeResponse] + def upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpsertCustomerCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile. + # + # To delete a custom attribute owned by another application, the `visibility` setting must be + # `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::DeleteCustomerCustomAttributeResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteCustomerCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/customers/custom_attributes/types/delete_custom_attributes_request.rb b/lib/square/customers/custom_attributes/types/delete_custom_attributes_request.rb new file mode 100644 index 000000000..f7331fc7e --- /dev/null +++ b/lib/square/customers/custom_attributes/types/delete_custom_attributes_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module CustomAttributes + module Types + class DeleteCustomAttributesRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/custom_attributes/types/get_custom_attributes_request.rb b/lib/square/customers/custom_attributes/types/get_custom_attributes_request.rb new file mode 100644 index 000000000..67aeeb152 --- /dev/null +++ b/lib/square/customers/custom_attributes/types/get_custom_attributes_request.rb @@ -0,0 +1,16 @@ + +module Square + module Customers + module CustomAttributes + module Types + class GetCustomAttributesRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + field :with_definition, Internal::Types::Boolean, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/custom_attributes/types/list_custom_attributes_request.rb b/lib/square/customers/custom_attributes/types/list_custom_attributes_request.rb new file mode 100644 index 000000000..9d9bfb2a7 --- /dev/null +++ b/lib/square/customers/custom_attributes/types/list_custom_attributes_request.rb @@ -0,0 +1,16 @@ + +module Square + module Customers + module CustomAttributes + module Types + class ListCustomAttributesRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :with_definitions, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/custom_attributes/types/upsert_customer_custom_attribute_request.rb b/lib/square/customers/custom_attributes/types/upsert_customer_custom_attribute_request.rb new file mode 100644 index 000000000..7214e5089 --- /dev/null +++ b/lib/square/customers/custom_attributes/types/upsert_customer_custom_attribute_request.rb @@ -0,0 +1,16 @@ + +module Square + module Customers + module CustomAttributes + module Types + class UpsertCustomerCustomAttributeRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/groups/client.rb b/lib/square/customers/groups/client.rb new file mode 100644 index 000000000..f2446a1c0 --- /dev/null +++ b/lib/square/customers/groups/client.rb @@ -0,0 +1,115 @@ + +module Square + module Customers + module Groups + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Customers::Groups::Client] + def initialize(client) + @client = client + end + + # Retrieves the list of customer groups of a business. + # + # @return [Square::Types::ListCustomerGroupsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListCustomerGroupsResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a new customer group for a business. + # + # The request must include the `name` value of the group. + # + # @return [Square::Types::CreateCustomerGroupResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateCustomerGroupResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a specific customer group as identified by the `group_id` value. + # + # @return [Square::Types::GetCustomerGroupResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetCustomerGroupResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates a customer group as identified by the `group_id` value. + # + # @return [Square::Types::UpdateCustomerGroupResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateCustomerGroupResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a customer group as identified by the `group_id` value. + # + # @return [Square::Types::DeleteCustomerGroupResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteCustomerGroupResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::AddGroupToCustomerResponse] + def add(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::AddGroupToCustomerResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::RemoveGroupFromCustomerResponse] + def remove(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RemoveGroupFromCustomerResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/customers/groups/types/add_groups_request.rb b/lib/square/customers/groups/types/add_groups_request.rb new file mode 100644 index 000000000..2ad98cb2c --- /dev/null +++ b/lib/square/customers/groups/types/add_groups_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module Groups + module Types + class AddGroupsRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :group_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/groups/types/create_customer_group_request.rb b/lib/square/customers/groups/types/create_customer_group_request.rb new file mode 100644 index 000000000..274870d2e --- /dev/null +++ b/lib/square/customers/groups/types/create_customer_group_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module Groups + module Types + class CreateCustomerGroupRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :group, Square::Types::CustomerGroup, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/groups/types/delete_groups_request.rb b/lib/square/customers/groups/types/delete_groups_request.rb new file mode 100644 index 000000000..83a9219d5 --- /dev/null +++ b/lib/square/customers/groups/types/delete_groups_request.rb @@ -0,0 +1,13 @@ + +module Square + module Customers + module Groups + module Types + class DeleteGroupsRequest < Internal::Types::Model + field :group_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/groups/types/get_groups_request.rb b/lib/square/customers/groups/types/get_groups_request.rb new file mode 100644 index 000000000..ef805964b --- /dev/null +++ b/lib/square/customers/groups/types/get_groups_request.rb @@ -0,0 +1,13 @@ + +module Square + module Customers + module Groups + module Types + class GetGroupsRequest < Internal::Types::Model + field :group_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/groups/types/list_groups_request.rb b/lib/square/customers/groups/types/list_groups_request.rb new file mode 100644 index 000000000..709587316 --- /dev/null +++ b/lib/square/customers/groups/types/list_groups_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module Groups + module Types + class ListGroupsRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/groups/types/remove_groups_request.rb b/lib/square/customers/groups/types/remove_groups_request.rb new file mode 100644 index 000000000..db29d8ad9 --- /dev/null +++ b/lib/square/customers/groups/types/remove_groups_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module Groups + module Types + class RemoveGroupsRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :group_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/groups/types/update_customer_group_request.rb b/lib/square/customers/groups/types/update_customer_group_request.rb new file mode 100644 index 000000000..1eb38dda0 --- /dev/null +++ b/lib/square/customers/groups/types/update_customer_group_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module Groups + module Types + class UpdateCustomerGroupRequest < Internal::Types::Model + field :group_id, String, optional: false, nullable: false + field :group, Square::Types::CustomerGroup, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/segments/client.rb b/lib/square/customers/segments/client.rb new file mode 100644 index 000000000..531806097 --- /dev/null +++ b/lib/square/customers/segments/client.rb @@ -0,0 +1,42 @@ + +module Square + module Customers + module Segments + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Customers::Segments::Client] + def initialize(client) + @client = client + end + + # Retrieves the list of customer segments of a business. + # + # @return [Square::Types::ListCustomerSegmentsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListCustomerSegmentsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a specific customer segment as identified by the `segment_id` value. + # + # @return [Square::Types::GetCustomerSegmentResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetCustomerSegmentResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/customers/segments/types/get_segments_request.rb b/lib/square/customers/segments/types/get_segments_request.rb new file mode 100644 index 000000000..31fce5091 --- /dev/null +++ b/lib/square/customers/segments/types/get_segments_request.rb @@ -0,0 +1,13 @@ + +module Square + module Customers + module Segments + module Types + class GetSegmentsRequest < Internal::Types::Model + field :segment_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/segments/types/list_segments_request.rb b/lib/square/customers/segments/types/list_segments_request.rb new file mode 100644 index 000000000..445f3010e --- /dev/null +++ b/lib/square/customers/segments/types/list_segments_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module Segments + module Types + class ListSegmentsRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/customers/types/bulk_create_customers_request.rb b/lib/square/customers/types/bulk_create_customers_request.rb new file mode 100644 index 000000000..db730c890 --- /dev/null +++ b/lib/square/customers/types/bulk_create_customers_request.rb @@ -0,0 +1,11 @@ + +module Square + module Customers + module Types + class BulkCreateCustomersRequest < Internal::Types::Model + field :customers, Internal::Types::Hash[String, Square::Types::BulkCreateCustomerData], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/customers/types/bulk_delete_customers_request.rb b/lib/square/customers/types/bulk_delete_customers_request.rb new file mode 100644 index 000000000..7ee99f847 --- /dev/null +++ b/lib/square/customers/types/bulk_delete_customers_request.rb @@ -0,0 +1,11 @@ + +module Square + module Customers + module Types + class BulkDeleteCustomersRequest < Internal::Types::Model + field :customer_ids, Internal::Types::Array[String], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/customers/types/bulk_retrieve_customers_request.rb b/lib/square/customers/types/bulk_retrieve_customers_request.rb new file mode 100644 index 000000000..f7b198a9e --- /dev/null +++ b/lib/square/customers/types/bulk_retrieve_customers_request.rb @@ -0,0 +1,11 @@ + +module Square + module Customers + module Types + class BulkRetrieveCustomersRequest < Internal::Types::Model + field :customer_ids, Internal::Types::Array[String], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/customers/types/bulk_update_customers_request.rb b/lib/square/customers/types/bulk_update_customers_request.rb new file mode 100644 index 000000000..a4c609eab --- /dev/null +++ b/lib/square/customers/types/bulk_update_customers_request.rb @@ -0,0 +1,11 @@ + +module Square + module Customers + module Types + class BulkUpdateCustomersRequest < Internal::Types::Model + field :customers, Internal::Types::Hash[String, Square::Types::BulkUpdateCustomerData], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/customers/types/create_customer_request.rb b/lib/square/customers/types/create_customer_request.rb new file mode 100644 index 000000000..001183610 --- /dev/null +++ b/lib/square/customers/types/create_customer_request.rb @@ -0,0 +1,22 @@ + +module Square + module Customers + module Types + class CreateCustomerRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :given_name, String, optional: true, nullable: false + field :family_name, String, optional: true, nullable: false + field :company_name, String, optional: true, nullable: false + field :nickname, String, optional: true, nullable: false + field :email_address, String, optional: true, nullable: false + field :address, Square::Types::Address, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :birthday, String, optional: true, nullable: false + field :tax_ids, Square::Types::CustomerTaxIds, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/customers/types/delete_customers_request.rb b/lib/square/customers/types/delete_customers_request.rb new file mode 100644 index 000000000..2988123d7 --- /dev/null +++ b/lib/square/customers/types/delete_customers_request.rb @@ -0,0 +1,12 @@ + +module Square + module Customers + module Types + class DeleteCustomersRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/customers/types/get_customers_request.rb b/lib/square/customers/types/get_customers_request.rb new file mode 100644 index 000000000..358c55fcc --- /dev/null +++ b/lib/square/customers/types/get_customers_request.rb @@ -0,0 +1,11 @@ + +module Square + module Customers + module Types + class GetCustomersRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/customers/types/list_customers_request.rb b/lib/square/customers/types/list_customers_request.rb new file mode 100644 index 000000000..230ab3bb9 --- /dev/null +++ b/lib/square/customers/types/list_customers_request.rb @@ -0,0 +1,15 @@ + +module Square + module Customers + module Types + class ListCustomersRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :sort_field, Square::Types::CustomerSortField, optional: true, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + field :count, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/customers/types/search_customers_request.rb b/lib/square/customers/types/search_customers_request.rb new file mode 100644 index 000000000..96257bd70 --- /dev/null +++ b/lib/square/customers/types/search_customers_request.rb @@ -0,0 +1,14 @@ + +module Square + module Customers + module Types + class SearchCustomersRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :query, Square::Types::CustomerQuery, optional: true, nullable: false + field :count, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/customers/types/update_customer_request.rb b/lib/square/customers/types/update_customer_request.rb new file mode 100644 index 000000000..a9e64a454 --- /dev/null +++ b/lib/square/customers/types/update_customer_request.rb @@ -0,0 +1,23 @@ + +module Square + module Customers + module Types + class UpdateCustomerRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :given_name, String, optional: true, nullable: false + field :family_name, String, optional: true, nullable: false + field :company_name, String, optional: true, nullable: false + field :nickname, String, optional: true, nullable: false + field :email_address, String, optional: true, nullable: false + field :address, Square::Types::Address, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :birthday, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :tax_ids, Square::Types::CustomerTaxIds, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/devices/client.rb b/lib/square/devices/client.rb new file mode 100644 index 000000000..cbf36237b --- /dev/null +++ b/lib/square/devices/client.rb @@ -0,0 +1,41 @@ + +module Square + module Devices + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Devices::Client] + def initialize(client) + @client = client + end + + # List devices associated with the merchant. Currently, only Terminal API + # devices are supported. + # + # @return [Square::Types::ListDevicesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListDevicesResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves Device with the associated `device_id`. + # + # @return [Square::Types::GetDeviceResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetDeviceResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/devices/codes/client.rb b/lib/square/devices/codes/client.rb new file mode 100644 index 000000000..960495e64 --- /dev/null +++ b/lib/square/devices/codes/client.rb @@ -0,0 +1,56 @@ + +module Square + module Devices + module Codes + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Devices::Codes::Client] + def initialize(client) + @client = client + end + + # Lists all DeviceCodes associated with the merchant. + # + # @return [Square::Types::ListDeviceCodesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListDeviceCodesResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected + # terminal mode. + # + # @return [Square::Types::CreateDeviceCodeResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateDeviceCodeResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves DeviceCode with the associated ID. + # + # @return [Square::Types::GetDeviceCodeResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetDeviceCodeResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/devices/codes/types/create_device_code_request.rb b/lib/square/devices/codes/types/create_device_code_request.rb new file mode 100644 index 000000000..9c36b2580 --- /dev/null +++ b/lib/square/devices/codes/types/create_device_code_request.rb @@ -0,0 +1,14 @@ + +module Square + module Devices + module Codes + module Types + class CreateDeviceCodeRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :device_code, Square::Types::DeviceCode, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/devices/codes/types/get_codes_request.rb b/lib/square/devices/codes/types/get_codes_request.rb new file mode 100644 index 000000000..3d482d128 --- /dev/null +++ b/lib/square/devices/codes/types/get_codes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Devices + module Codes + module Types + class GetCodesRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/devices/codes/types/list_codes_request.rb b/lib/square/devices/codes/types/list_codes_request.rb new file mode 100644 index 000000000..0e56cc400 --- /dev/null +++ b/lib/square/devices/codes/types/list_codes_request.rb @@ -0,0 +1,16 @@ + +module Square + module Devices + module Codes + module Types + class ListCodesRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :product_type, String, optional: true, nullable: false + field :status, Square::Types::DeviceCodeStatus, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/devices/types/get_devices_request.rb b/lib/square/devices/types/get_devices_request.rb new file mode 100644 index 000000000..9ef45ee70 --- /dev/null +++ b/lib/square/devices/types/get_devices_request.rb @@ -0,0 +1,11 @@ + +module Square + module Devices + module Types + class GetDevicesRequest < Internal::Types::Model + field :device_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/devices/types/list_devices_request.rb b/lib/square/devices/types/list_devices_request.rb new file mode 100644 index 000000000..61f0f0d08 --- /dev/null +++ b/lib/square/devices/types/list_devices_request.rb @@ -0,0 +1,14 @@ + +module Square + module Devices + module Types + class ListDevicesRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/disputes/client.rb b/lib/square/disputes/client.rb new file mode 100644 index 000000000..2c79dc0bd --- /dev/null +++ b/lib/square/disputes/client.rb @@ -0,0 +1,103 @@ + +module Square + module Disputes + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Disputes::Client] + def initialize(client) + @client = client + end + + # Returns a list of disputes associated with a particular account. + # + # @return [Square::Types::ListDisputesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListDisputesResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns details about a specific dispute. + # + # @return [Square::Types::GetDisputeResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetDisputeResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::AcceptDisputeResponse] + def accept(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::AcceptDisputeResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::CreateDisputeEvidenceFileResponse] + def create_evidence_file(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateDisputeEvidenceFileResponse.load(_response.body) + else + raise _response.body + end + end + + # Uploads text to use as evidence for a dispute challenge. + # + # @return [Square::Types::CreateDisputeEvidenceTextResponse] + def create_evidence_text(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateDisputeEvidenceTextResponse.load(_response.body) + else + raise _response.body + end + end + + # Submits evidence to the cardholder's bank. + # + # The evidence submitted by this endpoint includes evidence uploaded + # using the [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) and + # [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText) endpoints and + # evidence automatically provided by Square, when available. Evidence cannot be removed from + # a dispute after submission. + # + # @return [Square::Types::SubmitEvidenceResponse] + def submit_evidence(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SubmitEvidenceResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/disputes/evidence/client.rb b/lib/square/disputes/evidence/client.rb new file mode 100644 index 000000000..d8daa07c1 --- /dev/null +++ b/lib/square/disputes/evidence/client.rb @@ -0,0 +1,58 @@ + +module Square + module Disputes + module Evidence + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Disputes::Evidence::Client] + def initialize(client) + @client = client + end + + # Returns a list of evidence associated with a dispute. + # + # @return [Square::Types::ListDisputeEvidenceResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListDisputeEvidenceResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::GetDisputeEvidenceResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetDisputeEvidenceResponse.load(_response.body) + else + raise _response.body + end + end + + # Removes specified evidence from a dispute. + # Square does not send the bank any evidence that is removed. + # + # @return [Square::Types::DeleteDisputeEvidenceResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteDisputeEvidenceResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/disputes/evidence/types/delete_evidence_request.rb b/lib/square/disputes/evidence/types/delete_evidence_request.rb new file mode 100644 index 000000000..7cb4679e2 --- /dev/null +++ b/lib/square/disputes/evidence/types/delete_evidence_request.rb @@ -0,0 +1,14 @@ + +module Square + module Disputes + module Evidence + module Types + class DeleteEvidenceRequest < Internal::Types::Model + field :dispute_id, String, optional: false, nullable: false + field :evidence_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/disputes/evidence/types/get_evidence_request.rb b/lib/square/disputes/evidence/types/get_evidence_request.rb new file mode 100644 index 000000000..61f38a339 --- /dev/null +++ b/lib/square/disputes/evidence/types/get_evidence_request.rb @@ -0,0 +1,14 @@ + +module Square + module Disputes + module Evidence + module Types + class GetEvidenceRequest < Internal::Types::Model + field :dispute_id, String, optional: false, nullable: false + field :evidence_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/disputes/evidence/types/list_evidence_request.rb b/lib/square/disputes/evidence/types/list_evidence_request.rb new file mode 100644 index 000000000..07683a95f --- /dev/null +++ b/lib/square/disputes/evidence/types/list_evidence_request.rb @@ -0,0 +1,14 @@ + +module Square + module Disputes + module Evidence + module Types + class ListEvidenceRequest < Internal::Types::Model + field :dispute_id, String, optional: false, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/disputes/types/accept_disputes_request.rb b/lib/square/disputes/types/accept_disputes_request.rb new file mode 100644 index 000000000..6d3c16b9b --- /dev/null +++ b/lib/square/disputes/types/accept_disputes_request.rb @@ -0,0 +1,11 @@ + +module Square + module Disputes + module Types + class AcceptDisputesRequest < Internal::Types::Model + field :dispute_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/disputes/types/create_dispute_evidence_text_request.rb b/lib/square/disputes/types/create_dispute_evidence_text_request.rb new file mode 100644 index 000000000..e8db5e777 --- /dev/null +++ b/lib/square/disputes/types/create_dispute_evidence_text_request.rb @@ -0,0 +1,14 @@ + +module Square + module Disputes + module Types + class CreateDisputeEvidenceTextRequest < Internal::Types::Model + field :dispute_id, String, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + field :evidence_type, Square::Types::DisputeEvidenceType, optional: true, nullable: false + field :evidence_text, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/disputes/types/create_evidence_file_disputes_request.rb b/lib/square/disputes/types/create_evidence_file_disputes_request.rb new file mode 100644 index 000000000..57c67e979 --- /dev/null +++ b/lib/square/disputes/types/create_evidence_file_disputes_request.rb @@ -0,0 +1,11 @@ + +module Square + module Disputes + module Types + class CreateEvidenceFileDisputesRequest < Internal::Types::Model + field :dispute_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/disputes/types/get_disputes_request.rb b/lib/square/disputes/types/get_disputes_request.rb new file mode 100644 index 000000000..fe90c3c25 --- /dev/null +++ b/lib/square/disputes/types/get_disputes_request.rb @@ -0,0 +1,11 @@ + +module Square + module Disputes + module Types + class GetDisputesRequest < Internal::Types::Model + field :dispute_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/disputes/types/list_disputes_request.rb b/lib/square/disputes/types/list_disputes_request.rb new file mode 100644 index 000000000..4469ebd70 --- /dev/null +++ b/lib/square/disputes/types/list_disputes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Disputes + module Types + class ListDisputesRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :states, Square::Types::DisputeState, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/disputes/types/submit_evidence_disputes_request.rb b/lib/square/disputes/types/submit_evidence_disputes_request.rb new file mode 100644 index 000000000..c48ab1054 --- /dev/null +++ b/lib/square/disputes/types/submit_evidence_disputes_request.rb @@ -0,0 +1,11 @@ + +module Square + module Disputes + module Types + class SubmitEvidenceDisputesRequest < Internal::Types::Model + field :dispute_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/employees/client.rb b/lib/square/employees/client.rb new file mode 100644 index 000000000..1b88f63f6 --- /dev/null +++ b/lib/square/employees/client.rb @@ -0,0 +1,36 @@ + +module Square + module Employees + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Employees::Client] + def initialize(client) + @client = client + end + + # @return [Square::Types::ListEmployeesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListEmployeesResponse.load(_response.body) + else + raise _response.body + end + end + + # @return [Square::Types::GetEmployeeResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetEmployeeResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/employees/types/get_employees_request.rb b/lib/square/employees/types/get_employees_request.rb new file mode 100644 index 000000000..2b4ec7887 --- /dev/null +++ b/lib/square/employees/types/get_employees_request.rb @@ -0,0 +1,11 @@ + +module Square + module Employees + module Types + class GetEmployeesRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/employees/types/list_employees_request.rb b/lib/square/employees/types/list_employees_request.rb new file mode 100644 index 000000000..1898e7d07 --- /dev/null +++ b/lib/square/employees/types/list_employees_request.rb @@ -0,0 +1,14 @@ + +module Square + module Employees + module Types + class ListEmployeesRequest < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + field :status, Square::Types::EmployeeStatus, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/environment.rb b/lib/square/environment.rb new file mode 100644 index 000000000..19f045c04 --- /dev/null +++ b/lib/square/environment.rb @@ -0,0 +1,9 @@ + +module Square + class Environment + PRODUCTION = "https://connect.squareup.com" + SANDBOX = "https://connect.squareupsandbox.com" + + + end +end diff --git a/lib/square/events/client.rb b/lib/square/events/client.rb new file mode 100644 index 000000000..a511e28d2 --- /dev/null +++ b/lib/square/events/client.rb @@ -0,0 +1,68 @@ + +module Square + module Events + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Events::Client] + def initialize(client) + @client = client + end + + # Search for Square API events that occur within a 28-day timeframe. + # + # @return [Square::Types::SearchEventsResponse] + def search_events(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchEventsResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::DisableEventsResponse] + def disable_events(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DisableEventsResponse.load(_response.body) + else + raise _response.body + end + end + + # Enables events to make them searchable. Only events that occur while in the enabled state are searchable. + # + # @return [Square::Types::EnableEventsResponse] + def enable_events(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::EnableEventsResponse.load(_response.body) + else + raise _response.body + end + end + + # Lists all event types that you can subscribe to as webhooks or query using the Events API. + # + # @return [Square::Types::ListEventTypesResponse] + def list_event_types(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListEventTypesResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/events/types/list_event_types_request.rb b/lib/square/events/types/list_event_types_request.rb new file mode 100644 index 000000000..f389573eb --- /dev/null +++ b/lib/square/events/types/list_event_types_request.rb @@ -0,0 +1,11 @@ + +module Square + module Events + module Types + class ListEventTypesRequest < Internal::Types::Model + field :api_version, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/events/types/search_events_request.rb b/lib/square/events/types/search_events_request.rb new file mode 100644 index 000000000..39345c14a --- /dev/null +++ b/lib/square/events/types/search_events_request.rb @@ -0,0 +1,13 @@ + +module Square + module Events + module Types + class SearchEventsRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :query, Square::Types::SearchEventsQuery, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/gift_cards/activities/client.rb b/lib/square/gift_cards/activities/client.rb new file mode 100644 index 000000000..bbd286963 --- /dev/null +++ b/lib/square/gift_cards/activities/client.rb @@ -0,0 +1,46 @@ + +module Square + module GiftCards + module Activities + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::GiftCards::Activities::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::ListGiftCardActivitiesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListGiftCardActivitiesResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a gift card activity to manage the balance or state of a [gift card](entity:GiftCard). + # For example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use. + # + # @return [Square::Types::CreateGiftCardActivityResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateGiftCardActivityResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/gift_cards/activities/types/create_gift_card_activity_request.rb b/lib/square/gift_cards/activities/types/create_gift_card_activity_request.rb new file mode 100644 index 000000000..8241bc462 --- /dev/null +++ b/lib/square/gift_cards/activities/types/create_gift_card_activity_request.rb @@ -0,0 +1,14 @@ + +module Square + module GiftCards + module Activities + module Types + class CreateGiftCardActivityRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :gift_card_activity, Square::Types::GiftCardActivity, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/gift_cards/activities/types/list_activities_request.rb b/lib/square/gift_cards/activities/types/list_activities_request.rb new file mode 100644 index 000000000..2cde4dd6f --- /dev/null +++ b/lib/square/gift_cards/activities/types/list_activities_request.rb @@ -0,0 +1,20 @@ + +module Square + module GiftCards + module Activities + module Types + class ListActivitiesRequest < Internal::Types::Model + field :gift_card_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :begin_time, String, optional: true, nullable: false + field :end_time, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :sort_order, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/gift_cards/client.rb b/lib/square/gift_cards/client.rb new file mode 100644 index 000000000..8476046ce --- /dev/null +++ b/lib/square/gift_cards/client.rb @@ -0,0 +1,110 @@ + +module Square + module GiftCards + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::GiftCards::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::ListGiftCardsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListGiftCardsResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift card + # has a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, call + # [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) and create an `ACTIVATE` + # activity with the initial balance. Alternatively, you can use [RefundPayment](api-endpoint:Refunds-RefundPayment) + # to refund a payment to the new gift card. + # + # @return [Square::Types::CreateGiftCardResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateGiftCardResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a gift card using the gift card account number (GAN). + # + # @return [Square::Types::GetGiftCardFromGanResponse] + def get_from_gan(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetGiftCardFromGanResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a gift card using a secure payment token that represents the gift card. + # + # @return [Square::Types::GetGiftCardFromNonceResponse] + def get_from_nonce(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetGiftCardFromNonceResponse.load(_response.body) + else + raise _response.body + end + end + + # Links a customer to a gift card, which is also referred to as adding a card on file. + # + # @return [Square::Types::LinkCustomerToGiftCardResponse] + def link_customer(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::LinkCustomerToGiftCardResponse.load(_response.body) + else + raise _response.body + end + end + + # Unlinks a customer from a gift card, which is also referred to as removing a card on file. + # + # @return [Square::Types::UnlinkCustomerFromGiftCardResponse] + def unlink_customer(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UnlinkCustomerFromGiftCardResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a gift card using the gift card ID. + # + # @return [Square::Types::GetGiftCardResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetGiftCardResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/gift_cards/types/create_gift_card_request.rb b/lib/square/gift_cards/types/create_gift_card_request.rb new file mode 100644 index 000000000..8e314425a --- /dev/null +++ b/lib/square/gift_cards/types/create_gift_card_request.rb @@ -0,0 +1,13 @@ + +module Square + module GiftCards + module Types + class CreateGiftCardRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :location_id, String, optional: false, nullable: false + field :gift_card, Square::Types::GiftCard, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/gift_cards/types/get_gift_card_from_gan_request.rb b/lib/square/gift_cards/types/get_gift_card_from_gan_request.rb new file mode 100644 index 000000000..3eebeb1d6 --- /dev/null +++ b/lib/square/gift_cards/types/get_gift_card_from_gan_request.rb @@ -0,0 +1,11 @@ + +module Square + module GiftCards + module Types + class GetGiftCardFromGanRequest < Internal::Types::Model + field :gan, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/gift_cards/types/get_gift_card_from_nonce_request.rb b/lib/square/gift_cards/types/get_gift_card_from_nonce_request.rb new file mode 100644 index 000000000..d1c975ceb --- /dev/null +++ b/lib/square/gift_cards/types/get_gift_card_from_nonce_request.rb @@ -0,0 +1,11 @@ + +module Square + module GiftCards + module Types + class GetGiftCardFromNonceRequest < Internal::Types::Model + field :nonce, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/gift_cards/types/get_gift_cards_request.rb b/lib/square/gift_cards/types/get_gift_cards_request.rb new file mode 100644 index 000000000..0b1bf1b40 --- /dev/null +++ b/lib/square/gift_cards/types/get_gift_cards_request.rb @@ -0,0 +1,11 @@ + +module Square + module GiftCards + module Types + class GetGiftCardsRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/gift_cards/types/link_customer_to_gift_card_request.rb b/lib/square/gift_cards/types/link_customer_to_gift_card_request.rb new file mode 100644 index 000000000..1b0212900 --- /dev/null +++ b/lib/square/gift_cards/types/link_customer_to_gift_card_request.rb @@ -0,0 +1,12 @@ + +module Square + module GiftCards + module Types + class LinkCustomerToGiftCardRequest < Internal::Types::Model + field :gift_card_id, String, optional: false, nullable: false + field :customer_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/gift_cards/types/list_gift_cards_request.rb b/lib/square/gift_cards/types/list_gift_cards_request.rb new file mode 100644 index 000000000..ab68a7fc2 --- /dev/null +++ b/lib/square/gift_cards/types/list_gift_cards_request.rb @@ -0,0 +1,15 @@ + +module Square + module GiftCards + module Types + class ListGiftCardsRequest < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :state, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/gift_cards/types/unlink_customer_from_gift_card_request.rb b/lib/square/gift_cards/types/unlink_customer_from_gift_card_request.rb new file mode 100644 index 000000000..1f77cf03e --- /dev/null +++ b/lib/square/gift_cards/types/unlink_customer_from_gift_card_request.rb @@ -0,0 +1,12 @@ + +module Square + module GiftCards + module Types + class UnlinkCustomerFromGiftCardRequest < Internal::Types::Model + field :gift_card_id, String, optional: false, nullable: false + field :customer_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/internal/errors/constraint_error.rb b/lib/square/internal/errors/constraint_error.rb new file mode 100644 index 000000000..1def656aa --- /dev/null +++ b/lib/square/internal/errors/constraint_error.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Internal + module Errors + class ConstraintError < StandardError + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/errors/type_error.rb b/lib/square/internal/errors/type_error.rb new file mode 100644 index 000000000..c72468ba5 --- /dev/null +++ b/lib/square/internal/errors/type_error.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Internal + module Errors + class TypeError < StandardError + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/http/base_request.rb b/lib/square/internal/http/base_request.rb new file mode 100644 index 000000000..60036951e --- /dev/null +++ b/lib/square/internal/http/base_request.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Square + module Internal + module Http + # @api private + class BaseRequest + attr_reader :base_url, :path, :method, :headers, :query, :request_options + + # @param base_url [String] The base URL for the request + # @param path [String] The path for the request + # @param method [String] The HTTP method for the request (:get, :post, etc.) + # @param headers [Hash] Additional headers for the request (optional) + # @param query [Hash] Query parameters for the request (optional) + # @param request_options [Square::RequestOptions, Hash{Symbol=>Object}, nil] + def initialize(base_url:, path:, method:, headers: {}, query: {}, request_options: {}) + @base_url = base_url + @path = path + @method = method + @headers = headers + @query = query + @request_options = request_options + end + + # Child classes should implement: + # - encode_headers: Returns the encoded HTTP request headers. + # - encode_body: Returns the encoded HTTP request body. + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/http/raw_client.rb b/lib/square/internal/http/raw_client.rb new file mode 100644 index 000000000..ed7a9423d --- /dev/null +++ b/lib/square/internal/http/raw_client.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +module Square + module Internal + module Http + # @api private + class RawClient + # @param base_url [String] The base url for the request. + # @param max_retries [Integer] The number of times to retry a failed request, defaults to 2. + # @param timeout [Float] The timeout for the request, defaults to 60.0 seconds. + # @param headers [Hash] The headers for the request. + def initialize(base_url:, max_retries: 2, timeout: 60.0, headers: {}) + @base_url = base_url + @max_retries = max_retries + @timeout = timeout + @default_headers = { + "X-Fern-Language": "Ruby", + "X-Fern-SDK-Name": "square", + "X-Fern-SDK-Version": "0.0.1" + }.merge(headers) + end + + # @param request [Square::Internal::Http::BaseRequest] The HTTP request. + # @return [HTTP::Response] The HTTP response. + def send(request) + url = build_url(request) + + http_request = build_http_request( + url:, + method: request.method, + headers: request.encode_headers, + body: request.encode_body + ) + + conn = connect(url) + conn.open_timeout = @timeout + conn.read_timeout = @timeout + conn.write_timeout = @timeout + conn.continue_timeout = @timeout + + conn.request(http_request) + # begin + # conn.request(http_request) + # rescue StandardError => e + # raise HttpError, "HTTP request failed: #{e.message}" + # end + end + + # @param request [Square::Internal::Http::BaseRequest] The HTTP request. + # @return [URI::Generic] The URL. + def build_url(request) + path = request.path.start_with?("/") ? request.path[1..] : request.path + url = "#{@base_url.chomp("/")}/#{path}" + url = "#{url}?#{encode_query(request.query)}" if request.query + URI.parse(url) + end + + # @param url [URI::Generic] The url to the resource. + # @param method [String] The HTTP method to use. + # @param headers [Hash] The headers for the request. + # @param body [String, nil] The body for the request. + # @return [HTTP::Request] The HTTP request. + def build_http_request(url:, method:, headers: {}, body: nil) + request = Net::HTTPGenericRequest.new( + method, + !body.nil?, + method != "HEAD", + url + ) + + request_headers = @default_headers.merge(headers) + request_headers.each { |name, value| request[name] = value } + request.body = body if body + + request + end + + # @param query [Hash] The query for the request. + # @return [String, nil] The encoded query. + def encode_query(query) + query.to_h.empty? ? nil : URI.encode_www_form(query) + end + + # @param url [URI::Generic] The url to connect to. + # @return [Net::HTTP] The HTTP connection. + def connect(url) + is_https = (url.scheme == "https") + + port = if url.port + url.port + elsif is_https + Net::HTTP.https_default_port + else + Net::HTTP.http_default_port + end + + http = Net::HTTP.new(url.host, port) + http.use_ssl = is_https + http.max_retries = 0 + http + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/json/request.rb b/lib/square/internal/json/request.rb new file mode 100644 index 000000000..86d7fc087 --- /dev/null +++ b/lib/square/internal/json/request.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Square + module Internal + module Multipart + # @api private + class Request < Square::Internal::Http::BaseRequest + attr_reader :body + + # @param base_url [String] The base URL for the request + # @param path [String] The path for the request + # @param method [Symbol] The HTTP method for the request (:get, :post, etc.) + # @param headers [Hash] Additional headers for the request (optional) + # @param query [Hash] Query parameters for the request (optional) + # @param body [Object, nil] The JSON request body (optional) + # @param request_options [Square::RequestOptions, Hash{Symbol=>Object}, nil] + def initialize(base_url:, path:, method:, headers: {}, query: {}, body: nil, request_options: {}) + super(base_url:, path:, method:, headers:, query:, request_options:) + + @body = body + end + + # @return [Hash] The encoded HTTP request headers. + def encode_headers + { + "Content-Type" => "application/json", + "Accept" => "application/json" + }.merge(@headers) + end + + # @return [String, nil] The encoded HTTP request body. + def encode_body + @body.nil? ? nil : ::JSON.generate(@body) + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/json/serializable.rb b/lib/square/internal/json/serializable.rb new file mode 100644 index 000000000..e9e664184 --- /dev/null +++ b/lib/square/internal/json/serializable.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Square + module Internal + module JSON + module Serializable + # Loads data from JSON into its deserialized form + # + # @param str [String] Raw JSON to load into an object + # @return [Object] + def load(str) + raise NotImplementedError + end + + # Dumps data from its deserialized form into JSON + # + # @param value [Object] The deserialized value + # @return [String] + def dump(value) + raise NotImplementedError + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/multipart/multipart_encoder.rb b/lib/square/internal/multipart/multipart_encoder.rb new file mode 100644 index 000000000..d182c743e --- /dev/null +++ b/lib/square/internal/multipart/multipart_encoder.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +module Square + module Internal + module Multipart + # Encodes parameters into a `multipart/form-data` payload as described by RFC + # 2388: + # + # https://tools.ietf.org/html/rfc2388 + # + # This is most useful for transferring file-like objects. + # + # Parameters should be added with `#encode`. When ready, use `#body` to get + # the encoded result and `#content_type` to get the value that should be + # placed in the `Content-Type` header of a subsequent request (which includes + # a boundary value). + # + # This abstraction is heavily inspired by Stripe's multipart/form-data implementation, + # which can be found here: + # + # https://github.com/stripe/stripe-ruby/blob/ca00b676f04ac421cf5cb5ff0325f243651677b6/lib/stripe/multipart_encoder.rb#L18 + # + # @api private + class Encoder + CONTENT_TYPE = "multipart/form-data" + CRLF = "\r\n" + + attr_reader :boundary, :body + + def initialize + # Chose the same number of random bytes that Go uses in its standard + # library implementation. Easily enough entropy to ensure that it won't + # be present in a file we're sending. + @boundary = SecureRandom.hex(30) + + @body = String.new + @closed = false + @first_field = true + end + + # Gets the content type string including the boundary. + # + # @return [String] The content type with boundary + def content_type + "#{CONTENT_TYPE}; boundary=#{@boundary}" + end + + # Encode the given FormData object into a multipart/form-data payload. + # + # @param form_data [FormData] The form data to encode + # @return [String] The encoded body. + def encode(form_data) + return "" if form_data.parts.empty? + + form_data.parts.each do |part| + write_part(part) + end + close + + @body + end + + # Writes a FormDataPart to the encoder. + # + # @param part [FormDataPart] The part to write + # @return [nil] + def write_part(part) + raise "Cannot write to closed encoder" if @closed + + write_field( + name: part.name, + data: part.contents, + filename: part.filename, + headers: part.headers + ) + + nil + end + + # Writes a field to the encoder. + # + # @param name [String] The field name + # @param data [String] The field data + # @param filename [String, nil] Optional filename + # @param headers [Hash, nil] Optional additional headers + # @return [nil] + def write_field(name:, data:, filename: nil, headers: nil) + raise "Cannot write to closed encoder" if @closed + + if @first_field + @first_field = false + else + @body << CRLF + end + + @body << "--#{@boundary}#{CRLF}" + @body << %(Content-Disposition: form-data; name="#{escape(name.to_s)}") + @body << %(; filename="#{escape(filename)}") if filename + @body << CRLF + + if headers + headers.each do |key, value| + @body << "#{key}: #{value}#{CRLF}" + end + elsif filename + # Default content type for files. + @body << "Content-Type: application/octet-stream#{CRLF}" + end + + @body << CRLF + @body << data.to_s + + nil + end + + # Finalizes the encoder by writing the final boundary. + # + # @return [nil] + def close + raise "Encoder already closed" if @closed + + @body << CRLF + @body << "--#{@boundary}--" + @closed = true + + nil + end + + private + + # Escapes quotes for use in header values and replaces line breaks with spaces. + # + # @param str [String] The string to escape + # @return [String] The escaped string + def escape(str) + str.to_s.gsub('"', "%22").tr("\n", " ").tr("\r", " ") + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/multipart/multipart_form_data.rb b/lib/square/internal/multipart/multipart_form_data.rb new file mode 100644 index 000000000..b807463af --- /dev/null +++ b/lib/square/internal/multipart/multipart_form_data.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module Square + module Internal + module Multipart + # @api private + class FormData + # @return [Array] The parts in this multipart form data. + attr_reader :parts + + # @return [Encoder] The encoder for this multipart form data. + private attr_reader :encoder + + def initialize + @encoder = Encoder.new + @parts = [] + end + + # Adds a new part to the multipart form data. + # + # @param name [String] The name of the form field + # @param value [String, Integer, Float, Boolean, #read] The value of the field + # @param content_type [String, nil] Optional content type + # @return [self] Returns self for chaining + def add(name:, value:, content_type: nil) + headers = content_type ? { "Content-Type" => content_type } : nil + add_part(FormDataPart.new(name:, value:, headers:)) + end + + # Adds a file to the multipart form data. + # + # @param name [String] The name of the form field + # @param file [#read] The file or readable object + # @param filename [String, nil] Optional filename (defaults to basename of path for File objects) + # @param content_type [String, nil] Optional content type (e.g. "image/png") + # @return [self] Returns self for chaining + def add_file(name:, file:, filename: nil, content_type: nil) + headers = content_type ? { "Content-Type" => content_type } : nil + filename ||= filename_for(file) + add_part(FormDataPart.new(name:, value: file, filename:, headers:)) + end + + # Adds a pre-created part to the multipart form data. + # + # @param part [FormDataPart] The part to add + # @return [self] Returns self for chaining + def add_part(part) + @parts << part + self + end + + # Gets the content type string including the boundary. + # + # @return [String] The content type with boundary. + def content_type + @encoder.content_type + end + + # Encode the multipart form data into a multipart/form-data payload. + # + # @return [String] The encoded body. + def encode + @encoder.encode(self) + end + + private + + def filename_for(file) + if file.is_a?(::File) || file.respond_to?(:path) + ::File.basename(file.path) + elsif file.respond_to?(:name) + file.name + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/multipart/multipart_form_data_part.rb b/lib/square/internal/multipart/multipart_form_data_part.rb new file mode 100644 index 000000000..ae1d26b1c --- /dev/null +++ b/lib/square/internal/multipart/multipart_form_data_part.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +require "securerandom" + +module Square + module Internal + module Multipart + # @api private + class FormDataPart + attr_reader :name, :contents, :filename, :headers + + # @param name [String] The name of the form field + # @param value [String, Integer, Float, Boolean, File, #read] The value of the field + # @param filename [String, nil] Optional filename for file uploads + # @param headers [Hash, nil] Optional additional headers + def initialize(name:, value:, filename: nil, headers: nil) + @name = name + @contents = convert_to_content(value) + @filename = filename + @headers = headers + end + + # Converts the part to a hash suitable for serialization. + # + # @return [Hash] A hash representation of the part + def to_hash + result = { + name: @name, + contents: @contents + } + result[:filename] = @filename if @filename + result[:headers] = @headers if @headers + result + end + + private + + # Converts various types of values to a content representation + # @param value [String, Integer, Float, Boolean, #read] The value to convert + # @return [String] The string representation of the value + def convert_to_content(value) + if value.respond_to?(:read) + value.read + else + value.to_s + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/multipart/multipart_request.rb b/lib/square/internal/multipart/multipart_request.rb new file mode 100644 index 000000000..e6fd33615 --- /dev/null +++ b/lib/square/internal/multipart/multipart_request.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Square + module Internal + module Multipart + # @api private + class Request Square::Internal::Http::BaseRequest + attr_reader :body + + # @param base_url [String] The base URL for the request + # @param path [String] The path for the request + # @param method [Symbol] The HTTP method for the request (:get, :post, etc.) + # @param headers [Hash] Additional headers for the request (optional) + # @param query [Hash] Query parameters for the request (optional) + # @param body [MultipartFormData, nil] The multipart form data for the request (optional) + # @param request_options [Square::RequestOptions, Hash{Symbol=>Object}, nil] + def initialize(base_url:, path:, method:, headers: {}, query: {}, body: nil, request_options: {}) + super(base_url:, path:, method:, headers:, query:, request_options:) + + @body = body + end + + # @return [Hash] The encoded HTTP request headers. + def encode_headers + { + "Content-Type" => @body.content_type + }.merge(@headers) + end + + # @return [String, nil] The encoded HTTP request body. + def encode_body + @body&.encode + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/types/array.rb b/lib/square/internal/types/array.rb new file mode 100644 index 000000000..0d9c5805c --- /dev/null +++ b/lib/square/internal/types/array.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Square + module Internal + module Types + # An array of a specific type + class Array + include Square::Internal::Types::Type + + attr_reader :type + + class << self + # Instantiates a new `Array` of a given type + # + # @param type [Object] The member type of this array + # + # @return [Square::Internal::Types::Array] + def [](type) + new(type) + end + end + + # @api private + def initialize(type) + @type = type + end + + # Coerces a value into this array + # + # @param value [Object] + # @option strict [Boolean] + # @return [::Array] + def coerce(value, strict: strict?) + unless value.is_a?(::Array) + raise Errors::TypeError, "cannot coerce `#{value.class}` to Array<#{type}>" if strict + + return value + end + + value.map do |element| + Utils.coerce(type, element, strict: strict) + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/types/boolean.rb b/lib/square/internal/types/boolean.rb new file mode 100644 index 000000000..5562ddd05 --- /dev/null +++ b/lib/square/internal/types/boolean.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Square + module Internal + module Types + module Boolean + extend Square::Internal::Types::Union + + member TrueClass + member FalseClass + + # Overrides the base coercion method for enums to allow integer and string values to become booleans + # + # @param value [Object] + # @option strict [Boolean] + # @return [Object] + def self.coerce(value, strict: strict?) + case value + when TrueClass, FalseClass + value + when Integer + return value == 1 + when String + return %w[1 true].include?(value) + end + + raise Errors::TypeError, "cannot coerce `#{value.class}` to Boolean" if strict + + value + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/types/enum.rb b/lib/square/internal/types/enum.rb new file mode 100644 index 000000000..ad2bdb251 --- /dev/null +++ b/lib/square/internal/types/enum.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Square + module Internal + module Types + # Module for defining enums + module Enum + include Square::Internal::Types::Type + + # @api private + # + # @return [Array] + def values + @values ||= constants.map { |c| const_get(c) } + end + + # @api private + def finalize! + values + end + + # @api private + def strict? + @strict ||= false + end + + # @api private + def strict! + @strict = true + end + + def coerce(value, strict: strict?) + coerced_value = Utils.coerce(Symbol, value) + + return coerced_value if values.include?(coerced_value) + + raise Errors::TypeError, "`#{value}` not in enum #{self}" if strict + + value + end + + def inspect + "#{name}[#{values.join(", ")}]" + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/types/hash.rb b/lib/square/internal/types/hash.rb new file mode 100644 index 000000000..9d61b8815 --- /dev/null +++ b/lib/square/internal/types/hash.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Square + module Internal + module Types + class Hash + include Type + + attr_reader :key_type, :value_type + + class << self + def [](key_type, value_type) + new(key_type, value_type) + end + end + + def initialize(key_type, value_type) + @key_type = key_type + @value_type = value_type + end + + def coerce(value, strict: strict?) + unless value.is_a?(::Hash) + raise Errors::TypeError, "not hash" if strict + + return value + end + + value.to_h do |k, v| + [Utils.coerce(key_type, k, strict: strict), Utils.coerce(value_type, v, strict: strict)] + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/types/model.rb b/lib/square/internal/types/model.rb new file mode 100644 index 000000000..3707af1ad --- /dev/null +++ b/lib/square/internal/types/model.rb @@ -0,0 +1,192 @@ +# frozen_string_literal: true + +module Square + module Internal + module Types + # @abstract + # + # An abstract model that all data objects will inherit from + class Model + include Type + + class << self + # The defined fields for this model + # + # @api private + # + # @return [Hash] + def fields + @fields ||= if self < Square::Internal::Types::Model + superclass.fields.dup + else + {} + end + end + + # Any extra fields that have been created from instantiation + # + # @api private + # + # @return [Hash] + def extra_fields + @extra_fields ||= {} + end + + # Define a new field on this model + # + # @param name [Symbol] The name of the field + # @param type [Class] Type of the field + # @option optional [Boolean] If it is an optional field + # @option nullable [Boolean] If it is a nullable field + # @option api_name [Symbol, String] Name in the API of this field. When serializing/deserializing, will use + # this field name + # @return [void] + def field(name, type, optional: false, nullable: false, api_name: nil, default: nil) + add_field_definition(name: name, type: type, optional: optional, nullable: nullable, api_name: api_name, + default: default) + + define_accessor(name) + define_setter(name) + end + + # Define a new literal for this model + # + # @param name [Symbol] + # @param value [Object] + # @option api_name [Symbol, String] + # @return [void] + def literal(name, value, api_name: nil) + add_field_definition(name: name, type: value.class, optional: false, nullable: false, api_name: api_name, + value: value) + + define_accessor(name) + end + + # Adds a new field definition into the class's fields registry + # + # @api private + # + # @param name [Symbol] + # @param type [Class] + # @option optional [Boolean] + # @return [void] + private def add_field_definition(name:, type:, optional:, nullable:, api_name:, default: nil, value: nil) + fields[name.to_sym] = + Field.new(name: name, type: type, optional: optional, nullable: nullable, api_name: api_name, + value: value, default: default) + end + + # Adds a new field definition into the class's extra fields registry + # + # @api private + # + # @param name [Symbol] + # @param type [Class] + # @option required [Boolean] + # @option optional [Boolean] + # @return [void] + def add_extra_field_definition(name:, type:) + return if extra_fields.key?(name.to_sym) + + extra_fields[name.to_sym] = Field.new(name: name, type: type, optional: true, nullable: false) + + define_accessor(name) + define_setter(name) + end + + # @api private + private def define_accessor(name) + method_name = name.to_sym + + define_method(method_name) do + @data[name] + end + end + + # @api private + private def define_setter(name) + method_name = :"#{name}=" + + define_method(method_name) do |val| + @data[name] = val + end + end + + def coerce(value, strict: strict?) + return value if value.is_a?(self) + + return value unless value.is_a?(::Hash) + + new(value) + end + + def load(str) + coerce(::JSON.parse(str, symbolize_names: true)) + end + + def ===(instance) + instance.class.ancestors.include?(self) + end + end + + # Creates a new instance of this model + # TODO: Should all this logic be in `#coerce` instead? + # + # @param values [Hash] + # @option strict [Boolean] + # @return [self] + def initialize(values = {}) + @data = {} + + values = Utils.symbolize_keys(values.dup) + + self.class.fields.each do |field_name, field| + value = values.delete(field.api_name) + + field_value = value || (if field.literal? + field.value + elsif field.default + field.default + end) + + @data[field_name] = Utils.coerce(field.type, field_value) + end + + # Any remaining values in the input become extra fields + values.each do |name, value| + self.class.add_extra_field_definition(name: name, type: value.class) + + @data[name.to_sym] = value + end + end + + def to_h + self.class.fields.merge(self.class.extra_fields).each_with_object({}) do |(name, field), acc| + # If there is a value present in the data, use that value + # If there is a `nil` value present in the data, and it is optional but NOT nullable, exclude key altogether + # If there is a `nil` value present in the data, and it is optional and nullable, use the nil value + + value = @data[name] + + next if value.nil? && field.optional && !field.nullable + + acc[field.api_name] = value + end + end + + def ==(other) + self.class == other.class && to_h == other.to_h + end + + # @return [String] + def inspect + attrs = @data.map do |name, value| + "#{name}=#{value.inspect}" + end + + "#<#{self.class.name}:0x#{object_id&.to_s(16)} #{attrs.join(" ")}>" + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/types/model/field.rb b/lib/square/internal/types/model/field.rb new file mode 100644 index 000000000..01ac747a4 --- /dev/null +++ b/lib/square/internal/types/model/field.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +module Square + module Internal + module Types + class Model + # Definition of a field on a model + class Field + attr_reader :name, :type, :optional, :nullable, :api_name, :value, :default + + def initialize(name:, type:, optional: false, nullable: false, api_name: nil, value: nil, default: nil) + @name = name.to_sym + @type = type + @optional = optional + @nullable = nullable + @api_name = (api_name || name).to_sym + @value = value + @default = default + end + + def literal? + !value.nil? + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/types/type.rb b/lib/square/internal/types/type.rb new file mode 100644 index 000000000..29004dd6f --- /dev/null +++ b/lib/square/internal/types/type.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Square + module Internal + module Types + # @abstract + module Type + include Square::Internal::JSON::Serializable + + # Coerces a value to this type + # + # @param value [unknown] + # @option strict [Boolean] If we should strictly coerce this value + def coerce(value, strict: strict?) + raise NotImplementedError + end + + # Returns if strictness is on for this type, defaults to `false` + # + # @return [Boolean] + def strict? + @strict ||= false + end + + # Enable strictness by default for this type + # + # @return [void] + def strict! + @strict = true + self + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/types/union.rb b/lib/square/internal/types/union.rb new file mode 100644 index 000000000..3fea19c7e --- /dev/null +++ b/lib/square/internal/types/union.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module Square + module Internal + module Types + # Define a union between two types + module Union + include Square::Internal::Types::Type + + def members + @members ||= [] + end + + # Add a member to this union + # + # @param type [Object] + # @option key [Symbol, String] + # @return [void] + def member(type, key: nil) + members.push([key, Utils.wrap_type(type)]) + self + end + + def member?(type) + members.any? { |_key, type_fn| type == type_fn.call } + end + + # Set the discriminant for this union + # + # @param key [Symbol, String] + # @return [void] + def discriminant(key) + @discriminant = key + end + + # @api private + private def discriminated? + !@discriminant.nil? + end + + # Resolves the type of a value to be one of the members + # + # @param value [Object] + # @return [Class] + private def resolve_member(value) + if discriminated? && value.is_a?(::Hash) + disciminant_value = value.fetch(@discriminant, nil) + + return if disciminant_value.nil? + + members.to_h[disciminant_value]&.call + else + members.find do |_key, mem| + member_type = Utils.unwrap_type(mem) + + value.is_a?(member_type) + end&.last&.call + end + end + + def coerce(value, strict: strict?) + type = resolve_member(value) + + unless type + return value unless strict + + if discriminated? + raise Errors::TypeError, + "value of type `#{value.class}` not member of union #{self}" + end + + raise Errors::TypeError, "could not resolve to member of union #{self}" + end + + value = value.except(@discriminant) if type <= Model && value.is_a?(::Hash) + + Utils.coerce(type, value, strict: strict) + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/types/unknown.rb b/lib/square/internal/types/unknown.rb new file mode 100644 index 000000000..658562fac --- /dev/null +++ b/lib/square/internal/types/unknown.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Internal + module Types + module Unknown + include Square::Internal::Types::Type + + def coerce(value) + value + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/internal/types/utils.rb b/lib/square/internal/types/utils.rb new file mode 100644 index 000000000..7c368361e --- /dev/null +++ b/lib/square/internal/types/utils.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module Square + module Internal + module Types + # Utilities for dealing with and checking types + module Utils + # Wraps a type into a type function + # + # @param type [Proc, Object] + # @return [Proc] + def self.wrap_type(type) + case type + when Proc + type + else + -> { type } + end + end + + # Resolves a type or type function into a type + # + # @param type [Proc, Object] + # @return [Object] + def self.unwrap_type(type) + type.is_a?(Proc) ? type.call : type + end + + def self.coerce(target, value, strict: false) # rubocop:disable Metrics/CyclomaticComplexity + type = unwrap_type(target) + + case type + in Array + case value + when ::Array + return type.coerce(value, strict: strict) + when Set, ::Hash + return coerce(type, value.to_a) + end + in Hash + case value + when ::Hash + return type.coerce(value, strict: strict) + when ::Array + return coerce(type, value.to_h) + end + in ->(t) { t <= NilClass } + return nil + in ->(t) { t <= String } + case value + when String, Symbol, Numeric, TrueClass, FalseClass + return value.to_s + end + in ->(t) { t <= Symbol } + case value + when Symbol, String + return value.to_sym + end + in ->(t) { t <= Integer } + case value + when Numeric, String, Time + return value.to_i + end + in ->(t) { t <= Float } + case value + when Numeric, Time, String + return value.to_f + end + in ->(t) { t <= Model } + case value + when type + return value + when ::Hash + return type.coerce(value, strict: strict) + end + in Module + case type + in ->(t) { t.singleton_class.included_modules.include?(Enum) } + return type.coerce(value, strict: strict) + in ->(t) { t.singleton_class.included_modules.include?(Union) } + return type.coerce(value, strict: strict) + else + value + end + else + value + end + + raise Errors::TypeError, "cannot coerce value of type `#{value.class}` to `#{target}`" if strict + + value + end + + def self.symbolize_keys(hash) + hash.transform_keys(&:to_sym) + end + end + end + end +end \ No newline at end of file diff --git a/lib/square/inventory/client.rb b/lib/square/inventory/client.rb new file mode 100644 index 000000000..66fbaeead --- /dev/null +++ b/lib/square/inventory/client.rb @@ -0,0 +1,245 @@ + +module Square + module Inventory + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Inventory::Client] + def initialize(client) + @client = client + end + + # Deprecated version of [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) after the endpoint URL + # is updated to conform to the standard convention. + # + # @return [Square::Types::GetInventoryAdjustmentResponse] + def deprecated_get_adjustment(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetInventoryAdjustmentResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns the [InventoryAdjustment](entity:InventoryAdjustment) object + # with the provided `adjustment_id`. + # + # @return [Square::Types::GetInventoryAdjustmentResponse] + def get_adjustment(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetInventoryAdjustmentResponse.load(_response.body) + else + raise _response.body + end + end + + # Deprecated version of [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) after the endpoint URL + # is updated to conform to the standard convention. + # + # @return [Square::Types::BatchChangeInventoryResponse] + def deprecated_batch_change(request_options: {}, **params) + _request = Square::Internal::Http::JSONRequest.new( + method: POST, + path: "v2/inventory/batch-change" + ) + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchChangeInventoryResponse.load(_response.body) + else + raise _response.body + end + end + + # Deprecated version of [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) after the endpoint URL + # is updated to conform to the standard convention. + # + # @return [Square::Types::BatchGetInventoryChangesResponse] + def deprecated_batch_get_changes(request_options: {}, **params) + _request = Square::Internal::Http::JSONRequest.new( + method: POST, + path: "v2/inventory/batch-retrieve-changes" + ) + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchGetInventoryChangesResponse.load(_response.body) + else + raise _response.body + end + end + + # Deprecated version of [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) after the endpoint URL + # is updated to conform to the standard convention. + # + # @return [Square::Types::BatchGetInventoryCountsResponse] + def deprecated_batch_get_counts(request_options: {}, **params) + _request = Square::Internal::Http::JSONRequest.new( + method: POST, + path: "v2/inventory/batch-retrieve-counts" + ) + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchGetInventoryCountsResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::BatchChangeInventoryResponse] + def batch_create_changes(request_options: {}, **params) + _request = Square::Internal::Http::JSONRequest.new( + method: POST, + path: "v2/inventory/changes/batch-create" + ) + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchChangeInventoryResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::BatchGetInventoryChangesResponse] + def batch_get_changes(request_options: {}, **params) + _request = Square::Internal::Http::JSONRequest.new( + method: POST, + path: "v2/inventory/changes/batch-retrieve" + ) + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchGetInventoryChangesResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns current counts for the provided + # [CatalogObject](entity:CatalogObject)s at the requested + # [Location](entity:Location)s. + # + # Results are paginated and sorted in descending order according to their + # `calculated_at` timestamp (newest first). + # + # When `updated_after` is specified, only counts that have changed since that + # time (based on the server timestamp for the most recent change) are + # returned. This allows clients to perform a "sync" operation, for example + # in response to receiving a Webhook notification. + # + # @return [Square::Types::BatchGetInventoryCountsResponse] + def batch_get_counts(request_options: {}, **params) + _request = Square::Internal::Http::JSONRequest.new( + method: POST, + path: "v2/inventory/counts/batch-retrieve" + ) + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchGetInventoryCountsResponse.load(_response.body) + else + raise _response.body + end + end + + # Deprecated version of [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) after the endpoint URL + # is updated to conform to the standard convention. + # + # @return [Square::Types::GetInventoryPhysicalCountResponse] + def deprecated_get_physical_count(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetInventoryPhysicalCountResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns the [InventoryPhysicalCount](entity:InventoryPhysicalCount) + # object with the provided `physical_count_id`. + # + # @return [Square::Types::GetInventoryPhysicalCountResponse] + def get_physical_count(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetInventoryPhysicalCountResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns the [InventoryTransfer](entity:InventoryTransfer) object + # with the provided `transfer_id`. + # + # @return [Square::Types::GetInventoryTransferResponse] + def get_transfer(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetInventoryTransferResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves the current calculated stock count for a given + # [CatalogObject](entity:CatalogObject) at a given set of + # [Location](entity:Location)s. Responses are paginated and unsorted. + # For more sophisticated queries, use a batch endpoint. + # + # @return [Square::Types::GetInventoryCountResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetInventoryCountResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::GetInventoryChangesResponse] + def changes(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetInventoryChangesResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/inventory/types/changes_inventory_request.rb b/lib/square/inventory/types/changes_inventory_request.rb new file mode 100644 index 000000000..627e328ee --- /dev/null +++ b/lib/square/inventory/types/changes_inventory_request.rb @@ -0,0 +1,13 @@ + +module Square + module Inventory + module Types + class ChangesInventoryRequest < Internal::Types::Model + field :catalog_object_id, String, optional: false, nullable: false + field :location_ids, String, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/inventory/types/deprecated_get_adjustment_inventory_request.rb b/lib/square/inventory/types/deprecated_get_adjustment_inventory_request.rb new file mode 100644 index 000000000..8af0572d2 --- /dev/null +++ b/lib/square/inventory/types/deprecated_get_adjustment_inventory_request.rb @@ -0,0 +1,11 @@ + +module Square + module Inventory + module Types + class DeprecatedGetAdjustmentInventoryRequest < Internal::Types::Model + field :adjustment_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/inventory/types/deprecated_get_physical_count_inventory_request.rb b/lib/square/inventory/types/deprecated_get_physical_count_inventory_request.rb new file mode 100644 index 000000000..81c9290ac --- /dev/null +++ b/lib/square/inventory/types/deprecated_get_physical_count_inventory_request.rb @@ -0,0 +1,11 @@ + +module Square + module Inventory + module Types + class DeprecatedGetPhysicalCountInventoryRequest < Internal::Types::Model + field :physical_count_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/inventory/types/get_adjustment_inventory_request.rb b/lib/square/inventory/types/get_adjustment_inventory_request.rb new file mode 100644 index 000000000..ac28a3cae --- /dev/null +++ b/lib/square/inventory/types/get_adjustment_inventory_request.rb @@ -0,0 +1,11 @@ + +module Square + module Inventory + module Types + class GetAdjustmentInventoryRequest < Internal::Types::Model + field :adjustment_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/inventory/types/get_inventory_request.rb b/lib/square/inventory/types/get_inventory_request.rb new file mode 100644 index 000000000..729b3632b --- /dev/null +++ b/lib/square/inventory/types/get_inventory_request.rb @@ -0,0 +1,13 @@ + +module Square + module Inventory + module Types + class GetInventoryRequest < Internal::Types::Model + field :catalog_object_id, String, optional: false, nullable: false + field :location_ids, String, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/inventory/types/get_physical_count_inventory_request.rb b/lib/square/inventory/types/get_physical_count_inventory_request.rb new file mode 100644 index 000000000..9a01bc7d1 --- /dev/null +++ b/lib/square/inventory/types/get_physical_count_inventory_request.rb @@ -0,0 +1,11 @@ + +module Square + module Inventory + module Types + class GetPhysicalCountInventoryRequest < Internal::Types::Model + field :physical_count_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/inventory/types/get_transfer_inventory_request.rb b/lib/square/inventory/types/get_transfer_inventory_request.rb new file mode 100644 index 000000000..fe02cff75 --- /dev/null +++ b/lib/square/inventory/types/get_transfer_inventory_request.rb @@ -0,0 +1,11 @@ + +module Square + module Inventory + module Types + class GetTransferInventoryRequest < Internal::Types::Model + field :transfer_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/invoices/client.rb b/lib/square/invoices/client.rb new file mode 100644 index 000000000..39031cea1 --- /dev/null +++ b/lib/square/invoices/client.rb @@ -0,0 +1,185 @@ + +module Square + module Invoices + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Invoices::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::ListInvoicesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListInvoicesResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a draft [invoice](entity:Invoice) + # for an order created using the Orders API. + # + # A draft invoice remains in your account and no action is taken. + # You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). + # + # @return [Square::Types::CreateInvoiceResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateInvoiceResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::SearchInvoicesResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchInvoicesResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves an invoice by invoice ID. + # + # @return [Square::Types::GetInvoiceResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetInvoiceResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::UpdateInvoiceResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateInvoiceResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::DeleteInvoiceResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteInvoiceResponse.load(_response.body) + else + raise _response.body + end + end + + # Uploads a file and attaches it to an invoice. This endpoint accepts HTTP multipart/form-data file uploads + # with a JSON `request` part and a `file` part. The `file` part must be a `readable stream` that contains a file + # in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF. + # + # Invoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added only to invoices + # in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. + # + # __NOTE:__ When testing in the Sandbox environment, the total file size is limited to 1 KB. + # + # @return [Square::Types::CreateInvoiceAttachmentResponse] + def create_invoice_attachment(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateInvoiceAttachmentResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::DeleteInvoiceAttachmentResponse] + def delete_invoice_attachment(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteInvoiceAttachmentResponse.load(_response.body) + else + raise _response.body + end + end + + # 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`. + # + # @return [Square::Types::CancelInvoiceResponse] + def cancel(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CancelInvoiceResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::PublishInvoiceResponse] + def publish(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::PublishInvoiceResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/invoices/types/cancel_invoice_request.rb b/lib/square/invoices/types/cancel_invoice_request.rb new file mode 100644 index 000000000..d13c712e4 --- /dev/null +++ b/lib/square/invoices/types/cancel_invoice_request.rb @@ -0,0 +1,12 @@ + +module Square + module Invoices + module Types + class CancelInvoiceRequest < Internal::Types::Model + field :invoice_id, String, optional: false, nullable: false + field :version, Integer, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/invoices/types/create_invoice_attachment_request.rb b/lib/square/invoices/types/create_invoice_attachment_request.rb new file mode 100644 index 000000000..f16db4305 --- /dev/null +++ b/lib/square/invoices/types/create_invoice_attachment_request.rb @@ -0,0 +1,11 @@ + +module Square + module Invoices + module Types + class CreateInvoiceAttachmentRequest < Internal::Types::Model + field :invoice_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/invoices/types/create_invoice_request.rb b/lib/square/invoices/types/create_invoice_request.rb new file mode 100644 index 000000000..2f4339d00 --- /dev/null +++ b/lib/square/invoices/types/create_invoice_request.rb @@ -0,0 +1,12 @@ + +module Square + module Invoices + module Types + class CreateInvoiceRequest < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/invoices/types/delete_invoice_attachment_request.rb b/lib/square/invoices/types/delete_invoice_attachment_request.rb new file mode 100644 index 000000000..5c0abb0f1 --- /dev/null +++ b/lib/square/invoices/types/delete_invoice_attachment_request.rb @@ -0,0 +1,12 @@ + +module Square + module Invoices + module Types + class DeleteInvoiceAttachmentRequest < Internal::Types::Model + field :invoice_id, String, optional: false, nullable: false + field :attachment_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/invoices/types/delete_invoices_request.rb b/lib/square/invoices/types/delete_invoices_request.rb new file mode 100644 index 000000000..3ccc7e68b --- /dev/null +++ b/lib/square/invoices/types/delete_invoices_request.rb @@ -0,0 +1,12 @@ + +module Square + module Invoices + module Types + class DeleteInvoicesRequest < Internal::Types::Model + field :invoice_id, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/invoices/types/get_invoices_request.rb b/lib/square/invoices/types/get_invoices_request.rb new file mode 100644 index 000000000..21634496d --- /dev/null +++ b/lib/square/invoices/types/get_invoices_request.rb @@ -0,0 +1,11 @@ + +module Square + module Invoices + module Types + class GetInvoicesRequest < Internal::Types::Model + field :invoice_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/invoices/types/list_invoices_request.rb b/lib/square/invoices/types/list_invoices_request.rb new file mode 100644 index 000000000..56e88ca9b --- /dev/null +++ b/lib/square/invoices/types/list_invoices_request.rb @@ -0,0 +1,13 @@ + +module Square + module Invoices + module Types + class ListInvoicesRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/invoices/types/publish_invoice_request.rb b/lib/square/invoices/types/publish_invoice_request.rb new file mode 100644 index 000000000..f9d850215 --- /dev/null +++ b/lib/square/invoices/types/publish_invoice_request.rb @@ -0,0 +1,13 @@ + +module Square + module Invoices + module Types + class PublishInvoiceRequest < Internal::Types::Model + field :invoice_id, String, optional: false, nullable: false + field :version, Integer, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/invoices/types/search_invoices_request.rb b/lib/square/invoices/types/search_invoices_request.rb new file mode 100644 index 000000000..af7d6c1ac --- /dev/null +++ b/lib/square/invoices/types/search_invoices_request.rb @@ -0,0 +1,13 @@ + +module Square + module Invoices + module Types + class SearchInvoicesRequest < Internal::Types::Model + field :query, Square::Types::InvoiceQuery, optional: false, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/invoices/types/update_invoice_request.rb b/lib/square/invoices/types/update_invoice_request.rb new file mode 100644 index 000000000..3a86b25ef --- /dev/null +++ b/lib/square/invoices/types/update_invoice_request.rb @@ -0,0 +1,14 @@ + +module Square + module Invoices + module Types + class UpdateInvoiceRequest < Internal::Types::Model + field :invoice_id, String, optional: false, nullable: false + field :invoice, Square::Types::Invoice, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + field :fields_to_clear, Internal::Types::Array[String], optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/labor/break_types/client.rb b/lib/square/labor/break_types/client.rb new file mode 100644 index 000000000..f3985f71f --- /dev/null +++ b/lib/square/labor/break_types/client.rb @@ -0,0 +1,96 @@ + +module Square + module Labor + module BreakTypes + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Labor::BreakTypes::Client] + def initialize(client) + @client = client + end + + # Returns a paginated list of `BreakType` instances for a business. + # + # @return [Square::Types::ListBreakTypesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListBreakTypesResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::CreateBreakTypeResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateBreakTypeResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns a single `BreakType` specified by `id`. + # + # @return [Square::Types::GetBreakTypeResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetBreakTypeResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates an existing `BreakType`. + # + # @return [Square::Types::UpdateBreakTypeResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateBreakTypeResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes an existing `BreakType`. + # + # A `BreakType` can be deleted even if it is referenced from a `Shift`. + # + # @return [Square::Types::DeleteBreakTypeResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteBreakTypeResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/labor/break_types/types/create_break_type_request.rb b/lib/square/labor/break_types/types/create_break_type_request.rb new file mode 100644 index 000000000..d6f5c4cc9 --- /dev/null +++ b/lib/square/labor/break_types/types/create_break_type_request.rb @@ -0,0 +1,14 @@ + +module Square + module Labor + module BreakTypes + module Types + class CreateBreakTypeRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :break_type, Square::Types::BreakType, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/break_types/types/delete_break_types_request.rb b/lib/square/labor/break_types/types/delete_break_types_request.rb new file mode 100644 index 000000000..af31c4a41 --- /dev/null +++ b/lib/square/labor/break_types/types/delete_break_types_request.rb @@ -0,0 +1,13 @@ + +module Square + module Labor + module BreakTypes + module Types + class DeleteBreakTypesRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/break_types/types/get_break_types_request.rb b/lib/square/labor/break_types/types/get_break_types_request.rb new file mode 100644 index 000000000..3c3a40e7a --- /dev/null +++ b/lib/square/labor/break_types/types/get_break_types_request.rb @@ -0,0 +1,13 @@ + +module Square + module Labor + module BreakTypes + module Types + class GetBreakTypesRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/break_types/types/list_break_types_request.rb b/lib/square/labor/break_types/types/list_break_types_request.rb new file mode 100644 index 000000000..5b2e3cda0 --- /dev/null +++ b/lib/square/labor/break_types/types/list_break_types_request.rb @@ -0,0 +1,15 @@ + +module Square + module Labor + module BreakTypes + module Types + class ListBreakTypesRequest < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/break_types/types/update_break_type_request.rb b/lib/square/labor/break_types/types/update_break_type_request.rb new file mode 100644 index 000000000..e28d44a35 --- /dev/null +++ b/lib/square/labor/break_types/types/update_break_type_request.rb @@ -0,0 +1,14 @@ + +module Square + module Labor + module BreakTypes + module Types + class UpdateBreakTypeRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :break_type, Square::Types::BreakType, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/client.rb b/lib/square/labor/client.rb new file mode 100644 index 000000000..75dd101b8 --- /dev/null +++ b/lib/square/labor/client.rb @@ -0,0 +1,216 @@ + +module Square + module Labor + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Labor::Client] + def initialize(client) + @client = client + end + + # Creates a scheduled shift by providing draft shift details such as job ID, + # team member assignment, and start and end times. + # + # The following `draft_shift_details` fields are required: + # - `location_id` + # - `job_id` + # - `start_at` + # - `end_at` + # + # @return [Square::Types::CreateScheduledShiftResponse] + def create_scheduled_shift(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateScheduledShiftResponse.load(_response.body) + else + raise _response.body + end + end + + # Publishes 1 - 100 scheduled shifts. This endpoint takes a map of individual publish + # requests and returns a map of responses. When a scheduled shift is published, Square keeps + # the `draft_shift_details` field as is and copies it to the `published_shift_details` field. + # + # The minimum `start_at` and maximum `end_at` timestamps of all shifts in a + # `BulkPublishScheduledShifts` request must fall within a two-week period. + # + # @return [Square::Types::BulkPublishScheduledShiftsResponse] + def bulk_publish_scheduled_shifts(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkPublishScheduledShiftsResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns a paginated list of scheduled shifts, with optional filter and sort settings. + # By default, results are sorted by `start_at` in ascending order. + # + # @return [Square::Types::SearchScheduledShiftsResponse] + def search_scheduled_shifts(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchScheduledShiftsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a scheduled shift by ID. + # + # @return [Square::Types::RetrieveScheduledShiftResponse] + def retrieve_scheduled_shift(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveScheduledShiftResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates the draft shift details for a scheduled shift. This endpoint supports + # sparse updates, so only new, changed, or removed fields are required in the request. + # You must publish the shift to make updates public. + # + # You can make the following updates to `draft_shift_details`: + # - Change the `location_id`, `job_id`, `start_at`, and `end_at` fields. + # - Add, change, or clear the `team_member_id` and `notes` fields. To clear these fields, + # set the value to null. + # - Change the `is_deleted` field. To delete a scheduled shift, set `is_deleted` to true + # and then publish the shift. + # + # @return [Square::Types::UpdateScheduledShiftResponse] + def update_scheduled_shift(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateScheduledShiftResponse.load(_response.body) + else + raise _response.body + end + end + + # Publishes a scheduled shift. When a scheduled shift is published, Square keeps the + # `draft_shift_details` field as is and copies it to the `published_shift_details` field. + # + # @return [Square::Types::PublishScheduledShiftResponse] + def publish_scheduled_shift(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::PublishScheduledShiftResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a new `Timecard`. + # + # A `Timecard` represents a complete workday for a single team member. + # You must provide the following values in your request to this + # endpoint: + # + # - `location_id` + # - `team_member_id` + # - `start_at` + # + # An attempt to create a new `Timecard` can result in a `BAD_REQUEST` error when: + # - The `status` of the new `Timecard` is `OPEN` and the team member has another + # timecard with an `OPEN` status. + # - The `start_at` date is in the future. + # - The `start_at` or `end_at` date overlaps another timecard for the same team member. + # - The `Break` instances are set in the request and a break `start_at` + # is before the `Timecard.start_at`, a break `end_at` is after + # the `Timecard.end_at`, or both. + # + # @return [Square::Types::CreateTimecardResponse] + def create_timecard(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateTimecardResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns a paginated list of `Timecard` records for a business. + # The list to be returned can be filtered by: + # - Location IDs + # - Team member IDs + # - Timecard status (`OPEN` or `CLOSED`) + # - Timecard start + # - Timecard end + # - Workday details + # + # The list can be sorted by: + # - `START_AT` + # - `END_AT` + # - `CREATED_AT` + # - `UPDATED_AT` + # + # @return [Square::Types::SearchTimecardsResponse] + def search_timecards(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchTimecardsResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns a single `Timecard` specified by `id`. + # + # @return [Square::Types::RetrieveTimecardResponse] + def retrieve_timecard(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveTimecardResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates an existing `Timecard`. + # + # When adding a `Break` to a `Timecard`, any earlier `Break` instances in the `Timecard` have + # the `end_at` property set to a valid RFC-3339 datetime string. + # + # When closing a `Timecard`, all `Break` instances in the `Timecard` must be complete with `end_at` + # set on each `Break`. + # + # @return [Square::Types::UpdateTimecardResponse] + def update_timecard(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateTimecardResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a `Timecard`. + # + # @return [Square::Types::DeleteTimecardResponse] + def delete_timecard(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteTimecardResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/labor/employee_wages/client.rb b/lib/square/labor/employee_wages/client.rb new file mode 100644 index 000000000..6dc7c316d --- /dev/null +++ b/lib/square/labor/employee_wages/client.rb @@ -0,0 +1,42 @@ + +module Square + module Labor + module EmployeeWages + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Labor::EmployeeWages::Client] + def initialize(client) + @client = client + end + + # Returns a paginated list of `EmployeeWage` instances for a business. + # + # @return [Square::Types::ListEmployeeWagesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListEmployeeWagesResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns a single `EmployeeWage` specified by `id`. + # + # @return [Square::Types::GetEmployeeWageResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetEmployeeWageResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/labor/employee_wages/types/get_employee_wages_request.rb b/lib/square/labor/employee_wages/types/get_employee_wages_request.rb new file mode 100644 index 000000000..94ed63452 --- /dev/null +++ b/lib/square/labor/employee_wages/types/get_employee_wages_request.rb @@ -0,0 +1,13 @@ + +module Square + module Labor + module EmployeeWages + module Types + class GetEmployeeWagesRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/employee_wages/types/list_employee_wages_request.rb b/lib/square/labor/employee_wages/types/list_employee_wages_request.rb new file mode 100644 index 000000000..5332a6857 --- /dev/null +++ b/lib/square/labor/employee_wages/types/list_employee_wages_request.rb @@ -0,0 +1,15 @@ + +module Square + module Labor + module EmployeeWages + module Types + class ListEmployeeWagesRequest < Internal::Types::Model + field :employee_id, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/shifts/client.rb b/lib/square/labor/shifts/client.rb new file mode 100644 index 000000000..d6a27de73 --- /dev/null +++ b/lib/square/labor/shifts/client.rb @@ -0,0 +1,117 @@ + +module Square + module Labor + module Shifts + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Labor::Shifts::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::CreateShiftResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateShiftResponse.load(_response.body) + else + raise _response.body + end + end + + # 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` + # + # @return [Square::Types::SearchShiftsResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchShiftsResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns a single `Shift` specified by `id`. + # + # @return [Square::Types::GetShiftResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetShiftResponse.load(_response.body) + else + raise _response.body + end + end + + # 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`. + # + # @return [Square::Types::UpdateShiftResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateShiftResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a `Shift`. + # + # @return [Square::Types::DeleteShiftResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteShiftResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/labor/shifts/types/create_shift_request.rb b/lib/square/labor/shifts/types/create_shift_request.rb new file mode 100644 index 000000000..7a746bdf3 --- /dev/null +++ b/lib/square/labor/shifts/types/create_shift_request.rb @@ -0,0 +1,14 @@ + +module Square + module Labor + module Shifts + module Types + class CreateShiftRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :shift, Square::Types::Shift, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/shifts/types/delete_shifts_request.rb b/lib/square/labor/shifts/types/delete_shifts_request.rb new file mode 100644 index 000000000..fc50ae845 --- /dev/null +++ b/lib/square/labor/shifts/types/delete_shifts_request.rb @@ -0,0 +1,13 @@ + +module Square + module Labor + module Shifts + module Types + class DeleteShiftsRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/shifts/types/get_shifts_request.rb b/lib/square/labor/shifts/types/get_shifts_request.rb new file mode 100644 index 000000000..0d6662adf --- /dev/null +++ b/lib/square/labor/shifts/types/get_shifts_request.rb @@ -0,0 +1,13 @@ + +module Square + module Labor + module Shifts + module Types + class GetShiftsRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/shifts/types/search_shifts_request.rb b/lib/square/labor/shifts/types/search_shifts_request.rb new file mode 100644 index 000000000..550fd56c2 --- /dev/null +++ b/lib/square/labor/shifts/types/search_shifts_request.rb @@ -0,0 +1,15 @@ + +module Square + module Labor + module Shifts + module Types + class SearchShiftsRequest < Internal::Types::Model + field :query, Square::Types::ShiftQuery, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/shifts/types/update_shift_request.rb b/lib/square/labor/shifts/types/update_shift_request.rb new file mode 100644 index 000000000..5b8457af5 --- /dev/null +++ b/lib/square/labor/shifts/types/update_shift_request.rb @@ -0,0 +1,14 @@ + +module Square + module Labor + module Shifts + module Types + class UpdateShiftRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :shift, Square::Types::Shift, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/team_member_wages/client.rb b/lib/square/labor/team_member_wages/client.rb new file mode 100644 index 000000000..378da3be3 --- /dev/null +++ b/lib/square/labor/team_member_wages/client.rb @@ -0,0 +1,42 @@ + +module Square + module Labor + module TeamMemberWages + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Labor::TeamMemberWages::Client] + def initialize(client) + @client = client + end + + # Returns a paginated list of `TeamMemberWage` instances for a business. + # + # @return [Square::Types::ListTeamMemberWagesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListTeamMemberWagesResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns a single `TeamMemberWage` specified by `id`. + # + # @return [Square::Types::GetTeamMemberWageResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetTeamMemberWageResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/labor/team_member_wages/types/get_team_member_wages_request.rb b/lib/square/labor/team_member_wages/types/get_team_member_wages_request.rb new file mode 100644 index 000000000..0127a084d --- /dev/null +++ b/lib/square/labor/team_member_wages/types/get_team_member_wages_request.rb @@ -0,0 +1,13 @@ + +module Square + module Labor + module TeamMemberWages + module Types + class GetTeamMemberWagesRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/team_member_wages/types/list_team_member_wages_request.rb b/lib/square/labor/team_member_wages/types/list_team_member_wages_request.rb new file mode 100644 index 000000000..acccc6739 --- /dev/null +++ b/lib/square/labor/team_member_wages/types/list_team_member_wages_request.rb @@ -0,0 +1,15 @@ + +module Square + module Labor + module TeamMemberWages + module Types + class ListTeamMemberWagesRequest < Internal::Types::Model + field :team_member_id, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/types/bulk_publish_scheduled_shifts_request.rb b/lib/square/labor/types/bulk_publish_scheduled_shifts_request.rb new file mode 100644 index 000000000..006a7e6dc --- /dev/null +++ b/lib/square/labor/types/bulk_publish_scheduled_shifts_request.rb @@ -0,0 +1,12 @@ + +module Square + module Labor + module Types + class BulkPublishScheduledShiftsRequest < Internal::Types::Model + field :scheduled_shifts, Internal::Types::Hash[String, Square::Types::BulkPublishScheduledShiftsData], optional: false, nullable: false + field :scheduled_shift_notification_audience, Square::Types::ScheduledShiftNotificationAudience, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/labor/types/create_scheduled_shift_request.rb b/lib/square/labor/types/create_scheduled_shift_request.rb new file mode 100644 index 000000000..3d35227fb --- /dev/null +++ b/lib/square/labor/types/create_scheduled_shift_request.rb @@ -0,0 +1,12 @@ + +module Square + module Labor + module Types + class CreateScheduledShiftRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :scheduled_shift, Square::Types::ScheduledShift, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/labor/types/create_timecard_request.rb b/lib/square/labor/types/create_timecard_request.rb new file mode 100644 index 000000000..01abbc18b --- /dev/null +++ b/lib/square/labor/types/create_timecard_request.rb @@ -0,0 +1,12 @@ + +module Square + module Labor + module Types + class CreateTimecardRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :timecard, Square::Types::Timecard, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/labor/types/delete_timecard_request.rb b/lib/square/labor/types/delete_timecard_request.rb new file mode 100644 index 000000000..32d650a38 --- /dev/null +++ b/lib/square/labor/types/delete_timecard_request.rb @@ -0,0 +1,11 @@ + +module Square + module Labor + module Types + class DeleteTimecardRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/labor/types/publish_scheduled_shift_request.rb b/lib/square/labor/types/publish_scheduled_shift_request.rb new file mode 100644 index 000000000..b34e897e9 --- /dev/null +++ b/lib/square/labor/types/publish_scheduled_shift_request.rb @@ -0,0 +1,14 @@ + +module Square + module Labor + module Types + class PublishScheduledShiftRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + field :scheduled_shift_notification_audience, Square::Types::ScheduledShiftNotificationAudience, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/labor/types/retrieve_scheduled_shift_request.rb b/lib/square/labor/types/retrieve_scheduled_shift_request.rb new file mode 100644 index 000000000..4857d7fd8 --- /dev/null +++ b/lib/square/labor/types/retrieve_scheduled_shift_request.rb @@ -0,0 +1,11 @@ + +module Square + module Labor + module Types + class RetrieveScheduledShiftRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/labor/types/retrieve_timecard_request.rb b/lib/square/labor/types/retrieve_timecard_request.rb new file mode 100644 index 000000000..d4b21bf09 --- /dev/null +++ b/lib/square/labor/types/retrieve_timecard_request.rb @@ -0,0 +1,11 @@ + +module Square + module Labor + module Types + class RetrieveTimecardRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/labor/types/search_scheduled_shifts_request.rb b/lib/square/labor/types/search_scheduled_shifts_request.rb new file mode 100644 index 000000000..8fcf11592 --- /dev/null +++ b/lib/square/labor/types/search_scheduled_shifts_request.rb @@ -0,0 +1,13 @@ + +module Square + module Labor + module Types + class SearchScheduledShiftsRequest < Internal::Types::Model + field :query, Square::Types::ScheduledShiftQuery, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/labor/types/search_timecards_request.rb b/lib/square/labor/types/search_timecards_request.rb new file mode 100644 index 000000000..804bfcd63 --- /dev/null +++ b/lib/square/labor/types/search_timecards_request.rb @@ -0,0 +1,13 @@ + +module Square + module Labor + module Types + class SearchTimecardsRequest < Internal::Types::Model + field :query, Square::Types::TimecardQuery, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/labor/types/update_scheduled_shift_request.rb b/lib/square/labor/types/update_scheduled_shift_request.rb new file mode 100644 index 000000000..8ed353749 --- /dev/null +++ b/lib/square/labor/types/update_scheduled_shift_request.rb @@ -0,0 +1,12 @@ + +module Square + module Labor + module Types + class UpdateScheduledShiftRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :scheduled_shift, Square::Types::ScheduledShift, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/labor/types/update_timecard_request.rb b/lib/square/labor/types/update_timecard_request.rb new file mode 100644 index 000000000..9191ca4f8 --- /dev/null +++ b/lib/square/labor/types/update_timecard_request.rb @@ -0,0 +1,12 @@ + +module Square + module Labor + module Types + class UpdateTimecardRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :timecard, Square::Types::Timecard, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/labor/workweek_configs/client.rb b/lib/square/labor/workweek_configs/client.rb new file mode 100644 index 000000000..403b40224 --- /dev/null +++ b/lib/square/labor/workweek_configs/client.rb @@ -0,0 +1,42 @@ + +module Square + module Labor + module WorkweekConfigs + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Labor::WorkweekConfigs::Client] + def initialize(client) + @client = client + end + + # Returns a list of `WorkweekConfig` instances for a business. + # + # @return [Square::Types::ListWorkweekConfigsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListWorkweekConfigsResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates a `WorkweekConfig`. + # + # @return [Square::Types::UpdateWorkweekConfigResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateWorkweekConfigResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/labor/workweek_configs/types/list_workweek_configs_request.rb b/lib/square/labor/workweek_configs/types/list_workweek_configs_request.rb new file mode 100644 index 000000000..91dc48dbb --- /dev/null +++ b/lib/square/labor/workweek_configs/types/list_workweek_configs_request.rb @@ -0,0 +1,14 @@ + +module Square + module Labor + module WorkweekConfigs + module Types + class ListWorkweekConfigsRequest < Internal::Types::Model + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/labor/workweek_configs/types/update_workweek_config_request.rb b/lib/square/labor/workweek_configs/types/update_workweek_config_request.rb new file mode 100644 index 000000000..2b28326bc --- /dev/null +++ b/lib/square/labor/workweek_configs/types/update_workweek_config_request.rb @@ -0,0 +1,14 @@ + +module Square + module Labor + module WorkweekConfigs + module Types + class UpdateWorkweekConfigRequest < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :workweek_config, Square::Types::WorkweekConfig, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/client.rb b/lib/square/locations/client.rb new file mode 100644 index 000000000..2fa01f381 --- /dev/null +++ b/lib/square/locations/client.rb @@ -0,0 +1,93 @@ + +module Square + module Locations + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Locations::Client] + def initialize(client) + @client = client + end + + # 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`. + # + # @return [Square::Types::ListLocationsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListLocationsResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::CreateLocationResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateLocationResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::GetLocationResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetLocationResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates a [location](https://developer.squareup.com/docs/locations-api). + # + # @return [Square::Types::UpdateLocationResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateLocationResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::CreateCheckoutResponse] + def checkouts(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateCheckoutResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/locations/custom_attribute_definitions/client.rb b/lib/square/locations/custom_attribute_definitions/client.rb new file mode 100644 index 000000000..f80350ec2 --- /dev/null +++ b/lib/square/locations/custom_attribute_definitions/client.rb @@ -0,0 +1,98 @@ + +module Square + module Locations + module CustomAttributeDefinitions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Locations::CustomAttributeDefinitions::Client] + def initialize(client) + @client = client + end + + # Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + # When all response pages are retrieved, the results include all custom attribute definitions + # that are visible to the requesting application, including those that are created by other + # applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::ListLocationCustomAttributeDefinitionsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListLocationCustomAttributeDefinitionsResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + # Use this endpoint to define a custom attribute that can be associated with locations. + # A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties + # for a custom attribute. After the definition is created, you can call + # [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) or + # [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + # to set the custom attribute for locations. + # + # @return [Square::Types::CreateLocationCustomAttributeDefinitionResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateLocationCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + # To retrieve a custom attribute definition created by another application, the `visibility` + # setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::RetrieveLocationCustomAttributeDefinitionResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveLocationCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + # Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the + # `schema` for a `Selection` data type. + # Only the definition owner can update a custom attribute definition. + # + # @return [Square::Types::UpdateLocationCustomAttributeDefinitionResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateLocationCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + # Deleting a custom attribute definition also deletes the corresponding custom attribute from + # all locations. + # Only the definition owner can delete a custom attribute definition. + # + # @return [Square::Types::DeleteLocationCustomAttributeDefinitionResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteLocationCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/locations/custom_attribute_definitions/types/create_location_custom_attribute_definition_request.rb b/lib/square/locations/custom_attribute_definitions/types/create_location_custom_attribute_definition_request.rb new file mode 100644 index 000000000..3ed320dc2 --- /dev/null +++ b/lib/square/locations/custom_attribute_definitions/types/create_location_custom_attribute_definition_request.rb @@ -0,0 +1,14 @@ + +module Square + module Locations + module CustomAttributeDefinitions + module Types + class CreateLocationCustomAttributeDefinitionRequest < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb b/lib/square/locations/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..1f7ad88f1 --- /dev/null +++ b/lib/square/locations/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb @@ -0,0 +1,13 @@ + +module Square + module Locations + module CustomAttributeDefinitions + module Types + class DeleteCustomAttributeDefinitionsRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb b/lib/square/locations/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..5018e91e5 --- /dev/null +++ b/lib/square/locations/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Locations + module CustomAttributeDefinitions + module Types + class GetCustomAttributeDefinitionsRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb b/lib/square/locations/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..c96e0f8c1 --- /dev/null +++ b/lib/square/locations/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb @@ -0,0 +1,15 @@ + +module Square + module Locations + module CustomAttributeDefinitions + module Types + class ListCustomAttributeDefinitionsRequest < Internal::Types::Model + field :visibility_filter, Square::Types::VisibilityFilter, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/custom_attribute_definitions/types/update_location_custom_attribute_definition_request.rb b/lib/square/locations/custom_attribute_definitions/types/update_location_custom_attribute_definition_request.rb new file mode 100644 index 000000000..280716e7f --- /dev/null +++ b/lib/square/locations/custom_attribute_definitions/types/update_location_custom_attribute_definition_request.rb @@ -0,0 +1,15 @@ + +module Square + module Locations + module CustomAttributeDefinitions + module Types + class UpdateLocationCustomAttributeDefinitionRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/custom_attributes/client.rb b/lib/square/locations/custom_attributes/client.rb new file mode 100644 index 000000000..3721c3dc4 --- /dev/null +++ b/lib/square/locations/custom_attributes/client.rb @@ -0,0 +1,121 @@ + +module Square + module Locations + module CustomAttributes + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Locations::CustomAttributes::Client] + def initialize(client) + @client = client + end + + # Deletes [custom attributes](entity:CustomAttribute) for locations as a bulk operation. + # To delete a custom attribute owned by another application, the `visibility` setting must be + # `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::BulkDeleteLocationCustomAttributesResponse] + def batch_delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkDeleteLocationCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates or updates [custom attributes](entity:CustomAttribute) for locations as a bulk operation. + # Use this endpoint to set the value of one or more custom attributes for one or more locations. + # A custom attribute is based on a custom attribute definition in a Square seller account, which is + # created using the [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) endpoint. + # This `BulkUpsertLocationCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert + # requests and returns a map of individual upsert responses. Each upsert request has a unique ID + # and provides a location ID and custom attribute. Each upsert response is returned with the ID + # of the corresponding request. + # To create or update a custom attribute owned by another application, the `visibility` setting + # must be `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::BulkUpsertLocationCustomAttributesResponse] + def batch_upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkUpsertLocationCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # Lists the [custom attributes](entity:CustomAttribute) associated with a location. + # You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + # in the same call. + # When all response pages are retrieved, the results include all custom attributes that are + # visible to the requesting application, including those that are owned by other applications + # and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::ListLocationCustomAttributesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListLocationCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a [custom attribute](entity:CustomAttribute) associated with a location. + # You can use the `with_definition` query parameter to also retrieve the custom attribute definition + # in the same call. + # To retrieve a custom attribute owned by another application, the `visibility` setting must be + # `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::RetrieveLocationCustomAttributeResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveLocationCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates or updates a [custom attribute](entity:CustomAttribute) for a location. + # Use this endpoint to set the value of a custom attribute for a specified location. + # A custom attribute is based on a custom attribute definition in a Square seller account, which + # is created using the [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) endpoint. + # To create or update a custom attribute owned by another application, the `visibility` setting + # must be `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::UpsertLocationCustomAttributeResponse] + def upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpsertLocationCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a [custom attribute](entity:CustomAttribute) associated with a location. + # To delete a custom attribute owned by another application, the `visibility` setting must be + # `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::DeleteLocationCustomAttributeResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteLocationCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/locations/custom_attributes/types/bulk_delete_location_custom_attributes_request.rb b/lib/square/locations/custom_attributes/types/bulk_delete_location_custom_attributes_request.rb new file mode 100644 index 000000000..a1322763e --- /dev/null +++ b/lib/square/locations/custom_attributes/types/bulk_delete_location_custom_attributes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Locations + module CustomAttributes + module Types + class BulkDeleteLocationCustomAttributesRequest < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest], optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/custom_attributes/types/bulk_upsert_location_custom_attributes_request.rb b/lib/square/locations/custom_attributes/types/bulk_upsert_location_custom_attributes_request.rb new file mode 100644 index 000000000..3a0262311 --- /dev/null +++ b/lib/square/locations/custom_attributes/types/bulk_upsert_location_custom_attributes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Locations + module CustomAttributes + module Types + class BulkUpsertLocationCustomAttributesRequest < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest], optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/custom_attributes/types/delete_custom_attributes_request.rb b/lib/square/locations/custom_attributes/types/delete_custom_attributes_request.rb new file mode 100644 index 000000000..984d28785 --- /dev/null +++ b/lib/square/locations/custom_attributes/types/delete_custom_attributes_request.rb @@ -0,0 +1,14 @@ + +module Square + module Locations + module CustomAttributes + module Types + class DeleteCustomAttributesRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/custom_attributes/types/get_custom_attributes_request.rb b/lib/square/locations/custom_attributes/types/get_custom_attributes_request.rb new file mode 100644 index 000000000..b2b0ace25 --- /dev/null +++ b/lib/square/locations/custom_attributes/types/get_custom_attributes_request.rb @@ -0,0 +1,16 @@ + +module Square + module Locations + module CustomAttributes + module Types + class GetCustomAttributesRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + field :with_definition, Internal::Types::Boolean, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/custom_attributes/types/list_custom_attributes_request.rb b/lib/square/locations/custom_attributes/types/list_custom_attributes_request.rb new file mode 100644 index 000000000..54fdb804a --- /dev/null +++ b/lib/square/locations/custom_attributes/types/list_custom_attributes_request.rb @@ -0,0 +1,17 @@ + +module Square + module Locations + module CustomAttributes + module Types + class ListCustomAttributesRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :visibility_filter, Square::Types::VisibilityFilter, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :with_definitions, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/custom_attributes/types/upsert_location_custom_attribute_request.rb b/lib/square/locations/custom_attributes/types/upsert_location_custom_attribute_request.rb new file mode 100644 index 000000000..8295b610d --- /dev/null +++ b/lib/square/locations/custom_attributes/types/upsert_location_custom_attribute_request.rb @@ -0,0 +1,16 @@ + +module Square + module Locations + module CustomAttributes + module Types + class UpsertLocationCustomAttributeRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/transactions/client.rb b/lib/square/locations/transactions/client.rb new file mode 100644 index 000000000..ea223533f --- /dev/null +++ b/lib/square/locations/transactions/client.rb @@ -0,0 +1,83 @@ + +module Square + module Locations + module Transactions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Locations::Transactions::Client] + def initialize(client) + @client = client + end + + # 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 + # + # @return [Square::Types::ListTransactionsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListTransactionsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves details for a single transaction. + # + # @return [Square::Types::GetTransactionResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetTransactionResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::CaptureTransactionResponse] + def capture(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CaptureTransactionResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::VoidTransactionResponse] + def void(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::VoidTransactionResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/locations/transactions/types/capture_transactions_request.rb b/lib/square/locations/transactions/types/capture_transactions_request.rb new file mode 100644 index 000000000..8ea0d90ea --- /dev/null +++ b/lib/square/locations/transactions/types/capture_transactions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Locations + module Transactions + module Types + class CaptureTransactionsRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :transaction_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/transactions/types/get_transactions_request.rb b/lib/square/locations/transactions/types/get_transactions_request.rb new file mode 100644 index 000000000..cd7ff0d14 --- /dev/null +++ b/lib/square/locations/transactions/types/get_transactions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Locations + module Transactions + module Types + class GetTransactionsRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :transaction_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/transactions/types/list_transactions_request.rb b/lib/square/locations/transactions/types/list_transactions_request.rb new file mode 100644 index 000000000..53c567060 --- /dev/null +++ b/lib/square/locations/transactions/types/list_transactions_request.rb @@ -0,0 +1,17 @@ + +module Square + module Locations + module Transactions + module Types + class ListTransactionsRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :begin_time, String, optional: true, nullable: false + field :end_time, String, optional: true, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/transactions/types/void_transactions_request.rb b/lib/square/locations/transactions/types/void_transactions_request.rb new file mode 100644 index 000000000..424993fbe --- /dev/null +++ b/lib/square/locations/transactions/types/void_transactions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Locations + module Transactions + module Types + class VoidTransactionsRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :transaction_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/locations/types/create_checkout_request.rb b/lib/square/locations/types/create_checkout_request.rb new file mode 100644 index 000000000..bad35d605 --- /dev/null +++ b/lib/square/locations/types/create_checkout_request.rb @@ -0,0 +1,20 @@ + +module Square + module Locations + module Types + class CreateCheckoutRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + field :order, Square::Types::CreateOrderRequest, optional: false, nullable: false + field :ask_for_shipping_address, Internal::Types::Boolean, optional: true, nullable: false + field :merchant_support_email, String, optional: true, nullable: false + field :pre_populate_buyer_email, String, optional: true, nullable: false + field :pre_populate_shipping_address, Square::Types::Address, optional: true, nullable: false + field :redirect_url, String, optional: true, nullable: false + field :additional_recipients, Internal::Types::Array[Square::Types::ChargeRequestAdditionalRecipient], optional: true, nullable: false + field :note, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/locations/types/create_location_request.rb b/lib/square/locations/types/create_location_request.rb new file mode 100644 index 000000000..bb3448ab3 --- /dev/null +++ b/lib/square/locations/types/create_location_request.rb @@ -0,0 +1,11 @@ + +module Square + module Locations + module Types + class CreateLocationRequest < Internal::Types::Model + field :location, Square::Types::Location, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/locations/types/get_locations_request.rb b/lib/square/locations/types/get_locations_request.rb new file mode 100644 index 000000000..0f785dd5e --- /dev/null +++ b/lib/square/locations/types/get_locations_request.rb @@ -0,0 +1,11 @@ + +module Square + module Locations + module Types + class GetLocationsRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/locations/types/update_location_request.rb b/lib/square/locations/types/update_location_request.rb new file mode 100644 index 000000000..1026b1418 --- /dev/null +++ b/lib/square/locations/types/update_location_request.rb @@ -0,0 +1,12 @@ + +module Square + module Locations + module Types + class UpdateLocationRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :location, Square::Types::Location, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/loyalty/accounts/client.rb b/lib/square/loyalty/accounts/client.rb new file mode 100644 index 000000000..deb14f932 --- /dev/null +++ b/lib/square/loyalty/accounts/client.rb @@ -0,0 +1,102 @@ + +module Square + module Loyalty + module Accounts + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Loyalty::Accounts::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::CreateLoyaltyAccountResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateLoyaltyAccountResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::SearchLoyaltyAccountsResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchLoyaltyAccountsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a loyalty account. + # + # @return [Square::Types::GetLoyaltyAccountResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetLoyaltyAccountResponse.load(_response.body) + else + raise _response.body + end + end + + # Adds points earned from a purchase to a [loyalty account](entity:LoyaltyAccount). + # + # - If you are using the Orders API to manage orders, provide the `order_id`. Square reads the order + # to compute the points earned from both the base loyalty program and an associated + # [loyalty promotion](entity:LoyaltyPromotion). For purchases that qualify for multiple accrual + # rules, Square computes points based on the accrual rule that grants the most points. + # For purchases that qualify for multiple promotions, Square computes points based on the most + # recently created promotion. A purchase must first qualify for program points to be eligible for promotion points. + # + # - If you are not using the Orders API to manage orders, provide `points` with the number of points to add. + # You must first perform a client-side computation of the points earned from the loyalty program and + # loyalty promotion. For spend-based and visit-based programs, you can call [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) + # to compute the points earned from the base loyalty program. For information about computing points earned from a loyalty promotion, see + # [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). + # + # @return [Square::Types::AccumulateLoyaltyPointsResponse] + def accumulate_points(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::AccumulateLoyaltyPointsResponse.load(_response.body) + else + raise _response.body + end + end + + # Adds points to or subtracts points from a buyer's account. + # + # Use this endpoint only when you need to manually adjust points. Otherwise, in your application flow, you call + # [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) + # to add points when a buyer pays for the purchase. + # + # @return [Square::Types::AdjustLoyaltyPointsResponse] + def adjust(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::AdjustLoyaltyPointsResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/loyalty/accounts/types/accumulate_loyalty_points_request.rb b/lib/square/loyalty/accounts/types/accumulate_loyalty_points_request.rb new file mode 100644 index 000000000..79f83218f --- /dev/null +++ b/lib/square/loyalty/accounts/types/accumulate_loyalty_points_request.rb @@ -0,0 +1,16 @@ + +module Square + module Loyalty + module Accounts + module Types + class AccumulateLoyaltyPointsRequest < Internal::Types::Model + field :account_id, String, optional: false, nullable: false + field :accumulate_points, Square::Types::LoyaltyEventAccumulatePoints, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + field :location_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/accounts/types/adjust_loyalty_points_request.rb b/lib/square/loyalty/accounts/types/adjust_loyalty_points_request.rb new file mode 100644 index 000000000..702cf4c68 --- /dev/null +++ b/lib/square/loyalty/accounts/types/adjust_loyalty_points_request.rb @@ -0,0 +1,16 @@ + +module Square + module Loyalty + module Accounts + module Types + class AdjustLoyaltyPointsRequest < Internal::Types::Model + field :account_id, String, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + field :adjust_points, Square::Types::LoyaltyEventAdjustPoints, optional: false, nullable: false + field :allow_negative_balance, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/accounts/types/create_loyalty_account_request.rb b/lib/square/loyalty/accounts/types/create_loyalty_account_request.rb new file mode 100644 index 000000000..c862730df --- /dev/null +++ b/lib/square/loyalty/accounts/types/create_loyalty_account_request.rb @@ -0,0 +1,14 @@ + +module Square + module Loyalty + module Accounts + module Types + class CreateLoyaltyAccountRequest < Internal::Types::Model + field :loyalty_account, Square::Types::LoyaltyAccount, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/accounts/types/get_accounts_request.rb b/lib/square/loyalty/accounts/types/get_accounts_request.rb new file mode 100644 index 000000000..0a48f9a71 --- /dev/null +++ b/lib/square/loyalty/accounts/types/get_accounts_request.rb @@ -0,0 +1,13 @@ + +module Square + module Loyalty + module Accounts + module Types + class GetAccountsRequest < Internal::Types::Model + field :account_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/accounts/types/search_loyalty_accounts_request.rb b/lib/square/loyalty/accounts/types/search_loyalty_accounts_request.rb new file mode 100644 index 000000000..c899f58cb --- /dev/null +++ b/lib/square/loyalty/accounts/types/search_loyalty_accounts_request.rb @@ -0,0 +1,15 @@ + +module Square + module Loyalty + module Accounts + module Types + class SearchLoyaltyAccountsRequest < Internal::Types::Model + field :query, Square::Types::SearchLoyaltyAccountsRequestLoyaltyAccountQuery, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/client.rb b/lib/square/loyalty/client.rb new file mode 100644 index 000000000..692fd18e6 --- /dev/null +++ b/lib/square/loyalty/client.rb @@ -0,0 +1,34 @@ + +module Square + module Loyalty + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Loyalty::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::SearchLoyaltyEventsResponse] + def search_events(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchLoyaltyEventsResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/loyalty/programs/client.rb b/lib/square/loyalty/programs/client.rb new file mode 100644 index 000000000..18400eb82 --- /dev/null +++ b/lib/square/loyalty/programs/client.rb @@ -0,0 +1,75 @@ + +module Square + module Loyalty + module Programs + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Loyalty::Programs::Client] + def initialize(client) + @client = client + end + + # 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`. + # + # @return [Square::Types::ListLoyaltyProgramsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListLoyaltyProgramsResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::GetLoyaltyProgramResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetLoyaltyProgramResponse.load(_response.body) + else + raise _response.body + end + end + + # Calculates the number of points a buyer can earn from a purchase. Applications might call this endpoint + # to display the points to the buyer. + # + # - If you are using the Orders API to manage orders, provide the `order_id` and (optional) `loyalty_account_id`. + # Square reads the order to compute the points earned from the base loyalty program and an associated + # [loyalty promotion](entity:LoyaltyPromotion). + # + # - If you are not using the Orders API to manage orders, provide `transaction_amount_money` with the + # purchase amount. Square uses this amount to calculate the points earned from the base loyalty program, + # but not points earned from a loyalty promotion. For spend-based and visit-based programs, the `tax_mode` + # setting of the accrual rule indicates how taxes should be treated for loyalty points accrual. + # If the purchase qualifies for program points, call + # [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) and perform a client-side computation + # to calculate whether the purchase also qualifies for promotion points. For more information, see + # [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). + # + # @return [Square::Types::CalculateLoyaltyPointsResponse] + def calculate(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CalculateLoyaltyPointsResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/loyalty/programs/promotions/client.rb b/lib/square/loyalty/programs/promotions/client.rb new file mode 100644 index 000000000..fe4824356 --- /dev/null +++ b/lib/square/loyalty/programs/promotions/client.rb @@ -0,0 +1,81 @@ + +module Square + module Loyalty + module Programs + module Promotions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Loyalty::Programs::Promotions::Client] + def initialize(client) + @client = client + end + + # Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). + # Results are sorted by the `created_at` date in descending order (newest to oldest). + # + # @return [Square::Types::ListLoyaltyPromotionsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListLoyaltyPromotionsResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a loyalty promotion for a [loyalty program](entity:LoyaltyProgram). A loyalty promotion + # enables buyers to earn points in addition to those earned from the base loyalty program. + # + # This endpoint sets the loyalty promotion to the `ACTIVE` or `SCHEDULED` status, depending on the + # `available_time` setting. A loyalty program can have a maximum of 10 loyalty promotions with an + # `ACTIVE` or `SCHEDULED` status. + # + # @return [Square::Types::CreateLoyaltyPromotionResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateLoyaltyPromotionResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a loyalty promotion. + # + # @return [Square::Types::GetLoyaltyPromotionResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetLoyaltyPromotionResponse.load(_response.body) + else + raise _response.body + end + end + + # 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 + # + # @return [Square::Types::CancelLoyaltyPromotionResponse] + def cancel(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CancelLoyaltyPromotionResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end + end +end diff --git a/lib/square/loyalty/programs/promotions/types/cancel_promotions_request.rb b/lib/square/loyalty/programs/promotions/types/cancel_promotions_request.rb new file mode 100644 index 000000000..defb195b5 --- /dev/null +++ b/lib/square/loyalty/programs/promotions/types/cancel_promotions_request.rb @@ -0,0 +1,16 @@ + +module Square + module Loyalty + module Programs + module Promotions + module Types + class CancelPromotionsRequest < Internal::Types::Model + field :promotion_id, String, optional: false, nullable: false + field :program_id, String, optional: false, nullable: false + + end + end + end + end + end +end diff --git a/lib/square/loyalty/programs/promotions/types/create_loyalty_promotion_request.rb b/lib/square/loyalty/programs/promotions/types/create_loyalty_promotion_request.rb new file mode 100644 index 000000000..c9fce6737 --- /dev/null +++ b/lib/square/loyalty/programs/promotions/types/create_loyalty_promotion_request.rb @@ -0,0 +1,17 @@ + +module Square + module Loyalty + module Programs + module Promotions + module Types + class CreateLoyaltyPromotionRequest < Internal::Types::Model + field :program_id, String, optional: false, nullable: false + field :loyalty_promotion, Square::Types::LoyaltyPromotion, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + + end + end + end + end + end +end diff --git a/lib/square/loyalty/programs/promotions/types/get_promotions_request.rb b/lib/square/loyalty/programs/promotions/types/get_promotions_request.rb new file mode 100644 index 000000000..1a5473d6b --- /dev/null +++ b/lib/square/loyalty/programs/promotions/types/get_promotions_request.rb @@ -0,0 +1,16 @@ + +module Square + module Loyalty + module Programs + module Promotions + module Types + class GetPromotionsRequest < Internal::Types::Model + field :promotion_id, String, optional: false, nullable: false + field :program_id, String, optional: false, nullable: false + + end + end + end + end + end +end diff --git a/lib/square/loyalty/programs/promotions/types/list_promotions_request.rb b/lib/square/loyalty/programs/promotions/types/list_promotions_request.rb new file mode 100644 index 000000000..301815e7b --- /dev/null +++ b/lib/square/loyalty/programs/promotions/types/list_promotions_request.rb @@ -0,0 +1,18 @@ + +module Square + module Loyalty + module Programs + module Promotions + module Types + class ListPromotionsRequest < Internal::Types::Model + field :program_id, String, optional: false, nullable: false + field :status, Square::Types::LoyaltyPromotionStatus, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end + end + end +end diff --git a/lib/square/loyalty/programs/types/calculate_loyalty_points_request.rb b/lib/square/loyalty/programs/types/calculate_loyalty_points_request.rb new file mode 100644 index 000000000..7b9ea907d --- /dev/null +++ b/lib/square/loyalty/programs/types/calculate_loyalty_points_request.rb @@ -0,0 +1,16 @@ + +module Square + module Loyalty + module Programs + module Types + class CalculateLoyaltyPointsRequest < Internal::Types::Model + field :program_id, String, optional: false, nullable: false + field :order_id, String, optional: true, nullable: false + field :transaction_amount_money, Square::Types::Money, optional: true, nullable: false + field :loyalty_account_id, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/programs/types/get_programs_request.rb b/lib/square/loyalty/programs/types/get_programs_request.rb new file mode 100644 index 000000000..db26fbbfa --- /dev/null +++ b/lib/square/loyalty/programs/types/get_programs_request.rb @@ -0,0 +1,13 @@ + +module Square + module Loyalty + module Programs + module Types + class GetProgramsRequest < Internal::Types::Model + field :program_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/rewards/client.rb b/lib/square/loyalty/rewards/client.rb new file mode 100644 index 000000000..9d8f7e037 --- /dev/null +++ b/lib/square/loyalty/rewards/client.rb @@ -0,0 +1,112 @@ + +module Square + module Loyalty + module Rewards + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Loyalty::Rewards::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::CreateLoyaltyRewardResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateLoyaltyRewardResponse.load(_response.body) + else + raise _response.body + end + end + + # Searches for loyalty rewards. This endpoint accepts a request with no query filters and returns results for all loyalty accounts. + # If you include a `query` object, `loyalty_account_id` is required and `status` is optional. + # + # If you know a reward ID, use the + # [RetrieveLoyaltyReward](api-endpoint:Loyalty-RetrieveLoyaltyReward) endpoint. + # + # Search results are sorted by `updated_at` in descending order. + # + # @return [Square::Types::SearchLoyaltyRewardsResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchLoyaltyRewardsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a loyalty reward. + # + # @return [Square::Types::GetLoyaltyRewardResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetLoyaltyRewardResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a loyalty reward by doing the following: + # + # - Returns the loyalty points back to the loyalty account. + # - If an order ID was specified when the reward was created + # (see [CreateLoyaltyReward](api-endpoint:Loyalty-CreateLoyaltyReward)), + # it updates the order by removing the reward and related + # discounts. + # + # You cannot delete a reward that has reached the terminal state (REDEEMED). + # + # @return [Square::Types::DeleteLoyaltyRewardResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteLoyaltyRewardResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::RedeemLoyaltyRewardResponse] + def redeem(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RedeemLoyaltyRewardResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/loyalty/rewards/types/create_loyalty_reward_request.rb b/lib/square/loyalty/rewards/types/create_loyalty_reward_request.rb new file mode 100644 index 000000000..1d47546aa --- /dev/null +++ b/lib/square/loyalty/rewards/types/create_loyalty_reward_request.rb @@ -0,0 +1,14 @@ + +module Square + module Loyalty + module Rewards + module Types + class CreateLoyaltyRewardRequest < Internal::Types::Model + field :reward, Square::Types::LoyaltyReward, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/rewards/types/delete_rewards_request.rb b/lib/square/loyalty/rewards/types/delete_rewards_request.rb new file mode 100644 index 000000000..b2b621c32 --- /dev/null +++ b/lib/square/loyalty/rewards/types/delete_rewards_request.rb @@ -0,0 +1,13 @@ + +module Square + module Loyalty + module Rewards + module Types + class DeleteRewardsRequest < Internal::Types::Model + field :reward_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/rewards/types/get_rewards_request.rb b/lib/square/loyalty/rewards/types/get_rewards_request.rb new file mode 100644 index 000000000..4adf3b489 --- /dev/null +++ b/lib/square/loyalty/rewards/types/get_rewards_request.rb @@ -0,0 +1,13 @@ + +module Square + module Loyalty + module Rewards + module Types + class GetRewardsRequest < Internal::Types::Model + field :reward_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/rewards/types/redeem_loyalty_reward_request.rb b/lib/square/loyalty/rewards/types/redeem_loyalty_reward_request.rb new file mode 100644 index 000000000..1d53e688f --- /dev/null +++ b/lib/square/loyalty/rewards/types/redeem_loyalty_reward_request.rb @@ -0,0 +1,15 @@ + +module Square + module Loyalty + module Rewards + module Types + class RedeemLoyaltyRewardRequest < Internal::Types::Model + field :reward_id, String, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + field :location_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/rewards/types/search_loyalty_rewards_request.rb b/lib/square/loyalty/rewards/types/search_loyalty_rewards_request.rb new file mode 100644 index 000000000..27a079f80 --- /dev/null +++ b/lib/square/loyalty/rewards/types/search_loyalty_rewards_request.rb @@ -0,0 +1,15 @@ + +module Square + module Loyalty + module Rewards + module Types + class SearchLoyaltyRewardsRequest < Internal::Types::Model + field :query, Square::Types::SearchLoyaltyRewardsRequestLoyaltyRewardQuery, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/loyalty/types/search_loyalty_events_request.rb b/lib/square/loyalty/types/search_loyalty_events_request.rb new file mode 100644 index 000000000..1d9a88486 --- /dev/null +++ b/lib/square/loyalty/types/search_loyalty_events_request.rb @@ -0,0 +1,13 @@ + +module Square + module Loyalty + module Types + class SearchLoyaltyEventsRequest < Internal::Types::Model + field :query, Square::Types::LoyaltyEventQuery, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/merchants/client.rb b/lib/square/merchants/client.rb new file mode 100644 index 000000000..fc378bf36 --- /dev/null +++ b/lib/square/merchants/client.rb @@ -0,0 +1,49 @@ + +module Square + module Merchants + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Merchants::Client] + def initialize(client) + @client = client + end + + # Provides details about the merchant associated with a given access token. + # + # The access token used to connect your application to a Square seller is associated + # with a single merchant. That means that `ListMerchants` returns a list + # with a single `Merchant` object. You can specify your personal access token + # to get your own merchant information or specify an OAuth token to get the + # information for the merchant that granted your application access. + # + # If you know the merchant ID, you can also use the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) + # endpoint to retrieve the merchant information. + # + # @return [Square::Types::ListMerchantsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListMerchantsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves the `Merchant` object for the given `merchant_id`. + # + # @return [Square::Types::GetMerchantResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetMerchantResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/merchants/custom_attribute_definitions/client.rb b/lib/square/merchants/custom_attribute_definitions/client.rb new file mode 100644 index 000000000..8d6b613ea --- /dev/null +++ b/lib/square/merchants/custom_attribute_definitions/client.rb @@ -0,0 +1,98 @@ + +module Square + module Merchants + module CustomAttributeDefinitions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Merchants::CustomAttributeDefinitions::Client] + def initialize(client) + @client = client + end + + # Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + # When all response pages are retrieved, the results include all custom attribute definitions + # that are visible to the requesting application, including those that are created by other + # applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::ListMerchantCustomAttributeDefinitionsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListMerchantCustomAttributeDefinitionsResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + # Use this endpoint to define a custom attribute that can be associated with a merchant connecting to your application. + # A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties + # for a custom attribute. After the definition is created, you can call + # [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) or + # [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + # to set the custom attribute for a merchant. + # + # @return [Square::Types::CreateMerchantCustomAttributeDefinitionResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateMerchantCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + # To retrieve a custom attribute definition created by another application, the `visibility` + # setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::RetrieveMerchantCustomAttributeDefinitionResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveMerchantCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account. + # Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the + # `schema` for a `Selection` data type. + # Only the definition owner can update a custom attribute definition. + # + # @return [Square::Types::UpdateMerchantCustomAttributeDefinitionResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateMerchantCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + # Deleting a custom attribute definition also deletes the corresponding custom attribute from + # the merchant. + # Only the definition owner can delete a custom attribute definition. + # + # @return [Square::Types::DeleteMerchantCustomAttributeDefinitionResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteMerchantCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/merchants/custom_attribute_definitions/types/create_merchant_custom_attribute_definition_request.rb b/lib/square/merchants/custom_attribute_definitions/types/create_merchant_custom_attribute_definition_request.rb new file mode 100644 index 000000000..23a7259bb --- /dev/null +++ b/lib/square/merchants/custom_attribute_definitions/types/create_merchant_custom_attribute_definition_request.rb @@ -0,0 +1,14 @@ + +module Square + module Merchants + module CustomAttributeDefinitions + module Types + class CreateMerchantCustomAttributeDefinitionRequest < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb b/lib/square/merchants/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..0670c171d --- /dev/null +++ b/lib/square/merchants/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb @@ -0,0 +1,13 @@ + +module Square + module Merchants + module CustomAttributeDefinitions + module Types + class DeleteCustomAttributeDefinitionsRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb b/lib/square/merchants/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..688c006ca --- /dev/null +++ b/lib/square/merchants/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Merchants + module CustomAttributeDefinitions + module Types + class GetCustomAttributeDefinitionsRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb b/lib/square/merchants/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..4fb62dfdc --- /dev/null +++ b/lib/square/merchants/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb @@ -0,0 +1,15 @@ + +module Square + module Merchants + module CustomAttributeDefinitions + module Types + class ListCustomAttributeDefinitionsRequest < Internal::Types::Model + field :visibility_filter, Square::Types::VisibilityFilter, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/custom_attribute_definitions/types/update_merchant_custom_attribute_definition_request.rb b/lib/square/merchants/custom_attribute_definitions/types/update_merchant_custom_attribute_definition_request.rb new file mode 100644 index 000000000..d0e1b496a --- /dev/null +++ b/lib/square/merchants/custom_attribute_definitions/types/update_merchant_custom_attribute_definition_request.rb @@ -0,0 +1,15 @@ + +module Square + module Merchants + module CustomAttributeDefinitions + module Types + class UpdateMerchantCustomAttributeDefinitionRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/custom_attributes/client.rb b/lib/square/merchants/custom_attributes/client.rb new file mode 100644 index 000000000..2afc2af61 --- /dev/null +++ b/lib/square/merchants/custom_attributes/client.rb @@ -0,0 +1,121 @@ + +module Square + module Merchants + module CustomAttributes + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Merchants::CustomAttributes::Client] + def initialize(client) + @client = client + end + + # Deletes [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation. + # To delete a custom attribute owned by another application, the `visibility` setting must be + # `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::BulkDeleteMerchantCustomAttributesResponse] + def batch_delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkDeleteMerchantCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates or updates [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation. + # Use this endpoint to set the value of one or more custom attributes for a merchant. + # A custom attribute is based on a custom attribute definition in a Square seller account, which is + # created using the [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) endpoint. + # This `BulkUpsertMerchantCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert + # requests and returns a map of individual upsert responses. Each upsert request has a unique ID + # and provides a merchant ID and custom attribute. Each upsert response is returned with the ID + # of the corresponding request. + # To create or update a custom attribute owned by another application, the `visibility` setting + # must be `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::BulkUpsertMerchantCustomAttributesResponse] + def batch_upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkUpsertMerchantCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. + # You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + # in the same call. + # When all response pages are retrieved, the results include all custom attributes that are + # visible to the requesting application, including those that are owned by other applications + # and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::ListMerchantCustomAttributesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListMerchantCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a [custom attribute](entity:CustomAttribute) associated with a merchant. + # You can use the `with_definition` query parameter to also retrieve the custom attribute definition + # in the same call. + # To retrieve a custom attribute owned by another application, the `visibility` setting must be + # `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::RetrieveMerchantCustomAttributeResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveMerchantCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates or updates a [custom attribute](entity:CustomAttribute) for a merchant. + # Use this endpoint to set the value of a custom attribute for a specified merchant. + # A custom attribute is based on a custom attribute definition in a Square seller account, which + # is created using the [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) endpoint. + # To create or update a custom attribute owned by another application, the `visibility` setting + # must be `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::UpsertMerchantCustomAttributeResponse] + def upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpsertMerchantCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a [custom attribute](entity:CustomAttribute) associated with a merchant. + # To delete a custom attribute owned by another application, the `visibility` setting must be + # `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::DeleteMerchantCustomAttributeResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteMerchantCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/merchants/custom_attributes/types/bulk_delete_merchant_custom_attributes_request.rb b/lib/square/merchants/custom_attributes/types/bulk_delete_merchant_custom_attributes_request.rb new file mode 100644 index 000000000..e5f960e98 --- /dev/null +++ b/lib/square/merchants/custom_attributes/types/bulk_delete_merchant_custom_attributes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Merchants + module CustomAttributes + module Types + class BulkDeleteMerchantCustomAttributesRequest < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest], optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/custom_attributes/types/bulk_upsert_merchant_custom_attributes_request.rb b/lib/square/merchants/custom_attributes/types/bulk_upsert_merchant_custom_attributes_request.rb new file mode 100644 index 000000000..a05963e24 --- /dev/null +++ b/lib/square/merchants/custom_attributes/types/bulk_upsert_merchant_custom_attributes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Merchants + module CustomAttributes + module Types + class BulkUpsertMerchantCustomAttributesRequest < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest], optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/custom_attributes/types/delete_custom_attributes_request.rb b/lib/square/merchants/custom_attributes/types/delete_custom_attributes_request.rb new file mode 100644 index 000000000..22e92b9ee --- /dev/null +++ b/lib/square/merchants/custom_attributes/types/delete_custom_attributes_request.rb @@ -0,0 +1,14 @@ + +module Square + module Merchants + module CustomAttributes + module Types + class DeleteCustomAttributesRequest < Internal::Types::Model + field :merchant_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/custom_attributes/types/get_custom_attributes_request.rb b/lib/square/merchants/custom_attributes/types/get_custom_attributes_request.rb new file mode 100644 index 000000000..3dd104e64 --- /dev/null +++ b/lib/square/merchants/custom_attributes/types/get_custom_attributes_request.rb @@ -0,0 +1,16 @@ + +module Square + module Merchants + module CustomAttributes + module Types + class GetCustomAttributesRequest < Internal::Types::Model + field :merchant_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + field :with_definition, Internal::Types::Boolean, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/custom_attributes/types/list_custom_attributes_request.rb b/lib/square/merchants/custom_attributes/types/list_custom_attributes_request.rb new file mode 100644 index 000000000..55c6b4451 --- /dev/null +++ b/lib/square/merchants/custom_attributes/types/list_custom_attributes_request.rb @@ -0,0 +1,17 @@ + +module Square + module Merchants + module CustomAttributes + module Types + class ListCustomAttributesRequest < Internal::Types::Model + field :merchant_id, String, optional: false, nullable: false + field :visibility_filter, Square::Types::VisibilityFilter, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :with_definitions, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/custom_attributes/types/upsert_merchant_custom_attribute_request.rb b/lib/square/merchants/custom_attributes/types/upsert_merchant_custom_attribute_request.rb new file mode 100644 index 000000000..2a91c189a --- /dev/null +++ b/lib/square/merchants/custom_attributes/types/upsert_merchant_custom_attribute_request.rb @@ -0,0 +1,16 @@ + +module Square + module Merchants + module CustomAttributes + module Types + class UpsertMerchantCustomAttributeRequest < Internal::Types::Model + field :merchant_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/merchants/types/get_merchants_request.rb b/lib/square/merchants/types/get_merchants_request.rb new file mode 100644 index 000000000..ce127f7ed --- /dev/null +++ b/lib/square/merchants/types/get_merchants_request.rb @@ -0,0 +1,11 @@ + +module Square + module Merchants + module Types + class GetMerchantsRequest < Internal::Types::Model + field :merchant_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/merchants/types/list_merchants_request.rb b/lib/square/merchants/types/list_merchants_request.rb new file mode 100644 index 000000000..b30415b83 --- /dev/null +++ b/lib/square/merchants/types/list_merchants_request.rb @@ -0,0 +1,11 @@ + +module Square + module Merchants + module Types + class ListMerchantsRequest < Internal::Types::Model + field :cursor, Integer, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/mobile/client.rb b/lib/square/mobile/client.rb new file mode 100644 index 000000000..420246a92 --- /dev/null +++ b/lib/square/mobile/client.rb @@ -0,0 +1,41 @@ + +module Square + module Mobile + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Mobile::Client] + def initialize(client) + @client = client + end + + # __Note:__ This endpoint is used by the deprecated Reader SDK. + # Developers should update their integration to use the [Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. + # + # Generates code to authorize a mobile application to connect to a Square card reader. + # + # Authorization codes are one-time-use codes and expire 60 minutes after being issued. + # + # The `Authorization` header you provide to this endpoint must have the following format: + # + # ``` + # Authorization: Bearer ACCESS_TOKEN + # ``` + # + # Replace `ACCESS_TOKEN` with a + # [valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). + # + # @return [Square::Types::CreateMobileAuthorizationCodeResponse] + def authorization_code(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateMobileAuthorizationCodeResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/mobile/types/create_mobile_authorization_code_request.rb b/lib/square/mobile/types/create_mobile_authorization_code_request.rb new file mode 100644 index 000000000..27ffd5d6e --- /dev/null +++ b/lib/square/mobile/types/create_mobile_authorization_code_request.rb @@ -0,0 +1,11 @@ + +module Square + module Mobile + module Types + class CreateMobileAuthorizationCodeRequest < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/o_auth/client.rb b/lib/square/o_auth/client.rb new file mode 100644 index 000000000..9c2e95c86 --- /dev/null +++ b/lib/square/o_auth/client.rb @@ -0,0 +1,110 @@ + +module Square + module OAuth + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::OAuth::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::RevokeTokenResponse] + def revoke_token(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RevokeTokenResponse.load(_response.body) + else + raise _response.body + end + end + + # Returns an OAuth access token and refresh token using the `authorization_code` + # or `refresh_token` grant type. + # + # When `grant_type` is `authorization_code`: + # - With the [code flow](https://developer.squareup.com/docs/oauth-api/overview#code-flow), + # provide `code`, `client_id`, and `client_secret`. + # - With the [PKCE flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow), + # provide `code`, `client_id`, and `code_verifier`. + # + # When `grant_type` is `refresh_token`: + # - With the code flow, provide `refresh_token`, `client_id`, and `client_secret`. + # The response returns the same refresh token provided in the request. + # - With the PKCE flow, provide `refresh_token` and `client_id`. The response returns + # a new refresh token. + # + # You can use the `scopes` parameter to limit the set of permissions authorized by the + # access token. You can use the `short_lived` parameter to create an access token that + # expires in 24 hours. + # + # __Important:__ OAuth tokens should be encrypted and stored on a secure server. + # Application clients should never interact directly with OAuth tokens. + # + # @return [Square::Types::ObtainTokenResponse] + def obtain_token(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ObtainTokenResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::RetrieveTokenStatusResponse] + def retrieve_token_status(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveTokenStatusResponse.load(_response.body) + else + raise _response.body + end + end + + # @return [untyped] + def authorize(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/o_auth/types/obtain_token_request.rb b/lib/square/o_auth/types/obtain_token_request.rb new file mode 100644 index 000000000..dad4e9443 --- /dev/null +++ b/lib/square/o_auth/types/obtain_token_request.rb @@ -0,0 +1,20 @@ + +module Square + module OAuth + module Types + class ObtainTokenRequest < Internal::Types::Model + field :client_id, String, optional: false, nullable: false + field :client_secret, String, optional: true, nullable: false + field :code, String, optional: true, nullable: false + field :redirect_uri, String, optional: true, nullable: false + field :grant_type, String, optional: false, nullable: false + field :refresh_token, String, optional: true, nullable: false + field :migration_token, String, optional: true, nullable: false + field :scopes, Internal::Types::Array[String], optional: true, nullable: false + field :short_lived, Internal::Types::Boolean, optional: true, nullable: false + field :code_verifier, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/o_auth/types/revoke_token_request.rb b/lib/square/o_auth/types/revoke_token_request.rb new file mode 100644 index 000000000..8a66661c8 --- /dev/null +++ b/lib/square/o_auth/types/revoke_token_request.rb @@ -0,0 +1,14 @@ + +module Square + module OAuth + module Types + class RevokeTokenRequest < Internal::Types::Model + field :client_id, String, optional: true, nullable: false + field :access_token, String, optional: true, nullable: false + field :merchant_id, String, optional: true, nullable: false + field :revoke_only_access_token, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/orders/client.rb b/lib/square/orders/client.rb new file mode 100644 index 000000000..9ad071a8c --- /dev/null +++ b/lib/square/orders/client.rb @@ -0,0 +1,173 @@ + +module Square + module Orders + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Orders::Client] + def initialize(client) + @client = client + end + + # Creates a new [order](entity:Order) that can include information about products for + # purchase and settings to apply to the purchase. + # + # To pay for a created order, see + # [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). + # + # You can modify open orders using the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. + # + # @return [Square::Types::CreateOrderResponse] + def create(request_options: {}, **params) + _request = Square::Internal::Http::JSONRequest.new( + method: POST, + path: "v2/orders" + ) + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateOrderResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a set of [orders](entity:Order) by their IDs. + # + # If a given order ID does not exist, the ID is ignored instead of generating an error. + # + # @return [Square::Types::BatchGetOrdersResponse] + def batch_get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchGetOrdersResponse.load(_response.body) + else + raise _response.body + end + end + + # Enables applications to preview order pricing without creating an order. + # + # @return [Square::Types::CalculateOrderResponse] + def calculate(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CalculateOrderResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::CloneOrderResponse] + def clone(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CloneOrderResponse.load(_response.body) + else + raise _response.body + end + end + + # Search all orders for one or more locations. Orders include all sales, + # returns, and exchanges regardless of how or when they entered the Square + # ecosystem (such as Point of Sale, Invoices, and Connect APIs). + # + # `SearchOrders` requests need to specify which locations to search and define a + # [SearchOrdersQuery](entity:SearchOrdersQuery) object that controls + # how to sort or filter the results. Your `SearchOrdersQuery` can: + # + # Set filter criteria. + # Set the sort order. + # Determine whether to return results as complete `Order` objects or as + # [OrderEntry](entity:OrderEntry) objects. + # + # Note that details for orders processed with Square Point of Sale while in + # offline mode might not be transmitted to Square for up to 72 hours. Offline + # orders have a `created_at` value that reflects the time the order was created, + # not the time it was subsequently transmitted to Square. + # + # @return [Square::Types::SearchOrdersResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchOrdersResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves an [Order](entity:Order) by ID. + # + # @return [Square::Types::GetOrderResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetOrderResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates an open [order](entity:Order) by adding, replacing, or deleting + # fields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated. + # + # An `UpdateOrder` request requires the following: + # + # - The `order_id` in the endpoint path, identifying the order to update. + # - The latest `version` of the order to update. + # - The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) + # containing only the fields to update and the version to which the update is + # being applied. + # - If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete) + # identifying the fields to clear. + # + # To pay for an order, see + # [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). + # + # @return [Square::Types::UpdateOrderResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateOrderResponse.load(_response.body) + else + raise _response.body + end + end + + # Pay for an [order](entity:Order) using one or more approved [payments](entity:Payment) + # or settle an order with a total of `0`. + # + # The total of the `payment_ids` listed in the request must be equal to the order + # total. Orders with a total amount of `0` can be marked as paid by specifying an empty + # array of `payment_ids` in the request. + # + # To be used with `PayOrder`, a payment must: + # + # - Reference the order by specifying the `order_id` when [creating the payment](api-endpoint:Payments-CreatePayment). + # Any approved payments that reference the same `order_id` not specified in the + # `payment_ids` is canceled. + # - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture). + # Using a delayed capture payment with `PayOrder` completes the approved payment. + # + # @return [Square::Types::PayOrderResponse] + def pay(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::PayOrderResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/orders/custom_attribute_definitions/client.rb b/lib/square/orders/custom_attribute_definitions/client.rb new file mode 100644 index 000000000..f22fd0daf --- /dev/null +++ b/lib/square/orders/custom_attribute_definitions/client.rb @@ -0,0 +1,98 @@ + +module Square + module Orders + module CustomAttributeDefinitions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Orders::CustomAttributeDefinitions::Client] + def initialize(client) + @client = client + end + + # Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. + # + # When all response pages are retrieved, the results include all custom attribute definitions + # that are visible to the requesting application, including those that are created by other + # applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that + # seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::ListOrderCustomAttributeDefinitionsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListOrderCustomAttributeDefinitionsResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::CreateOrderCustomAttributeDefinitionResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateOrderCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + # + # To retrieve a custom attribute definition created by another application, the `visibility` + # setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::RetrieveOrderCustomAttributeDefinitionResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveOrderCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # 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`. + # + # @return [Square::Types::UpdateOrderCustomAttributeDefinitionResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateOrderCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. + # + # Only the definition owner can delete a custom attribute definition. + # + # @return [Square::Types::DeleteOrderCustomAttributeDefinitionResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteOrderCustomAttributeDefinitionResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/orders/custom_attribute_definitions/types/create_order_custom_attribute_definition_request.rb b/lib/square/orders/custom_attribute_definitions/types/create_order_custom_attribute_definition_request.rb new file mode 100644 index 000000000..2b0d770f5 --- /dev/null +++ b/lib/square/orders/custom_attribute_definitions/types/create_order_custom_attribute_definition_request.rb @@ -0,0 +1,14 @@ + +module Square + module Orders + module CustomAttributeDefinitions + module Types + class CreateOrderCustomAttributeDefinitionRequest < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb b/lib/square/orders/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..92a75c7f0 --- /dev/null +++ b/lib/square/orders/custom_attribute_definitions/types/delete_custom_attribute_definitions_request.rb @@ -0,0 +1,13 @@ + +module Square + module Orders + module CustomAttributeDefinitions + module Types + class DeleteCustomAttributeDefinitionsRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb b/lib/square/orders/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..de098fbe2 --- /dev/null +++ b/lib/square/orders/custom_attribute_definitions/types/get_custom_attribute_definitions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Orders + module CustomAttributeDefinitions + module Types + class GetCustomAttributeDefinitionsRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb b/lib/square/orders/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb new file mode 100644 index 000000000..8a85e316f --- /dev/null +++ b/lib/square/orders/custom_attribute_definitions/types/list_custom_attribute_definitions_request.rb @@ -0,0 +1,15 @@ + +module Square + module Orders + module CustomAttributeDefinitions + module Types + class ListCustomAttributeDefinitionsRequest < Internal::Types::Model + field :visibility_filter, Square::Types::VisibilityFilter, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/custom_attribute_definitions/types/update_order_custom_attribute_definition_request.rb b/lib/square/orders/custom_attribute_definitions/types/update_order_custom_attribute_definition_request.rb new file mode 100644 index 000000000..31c6ac2a4 --- /dev/null +++ b/lib/square/orders/custom_attribute_definitions/types/update_order_custom_attribute_definition_request.rb @@ -0,0 +1,15 @@ + +module Square + module Orders + module CustomAttributeDefinitions + module Types + class UpdateOrderCustomAttributeDefinitionRequest < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/custom_attributes/client.rb b/lib/square/orders/custom_attributes/client.rb new file mode 100644 index 000000000..f0bc3ff8f --- /dev/null +++ b/lib/square/orders/custom_attributes/client.rb @@ -0,0 +1,146 @@ + +module Square + module Orders + module CustomAttributes + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Orders::CustomAttributes::Client] + def initialize(client) + @client = client + end + + # Deletes order [custom attributes](entity:CustomAttribute) as a bulk operation. + # + # Use this endpoint to delete one or more custom attributes from one or more orders. + # A custom attribute is based on a custom attribute definition in a Square seller account. (To create a + # custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.) + # + # This `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual delete + # requests and returns a map of individual delete responses. Each delete request has a unique ID + # and provides an order ID and custom attribute. Each delete response is returned with the ID + # of the corresponding request. + # + # To delete a custom attribute owned by another application, the `visibility` setting + # must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::BulkDeleteOrderCustomAttributesResponse] + def batch_delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkDeleteOrderCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates or updates order [custom attributes](entity:CustomAttribute) as a bulk operation. + # + # Use this endpoint to delete one or more custom attributes from one or more orders. + # A custom attribute is based on a custom attribute definition in a Square seller account. (To create a + # custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.) + # + # This `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert + # requests and returns a map of individual upsert responses. Each upsert request has a unique ID + # and provides an order ID and custom attribute. Each upsert response is returned with the ID + # of the corresponding request. + # + # To create or update a custom attribute owned by another application, the `visibility` setting + # must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::BulkUpsertOrderCustomAttributesResponse] + def batch_upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkUpsertOrderCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # Lists the [custom attributes](entity:CustomAttribute) associated with an order. + # + # You can use the `with_definitions` query parameter to also retrieve custom attribute definitions + # in the same call. + # + # When all response pages are retrieved, the results include all custom attributes that are + # visible to the requesting application, including those that are owned by other applications + # and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::ListOrderCustomAttributesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListOrderCustomAttributesResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a [custom attribute](entity:CustomAttribute) associated with an order. + # + # You can use the `with_definition` query parameter to also retrieve the custom attribute definition + # in the same call. + # + # To retrieve a custom attribute owned by another application, the `visibility` setting must be + # `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::RetrieveOrderCustomAttributeResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveOrderCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates or updates a [custom attribute](entity:CustomAttribute) for an order. + # + # Use this endpoint to set the value of a custom attribute for a specific order. + # A custom attribute is based on a custom attribute definition in a Square seller account. (To create a + # custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.) + # + # To create or update a custom attribute owned by another application, the `visibility` setting + # must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::UpsertOrderCustomAttributeResponse] + def upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpsertOrderCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile. + # + # To delete a custom attribute owned by another application, the `visibility` setting must be + # `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes + # (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + # + # @return [Square::Types::DeleteOrderCustomAttributeResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteOrderCustomAttributeResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/orders/custom_attributes/types/bulk_delete_order_custom_attributes_request.rb b/lib/square/orders/custom_attributes/types/bulk_delete_order_custom_attributes_request.rb new file mode 100644 index 000000000..59b5435c7 --- /dev/null +++ b/lib/square/orders/custom_attributes/types/bulk_delete_order_custom_attributes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Orders + module CustomAttributes + module Types + class BulkDeleteOrderCustomAttributesRequest < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute], optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/custom_attributes/types/bulk_upsert_order_custom_attributes_request.rb b/lib/square/orders/custom_attributes/types/bulk_upsert_order_custom_attributes_request.rb new file mode 100644 index 000000000..10508a142 --- /dev/null +++ b/lib/square/orders/custom_attributes/types/bulk_upsert_order_custom_attributes_request.rb @@ -0,0 +1,13 @@ + +module Square + module Orders + module CustomAttributes + module Types + class BulkUpsertOrderCustomAttributesRequest < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute], optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/custom_attributes/types/delete_custom_attributes_request.rb b/lib/square/orders/custom_attributes/types/delete_custom_attributes_request.rb new file mode 100644 index 000000000..f411e9797 --- /dev/null +++ b/lib/square/orders/custom_attributes/types/delete_custom_attributes_request.rb @@ -0,0 +1,14 @@ + +module Square + module Orders + module CustomAttributes + module Types + class DeleteCustomAttributesRequest < Internal::Types::Model + field :order_id, String, optional: false, nullable: false + field :custom_attribute_key, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/custom_attributes/types/get_custom_attributes_request.rb b/lib/square/orders/custom_attributes/types/get_custom_attributes_request.rb new file mode 100644 index 000000000..be9b912e1 --- /dev/null +++ b/lib/square/orders/custom_attributes/types/get_custom_attributes_request.rb @@ -0,0 +1,16 @@ + +module Square + module Orders + module CustomAttributes + module Types + class GetCustomAttributesRequest < Internal::Types::Model + field :order_id, String, optional: false, nullable: false + field :custom_attribute_key, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + field :with_definition, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/custom_attributes/types/list_custom_attributes_request.rb b/lib/square/orders/custom_attributes/types/list_custom_attributes_request.rb new file mode 100644 index 000000000..a4c6f5579 --- /dev/null +++ b/lib/square/orders/custom_attributes/types/list_custom_attributes_request.rb @@ -0,0 +1,17 @@ + +module Square + module Orders + module CustomAttributes + module Types + class ListCustomAttributesRequest < Internal::Types::Model + field :order_id, String, optional: false, nullable: false + field :visibility_filter, Square::Types::VisibilityFilter, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :with_definitions, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/custom_attributes/types/upsert_order_custom_attribute_request.rb b/lib/square/orders/custom_attributes/types/upsert_order_custom_attribute_request.rb new file mode 100644 index 000000000..201434c63 --- /dev/null +++ b/lib/square/orders/custom_attributes/types/upsert_order_custom_attribute_request.rb @@ -0,0 +1,16 @@ + +module Square + module Orders + module CustomAttributes + module Types + class UpsertOrderCustomAttributeRequest < Internal::Types::Model + field :order_id, String, optional: false, nullable: false + field :custom_attribute_key, String, optional: false, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/orders/types/batch_get_orders_request.rb b/lib/square/orders/types/batch_get_orders_request.rb new file mode 100644 index 000000000..0e688c9a6 --- /dev/null +++ b/lib/square/orders/types/batch_get_orders_request.rb @@ -0,0 +1,12 @@ + +module Square + module Orders + module Types + class BatchGetOrdersRequest < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + field :order_ids, Internal::Types::Array[String], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/orders/types/calculate_order_request.rb b/lib/square/orders/types/calculate_order_request.rb new file mode 100644 index 000000000..b414ec7c5 --- /dev/null +++ b/lib/square/orders/types/calculate_order_request.rb @@ -0,0 +1,12 @@ + +module Square + module Orders + module Types + class CalculateOrderRequest < Internal::Types::Model + field :order, Square::Types::Order, optional: false, nullable: false + field :proposed_rewards, Internal::Types::Array[Square::Types::OrderReward], optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/orders/types/clone_order_request.rb b/lib/square/orders/types/clone_order_request.rb new file mode 100644 index 000000000..f95a1767a --- /dev/null +++ b/lib/square/orders/types/clone_order_request.rb @@ -0,0 +1,13 @@ + +module Square + module Orders + module Types + class CloneOrderRequest < Internal::Types::Model + field :order_id, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/orders/types/get_orders_request.rb b/lib/square/orders/types/get_orders_request.rb new file mode 100644 index 000000000..bc68985d5 --- /dev/null +++ b/lib/square/orders/types/get_orders_request.rb @@ -0,0 +1,11 @@ + +module Square + module Orders + module Types + class GetOrdersRequest < Internal::Types::Model + field :order_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/orders/types/pay_order_request.rb b/lib/square/orders/types/pay_order_request.rb new file mode 100644 index 000000000..e79a06524 --- /dev/null +++ b/lib/square/orders/types/pay_order_request.rb @@ -0,0 +1,14 @@ + +module Square + module Orders + module Types + class PayOrderRequest < Internal::Types::Model + field :order_id, String, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + field :order_version, Integer, optional: true, nullable: false + field :payment_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/orders/types/search_orders_request.rb b/lib/square/orders/types/search_orders_request.rb new file mode 100644 index 000000000..bdfd49cca --- /dev/null +++ b/lib/square/orders/types/search_orders_request.rb @@ -0,0 +1,15 @@ + +module Square + module Orders + module Types + class SearchOrdersRequest < Internal::Types::Model + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :query, Square::Types::SearchOrdersQuery, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :return_entries, Internal::Types::Boolean, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/orders/types/update_order_request.rb b/lib/square/orders/types/update_order_request.rb new file mode 100644 index 000000000..b290285e0 --- /dev/null +++ b/lib/square/orders/types/update_order_request.rb @@ -0,0 +1,14 @@ + +module Square + module Orders + module Types + class UpdateOrderRequest < Internal::Types::Model + field :order_id, String, optional: false, nullable: false + field :order, Square::Types::Order, optional: true, nullable: false + field :fields_to_clear, Internal::Types::Array[String], optional: true, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/payments/client.rb b/lib/square/payments/client.rb new file mode 100644 index 000000000..15aca60fd --- /dev/null +++ b/lib/square/payments/client.rb @@ -0,0 +1,132 @@ + +module Square + module Payments + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Payments::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::ListPaymentsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListPaymentsResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::CreatePaymentResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreatePaymentResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::CancelPaymentByIdempotencyKeyResponse] + def cancel_by_idempotency_key(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CancelPaymentByIdempotencyKeyResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves details for a specific payment. + # + # @return [Square::Types::GetPaymentResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetPaymentResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates a payment with the APPROVED status. + # You can update the `amount_money` and `tip_money` using this endpoint. + # + # @return [Square::Types::UpdatePaymentResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdatePaymentResponse.load(_response.body) + else + raise _response.body + end + end + + # Cancels (voids) a payment. You can use this endpoint to cancel a payment with + # the APPROVED `status`. + # + # @return [Square::Types::CancelPaymentResponse] + def cancel(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CancelPaymentResponse.load(_response.body) + else + raise _response.body + end + end + + # 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`. + # + # @return [Square::Types::CompletePaymentResponse] + def complete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CompletePaymentResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/payments/types/cancel_payment_by_idempotency_key_request.rb b/lib/square/payments/types/cancel_payment_by_idempotency_key_request.rb new file mode 100644 index 000000000..467e30d38 --- /dev/null +++ b/lib/square/payments/types/cancel_payment_by_idempotency_key_request.rb @@ -0,0 +1,11 @@ + +module Square + module Payments + module Types + class CancelPaymentByIdempotencyKeyRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/payments/types/cancel_payments_request.rb b/lib/square/payments/types/cancel_payments_request.rb new file mode 100644 index 000000000..f73a64eaa --- /dev/null +++ b/lib/square/payments/types/cancel_payments_request.rb @@ -0,0 +1,11 @@ + +module Square + module Payments + module Types + class CancelPaymentsRequest < Internal::Types::Model + field :payment_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/payments/types/complete_payment_request.rb b/lib/square/payments/types/complete_payment_request.rb new file mode 100644 index 000000000..06314d0f1 --- /dev/null +++ b/lib/square/payments/types/complete_payment_request.rb @@ -0,0 +1,12 @@ + +module Square + module Payments + module Types + class CompletePaymentRequest < Internal::Types::Model + field :payment_id, String, optional: false, nullable: false + field :version_token, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/payments/types/create_payment_request.rb b/lib/square/payments/types/create_payment_request.rb new file mode 100644 index 000000000..19cf3f118 --- /dev/null +++ b/lib/square/payments/types/create_payment_request.rb @@ -0,0 +1,35 @@ + +module Square + module Payments + module Types + class CreatePaymentRequest < Internal::Types::Model + field :source_id, String, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :tip_money, Square::Types::Money, optional: true, nullable: false + field :app_fee_money, Square::Types::Money, optional: true, nullable: false + field :delay_duration, String, optional: true, nullable: false + field :delay_action, String, optional: true, nullable: false + field :autocomplete, Internal::Types::Boolean, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :verification_token, String, optional: true, nullable: false + field :accept_partial_authorization, Internal::Types::Boolean, optional: true, nullable: false + field :buyer_email_address, String, optional: true, nullable: false + field :buyer_phone_number, String, optional: true, nullable: false + field :billing_address, Square::Types::Address, optional: true, nullable: false + field :shipping_address, Square::Types::Address, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :statement_description_identifier, String, optional: true, nullable: false + field :cash_details, Square::Types::CashPaymentDetails, optional: true, nullable: false + field :external_details, Square::Types::ExternalPaymentDetails, optional: true, nullable: false + field :customer_details, Square::Types::CustomerDetails, optional: true, nullable: false + field :offline_payment_details, Square::Types::OfflinePaymentDetails, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/payments/types/get_payments_request.rb b/lib/square/payments/types/get_payments_request.rb new file mode 100644 index 000000000..35bdceb21 --- /dev/null +++ b/lib/square/payments/types/get_payments_request.rb @@ -0,0 +1,11 @@ + +module Square + module Payments + module Types + class GetPaymentsRequest < Internal::Types::Model + field :payment_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/payments/types/list_payments_request.rb b/lib/square/payments/types/list_payments_request.rb new file mode 100644 index 000000000..4b60b854a --- /dev/null +++ b/lib/square/payments/types/list_payments_request.rb @@ -0,0 +1,25 @@ + +module Square + module Payments + module Types + class ListPaymentsRequest < Internal::Types::Model + field :begin_time, String, optional: true, nullable: false + field :end_time, String, optional: true, nullable: false + field :sort_order, String, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :total, Integer, optional: true, nullable: false + field :last_4, String, optional: true, nullable: false + field :card_brand, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :is_offline_payment, Internal::Types::Boolean, optional: true, nullable: false + field :offline_begin_time, String, optional: true, nullable: false + field :offline_end_time, String, optional: true, nullable: false + field :updated_at_begin_time, String, optional: true, nullable: false + field :updated_at_end_time, String, optional: true, nullable: false + field :sort_field, Square::Types::ListPaymentsRequestSortField, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/payments/types/update_payment_request.rb b/lib/square/payments/types/update_payment_request.rb new file mode 100644 index 000000000..d4bb15db1 --- /dev/null +++ b/lib/square/payments/types/update_payment_request.rb @@ -0,0 +1,13 @@ + +module Square + module Payments + module Types + class UpdatePaymentRequest < Internal::Types::Model + field :payment_id, String, optional: false, nullable: false + field :payment, Square::Types::Payment, optional: true, nullable: false + field :idempotency_key, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/payouts/client.rb b/lib/square/payouts/client.rb new file mode 100644 index 000000000..1e57ba6cc --- /dev/null +++ b/lib/square/payouts/client.rb @@ -0,0 +1,57 @@ + +module Square + module Payouts + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Payouts::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::ListPayoutsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListPayoutsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves details of a specific payout identified by a payout ID. + # To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + # + # @return [Square::Types::GetPayoutResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetPayoutResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a list of all payout entries for a specific payout. + # To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + # + # @return [Square::Types::ListPayoutEntriesResponse] + def list_entries(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListPayoutEntriesResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/payouts/types/get_payouts_request.rb b/lib/square/payouts/types/get_payouts_request.rb new file mode 100644 index 000000000..069e8f877 --- /dev/null +++ b/lib/square/payouts/types/get_payouts_request.rb @@ -0,0 +1,11 @@ + +module Square + module Payouts + module Types + class GetPayoutsRequest < Internal::Types::Model + field :payout_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/payouts/types/list_entries_payouts_request.rb b/lib/square/payouts/types/list_entries_payouts_request.rb new file mode 100644 index 000000000..d49521f7d --- /dev/null +++ b/lib/square/payouts/types/list_entries_payouts_request.rb @@ -0,0 +1,14 @@ + +module Square + module Payouts + module Types + class ListEntriesPayoutsRequest < Internal::Types::Model + field :payout_id, String, optional: false, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/payouts/types/list_payouts_request.rb b/lib/square/payouts/types/list_payouts_request.rb new file mode 100644 index 000000000..2f665da28 --- /dev/null +++ b/lib/square/payouts/types/list_payouts_request.rb @@ -0,0 +1,17 @@ + +module Square + module Payouts + module Types + class ListPayoutsRequest < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + field :status, Square::Types::PayoutStatus, optional: true, nullable: false + field :begin_time, String, optional: true, nullable: false + field :end_time, String, optional: true, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/refunds/client.rb b/lib/square/refunds/client.rb new file mode 100644 index 000000000..0a8177c61 --- /dev/null +++ b/lib/square/refunds/client.rb @@ -0,0 +1,61 @@ + +module Square + module Refunds + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Refunds::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::ListPaymentRefundsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListPaymentRefundsResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::RefundPaymentResponse] + def refund_payment(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RefundPaymentResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a specific refund using the `refund_id`. + # + # @return [Square::Types::GetPaymentRefundResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetPaymentRefundResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/refunds/types/get_refunds_request.rb b/lib/square/refunds/types/get_refunds_request.rb new file mode 100644 index 000000000..93d8871c5 --- /dev/null +++ b/lib/square/refunds/types/get_refunds_request.rb @@ -0,0 +1,11 @@ + +module Square + module Refunds + module Types + class GetRefundsRequest < Internal::Types::Model + field :refund_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/refunds/types/list_refunds_request.rb b/lib/square/refunds/types/list_refunds_request.rb new file mode 100644 index 000000000..b7be2bfec --- /dev/null +++ b/lib/square/refunds/types/list_refunds_request.rb @@ -0,0 +1,21 @@ + +module Square + module Refunds + module Types + class ListRefundsRequest < Internal::Types::Model + field :begin_time, String, optional: true, nullable: false + field :end_time, String, optional: true, nullable: false + field :sort_order, String, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :status, String, optional: true, nullable: false + field :source_type, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :updated_at_begin_time, String, optional: true, nullable: false + field :updated_at_end_time, String, optional: true, nullable: false + field :sort_field, Square::Types::ListPaymentRefundsRequestSortField, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/refunds/types/refund_payment_request.rb b/lib/square/refunds/types/refund_payment_request.rb new file mode 100644 index 000000000..6613f5768 --- /dev/null +++ b/lib/square/refunds/types/refund_payment_request.rb @@ -0,0 +1,23 @@ + +module Square + module Refunds + module Types + class RefundPaymentRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :app_fee_money, Square::Types::Money, optional: true, nullable: false + field :payment_id, String, optional: true, nullable: false + field :destination_id, String, optional: true, nullable: false + field :unlinked, Internal::Types::Boolean, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :reason, String, optional: true, nullable: false + field :payment_version_token, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :cash_details, Square::Types::DestinationDetailsCashRefundDetails, optional: true, nullable: false + field :external_details, Square::Types::DestinationDetailsExternalRefundDetails, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/sites/client.rb b/lib/square/sites/client.rb new file mode 100644 index 000000000..ce56cb00a --- /dev/null +++ b/lib/square/sites/client.rb @@ -0,0 +1,30 @@ + +module Square + module Sites + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Sites::Client] + def initialize(client) + @client = client + end + + # 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). + # + # @return [Square::Types::ListSitesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListSitesResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/snippets/client.rb b/lib/square/snippets/client.rb new file mode 100644 index 000000000..95e431c33 --- /dev/null +++ b/lib/square/snippets/client.rb @@ -0,0 +1,69 @@ + +module Square + module Snippets + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Snippets::Client] + def initialize(client) + @client = client + end + + # Retrieves your snippet from a Square Online site. A site can contain snippets from multiple snippet applications, but you can retrieve only the snippet that was added by your application. + # + # You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. + # + # + # __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + # + # @return [Square::Types::GetSnippetResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetSnippetResponse.load(_response.body) + else + raise _response.body + end + end + + # Adds a snippet to a Square Online site or updates the existing snippet on the site. + # The snippet code is appended to the end of the `head` element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site. + # + # You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. + # + # + # __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + # + # @return [Square::Types::UpsertSnippetResponse] + def upsert(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpsertSnippetResponse.load(_response.body) + else + raise _response.body + end + end + + # Removes your snippet from a Square Online site. + # + # You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. + # + # + # __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + # + # @return [Square::Types::DeleteSnippetResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteSnippetResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/snippets/types/delete_snippets_request.rb b/lib/square/snippets/types/delete_snippets_request.rb new file mode 100644 index 000000000..cb44749d4 --- /dev/null +++ b/lib/square/snippets/types/delete_snippets_request.rb @@ -0,0 +1,11 @@ + +module Square + module Snippets + module Types + class DeleteSnippetsRequest < Internal::Types::Model + field :site_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/snippets/types/get_snippets_request.rb b/lib/square/snippets/types/get_snippets_request.rb new file mode 100644 index 000000000..7b1087291 --- /dev/null +++ b/lib/square/snippets/types/get_snippets_request.rb @@ -0,0 +1,11 @@ + +module Square + module Snippets + module Types + class GetSnippetsRequest < Internal::Types::Model + field :site_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/snippets/types/upsert_snippet_request.rb b/lib/square/snippets/types/upsert_snippet_request.rb new file mode 100644 index 000000000..2b46d6cb1 --- /dev/null +++ b/lib/square/snippets/types/upsert_snippet_request.rb @@ -0,0 +1,12 @@ + +module Square + module Snippets + module Types + class UpsertSnippetRequest < Internal::Types::Model + field :site_id, String, optional: false, nullable: false + field :snippet, Square::Types::Snippet, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/client.rb b/lib/square/subscriptions/client.rb new file mode 100644 index 000000000..72f38ccc0 --- /dev/null +++ b/lib/square/subscriptions/client.rb @@ -0,0 +1,196 @@ + +module Square + module Subscriptions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Subscriptions::Client] + def initialize(client) + @client = client + end + + # 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). + # + # @return [Square::Types::CreateSubscriptionResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::BulkSwapPlanResponse] + def bulk_swap_plan(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BulkSwapPlanResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::SearchSubscriptionsResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchSubscriptionsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a specific subscription. + # + # @return [Square::Types::GetSubscriptionResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates a subscription by modifying or clearing `subscription` field values. + # To clear a field, set its value to `null`. + # + # @return [Square::Types::UpdateSubscriptionResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a scheduled action for a subscription. + # + # @return [Square::Types::DeleteSubscriptionActionResponse] + def delete_action(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteSubscriptionActionResponse.load(_response.body) + else + raise _response.body + end + end + + # Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates) + # for a subscription. + # + # @return [Square::Types::ChangeBillingAnchorDateResponse] + def change_billing_anchor_date(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ChangeBillingAnchorDateResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::CancelSubscriptionResponse] + def cancel(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CancelSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + # Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. + # + # @return [Square::Types::ListSubscriptionEventsResponse] + def list_events(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListSubscriptionEventsResponse.load(_response.body) + else + raise _response.body + end + end + + # Schedules a `PAUSE` action to pause an active subscription. + # + # @return [Square::Types::PauseSubscriptionResponse] + def pause(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::PauseSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + # Schedules a `RESUME` action to resume a paused or a deactivated subscription. + # + # @return [Square::Types::ResumeSubscriptionResponse] + def resume(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ResumeSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::SwapPlanResponse] + def swap_plan(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SwapPlanResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/subscriptions/types/bulk_swap_plan_request.rb b/lib/square/subscriptions/types/bulk_swap_plan_request.rb new file mode 100644 index 000000000..5eb5cb0a7 --- /dev/null +++ b/lib/square/subscriptions/types/bulk_swap_plan_request.rb @@ -0,0 +1,13 @@ + +module Square + module Subscriptions + module Types + class BulkSwapPlanRequest < Internal::Types::Model + field :new_plan_variation_id, String, optional: false, nullable: false + field :old_plan_variation_id, String, optional: false, nullable: false + field :location_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/cancel_subscriptions_request.rb b/lib/square/subscriptions/types/cancel_subscriptions_request.rb new file mode 100644 index 000000000..e6070ebcd --- /dev/null +++ b/lib/square/subscriptions/types/cancel_subscriptions_request.rb @@ -0,0 +1,11 @@ + +module Square + module Subscriptions + module Types + class CancelSubscriptionsRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/change_billing_anchor_date_request.rb b/lib/square/subscriptions/types/change_billing_anchor_date_request.rb new file mode 100644 index 000000000..be7f91619 --- /dev/null +++ b/lib/square/subscriptions/types/change_billing_anchor_date_request.rb @@ -0,0 +1,13 @@ + +module Square + module Subscriptions + module Types + class ChangeBillingAnchorDateRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :monthly_billing_anchor_date, Integer, optional: true, nullable: false + field :effective_date, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/create_subscription_request.rb b/lib/square/subscriptions/types/create_subscription_request.rb new file mode 100644 index 000000000..741ad8080 --- /dev/null +++ b/lib/square/subscriptions/types/create_subscription_request.rb @@ -0,0 +1,23 @@ + +module Square + module Subscriptions + module Types + class CreateSubscriptionRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :location_id, String, optional: false, nullable: false + field :plan_variation_id, String, optional: true, nullable: false + field :customer_id, String, optional: false, nullable: false + field :start_date, String, optional: true, nullable: false + field :canceled_date, String, optional: true, nullable: false + field :tax_percentage, String, optional: true, nullable: false + field :price_override_money, Square::Types::Money, optional: true, nullable: false + field :card_id, String, optional: true, nullable: false + field :timezone, String, optional: true, nullable: false + field :source, Square::Types::SubscriptionSource, optional: true, nullable: false + field :monthly_billing_anchor_date, Integer, optional: true, nullable: false + field :phases, Internal::Types::Array[Square::Types::Phase], optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/delete_action_subscriptions_request.rb b/lib/square/subscriptions/types/delete_action_subscriptions_request.rb new file mode 100644 index 000000000..648ac4e00 --- /dev/null +++ b/lib/square/subscriptions/types/delete_action_subscriptions_request.rb @@ -0,0 +1,12 @@ + +module Square + module Subscriptions + module Types + class DeleteActionSubscriptionsRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :action_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/get_subscriptions_request.rb b/lib/square/subscriptions/types/get_subscriptions_request.rb new file mode 100644 index 000000000..e72d524af --- /dev/null +++ b/lib/square/subscriptions/types/get_subscriptions_request.rb @@ -0,0 +1,12 @@ + +module Square + module Subscriptions + module Types + class GetSubscriptionsRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :include, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/list_events_subscriptions_request.rb b/lib/square/subscriptions/types/list_events_subscriptions_request.rb new file mode 100644 index 000000000..7f182a91c --- /dev/null +++ b/lib/square/subscriptions/types/list_events_subscriptions_request.rb @@ -0,0 +1,13 @@ + +module Square + module Subscriptions + module Types + class ListEventsSubscriptionsRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/pause_subscription_request.rb b/lib/square/subscriptions/types/pause_subscription_request.rb new file mode 100644 index 000000000..22704e5b4 --- /dev/null +++ b/lib/square/subscriptions/types/pause_subscription_request.rb @@ -0,0 +1,16 @@ + +module Square + module Subscriptions + module Types + class PauseSubscriptionRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :pause_effective_date, String, optional: true, nullable: false + field :pause_cycle_duration, Integer, optional: true, nullable: false + field :resume_effective_date, String, optional: true, nullable: false + field :resume_change_timing, Square::Types::ChangeTiming, optional: true, nullable: false + field :pause_reason, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/resume_subscription_request.rb b/lib/square/subscriptions/types/resume_subscription_request.rb new file mode 100644 index 000000000..762c29332 --- /dev/null +++ b/lib/square/subscriptions/types/resume_subscription_request.rb @@ -0,0 +1,13 @@ + +module Square + module Subscriptions + module Types + class ResumeSubscriptionRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :resume_effective_date, String, optional: true, nullable: false + field :resume_change_timing, Square::Types::ChangeTiming, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/search_subscriptions_request.rb b/lib/square/subscriptions/types/search_subscriptions_request.rb new file mode 100644 index 000000000..d2a5d0aae --- /dev/null +++ b/lib/square/subscriptions/types/search_subscriptions_request.rb @@ -0,0 +1,14 @@ + +module Square + module Subscriptions + module Types + class SearchSubscriptionsRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :query, Square::Types::SearchSubscriptionsQuery, optional: true, nullable: false + field :include, Internal::Types::Array[String], optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/swap_plan_request.rb b/lib/square/subscriptions/types/swap_plan_request.rb new file mode 100644 index 000000000..526dcb938 --- /dev/null +++ b/lib/square/subscriptions/types/swap_plan_request.rb @@ -0,0 +1,13 @@ + +module Square + module Subscriptions + module Types + class SwapPlanRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :new_plan_variation_id, String, optional: true, nullable: false + field :phases, Internal::Types::Array[Square::Types::PhaseInput], optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/subscriptions/types/update_subscription_request.rb b/lib/square/subscriptions/types/update_subscription_request.rb new file mode 100644 index 000000000..a91a2a6c9 --- /dev/null +++ b/lib/square/subscriptions/types/update_subscription_request.rb @@ -0,0 +1,12 @@ + +module Square + module Subscriptions + module Types + class UpdateSubscriptionRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :subscription, Square::Types::Subscription, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/team/client.rb b/lib/square/team/client.rb new file mode 100644 index 000000000..8c9e76cf1 --- /dev/null +++ b/lib/square/team/client.rb @@ -0,0 +1,69 @@ + +module Square + module Team + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Team::Client] + def initialize(client) + @client = client + end + + # Lists jobs in a seller account. Results are sorted by title in ascending order. + # + # @return [Square::Types::ListJobsResponse] + def list_jobs(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListJobsResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a job in a seller account. A job defines a title and tip eligibility. Note that + # compensation is defined in a [job assignment](entity:JobAssignment) in a team member's wage setting. + # + # @return [Square::Types::CreateJobResponse] + def create_job(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateJobResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a specified job. + # + # @return [Square::Types::RetrieveJobResponse] + def retrieve_job(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::RetrieveJobResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::UpdateJobResponse] + def update_job(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateJobResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/team/types/create_job_request.rb b/lib/square/team/types/create_job_request.rb new file mode 100644 index 000000000..5c25d81df --- /dev/null +++ b/lib/square/team/types/create_job_request.rb @@ -0,0 +1,12 @@ + +module Square + module Team + module Types + class CreateJobRequest < Internal::Types::Model + field :job, Square::Types::Job, optional: false, nullable: false + field :idempotency_key, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/team/types/list_jobs_request.rb b/lib/square/team/types/list_jobs_request.rb new file mode 100644 index 000000000..976fbf47f --- /dev/null +++ b/lib/square/team/types/list_jobs_request.rb @@ -0,0 +1,11 @@ + +module Square + module Team + module Types + class ListJobsRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/team/types/retrieve_job_request.rb b/lib/square/team/types/retrieve_job_request.rb new file mode 100644 index 000000000..a5ca300c8 --- /dev/null +++ b/lib/square/team/types/retrieve_job_request.rb @@ -0,0 +1,11 @@ + +module Square + module Team + module Types + class RetrieveJobRequest < Internal::Types::Model + field :job_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/team/types/update_job_request.rb b/lib/square/team/types/update_job_request.rb new file mode 100644 index 000000000..16c047faf --- /dev/null +++ b/lib/square/team/types/update_job_request.rb @@ -0,0 +1,12 @@ + +module Square + module Team + module Types + class UpdateJobRequest < Internal::Types::Model + field :job_id, String, optional: false, nullable: false + field :job, Square::Types::Job, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/team_members/client.rb b/lib/square/team_members/client.rb new file mode 100644 index 000000000..888058589 --- /dev/null +++ b/lib/square/team_members/client.rb @@ -0,0 +1,113 @@ + +module Square + module TeamMembers + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::TeamMembers::Client] + def initialize(client) + @client = client + end + + # 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). + # + # @return [Square::Types::CreateTeamMemberResponse] + def create(request_options: {}, **params) + _request = Square::Internal::Http::JSONRequest.new( + method: POST, + path: "v2/team-members" + ) + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateTeamMemberResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::BatchCreateTeamMembersResponse] + def batch_create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchCreateTeamMembersResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::BatchUpdateTeamMembersResponse] + def batch_update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchUpdateTeamMembersResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::SearchTeamMembersResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchTeamMembersResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::GetTeamMemberResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetTeamMemberResponse.load(_response.body) + else + raise _response.body + end + end + + # 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). + # + # @return [Square::Types::UpdateTeamMemberResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateTeamMemberResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/team_members/types/batch_create_team_members_request.rb b/lib/square/team_members/types/batch_create_team_members_request.rb new file mode 100644 index 000000000..0f43453b1 --- /dev/null +++ b/lib/square/team_members/types/batch_create_team_members_request.rb @@ -0,0 +1,11 @@ + +module Square + module TeamMembers + module Types + class BatchCreateTeamMembersRequest < Internal::Types::Model + field :team_members, Internal::Types::Hash[String, Square::Types::CreateTeamMemberRequest], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/team_members/types/batch_update_team_members_request.rb b/lib/square/team_members/types/batch_update_team_members_request.rb new file mode 100644 index 000000000..8c5908a63 --- /dev/null +++ b/lib/square/team_members/types/batch_update_team_members_request.rb @@ -0,0 +1,11 @@ + +module Square + module TeamMembers + module Types + class BatchUpdateTeamMembersRequest < Internal::Types::Model + field :team_members, Internal::Types::Hash[String, Square::Types::UpdateTeamMemberRequest], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/team_members/types/get_team_members_request.rb b/lib/square/team_members/types/get_team_members_request.rb new file mode 100644 index 000000000..bd172c303 --- /dev/null +++ b/lib/square/team_members/types/get_team_members_request.rb @@ -0,0 +1,11 @@ + +module Square + module TeamMembers + module Types + class GetTeamMembersRequest < Internal::Types::Model + field :team_member_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/team_members/types/search_team_members_request.rb b/lib/square/team_members/types/search_team_members_request.rb new file mode 100644 index 000000000..803eebbe9 --- /dev/null +++ b/lib/square/team_members/types/search_team_members_request.rb @@ -0,0 +1,13 @@ + +module Square + module TeamMembers + module Types + class SearchTeamMembersRequest < Internal::Types::Model + field :query, Square::Types::SearchTeamMembersQuery, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/team_members/types/update_team_members_request.rb b/lib/square/team_members/types/update_team_members_request.rb new file mode 100644 index 000000000..e4bf1a7d2 --- /dev/null +++ b/lib/square/team_members/types/update_team_members_request.rb @@ -0,0 +1,12 @@ + +module Square + module TeamMembers + module Types + class UpdateTeamMembersRequest < Internal::Types::Model + field :team_member_id, String, optional: false, nullable: false + field :body, Square::Types::UpdateTeamMemberRequest, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/team_members/wage_setting/client.rb b/lib/square/team_members/wage_setting/client.rb new file mode 100644 index 000000000..b4890323a --- /dev/null +++ b/lib/square/team_members/wage_setting/client.rb @@ -0,0 +1,54 @@ + +module Square + module TeamMembers + module WageSetting + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::TeamMembers::WageSetting::Client] + def initialize(client) + @client = client + end + + # Retrieves a `WageSetting` object for a team member specified + # by `TeamMember.id`. For more information, see + # [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting). + # + # Square recommends using [RetrieveTeamMember](api-endpoint:Team-RetrieveTeamMember) or [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) + # to get this information directly from the `TeamMember.wage_setting` field. + # + # @return [Square::Types::GetWageSettingResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetWageSettingResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates or updates a `WageSetting` object. The object is created if a + # `WageSetting` with the specified `team_member_id` doesn't exist. Otherwise, + # it fully replaces the `WageSetting` object for the team member. + # The `WageSetting` is returned on a successful update. For more information, see + # [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting). + # + # Square recommends using [CreateTeamMember](api-endpoint:Team-CreateTeamMember) or [UpdateTeamMember](api-endpoint:Team-UpdateTeamMember) + # to manage the `TeamMember.wage_setting` field directly. + # + # @return [Square::Types::UpdateWageSettingResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateWageSettingResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/team_members/wage_setting/types/get_wage_setting_request.rb b/lib/square/team_members/wage_setting/types/get_wage_setting_request.rb new file mode 100644 index 000000000..28953c9f8 --- /dev/null +++ b/lib/square/team_members/wage_setting/types/get_wage_setting_request.rb @@ -0,0 +1,13 @@ + +module Square + module TeamMembers + module WageSetting + module Types + class GetWageSettingRequest < Internal::Types::Model + field :team_member_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/team_members/wage_setting/types/update_wage_setting_request.rb b/lib/square/team_members/wage_setting/types/update_wage_setting_request.rb new file mode 100644 index 000000000..742519595 --- /dev/null +++ b/lib/square/team_members/wage_setting/types/update_wage_setting_request.rb @@ -0,0 +1,14 @@ + +module Square + module TeamMembers + module WageSetting + module Types + class UpdateWageSettingRequest < Internal::Types::Model + field :team_member_id, String, optional: false, nullable: false + field :wage_setting, Square::Types::WageSetting, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/actions/client.rb b/lib/square/terminal/actions/client.rb new file mode 100644 index 000000000..3b63a8d6a --- /dev/null +++ b/lib/square/terminal/actions/client.rb @@ -0,0 +1,68 @@ + +module Square + module Terminal + module Actions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Terminal::Actions::Client] + def initialize(client) + @client = client + end + + # Creates a Terminal action request and sends it to the specified device. + # + # @return [Square::Types::CreateTerminalActionResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateTerminalActionResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days. + # + # @return [Square::Types::SearchTerminalActionsResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchTerminalActionsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 days. + # + # @return [Square::Types::GetTerminalActionResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetTerminalActionResponse.load(_response.body) + else + raise _response.body + end + end + + # Cancels a Terminal action request if the status of the request permits it. + # + # @return [Square::Types::CancelTerminalActionResponse] + def cancel(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CancelTerminalActionResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/terminal/actions/types/cancel_actions_request.rb b/lib/square/terminal/actions/types/cancel_actions_request.rb new file mode 100644 index 000000000..0455d450d --- /dev/null +++ b/lib/square/terminal/actions/types/cancel_actions_request.rb @@ -0,0 +1,13 @@ + +module Square + module Terminal + module Actions + module Types + class CancelActionsRequest < Internal::Types::Model + field :action_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/actions/types/create_terminal_action_request.rb b/lib/square/terminal/actions/types/create_terminal_action_request.rb new file mode 100644 index 000000000..7aa8b22f4 --- /dev/null +++ b/lib/square/terminal/actions/types/create_terminal_action_request.rb @@ -0,0 +1,14 @@ + +module Square + module Terminal + module Actions + module Types + class CreateTerminalActionRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :action, Square::Types::TerminalAction, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/actions/types/get_actions_request.rb b/lib/square/terminal/actions/types/get_actions_request.rb new file mode 100644 index 000000000..0a83a0675 --- /dev/null +++ b/lib/square/terminal/actions/types/get_actions_request.rb @@ -0,0 +1,13 @@ + +module Square + module Terminal + module Actions + module Types + class GetActionsRequest < Internal::Types::Model + field :action_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/actions/types/search_terminal_actions_request.rb b/lib/square/terminal/actions/types/search_terminal_actions_request.rb new file mode 100644 index 000000000..6623ebae9 --- /dev/null +++ b/lib/square/terminal/actions/types/search_terminal_actions_request.rb @@ -0,0 +1,15 @@ + +module Square + module Terminal + module Actions + module Types + class SearchTerminalActionsRequest < Internal::Types::Model + field :query, Square::Types::TerminalActionQuery, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/checkouts/client.rb b/lib/square/terminal/checkouts/client.rb new file mode 100644 index 000000000..48b69d5d6 --- /dev/null +++ b/lib/square/terminal/checkouts/client.rb @@ -0,0 +1,69 @@ + +module Square + module Terminal + module Checkouts + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Terminal::Checkouts::Client] + def initialize(client) + @client = client + end + + # Creates a Terminal checkout request and sends it to the specified device to take a payment + # for the requested amount. + # + # @return [Square::Types::CreateTerminalCheckoutResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateTerminalCheckoutResponse.load(_response.body) + else + raise _response.body + end + end + + # 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. + # + # @return [Square::Types::SearchTerminalCheckoutsResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchTerminalCheckoutsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days. + # + # @return [Square::Types::GetTerminalCheckoutResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetTerminalCheckoutResponse.load(_response.body) + else + raise _response.body + end + end + + # Cancels a Terminal checkout request if the status of the request permits it. + # + # @return [Square::Types::CancelTerminalCheckoutResponse] + def cancel(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CancelTerminalCheckoutResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/terminal/checkouts/types/cancel_checkouts_request.rb b/lib/square/terminal/checkouts/types/cancel_checkouts_request.rb new file mode 100644 index 000000000..f9dc0b074 --- /dev/null +++ b/lib/square/terminal/checkouts/types/cancel_checkouts_request.rb @@ -0,0 +1,13 @@ + +module Square + module Terminal + module Checkouts + module Types + class CancelCheckoutsRequest < Internal::Types::Model + field :checkout_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/checkouts/types/create_terminal_checkout_request.rb b/lib/square/terminal/checkouts/types/create_terminal_checkout_request.rb new file mode 100644 index 000000000..68fba2f8f --- /dev/null +++ b/lib/square/terminal/checkouts/types/create_terminal_checkout_request.rb @@ -0,0 +1,14 @@ + +module Square + module Terminal + module Checkouts + module Types + class CreateTerminalCheckoutRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :checkout, Square::Types::TerminalCheckout, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/checkouts/types/get_checkouts_request.rb b/lib/square/terminal/checkouts/types/get_checkouts_request.rb new file mode 100644 index 000000000..15e779c3e --- /dev/null +++ b/lib/square/terminal/checkouts/types/get_checkouts_request.rb @@ -0,0 +1,13 @@ + +module Square + module Terminal + module Checkouts + module Types + class GetCheckoutsRequest < Internal::Types::Model + field :checkout_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/checkouts/types/search_terminal_checkouts_request.rb b/lib/square/terminal/checkouts/types/search_terminal_checkouts_request.rb new file mode 100644 index 000000000..4320091de --- /dev/null +++ b/lib/square/terminal/checkouts/types/search_terminal_checkouts_request.rb @@ -0,0 +1,15 @@ + +module Square + module Terminal + module Checkouts + module Types + class SearchTerminalCheckoutsRequest < Internal::Types::Model + field :query, Square::Types::TerminalCheckoutQuery, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/client.rb b/lib/square/terminal/client.rb new file mode 100644 index 000000000..0cebe9b7d --- /dev/null +++ b/lib/square/terminal/client.rb @@ -0,0 +1,55 @@ + +module Square + module Terminal + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Terminal::Client] + def initialize(client) + @client = client + end + + # 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. + # + # @return [Square::Types::DismissTerminalActionResponse] + def dismiss_terminal_action(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DismissTerminalActionResponse.load(_response.body) + else + raise _response.body + end + end + + # Dismisses a Terminal checkout request if the status and type of the request permits it. + # + # @return [Square::Types::DismissTerminalCheckoutResponse] + def dismiss_terminal_checkout(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DismissTerminalCheckoutResponse.load(_response.body) + else + raise _response.body + end + end + + # Dismisses a Terminal refund request if the status and type of the request permits it. + # + # @return [Square::Types::DismissTerminalRefundResponse] + def dismiss_terminal_refund(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DismissTerminalRefundResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/terminal/refunds/client.rb b/lib/square/terminal/refunds/client.rb new file mode 100644 index 000000000..23f784194 --- /dev/null +++ b/lib/square/terminal/refunds/client.rb @@ -0,0 +1,68 @@ + +module Square + module Terminal + module Refunds + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Terminal::Refunds::Client] + def initialize(client) + @client = client + end + + # Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](api:Refunds). + # + # @return [Square::Types::CreateTerminalRefundResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateTerminalRefundResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days. + # + # @return [Square::Types::SearchTerminalRefundsResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchTerminalRefundsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days. + # + # @return [Square::Types::GetTerminalRefundResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetTerminalRefundResponse.load(_response.body) + else + raise _response.body + end + end + + # Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. + # + # @return [Square::Types::CancelTerminalRefundResponse] + def cancel(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CancelTerminalRefundResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/terminal/refunds/types/cancel_refunds_request.rb b/lib/square/terminal/refunds/types/cancel_refunds_request.rb new file mode 100644 index 000000000..da0c66500 --- /dev/null +++ b/lib/square/terminal/refunds/types/cancel_refunds_request.rb @@ -0,0 +1,13 @@ + +module Square + module Terminal + module Refunds + module Types + class CancelRefundsRequest < Internal::Types::Model + field :terminal_refund_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/refunds/types/create_terminal_refund_request.rb b/lib/square/terminal/refunds/types/create_terminal_refund_request.rb new file mode 100644 index 000000000..8c8be5c5b --- /dev/null +++ b/lib/square/terminal/refunds/types/create_terminal_refund_request.rb @@ -0,0 +1,14 @@ + +module Square + module Terminal + module Refunds + module Types + class CreateTerminalRefundRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :refund, Square::Types::TerminalRefund, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/refunds/types/get_refunds_request.rb b/lib/square/terminal/refunds/types/get_refunds_request.rb new file mode 100644 index 000000000..51b783c1c --- /dev/null +++ b/lib/square/terminal/refunds/types/get_refunds_request.rb @@ -0,0 +1,13 @@ + +module Square + module Terminal + module Refunds + module Types + class GetRefundsRequest < Internal::Types::Model + field :terminal_refund_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/refunds/types/search_terminal_refunds_request.rb b/lib/square/terminal/refunds/types/search_terminal_refunds_request.rb new file mode 100644 index 000000000..efbb10df0 --- /dev/null +++ b/lib/square/terminal/refunds/types/search_terminal_refunds_request.rb @@ -0,0 +1,15 @@ + +module Square + module Terminal + module Refunds + module Types + class SearchTerminalRefundsRequest < Internal::Types::Model + field :query, Square::Types::TerminalRefundQuery, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/terminal/types/dismiss_terminal_action_request.rb b/lib/square/terminal/types/dismiss_terminal_action_request.rb new file mode 100644 index 000000000..1b8a96c10 --- /dev/null +++ b/lib/square/terminal/types/dismiss_terminal_action_request.rb @@ -0,0 +1,11 @@ + +module Square + module Terminal + module Types + class DismissTerminalActionRequest < Internal::Types::Model + field :action_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/terminal/types/dismiss_terminal_checkout_request.rb b/lib/square/terminal/types/dismiss_terminal_checkout_request.rb new file mode 100644 index 000000000..efd5e9a59 --- /dev/null +++ b/lib/square/terminal/types/dismiss_terminal_checkout_request.rb @@ -0,0 +1,11 @@ + +module Square + module Terminal + module Types + class DismissTerminalCheckoutRequest < Internal::Types::Model + field :checkout_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/terminal/types/dismiss_terminal_refund_request.rb b/lib/square/terminal/types/dismiss_terminal_refund_request.rb new file mode 100644 index 000000000..a3b5ea430 --- /dev/null +++ b/lib/square/terminal/types/dismiss_terminal_refund_request.rb @@ -0,0 +1,11 @@ + +module Square + module Terminal + module Types + class DismissTerminalRefundRequest < Internal::Types::Model + field :terminal_refund_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/types/accept_dispute_response.rb b/lib/square/types/accept_dispute_response.rb new file mode 100644 index 000000000..9a4d3e582 --- /dev/null +++ b/lib/square/types/accept_dispute_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields in an `AcceptDispute` response. + class AcceptDisputeResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :dispute, Square::Types::Dispute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/accepted_payment_methods.rb b/lib/square/types/accepted_payment_methods.rb new file mode 100644 index 000000000..0d9fbc14b --- /dev/null +++ b/lib/square/types/accepted_payment_methods.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class AcceptedPaymentMethods < Internal::Types::Model + field :apple_pay, Internal::Types::Boolean, optional: true, nullable: false + field :google_pay, Internal::Types::Boolean, optional: true, nullable: false + field :cash_app_pay, Internal::Types::Boolean, optional: true, nullable: false + field :afterpay_clearpay, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/accumulate_loyalty_points_response.rb b/lib/square/types/accumulate_loyalty_points_response.rb new file mode 100644 index 000000000..597d67b39 --- /dev/null +++ b/lib/square/types/accumulate_loyalty_points_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) response. + class AccumulateLoyaltyPointsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :event, Square::Types::LoyaltyEvent, optional: true, nullable: false + field :events, Internal::Types::Array[Square::Types::LoyaltyEvent], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/ach_details.rb b/lib/square/types/ach_details.rb new file mode 100644 index 000000000..cb5ace648 --- /dev/null +++ b/lib/square/types/ach_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. + class AchDetails < Internal::Types::Model + field :routing_number, String, optional: true, nullable: false + field :account_number_suffix, String, optional: true, nullable: false + field :account_type, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/action_cancel_reason.rb b/lib/square/types/action_cancel_reason.rb new file mode 100644 index 000000000..39f0eee06 --- /dev/null +++ b/lib/square/types/action_cancel_reason.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module ActionCancelReason + extend Square::Internal::Types::Enum + BUYER_CANCELED = "BUYER_CANCELED" + SELLER_CANCELED = "SELLER_CANCELED" + TIMED_OUT = "TIMED_OUT"end + end +end diff --git a/lib/square/types/activity_type.rb b/lib/square/types/activity_type.rb new file mode 100644 index 000000000..50c3d464c --- /dev/null +++ b/lib/square/types/activity_type.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Square + module Types + module ActivityType + extend Square::Internal::Types::Enum + ADJUSTMENT = "ADJUSTMENT" + APP_FEE_REFUND = "APP_FEE_REFUND" + APP_FEE_REVENUE = "APP_FEE_REVENUE" + AUTOMATIC_SAVINGS = "AUTOMATIC_SAVINGS" + AUTOMATIC_SAVINGS_REVERSED = "AUTOMATIC_SAVINGS_REVERSED" + CHARGE = "CHARGE" + DEPOSIT_FEE = "DEPOSIT_FEE" + DEPOSIT_FEE_REVERSED = "DEPOSIT_FEE_REVERSED" + DISPUTE = "DISPUTE" + ESCHEATMENT = "ESCHEATMENT" + FEE = "FEE" + FREE_PROCESSING = "FREE_PROCESSING" + HOLD_ADJUSTMENT = "HOLD_ADJUSTMENT" + INITIAL_BALANCE_CHANGE = "INITIAL_BALANCE_CHANGE" + MONEY_TRANSFER = "MONEY_TRANSFER" + MONEY_TRANSFER_REVERSAL = "MONEY_TRANSFER_REVERSAL" + OPEN_DISPUTE = "OPEN_DISPUTE" + OTHER = "OTHER" + OTHER_ADJUSTMENT = "OTHER_ADJUSTMENT" + PAID_SERVICE_FEE = "PAID_SERVICE_FEE" + PAID_SERVICE_FEE_REFUND = "PAID_SERVICE_FEE_REFUND" + REDEMPTION_CODE = "REDEMPTION_CODE" + REFUND = "REFUND" + RELEASE_ADJUSTMENT = "RELEASE_ADJUSTMENT" + RESERVE_HOLD = "RESERVE_HOLD" + RESERVE_RELEASE = "RESERVE_RELEASE" + RETURNED_PAYOUT = "RETURNED_PAYOUT" + SQUARE_CAPITAL_PAYMENT = "SQUARE_CAPITAL_PAYMENT" + SQUARE_CAPITAL_REVERSED_PAYMENT = "SQUARE_CAPITAL_REVERSED_PAYMENT" + SUBSCRIPTION_FEE = "SUBSCRIPTION_FEE" + SUBSCRIPTION_FEE_PAID_REFUND = "SUBSCRIPTION_FEE_PAID_REFUND" + SUBSCRIPTION_FEE_REFUND = "SUBSCRIPTION_FEE_REFUND" + TAX_ON_FEE = "TAX_ON_FEE" + THIRD_PARTY_FEE = "THIRD_PARTY_FEE" + THIRD_PARTY_FEE_REFUND = "THIRD_PARTY_FEE_REFUND" + PAYOUT = "PAYOUT" + AUTOMATIC_BITCOIN_CONVERSIONS = "AUTOMATIC_BITCOIN_CONVERSIONS" + AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED = "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED" + CREDIT_CARD_REPAYMENT = "CREDIT_CARD_REPAYMENT" + CREDIT_CARD_REPAYMENT_REVERSED = "CREDIT_CARD_REPAYMENT_REVERSED" + LOCAL_OFFERS_CASHBACK = "LOCAL_OFFERS_CASHBACK" + LOCAL_OFFERS_FEE = "LOCAL_OFFERS_FEE" + PERCENTAGE_PROCESSING_ENROLLMENT = "PERCENTAGE_PROCESSING_ENROLLMENT" + PERCENTAGE_PROCESSING_DEACTIVATION = "PERCENTAGE_PROCESSING_DEACTIVATION" + PERCENTAGE_PROCESSING_REPAYMENT = "PERCENTAGE_PROCESSING_REPAYMENT" + PERCENTAGE_PROCESSING_REPAYMENT_REVERSED = "PERCENTAGE_PROCESSING_REPAYMENT_REVERSED" + PROCESSING_FEE = "PROCESSING_FEE" + PROCESSING_FEE_REFUND = "PROCESSING_FEE_REFUND" + UNDO_PROCESSING_FEE_REFUND = "UNDO_PROCESSING_FEE_REFUND" + GIFT_CARD_LOAD_FEE = "GIFT_CARD_LOAD_FEE" + GIFT_CARD_LOAD_FEE_REFUND = "GIFT_CARD_LOAD_FEE_REFUND" + UNDO_GIFT_CARD_LOAD_FEE_REFUND = "UNDO_GIFT_CARD_LOAD_FEE_REFUND" + BALANCE_FOLDERS_TRANSFER = "BALANCE_FOLDERS_TRANSFER" + BALANCE_FOLDERS_TRANSFER_REVERSED = "BALANCE_FOLDERS_TRANSFER_REVERSED" + GIFT_CARD_POOL_TRANSFER = "GIFT_CARD_POOL_TRANSFER" + GIFT_CARD_POOL_TRANSFER_REVERSED = "GIFT_CARD_POOL_TRANSFER_REVERSED" + SQUARE_PAYROLL_TRANSFER = "SQUARE_PAYROLL_TRANSFER" + SQUARE_PAYROLL_TRANSFER_REVERSED = "SQUARE_PAYROLL_TRANSFER_REVERSED"end + end +end diff --git a/lib/square/types/add_group_to_customer_response.rb b/lib/square/types/add_group_to_customer_response.rb new file mode 100644 index 000000000..a1d85088d --- /dev/null +++ b/lib/square/types/add_group_to_customer_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [AddGroupToCustomer](api-endpoint:Customers-AddGroupToCustomer) endpoint. + class AddGroupToCustomerResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/additional_recipient.rb b/lib/square/types/additional_recipient.rb new file mode 100644 index 000000000..92d9631b1 --- /dev/null +++ b/lib/square/types/additional_recipient.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an additional recipient (other than the merchant) receiving a portion of this tender. + class AdditionalRecipient < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :description, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :receivable_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/address.rb b/lib/square/types/address.rb new file mode 100644 index 000000000..b6d3197fc --- /dev/null +++ b/lib/square/types/address.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a postal address in a country. + # For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + class Address < Internal::Types::Model + field :address_line_1, String, optional: true, nullable: false + field :address_line_2, String, optional: true, nullable: false + field :address_line_3, String, optional: true, nullable: false + field :locality, String, optional: true, nullable: false + field :sublocality, String, optional: true, nullable: false + field :sublocality_2, String, optional: true, nullable: false + field :sublocality_3, String, optional: true, nullable: false + field :administrative_district_level_1, String, optional: true, nullable: false + field :administrative_district_level_2, String, optional: true, nullable: false + field :administrative_district_level_3, String, optional: true, nullable: false + field :postal_code, String, optional: true, nullable: false + field :country, Square::Types::Country, optional: true, nullable: false + field :first_name, String, optional: true, nullable: false + field :last_name, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/adjust_loyalty_points_response.rb b/lib/square/types/adjust_loyalty_points_response.rb new file mode 100644 index 000000000..448637527 --- /dev/null +++ b/lib/square/types/adjust_loyalty_points_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request. + class AdjustLoyaltyPointsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :event, Square::Types::LoyaltyEvent, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/afterpay_details.rb b/lib/square/types/afterpay_details.rb new file mode 100644 index 000000000..82a23cba9 --- /dev/null +++ b/lib/square/types/afterpay_details.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Additional details about Afterpay payments. + class AfterpayDetails < Internal::Types::Model + field :email_address, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/application_details.rb b/lib/square/types/application_details.rb new file mode 100644 index 000000000..e23af4b90 --- /dev/null +++ b/lib/square/types/application_details.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Details about the application that took the payment. + class ApplicationDetails < Internal::Types::Model + field :square_product, Square::Types::ApplicationDetailsExternalSquareProduct, optional: true, nullable: false + field :application_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/application_details_external_square_product.rb b/lib/square/types/application_details_external_square_product.rb new file mode 100644 index 000000000..b45b4037f --- /dev/null +++ b/lib/square/types/application_details_external_square_product.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + module ApplicationDetailsExternalSquareProduct + extend Square::Internal::Types::Enum + APPOINTMENTS = "APPOINTMENTS" + ECOMMERCE_API = "ECOMMERCE_API" + INVOICES = "INVOICES" + ONLINE_STORE = "ONLINE_STORE" + OTHER = "OTHER" + RESTAURANTS = "RESTAURANTS" + RETAIL = "RETAIL" + SQUARE_POS = "SQUARE_POS" + TERMINAL_API = "TERMINAL_API" + VIRTUAL_TERMINAL = "VIRTUAL_TERMINAL"end + end +end diff --git a/lib/square/types/appointment_segment.rb b/lib/square/types/appointment_segment.rb new file mode 100644 index 000000000..3433ca912 --- /dev/null +++ b/lib/square/types/appointment_segment.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines an appointment segment of a booking. + class AppointmentSegment < Internal::Types::Model + field :duration_minutes, Integer, optional: true, nullable: false + field :service_variation_id, String, optional: true, nullable: false + field :team_member_id, String, optional: false, nullable: false + field :service_variation_version, Integer, optional: true, nullable: false + field :intermission_minutes, Integer, optional: true, nullable: false + field :any_team_member, Internal::Types::Boolean, optional: true, nullable: false + field :resource_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/archived_state.rb b/lib/square/types/archived_state.rb new file mode 100644 index 000000000..83fb71634 --- /dev/null +++ b/lib/square/types/archived_state.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module ArchivedState + extend Square::Internal::Types::Enum + ARCHIVED_STATE_NOT_ARCHIVED = "ARCHIVED_STATE_NOT_ARCHIVED" + ARCHIVED_STATE_ARCHIVED = "ARCHIVED_STATE_ARCHIVED" + ARCHIVED_STATE_ALL = "ARCHIVED_STATE_ALL"end + end +end diff --git a/lib/square/types/availability.rb b/lib/square/types/availability.rb new file mode 100644 index 000000000..448a69871 --- /dev/null +++ b/lib/square/types/availability.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines an appointment slot that encapsulates the appointment segments, location and starting time available for booking. + class Availability < Internal::Types::Model + field :start_at, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :appointment_segments, Internal::Types::Array[Square::Types::AppointmentSegment], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account.rb b/lib/square/types/bank_account.rb new file mode 100644 index 000000000..ec4db57dc --- /dev/null +++ b/lib/square/types/bank_account.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class BankAccount < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :account_number_suffix, String, optional: false, nullable: false + field :country, Square::Types::Country, optional: false, nullable: false + field :currency, Square::Types::Currency, optional: false, nullable: false + field :account_type, Square::Types::BankAccountType, optional: false, nullable: false + field :holder_name, String, optional: false, nullable: false + field :primary_bank_identification_number, String, optional: false, nullable: false + field :secondary_bank_identification_number, String, optional: true, nullable: false + field :debit_mandate_reference_id, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :status, Square::Types::BankAccountStatus, optional: false, nullable: false + field :creditable, Internal::Types::Boolean, optional: false, nullable: false + field :debitable, Internal::Types::Boolean, optional: false, nullable: false + field :fingerprint, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :bank_name, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account_created_event.rb b/lib/square/types/bank_account_created_event.rb new file mode 100644 index 000000000..8ce14e203 --- /dev/null +++ b/lib/square/types/bank_account_created_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when you link an external bank account to a Square + # account in the Seller Dashboard. Square sets the initial status to + # `VERIFICATION_IN_PROGRESS` and publishes the event. + class BankAccountCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::BankAccountCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account_created_event_data.rb b/lib/square/types/bank_account_created_event_data.rb new file mode 100644 index 000000000..0f86994a0 --- /dev/null +++ b/lib/square/types/bank_account_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BankAccountCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::BankAccountCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account_created_event_object.rb b/lib/square/types/bank_account_created_event_object.rb new file mode 100644 index 000000000..3b93134d1 --- /dev/null +++ b/lib/square/types/bank_account_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class BankAccountCreatedEventObject < Internal::Types::Model + field :bank_account, Square::Types::BankAccount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account_disabled_event.rb b/lib/square/types/bank_account_disabled_event.rb new file mode 100644 index 000000000..a7e78ece0 --- /dev/null +++ b/lib/square/types/bank_account_disabled_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when Square sets the status of a + # [BankAccount](entity:BankAccount) to `DISABLED`. + class BankAccountDisabledEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::BankAccountDisabledEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account_disabled_event_data.rb b/lib/square/types/bank_account_disabled_event_data.rb new file mode 100644 index 000000000..328999fb1 --- /dev/null +++ b/lib/square/types/bank_account_disabled_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BankAccountDisabledEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::BankAccountDisabledEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account_disabled_event_object.rb b/lib/square/types/bank_account_disabled_event_object.rb new file mode 100644 index 000000000..9b80a2c8d --- /dev/null +++ b/lib/square/types/bank_account_disabled_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class BankAccountDisabledEventObject < Internal::Types::Model + field :bank_account, Square::Types::BankAccount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account_payment_details.rb b/lib/square/types/bank_account_payment_details.rb new file mode 100644 index 000000000..65c8da17c --- /dev/null +++ b/lib/square/types/bank_account_payment_details.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Additional details about BANK_ACCOUNT type payments. + class BankAccountPaymentDetails < Internal::Types::Model + field :bank_name, String, optional: true, nullable: false + field :transfer_type, String, optional: true, nullable: false + field :account_ownership_type, String, optional: true, nullable: false + field :fingerprint, String, optional: true, nullable: false + field :country, String, optional: true, nullable: false + field :statement_description, String, optional: true, nullable: false + field :ach_details, Square::Types::AchDetails, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account_status.rb b/lib/square/types/bank_account_status.rb new file mode 100644 index 000000000..4d3193409 --- /dev/null +++ b/lib/square/types/bank_account_status.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module BankAccountStatus + extend Square::Internal::Types::Enum + VERIFICATION_IN_PROGRESS = "VERIFICATION_IN_PROGRESS" + VERIFIED = "VERIFIED" + DISABLED = "DISABLED"end + end +end diff --git a/lib/square/types/bank_account_type.rb b/lib/square/types/bank_account_type.rb new file mode 100644 index 000000000..9abd564d9 --- /dev/null +++ b/lib/square/types/bank_account_type.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + module BankAccountType + extend Square::Internal::Types::Enum + CHECKING = "CHECKING" + SAVINGS = "SAVINGS" + INVESTMENT = "INVESTMENT" + OTHER = "OTHER" + BUSINESS_CHECKING = "BUSINESS_CHECKING"end + end +end diff --git a/lib/square/types/bank_account_verified_event.rb b/lib/square/types/bank_account_verified_event.rb new file mode 100644 index 000000000..07684fc14 --- /dev/null +++ b/lib/square/types/bank_account_verified_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when Square sets the status of a + # [BankAccount](entity:BankAccount) to `VERIFIED`. + class BankAccountVerifiedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::BankAccountVerifiedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account_verified_event_data.rb b/lib/square/types/bank_account_verified_event_data.rb new file mode 100644 index 000000000..2e9e24c9e --- /dev/null +++ b/lib/square/types/bank_account_verified_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BankAccountVerifiedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::BankAccountVerifiedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bank_account_verified_event_object.rb b/lib/square/types/bank_account_verified_event_object.rb new file mode 100644 index 000000000..c17c4a56a --- /dev/null +++ b/lib/square/types/bank_account_verified_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class BankAccountVerifiedEventObject < Internal::Types::Model + field :bank_account, Square::Types::BankAccount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_change_inventory_request.rb b/lib/square/types/batch_change_inventory_request.rb new file mode 100644 index 000000000..7f512f629 --- /dev/null +++ b/lib/square/types/batch_change_inventory_request.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BatchChangeInventoryRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :changes, Internal::Types::Array[Square::Types::InventoryChange], optional: true, nullable: false + field :ignore_unchanged_counts, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_change_inventory_response.rb b/lib/square/types/batch_change_inventory_response.rb new file mode 100644 index 000000000..d7c7d2a34 --- /dev/null +++ b/lib/square/types/batch_change_inventory_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BatchChangeInventoryResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :counts, Internal::Types::Array[Square::Types::InventoryCount], optional: true, nullable: false + field :changes, Internal::Types::Array[Square::Types::InventoryChange], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_create_team_members_response.rb b/lib/square/types/batch_create_team_members_response.rb new file mode 100644 index 000000000..737d28d05 --- /dev/null +++ b/lib/square/types/batch_create_team_members_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from a bulk create request containing the created `TeamMember` objects or error messages. + class BatchCreateTeamMembersResponse < Internal::Types::Model + field :team_members, Internal::Types::Hash[String, Square::Types::CreateTeamMemberResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_create_vendors_response.rb b/lib/square/types/batch_create_vendors_response.rb new file mode 100644 index 000000000..463910b46 --- /dev/null +++ b/lib/square/types/batch_create_vendors_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an output from a call to [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors). + class BatchCreateVendorsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :responses, Internal::Types::Hash[String, Square::Types::CreateVendorResponse], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_delete_catalog_objects_response.rb b/lib/square/types/batch_delete_catalog_objects_response.rb new file mode 100644 index 000000000..825ce067b --- /dev/null +++ b/lib/square/types/batch_delete_catalog_objects_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BatchDeleteCatalogObjectsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :deleted_object_ids, Internal::Types::Array[String], optional: true, nullable: false + field :deleted_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_get_catalog_objects_response.rb b/lib/square/types/batch_get_catalog_objects_response.rb new file mode 100644 index 000000000..dd20df655 --- /dev/null +++ b/lib/square/types/batch_get_catalog_objects_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BatchGetCatalogObjectsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :objects, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + field :related_objects, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_get_inventory_changes_response.rb b/lib/square/types/batch_get_inventory_changes_response.rb new file mode 100644 index 000000000..62f143de6 --- /dev/null +++ b/lib/square/types/batch_get_inventory_changes_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BatchGetInventoryChangesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :changes, Internal::Types::Array[Square::Types::InventoryChange], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_get_inventory_counts_request.rb b/lib/square/types/batch_get_inventory_counts_request.rb new file mode 100644 index 000000000..e26dad172 --- /dev/null +++ b/lib/square/types/batch_get_inventory_counts_request.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + class BatchGetInventoryCountsRequest < Internal::Types::Model + field :catalog_object_ids, Internal::Types::Array[String], optional: true, nullable: false + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :updated_after, String, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :states, Internal::Types::Array[Square::Types::InventoryState], optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_get_inventory_counts_response.rb b/lib/square/types/batch_get_inventory_counts_response.rb new file mode 100644 index 000000000..f0e87689c --- /dev/null +++ b/lib/square/types/batch_get_inventory_counts_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BatchGetInventoryCountsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :counts, Internal::Types::Array[Square::Types::InventoryCount], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_get_orders_response.rb b/lib/square/types/batch_get_orders_response.rb new file mode 100644 index 000000000..d64587024 --- /dev/null +++ b/lib/square/types/batch_get_orders_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the `BatchRetrieveOrders` endpoint. + class BatchGetOrdersResponse < Internal::Types::Model + field :orders, Internal::Types::Array[Square::Types::Order], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_get_vendors_response.rb b/lib/square/types/batch_get_vendors_response.rb new file mode 100644 index 000000000..39037daa7 --- /dev/null +++ b/lib/square/types/batch_get_vendors_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an output from a call to [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors). + class BatchGetVendorsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :responses, Internal::Types::Hash[String, Square::Types::GetVendorResponse], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_retrieve_inventory_changes_request.rb b/lib/square/types/batch_retrieve_inventory_changes_request.rb new file mode 100644 index 000000000..606653f18 --- /dev/null +++ b/lib/square/types/batch_retrieve_inventory_changes_request.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + class BatchRetrieveInventoryChangesRequest < Internal::Types::Model + field :catalog_object_ids, Internal::Types::Array[String], optional: true, nullable: false + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :types, Internal::Types::Array[Square::Types::InventoryChangeType], optional: true, nullable: false + field :states, Internal::Types::Array[Square::Types::InventoryState], optional: true, nullable: false + field :updated_after, String, optional: true, nullable: false + field :updated_before, String, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_update_team_members_response.rb b/lib/square/types/batch_update_team_members_response.rb new file mode 100644 index 000000000..821ca19db --- /dev/null +++ b/lib/square/types/batch_update_team_members_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from a bulk update request containing the updated `TeamMember` objects or error messages. + class BatchUpdateTeamMembersResponse < Internal::Types::Model + field :team_members, Internal::Types::Hash[String, Square::Types::UpdateTeamMemberResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_update_vendors_response.rb b/lib/square/types/batch_update_vendors_response.rb new file mode 100644 index 000000000..9913587fd --- /dev/null +++ b/lib/square/types/batch_update_vendors_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an output from a call to [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors). + class BatchUpdateVendorsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :responses, Internal::Types::Hash[String, Square::Types::UpdateVendorResponse], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_upsert_catalog_objects_response.rb b/lib/square/types/batch_upsert_catalog_objects_response.rb new file mode 100644 index 000000000..0bc83583b --- /dev/null +++ b/lib/square/types/batch_upsert_catalog_objects_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class BatchUpsertCatalogObjectsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :objects, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :id_mappings, Internal::Types::Array[Square::Types::CatalogIdMapping], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.rb b/lib/square/types/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.rb new file mode 100644 index 000000000..59184daf0 --- /dev/null +++ b/lib/square/types/batch_upsert_customer_custom_attributes_request_customer_custom_attribute_upsert_request.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + # request. An individual request contains a customer ID, the custom attribute to create or update, + # and an optional idempotency key. + class BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_upsert_customer_custom_attributes_response.rb b/lib/square/types/batch_upsert_customer_custom_attributes_response.rb new file mode 100644 index 000000000..d35fc82c1 --- /dev/null +++ b/lib/square/types/batch_upsert_customer_custom_attributes_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) response, + # which contains a map of responses that each corresponds to an individual upsert request. + class BatchUpsertCustomerCustomAttributesResponse < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.rb b/lib/square/types/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.rb new file mode 100644 index 000000000..483914d0a --- /dev/null +++ b/lib/square/types/batch_upsert_customer_custom_attributes_response_customer_custom_attribute_upsert_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response for an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) operation. + class BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse < Internal::Types::Model + field :customer_id, String, optional: true, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking.rb b/lib/square/types/booking.rb new file mode 100644 index 000000000..02819aa31 --- /dev/null +++ b/lib/square/types/booking.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class Booking < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :status, Square::Types::BookingStatus, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :start_at, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :customer_note, String, optional: true, nullable: false + field :seller_note, String, optional: true, nullable: false + field :appointment_segments, Internal::Types::Array[Square::Types::AppointmentSegment], optional: true, nullable: false + field :transition_time_minutes, Integer, optional: true, nullable: false + field :all_day, Internal::Types::Boolean, optional: true, nullable: false + field :location_type, Square::Types::BusinessAppointmentSettingsBookingLocationType, optional: true, nullable: false + field :creator_details, Square::Types::BookingCreatorDetails, optional: true, nullable: false + field :source, Square::Types::BookingBookingSource, optional: true, nullable: false + field :address, Square::Types::Address, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_booking_source.rb b/lib/square/types/booking_booking_source.rb new file mode 100644 index 000000000..31c34e988 --- /dev/null +++ b/lib/square/types/booking_booking_source.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module BookingBookingSource + extend Square::Internal::Types::Enum + FIRST_PARTY_MERCHANT = "FIRST_PARTY_MERCHANT" + FIRST_PARTY_BUYER = "FIRST_PARTY_BUYER" + THIRD_PARTY_BUYER = "THIRD_PARTY_BUYER" + API = "API"end + end +end diff --git a/lib/square/types/booking_created_event.rb b/lib/square/types/booking_created_event.rb new file mode 100644 index 000000000..cc1d3e03a --- /dev/null +++ b/lib/square/types/booking_created_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking is created. + # + # To receive this event with buyer-level permissions, you must have `APPOINTMENTS_READ` set for the OAuth scope. + # To receive this event with seller-level permissions, you must have `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope. + class BookingCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::BookingCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_created_event_data.rb b/lib/square/types/booking_created_event_data.rb new file mode 100644 index 000000000..9ea94e07b --- /dev/null +++ b/lib/square/types/booking_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BookingCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::BookingCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_created_event_object.rb b/lib/square/types/booking_created_event_object.rb new file mode 100644 index 000000000..476a2ac27 --- /dev/null +++ b/lib/square/types/booking_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class BookingCreatedEventObject < Internal::Types::Model + field :booking, Square::Types::Booking, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_creator_details.rb b/lib/square/types/booking_creator_details.rb new file mode 100644 index 000000000..3138695ee --- /dev/null +++ b/lib/square/types/booking_creator_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Information about a booking creator. + class BookingCreatorDetails < Internal::Types::Model + field :creator_type, Square::Types::BookingCreatorDetailsCreatorType, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_creator_details_creator_type.rb b/lib/square/types/booking_creator_details_creator_type.rb new file mode 100644 index 000000000..aa14bab51 --- /dev/null +++ b/lib/square/types/booking_creator_details_creator_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module BookingCreatorDetailsCreatorType + extend Square::Internal::Types::Enum + TEAM_MEMBER = "TEAM_MEMBER" + CUSTOMER = "CUSTOMER"end + end +end diff --git a/lib/square/types/booking_custom_attribute_definition_owned_created_event.rb b/lib/square/types/booking_custom_attribute_definition_owned_created_event.rb new file mode 100644 index 000000000..8ff2f7fac --- /dev/null +++ b/lib/square/types/booking_custom_attribute_definition_owned_created_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) + # is created by the subscribing application. Subscribe to this event to be notified + # when your application creates a booking custom attribute definition. + class BookingCustomAttributeDefinitionOwnedCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_definition_owned_deleted_event.rb b/lib/square/types/booking_custom_attribute_definition_owned_deleted_event.rb new file mode 100644 index 000000000..3c2da1a11 --- /dev/null +++ b/lib/square/types/booking_custom_attribute_definition_owned_deleted_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) + # is deleted by the subscribing application. Subscribe to this event to be notified + # when your application deletes a booking custom attribute definition. + class BookingCustomAttributeDefinitionOwnedDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_definition_owned_updated_event.rb b/lib/square/types/booking_custom_attribute_definition_owned_updated_event.rb new file mode 100644 index 000000000..72230d283 --- /dev/null +++ b/lib/square/types/booking_custom_attribute_definition_owned_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) + # is updated by the subscribing application. Subscribe to this event to be notified + # when your application updates a booking custom attribute definition. + class BookingCustomAttributeDefinitionOwnedUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_definition_visible_created_event.rb b/lib/square/types/booking_custom_attribute_definition_visible_created_event.rb new file mode 100644 index 000000000..5450ed554 --- /dev/null +++ b/lib/square/types/booking_custom_attribute_definition_visible_created_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) + # with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is created. + # An application that subscribes to this event is notified when a booking custom attribute definition is created + # by any application for which the subscribing application has read access to the booking custom attribute definition. + class BookingCustomAttributeDefinitionVisibleCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_definition_visible_deleted_event.rb b/lib/square/types/booking_custom_attribute_definition_visible_deleted_event.rb new file mode 100644 index 000000000..0a509ee65 --- /dev/null +++ b/lib/square/types/booking_custom_attribute_definition_visible_deleted_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) + # with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted. + # An application that subscribes to this event is notified when a booking custom attribute definition is deleted + # by any application for which the subscribing application has read access to the booking custom attribute definition. + class BookingCustomAttributeDefinitionVisibleDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_definition_visible_updated_event.rb b/lib/square/types/booking_custom_attribute_definition_visible_updated_event.rb new file mode 100644 index 000000000..d081000b8 --- /dev/null +++ b/lib/square/types/booking_custom_attribute_definition_visible_updated_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) + # with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated. + # An application that subscribes to this event is notified when a booking custom attribute definition is updated + # by any application for which the subscribing application has read access to the booking custom attribute definition. + class BookingCustomAttributeDefinitionVisibleUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_delete_request.rb b/lib/square/types/booking_custom_attribute_delete_request.rb new file mode 100644 index 000000000..9cb714070 --- /dev/null +++ b/lib/square/types/booking_custom_attribute_delete_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an individual delete request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) + # request. An individual request contains a booking ID, the custom attribute to delete, and an optional idempotency key. + class BookingCustomAttributeDeleteRequest < Internal::Types::Model + field :booking_id, String, optional: false, nullable: false + field :key, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_delete_response.rb b/lib/square/types/booking_custom_attribute_delete_response.rb new file mode 100644 index 000000000..fbf3e0a90 --- /dev/null +++ b/lib/square/types/booking_custom_attribute_delete_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response for an individual upsert request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) operation. + class BookingCustomAttributeDeleteResponse < Internal::Types::Model + field :booking_id, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_owned_deleted_event.rb b/lib/square/types/booking_custom_attribute_owned_deleted_event.rb new file mode 100644 index 000000000..135fa9a9f --- /dev/null +++ b/lib/square/types/booking_custom_attribute_owned_deleted_event.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking [custom attribute](entity:CustomAttribute) + # associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is + # owned by the subscribing application is deleted. + # Subscribe to this event to be notified + # when your application deletes a booking custom attribute. + class BookingCustomAttributeOwnedDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_owned_updated_event.rb b/lib/square/types/booking_custom_attribute_owned_updated_event.rb new file mode 100644 index 000000000..68766abdc --- /dev/null +++ b/lib/square/types/booking_custom_attribute_owned_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking [custom attribute](entity:CustomAttribute) + # is updated by the subscribing application. Subscribe to this event to be notified + # when your application updates a booking custom attribute. + class BookingCustomAttributeOwnedUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_upsert_request.rb b/lib/square/types/booking_custom_attribute_upsert_request.rb new file mode 100644 index 000000000..5cd652ce3 --- /dev/null +++ b/lib/square/types/booking_custom_attribute_upsert_request.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) + # request. An individual request contains a booking ID, the custom attribute to create or update, + # and an optional idempotency key. + class BookingCustomAttributeUpsertRequest < Internal::Types::Model + field :booking_id, String, optional: false, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_upsert_response.rb b/lib/square/types/booking_custom_attribute_upsert_response.rb new file mode 100644 index 000000000..10cb7e473 --- /dev/null +++ b/lib/square/types/booking_custom_attribute_upsert_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response for an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) operation. + class BookingCustomAttributeUpsertResponse < Internal::Types::Model + field :booking_id, String, optional: true, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_visible_deleted_event.rb b/lib/square/types/booking_custom_attribute_visible_deleted_event.rb new file mode 100644 index 000000000..106ae79fb --- /dev/null +++ b/lib/square/types/booking_custom_attribute_visible_deleted_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking [custom attribute](entity:CustomAttribute) with + # the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted. + # An application that subscribes to this event is notified when a booking custom attribute is deleted + # by any application for which the subscribing application has read access to the booking custom attribute. + class BookingCustomAttributeVisibleDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_custom_attribute_visible_updated_event.rb b/lib/square/types/booking_custom_attribute_visible_updated_event.rb new file mode 100644 index 000000000..23a70f3f9 --- /dev/null +++ b/lib/square/types/booking_custom_attribute_visible_updated_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking [custom attribute](entity:CustomAttribute) + # with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated. + # An application that subscribes to this event is notified when a booking custom attribute is updated + # by any application for which the subscribing application has read access to the booking custom attribute. + class BookingCustomAttributeVisibleUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_status.rb b/lib/square/types/booking_status.rb new file mode 100644 index 000000000..d2430884c --- /dev/null +++ b/lib/square/types/booking_status.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + module BookingStatus + extend Square::Internal::Types::Enum + PENDING = "PENDING" + CANCELLED_BY_CUSTOMER = "CANCELLED_BY_CUSTOMER" + CANCELLED_BY_SELLER = "CANCELLED_BY_SELLER" + DECLINED = "DECLINED" + ACCEPTED = "ACCEPTED" + NO_SHOW = "NO_SHOW"end + end +end diff --git a/lib/square/types/booking_updated_event.rb b/lib/square/types/booking_updated_event.rb new file mode 100644 index 000000000..c537762ff --- /dev/null +++ b/lib/square/types/booking_updated_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a booking is updated or cancelled. + # + # To receive this event with buyer-level permissions, you must have `APPOINTMENTS_READ` set for the OAuth scope. + # To receive this event with seller-level permissions, you must have `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope. + class BookingUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::BookingUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_updated_event_data.rb b/lib/square/types/booking_updated_event_data.rb new file mode 100644 index 000000000..ccf60b9c5 --- /dev/null +++ b/lib/square/types/booking_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class BookingUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::BookingUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/booking_updated_event_object.rb b/lib/square/types/booking_updated_event_object.rb new file mode 100644 index 000000000..1bc080150 --- /dev/null +++ b/lib/square/types/booking_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class BookingUpdatedEventObject < Internal::Types::Model + field :booking, Square::Types::Booking, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/break_.rb b/lib/square/types/break_.rb new file mode 100644 index 000000000..9d14501de --- /dev/null +++ b/lib/square/types/break_.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # A record of a team member's break on a [timecard](entity:Timecard). + class Break < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :start_at, String, optional: false, nullable: false + field :end_at, String, optional: true, nullable: false + field :break_type_id, String, optional: false, nullable: false + field :name, String, optional: false, nullable: false + field :expected_duration, String, optional: false, nullable: false + field :is_paid, Internal::Types::Boolean, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/break_type.rb b/lib/square/types/break_type.rb new file mode 100644 index 000000000..1a74498b9 --- /dev/null +++ b/lib/square/types/break_type.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # A template for a type of [break](entity:Break) that can be added to a + # [timecard](entity:Timecard), including the expected duration and paid status. + class BreakType < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :location_id, String, optional: false, nullable: false + field :break_name, String, optional: false, nullable: false + field :expected_duration, String, optional: false, nullable: false + field :is_paid, Internal::Types::Boolean, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_create_customer_data.rb b/lib/square/types/bulk_create_customer_data.rb new file mode 100644 index 000000000..44518258b --- /dev/null +++ b/lib/square/types/bulk_create_customer_data.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the customer data provided in individual create requests for a + # [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) operation. + class BulkCreateCustomerData < Internal::Types::Model + field :given_name, String, optional: true, nullable: false + field :family_name, String, optional: true, nullable: false + field :company_name, String, optional: true, nullable: false + field :nickname, String, optional: true, nullable: false + field :email_address, String, optional: true, nullable: false + field :address, Square::Types::Address, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :birthday, String, optional: true, nullable: false + field :tax_ids, Square::Types::CustomerTaxIds, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_create_customers_response.rb b/lib/square/types/bulk_create_customers_response.rb new file mode 100644 index 000000000..5cef1298d --- /dev/null +++ b/lib/square/types/bulk_create_customers_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields included in the response body from the + # [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint. + class BulkCreateCustomersResponse < Internal::Types::Model + field :responses, Internal::Types::Hash[String, Square::Types::CreateCustomerResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_delete_booking_custom_attributes_response.rb b/lib/square/types/bulk_delete_booking_custom_attributes_response.rb new file mode 100644 index 000000000..af8609b89 --- /dev/null +++ b/lib/square/types/bulk_delete_booking_custom_attributes_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) response, + # which contains a map of responses that each corresponds to an individual delete request. + class BulkDeleteBookingCustomAttributesResponse < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BookingCustomAttributeDeleteResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_delete_customers_response.rb b/lib/square/types/bulk_delete_customers_response.rb new file mode 100644 index 000000000..b733cc3df --- /dev/null +++ b/lib/square/types/bulk_delete_customers_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields included in the response body from the + # [BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint. + class BulkDeleteCustomersResponse < Internal::Types::Model + field :responses, Internal::Types::Hash[String, Square::Types::DeleteCustomerResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.rb b/lib/square/types/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.rb new file mode 100644 index 000000000..0f313b015 --- /dev/null +++ b/lib/square/types/bulk_delete_location_custom_attributes_request_location_custom_attribute_delete_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an individual delete request in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) + # request. An individual request contains an optional ID of the associated custom attribute definition + # and optional key of the associated custom attribute definition. + class BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest < Internal::Types::Model + field :key, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_delete_location_custom_attributes_response.rb b/lib/square/types/bulk_delete_location_custom_attributes_response.rb new file mode 100644 index 000000000..ae0fb1217 --- /dev/null +++ b/lib/square/types/bulk_delete_location_custom_attributes_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) response, + # which contains a map of responses that each corresponds to an individual delete request. + class BulkDeleteLocationCustomAttributesResponse < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse], optional: false, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.rb b/lib/square/types/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.rb new file mode 100644 index 000000000..17c200b8c --- /dev/null +++ b/lib/square/types/bulk_delete_location_custom_attributes_response_location_custom_attribute_delete_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an individual delete response in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) + # request. + class BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.rb b/lib/square/types/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.rb new file mode 100644 index 000000000..8d3dba6e9 --- /dev/null +++ b/lib/square/types/bulk_delete_merchant_custom_attributes_request_merchant_custom_attribute_delete_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an individual delete request in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) + # request. An individual request contains an optional ID of the associated custom attribute definition + # and optional key of the associated custom attribute definition. + class BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest < Internal::Types::Model + field :key, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_delete_merchant_custom_attributes_response.rb b/lib/square/types/bulk_delete_merchant_custom_attributes_response.rb new file mode 100644 index 000000000..5251ac398 --- /dev/null +++ b/lib/square/types/bulk_delete_merchant_custom_attributes_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) response, + # which contains a map of responses that each corresponds to an individual delete request. + class BulkDeleteMerchantCustomAttributesResponse < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse], optional: false, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.rb b/lib/square/types/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.rb new file mode 100644 index 000000000..e65c13eb7 --- /dev/null +++ b/lib/square/types/bulk_delete_merchant_custom_attributes_response_merchant_custom_attribute_delete_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an individual delete response in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) + # request. + class BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_delete_order_custom_attributes_request_delete_custom_attribute.rb b/lib/square/types/bulk_delete_order_custom_attributes_request_delete_custom_attribute.rb new file mode 100644 index 000000000..dd3302a33 --- /dev/null +++ b/lib/square/types/bulk_delete_order_custom_attributes_request_delete_custom_attribute.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents one delete within the bulk operation. + class BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute < Internal::Types::Model + field :key, String, optional: true, nullable: false + field :order_id, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_delete_order_custom_attributes_response.rb b/lib/square/types/bulk_delete_order_custom_attributes_response.rb new file mode 100644 index 000000000..0691be6b7 --- /dev/null +++ b/lib/square/types/bulk_delete_order_custom_attributes_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from deleting one or more order custom attributes. + class BulkDeleteOrderCustomAttributesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :values, Internal::Types::Hash[String, Square::Types::DeleteOrderCustomAttributeResponse], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_publish_scheduled_shifts_data.rb b/lib/square/types/bulk_publish_scheduled_shifts_data.rb new file mode 100644 index 000000000..b029c140b --- /dev/null +++ b/lib/square/types/bulk_publish_scheduled_shifts_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents options for an individual publish request in a + # [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) + # operation, provided as the value in a key-value pair. + class BulkPublishScheduledShiftsData < Internal::Types::Model + field :version, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_publish_scheduled_shifts_response.rb b/lib/square/types/bulk_publish_scheduled_shifts_response.rb new file mode 100644 index 000000000..fda14ca71 --- /dev/null +++ b/lib/square/types/bulk_publish_scheduled_shifts_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) response. + # Either `scheduled_shifts` or `errors` is present in the response. + class BulkPublishScheduledShiftsResponse < Internal::Types::Model + field :responses, Internal::Types::Hash[String, Square::Types::PublishScheduledShiftResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_retrieve_bookings_response.rb b/lib/square/types/bulk_retrieve_bookings_response.rb new file mode 100644 index 000000000..c9aa27f94 --- /dev/null +++ b/lib/square/types/bulk_retrieve_bookings_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Response payload for bulk retrieval of bookings. + class BulkRetrieveBookingsResponse < Internal::Types::Model + field :bookings, Internal::Types::Hash[String, Square::Types::GetBookingResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_retrieve_customers_response.rb b/lib/square/types/bulk_retrieve_customers_response.rb new file mode 100644 index 000000000..2777ddd0d --- /dev/null +++ b/lib/square/types/bulk_retrieve_customers_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields included in the response body from the + # [BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint. + class BulkRetrieveCustomersResponse < Internal::Types::Model + field :responses, Internal::Types::Hash[String, Square::Types::GetCustomerResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_retrieve_team_member_booking_profiles_response.rb b/lib/square/types/bulk_retrieve_team_member_booking_profiles_response.rb new file mode 100644 index 000000000..fefa4f81b --- /dev/null +++ b/lib/square/types/bulk_retrieve_team_member_booking_profiles_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Response payload for the [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) endpoint. + class BulkRetrieveTeamMemberBookingProfilesResponse < Internal::Types::Model + field :team_member_booking_profiles, Internal::Types::Hash[String, Square::Types::GetTeamMemberBookingProfileResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_swap_plan_response.rb b/lib/square/types/bulk_swap_plan_response.rb new file mode 100644 index 000000000..4c352a2b0 --- /dev/null +++ b/lib/square/types/bulk_swap_plan_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response of the + # [BulkSwapPlan](api-endpoint:Subscriptions-BulkSwapPlan) endpoint. + class BulkSwapPlanResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :affected_subscriptions, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_update_customer_data.rb b/lib/square/types/bulk_update_customer_data.rb new file mode 100644 index 000000000..5ad65d9f9 --- /dev/null +++ b/lib/square/types/bulk_update_customer_data.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the customer data provided in individual update requests for a + # [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) operation. + class BulkUpdateCustomerData < Internal::Types::Model + field :given_name, String, optional: true, nullable: false + field :family_name, String, optional: true, nullable: false + field :company_name, String, optional: true, nullable: false + field :nickname, String, optional: true, nullable: false + field :email_address, String, optional: true, nullable: false + field :address, Square::Types::Address, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :birthday, String, optional: true, nullable: false + field :tax_ids, Square::Types::CustomerTaxIds, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_update_customers_response.rb b/lib/square/types/bulk_update_customers_response.rb new file mode 100644 index 000000000..b033fe434 --- /dev/null +++ b/lib/square/types/bulk_update_customers_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields included in the response body from the + # [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint. + class BulkUpdateCustomersResponse < Internal::Types::Model + field :responses, Internal::Types::Hash[String, Square::Types::UpdateCustomerResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_upsert_booking_custom_attributes_response.rb b/lib/square/types/bulk_upsert_booking_custom_attributes_response.rb new file mode 100644 index 000000000..f60151e4b --- /dev/null +++ b/lib/square/types/bulk_upsert_booking_custom_attributes_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) response, + # which contains a map of responses that each corresponds to an individual upsert request. + class BulkUpsertBookingCustomAttributesResponse < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BookingCustomAttributeUpsertResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.rb b/lib/square/types/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.rb new file mode 100644 index 000000000..d918729d2 --- /dev/null +++ b/lib/square/types/bulk_upsert_location_custom_attributes_request_location_custom_attribute_upsert_request.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + # request. An individual request contains a location ID, the custom attribute to create or update, + # and an optional idempotency key. + class BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_upsert_location_custom_attributes_response.rb b/lib/square/types/bulk_upsert_location_custom_attributes_response.rb new file mode 100644 index 000000000..1cc555694 --- /dev/null +++ b/lib/square/types/bulk_upsert_location_custom_attributes_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) response, + # which contains a map of responses that each corresponds to an individual upsert request. + class BulkUpsertLocationCustomAttributesResponse < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.rb b/lib/square/types/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.rb new file mode 100644 index 000000000..d3378e678 --- /dev/null +++ b/lib/square/types/bulk_upsert_location_custom_attributes_response_location_custom_attribute_upsert_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response for an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) operation. + class BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.rb b/lib/square/types/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.rb new file mode 100644 index 000000000..3547c8a32 --- /dev/null +++ b/lib/square/types/bulk_upsert_merchant_custom_attributes_request_merchant_custom_attribute_upsert_request.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + # request. An individual request contains a merchant ID, the custom attribute to create or update, + # and an optional idempotency key. + class BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest < Internal::Types::Model + field :merchant_id, String, optional: false, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_upsert_merchant_custom_attributes_response.rb b/lib/square/types/bulk_upsert_merchant_custom_attributes_response.rb new file mode 100644 index 000000000..f83bce458 --- /dev/null +++ b/lib/square/types/bulk_upsert_merchant_custom_attributes_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) response, + # which contains a map of responses that each corresponds to an individual upsert request. + class BulkUpsertMerchantCustomAttributesResponse < Internal::Types::Model + field :values, Internal::Types::Hash[String, Square::Types::BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.rb b/lib/square/types/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.rb new file mode 100644 index 000000000..7be17fde7 --- /dev/null +++ b/lib/square/types/bulk_upsert_merchant_custom_attributes_response_merchant_custom_attribute_upsert_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response for an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) operation. + class BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.rb b/lib/square/types/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.rb new file mode 100644 index 000000000..695be494e --- /dev/null +++ b/lib/square/types/bulk_upsert_order_custom_attributes_request_upsert_custom_attribute.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents one upsert within the bulk operation. + class BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + field :order_id, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/bulk_upsert_order_custom_attributes_response.rb b/lib/square/types/bulk_upsert_order_custom_attributes_response.rb new file mode 100644 index 000000000..4ef46c800 --- /dev/null +++ b/lib/square/types/bulk_upsert_order_custom_attributes_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from a bulk upsert of order custom attributes. + class BulkUpsertOrderCustomAttributesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :values, Internal::Types::Hash[String, Square::Types::UpsertOrderCustomAttributeResponse], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/business_appointment_settings.rb b/lib/square/types/business_appointment_settings.rb new file mode 100644 index 000000000..6d164761e --- /dev/null +++ b/lib/square/types/business_appointment_settings.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + # The service appointment settings, including where and how the service is provided. + class BusinessAppointmentSettings < Internal::Types::Model + field :location_types, Internal::Types::Array[Square::Types::BusinessAppointmentSettingsBookingLocationType], optional: true, nullable: false + field :alignment_time, Square::Types::BusinessAppointmentSettingsAlignmentTime, optional: true, nullable: false + field :min_booking_lead_time_seconds, Integer, optional: true, nullable: false + field :max_booking_lead_time_seconds, Integer, optional: true, nullable: false + field :any_team_member_booking_enabled, Internal::Types::Boolean, optional: true, nullable: false + field :multiple_service_booking_enabled, Internal::Types::Boolean, optional: true, nullable: false + field :max_appointments_per_day_limit_type, Square::Types::BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType, optional: true, nullable: false + field :max_appointments_per_day_limit, Integer, optional: true, nullable: false + field :cancellation_window_seconds, Integer, optional: true, nullable: false + field :cancellation_fee_money, Square::Types::Money, optional: true, nullable: false + field :cancellation_policy, Square::Types::BusinessAppointmentSettingsCancellationPolicy, optional: true, nullable: false + field :cancellation_policy_text, String, optional: true, nullable: false + field :skip_booking_flow_staff_selection, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/business_appointment_settings_alignment_time.rb b/lib/square/types/business_appointment_settings_alignment_time.rb new file mode 100644 index 000000000..734288280 --- /dev/null +++ b/lib/square/types/business_appointment_settings_alignment_time.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module BusinessAppointmentSettingsAlignmentTime + extend Square::Internal::Types::Enum + SERVICE_DURATION = "SERVICE_DURATION" + QUARTER_HOURLY = "QUARTER_HOURLY" + HALF_HOURLY = "HALF_HOURLY" + HOURLY = "HOURLY"end + end +end diff --git a/lib/square/types/business_appointment_settings_booking_location_type.rb b/lib/square/types/business_appointment_settings_booking_location_type.rb new file mode 100644 index 000000000..34688f182 --- /dev/null +++ b/lib/square/types/business_appointment_settings_booking_location_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module BusinessAppointmentSettingsBookingLocationType + extend Square::Internal::Types::Enum + BUSINESS_LOCATION = "BUSINESS_LOCATION" + CUSTOMER_LOCATION = "CUSTOMER_LOCATION" + PHONE = "PHONE"end + end +end diff --git a/lib/square/types/business_appointment_settings_cancellation_policy.rb b/lib/square/types/business_appointment_settings_cancellation_policy.rb new file mode 100644 index 000000000..3dc15f1e6 --- /dev/null +++ b/lib/square/types/business_appointment_settings_cancellation_policy.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module BusinessAppointmentSettingsCancellationPolicy + extend Square::Internal::Types::Enum + CANCELLATION_TREATED_AS_NO_SHOW = "CANCELLATION_TREATED_AS_NO_SHOW" + CUSTOM_POLICY = "CUSTOM_POLICY"end + end +end diff --git a/lib/square/types/business_appointment_settings_max_appointments_per_day_limit_type.rb b/lib/square/types/business_appointment_settings_max_appointments_per_day_limit_type.rb new file mode 100644 index 000000000..efc83e74a --- /dev/null +++ b/lib/square/types/business_appointment_settings_max_appointments_per_day_limit_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType + extend Square::Internal::Types::Enum + PER_TEAM_MEMBER = "PER_TEAM_MEMBER" + PER_LOCATION = "PER_LOCATION"end + end +end diff --git a/lib/square/types/business_booking_profile.rb b/lib/square/types/business_booking_profile.rb new file mode 100644 index 000000000..ef1ef101e --- /dev/null +++ b/lib/square/types/business_booking_profile.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # A seller's business booking profile, including booking policy, appointment settings, etc. + class BusinessBookingProfile < Internal::Types::Model + field :seller_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :booking_enabled, Internal::Types::Boolean, optional: true, nullable: false + field :customer_timezone_choice, Square::Types::BusinessBookingProfileCustomerTimezoneChoice, optional: true, nullable: false + field :booking_policy, Square::Types::BusinessBookingProfileBookingPolicy, optional: true, nullable: false + field :allow_user_cancel, Internal::Types::Boolean, optional: true, nullable: false + field :business_appointment_settings, Square::Types::BusinessAppointmentSettings, optional: true, nullable: false + field :support_seller_level_writes, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/business_booking_profile_booking_policy.rb b/lib/square/types/business_booking_profile_booking_policy.rb new file mode 100644 index 000000000..e542aacc7 --- /dev/null +++ b/lib/square/types/business_booking_profile_booking_policy.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module BusinessBookingProfileBookingPolicy + extend Square::Internal::Types::Enum + ACCEPT_ALL = "ACCEPT_ALL" + REQUIRES_ACCEPTANCE = "REQUIRES_ACCEPTANCE"end + end +end diff --git a/lib/square/types/business_booking_profile_customer_timezone_choice.rb b/lib/square/types/business_booking_profile_customer_timezone_choice.rb new file mode 100644 index 000000000..841e54635 --- /dev/null +++ b/lib/square/types/business_booking_profile_customer_timezone_choice.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module BusinessBookingProfileCustomerTimezoneChoice + extend Square::Internal::Types::Enum + BUSINESS_LOCATION_TIMEZONE = "BUSINESS_LOCATION_TIMEZONE" + CUSTOMER_CHOICE = "CUSTOMER_CHOICE"end + end +end diff --git a/lib/square/types/business_hours.rb b/lib/square/types/business_hours.rb new file mode 100644 index 000000000..4141cdbdf --- /dev/null +++ b/lib/square/types/business_hours.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # The hours of operation for a location. + class BusinessHours < Internal::Types::Model + field :periods, Internal::Types::Array[Square::Types::BusinessHoursPeriod], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/business_hours_period.rb b/lib/square/types/business_hours_period.rb new file mode 100644 index 000000000..da67eff07 --- /dev/null +++ b/lib/square/types/business_hours_period.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a period of time during which a business location is open. + class BusinessHoursPeriod < Internal::Types::Model + field :day_of_week, Square::Types::DayOfWeek, optional: true, nullable: false + field :start_local_time, String, optional: true, nullable: false + field :end_local_time, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/buy_now_pay_later_details.rb b/lib/square/types/buy_now_pay_later_details.rb new file mode 100644 index 000000000..5fdb89d42 --- /dev/null +++ b/lib/square/types/buy_now_pay_later_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Additional details about a Buy Now Pay Later payment type. + class BuyNowPayLaterDetails < Internal::Types::Model + field :brand, String, optional: true, nullable: false + field :afterpay_details, Square::Types::AfterpayDetails, optional: true, nullable: false + field :clearpay_details, Square::Types::ClearpayDetails, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/calculate_loyalty_points_response.rb b/lib/square/types/calculate_loyalty_points_response.rb new file mode 100644 index 000000000..ebd750049 --- /dev/null +++ b/lib/square/types/calculate_loyalty_points_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) response. + class CalculateLoyaltyPointsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :points, Integer, optional: true, nullable: false + field :promotion_points, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/calculate_order_response.rb b/lib/square/types/calculate_order_response.rb new file mode 100644 index 000000000..d8eb3f07c --- /dev/null +++ b/lib/square/types/calculate_order_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CalculateOrderResponse < Internal::Types::Model + field :order, Square::Types::Order, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cancel_booking_response.rb b/lib/square/types/cancel_booking_response.rb new file mode 100644 index 000000000..6eb5a1e6c --- /dev/null +++ b/lib/square/types/cancel_booking_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CancelBookingResponse < Internal::Types::Model + field :booking, Square::Types::Booking, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cancel_invoice_response.rb b/lib/square/types/cancel_invoice_response.rb new file mode 100644 index 000000000..25c786615 --- /dev/null +++ b/lib/square/types/cancel_invoice_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The response returned by the `CancelInvoice` request. + class CancelInvoiceResponse < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cancel_loyalty_promotion_response.rb b/lib/square/types/cancel_loyalty_promotion_response.rb new file mode 100644 index 000000000..42502c245 --- /dev/null +++ b/lib/square/types/cancel_loyalty_promotion_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CancelLoyaltyPromotion](api-endpoint:Loyalty-CancelLoyaltyPromotion) response. + # Either `loyalty_promotion` or `errors` is present in the response. + class CancelLoyaltyPromotionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :loyalty_promotion, Square::Types::LoyaltyPromotion, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cancel_payment_by_idempotency_key_response.rb b/lib/square/types/cancel_payment_by_idempotency_key_response.rb new file mode 100644 index 000000000..8e5bac4d8 --- /dev/null +++ b/lib/square/types/cancel_payment_by_idempotency_key_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response returned by + # [CancelPaymentByIdempotencyKey](api-endpoint:Payments-CancelPaymentByIdempotencyKey). + # On success, `errors` is empty. + class CancelPaymentByIdempotencyKeyResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cancel_payment_response.rb b/lib/square/types/cancel_payment_response.rb new file mode 100644 index 000000000..52e2f1cb2 --- /dev/null +++ b/lib/square/types/cancel_payment_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response returned by [CancelPayment](api-endpoint:Payments-CancelPayment). + class CancelPaymentResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :payment, Square::Types::Payment, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cancel_subscription_response.rb b/lib/square/types/cancel_subscription_response.rb new file mode 100644 index 000000000..471ee16af --- /dev/null +++ b/lib/square/types/cancel_subscription_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response from the + # [CancelSubscription](api-endpoint:Subscriptions-CancelSubscription) endpoint. + class CancelSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::Subscription, optional: true, nullable: false + field :actions, Internal::Types::Array[Square::Types::SubscriptionAction], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cancel_terminal_action_response.rb b/lib/square/types/cancel_terminal_action_response.rb new file mode 100644 index 000000000..8df709d06 --- /dev/null +++ b/lib/square/types/cancel_terminal_action_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CancelTerminalActionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :action, Square::Types::TerminalAction, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cancel_terminal_checkout_response.rb b/lib/square/types/cancel_terminal_checkout_response.rb new file mode 100644 index 000000000..2487c3058 --- /dev/null +++ b/lib/square/types/cancel_terminal_checkout_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CancelTerminalCheckoutResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :checkout, Square::Types::TerminalCheckout, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cancel_terminal_refund_response.rb b/lib/square/types/cancel_terminal_refund_response.rb new file mode 100644 index 000000000..d222a5f13 --- /dev/null +++ b/lib/square/types/cancel_terminal_refund_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CancelTerminalRefundResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :refund, Square::Types::TerminalRefund, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/capture_transaction_response.rb b/lib/square/types/capture_transaction_response.rb new file mode 100644 index 000000000..7292983fb --- /dev/null +++ b/lib/square/types/capture_transaction_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint. + class CaptureTransactionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card.rb b/lib/square/types/card.rb new file mode 100644 index 000000000..0760243fd --- /dev/null +++ b/lib/square/types/card.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class Card < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :card_brand, Square::Types::CardBrand, optional: true, nullable: false + field :last_4, String, optional: true, nullable: false + field :exp_month, Integer, optional: true, nullable: false + field :exp_year, Integer, optional: true, nullable: false + field :cardholder_name, String, optional: true, nullable: false + field :billing_address, Square::Types::Address, optional: true, nullable: false + field :fingerprint, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :merchant_id, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :enabled, Internal::Types::Boolean, optional: true, nullable: false + field :card_type, Square::Types::CardType, optional: true, nullable: false + field :prepaid_type, Square::Types::CardPrepaidType, optional: true, nullable: false + field :bin, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :card_co_brand, Square::Types::CardCoBrand, optional: true, nullable: false + field :issuer_alert, String, optional: true, nullable: false + field :issuer_alert_at, String, optional: true, nullable: false + field :hsa_fsa, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_automatically_updated_event.rb b/lib/square/types/card_automatically_updated_event.rb new file mode 100644 index 000000000..d75d22297 --- /dev/null +++ b/lib/square/types/card_automatically_updated_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when Square automatically updates the expiration date or + # primary account number (PAN) of a [card](entity:Card) or adds or removes an issuer alert. + class CardAutomaticallyUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CardAutomaticallyUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_automatically_updated_event_data.rb b/lib/square/types/card_automatically_updated_event_data.rb new file mode 100644 index 000000000..85aad68c4 --- /dev/null +++ b/lib/square/types/card_automatically_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class CardAutomaticallyUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::CardAutomaticallyUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_automatically_updated_event_object.rb b/lib/square/types/card_automatically_updated_event_object.rb new file mode 100644 index 000000000..562a7299e --- /dev/null +++ b/lib/square/types/card_automatically_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CardAutomaticallyUpdatedEventObject < Internal::Types::Model + field :card, Square::Types::Card, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_brand.rb b/lib/square/types/card_brand.rb new file mode 100644 index 000000000..cb1ba3a6f --- /dev/null +++ b/lib/square/types/card_brand.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Square + module Types + module CardBrand + extend Square::Internal::Types::Enum + OTHER_BRAND = "OTHER_BRAND" + VISA = "VISA" + MASTERCARD = "MASTERCARD" + AMERICAN_EXPRESS = "AMERICAN_EXPRESS" + DISCOVER = "DISCOVER" + DISCOVER_DINERS = "DISCOVER_DINERS" + JCB = "JCB" + CHINA_UNIONPAY = "CHINA_UNIONPAY" + SQUARE_GIFT_CARD = "SQUARE_GIFT_CARD" + SQUARE_CAPITAL_CARD = "SQUARE_CAPITAL_CARD" + INTERAC = "INTERAC" + EFTPOS = "EFTPOS" + FELICA = "FELICA" + EBT = "EBT"end + end +end diff --git a/lib/square/types/card_co_brand.rb b/lib/square/types/card_co_brand.rb new file mode 100644 index 000000000..0e0c963eb --- /dev/null +++ b/lib/square/types/card_co_brand.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module CardCoBrand + extend Square::Internal::Types::Enum + UNKNOWN = "UNKNOWN" + AFTERPAY = "AFTERPAY" + CLEARPAY = "CLEARPAY"end + end +end diff --git a/lib/square/types/card_created_event.rb b/lib/square/types/card_created_event.rb new file mode 100644 index 000000000..7528bec37 --- /dev/null +++ b/lib/square/types/card_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [card](entity:Card) is created or imported. + class CardCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CardCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_created_event_data.rb b/lib/square/types/card_created_event_data.rb new file mode 100644 index 000000000..7c1a8365a --- /dev/null +++ b/lib/square/types/card_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class CardCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::CardCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_created_event_object.rb b/lib/square/types/card_created_event_object.rb new file mode 100644 index 000000000..8cd529bbf --- /dev/null +++ b/lib/square/types/card_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CardCreatedEventObject < Internal::Types::Model + field :card, Square::Types::Card, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_disabled_event.rb b/lib/square/types/card_disabled_event.rb new file mode 100644 index 000000000..0af17b151 --- /dev/null +++ b/lib/square/types/card_disabled_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [card](entity:Card) is disabled. + class CardDisabledEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CardDisabledEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_disabled_event_data.rb b/lib/square/types/card_disabled_event_data.rb new file mode 100644 index 000000000..f217b97fe --- /dev/null +++ b/lib/square/types/card_disabled_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class CardDisabledEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::CardDisabledEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_disabled_event_object.rb b/lib/square/types/card_disabled_event_object.rb new file mode 100644 index 000000000..2fd683fac --- /dev/null +++ b/lib/square/types/card_disabled_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CardDisabledEventObject < Internal::Types::Model + field :card, Square::Types::Card, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_forgotten_event.rb b/lib/square/types/card_forgotten_event.rb new file mode 100644 index 000000000..8a18ad3f6 --- /dev/null +++ b/lib/square/types/card_forgotten_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [card](entity:Card) is GDPR forgotten or vaulted. + class CardForgottenEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CardForgottenEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_forgotten_event_card.rb b/lib/square/types/card_forgotten_event_card.rb new file mode 100644 index 000000000..ea2fbaaac --- /dev/null +++ b/lib/square/types/card_forgotten_event_card.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + class CardForgottenEventCard < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :enabled, Internal::Types::Boolean, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :merchant_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_forgotten_event_data.rb b/lib/square/types/card_forgotten_event_data.rb new file mode 100644 index 000000000..2de90ef7f --- /dev/null +++ b/lib/square/types/card_forgotten_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class CardForgottenEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::CardForgottenEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_forgotten_event_object.rb b/lib/square/types/card_forgotten_event_object.rb new file mode 100644 index 000000000..177743bdb --- /dev/null +++ b/lib/square/types/card_forgotten_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CardForgottenEventObject < Internal::Types::Model + field :card, Square::Types::CardForgottenEventCard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_payment_details.rb b/lib/square/types/card_payment_details.rb new file mode 100644 index 000000000..0640b693d --- /dev/null +++ b/lib/square/types/card_payment_details.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Square + module Types + # Reflects the current status of a card payment. Contains only non-confidential information. + class CardPaymentDetails < Internal::Types::Model + field :status, String, optional: true, nullable: false + field :card, Square::Types::Card, optional: true, nullable: false + field :entry_method, String, optional: true, nullable: false + field :cvv_status, String, optional: true, nullable: false + field :avs_status, String, optional: true, nullable: false + field :auth_result_code, String, optional: true, nullable: false + field :application_identifier, String, optional: true, nullable: false + field :application_name, String, optional: true, nullable: false + field :application_cryptogram, String, optional: true, nullable: false + field :verification_method, String, optional: true, nullable: false + field :verification_results, String, optional: true, nullable: false + field :statement_description, String, optional: true, nullable: false + field :device_details, Square::Types::DeviceDetails, optional: true, nullable: false + field :card_payment_timeline, Square::Types::CardPaymentTimeline, optional: true, nullable: false + field :refund_requires_card_presence, Internal::Types::Boolean, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_payment_timeline.rb b/lib/square/types/card_payment_timeline.rb new file mode 100644 index 000000000..4808d903d --- /dev/null +++ b/lib/square/types/card_payment_timeline.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The timeline for card payments. + class CardPaymentTimeline < Internal::Types::Model + field :authorized_at, String, optional: true, nullable: false + field :captured_at, String, optional: true, nullable: false + field :voided_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_prepaid_type.rb b/lib/square/types/card_prepaid_type.rb new file mode 100644 index 000000000..20d796e77 --- /dev/null +++ b/lib/square/types/card_prepaid_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module CardPrepaidType + extend Square::Internal::Types::Enum + UNKNOWN_PREPAID_TYPE = "UNKNOWN_PREPAID_TYPE" + NOT_PREPAID = "NOT_PREPAID" + PREPAID = "PREPAID"end + end +end diff --git a/lib/square/types/card_type.rb b/lib/square/types/card_type.rb new file mode 100644 index 000000000..b94e3f083 --- /dev/null +++ b/lib/square/types/card_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module CardType + extend Square::Internal::Types::Enum + UNKNOWN_CARD_TYPE = "UNKNOWN_CARD_TYPE" + CREDIT = "CREDIT" + DEBIT = "DEBIT"end + end +end diff --git a/lib/square/types/card_updated_event.rb b/lib/square/types/card_updated_event.rb new file mode 100644 index 000000000..8ab45a657 --- /dev/null +++ b/lib/square/types/card_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [card](entity:Card) is updated by the seller in the Square Dashboard. + class CardUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CardUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_updated_event_data.rb b/lib/square/types/card_updated_event_data.rb new file mode 100644 index 000000000..be4e94588 --- /dev/null +++ b/lib/square/types/card_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class CardUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::CardUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/card_updated_event_object.rb b/lib/square/types/card_updated_event_object.rb new file mode 100644 index 000000000..babedc034 --- /dev/null +++ b/lib/square/types/card_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CardUpdatedEventObject < Internal::Types::Model + field :card, Square::Types::Card, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cash_app_details.rb b/lib/square/types/cash_app_details.rb new file mode 100644 index 000000000..2be7753f0 --- /dev/null +++ b/lib/square/types/cash_app_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. + class CashAppDetails < Internal::Types::Model + field :buyer_full_name, String, optional: true, nullable: false + field :buyer_country_code, String, optional: true, nullable: false + field :buyer_cashtag, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cash_drawer_device.rb b/lib/square/types/cash_drawer_device.rb new file mode 100644 index 000000000..02910d42f --- /dev/null +++ b/lib/square/types/cash_drawer_device.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CashDrawerDevice < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cash_drawer_event_type.rb b/lib/square/types/cash_drawer_event_type.rb new file mode 100644 index 000000000..dfa63a40b --- /dev/null +++ b/lib/square/types/cash_drawer_event_type.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + module CashDrawerEventType + extend Square::Internal::Types::Enum + NO_SALE = "NO_SALE" + CASH_TENDER_PAYMENT = "CASH_TENDER_PAYMENT" + OTHER_TENDER_PAYMENT = "OTHER_TENDER_PAYMENT" + CASH_TENDER_CANCELLED_PAYMENT = "CASH_TENDER_CANCELLED_PAYMENT" + OTHER_TENDER_CANCELLED_PAYMENT = "OTHER_TENDER_CANCELLED_PAYMENT" + CASH_TENDER_REFUND = "CASH_TENDER_REFUND" + OTHER_TENDER_REFUND = "OTHER_TENDER_REFUND" + PAID_IN = "PAID_IN" + PAID_OUT = "PAID_OUT"end + end +end diff --git a/lib/square/types/cash_drawer_shift.rb b/lib/square/types/cash_drawer_shift.rb new file mode 100644 index 000000000..55b700adf --- /dev/null +++ b/lib/square/types/cash_drawer_shift.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CashDrawerShift < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :state, Square::Types::CashDrawerShiftState, optional: true, nullable: false + field :opened_at, String, optional: true, nullable: false + field :ended_at, String, optional: true, nullable: false + field :closed_at, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :opened_cash_money, Square::Types::Money, optional: true, nullable: false + field :cash_payment_money, Square::Types::Money, optional: true, nullable: false + field :cash_refunds_money, Square::Types::Money, optional: true, nullable: false + field :cash_paid_in_money, Square::Types::Money, optional: true, nullable: false + field :cash_paid_out_money, Square::Types::Money, optional: true, nullable: false + field :expected_cash_money, Square::Types::Money, optional: true, nullable: false + field :closed_cash_money, Square::Types::Money, optional: true, nullable: false + field :device, Square::Types::CashDrawerDevice, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :team_member_ids, Internal::Types::Array[String], optional: true, nullable: false + field :opening_team_member_id, String, optional: true, nullable: false + field :ending_team_member_id, String, optional: true, nullable: false + field :closing_team_member_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cash_drawer_shift_event.rb b/lib/square/types/cash_drawer_shift_event.rb new file mode 100644 index 000000000..2d0d55044 --- /dev/null +++ b/lib/square/types/cash_drawer_shift_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + class CashDrawerShiftEvent < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :event_type, Square::Types::CashDrawerEventType, optional: true, nullable: false + field :event_money, Square::Types::Money, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cash_drawer_shift_state.rb b/lib/square/types/cash_drawer_shift_state.rb new file mode 100644 index 000000000..d795c74ae --- /dev/null +++ b/lib/square/types/cash_drawer_shift_state.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module CashDrawerShiftState + extend Square::Internal::Types::Enum + OPEN = "OPEN" + ENDED = "ENDED" + CLOSED = "CLOSED"end + end +end diff --git a/lib/square/types/cash_drawer_shift_summary.rb b/lib/square/types/cash_drawer_shift_summary.rb new file mode 100644 index 000000000..61f8c1763 --- /dev/null +++ b/lib/square/types/cash_drawer_shift_summary.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CashDrawerShiftSummary < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :state, Square::Types::CashDrawerShiftState, optional: true, nullable: false + field :opened_at, String, optional: true, nullable: false + field :ended_at, String, optional: true, nullable: false + field :closed_at, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :opened_cash_money, Square::Types::Money, optional: true, nullable: false + field :expected_cash_money, Square::Types::Money, optional: true, nullable: false + field :closed_cash_money, Square::Types::Money, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/cash_payment_details.rb b/lib/square/types/cash_payment_details.rb new file mode 100644 index 000000000..368181a92 --- /dev/null +++ b/lib/square/types/cash_payment_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class CashPaymentDetails < Internal::Types::Model + field :buyer_supplied_money, Square::Types::Money, optional: false, nullable: false + field :change_back_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_availability_period.rb b/lib/square/types/catalog_availability_period.rb new file mode 100644 index 000000000..250d2c0da --- /dev/null +++ b/lib/square/types/catalog_availability_period.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a time period of availability. + class CatalogAvailabilityPeriod < Internal::Types::Model + field :start_local_time, String, optional: true, nullable: false + field :end_local_time, String, optional: true, nullable: false + field :day_of_week, Square::Types::DayOfWeek, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_category.rb b/lib/square/types/catalog_category.rb new file mode 100644 index 000000000..f2ec58cad --- /dev/null +++ b/lib/square/types/catalog_category.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # A category to which a `CatalogItem` instance belongs. + class CatalogCategory < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :image_ids, Internal::Types::Array[String], optional: true, nullable: false + field :category_type, Square::Types::CatalogCategoryType, optional: true, nullable: false + field :parent_category, Square::Types::CatalogObjectCategory, optional: true, nullable: false + field :is_top_level, Internal::Types::Boolean, optional: true, nullable: false + field :channels, Internal::Types::Array[String], optional: true, nullable: false + field :availability_period_ids, Internal::Types::Array[String], optional: true, nullable: false + field :online_visibility, Internal::Types::Boolean, optional: true, nullable: false + field :root_category, String, optional: true, nullable: false + field :ecom_seo_data, Square::Types::CatalogEcomSeoData, optional: true, nullable: false + field :path_to_root, Internal::Types::Array[Square::Types::CategoryPathToRootNode], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_category_type.rb b/lib/square/types/catalog_category_type.rb new file mode 100644 index 000000000..5655e6b95 --- /dev/null +++ b/lib/square/types/catalog_category_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogCategoryType + extend Square::Internal::Types::Enum + REGULAR_CATEGORY = "REGULAR_CATEGORY" + MENU_CATEGORY = "MENU_CATEGORY" + KITCHEN_CATEGORY = "KITCHEN_CATEGORY"end + end +end diff --git a/lib/square/types/catalog_custom_attribute_definition.rb b/lib/square/types/catalog_custom_attribute_definition.rb new file mode 100644 index 000000000..b1064e647 --- /dev/null +++ b/lib/square/types/catalog_custom_attribute_definition.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Square + module Types + # 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) + class CatalogCustomAttributeDefinition < Internal::Types::Model + field :type, Square::Types::CatalogCustomAttributeDefinitionType, optional: false, nullable: false + field :name, String, optional: false, nullable: false + field :description, String, optional: true, nullable: false + field :source_application, Square::Types::SourceApplication, optional: true, nullable: false + field :allowed_object_types, Internal::Types::Array[Square::Types::CatalogObjectType], optional: false, nullable: false + field :seller_visibility, Square::Types::CatalogCustomAttributeDefinitionSellerVisibility, optional: true, nullable: false + field :app_visibility, Square::Types::CatalogCustomAttributeDefinitionAppVisibility, optional: true, nullable: false + field :string_config, Square::Types::CatalogCustomAttributeDefinitionStringConfig, optional: true, nullable: false + field :number_config, Square::Types::CatalogCustomAttributeDefinitionNumberConfig, optional: true, nullable: false + field :selection_config, Square::Types::CatalogCustomAttributeDefinitionSelectionConfig, optional: true, nullable: false + field :custom_attribute_usage_count, Integer, optional: true, nullable: false + field :key, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_custom_attribute_definition_app_visibility.rb b/lib/square/types/catalog_custom_attribute_definition_app_visibility.rb new file mode 100644 index 000000000..3643b5710 --- /dev/null +++ b/lib/square/types/catalog_custom_attribute_definition_app_visibility.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogCustomAttributeDefinitionAppVisibility + extend Square::Internal::Types::Enum + APP_VISIBILITY_HIDDEN = "APP_VISIBILITY_HIDDEN" + APP_VISIBILITY_READ_ONLY = "APP_VISIBILITY_READ_ONLY" + APP_VISIBILITY_READ_WRITE_VALUES = "APP_VISIBILITY_READ_WRITE_VALUES"end + end +end diff --git a/lib/square/types/catalog_custom_attribute_definition_number_config.rb b/lib/square/types/catalog_custom_attribute_definition_number_config.rb new file mode 100644 index 000000000..917cb4bc2 --- /dev/null +++ b/lib/square/types/catalog_custom_attribute_definition_number_config.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogCustomAttributeDefinitionNumberConfig < Internal::Types::Model + field :precision, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_custom_attribute_definition_selection_config.rb b/lib/square/types/catalog_custom_attribute_definition_selection_config.rb new file mode 100644 index 000000000..cd7693edd --- /dev/null +++ b/lib/square/types/catalog_custom_attribute_definition_selection_config.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Configuration associated with `SELECTION`-type custom attribute definitions. + class CatalogCustomAttributeDefinitionSelectionConfig < Internal::Types::Model + field :max_allowed_selections, Integer, optional: true, nullable: false + field :allowed_selections, Internal::Types::Array[Square::Types::CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.rb b/lib/square/types/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.rb new file mode 100644 index 000000000..986cde7f0 --- /dev/null +++ b/lib/square/types/catalog_custom_attribute_definition_selection_config_custom_attribute_selection.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A named selection for this `SELECTION`-type custom attribute definition. + class CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :name, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_custom_attribute_definition_seller_visibility.rb b/lib/square/types/catalog_custom_attribute_definition_seller_visibility.rb new file mode 100644 index 000000000..5d2bbba28 --- /dev/null +++ b/lib/square/types/catalog_custom_attribute_definition_seller_visibility.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogCustomAttributeDefinitionSellerVisibility + extend Square::Internal::Types::Enum + SELLER_VISIBILITY_HIDDEN = "SELLER_VISIBILITY_HIDDEN" + SELLER_VISIBILITY_READ_WRITE_VALUES = "SELLER_VISIBILITY_READ_WRITE_VALUES"end + end +end diff --git a/lib/square/types/catalog_custom_attribute_definition_string_config.rb b/lib/square/types/catalog_custom_attribute_definition_string_config.rb new file mode 100644 index 000000000..141e15c41 --- /dev/null +++ b/lib/square/types/catalog_custom_attribute_definition_string_config.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Configuration associated with Custom Attribute Definitions of type `STRING`. + class CatalogCustomAttributeDefinitionStringConfig < Internal::Types::Model + field :enforce_uniqueness, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_custom_attribute_definition_type.rb b/lib/square/types/catalog_custom_attribute_definition_type.rb new file mode 100644 index 000000000..e98edb552 --- /dev/null +++ b/lib/square/types/catalog_custom_attribute_definition_type.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogCustomAttributeDefinitionType + extend Square::Internal::Types::Enum + STRING = "STRING" + BOOLEAN = "BOOLEAN" + NUMBER = "NUMBER" + SELECTION = "SELECTION"end + end +end diff --git a/lib/square/types/catalog_custom_attribute_value.rb b/lib/square/types/catalog_custom_attribute_value.rb new file mode 100644 index 000000000..f7d68b574 --- /dev/null +++ b/lib/square/types/catalog_custom_attribute_value.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class CatalogCustomAttributeValue < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :string_value, String, optional: true, nullable: false + field :custom_attribute_definition_id, String, optional: true, nullable: false + field :type, Square::Types::CatalogCustomAttributeDefinitionType, optional: true, nullable: false + field :number_value, String, optional: true, nullable: false + field :boolean_value, Internal::Types::Boolean, optional: true, nullable: false + field :selection_uid_values, Internal::Types::Array[String], optional: true, nullable: false + field :key, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_discount.rb b/lib/square/types/catalog_discount.rb new file mode 100644 index 000000000..a03a96fc6 --- /dev/null +++ b/lib/square/types/catalog_discount.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # A discount applicable to items. + class CatalogDiscount < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :discount_type, Square::Types::CatalogDiscountType, optional: true, nullable: false + field :percentage, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :pin_required, Internal::Types::Boolean, optional: true, nullable: false + field :label_color, String, optional: true, nullable: false + field :modify_tax_basis, Square::Types::CatalogDiscountModifyTaxBasis, optional: true, nullable: false + field :maximum_amount_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_discount_modify_tax_basis.rb b/lib/square/types/catalog_discount_modify_tax_basis.rb new file mode 100644 index 000000000..098449087 --- /dev/null +++ b/lib/square/types/catalog_discount_modify_tax_basis.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogDiscountModifyTaxBasis + extend Square::Internal::Types::Enum + MODIFY_TAX_BASIS = "MODIFY_TAX_BASIS" + DO_NOT_MODIFY_TAX_BASIS = "DO_NOT_MODIFY_TAX_BASIS"end + end +end diff --git a/lib/square/types/catalog_discount_type.rb b/lib/square/types/catalog_discount_type.rb new file mode 100644 index 000000000..e2fcd8370 --- /dev/null +++ b/lib/square/types/catalog_discount_type.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogDiscountType + extend Square::Internal::Types::Enum + FIXED_PERCENTAGE = "FIXED_PERCENTAGE" + FIXED_AMOUNT = "FIXED_AMOUNT" + VARIABLE_PERCENTAGE = "VARIABLE_PERCENTAGE" + VARIABLE_AMOUNT = "VARIABLE_AMOUNT"end + end +end diff --git a/lib/square/types/catalog_ecom_seo_data.rb b/lib/square/types/catalog_ecom_seo_data.rb new file mode 100644 index 000000000..f0d88bf3a --- /dev/null +++ b/lib/square/types/catalog_ecom_seo_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # SEO data for for a seller's Square Online store. + class CatalogEcomSeoData < Internal::Types::Model + field :page_title, String, optional: true, nullable: false + field :page_description, String, optional: true, nullable: false + field :permalink, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_id_mapping.rb b/lib/square/types/catalog_id_mapping.rb new file mode 100644 index 000000000..18e5b1db6 --- /dev/null +++ b/lib/square/types/catalog_id_mapping.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Square + module Types + # A mapping between a temporary client-supplied ID and a permanent server-generated ID. + # + # When calling [UpsertCatalogObject](api-endpoint:Catalog-UpsertCatalogObject) or + # [BatchUpsertCatalogObjects](api-endpoint:Catalog-BatchUpsertCatalogObjects) to + # create a [CatalogObject](entity:CatalogObject) instance, you can supply + # a temporary ID for the to-be-created object, especially when the object is to be referenced + # elsewhere in the same request body. This temporary ID can be any string unique within + # the call, but must be prefixed by "#". + # + # After the request is submitted and the object created, a permanent server-generated ID is assigned + # to the new object. The permanent ID is unique across the Square catalog. + class CatalogIdMapping < Internal::Types::Model + field :client_object_id, String, optional: true, nullable: false + field :object_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_image.rb b/lib/square/types/catalog_image.rb new file mode 100644 index 000000000..de06854af --- /dev/null +++ b/lib/square/types/catalog_image.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CatalogImage < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :url, String, optional: true, nullable: false + field :caption, String, optional: true, nullable: false + field :photo_studio_order_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_info_response.rb b/lib/square/types/catalog_info_response.rb new file mode 100644 index 000000000..a9bbc399f --- /dev/null +++ b/lib/square/types/catalog_info_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogInfoResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :limits, Square::Types::CatalogInfoResponseLimits, optional: true, nullable: false + field :standard_unit_description_group, Square::Types::StandardUnitDescriptionGroup, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_info_response_limits.rb b/lib/square/types/catalog_info_response_limits.rb new file mode 100644 index 000000000..a0e70a6b8 --- /dev/null +++ b/lib/square/types/catalog_info_response_limits.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogInfoResponseLimits < Internal::Types::Model + field :batch_upsert_max_objects_per_batch, Integer, optional: true, nullable: false + field :batch_upsert_max_total_objects, Integer, optional: true, nullable: false + field :batch_retrieve_max_object_ids, Integer, optional: true, nullable: false + field :search_max_page_limit, Integer, optional: true, nullable: false + field :batch_delete_max_object_ids, Integer, optional: true, nullable: false + field :update_item_taxes_max_item_ids, Integer, optional: true, nullable: false + field :update_item_taxes_max_taxes_to_enable, Integer, optional: true, nullable: false + field :update_item_taxes_max_taxes_to_disable, Integer, optional: true, nullable: false + field :update_item_modifier_lists_max_item_ids, Integer, optional: true, nullable: false + field :update_item_modifier_lists_max_modifier_lists_to_enable, Integer, optional: true, nullable: false + field :update_item_modifier_lists_max_modifier_lists_to_disable, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_item.rb b/lib/square/types/catalog_item.rb new file mode 100644 index 000000000..b87e74c29 --- /dev/null +++ b/lib/square/types/catalog_item.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Square + module Types + # A [CatalogObject](entity:CatalogObject) instance of the `ITEM` type, also referred to as an item, in the catalog. + class CatalogItem < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :abbreviation, String, optional: true, nullable: false + field :label_color, String, optional: true, nullable: false + field :is_taxable, Internal::Types::Boolean, optional: true, nullable: false + field :category_id, String, optional: true, nullable: false + field :tax_ids, Internal::Types::Array[String], optional: true, nullable: false + field :modifier_list_info, Internal::Types::Array[Square::Types::CatalogItemModifierListInfo], optional: true, nullable: false + field :variations, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + field :product_type, Square::Types::CatalogItemProductType, optional: true, nullable: false + field :skip_modifier_screen, Internal::Types::Boolean, optional: true, nullable: false + field :item_options, Internal::Types::Array[Square::Types::CatalogItemOptionForItem], optional: true, nullable: false + field :ecom_uri, String, optional: true, nullable: false + field :ecom_image_uris, Internal::Types::Array[String], optional: true, nullable: false + field :image_ids, Internal::Types::Array[String], optional: true, nullable: false + field :sort_name, String, optional: true, nullable: false + field :categories, Internal::Types::Array[Square::Types::CatalogObjectCategory], optional: true, nullable: false + field :description_html, String, optional: true, nullable: false + field :description_plaintext, String, optional: true, nullable: false + field :channels, Internal::Types::Array[String], optional: true, nullable: false + field :is_archived, Internal::Types::Boolean, optional: true, nullable: false + field :ecom_seo_data, Square::Types::CatalogEcomSeoData, optional: true, nullable: false + field :food_and_beverage_details, Square::Types::CatalogItemFoodAndBeverageDetails, optional: true, nullable: false + field :reporting_category, Square::Types::CatalogObjectCategory, optional: true, nullable: false + field :is_alcoholic, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_item_food_and_beverage_details.rb b/lib/square/types/catalog_item_food_and_beverage_details.rb new file mode 100644 index 000000000..05b3389df --- /dev/null +++ b/lib/square/types/catalog_item_food_and_beverage_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The food and beverage-specific details of a `FOOD_AND_BEV` item. + class CatalogItemFoodAndBeverageDetails < Internal::Types::Model + field :calorie_count, Integer, optional: true, nullable: false + field :dietary_preferences, Internal::Types::Array[Square::Types::CatalogItemFoodAndBeverageDetailsDietaryPreference], optional: true, nullable: false + field :ingredients, Internal::Types::Array[Square::Types::CatalogItemFoodAndBeverageDetailsIngredient], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference.rb b/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference.rb new file mode 100644 index 000000000..c7f4b9b1e --- /dev/null +++ b/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its ingredients. + class CatalogItemFoodAndBeverageDetailsDietaryPreference < Internal::Types::Model + field :type, Square::Types::CatalogItemFoodAndBeverageDetailsDietaryPreferenceType, optional: true, nullable: false + field :standard_name, Square::Types::CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference, optional: true, nullable: false + field :custom_name, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference_standard_dietary_preference.rb b/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference_standard_dietary_preference.rb new file mode 100644 index 000000000..57081d9da --- /dev/null +++ b/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference_standard_dietary_preference.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference + extend Square::Internal::Types::Enum + DAIRY_FREE = "DAIRY_FREE" + GLUTEN_FREE = "GLUTEN_FREE" + HALAL = "HALAL" + KOSHER = "KOSHER" + NUT_FREE = "NUT_FREE" + VEGAN = "VEGAN" + VEGETARIAN = "VEGETARIAN"end + end +end diff --git a/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference_type.rb b/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference_type.rb new file mode 100644 index 000000000..28d2b4bd2 --- /dev/null +++ b/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogItemFoodAndBeverageDetailsDietaryPreferenceType + extend Square::Internal::Types::Enum + STANDARD = "STANDARD" + CUSTOM = "CUSTOM"end + end +end diff --git a/lib/square/types/catalog_item_food_and_beverage_details_ingredient.rb b/lib/square/types/catalog_item_food_and_beverage_details_ingredient.rb new file mode 100644 index 000000000..40f1a980e --- /dev/null +++ b/lib/square/types/catalog_item_food_and_beverage_details_ingredient.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes the ingredient used in a `FOOD_AND_BEV` item. + class CatalogItemFoodAndBeverageDetailsIngredient < Internal::Types::Model + field :type, Square::Types::CatalogItemFoodAndBeverageDetailsDietaryPreferenceType, optional: true, nullable: false + field :standard_name, Square::Types::CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient, optional: true, nullable: false + field :custom_name, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_item_food_and_beverage_details_ingredient_standard_ingredient.rb b/lib/square/types/catalog_item_food_and_beverage_details_ingredient_standard_ingredient.rb new file mode 100644 index 000000000..3f7bde489 --- /dev/null +++ b/lib/square/types/catalog_item_food_and_beverage_details_ingredient_standard_ingredient.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient + extend Square::Internal::Types::Enum + CELERY = "CELERY" + CRUSTACEANS = "CRUSTACEANS" + EGGS = "EGGS" + FISH = "FISH" + GLUTEN = "GLUTEN" + LUPIN = "LUPIN" + MILK = "MILK" + MOLLUSCS = "MOLLUSCS" + MUSTARD = "MUSTARD" + PEANUTS = "PEANUTS" + SESAME = "SESAME" + SOY = "SOY" + SULPHITES = "SULPHITES" + TREE_NUTS = "TREE_NUTS"end + end +end diff --git a/lib/square/types/catalog_item_modifier_list_info.rb b/lib/square/types/catalog_item_modifier_list_info.rb new file mode 100644 index 000000000..6c5c59348 --- /dev/null +++ b/lib/square/types/catalog_item_modifier_list_info.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # Controls how a modifier list is applied to a specific item. This object allows for item-specific customization of modifier list behavior + # and provides the ability to override global modifier list settings. + class CatalogItemModifierListInfo < Internal::Types::Model + field :modifier_list_id, String, optional: false, nullable: false + field :modifier_overrides, Internal::Types::Array[Square::Types::CatalogModifierOverride], optional: true, nullable: false + field :min_selected_modifiers, Integer, optional: true, nullable: false + field :max_selected_modifiers, Integer, optional: true, nullable: false + field :enabled, Internal::Types::Boolean, optional: true, nullable: false + field :ordinal, Integer, optional: true, nullable: false + field :allow_quantities, Internal::Types::Hash[String, ], optional: true, nullable: false + field :is_conversational, Internal::Types::Hash[String, ], optional: true, nullable: false + field :hidden_from_customer_override, Internal::Types::Hash[String, ], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_item_option.rb b/lib/square/types/catalog_item_option.rb new file mode 100644 index 000000000..9cee1530a --- /dev/null +++ b/lib/square/types/catalog_item_option.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # A group of variations for a `CatalogItem`. + class CatalogItemOption < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :display_name, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :show_colors, Internal::Types::Boolean, optional: true, nullable: false + field :values, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_item_option_for_item.rb b/lib/square/types/catalog_item_option_for_item.rb new file mode 100644 index 000000000..6889edd59 --- /dev/null +++ b/lib/square/types/catalog_item_option_for_item.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # An option that can be assigned to an item. + # For example, a t-shirt item may offer a color option or a size option. + class CatalogItemOptionForItem < Internal::Types::Model + field :item_option_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_item_option_value.rb b/lib/square/types/catalog_item_option_value.rb new file mode 100644 index 000000000..709d6d294 --- /dev/null +++ b/lib/square/types/catalog_item_option_value.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # An enumerated value that can link a + # `CatalogItemVariation` to an item option as one of + # its item option values. + class CatalogItemOptionValue < Internal::Types::Model + field :item_option_id, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :color, String, optional: true, nullable: false + field :ordinal, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_item_option_value_for_item_variation.rb b/lib/square/types/catalog_item_option_value_for_item_variation.rb new file mode 100644 index 000000000..e4b4133d4 --- /dev/null +++ b/lib/square/types/catalog_item_option_value_for_item_variation.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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". + class CatalogItemOptionValueForItemVariation < Internal::Types::Model + field :item_option_id, String, optional: true, nullable: false + field :item_option_value_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_item_product_type.rb b/lib/square/types/catalog_item_product_type.rb new file mode 100644 index 000000000..1f1816cd9 --- /dev/null +++ b/lib/square/types/catalog_item_product_type.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogItemProductType + extend Square::Internal::Types::Enum + REGULAR = "REGULAR" + GIFT_CARD = "GIFT_CARD" + APPOINTMENTS_SERVICE = "APPOINTMENTS_SERVICE" + FOOD_AND_BEV = "FOOD_AND_BEV" + EVENT = "EVENT" + DIGITAL = "DIGITAL" + DONATION = "DONATION" + LEGACY_SQUARE_ONLINE_SERVICE = "LEGACY_SQUARE_ONLINE_SERVICE" + LEGACY_SQUARE_ONLINE_MEMBERSHIP = "LEGACY_SQUARE_ONLINE_MEMBERSHIP"end + end +end diff --git a/lib/square/types/catalog_item_variation.rb b/lib/square/types/catalog_item_variation.rb new file mode 100644 index 000000000..638d2e796 --- /dev/null +++ b/lib/square/types/catalog_item_variation.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Square + module Types + # An item variation, representing a product for sale, in the Catalog object model. Each [item](entity:CatalogItem) must have at least one + # item variation and can have at most 250 item variations. + # + # An item variation can be sellable, stockable, or both if it has a unit of measure for its count for the sold number of the variation, the stocked + # number of the variation, or both. For example, when a variation representing wine is stocked and sold by the bottle, the variation is both + # stockable and sellable. But when a variation of the wine is sold by the glass, the sold units cannot be used as a measure of the stocked units. This by-the-glass + # variation is sellable, but not stockable. To accurately keep track of the wine's inventory count at any time, the sellable count must be + # converted to stockable count. Typically, the seller defines this unit conversion. For example, 1 bottle equals 5 glasses. The Square API exposes + # the `stockable_conversion` property on the variation to specify the conversion. Thus, when two glasses of the wine are sold, the sellable count + # decreases by 2, and the stockable count automatically decreases by 0.4 bottle according to the conversion. + class CatalogItemVariation < Internal::Types::Model + field :item_id, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :sku, String, optional: true, nullable: false + field :upc, String, optional: true, nullable: false + field :ordinal, Integer, optional: true, nullable: false + field :pricing_type, Square::Types::CatalogPricingType, optional: true, nullable: false + field :price_money, Square::Types::Money, optional: true, nullable: false + field :location_overrides, Internal::Types::Array[Square::Types::ItemVariationLocationOverrides], optional: true, nullable: false + field :track_inventory, Internal::Types::Boolean, optional: true, nullable: false + field :inventory_alert_type, Square::Types::InventoryAlertType, optional: true, nullable: false + field :inventory_alert_threshold, Integer, optional: true, nullable: false + field :user_data, String, optional: true, nullable: false + field :service_duration, Integer, optional: true, nullable: false + field :available_for_booking, Internal::Types::Boolean, optional: true, nullable: false + field :item_option_values, Internal::Types::Array[Square::Types::CatalogItemOptionValueForItemVariation], optional: true, nullable: false + field :measurement_unit_id, String, optional: true, nullable: false + field :sellable, Internal::Types::Boolean, optional: true, nullable: false + field :stockable, Internal::Types::Boolean, optional: true, nullable: false + field :image_ids, Internal::Types::Array[String], optional: true, nullable: false + field :team_member_ids, Internal::Types::Array[String], optional: true, nullable: false + field :stockable_conversion, Square::Types::CatalogStockConversion, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_measurement_unit.rb b/lib/square/types/catalog_measurement_unit.rb new file mode 100644 index 000000000..c1f5da3b4 --- /dev/null +++ b/lib/square/types/catalog_measurement_unit.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the unit used to measure a `CatalogItemVariation` and + # specifies the precision for decimal quantities. + class CatalogMeasurementUnit < Internal::Types::Model + field :measurement_unit, Square::Types::MeasurementUnit, optional: true, nullable: false + field :precision, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_modifier.rb b/lib/square/types/catalog_modifier.rb new file mode 100644 index 000000000..8b1b2ae6b --- /dev/null +++ b/lib/square/types/catalog_modifier.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # A modifier that can be applied to items at the time of sale. For example, a cheese modifier for a burger, or a flavor modifier for a serving of ice cream. + class CatalogModifier < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :price_money, Square::Types::Money, optional: true, nullable: false + field :on_by_default, Internal::Types::Boolean, optional: true, nullable: false + field :ordinal, Integer, optional: true, nullable: false + field :modifier_list_id, String, optional: true, nullable: false + field :location_overrides, Internal::Types::Array[Square::Types::ModifierLocationOverrides], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + field :hidden_online, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_modifier_list.rb b/lib/square/types/catalog_modifier_list.rb new file mode 100644 index 000000000..56c0c9daf --- /dev/null +++ b/lib/square/types/catalog_modifier_list.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Square + module Types + # A container for a list of modifiers, or a text-based modifier. + # For text-based modifiers, this represents text configuration for an item. (For example, custom text to print on a t-shirt). + # For non text-based modifiers, this represents a list of modifiers that can be applied to items at the time of sale. + # (For example, a list of condiments for a hot dog, or a list of ice cream flavors). + # Each element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type. + class CatalogModifierList < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :ordinal, Integer, optional: true, nullable: false + field :selection_type, Square::Types::CatalogModifierListSelectionType, optional: true, nullable: false + field :modifiers, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + field :image_ids, Internal::Types::Array[String], optional: true, nullable: false + field :allow_quantities, Internal::Types::Boolean, optional: true, nullable: false + field :is_conversational, Internal::Types::Boolean, optional: true, nullable: false + field :modifier_type, Square::Types::CatalogModifierListModifierType, optional: true, nullable: false + field :max_length, Integer, optional: true, nullable: false + field :text_required, Internal::Types::Boolean, optional: true, nullable: false + field :internal_name, String, optional: true, nullable: false + field :min_selected_modifiers, Integer, optional: true, nullable: false + field :max_selected_modifiers, Integer, optional: true, nullable: false + field :hidden_from_customer, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_modifier_list_modifier_type.rb b/lib/square/types/catalog_modifier_list_modifier_type.rb new file mode 100644 index 000000000..d6a6d3547 --- /dev/null +++ b/lib/square/types/catalog_modifier_list_modifier_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogModifierListModifierType + extend Square::Internal::Types::Enum + LIST = "LIST" + TEXT = "TEXT"end + end +end diff --git a/lib/square/types/catalog_modifier_list_selection_type.rb b/lib/square/types/catalog_modifier_list_selection_type.rb new file mode 100644 index 000000000..74e33353c --- /dev/null +++ b/lib/square/types/catalog_modifier_list_selection_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogModifierListSelectionType + extend Square::Internal::Types::Enum + SINGLE = "SINGLE" + MULTIPLE = "MULTIPLE"end + end +end diff --git a/lib/square/types/catalog_modifier_override.rb b/lib/square/types/catalog_modifier_override.rb new file mode 100644 index 000000000..6c951b1e9 --- /dev/null +++ b/lib/square/types/catalog_modifier_override.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Options to control how to override the default behavior of the specified modifier. + class CatalogModifierOverride < Internal::Types::Model + field :modifier_id, String, optional: false, nullable: false + field :on_by_default, Internal::Types::Boolean, optional: true, nullable: false + field :hidden_online_override, Internal::Types::Hash[String, ], optional: true, nullable: false + field :on_by_default_override, Internal::Types::Hash[String, ], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_availability_period.rb b/lib/square/types/catalog_object_availability_period.rb new file mode 100644 index 000000000..98a27c32a --- /dev/null +++ b/lib/square/types/catalog_object_availability_period.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectAvailabilityPeriod < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :availability_period_data, Square::Types::CatalogAvailabilityPeriod, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_base.rb b/lib/square/types/catalog_object_base.rb new file mode 100644 index 000000000..75bf25d17 --- /dev/null +++ b/lib/square/types/catalog_object_base.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectBase < Internal::Types::Model + field :type, Square::Types::CatalogObjectType, optional: false, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_batch.rb b/lib/square/types/catalog_object_batch.rb new file mode 100644 index 000000000..838eb3287 --- /dev/null +++ b/lib/square/types/catalog_object_batch.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # A batch of catalog objects. + class CatalogObjectBatch < Internal::Types::Model + field :objects, Internal::Types::Array[Square::Types::CatalogObject], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_category.rb b/lib/square/types/catalog_object_category.rb new file mode 100644 index 000000000..11326a5cc --- /dev/null +++ b/lib/square/types/catalog_object_category.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CatalogObjectCategory < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :ordinal, Integer, optional: true, nullable: false + field :type, String, optional: false, nullable: false + field :category_data, Square::Types::CatalogCategory, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_custom_attribute_definition.rb b/lib/square/types/catalog_object_custom_attribute_definition.rb new file mode 100644 index 000000000..9624cb67c --- /dev/null +++ b/lib/square/types/catalog_object_custom_attribute_definition.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectCustomAttributeDefinition < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :custom_attribute_definition_data, Square::Types::CatalogCustomAttributeDefinition, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_discount.rb b/lib/square/types/catalog_object_discount.rb new file mode 100644 index 000000000..06451f8d0 --- /dev/null +++ b/lib/square/types/catalog_object_discount.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectDiscount < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :discount_data, Square::Types::CatalogDiscount, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_image.rb b/lib/square/types/catalog_object_image.rb new file mode 100644 index 000000000..9bfcaa08b --- /dev/null +++ b/lib/square/types/catalog_object_image.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectImage < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :image_data, Square::Types::CatalogImage, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_item.rb b/lib/square/types/catalog_object_item.rb new file mode 100644 index 000000000..74746be61 --- /dev/null +++ b/lib/square/types/catalog_object_item.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectItem < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :item_data, Square::Types::CatalogItem, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_item_option.rb b/lib/square/types/catalog_object_item_option.rb new file mode 100644 index 000000000..271df701b --- /dev/null +++ b/lib/square/types/catalog_object_item_option.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectItemOption < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :item_option_data, Square::Types::CatalogItemOption, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_item_option_value.rb b/lib/square/types/catalog_object_item_option_value.rb new file mode 100644 index 000000000..7c7862f35 --- /dev/null +++ b/lib/square/types/catalog_object_item_option_value.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectItemOptionValue < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :item_option_value_data, Square::Types::CatalogItemOptionValue, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_item_variation.rb b/lib/square/types/catalog_object_item_variation.rb new file mode 100644 index 000000000..f0cb4ee6e --- /dev/null +++ b/lib/square/types/catalog_object_item_variation.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectItemVariation < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :item_variation_data, Square::Types::CatalogItemVariation, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_measurement_unit.rb b/lib/square/types/catalog_object_measurement_unit.rb new file mode 100644 index 000000000..7d096808a --- /dev/null +++ b/lib/square/types/catalog_object_measurement_unit.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectMeasurementUnit < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :measurement_unit_data, Square::Types::CatalogMeasurementUnit, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_modifier.rb b/lib/square/types/catalog_object_modifier.rb new file mode 100644 index 000000000..2299cb3dd --- /dev/null +++ b/lib/square/types/catalog_object_modifier.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectModifier < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :modifier_data, Square::Types::CatalogModifier, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_modifier_list.rb b/lib/square/types/catalog_object_modifier_list.rb new file mode 100644 index 000000000..9da9c04d8 --- /dev/null +++ b/lib/square/types/catalog_object_modifier_list.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectModifierList < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :modifier_list_data, Square::Types::CatalogModifierList, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_pricing_rule.rb b/lib/square/types/catalog_object_pricing_rule.rb new file mode 100644 index 000000000..6a8c22b0b --- /dev/null +++ b/lib/square/types/catalog_object_pricing_rule.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectPricingRule < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :pricing_rule_data, Square::Types::CatalogPricingRule, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_product_set.rb b/lib/square/types/catalog_object_product_set.rb new file mode 100644 index 000000000..9068ba1aa --- /dev/null +++ b/lib/square/types/catalog_object_product_set.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectProductSet < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :product_set_data, Square::Types::CatalogProductSet, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_quick_amounts_settings.rb b/lib/square/types/catalog_object_quick_amounts_settings.rb new file mode 100644 index 000000000..30da8088c --- /dev/null +++ b/lib/square/types/catalog_object_quick_amounts_settings.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectQuickAmountsSettings < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :quick_amounts_settings_data, Square::Types::CatalogQuickAmountsSettings, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_reference.rb b/lib/square/types/catalog_object_reference.rb new file mode 100644 index 000000000..b7bb54a95 --- /dev/null +++ b/lib/square/types/catalog_object_reference.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CatalogObjectReference < Internal::Types::Model + field :object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_subscription_plan.rb b/lib/square/types/catalog_object_subscription_plan.rb new file mode 100644 index 000000000..ade12b8f3 --- /dev/null +++ b/lib/square/types/catalog_object_subscription_plan.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectSubscriptionPlan < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :subscription_plan_data, Square::Types::CatalogSubscriptionPlan, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_subscription_plan_variation.rb b/lib/square/types/catalog_object_subscription_plan_variation.rb new file mode 100644 index 000000000..9677410cc --- /dev/null +++ b/lib/square/types/catalog_object_subscription_plan_variation.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectSubscriptionPlanVariation < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :subscription_plan_variation_data, Square::Types::CatalogSubscriptionPlanVariation, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_tax.rb b/lib/square/types/catalog_object_tax.rb new file mode 100644 index 000000000..aa9ea0289 --- /dev/null +++ b/lib/square/types/catalog_object_tax.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectTax < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :tax_data, Square::Types::CatalogTax, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_time_period.rb b/lib/square/types/catalog_object_time_period.rb new file mode 100644 index 000000000..d99e66ac4 --- /dev/null +++ b/lib/square/types/catalog_object_time_period.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogObjectTimePeriod < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :time_period_data, Square::Types::CatalogTimePeriod, optional: true, nullable: false + field :id, String, optional: false, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :custom_attribute_values, Internal::Types::Hash[String, Square::Types::CatalogCustomAttributeValue], optional: true, nullable: false + field :catalog_v_1_ids, Internal::Types::Array[Square::Types::CatalogV1Id], optional: true, nullable: false + field :present_at_all_locations, Internal::Types::Boolean, optional: true, nullable: false + field :present_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :absent_at_location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :image_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_object_type.rb b/lib/square/types/catalog_object_type.rb new file mode 100644 index 000000000..e55c48547 --- /dev/null +++ b/lib/square/types/catalog_object_type.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogObjectType + extend Square::Internal::Types::Enum + ITEM = "ITEM" + IMAGE = "IMAGE" + CATEGORY = "CATEGORY" + ITEM_VARIATION = "ITEM_VARIATION" + TAX = "TAX" + DISCOUNT = "DISCOUNT" + MODIFIER_LIST = "MODIFIER_LIST" + MODIFIER = "MODIFIER" + PRICING_RULE = "PRICING_RULE" + PRODUCT_SET = "PRODUCT_SET" + TIME_PERIOD = "TIME_PERIOD" + MEASUREMENT_UNIT = "MEASUREMENT_UNIT" + SUBSCRIPTION_PLAN_VARIATION = "SUBSCRIPTION_PLAN_VARIATION" + ITEM_OPTION = "ITEM_OPTION" + ITEM_OPTION_VAL = "ITEM_OPTION_VAL" + CUSTOM_ATTRIBUTE_DEFINITION = "CUSTOM_ATTRIBUTE_DEFINITION" + QUICK_AMOUNTS_SETTINGS = "QUICK_AMOUNTS_SETTINGS" + SUBSCRIPTION_PLAN = "SUBSCRIPTION_PLAN" + AVAILABILITY_PERIOD = "AVAILABILITY_PERIOD"end + end +end diff --git a/lib/square/types/catalog_pricing_rule.rb b/lib/square/types/catalog_pricing_rule.rb new file mode 100644 index 000000000..607e52a1b --- /dev/null +++ b/lib/square/types/catalog_pricing_rule.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines how discounts are automatically applied to a set of items that match the pricing rule + # during the active time period. + class CatalogPricingRule < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :time_period_ids, Internal::Types::Array[String], optional: true, nullable: false + field :discount_id, String, optional: true, nullable: false + field :match_products_id, String, optional: true, nullable: false + field :apply_products_id, String, optional: true, nullable: false + field :exclude_products_id, String, optional: true, nullable: false + field :valid_from_date, String, optional: true, nullable: false + field :valid_from_local_time, String, optional: true, nullable: false + field :valid_until_date, String, optional: true, nullable: false + field :valid_until_local_time, String, optional: true, nullable: false + field :exclude_strategy, Square::Types::ExcludeStrategy, optional: true, nullable: false + field :minimum_order_subtotal_money, Square::Types::Money, optional: true, nullable: false + field :customer_group_ids_any, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_pricing_type.rb b/lib/square/types/catalog_pricing_type.rb new file mode 100644 index 000000000..e2095b33e --- /dev/null +++ b/lib/square/types/catalog_pricing_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogPricingType + extend Square::Internal::Types::Enum + FIXED_PRICING = "FIXED_PRICING" + VARIABLE_PRICING = "VARIABLE_PRICING"end + end +end diff --git a/lib/square/types/catalog_product_set.rb b/lib/square/types/catalog_product_set.rb new file mode 100644 index 000000000..eaa23eb4d --- /dev/null +++ b/lib/square/types/catalog_product_set.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CatalogProductSet < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :product_ids_any, Internal::Types::Array[String], optional: true, nullable: false + field :product_ids_all, Internal::Types::Array[String], optional: true, nullable: false + field :quantity_exact, Integer, optional: true, nullable: false + field :quantity_min, Integer, optional: true, nullable: false + field :quantity_max, Integer, optional: true, nullable: false + field :all_products, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query.rb b/lib/square/types/catalog_query.rb new file mode 100644 index 000000000..c36a759f9 --- /dev/null +++ b/lib/square/types/catalog_query.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Square + module Types + # A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint. + # + # Although a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). + # Any combination of the following types may be used together: + # - [exact_query](entity:CatalogQueryExact) + # - [prefix_query](entity:CatalogQueryPrefix) + # - [range_query](entity:CatalogQueryRange) + # - [sorted_attribute_query](entity:CatalogQuerySortedAttribute) + # - [text_query](entity:CatalogQueryText) + # + # All other query types cannot be combined with any others. + # + # When a query filter is based on an attribute, the attribute must be searchable. + # Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters. + # + # Searchable attribute and objects queryable by searchable attributes: + # - `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, `CatalogModifierList`, `CatalogItemOption`, `CatalogItemOptionValue` + # - `description`: `CatalogItem`, `CatalogItemOptionValue` + # - `abbreviation`: `CatalogItem` + # - `upc`: `CatalogItemVariation` + # - `sku`: `CatalogItemVariation` + # - `caption`: `CatalogImage` + # - `display_name`: `CatalogItemOption` + # + # For example, to search for [CatalogItem](entity:CatalogItem) objects by searchable attributes, you can use + # the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. + class CatalogQuery < Internal::Types::Model + field :sorted_attribute_query, Square::Types::CatalogQuerySortedAttribute, optional: true, nullable: false + field :exact_query, Square::Types::CatalogQueryExact, optional: true, nullable: false + field :set_query, Square::Types::CatalogQuerySet, optional: true, nullable: false + field :prefix_query, Square::Types::CatalogQueryPrefix, optional: true, nullable: false + field :range_query, Square::Types::CatalogQueryRange, optional: true, nullable: false + field :text_query, Square::Types::CatalogQueryText, optional: true, nullable: false + field :items_for_tax_query, Square::Types::CatalogQueryItemsForTax, optional: true, nullable: false + field :items_for_modifier_list_query, Square::Types::CatalogQueryItemsForModifierList, optional: true, nullable: false + field :items_for_item_options_query, Square::Types::CatalogQueryItemsForItemOptions, optional: true, nullable: false + field :item_variations_for_item_option_values_query, Square::Types::CatalogQueryItemVariationsForItemOptionValues, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query_exact.rb b/lib/square/types/catalog_query_exact.rb new file mode 100644 index 000000000..a21911eb1 --- /dev/null +++ b/lib/square/types/catalog_query_exact.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The query filter to return the search result by exact match of the specified attribute name and value. + class CatalogQueryExact < Internal::Types::Model + field :attribute_name, String, optional: false, nullable: false + field :attribute_value, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query_item_variations_for_item_option_values.rb b/lib/square/types/catalog_query_item_variations_for_item_option_values.rb new file mode 100644 index 000000000..2b9761339 --- /dev/null +++ b/lib/square/types/catalog_query_item_variations_for_item_option_values.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # The query filter to return the item variations containing the specified item option value IDs. + class CatalogQueryItemVariationsForItemOptionValues < Internal::Types::Model + field :item_option_value_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query_items_for_item_options.rb b/lib/square/types/catalog_query_items_for_item_options.rb new file mode 100644 index 000000000..460a29860 --- /dev/null +++ b/lib/square/types/catalog_query_items_for_item_options.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # The query filter to return the items containing the specified item option IDs. + class CatalogQueryItemsForItemOptions < Internal::Types::Model + field :item_option_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query_items_for_modifier_list.rb b/lib/square/types/catalog_query_items_for_modifier_list.rb new file mode 100644 index 000000000..f6fb0de79 --- /dev/null +++ b/lib/square/types/catalog_query_items_for_modifier_list.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # The query filter to return the items containing the specified modifier list IDs. + class CatalogQueryItemsForModifierList < Internal::Types::Model + field :modifier_list_ids, Internal::Types::Array[String], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query_items_for_tax.rb b/lib/square/types/catalog_query_items_for_tax.rb new file mode 100644 index 000000000..a7699a3f7 --- /dev/null +++ b/lib/square/types/catalog_query_items_for_tax.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # The query filter to return the items containing the specified tax IDs. + class CatalogQueryItemsForTax < Internal::Types::Model + field :tax_ids, Internal::Types::Array[String], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query_prefix.rb b/lib/square/types/catalog_query_prefix.rb new file mode 100644 index 000000000..9fd9f634d --- /dev/null +++ b/lib/square/types/catalog_query_prefix.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. + class CatalogQueryPrefix < Internal::Types::Model + field :attribute_name, String, optional: false, nullable: false + field :attribute_prefix, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query_range.rb b/lib/square/types/catalog_query_range.rb new file mode 100644 index 000000000..b8a059ba2 --- /dev/null +++ b/lib/square/types/catalog_query_range.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The query filter to return the search result whose named attribute values fall between the specified range. + class CatalogQueryRange < Internal::Types::Model + field :attribute_name, String, optional: false, nullable: false + field :attribute_min_value, Integer, optional: true, nullable: false + field :attribute_max_value, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query_set.rb b/lib/square/types/catalog_query_set.rb new file mode 100644 index 000000000..5c0ec36a8 --- /dev/null +++ b/lib/square/types/catalog_query_set.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of + # the `attribute_values`. + class CatalogQuerySet < Internal::Types::Model + field :attribute_name, String, optional: false, nullable: false + field :attribute_values, Internal::Types::Array[String], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query_sorted_attribute.rb b/lib/square/types/catalog_query_sorted_attribute.rb new file mode 100644 index 000000000..5aea2d60d --- /dev/null +++ b/lib/square/types/catalog_query_sorted_attribute.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The query expression to specify the key to sort search results. + class CatalogQuerySortedAttribute < Internal::Types::Model + field :attribute_name, String, optional: false, nullable: false + field :initial_attribute_value, String, optional: true, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_query_text.rb b/lib/square/types/catalog_query_text.rb new file mode 100644 index 000000000..0b6bde34c --- /dev/null +++ b/lib/square/types/catalog_query_text.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CatalogQueryText < Internal::Types::Model + field :keywords, Internal::Types::Array[String], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_quick_amount.rb b/lib/square/types/catalog_quick_amount.rb new file mode 100644 index 000000000..0094ee60c --- /dev/null +++ b/lib/square/types/catalog_quick_amount.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a Quick Amount in the Catalog. + class CatalogQuickAmount < Internal::Types::Model + field :type, Square::Types::CatalogQuickAmountType, optional: false, nullable: false + field :amount, Square::Types::Money, optional: false, nullable: false + field :score, Integer, optional: true, nullable: false + field :ordinal, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_quick_amount_type.rb b/lib/square/types/catalog_quick_amount_type.rb new file mode 100644 index 000000000..690d89db8 --- /dev/null +++ b/lib/square/types/catalog_quick_amount_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogQuickAmountType + extend Square::Internal::Types::Enum + QUICK_AMOUNT_TYPE_MANUAL = "QUICK_AMOUNT_TYPE_MANUAL" + QUICK_AMOUNT_TYPE_AUTO = "QUICK_AMOUNT_TYPE_AUTO"end + end +end diff --git a/lib/square/types/catalog_quick_amounts_settings.rb b/lib/square/types/catalog_quick_amounts_settings.rb new file mode 100644 index 000000000..c2bfff429 --- /dev/null +++ b/lib/square/types/catalog_quick_amounts_settings.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. + class CatalogQuickAmountsSettings < Internal::Types::Model + field :option, Square::Types::CatalogQuickAmountsSettingsOption, optional: false, nullable: false + field :eligible_for_auto_amounts, Internal::Types::Boolean, optional: true, nullable: false + field :amounts, Internal::Types::Array[Square::Types::CatalogQuickAmount], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_quick_amounts_settings_option.rb b/lib/square/types/catalog_quick_amounts_settings_option.rb new file mode 100644 index 000000000..941de370f --- /dev/null +++ b/lib/square/types/catalog_quick_amounts_settings_option.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module CatalogQuickAmountsSettingsOption + extend Square::Internal::Types::Enum + DISABLED = "DISABLED" + MANUAL = "MANUAL" + AUTO = "AUTO"end + end +end diff --git a/lib/square/types/catalog_stock_conversion.rb b/lib/square/types/catalog_stock_conversion.rb new file mode 100644 index 000000000..3d5908192 --- /dev/null +++ b/lib/square/types/catalog_stock_conversion.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the rule of conversion between a stockable [CatalogItemVariation](entity:CatalogItemVariation) + # and a non-stockable sell-by or receive-by `CatalogItemVariation` that + # share the same underlying stock. + class CatalogStockConversion < Internal::Types::Model + field :stockable_item_variation_id, String, optional: false, nullable: false + field :stockable_quantity, String, optional: false, nullable: false + field :nonstockable_quantity, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_subscription_plan.rb b/lib/square/types/catalog_subscription_plan.rb new file mode 100644 index 000000000..a4c3a37c5 --- /dev/null +++ b/lib/square/types/catalog_subscription_plan.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class CatalogSubscriptionPlan < Internal::Types::Model + field :name, String, optional: false, nullable: false + field :phases, Internal::Types::Array[Square::Types::SubscriptionPhase], optional: true, nullable: false + field :subscription_plan_variations, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + field :eligible_item_ids, Internal::Types::Array[String], optional: true, nullable: false + field :eligible_category_ids, Internal::Types::Array[String], optional: true, nullable: false + field :all_items, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_subscription_plan_variation.rb b/lib/square/types/catalog_subscription_plan_variation.rb new file mode 100644 index 000000000..49d18b78e --- /dev/null +++ b/lib/square/types/catalog_subscription_plan_variation.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class CatalogSubscriptionPlanVariation < Internal::Types::Model + field :name, String, optional: false, nullable: false + field :phases, Internal::Types::Array[Square::Types::SubscriptionPhase], optional: false, nullable: false + field :subscription_plan_id, String, optional: true, nullable: false + field :monthly_billing_anchor_date, Integer, optional: true, nullable: false + field :can_prorate, Internal::Types::Boolean, optional: true, nullable: false + field :successor_plan_variation_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_tax.rb b/lib/square/types/catalog_tax.rb new file mode 100644 index 000000000..e7db70d45 --- /dev/null +++ b/lib/square/types/catalog_tax.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # A tax applicable to an item. + class CatalogTax < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :calculation_phase, Square::Types::TaxCalculationPhase, optional: true, nullable: false + field :inclusion_type, Square::Types::TaxInclusionType, optional: true, nullable: false + field :percentage, String, optional: true, nullable: false + field :applies_to_custom_amounts, Internal::Types::Boolean, optional: true, nullable: false + field :enabled, Internal::Types::Boolean, optional: true, nullable: false + field :applies_to_product_set_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_time_period.rb b/lib/square/types/catalog_time_period.rb new file mode 100644 index 000000000..e63fbf844 --- /dev/null +++ b/lib/square/types/catalog_time_period.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a time period - either a single period or a repeating period. + class CatalogTimePeriod < Internal::Types::Model + field :event, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_v_1_id.rb b/lib/square/types/catalog_v_1_id.rb new file mode 100644 index 000000000..34876c328 --- /dev/null +++ b/lib/square/types/catalog_v_1_id.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A Square API V1 identifier of an item, including the object ID and its associated location ID. + class CatalogV1Id < Internal::Types::Model + field :catalog_v_1_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_version_updated_event.rb b/lib/square/types/catalog_version_updated_event.rb new file mode 100644 index 000000000..c32f9b475 --- /dev/null +++ b/lib/square/types/catalog_version_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when the catalog is updated. + class CatalogVersionUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CatalogVersionUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_version_updated_event_catalog_version.rb b/lib/square/types/catalog_version_updated_event_catalog_version.rb new file mode 100644 index 000000000..2a41f9849 --- /dev/null +++ b/lib/square/types/catalog_version_updated_event_catalog_version.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogVersionUpdatedEventCatalogVersion < Internal::Types::Model + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_version_updated_event_data.rb b/lib/square/types/catalog_version_updated_event_data.rb new file mode 100644 index 000000000..8ea6c2be4 --- /dev/null +++ b/lib/square/types/catalog_version_updated_event_data.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogVersionUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :object, Square::Types::CatalogVersionUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/catalog_version_updated_event_object.rb b/lib/square/types/catalog_version_updated_event_object.rb new file mode 100644 index 000000000..20c2f9b5b --- /dev/null +++ b/lib/square/types/catalog_version_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CatalogVersionUpdatedEventObject < Internal::Types::Model + field :catalog_version, Square::Types::CatalogVersionUpdatedEventCatalogVersion, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/category_path_to_root_node.rb b/lib/square/types/category_path_to_root_node.rb new file mode 100644 index 000000000..c1095268a --- /dev/null +++ b/lib/square/types/category_path_to_root_node.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A node in the path from a retrieved category to its root node. + class CategoryPathToRootNode < Internal::Types::Model + field :category_id, String, optional: true, nullable: false + field :category_name, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/change_billing_anchor_date_response.rb b/lib/square/types/change_billing_anchor_date_response.rb new file mode 100644 index 000000000..1117f6c91 --- /dev/null +++ b/lib/square/types/change_billing_anchor_date_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a request to the + # [ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint. + class ChangeBillingAnchorDateResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::Subscription, optional: true, nullable: false + field :actions, Internal::Types::Array[Square::Types::SubscriptionAction], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/change_timing.rb b/lib/square/types/change_timing.rb new file mode 100644 index 000000000..955c03235 --- /dev/null +++ b/lib/square/types/change_timing.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module ChangeTiming + extend Square::Internal::Types::Enum + IMMEDIATE = "IMMEDIATE" + END_OF_BILLING_CYCLE = "END_OF_BILLING_CYCLE"end + end +end diff --git a/lib/square/types/charge_request_additional_recipient.rb b/lib/square/types/charge_request_additional_recipient.rb new file mode 100644 index 000000000..ea6d47fcc --- /dev/null +++ b/lib/square/types/charge_request_additional_recipient.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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 + class ChargeRequestAdditionalRecipient < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :description, String, optional: false, nullable: false + field :amount_money, Square::Types::Money, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/checkout.rb b/lib/square/types/checkout.rb new file mode 100644 index 000000000..94551cd52 --- /dev/null +++ b/lib/square/types/checkout.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # Square Checkout lets merchants accept online payments for supported + # payment types using a checkout workflow hosted on squareup.com. + class Checkout < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :checkout_page_url, String, optional: true, nullable: false + field :ask_for_shipping_address, Internal::Types::Boolean, optional: true, nullable: false + field :merchant_support_email, String, optional: true, nullable: false + field :pre_populate_buyer_email, String, optional: true, nullable: false + field :pre_populate_shipping_address, Square::Types::Address, optional: true, nullable: false + field :redirect_url, String, optional: true, nullable: false + field :order, Square::Types::Order, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :additional_recipients, Internal::Types::Array[Square::Types::AdditionalRecipient], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_location_settings.rb b/lib/square/types/checkout_location_settings.rb new file mode 100644 index 000000000..ca03ecbe8 --- /dev/null +++ b/lib/square/types/checkout_location_settings.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + class CheckoutLocationSettings < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + field :customer_notes_enabled, Internal::Types::Boolean, optional: true, nullable: false + field :policies, Internal::Types::Array[Square::Types::CheckoutLocationSettingsPolicy], optional: true, nullable: false + field :branding, Square::Types::CheckoutLocationSettingsBranding, optional: true, nullable: false + field :tipping, Square::Types::CheckoutLocationSettingsTipping, optional: true, nullable: false + field :coupons, Square::Types::CheckoutLocationSettingsCoupons, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_location_settings_branding.rb b/lib/square/types/checkout_location_settings_branding.rb new file mode 100644 index 000000000..6851f41cf --- /dev/null +++ b/lib/square/types/checkout_location_settings_branding.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class CheckoutLocationSettingsBranding < Internal::Types::Model + field :header_type, Square::Types::CheckoutLocationSettingsBrandingHeaderType, optional: true, nullable: false + field :button_color, String, optional: true, nullable: false + field :button_shape, Square::Types::CheckoutLocationSettingsBrandingButtonShape, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_location_settings_branding_button_shape.rb b/lib/square/types/checkout_location_settings_branding_button_shape.rb new file mode 100644 index 000000000..1afb88062 --- /dev/null +++ b/lib/square/types/checkout_location_settings_branding_button_shape.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module CheckoutLocationSettingsBrandingButtonShape + extend Square::Internal::Types::Enum + SQUARED = "SQUARED" + ROUNDED = "ROUNDED" + PILL = "PILL"end + end +end diff --git a/lib/square/types/checkout_location_settings_branding_header_type.rb b/lib/square/types/checkout_location_settings_branding_header_type.rb new file mode 100644 index 000000000..91f5adaea --- /dev/null +++ b/lib/square/types/checkout_location_settings_branding_header_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module CheckoutLocationSettingsBrandingHeaderType + extend Square::Internal::Types::Enum + BUSINESS_NAME = "BUSINESS_NAME" + FRAMED_LOGO = "FRAMED_LOGO" + FULL_WIDTH_LOGO = "FULL_WIDTH_LOGO"end + end +end diff --git a/lib/square/types/checkout_location_settings_coupons.rb b/lib/square/types/checkout_location_settings_coupons.rb new file mode 100644 index 000000000..69debfe47 --- /dev/null +++ b/lib/square/types/checkout_location_settings_coupons.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CheckoutLocationSettingsCoupons < Internal::Types::Model + field :enabled, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_location_settings_policy.rb b/lib/square/types/checkout_location_settings_policy.rb new file mode 100644 index 000000000..064dc4689 --- /dev/null +++ b/lib/square/types/checkout_location_settings_policy.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class CheckoutLocationSettingsPolicy < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :title, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_location_settings_tipping.rb b/lib/square/types/checkout_location_settings_tipping.rb new file mode 100644 index 000000000..e50b4b2a6 --- /dev/null +++ b/lib/square/types/checkout_location_settings_tipping.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + class CheckoutLocationSettingsTipping < Internal::Types::Model + field :percentages, Internal::Types::Array[Integer], optional: true, nullable: false + field :smart_tipping_enabled, Internal::Types::Boolean, optional: true, nullable: false + field :default_percent, Integer, optional: true, nullable: false + field :smart_tips, Internal::Types::Array[Square::Types::Money], optional: true, nullable: false + field :default_smart_tip, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_merchant_settings.rb b/lib/square/types/checkout_merchant_settings.rb new file mode 100644 index 000000000..fc868bd42 --- /dev/null +++ b/lib/square/types/checkout_merchant_settings.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CheckoutMerchantSettings < Internal::Types::Model + field :payment_methods, Square::Types::CheckoutMerchantSettingsPaymentMethods, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_merchant_settings_payment_methods.rb b/lib/square/types/checkout_merchant_settings_payment_methods.rb new file mode 100644 index 000000000..fd35dc656 --- /dev/null +++ b/lib/square/types/checkout_merchant_settings_payment_methods.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class CheckoutMerchantSettingsPaymentMethods < Internal::Types::Model + field :apple_pay, Square::Types::CheckoutMerchantSettingsPaymentMethodsPaymentMethod, optional: true, nullable: false + field :google_pay, Square::Types::CheckoutMerchantSettingsPaymentMethodsPaymentMethod, optional: true, nullable: false + field :cash_app, Square::Types::CheckoutMerchantSettingsPaymentMethodsPaymentMethod, optional: true, nullable: false + field :afterpay_clearpay, Square::Types::CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay.rb b/lib/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay.rb new file mode 100644 index 000000000..3e7ec2848 --- /dev/null +++ b/lib/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The settings allowed for AfterpayClearpay. + class CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay < Internal::Types::Model + field :order_eligibility_range, Square::Types::CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange, optional: true, nullable: false + field :item_eligibility_range, Square::Types::CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange, optional: true, nullable: false + field :enabled, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range.rb b/lib/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range.rb new file mode 100644 index 000000000..3ea4edc04 --- /dev/null +++ b/lib/square/types/checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A range of purchase price that qualifies. + class CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange < Internal::Types::Model + field :min, Square::Types::Money, optional: false, nullable: false + field :max, Square::Types::Money, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_merchant_settings_payment_methods_payment_method.rb b/lib/square/types/checkout_merchant_settings_payment_methods_payment_method.rb new file mode 100644 index 000000000..a375da2bf --- /dev/null +++ b/lib/square/types/checkout_merchant_settings_payment_methods_payment_method.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # The settings allowed for a payment method. + class CheckoutMerchantSettingsPaymentMethodsPaymentMethod < Internal::Types::Model + field :enabled, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_options.rb b/lib/square/types/checkout_options.rb new file mode 100644 index 000000000..6e1fcf09a --- /dev/null +++ b/lib/square/types/checkout_options.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + class CheckoutOptions < Internal::Types::Model + field :allow_tipping, Internal::Types::Boolean, optional: true, nullable: false + field :custom_fields, Internal::Types::Array[Square::Types::CustomField], optional: true, nullable: false + field :subscription_plan_id, String, optional: true, nullable: false + field :redirect_url, String, optional: true, nullable: false + field :merchant_support_email, String, optional: true, nullable: false + field :ask_for_shipping_address, Internal::Types::Boolean, optional: true, nullable: false + field :accepted_payment_methods, Square::Types::AcceptedPaymentMethods, optional: true, nullable: false + field :app_fee_money, Square::Types::Money, optional: true, nullable: false + field :shipping_fee, Square::Types::ShippingFee, optional: true, nullable: false + field :enable_coupon, Internal::Types::Boolean, optional: true, nullable: false + field :enable_loyalty, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/checkout_options_payment_type.rb b/lib/square/types/checkout_options_payment_type.rb new file mode 100644 index 000000000..9df8aae3a --- /dev/null +++ b/lib/square/types/checkout_options_payment_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + module CheckoutOptionsPaymentType + extend Square::Internal::Types::Enum + CARD_PRESENT = "CARD_PRESENT" + MANUAL_CARD_ENTRY = "MANUAL_CARD_ENTRY" + FELICA_ID = "FELICA_ID" + FELICA_QUICPAY = "FELICA_QUICPAY" + FELICA_TRANSPORTATION_GROUP = "FELICA_TRANSPORTATION_GROUP" + FELICA_ALL = "FELICA_ALL" + PAYPAY = "PAYPAY" + QR_CODE = "QR_CODE"end + end +end diff --git a/lib/square/types/clearpay_details.rb b/lib/square/types/clearpay_details.rb new file mode 100644 index 000000000..2fe0e5482 --- /dev/null +++ b/lib/square/types/clearpay_details.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Additional details about Clearpay payments. + class ClearpayDetails < Internal::Types::Model + field :email_address, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/clone_order_response.rb b/lib/square/types/clone_order_response.rb new file mode 100644 index 000000000..8a25d972a --- /dev/null +++ b/lib/square/types/clone_order_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [CloneOrder](api-endpoint:Orders-CloneOrder) endpoint. + class CloneOrderResponse < Internal::Types::Model + field :order, Square::Types::Order, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/collected_data.rb b/lib/square/types/collected_data.rb new file mode 100644 index 000000000..246ffd8eb --- /dev/null +++ b/lib/square/types/collected_data.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CollectedData < Internal::Types::Model + field :input_text, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/complete_payment_response.rb b/lib/square/types/complete_payment_response.rb new file mode 100644 index 000000000..e23f815b1 --- /dev/null +++ b/lib/square/types/complete_payment_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response returned by[CompletePayment](api-endpoint:Payments-CompletePayment). + class CompletePaymentResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :payment, Square::Types::Payment, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/component.rb b/lib/square/types/component.rb new file mode 100644 index 000000000..ef4bf3691 --- /dev/null +++ b/lib/square/types/component.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # The wrapper object for the component entries of a given component type. + class Component < Internal::Types::Model + field :type, Square::Types::ComponentComponentType, optional: false, nullable: false + field :application_details, Square::Types::DeviceComponentDetailsApplicationDetails, optional: true, nullable: false + field :card_reader_details, Square::Types::DeviceComponentDetailsCardReaderDetails, optional: true, nullable: false + field :battery_details, Square::Types::DeviceComponentDetailsBatteryDetails, optional: true, nullable: false + field :wifi_details, Square::Types::DeviceComponentDetailsWiFiDetails, optional: true, nullable: false + field :ethernet_details, Square::Types::DeviceComponentDetailsEthernetDetails, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/component_component_type.rb b/lib/square/types/component_component_type.rb new file mode 100644 index 000000000..62a54e95f --- /dev/null +++ b/lib/square/types/component_component_type.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + module ComponentComponentType + extend Square::Internal::Types::Enum + APPLICATION = "APPLICATION" + CARD_READER = "CARD_READER" + BATTERY = "BATTERY" + WIFI = "WIFI" + ETHERNET = "ETHERNET" + PRINTER = "PRINTER"end + end +end diff --git a/lib/square/types/confirmation_decision.rb b/lib/square/types/confirmation_decision.rb new file mode 100644 index 000000000..74defc99d --- /dev/null +++ b/lib/square/types/confirmation_decision.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class ConfirmationDecision < Internal::Types::Model + field :has_agreed, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/confirmation_options.rb b/lib/square/types/confirmation_options.rb new file mode 100644 index 000000000..fd10f663f --- /dev/null +++ b/lib/square/types/confirmation_options.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + class ConfirmationOptions < Internal::Types::Model + field :title, String, optional: false, nullable: false + field :body, String, optional: false, nullable: false + field :agree_button_text, String, optional: false, nullable: false + field :disagree_button_text, String, optional: true, nullable: false + field :decision, Square::Types::ConfirmationDecision, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/coordinates.rb b/lib/square/types/coordinates.rb new file mode 100644 index 000000000..7bf1f7f03 --- /dev/null +++ b/lib/square/types/coordinates.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Latitude and longitude coordinates. + class Coordinates < Internal::Types::Model + field :latitude, Integer, optional: true, nullable: false + field :longitude, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/country.rb b/lib/square/types/country.rb new file mode 100644 index 000000000..afaad6719 --- /dev/null +++ b/lib/square/types/country.rb @@ -0,0 +1,258 @@ +# frozen_string_literal: true + +module Square + module Types + module Country + extend Square::Internal::Types::Enum + ZZ = "ZZ" + AD = "AD" + AE = "AE" + AF = "AF" + AG = "AG" + AI = "AI" + AL = "AL" + AM = "AM" + AO = "AO" + AQ = "AQ" + AR = "AR" + AS = "AS" + AT = "AT" + AU = "AU" + AW = "AW" + AX = "AX" + AZ = "AZ" + BA = "BA" + BB = "BB" + BD = "BD" + BE = "BE" + BF = "BF" + BG = "BG" + BH = "BH" + BI = "BI" + BJ = "BJ" + BL = "BL" + BM = "BM" + BN = "BN" + BO = "BO" + BQ = "BQ" + BR = "BR" + BS = "BS" + BT = "BT" + BV = "BV" + BW = "BW" + BY = "BY" + BZ = "BZ" + CA = "CA" + CC = "CC" + CD = "CD" + CF = "CF" + CG = "CG" + CH = "CH" + CI = "CI" + CK = "CK" + CL = "CL" + CM = "CM" + CN = "CN" + CO = "CO" + CR = "CR" + CU = "CU" + CV = "CV" + CW = "CW" + CX = "CX" + CY = "CY" + CZ = "CZ" + DE = "DE" + DJ = "DJ" + DK = "DK" + DM = "DM" + DO = "DO" + DZ = "DZ" + EC = "EC" + EE = "EE" + EG = "EG" + EH = "EH" + ER = "ER" + ES = "ES" + ET = "ET" + FI = "FI" + FJ = "FJ" + FK = "FK" + FM = "FM" + FO = "FO" + FR = "FR" + GA = "GA" + GB = "GB" + GD = "GD" + GE = "GE" + GF = "GF" + GG = "GG" + GH = "GH" + GI = "GI" + GL = "GL" + GM = "GM" + GN = "GN" + GP = "GP" + GQ = "GQ" + GR = "GR" + GS = "GS" + GT = "GT" + GU = "GU" + GW = "GW" + GY = "GY" + HK = "HK" + HM = "HM" + HN = "HN" + HR = "HR" + HT = "HT" + HU = "HU" + ID = "ID" + IE = "IE" + IL = "IL" + IM = "IM" + IN = "IN" + IO = "IO" + IQ = "IQ" + IR = "IR" + IS = "IS" + IT = "IT" + JE = "JE" + JM = "JM" + JO = "JO" + JP = "JP" + KE = "KE" + KG = "KG" + KH = "KH" + KI = "KI" + KM = "KM" + KN = "KN" + KP = "KP" + KR = "KR" + KW = "KW" + KY = "KY" + KZ = "KZ" + LA = "LA" + LB = "LB" + LC = "LC" + LI = "LI" + LK = "LK" + LR = "LR" + LS = "LS" + LT = "LT" + LU = "LU" + LV = "LV" + LY = "LY" + MA = "MA" + MC = "MC" + MD = "MD" + ME = "ME" + MF = "MF" + MG = "MG" + MH = "MH" + MK = "MK" + ML = "ML" + MM = "MM" + MN = "MN" + MO = "MO" + MP = "MP" + MQ = "MQ" + MR = "MR" + MS = "MS" + MT = "MT" + MU = "MU" + MV = "MV" + MW = "MW" + MX = "MX" + MY = "MY" + MZ = "MZ" + NA = "NA" + NC = "NC" + NE = "NE" + NF = "NF" + NG = "NG" + NI = "NI" + NL = "NL" + NO = "NO" + NP = "NP" + NR = "NR" + NU = "NU" + NZ = "NZ" + OM = "OM" + PA = "PA" + PE = "PE" + PF = "PF" + PG = "PG" + PH = "PH" + PK = "PK" + PL = "PL" + PM = "PM" + PN = "PN" + PR = "PR" + PS = "PS" + PT = "PT" + PW = "PW" + PY = "PY" + QA = "QA" + RE = "RE" + RO = "RO" + RS = "RS" + RU = "RU" + RW = "RW" + SA = "SA" + SB = "SB" + SC = "SC" + SD = "SD" + SE = "SE" + SG = "SG" + SH = "SH" + SI = "SI" + SJ = "SJ" + SK = "SK" + SL = "SL" + SM = "SM" + SN = "SN" + SO = "SO" + SR = "SR" + SS = "SS" + ST = "ST" + SV = "SV" + SX = "SX" + SY = "SY" + SZ = "SZ" + TC = "TC" + TD = "TD" + TF = "TF" + TG = "TG" + TH = "TH" + TJ = "TJ" + TK = "TK" + TL = "TL" + TM = "TM" + TN = "TN" + TO = "TO" + TR = "TR" + TT = "TT" + TV = "TV" + TW = "TW" + TZ = "TZ" + UA = "UA" + UG = "UG" + UM = "UM" + US = "US" + UY = "UY" + UZ = "UZ" + VA = "VA" + VC = "VC" + VE = "VE" + VG = "VG" + VI = "VI" + VN = "VN" + VU = "VU" + WF = "WF" + WS = "WS" + YE = "YE" + YT = "YT" + ZA = "ZA" + ZM = "ZM" + ZW = "ZW"end + end +end diff --git a/lib/square/types/create_booking_custom_attribute_definition_response.rb b/lib/square/types/create_booking_custom_attribute_definition_response.rb new file mode 100644 index 000000000..d6fafd6e4 --- /dev/null +++ b/lib/square/types/create_booking_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class CreateBookingCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_booking_response.rb b/lib/square/types/create_booking_response.rb new file mode 100644 index 000000000..fcf8118cc --- /dev/null +++ b/lib/square/types/create_booking_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CreateBookingResponse < Internal::Types::Model + field :booking, Square::Types::Booking, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_break_type_response.rb b/lib/square/types/create_break_type_response.rb new file mode 100644 index 000000000..5e23ab164 --- /dev/null +++ b/lib/square/types/create_break_type_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CreateBreakTypeResponse < Internal::Types::Model + field :break_type, Square::Types::BreakType, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_card_response.rb b/lib/square/types/create_card_response.rb new file mode 100644 index 000000000..2835f7f37 --- /dev/null +++ b/lib/square/types/create_card_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [CreateCard](api-endpoint:Cards-CreateCard) endpoint. + # + # Note: if there are errors processing the request, the card field will not be + # present. + class CreateCardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :card, Square::Types::Card, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_catalog_image_request.rb b/lib/square/types/create_catalog_image_request.rb new file mode 100644 index 000000000..d5db19540 --- /dev/null +++ b/lib/square/types/create_catalog_image_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class CreateCatalogImageRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :object_id, String, optional: true, nullable: false + field :image, Square::Types::CatalogObject, optional: false, nullable: false + field :is_primary, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_catalog_image_response.rb b/lib/square/types/create_catalog_image_response.rb new file mode 100644 index 000000000..e69ef018d --- /dev/null +++ b/lib/square/types/create_catalog_image_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CreateCatalogImageResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :image, Square::Types::CatalogObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_checkout_response.rb b/lib/square/types/create_checkout_response.rb new file mode 100644 index 000000000..09b66e78b --- /dev/null +++ b/lib/square/types/create_checkout_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the `CreateCheckout` endpoint. + class CreateCheckoutResponse < Internal::Types::Model + field :checkout, Square::Types::Checkout, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_customer_card_response.rb b/lib/square/types/create_customer_card_response.rb new file mode 100644 index 000000000..fff6acd92 --- /dev/null +++ b/lib/square/types/create_customer_card_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class CreateCustomerCardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :card, Square::Types::Card, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_customer_custom_attribute_definition_response.rb b/lib/square/types/create_customer_custom_attribute_definition_response.rb new file mode 100644 index 000000000..6eed2d586 --- /dev/null +++ b/lib/square/types/create_customer_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class CreateCustomerCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_customer_group_response.rb b/lib/square/types/create_customer_group_response.rb new file mode 100644 index 000000000..6ef6e24b9 --- /dev/null +++ b/lib/square/types/create_customer_group_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [CreateCustomerGroup](api-endpoint:CustomerGroups-CreateCustomerGroup) endpoint. + # + # Either `errors` or `group` is present in a given response (never both). + class CreateCustomerGroupResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :group, Square::Types::CustomerGroup, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_customer_response.rb b/lib/square/types/create_customer_response.rb new file mode 100644 index 000000000..5561496c8 --- /dev/null +++ b/lib/square/types/create_customer_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [CreateCustomer](api-endpoint:Customers-CreateCustomer) or + # [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint. + # + # Either `errors` or `customer` is present in a given response (never both). + class CreateCustomerResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :customer, Square::Types::Customer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_device_code_response.rb b/lib/square/types/create_device_code_response.rb new file mode 100644 index 000000000..fcf72379a --- /dev/null +++ b/lib/square/types/create_device_code_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CreateDeviceCodeResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :device_code, Square::Types::DeviceCode, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_dispute_evidence_file_request.rb b/lib/square/types/create_dispute_evidence_file_request.rb new file mode 100644 index 000000000..4b7f9a80f --- /dev/null +++ b/lib/square/types/create_dispute_evidence_file_request.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the parameters for a `CreateDisputeEvidenceFile` request. + class CreateDisputeEvidenceFileRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :evidence_type, Square::Types::DisputeEvidenceType, optional: true, nullable: false + field :content_type, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_dispute_evidence_file_response.rb b/lib/square/types/create_dispute_evidence_file_response.rb new file mode 100644 index 000000000..ed3972323 --- /dev/null +++ b/lib/square/types/create_dispute_evidence_file_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields in a `CreateDisputeEvidenceFile` response. + class CreateDisputeEvidenceFileResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :evidence, Square::Types::DisputeEvidence, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_dispute_evidence_text_response.rb b/lib/square/types/create_dispute_evidence_text_response.rb new file mode 100644 index 000000000..a34217161 --- /dev/null +++ b/lib/square/types/create_dispute_evidence_text_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields in a `CreateDisputeEvidenceText` response. + class CreateDisputeEvidenceTextResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :evidence, Square::Types::DisputeEvidence, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_gift_card_activity_response.rb b/lib/square/types/create_gift_card_activity_response.rb new file mode 100644 index 000000000..7ff8eef6d --- /dev/null +++ b/lib/square/types/create_gift_card_activity_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains a `GiftCardActivity` that was created. + # The response might contain a set of `Error` objects if the request resulted in errors. + class CreateGiftCardActivityResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :gift_card_activity, Square::Types::GiftCardActivity, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_gift_card_response.rb b/lib/square/types/create_gift_card_response.rb new file mode 100644 index 000000000..ece6c28f4 --- /dev/null +++ b/lib/square/types/create_gift_card_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request + # resulted in errors. + class CreateGiftCardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :gift_card, Square::Types::GiftCard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_invoice_attachment_request_data.rb b/lib/square/types/create_invoice_attachment_request_data.rb new file mode 100644 index 000000000..c910f2fda --- /dev/null +++ b/lib/square/types/create_invoice_attachment_request_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) request. + class CreateInvoiceAttachmentRequestData < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_invoice_attachment_response.rb b/lib/square/types/create_invoice_attachment_response.rb new file mode 100644 index 000000000..287331801 --- /dev/null +++ b/lib/square/types/create_invoice_attachment_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) response. + class CreateInvoiceAttachmentResponse < Internal::Types::Model + field :attachment, Square::Types::InvoiceAttachment, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_invoice_response.rb b/lib/square/types/create_invoice_response.rb new file mode 100644 index 000000000..56f682579 --- /dev/null +++ b/lib/square/types/create_invoice_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The response returned by the `CreateInvoice` request. + class CreateInvoiceResponse < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_job_response.rb b/lib/square/types/create_job_response.rb new file mode 100644 index 000000000..a11a4a803 --- /dev/null +++ b/lib/square/types/create_job_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CreateJob](api-endpoint:Team-CreateJob) response. Either `job` or `errors` + # is present in the response. + class CreateJobResponse < Internal::Types::Model + field :job, Square::Types::Job, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_location_custom_attribute_definition_response.rb b/lib/square/types/create_location_custom_attribute_definition_response.rb new file mode 100644 index 000000000..6aafa22fe --- /dev/null +++ b/lib/square/types/create_location_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class CreateLocationCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_location_response.rb b/lib/square/types/create_location_response.rb new file mode 100644 index 000000000..5e9f9fc95 --- /dev/null +++ b/lib/square/types/create_location_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The response object returned by the [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint. + class CreateLocationResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :location, Square::Types::Location, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_loyalty_account_response.rb b/lib/square/types/create_loyalty_account_response.rb new file mode 100644 index 000000000..b3c517f8e --- /dev/null +++ b/lib/square/types/create_loyalty_account_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that includes loyalty account created. + class CreateLoyaltyAccountResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :loyalty_account, Square::Types::LoyaltyAccount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_loyalty_promotion_response.rb b/lib/square/types/create_loyalty_promotion_response.rb new file mode 100644 index 000000000..f029882c7 --- /dev/null +++ b/lib/square/types/create_loyalty_promotion_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) response. + # Either `loyalty_promotion` or `errors` is present in the response. + class CreateLoyaltyPromotionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :loyalty_promotion, Square::Types::LoyaltyPromotion, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_loyalty_reward_response.rb b/lib/square/types/create_loyalty_reward_response.rb new file mode 100644 index 000000000..d58eed6a7 --- /dev/null +++ b/lib/square/types/create_loyalty_reward_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that includes the loyalty reward created. + class CreateLoyaltyRewardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :reward, Square::Types::LoyaltyReward, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_merchant_custom_attribute_definition_response.rb b/lib/square/types/create_merchant_custom_attribute_definition_response.rb new file mode 100644 index 000000000..48ccbb5ad --- /dev/null +++ b/lib/square/types/create_merchant_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class CreateMerchantCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_mobile_authorization_code_response.rb b/lib/square/types/create_mobile_authorization_code_response.rb new file mode 100644 index 000000000..92f893ffb --- /dev/null +++ b/lib/square/types/create_mobile_authorization_code_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the `CreateMobileAuthorizationCode` endpoint. + class CreateMobileAuthorizationCodeResponse < Internal::Types::Model + field :authorization_code, String, optional: true, nullable: false + field :expires_at, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_order_custom_attribute_definition_response.rb b/lib/square/types/create_order_custom_attribute_definition_response.rb new file mode 100644 index 000000000..11e90a21c --- /dev/null +++ b/lib/square/types/create_order_custom_attribute_definition_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from creating an order custom attribute definition. + class CreateOrderCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_order_request.rb b/lib/square/types/create_order_request.rb new file mode 100644 index 000000000..5643c3189 --- /dev/null +++ b/lib/square/types/create_order_request.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CreateOrderRequest < Internal::Types::Model + field :order, Square::Types::Order, optional: true, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_order_response.rb b/lib/square/types/create_order_response.rb new file mode 100644 index 000000000..213b8814d --- /dev/null +++ b/lib/square/types/create_order_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CreateOrderResponse < Internal::Types::Model + field :order, Square::Types::Order, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_payment_link_response.rb b/lib/square/types/create_payment_link_response.rb new file mode 100644 index 000000000..16639f56e --- /dev/null +++ b/lib/square/types/create_payment_link_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class CreatePaymentLinkResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :payment_link, Square::Types::PaymentLink, optional: true, nullable: false + field :related_resources, Square::Types::PaymentLinkRelatedResources, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_payment_response.rb b/lib/square/types/create_payment_response.rb new file mode 100644 index 000000000..2475da6de --- /dev/null +++ b/lib/square/types/create_payment_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response returned by [CreatePayment](api-endpoint:Payments-CreatePayment). + # + # If there are errors processing the request, the `payment` field might not be + # present, or it might be present with a status of `FAILED`. + class CreatePaymentResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :payment, Square::Types::Payment, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_scheduled_shift_response.rb b/lib/square/types/create_scheduled_shift_response.rb new file mode 100644 index 000000000..14395de64 --- /dev/null +++ b/lib/square/types/create_scheduled_shift_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) response. + # Either `scheduled_shift` or `errors` is present in the response. + class CreateScheduledShiftResponse < Internal::Types::Model + field :scheduled_shift, Square::Types::ScheduledShift, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_shift_response.rb b/lib/square/types/create_shift_response.rb new file mode 100644 index 000000000..18b824cdc --- /dev/null +++ b/lib/square/types/create_shift_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CreateShiftResponse < Internal::Types::Model + field :shift, Square::Types::Shift, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_subscription_response.rb b/lib/square/types/create_subscription_response.rb new file mode 100644 index 000000000..4fb048b5f --- /dev/null +++ b/lib/square/types/create_subscription_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response from the + # [CreateSubscription](api-endpoint:Subscriptions-CreateSubscription) endpoint. + class CreateSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::Subscription, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_team_member_request.rb b/lib/square/types/create_team_member_request.rb new file mode 100644 index 000000000..2cd30722c --- /dev/null +++ b/lib/square/types/create_team_member_request.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a create request for a `TeamMember` object. + class CreateTeamMemberRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :team_member, Square::Types::TeamMember, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_team_member_response.rb b/lib/square/types/create_team_member_response.rb new file mode 100644 index 000000000..d1fb502c3 --- /dev/null +++ b/lib/square/types/create_team_member_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from a create request containing the created `TeamMember` object or error messages. + class CreateTeamMemberResponse < Internal::Types::Model + field :team_member, Square::Types::TeamMember, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_terminal_action_response.rb b/lib/square/types/create_terminal_action_response.rb new file mode 100644 index 000000000..d1797f353 --- /dev/null +++ b/lib/square/types/create_terminal_action_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CreateTerminalActionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :action, Square::Types::TerminalAction, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_terminal_checkout_response.rb b/lib/square/types/create_terminal_checkout_response.rb new file mode 100644 index 000000000..6487f8f0f --- /dev/null +++ b/lib/square/types/create_terminal_checkout_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CreateTerminalCheckoutResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :checkout, Square::Types::TerminalCheckout, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_terminal_refund_response.rb b/lib/square/types/create_terminal_refund_response.rb new file mode 100644 index 000000000..c5261ffcf --- /dev/null +++ b/lib/square/types/create_terminal_refund_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class CreateTerminalRefundResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :refund, Square::Types::TerminalRefund, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_timecard_response.rb b/lib/square/types/create_timecard_response.rb new file mode 100644 index 000000000..48cb72f40 --- /dev/null +++ b/lib/square/types/create_timecard_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # The response to a request to create a `Timecard`. The response contains + # the created `Timecard` object and might contain a set of `Error` objects if + # the request resulted in errors. + class CreateTimecardResponse < Internal::Types::Model + field :timecard, Square::Types::Timecard, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_vendor_response.rb b/lib/square/types/create_vendor_response.rb new file mode 100644 index 000000000..8cb1c8077 --- /dev/null +++ b/lib/square/types/create_vendor_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an output from a call to [CreateVendor](api-endpoint:Vendors-CreateVendor). + class CreateVendorResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :vendor, Square::Types::Vendor, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/create_webhook_subscription_response.rb b/lib/square/types/create_webhook_subscription_response.rb new file mode 100644 index 000000000..25d607aca --- /dev/null +++ b/lib/square/types/create_webhook_subscription_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) endpoint. + # + # Note: if there are errors processing the request, the [Subscription](entity:WebhookSubscription) will not be + # present. + class CreateWebhookSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::WebhookSubscription, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/currency.rb b/lib/square/types/currency.rb new file mode 100644 index 000000000..1a17f74c3 --- /dev/null +++ b/lib/square/types/currency.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +module Square + module Types + module Currency + extend Square::Internal::Types::Enum + UNKNOWN_CURRENCY = "UNKNOWN_CURRENCY" + AED = "AED" + AFN = "AFN" + ALL = "ALL" + AMD = "AMD" + ANG = "ANG" + AOA = "AOA" + ARS = "ARS" + AUD = "AUD" + AWG = "AWG" + AZN = "AZN" + BAM = "BAM" + BBD = "BBD" + BDT = "BDT" + BGN = "BGN" + BHD = "BHD" + BIF = "BIF" + BMD = "BMD" + BND = "BND" + BOB = "BOB" + BOV = "BOV" + BRL = "BRL" + BSD = "BSD" + BTN = "BTN" + BWP = "BWP" + BYR = "BYR" + BZD = "BZD" + CAD = "CAD" + CDF = "CDF" + CHE = "CHE" + CHF = "CHF" + CHW = "CHW" + CLF = "CLF" + CLP = "CLP" + CNY = "CNY" + COP = "COP" + COU = "COU" + CRC = "CRC" + CUC = "CUC" + CUP = "CUP" + CVE = "CVE" + CZK = "CZK" + DJF = "DJF" + DKK = "DKK" + DOP = "DOP" + DZD = "DZD" + EGP = "EGP" + ERN = "ERN" + ETB = "ETB" + EUR = "EUR" + FJD = "FJD" + FKP = "FKP" + GBP = "GBP" + GEL = "GEL" + GHS = "GHS" + GIP = "GIP" + GMD = "GMD" + GNF = "GNF" + GTQ = "GTQ" + GYD = "GYD" + HKD = "HKD" + HNL = "HNL" + HRK = "HRK" + HTG = "HTG" + HUF = "HUF" + IDR = "IDR" + ILS = "ILS" + INR = "INR" + IQD = "IQD" + IRR = "IRR" + ISK = "ISK" + JMD = "JMD" + JOD = "JOD" + JPY = "JPY" + KES = "KES" + KGS = "KGS" + KHR = "KHR" + KMF = "KMF" + KPW = "KPW" + KRW = "KRW" + KWD = "KWD" + KYD = "KYD" + KZT = "KZT" + LAK = "LAK" + LBP = "LBP" + LKR = "LKR" + LRD = "LRD" + LSL = "LSL" + LTL = "LTL" + LVL = "LVL" + LYD = "LYD" + MAD = "MAD" + MDL = "MDL" + MGA = "MGA" + MKD = "MKD" + MMK = "MMK" + MNT = "MNT" + MOP = "MOP" + MRO = "MRO" + MUR = "MUR" + MVR = "MVR" + MWK = "MWK" + MXN = "MXN" + MXV = "MXV" + MYR = "MYR" + MZN = "MZN" + NAD = "NAD" + NGN = "NGN" + NIO = "NIO" + NOK = "NOK" + NPR = "NPR" + NZD = "NZD" + OMR = "OMR" + PAB = "PAB" + PEN = "PEN" + PGK = "PGK" + PHP = "PHP" + PKR = "PKR" + PLN = "PLN" + PYG = "PYG" + QAR = "QAR" + RON = "RON" + RSD = "RSD" + RUB = "RUB" + RWF = "RWF" + SAR = "SAR" + SBD = "SBD" + SCR = "SCR" + SDG = "SDG" + SEK = "SEK" + SGD = "SGD" + SHP = "SHP" + SLL = "SLL" + SLE = "SLE" + SOS = "SOS" + SRD = "SRD" + SSP = "SSP" + STD = "STD" + SVC = "SVC" + SYP = "SYP" + SZL = "SZL" + THB = "THB" + TJS = "TJS" + TMT = "TMT" + TND = "TND" + TOP = "TOP" + TRY = "TRY" + TTD = "TTD" + TWD = "TWD" + TZS = "TZS" + UAH = "UAH" + UGX = "UGX" + USD = "USD" + USN = "USN" + USS = "USS" + UYI = "UYI" + UYU = "UYU" + UZS = "UZS" + VEF = "VEF" + VND = "VND" + VUV = "VUV" + WST = "WST" + XAF = "XAF" + XAG = "XAG" + XAU = "XAU" + XBA = "XBA" + XBB = "XBB" + XBC = "XBC" + XBD = "XBD" + XCD = "XCD" + XDR = "XDR" + XOF = "XOF" + XPD = "XPD" + XPF = "XPF" + XPT = "XPT" + XTS = "XTS" + XXX = "XXX" + YER = "YER" + ZAR = "ZAR" + ZMK = "ZMK" + ZMW = "ZMW" + BTC = "BTC" + XUS = "XUS"end + end +end diff --git a/lib/square/types/custom_attribute.rb b/lib/square/types/custom_attribute.rb new file mode 100644 index 000000000..5c2dc33d7 --- /dev/null +++ b/lib/square/types/custom_attribute.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # A custom attribute value. Each custom attribute value has a corresponding + # `CustomAttributeDefinition` object. + class CustomAttribute < Internal::Types::Model + field :key, String, optional: true, nullable: false + field :value, Internal::Types::Hash[String, ], optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :visibility, Square::Types::CustomAttributeDefinitionVisibility, optional: true, nullable: false + field :definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/custom_attribute_definition.rb b/lib/square/types/custom_attribute_definition.rb new file mode 100644 index 000000000..89c39c6d1 --- /dev/null +++ b/lib/square/types/custom_attribute_definition.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a definition for custom attribute values. A custom attribute definition + # specifies the key, visibility, schema, and other properties for a custom attribute. + class CustomAttributeDefinition < Internal::Types::Model + field :key, String, optional: true, nullable: false + field :schema, Internal::Types::Hash[String, Internal::Types::Hash[String, ]], optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :visibility, Square::Types::CustomAttributeDefinitionVisibility, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/custom_attribute_definition_event_data.rb b/lib/square/types/custom_attribute_definition_event_data.rb new file mode 100644 index 000000000..268dd9c96 --- /dev/null +++ b/lib/square/types/custom_attribute_definition_event_data.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an object in the CustomAttributeDefinition event notification + # payload that contains the affected custom attribute definition. + class CustomAttributeDefinitionEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::CustomAttributeDefinitionEventDataObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/custom_attribute_definition_event_data_object.rb b/lib/square/types/custom_attribute_definition_event_data_object.rb new file mode 100644 index 000000000..428ab187d --- /dev/null +++ b/lib/square/types/custom_attribute_definition_event_data_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CustomAttributeDefinitionEventDataObject < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/custom_attribute_definition_visibility.rb b/lib/square/types/custom_attribute_definition_visibility.rb new file mode 100644 index 000000000..7b8aadcd5 --- /dev/null +++ b/lib/square/types/custom_attribute_definition_visibility.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module CustomAttributeDefinitionVisibility + extend Square::Internal::Types::Enum + VISIBILITY_HIDDEN = "VISIBILITY_HIDDEN" + VISIBILITY_READ_ONLY = "VISIBILITY_READ_ONLY" + VISIBILITY_READ_WRITE_VALUES = "VISIBILITY_READ_WRITE_VALUES"end + end +end diff --git a/lib/square/types/custom_attribute_event_data.rb b/lib/square/types/custom_attribute_event_data.rb new file mode 100644 index 000000000..8779761b0 --- /dev/null +++ b/lib/square/types/custom_attribute_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class CustomAttributeEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::CustomAttributeEventDataObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/custom_attribute_event_data_object.rb b/lib/square/types/custom_attribute_event_data_object.rb new file mode 100644 index 000000000..c0e9d47cf --- /dev/null +++ b/lib/square/types/custom_attribute_event_data_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class CustomAttributeEventDataObject < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/custom_attribute_filter.rb b/lib/square/types/custom_attribute_filter.rb new file mode 100644 index 000000000..41af10e73 --- /dev/null +++ b/lib/square/types/custom_attribute_filter.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Supported custom attribute query expressions for calling the + # [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + # endpoint to search for items or item variations. + class CustomAttributeFilter < Internal::Types::Model + field :custom_attribute_definition_id, String, optional: true, nullable: false + field :key, String, optional: true, nullable: false + field :string_filter, String, optional: true, nullable: false + field :number_filter, Square::Types::Range, optional: true, nullable: false + field :selection_uids_filter, Internal::Types::Array[String], optional: true, nullable: false + field :bool_filter, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/custom_field.rb b/lib/square/types/custom_field.rb new file mode 100644 index 000000000..acfe4450e --- /dev/null +++ b/lib/square/types/custom_field.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class CustomField < Internal::Types::Model + field :title, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/customer.rb b/lib/square/types/customer.rb new file mode 100644 index 000000000..b54f819b1 --- /dev/null +++ b/lib/square/types/customer.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a Square customer profile in the Customer Directory of a Square seller. + class Customer < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :given_name, String, optional: true, nullable: false + field :family_name, String, optional: true, nullable: false + field :nickname, String, optional: true, nullable: false + field :company_name, String, optional: true, nullable: false + field :email_address, String, optional: true, nullable: false + field :address, Square::Types::Address, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :birthday, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :preferences, Square::Types::CustomerPreferences, optional: true, nullable: false + field :creation_source, Square::Types::CustomerCreationSource, optional: true, nullable: false + field :group_ids, Internal::Types::Array[String], optional: true, nullable: false + field :segment_ids, Internal::Types::Array[String], optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :tax_ids, Square::Types::CustomerTaxIds, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_address_filter.rb b/lib/square/types/customer_address_filter.rb new file mode 100644 index 000000000..b5a2e8198 --- /dev/null +++ b/lib/square/types/customer_address_filter.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](entity:CustomerCustomAttributeFilterValue) filter when + # searching by an `Address`-type custom attribute. + class CustomerAddressFilter < Internal::Types::Model + field :postal_code, Square::Types::CustomerTextFilter, optional: true, nullable: false + field :country, Square::Types::Country, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_created_event.rb b/lib/square/types/customer_created_event.rb new file mode 100644 index 000000000..a86b1a440 --- /dev/null +++ b/lib/square/types/customer_created_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [customer](entity:Customer) is created. Subscribe to this event to track customer profiles affected by a merge operation. + # For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). + # + # The `customer` object in the event notification does not include the `segment_ids` field. + class CustomerCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomerCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_created_event_data.rb b/lib/square/types/customer_created_event_data.rb new file mode 100644 index 000000000..216c373e3 --- /dev/null +++ b/lib/square/types/customer_created_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with the event. + class CustomerCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::CustomerCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_created_event_event_context.rb b/lib/square/types/customer_created_event_event_context.rb new file mode 100644 index 000000000..fedd72da5 --- /dev/null +++ b/lib/square/types/customer_created_event_event_context.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Information about the change that triggered the event. + class CustomerCreatedEventEventContext < Internal::Types::Model + field :merge, Square::Types::CustomerCreatedEventEventContextMerge, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_created_event_event_context_merge.rb b/lib/square/types/customer_created_event_event_context_merge.rb new file mode 100644 index 000000000..f28c106db --- /dev/null +++ b/lib/square/types/customer_created_event_event_context_merge.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers. + class CustomerCreatedEventEventContextMerge < Internal::Types::Model + field :from_customer_ids, Internal::Types::Array[String], optional: true, nullable: false + field :to_customer_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_created_event_object.rb b/lib/square/types/customer_created_event_object.rb new file mode 100644 index 000000000..3d5d368a6 --- /dev/null +++ b/lib/square/types/customer_created_event_object.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the customer associated with the event. + class CustomerCreatedEventObject < Internal::Types::Model + field :customer, Square::Types::Customer, optional: true, nullable: false + field :event_context, Square::Types::CustomerCreatedEventEventContext, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_creation_source.rb b/lib/square/types/customer_creation_source.rb new file mode 100644 index 000000000..00a6aede8 --- /dev/null +++ b/lib/square/types/customer_creation_source.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Square + module Types + module CustomerCreationSource + extend Square::Internal::Types::Enum + OTHER = "OTHER" + APPOINTMENTS = "APPOINTMENTS" + COUPON = "COUPON" + DELETION_RECOVERY = "DELETION_RECOVERY" + DIRECTORY = "DIRECTORY" + EGIFTING = "EGIFTING" + EMAIL_COLLECTION = "EMAIL_COLLECTION" + FEEDBACK = "FEEDBACK" + IMPORT = "IMPORT" + INVOICES = "INVOICES" + LOYALTY = "LOYALTY" + MARKETING = "MARKETING" + MERGE = "MERGE" + ONLINE_STORE = "ONLINE_STORE" + INSTANT_PROFILE = "INSTANT_PROFILE" + TERMINAL = "TERMINAL" + THIRD_PARTY = "THIRD_PARTY" + THIRD_PARTY_IMPORT = "THIRD_PARTY_IMPORT" + UNMERGE_RECOVERY = "UNMERGE_RECOVERY"end + end +end diff --git a/lib/square/types/customer_creation_source_filter.rb b/lib/square/types/customer_creation_source_filter.rb new file mode 100644 index 000000000..3d9b8c161 --- /dev/null +++ b/lib/square/types/customer_creation_source_filter.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CustomerCreationSourceFilter < Internal::Types::Model + field :values, Internal::Types::Array[Square::Types::CustomerCreationSource], optional: true, nullable: false + field :rule, Square::Types::CustomerInclusionExclusion, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_created_event.rb b/lib/square/types/customer_custom_attribute_definition_created_event.rb new file mode 100644 index 000000000..8f8eaa75b --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_created_event.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # is created by the subscribing application. + # + # This event is replaced by + # [customer.custom_attribute_definition.owned.created](webhook:customer.custom_attribute_definition.owned.created). + class CustomerCustomAttributeDefinitionCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_created_public_event.rb b/lib/square/types/customer_custom_attribute_definition_created_public_event.rb new file mode 100644 index 000000000..81fed79df --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_created_public_event.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to all applications is created. A notification is sent when any application creates a custom + # attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # This event is replaced by + # [customer.custom_attribute_definition.visible.created](webhook:customer.custom_attribute_definition.visible.created), + # which applies to custom attribute definitions that are visible to the subscribing application. + class CustomerCustomAttributeDefinitionCreatedPublicEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_deleted_event.rb b/lib/square/types/customer_custom_attribute_definition_deleted_event.rb new file mode 100644 index 000000000..11b01b47c --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_deleted_event.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # created by the subscribing application is deleted. A custom attribute definition can only be deleted by + # the application that created it. + # + # This event is replaced by + # [customer.custom_attribute_definition.owned.deleted](webhook:customer.custom_attribute_definition.owned.deleted). + class CustomerCustomAttributeDefinitionDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_deleted_public_event.rb b/lib/square/types/customer_custom_attribute_definition_deleted_public_event.rb new file mode 100644 index 000000000..4a0349419 --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_deleted_public_event.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to all applications is deleted. A notification is sent when any application deletes a custom + # attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # This event is replaced by + # [customer.custom_attribute_definition.visible.deleted](webhook:customer.custom_attribute_definition.visible.deleted), + # which applies to custom attribute definitions that are visible to the subscribing application. + class CustomerCustomAttributeDefinitionDeletedPublicEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_owned_created_event.rb b/lib/square/types/customer_custom_attribute_definition_owned_created_event.rb new file mode 100644 index 000000000..e87aa618b --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_owned_created_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # is created by the subscribing application. + class CustomerCustomAttributeDefinitionOwnedCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_owned_deleted_event.rb b/lib/square/types/customer_custom_attribute_definition_owned_deleted_event.rb new file mode 100644 index 000000000..e6bc4afe1 --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_owned_deleted_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # created by the subscribing application is deleted. A custom attribute definition can only be deleted by + # the application that created it. + class CustomerCustomAttributeDefinitionOwnedDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_owned_updated_event.rb b/lib/square/types/customer_custom_attribute_definition_owned_updated_event.rb new file mode 100644 index 000000000..bca911501 --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_owned_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # created by the subscribing application is updated. A custom attribute definition can only be updated by + # the application that created it. + class CustomerCustomAttributeDefinitionOwnedUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_updated_event.rb b/lib/square/types/customer_custom_attribute_definition_updated_event.rb new file mode 100644 index 000000000..4b9bf250b --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_updated_event.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # created by the subscribing application is updated. A custom attribute definition can only be updated by + # the application that created it. + # + # This event is replaced by + # [customer.custom_attribute_definition.owned.updated](webhook:customer.custom_attribute_definition.owned.updated). + class CustomerCustomAttributeDefinitionUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_updated_public_event.rb b/lib/square/types/customer_custom_attribute_definition_updated_public_event.rb new file mode 100644 index 000000000..435726bfe --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_updated_public_event.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to all applications is updated. A notification is sent when any application updates a custom + # attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # This event is replaced by + # [customer.custom_attribute_definition.visible.updated](webhook:customer.custom_attribute_definition.visible.updated), + # which applies to custom attribute definitions that are visible to the subscribing application. + class CustomerCustomAttributeDefinitionUpdatedPublicEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_visible_created_event.rb b/lib/square/types/customer_custom_attribute_definition_visible_created_event.rb new file mode 100644 index 000000000..e959aee3d --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_visible_created_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to the subscribing application is created. A notification is sent when your application + # creates a custom attribute definition or another application creates a custom attribute definition whose + # `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + class CustomerCustomAttributeDefinitionVisibleCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_visible_deleted_event.rb b/lib/square/types/customer_custom_attribute_definition_visible_deleted_event.rb new file mode 100644 index 000000000..b8ce79a78 --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_visible_deleted_event.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to the subscribing application is deleted. A custom attribute definition can only be deleted + # by the application that created it. A notification is sent when your application deletes a custom attribute + # definition or when another application deletes a custom attribute definition whose `visibility` is + # `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + class CustomerCustomAttributeDefinitionVisibleDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_definition_visible_updated_event.rb b/lib/square/types/customer_custom_attribute_definition_visible_updated_event.rb new file mode 100644 index 000000000..eb9097de6 --- /dev/null +++ b/lib/square/types/customer_custom_attribute_definition_visible_updated_event.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to the subscribing application is updated. A custom attribute definition can only be updated + # by the application that created it. A notification is sent when your application updates a custom + # attribute definition or when another application updates a custom attribute definition whose `visibility` is + # `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + class CustomerCustomAttributeDefinitionVisibleUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_deleted_event.rb b/lib/square/types/customer_custom_attribute_deleted_event.rb new file mode 100644 index 000000000..1ead1e74e --- /dev/null +++ b/lib/square/types/customer_custom_attribute_deleted_event.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute](entity:CustomAttribute) owned by the + # subscribing application is deleted. Custom attributes are owned by the application that created the + # corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose + # `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application. + # + # This event is replaced by + # [customer.custom_attribute.owned.deleted](webhook:customer.custom_attribute.owned.deleted). + class CustomerCustomAttributeDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_deleted_public_event.rb b/lib/square/types/customer_custom_attribute_deleted_public_event.rb new file mode 100644 index 000000000..a6ce1b338 --- /dev/null +++ b/lib/square/types/customer_custom_attribute_deleted_public_event.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute](entity:CustomAttribute) that is visible + # to all applications is deleted. A notification is sent when any application deletes a custom attribute + # whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # This event is replaced by + # [customer.custom_attribute.visible.deleted](webhook:customer.custom_attribute.visible.deleted), + # which applies to custom attributes that are visible to the subscribing application. + class CustomerCustomAttributeDeletedPublicEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_filter.rb b/lib/square/types/customer_custom_attribute_filter.rb new file mode 100644 index 000000000..44939a43d --- /dev/null +++ b/lib/square/types/customer_custom_attribute_filter.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # The custom attribute filter. Use this filter in a set of [custom attribute filters](entity:CustomerCustomAttributeFilters) to search + # based on the value or last updated date of a customer-related [custom attribute](entity:CustomAttribute). + class CustomerCustomAttributeFilter < Internal::Types::Model + field :key, String, optional: false, nullable: false + field :filter, Square::Types::CustomerCustomAttributeFilterValue, optional: true, nullable: false + field :updated_at, Square::Types::TimeRange, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_filter_value.rb b/lib/square/types/customer_custom_attribute_filter_value.rb new file mode 100644 index 000000000..f8dde4ed4 --- /dev/null +++ b/lib/square/types/customer_custom_attribute_filter_value.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # A type-specific filter used in a [custom attribute filter](entity:CustomerCustomAttributeFilter) to search based on the value + # of a customer-related [custom attribute](entity:CustomAttribute). + class CustomerCustomAttributeFilterValue < Internal::Types::Model + field :email, Square::Types::CustomerTextFilter, optional: true, nullable: false + field :phone, Square::Types::CustomerTextFilter, optional: true, nullable: false + field :text, Square::Types::CustomerTextFilter, optional: true, nullable: false + field :selection, Square::Types::FilterValue, optional: true, nullable: false + field :date, Square::Types::TimeRange, optional: true, nullable: false + field :number, Square::Types::FloatNumberRange, optional: true, nullable: false + field :boolean, Internal::Types::Boolean, optional: true, nullable: false + field :address, Square::Types::CustomerAddressFilter, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_filters.rb b/lib/square/types/customer_custom_attribute_filters.rb new file mode 100644 index 000000000..acd45f965 --- /dev/null +++ b/lib/square/types/customer_custom_attribute_filters.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The custom attribute filters in a set of [customer filters](entity:CustomerFilter) used in a search query. Use this filter + # to search based on [custom attributes](entity:CustomAttribute) that are assigned to customer profiles. For more information, see + # [Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute). + class CustomerCustomAttributeFilters < Internal::Types::Model + field :filters, Internal::Types::Array[Square::Types::CustomerCustomAttributeFilter], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_owned_deleted_event.rb b/lib/square/types/customer_custom_attribute_owned_deleted_event.rb new file mode 100644 index 000000000..c92c35a1c --- /dev/null +++ b/lib/square/types/customer_custom_attribute_owned_deleted_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute](entity:CustomAttribute) owned by the + # subscribing application is deleted. Custom attributes are owned by the application that created the + # corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose + # `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application. + class CustomerCustomAttributeOwnedDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_owned_updated_event.rb b/lib/square/types/customer_custom_attribute_owned_updated_event.rb new file mode 100644 index 000000000..90bdc3e33 --- /dev/null +++ b/lib/square/types/customer_custom_attribute_owned_updated_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute](entity:CustomAttribute) owned by the + # subscribing application is created or updated. Custom attributes are owned by the application that created + # the corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose + # `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application. + class CustomerCustomAttributeOwnedUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_updated_event.rb b/lib/square/types/customer_custom_attribute_updated_event.rb new file mode 100644 index 000000000..96650eb9d --- /dev/null +++ b/lib/square/types/customer_custom_attribute_updated_event.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute](entity:CustomAttribute) owned by the + # subscribing application is created or updated. Custom attributes are owned by the application that created + # the corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose + # `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application. + # + # This event is replaced by + # [customer.custom_attribute.owned.updated](webhook:customer.custom_attribute.owned.updated). + class CustomerCustomAttributeUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_updated_public_event.rb b/lib/square/types/customer_custom_attribute_updated_public_event.rb new file mode 100644 index 000000000..067aee659 --- /dev/null +++ b/lib/square/types/customer_custom_attribute_updated_public_event.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute](entity:CustomAttribute) that is visible + # to all applications is created or updated. A notification is sent when any application creates or updates + # a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + # + # This event is replaced by + # [customer.custom_attribute.visible.updated](webhook:customer.custom_attribute.visible.updated), + # which applies to custom attributes that are visible to the subscribing application. + class CustomerCustomAttributeUpdatedPublicEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_visible_deleted_event.rb b/lib/square/types/customer_custom_attribute_visible_deleted_event.rb new file mode 100644 index 000000000..a9324d81e --- /dev/null +++ b/lib/square/types/customer_custom_attribute_visible_deleted_event.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the + # subscribing application is deleted. A notification is sent when: + # - Your application deletes a custom attribute owned by your application, regardless of the `visibility` setting. + # - Any application deletes a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY` + # or `VISIBILITY_READ_WRITE_VALUES`. + # + # Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application, but those set to + # `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the owner. Custom attributes are owned + # by the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition). + class CustomerCustomAttributeVisibleDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_custom_attribute_visible_updated_event.rb b/lib/square/types/customer_custom_attribute_visible_updated_event.rb new file mode 100644 index 000000000..4fedb159b --- /dev/null +++ b/lib/square/types/customer_custom_attribute_visible_updated_event.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the + # subscribing application is created or updated. A notification is sent when: + # - Your application creates or updates a custom attribute owned by your application, regardless of the `visibility` setting. + # - Any application creates or updates a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY` + # or `VISIBILITY_READ_WRITE_VALUES`. + # + # Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application, but those set to + # `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or updated by the owner. Custom attributes are owned + # by the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition). + class CustomerCustomAttributeVisibleUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_deleted_event.rb b/lib/square/types/customer_deleted_event.rb new file mode 100644 index 000000000..879fa7d66 --- /dev/null +++ b/lib/square/types/customer_deleted_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [customer](entity:Customer) is deleted. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). + # + # The `customer` object in the event notification does not include the following fields: `group_ids` and `segment_ids`. + class CustomerDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomerDeletedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_deleted_event_data.rb b/lib/square/types/customer_deleted_event_data.rb new file mode 100644 index 000000000..5e57832aa --- /dev/null +++ b/lib/square/types/customer_deleted_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with the event. + class CustomerDeletedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::CustomerDeletedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_deleted_event_event_context.rb b/lib/square/types/customer_deleted_event_event_context.rb new file mode 100644 index 000000000..26a4d1622 --- /dev/null +++ b/lib/square/types/customer_deleted_event_event_context.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Information about the change that triggered the event. + class CustomerDeletedEventEventContext < Internal::Types::Model + field :merge, Square::Types::CustomerDeletedEventEventContextMerge, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_deleted_event_event_context_merge.rb b/lib/square/types/customer_deleted_event_event_context_merge.rb new file mode 100644 index 000000000..1e7ff2342 --- /dev/null +++ b/lib/square/types/customer_deleted_event_event_context_merge.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers. + class CustomerDeletedEventEventContextMerge < Internal::Types::Model + field :from_customer_ids, Internal::Types::Array[String], optional: true, nullable: false + field :to_customer_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_deleted_event_object.rb b/lib/square/types/customer_deleted_event_object.rb new file mode 100644 index 000000000..fe6345db6 --- /dev/null +++ b/lib/square/types/customer_deleted_event_object.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the customer associated with the event. + class CustomerDeletedEventObject < Internal::Types::Model + field :customer, Square::Types::Customer, optional: true, nullable: false + field :event_context, Square::Types::CustomerDeletedEventEventContext, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_details.rb b/lib/square/types/customer_details.rb new file mode 100644 index 000000000..5bf68587c --- /dev/null +++ b/lib/square/types/customer_details.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Details about the customer making the payment. + class CustomerDetails < Internal::Types::Model + field :customer_initiated, Internal::Types::Boolean, optional: true, nullable: false + field :seller_keyed_in, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_filter.rb b/lib/square/types/customer_filter.rb new file mode 100644 index 000000000..6b2f3f959 --- /dev/null +++ b/lib/square/types/customer_filter.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the filtering criteria in a [search query](entity:CustomerQuery) that defines how to filter + # customer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results. + class CustomerFilter < Internal::Types::Model + field :creation_source, Square::Types::CustomerCreationSourceFilter, optional: true, nullable: false + field :created_at, Square::Types::TimeRange, optional: true, nullable: false + field :updated_at, Square::Types::TimeRange, optional: true, nullable: false + field :email_address, Square::Types::CustomerTextFilter, optional: true, nullable: false + field :phone_number, Square::Types::CustomerTextFilter, optional: true, nullable: false + field :reference_id, Square::Types::CustomerTextFilter, optional: true, nullable: false + field :group_ids, Square::Types::FilterValue, optional: true, nullable: false + field :custom_attribute, Square::Types::CustomerCustomAttributeFilters, optional: true, nullable: false + field :segment_ids, Square::Types::FilterValue, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_group.rb b/lib/square/types/customer_group.rb new file mode 100644 index 000000000..ebf485816 --- /dev/null +++ b/lib/square/types/customer_group.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CustomerGroup < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :name, String, optional: false, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_inclusion_exclusion.rb b/lib/square/types/customer_inclusion_exclusion.rb new file mode 100644 index 000000000..c6cede2e4 --- /dev/null +++ b/lib/square/types/customer_inclusion_exclusion.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module CustomerInclusionExclusion + extend Square::Internal::Types::Enum + INCLUDE = "INCLUDE" + EXCLUDE = "EXCLUDE"end + end +end diff --git a/lib/square/types/customer_preferences.rb b/lib/square/types/customer_preferences.rb new file mode 100644 index 000000000..25de7c1bf --- /dev/null +++ b/lib/square/types/customer_preferences.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents communication preferences for the customer profile. + class CustomerPreferences < Internal::Types::Model + field :email_unsubscribed, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_query.rb b/lib/square/types/customer_query.rb new file mode 100644 index 000000000..cde69a8e0 --- /dev/null +++ b/lib/square/types/customer_query.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents filtering and sorting criteria for a [SearchCustomers](api-endpoint:Customers-SearchCustomers) request. + class CustomerQuery < Internal::Types::Model + field :filter, Square::Types::CustomerFilter, optional: true, nullable: false + field :sort, Square::Types::CustomerSort, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_segment.rb b/lib/square/types/customer_segment.rb new file mode 100644 index 000000000..466516181 --- /dev/null +++ b/lib/square/types/customer_segment.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CustomerSegment < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_sort.rb b/lib/square/types/customer_sort.rb new file mode 100644 index 000000000..ef8fa7d0b --- /dev/null +++ b/lib/square/types/customer_sort.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the sorting criteria in a [search query](entity:CustomerQuery) that defines how to sort + # customer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results. + class CustomerSort < Internal::Types::Model + field :field, Square::Types::CustomerSortField, optional: true, nullable: false + field :order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_sort_field.rb b/lib/square/types/customer_sort_field.rb new file mode 100644 index 000000000..2c71af283 --- /dev/null +++ b/lib/square/types/customer_sort_field.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module CustomerSortField + extend Square::Internal::Types::Enum + DEFAULT = "DEFAULT" + CREATED_AT = "CREATED_AT"end + end +end diff --git a/lib/square/types/customer_tax_ids.rb b/lib/square/types/customer_tax_ids.rb new file mode 100644 index 000000000..8fc008bf7 --- /dev/null +++ b/lib/square/types/customer_tax_ids.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the tax ID associated with a [customer profile](entity:Customer). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom. + # For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + class CustomerTaxIds < Internal::Types::Model + field :eu_vat, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_text_filter.rb b/lib/square/types/customer_text_filter.rb new file mode 100644 index 000000000..f1afcf3bc --- /dev/null +++ b/lib/square/types/customer_text_filter.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class CustomerTextFilter < Internal::Types::Model + field :exact, String, optional: true, nullable: false + field :fuzzy, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_updated_event.rb b/lib/square/types/customer_updated_event.rb new file mode 100644 index 000000000..b4a4643d5 --- /dev/null +++ b/lib/square/types/customer_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [customer](entity:Customer) is updated. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). + # + # Updates to the 'segment_ids' customer field does not invoke a `customer.updated` event. In addition, the `customer` object in the event notification does not include this field. + class CustomerUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomerUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_updated_event_data.rb b/lib/square/types/customer_updated_event_data.rb new file mode 100644 index 000000000..2038a72ec --- /dev/null +++ b/lib/square/types/customer_updated_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with the event. + class CustomerUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::CustomerUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/customer_updated_event_object.rb b/lib/square/types/customer_updated_event_object.rb new file mode 100644 index 000000000..5af253667 --- /dev/null +++ b/lib/square/types/customer_updated_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the customer associated with the event. + class CustomerUpdatedEventObject < Internal::Types::Model + field :customer, Square::Types::Customer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/data_collection_options.rb b/lib/square/types/data_collection_options.rb new file mode 100644 index 000000000..b0c43e812 --- /dev/null +++ b/lib/square/types/data_collection_options.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class DataCollectionOptions < Internal::Types::Model + field :title, String, optional: false, nullable: false + field :body, String, optional: false, nullable: false + field :input_type, Square::Types::DataCollectionOptionsInputType, optional: false, nullable: false + field :collected_data, Square::Types::CollectedData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/data_collection_options_input_type.rb b/lib/square/types/data_collection_options_input_type.rb new file mode 100644 index 000000000..c6bf4dbd7 --- /dev/null +++ b/lib/square/types/data_collection_options_input_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module DataCollectionOptionsInputType + extend Square::Internal::Types::Enum + EMAIL = "EMAIL" + PHONE_NUMBER = "PHONE_NUMBER"end + end +end diff --git a/lib/square/types/date_range.rb b/lib/square/types/date_range.rb new file mode 100644 index 000000000..1c687271c --- /dev/null +++ b/lib/square/types/date_range.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A range defined by two dates. Used for filtering a query for Connect v2 + # objects that have date properties. + class DateRange < Internal::Types::Model + field :start_date, String, optional: true, nullable: false + field :end_date, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/day_of_week.rb b/lib/square/types/day_of_week.rb new file mode 100644 index 000000000..a692b3b44 --- /dev/null +++ b/lib/square/types/day_of_week.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + module DayOfWeek + extend Square::Internal::Types::Enum + SUN = "SUN" + MON = "MON" + TUE = "TUE" + WED = "WED" + THU = "THU" + FRI = "FRI" + SAT = "SAT"end + end +end diff --git a/lib/square/types/delete_booking_custom_attribute_definition_response.rb b/lib/square/types/delete_booking_custom_attribute_definition_response.rb new file mode 100644 index 000000000..10481fa64 --- /dev/null +++ b/lib/square/types/delete_booking_custom_attribute_definition_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [DeleteBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttributeDefinition) response + # containing error messages when errors occurred during the request. The successful response does not contain any payload. + class DeleteBookingCustomAttributeDefinitionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_booking_custom_attribute_response.rb b/lib/square/types/delete_booking_custom_attribute_response.rb new file mode 100644 index 000000000..0cb5b6f73 --- /dev/null +++ b/lib/square/types/delete_booking_custom_attribute_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [DeleteBookingCustomAttribute](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttribute) response. + # Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. + class DeleteBookingCustomAttributeResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_break_type_response.rb b/lib/square/types/delete_break_type_response.rb new file mode 100644 index 000000000..de1e5ffe9 --- /dev/null +++ b/lib/square/types/delete_break_type_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The response to a request to delete a `BreakType`. The response might contain a set + # of `Error` objects if the request resulted in errors. + class DeleteBreakTypeResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_catalog_object_response.rb b/lib/square/types/delete_catalog_object_response.rb new file mode 100644 index 000000000..5cedbb19a --- /dev/null +++ b/lib/square/types/delete_catalog_object_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DeleteCatalogObjectResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :deleted_object_ids, Internal::Types::Array[String], optional: true, nullable: false + field :deleted_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_customer_card_response.rb b/lib/square/types/delete_customer_card_response.rb new file mode 100644 index 000000000..fe8852bf7 --- /dev/null +++ b/lib/square/types/delete_customer_card_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the `DeleteCustomerCard` endpoint. + class DeleteCustomerCardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_customer_custom_attribute_definition_response.rb b/lib/square/types/delete_customer_custom_attribute_definition_response.rb new file mode 100644 index 000000000..6f4f5e666 --- /dev/null +++ b/lib/square/types/delete_customer_custom_attribute_definition_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from a delete request containing error messages if there are any. + class DeleteCustomerCustomAttributeDefinitionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_customer_custom_attribute_response.rb b/lib/square/types/delete_customer_custom_attribute_response.rb new file mode 100644 index 000000000..b3e1fe380 --- /dev/null +++ b/lib/square/types/delete_customer_custom_attribute_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [DeleteCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-DeleteCustomerCustomAttribute) response. + # Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. + class DeleteCustomerCustomAttributeResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_customer_group_response.rb b/lib/square/types/delete_customer_group_response.rb new file mode 100644 index 000000000..34f384378 --- /dev/null +++ b/lib/square/types/delete_customer_group_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [DeleteCustomerGroup](api-endpoint:CustomerGroups-DeleteCustomerGroup) endpoint. + class DeleteCustomerGroupResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_customer_response.rb b/lib/square/types/delete_customer_response.rb new file mode 100644 index 000000000..4e8328f67 --- /dev/null +++ b/lib/square/types/delete_customer_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the `DeleteCustomer` endpoint. + class DeleteCustomerResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_dispute_evidence_response.rb b/lib/square/types/delete_dispute_evidence_response.rb new file mode 100644 index 000000000..5e3d8458d --- /dev/null +++ b/lib/square/types/delete_dispute_evidence_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields in a `DeleteDisputeEvidence` response. + class DeleteDisputeEvidenceResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_invoice_attachment_response.rb b/lib/square/types/delete_invoice_attachment_response.rb new file mode 100644 index 000000000..c3a2f880e --- /dev/null +++ b/lib/square/types/delete_invoice_attachment_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) response. + class DeleteInvoiceAttachmentResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_invoice_response.rb b/lib/square/types/delete_invoice_response.rb new file mode 100644 index 000000000..2b8c98093 --- /dev/null +++ b/lib/square/types/delete_invoice_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes a `DeleteInvoice` response. + class DeleteInvoiceResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_location_custom_attribute_definition_response.rb b/lib/square/types/delete_location_custom_attribute_definition_response.rb new file mode 100644 index 000000000..a331c59c7 --- /dev/null +++ b/lib/square/types/delete_location_custom_attribute_definition_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from a delete request containing error messages if there are any. + class DeleteLocationCustomAttributeDefinitionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_location_custom_attribute_response.rb b/lib/square/types/delete_location_custom_attribute_response.rb new file mode 100644 index 000000000..0438e9c60 --- /dev/null +++ b/lib/square/types/delete_location_custom_attribute_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [DeleteLocationCustomAttribute](api-endpoint:LocationCustomAttributes-DeleteLocationCustomAttribute) response. + # Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. + class DeleteLocationCustomAttributeResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_loyalty_reward_response.rb b/lib/square/types/delete_loyalty_reward_response.rb new file mode 100644 index 000000000..623b7fc9b --- /dev/null +++ b/lib/square/types/delete_loyalty_reward_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # A response returned by the API call. + class DeleteLoyaltyRewardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_merchant_custom_attribute_definition_response.rb b/lib/square/types/delete_merchant_custom_attribute_definition_response.rb new file mode 100644 index 000000000..574530345 --- /dev/null +++ b/lib/square/types/delete_merchant_custom_attribute_definition_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from a delete request containing error messages if there are any. + class DeleteMerchantCustomAttributeDefinitionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_merchant_custom_attribute_response.rb b/lib/square/types/delete_merchant_custom_attribute_response.rb new file mode 100644 index 000000000..a4ca0a138 --- /dev/null +++ b/lib/square/types/delete_merchant_custom_attribute_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [DeleteMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-DeleteMerchantCustomAttribute) response. + # Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. + class DeleteMerchantCustomAttributeResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_order_custom_attribute_definition_response.rb b/lib/square/types/delete_order_custom_attribute_definition_response.rb new file mode 100644 index 000000000..70c842d83 --- /dev/null +++ b/lib/square/types/delete_order_custom_attribute_definition_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from deleting an order custom attribute definition. + class DeleteOrderCustomAttributeDefinitionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_order_custom_attribute_response.rb b/lib/square/types/delete_order_custom_attribute_response.rb new file mode 100644 index 000000000..404cbdeaa --- /dev/null +++ b/lib/square/types/delete_order_custom_attribute_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from deleting an order custom attribute. + class DeleteOrderCustomAttributeResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_payment_link_response.rb b/lib/square/types/delete_payment_link_response.rb new file mode 100644 index 000000000..1297eacd6 --- /dev/null +++ b/lib/square/types/delete_payment_link_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DeletePaymentLinkResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :cancelled_order_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_shift_response.rb b/lib/square/types/delete_shift_response.rb new file mode 100644 index 000000000..4726a1f49 --- /dev/null +++ b/lib/square/types/delete_shift_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The response to a request to delete a `Shift`. The response might contain a set of + # `Error` objects if the request resulted in errors. + class DeleteShiftResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_snippet_response.rb b/lib/square/types/delete_snippet_response.rb new file mode 100644 index 000000000..9f2eb5a5b --- /dev/null +++ b/lib/square/types/delete_snippet_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a `DeleteSnippet` response. + class DeleteSnippetResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_subscription_action_response.rb b/lib/square/types/delete_subscription_action_response.rb new file mode 100644 index 000000000..66b5844b2 --- /dev/null +++ b/lib/square/types/delete_subscription_action_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response of the [DeleteSubscriptionAction](api-endpoint:Subscriptions-DeleteSubscriptionAction) + # endpoint. + class DeleteSubscriptionActionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::Subscription, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_timecard_response.rb b/lib/square/types/delete_timecard_response.rb new file mode 100644 index 000000000..7cf93b176 --- /dev/null +++ b/lib/square/types/delete_timecard_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The response to a request to delete a `Timecard`. The response might contain a set of + # `Error` objects if the request resulted in errors. + class DeleteTimecardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/delete_webhook_subscription_response.rb b/lib/square/types/delete_webhook_subscription_response.rb new file mode 100644 index 000000000..fb4d8c57b --- /dev/null +++ b/lib/square/types/delete_webhook_subscription_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [DeleteWebhookSubscription](api-endpoint:WebhookSubscriptions-DeleteWebhookSubscription) endpoint. + class DeleteWebhookSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/destination.rb b/lib/square/types/destination.rb new file mode 100644 index 000000000..a0944a1d5 --- /dev/null +++ b/lib/square/types/destination.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Information about the destination against which the payout was made. + class Destination < Internal::Types::Model + field :type, Square::Types::DestinationType, optional: true, nullable: false + field :id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/destination_details.rb b/lib/square/types/destination_details.rb new file mode 100644 index 000000000..c15ea9b31 --- /dev/null +++ b/lib/square/types/destination_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Details about a refund's destination. + class DestinationDetails < Internal::Types::Model + field :card_details, Square::Types::DestinationDetailsCardRefundDetails, optional: true, nullable: false + field :cash_details, Square::Types::DestinationDetailsCashRefundDetails, optional: true, nullable: false + field :external_details, Square::Types::DestinationDetailsExternalRefundDetails, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/destination_details_card_refund_details.rb b/lib/square/types/destination_details_card_refund_details.rb new file mode 100644 index 000000000..eded6fd8f --- /dev/null +++ b/lib/square/types/destination_details_card_refund_details.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DestinationDetailsCardRefundDetails < Internal::Types::Model + field :card, Square::Types::Card, optional: true, nullable: false + field :entry_method, String, optional: true, nullable: false + field :auth_result_code, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/destination_details_cash_refund_details.rb b/lib/square/types/destination_details_cash_refund_details.rb new file mode 100644 index 000000000..abc915c36 --- /dev/null +++ b/lib/square/types/destination_details_cash_refund_details.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Stores details about a cash refund. Contains only non-confidential information. + class DestinationDetailsCashRefundDetails < Internal::Types::Model + field :seller_supplied_money, Square::Types::Money, optional: false, nullable: false + field :change_back_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/destination_details_external_refund_details.rb b/lib/square/types/destination_details_external_refund_details.rb new file mode 100644 index 000000000..559b99374 --- /dev/null +++ b/lib/square/types/destination_details_external_refund_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Stores details about an external refund. Contains only non-confidential information. + class DestinationDetailsExternalRefundDetails < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :source, String, optional: false, nullable: false + field :source_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/destination_type.rb b/lib/square/types/destination_type.rb new file mode 100644 index 000000000..80d952972 --- /dev/null +++ b/lib/square/types/destination_type.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module DestinationType + extend Square::Internal::Types::Enum + BANK_ACCOUNT = "BANK_ACCOUNT" + CARD = "CARD" + SQUARE_BALANCE = "SQUARE_BALANCE" + SQUARE_STORED_BALANCE = "SQUARE_STORED_BALANCE"end + end +end diff --git a/lib/square/types/device.rb b/lib/square/types/device.rb new file mode 100644 index 000000000..ca79dd0d2 --- /dev/null +++ b/lib/square/types/device.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class Device < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :attributes, Square::Types::DeviceAttributes, optional: false, nullable: false + field :components, Internal::Types::Array[Square::Types::Component], optional: true, nullable: false + field :status, Square::Types::DeviceStatus, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_attributes.rb b/lib/square/types/device_attributes.rb new file mode 100644 index 000000000..7df6c721c --- /dev/null +++ b/lib/square/types/device_attributes.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceAttributes < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :manufacturer, String, optional: false, nullable: false + field :model, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :manufacturers_id, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, String, optional: true, nullable: false + field :merchant_token, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_checkout_options.rb b/lib/square/types/device_checkout_options.rb new file mode 100644 index 000000000..30a9b0af2 --- /dev/null +++ b/lib/square/types/device_checkout_options.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceCheckoutOptions < Internal::Types::Model + field :device_id, String, optional: false, nullable: false + field :skip_receipt_screen, Internal::Types::Boolean, optional: true, nullable: false + field :collect_signature, Internal::Types::Boolean, optional: true, nullable: false + field :tip_settings, Square::Types::TipSettings, optional: true, nullable: false + field :show_itemized_cart, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_code.rb b/lib/square/types/device_code.rb new file mode 100644 index 000000000..0d91b283a --- /dev/null +++ b/lib/square/types/device_code.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceCode < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :code, String, optional: true, nullable: false + field :device_id, String, optional: true, nullable: false + field :product_type, String, optional: false, nullable: false + field :location_id, String, optional: true, nullable: false + field :status, Square::Types::DeviceCodeStatus, optional: true, nullable: false + field :pair_by, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :status_changed_at, String, optional: true, nullable: false + field :paired_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_code_paired_event.rb b/lib/square/types/device_code_paired_event.rb new file mode 100644 index 000000000..4c4b35c68 --- /dev/null +++ b/lib/square/types/device_code_paired_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a Square Terminal has been paired with a + # Terminal API client and the device_id of the paired Square Terminal is + # available. + class DeviceCodePairedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::DeviceCodePairedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_code_paired_event_data.rb b/lib/square/types/device_code_paired_event_data.rb new file mode 100644 index 000000000..aa664fe18 --- /dev/null +++ b/lib/square/types/device_code_paired_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceCodePairedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::DeviceCodePairedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_code_paired_event_object.rb b/lib/square/types/device_code_paired_event_object.rb new file mode 100644 index 000000000..ff4056b65 --- /dev/null +++ b/lib/square/types/device_code_paired_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceCodePairedEventObject < Internal::Types::Model + field :device_code, Square::Types::DeviceCode, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_code_status.rb b/lib/square/types/device_code_status.rb new file mode 100644 index 000000000..deae03343 --- /dev/null +++ b/lib/square/types/device_code_status.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module DeviceCodeStatus + extend Square::Internal::Types::Enum + UNKNOWN = "UNKNOWN" + UNPAIRED = "UNPAIRED" + PAIRED = "PAIRED" + EXPIRED = "EXPIRED"end + end +end diff --git a/lib/square/types/device_component_details_application_details.rb b/lib/square/types/device_component_details_application_details.rb new file mode 100644 index 000000000..93359a261 --- /dev/null +++ b/lib/square/types/device_component_details_application_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceComponentDetailsApplicationDetails < Internal::Types::Model + field :application_type, String, optional: true, nullable: false + field :version, String, optional: true, nullable: false + field :session_location, String, optional: true, nullable: false + field :device_code_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_component_details_battery_details.rb b/lib/square/types/device_component_details_battery_details.rb new file mode 100644 index 000000000..c697a7e3d --- /dev/null +++ b/lib/square/types/device_component_details_battery_details.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceComponentDetailsBatteryDetails < Internal::Types::Model + field :visible_percent, Integer, optional: true, nullable: false + field :external_power, Square::Types::DeviceComponentDetailsExternalPower, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_component_details_card_reader_details.rb b/lib/square/types/device_component_details_card_reader_details.rb new file mode 100644 index 000000000..2494c72b1 --- /dev/null +++ b/lib/square/types/device_component_details_card_reader_details.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceComponentDetailsCardReaderDetails < Internal::Types::Model + field :version, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_component_details_ethernet_details.rb b/lib/square/types/device_component_details_ethernet_details.rb new file mode 100644 index 000000000..d36ccee43 --- /dev/null +++ b/lib/square/types/device_component_details_ethernet_details.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceComponentDetailsEthernetDetails < Internal::Types::Model + field :active, Internal::Types::Boolean, optional: true, nullable: false + field :ip_address_v_4, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_component_details_external_power.rb b/lib/square/types/device_component_details_external_power.rb new file mode 100644 index 000000000..d4e54501e --- /dev/null +++ b/lib/square/types/device_component_details_external_power.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module DeviceComponentDetailsExternalPower + extend Square::Internal::Types::Enum + AVAILABLE_CHARGING = "AVAILABLE_CHARGING" + AVAILABLE_NOT_IN_USE = "AVAILABLE_NOT_IN_USE" + UNAVAILABLE = "UNAVAILABLE" + AVAILABLE_INSUFFICIENT = "AVAILABLE_INSUFFICIENT"end + end +end diff --git a/lib/square/types/device_component_details_measurement.rb b/lib/square/types/device_component_details_measurement.rb new file mode 100644 index 000000000..d5b19acff --- /dev/null +++ b/lib/square/types/device_component_details_measurement.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # A value qualified by unit of measure. + class DeviceComponentDetailsMeasurement < Internal::Types::Model + field :value, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_component_details_wi_fi_details.rb b/lib/square/types/device_component_details_wi_fi_details.rb new file mode 100644 index 000000000..6ed364663 --- /dev/null +++ b/lib/square/types/device_component_details_wi_fi_details.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceComponentDetailsWiFiDetails < Internal::Types::Model + field :active, Internal::Types::Boolean, optional: true, nullable: false + field :ssid, String, optional: true, nullable: false + field :ip_address_v_4, String, optional: true, nullable: false + field :secure_connection, String, optional: true, nullable: false + field :signal_strength, Square::Types::DeviceComponentDetailsMeasurement, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_created_event.rb b/lib/square/types/device_created_event.rb new file mode 100644 index 000000000..71e9303e0 --- /dev/null +++ b/lib/square/types/device_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a Device is created. + class DeviceCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::DeviceCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_created_event_data.rb b/lib/square/types/device_created_event_data.rb new file mode 100644 index 000000000..5154834b9 --- /dev/null +++ b/lib/square/types/device_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::DeviceCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_created_event_object.rb b/lib/square/types/device_created_event_object.rb new file mode 100644 index 000000000..4baf9abd8 --- /dev/null +++ b/lib/square/types/device_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceCreatedEventObject < Internal::Types::Model + field :device, Square::Types::Device, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_details.rb b/lib/square/types/device_details.rb new file mode 100644 index 000000000..d6f5003a6 --- /dev/null +++ b/lib/square/types/device_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Details about the device that took the payment. + class DeviceDetails < Internal::Types::Model + field :device_id, String, optional: true, nullable: false + field :device_installation_id, String, optional: true, nullable: false + field :device_name, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_metadata.rb b/lib/square/types/device_metadata.rb new file mode 100644 index 000000000..5b79ef051 --- /dev/null +++ b/lib/square/types/device_metadata.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceMetadata < Internal::Types::Model + field :battery_percentage, String, optional: true, nullable: false + field :charging_state, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :merchant_id, String, optional: true, nullable: false + field :network_connection_type, String, optional: true, nullable: false + field :payment_region, String, optional: true, nullable: false + field :serial_number, String, optional: true, nullable: false + field :os_version, String, optional: true, nullable: false + field :app_version, String, optional: true, nullable: false + field :wifi_network_name, String, optional: true, nullable: false + field :wifi_network_strength, String, optional: true, nullable: false + field :ip_address, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_status.rb b/lib/square/types/device_status.rb new file mode 100644 index 000000000..1609be0f8 --- /dev/null +++ b/lib/square/types/device_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DeviceStatus < Internal::Types::Model + field :category, Square::Types::DeviceStatusCategory, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/device_status_category.rb b/lib/square/types/device_status_category.rb new file mode 100644 index 000000000..c00b3bfba --- /dev/null +++ b/lib/square/types/device_status_category.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module DeviceStatusCategory + extend Square::Internal::Types::Enum + AVAILABLE = "AVAILABLE" + NEEDS_ATTENTION = "NEEDS_ATTENTION" + OFFLINE = "OFFLINE"end + end +end diff --git a/lib/square/types/digital_wallet_details.rb b/lib/square/types/digital_wallet_details.rb new file mode 100644 index 000000000..6d57f7e7a --- /dev/null +++ b/lib/square/types/digital_wallet_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Additional details about `WALLET` type payments. Contains only non-confidential information. + class DigitalWalletDetails < Internal::Types::Model + field :status, String, optional: true, nullable: false + field :brand, String, optional: true, nullable: false + field :cash_app_details, Square::Types::CashAppDetails, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/disable_card_response.rb b/lib/square/types/disable_card_response.rb new file mode 100644 index 000000000..907646c79 --- /dev/null +++ b/lib/square/types/disable_card_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [DisableCard](api-endpoint:Cards-DisableCard) endpoint. + # + # Note: if there are errors processing the request, the card field will not be + # present. + class DisableCardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :card, Square::Types::Card, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/disable_events_response.rb b/lib/square/types/disable_events_response.rb new file mode 100644 index 000000000..b0bce454b --- /dev/null +++ b/lib/square/types/disable_events_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [DisableEvents](api-endpoint:Events-DisableEvents) endpoint. + # + # Note: if there are errors processing the request, the events field will not be + # present. + class DisableEventsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dismiss_terminal_action_response.rb b/lib/square/types/dismiss_terminal_action_response.rb new file mode 100644 index 000000000..e80c8a6bb --- /dev/null +++ b/lib/square/types/dismiss_terminal_action_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class DismissTerminalActionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :action, Square::Types::TerminalAction, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dismiss_terminal_checkout_response.rb b/lib/square/types/dismiss_terminal_checkout_response.rb new file mode 100644 index 000000000..1420c93b2 --- /dev/null +++ b/lib/square/types/dismiss_terminal_checkout_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class DismissTerminalCheckoutResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :checkout, Square::Types::TerminalCheckout, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dismiss_terminal_refund_response.rb b/lib/square/types/dismiss_terminal_refund_response.rb new file mode 100644 index 000000000..d84c42e75 --- /dev/null +++ b/lib/square/types/dismiss_terminal_refund_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class DismissTerminalRefundResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :refund, Square::Types::TerminalRefund, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute.rb b/lib/square/types/dispute.rb new file mode 100644 index 000000000..d5c96e639 --- /dev/null +++ b/lib/square/types/dispute.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. + class Dispute < Internal::Types::Model + field :dispute_id, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :reason, Square::Types::DisputeReason, optional: true, nullable: false + field :state, Square::Types::DisputeState, optional: true, nullable: false + field :due_at, String, optional: true, nullable: false + field :disputed_payment, Square::Types::DisputedPayment, optional: true, nullable: false + field :evidence_ids, Internal::Types::Array[String], optional: true, nullable: false + field :card_brand, Square::Types::CardBrand, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :brand_dispute_id, String, optional: true, nullable: false + field :reported_date, String, optional: true, nullable: false + field :reported_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_created_event.rb b/lib/square/types/dispute_created_event.rb new file mode 100644 index 000000000..41e42c762 --- /dev/null +++ b/lib/square/types/dispute_created_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Dispute](entity:Dispute) is created. + class DisputeCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::DisputeCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_created_event_data.rb b/lib/square/types/dispute_created_event_data.rb new file mode 100644 index 000000000..d3074d776 --- /dev/null +++ b/lib/square/types/dispute_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::DisputeCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_created_event_object.rb b/lib/square/types/dispute_created_event_object.rb new file mode 100644 index 000000000..727dff05d --- /dev/null +++ b/lib/square/types/dispute_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeCreatedEventObject < Internal::Types::Model + field :object, Square::Types::Dispute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence.rb b/lib/square/types/dispute_evidence.rb new file mode 100644 index 000000000..4c633fffd --- /dev/null +++ b/lib/square/types/dispute_evidence.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeEvidence < Internal::Types::Model + field :evidence_id, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :dispute_id, String, optional: true, nullable: false + field :evidence_file, Square::Types::DisputeEvidenceFile, optional: true, nullable: false + field :evidence_text, String, optional: true, nullable: false + field :uploaded_at, String, optional: true, nullable: false + field :evidence_type, Square::Types::DisputeEvidenceType, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_added_event.rb b/lib/square/types/dispute_evidence_added_event.rb new file mode 100644 index 000000000..73ebad177 --- /dev/null +++ b/lib/square/types/dispute_evidence_added_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when evidence is added to a [Dispute](entity:Dispute) + # from the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app, + # or by calling either [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) or [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText). + class DisputeEvidenceAddedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::DisputeEvidenceAddedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_added_event_data.rb b/lib/square/types/dispute_evidence_added_event_data.rb new file mode 100644 index 000000000..bf50bc03e --- /dev/null +++ b/lib/square/types/dispute_evidence_added_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeEvidenceAddedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::DisputeEvidenceAddedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_added_event_object.rb b/lib/square/types/dispute_evidence_added_event_object.rb new file mode 100644 index 000000000..96916c1b3 --- /dev/null +++ b/lib/square/types/dispute_evidence_added_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeEvidenceAddedEventObject < Internal::Types::Model + field :object, Square::Types::Dispute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_created_event.rb b/lib/square/types/dispute_evidence_created_event.rb new file mode 100644 index 000000000..db60f235c --- /dev/null +++ b/lib/square/types/dispute_evidence_created_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when evidence is added to a [Dispute](entity:Dispute) + # from the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app, + # or by calling either [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) or [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText). + class DisputeEvidenceCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::DisputeEvidenceCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_created_event_data.rb b/lib/square/types/dispute_evidence_created_event_data.rb new file mode 100644 index 000000000..ce52e3e36 --- /dev/null +++ b/lib/square/types/dispute_evidence_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeEvidenceCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::DisputeEvidenceCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_created_event_object.rb b/lib/square/types/dispute_evidence_created_event_object.rb new file mode 100644 index 000000000..9873209d2 --- /dev/null +++ b/lib/square/types/dispute_evidence_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeEvidenceCreatedEventObject < Internal::Types::Model + field :object, Square::Types::Dispute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_deleted_event.rb b/lib/square/types/dispute_evidence_deleted_event.rb new file mode 100644 index 000000000..5352c8792 --- /dev/null +++ b/lib/square/types/dispute_evidence_deleted_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when evidence is removed from a [Dispute](entity:Dispute) + # from the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app, + # or by calling [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence). + class DisputeEvidenceDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::DisputeEvidenceDeletedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_deleted_event_data.rb b/lib/square/types/dispute_evidence_deleted_event_data.rb new file mode 100644 index 000000000..8661d4e7c --- /dev/null +++ b/lib/square/types/dispute_evidence_deleted_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeEvidenceDeletedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::DisputeEvidenceDeletedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_deleted_event_object.rb b/lib/square/types/dispute_evidence_deleted_event_object.rb new file mode 100644 index 000000000..4fdf328d4 --- /dev/null +++ b/lib/square/types/dispute_evidence_deleted_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeEvidenceDeletedEventObject < Internal::Types::Model + field :object, Square::Types::Dispute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_file.rb b/lib/square/types/dispute_evidence_file.rb new file mode 100644 index 000000000..a6e3c7ba5 --- /dev/null +++ b/lib/square/types/dispute_evidence_file.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A file to be uploaded as dispute evidence. + class DisputeEvidenceFile < Internal::Types::Model + field :filename, String, optional: true, nullable: false + field :filetype, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_removed_event.rb b/lib/square/types/dispute_evidence_removed_event.rb new file mode 100644 index 000000000..a6810018e --- /dev/null +++ b/lib/square/types/dispute_evidence_removed_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when evidence is removed from a [Dispute](entity:Dispute) + # from the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app, + # or by calling [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence). + class DisputeEvidenceRemovedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::DisputeEvidenceRemovedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_removed_event_data.rb b/lib/square/types/dispute_evidence_removed_event_data.rb new file mode 100644 index 000000000..3da57d370 --- /dev/null +++ b/lib/square/types/dispute_evidence_removed_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeEvidenceRemovedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::DisputeEvidenceRemovedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_removed_event_object.rb b/lib/square/types/dispute_evidence_removed_event_object.rb new file mode 100644 index 000000000..74019b24f --- /dev/null +++ b/lib/square/types/dispute_evidence_removed_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeEvidenceRemovedEventObject < Internal::Types::Model + field :object, Square::Types::Dispute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_evidence_type.rb b/lib/square/types/dispute_evidence_type.rb new file mode 100644 index 000000000..d671f31b9 --- /dev/null +++ b/lib/square/types/dispute_evidence_type.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + module DisputeEvidenceType + extend Square::Internal::Types::Enum + GENERIC_EVIDENCE = "GENERIC_EVIDENCE" + ONLINE_OR_APP_ACCESS_LOG = "ONLINE_OR_APP_ACCESS_LOG" + AUTHORIZATION_DOCUMENTATION = "AUTHORIZATION_DOCUMENTATION" + CANCELLATION_OR_REFUND_DOCUMENTATION = "CANCELLATION_OR_REFUND_DOCUMENTATION" + CARDHOLDER_COMMUNICATION = "CARDHOLDER_COMMUNICATION" + CARDHOLDER_INFORMATION = "CARDHOLDER_INFORMATION" + PURCHASE_ACKNOWLEDGEMENT = "PURCHASE_ACKNOWLEDGEMENT" + DUPLICATE_CHARGE_DOCUMENTATION = "DUPLICATE_CHARGE_DOCUMENTATION" + PRODUCT_OR_SERVICE_DESCRIPTION = "PRODUCT_OR_SERVICE_DESCRIPTION" + RECEIPT = "RECEIPT" + SERVICE_RECEIVED_DOCUMENTATION = "SERVICE_RECEIVED_DOCUMENTATION" + PROOF_OF_DELIVERY_DOCUMENTATION = "PROOF_OF_DELIVERY_DOCUMENTATION" + RELATED_TRANSACTION_DOCUMENTATION = "RELATED_TRANSACTION_DOCUMENTATION" + REBUTTAL_EXPLANATION = "REBUTTAL_EXPLANATION" + TRACKING_NUMBER = "TRACKING_NUMBER"end + end +end diff --git a/lib/square/types/dispute_reason.rb b/lib/square/types/dispute_reason.rb new file mode 100644 index 000000000..d32a8252c --- /dev/null +++ b/lib/square/types/dispute_reason.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + module DisputeReason + extend Square::Internal::Types::Enum + AMOUNT_DIFFERS = "AMOUNT_DIFFERS" + CANCELLED = "CANCELLED" + DUPLICATE = "DUPLICATE" + NO_KNOWLEDGE = "NO_KNOWLEDGE" + NOT_AS_DESCRIBED = "NOT_AS_DESCRIBED" + NOT_RECEIVED = "NOT_RECEIVED" + PAID_BY_OTHER_MEANS = "PAID_BY_OTHER_MEANS" + CUSTOMER_REQUESTS_CREDIT = "CUSTOMER_REQUESTS_CREDIT" + EMV_LIABILITY_SHIFT = "EMV_LIABILITY_SHIFT"end + end +end diff --git a/lib/square/types/dispute_state.rb b/lib/square/types/dispute_state.rb new file mode 100644 index 000000000..4e61f93c9 --- /dev/null +++ b/lib/square/types/dispute_state.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + module DisputeState + extend Square::Internal::Types::Enum + INQUIRY_EVIDENCE_REQUIRED = "INQUIRY_EVIDENCE_REQUIRED" + INQUIRY_PROCESSING = "INQUIRY_PROCESSING" + INQUIRY_CLOSED = "INQUIRY_CLOSED" + EVIDENCE_REQUIRED = "EVIDENCE_REQUIRED" + PROCESSING = "PROCESSING" + WON = "WON" + LOST = "LOST" + ACCEPTED = "ACCEPTED"end + end +end diff --git a/lib/square/types/dispute_state_changed_event.rb b/lib/square/types/dispute_state_changed_event.rb new file mode 100644 index 000000000..c17c8ece1 --- /dev/null +++ b/lib/square/types/dispute_state_changed_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when the state of a [Dispute](entity:Dispute) changes. + # This includes the dispute resolution (WON, LOST) reported by the bank. The event + # data includes details of what changed. + class DisputeStateChangedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::DisputeStateChangedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_state_changed_event_data.rb b/lib/square/types/dispute_state_changed_event_data.rb new file mode 100644 index 000000000..4425fb0d3 --- /dev/null +++ b/lib/square/types/dispute_state_changed_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeStateChangedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::DisputeStateChangedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_state_changed_event_object.rb b/lib/square/types/dispute_state_changed_event_object.rb new file mode 100644 index 000000000..b34a535be --- /dev/null +++ b/lib/square/types/dispute_state_changed_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeStateChangedEventObject < Internal::Types::Model + field :object, Square::Types::Dispute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_state_updated_event.rb b/lib/square/types/dispute_state_updated_event.rb new file mode 100644 index 000000000..4c781c3bb --- /dev/null +++ b/lib/square/types/dispute_state_updated_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when the state of a [Dispute](entity:Dispute) changes. + # This includes the dispute resolution (WON, LOST) reported by the bank. The event + # data includes details of what changed. + class DisputeStateUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::DisputeStateUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_state_updated_event_data.rb b/lib/square/types/dispute_state_updated_event_data.rb new file mode 100644 index 000000000..54f5d213e --- /dev/null +++ b/lib/square/types/dispute_state_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeStateUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::DisputeStateUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/dispute_state_updated_event_object.rb b/lib/square/types/dispute_state_updated_event_object.rb new file mode 100644 index 000000000..740b9ab0f --- /dev/null +++ b/lib/square/types/dispute_state_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class DisputeStateUpdatedEventObject < Internal::Types::Model + field :object, Square::Types::Dispute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/disputed_payment.rb b/lib/square/types/disputed_payment.rb new file mode 100644 index 000000000..63a83a797 --- /dev/null +++ b/lib/square/types/disputed_payment.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # The payment the cardholder disputed. + class DisputedPayment < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/ecom_visibility.rb b/lib/square/types/ecom_visibility.rb new file mode 100644 index 000000000..91857ea3b --- /dev/null +++ b/lib/square/types/ecom_visibility.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module EcomVisibility + extend Square::Internal::Types::Enum + UNINDEXED = "UNINDEXED" + UNAVAILABLE = "UNAVAILABLE" + HIDDEN = "HIDDEN" + VISIBLE = "VISIBLE"end + end +end diff --git a/lib/square/types/employee.rb b/lib/square/types/employee.rb new file mode 100644 index 000000000..22523ac56 --- /dev/null +++ b/lib/square/types/employee.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Square + module Types + # An employee object that is used by the external API. + # + # DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember). + class Employee < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :first_name, String, optional: true, nullable: false + field :last_name, String, optional: true, nullable: false + field :email, String, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :status, Square::Types::EmployeeStatus, optional: true, nullable: false + field :is_owner, Internal::Types::Boolean, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/employee_status.rb b/lib/square/types/employee_status.rb new file mode 100644 index 000000000..40e82e115 --- /dev/null +++ b/lib/square/types/employee_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module EmployeeStatus + extend Square::Internal::Types::Enum + ACTIVE = "ACTIVE" + INACTIVE = "INACTIVE"end + end +end diff --git a/lib/square/types/employee_wage.rb b/lib/square/types/employee_wage.rb new file mode 100644 index 000000000..2e22424f0 --- /dev/null +++ b/lib/square/types/employee_wage.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class EmployeeWage < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :employee_id, String, optional: true, nullable: false + field :title, String, optional: true, nullable: false + field :hourly_rate, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/enable_events_response.rb b/lib/square/types/enable_events_response.rb new file mode 100644 index 000000000..b89f7fe23 --- /dev/null +++ b/lib/square/types/enable_events_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [EnableEvents](api-endpoint:Events-EnableEvents) endpoint. + # + # Note: if there are errors processing the request, the events field will not be + # present. + class EnableEventsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/error.rb b/lib/square/types/error.rb new file mode 100644 index 000000000..0423b8acb --- /dev/null +++ b/lib/square/types/error.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class Error < Internal::Types::Model + field :category, Square::Types::ErrorCategory, optional: false, nullable: false + field :code, Square::Types::ErrorCode, optional: false, nullable: false + field :detail, String, optional: true, nullable: false + field :field, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/error_category.rb b/lib/square/types/error_category.rb new file mode 100644 index 000000000..6d856882b --- /dev/null +++ b/lib/square/types/error_category.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + module ErrorCategory + extend Square::Internal::Types::Enum + API_ERROR = "API_ERROR" + AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR" + INVALID_REQUEST_ERROR = "INVALID_REQUEST_ERROR" + RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR" + PAYMENT_METHOD_ERROR = "PAYMENT_METHOD_ERROR" + REFUND_ERROR = "REFUND_ERROR" + MERCHANT_SUBSCRIPTION_ERROR = "MERCHANT_SUBSCRIPTION_ERROR" + EXTERNAL_VENDOR_ERROR = "EXTERNAL_VENDOR_ERROR"end + end +end diff --git a/lib/square/types/error_code.rb b/lib/square/types/error_code.rb new file mode 100644 index 000000000..1e386d214 --- /dev/null +++ b/lib/square/types/error_code.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module Square + module Types + module ErrorCode + extend Square::Internal::Types::Enum + INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR" + UNAUTHORIZED = "UNAUTHORIZED" + ACCESS_TOKEN_EXPIRED = "ACCESS_TOKEN_EXPIRED" + ACCESS_TOKEN_REVOKED = "ACCESS_TOKEN_REVOKED" + CLIENT_DISABLED = "CLIENT_DISABLED" + FORBIDDEN = "FORBIDDEN" + INSUFFICIENT_SCOPES = "INSUFFICIENT_SCOPES" + APPLICATION_DISABLED = "APPLICATION_DISABLED" + V_1_APPLICATION = "V1_APPLICATION" + V_1_ACCESS_TOKEN = "V1_ACCESS_TOKEN" + CARD_PROCESSING_NOT_ENABLED = "CARD_PROCESSING_NOT_ENABLED" + MERCHANT_SUBSCRIPTION_NOT_FOUND = "MERCHANT_SUBSCRIPTION_NOT_FOUND" + BAD_REQUEST = "BAD_REQUEST" + MISSING_REQUIRED_PARAMETER = "MISSING_REQUIRED_PARAMETER" + INCORRECT_TYPE = "INCORRECT_TYPE" + INVALID_TIME = "INVALID_TIME" + INVALID_TIME_RANGE = "INVALID_TIME_RANGE" + INVALID_VALUE = "INVALID_VALUE" + INVALID_CURSOR = "INVALID_CURSOR" + UNKNOWN_QUERY_PARAMETER = "UNKNOWN_QUERY_PARAMETER" + CONFLICTING_PARAMETERS = "CONFLICTING_PARAMETERS" + EXPECTED_JSON_BODY = "EXPECTED_JSON_BODY" + INVALID_SORT_ORDER = "INVALID_SORT_ORDER" + VALUE_REGEX_MISMATCH = "VALUE_REGEX_MISMATCH" + VALUE_TOO_SHORT = "VALUE_TOO_SHORT" + VALUE_TOO_LONG = "VALUE_TOO_LONG" + VALUE_TOO_LOW = "VALUE_TOO_LOW" + VALUE_TOO_HIGH = "VALUE_TOO_HIGH" + VALUE_EMPTY = "VALUE_EMPTY" + ARRAY_LENGTH_TOO_LONG = "ARRAY_LENGTH_TOO_LONG" + ARRAY_LENGTH_TOO_SHORT = "ARRAY_LENGTH_TOO_SHORT" + ARRAY_EMPTY = "ARRAY_EMPTY" + EXPECTED_BOOLEAN = "EXPECTED_BOOLEAN" + EXPECTED_INTEGER = "EXPECTED_INTEGER" + EXPECTED_FLOAT = "EXPECTED_FLOAT" + EXPECTED_STRING = "EXPECTED_STRING" + EXPECTED_OBJECT = "EXPECTED_OBJECT" + EXPECTED_ARRAY = "EXPECTED_ARRAY" + EXPECTED_MAP = "EXPECTED_MAP" + EXPECTED_BASE_64_ENCODED_BYTE_ARRAY = "EXPECTED_BASE64_ENCODED_BYTE_ARRAY" + INVALID_ARRAY_VALUE = "INVALID_ARRAY_VALUE" + INVALID_ENUM_VALUE = "INVALID_ENUM_VALUE" + INVALID_CONTENT_TYPE = "INVALID_CONTENT_TYPE" + INVALID_FORM_VALUE = "INVALID_FORM_VALUE" + CUSTOMER_NOT_FOUND = "CUSTOMER_NOT_FOUND" + ONE_INSTRUMENT_EXPECTED = "ONE_INSTRUMENT_EXPECTED" + NO_FIELDS_SET = "NO_FIELDS_SET" + TOO_MANY_MAP_ENTRIES = "TOO_MANY_MAP_ENTRIES" + MAP_KEY_LENGTH_TOO_SHORT = "MAP_KEY_LENGTH_TOO_SHORT" + MAP_KEY_LENGTH_TOO_LONG = "MAP_KEY_LENGTH_TOO_LONG" + CUSTOMER_MISSING_NAME = "CUSTOMER_MISSING_NAME" + CUSTOMER_MISSING_EMAIL = "CUSTOMER_MISSING_EMAIL" + INVALID_PAUSE_LENGTH = "INVALID_PAUSE_LENGTH" + INVALID_DATE = "INVALID_DATE" + UNSUPPORTED_COUNTRY = "UNSUPPORTED_COUNTRY" + UNSUPPORTED_CURRENCY = "UNSUPPORTED_CURRENCY" + APPLE_TTP_PIN_TOKEN = "APPLE_TTP_PIN_TOKEN" + CARD_EXPIRED = "CARD_EXPIRED" + INVALID_EXPIRATION = "INVALID_EXPIRATION" + INVALID_EXPIRATION_YEAR = "INVALID_EXPIRATION_YEAR" + INVALID_EXPIRATION_DATE = "INVALID_EXPIRATION_DATE" + UNSUPPORTED_CARD_BRAND = "UNSUPPORTED_CARD_BRAND" + UNSUPPORTED_ENTRY_METHOD = "UNSUPPORTED_ENTRY_METHOD" + INVALID_ENCRYPTED_CARD = "INVALID_ENCRYPTED_CARD" + INVALID_CARD = "INVALID_CARD" + PAYMENT_AMOUNT_MISMATCH = "PAYMENT_AMOUNT_MISMATCH" + GENERIC_DECLINE = "GENERIC_DECLINE" + CVV_FAILURE = "CVV_FAILURE" + ADDRESS_VERIFICATION_FAILURE = "ADDRESS_VERIFICATION_FAILURE" + INVALID_ACCOUNT = "INVALID_ACCOUNT" + CURRENCY_MISMATCH = "CURRENCY_MISMATCH" + INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS" + INSUFFICIENT_PERMISSIONS = "INSUFFICIENT_PERMISSIONS" + CARDHOLDER_INSUFFICIENT_PERMISSIONS = "CARDHOLDER_INSUFFICIENT_PERMISSIONS" + INVALID_LOCATION = "INVALID_LOCATION" + TRANSACTION_LIMIT = "TRANSACTION_LIMIT" + VOICE_FAILURE = "VOICE_FAILURE" + PAN_FAILURE = "PAN_FAILURE" + EXPIRATION_FAILURE = "EXPIRATION_FAILURE" + CARD_NOT_SUPPORTED = "CARD_NOT_SUPPORTED" + READER_DECLINED = "READER_DECLINED" + INVALID_PIN = "INVALID_PIN" + MISSING_PIN = "MISSING_PIN" + MISSING_ACCOUNT_TYPE = "MISSING_ACCOUNT_TYPE" + INVALID_POSTAL_CODE = "INVALID_POSTAL_CODE" + INVALID_FEES = "INVALID_FEES" + MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED = "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED" + PAYMENT_LIMIT_EXCEEDED = "PAYMENT_LIMIT_EXCEEDED" + GIFT_CARD_AVAILABLE_AMOUNT = "GIFT_CARD_AVAILABLE_AMOUNT" + ACCOUNT_UNUSABLE = "ACCOUNT_UNUSABLE" + BUYER_REFUSED_PAYMENT = "BUYER_REFUSED_PAYMENT" + DELAYED_TRANSACTION_EXPIRED = "DELAYED_TRANSACTION_EXPIRED" + DELAYED_TRANSACTION_CANCELED = "DELAYED_TRANSACTION_CANCELED" + DELAYED_TRANSACTION_CAPTURED = "DELAYED_TRANSACTION_CAPTURED" + DELAYED_TRANSACTION_FAILED = "DELAYED_TRANSACTION_FAILED" + CARD_TOKEN_EXPIRED = "CARD_TOKEN_EXPIRED" + CARD_TOKEN_USED = "CARD_TOKEN_USED" + AMOUNT_TOO_HIGH = "AMOUNT_TOO_HIGH" + UNSUPPORTED_INSTRUMENT_TYPE = "UNSUPPORTED_INSTRUMENT_TYPE" + REFUND_AMOUNT_INVALID = "REFUND_AMOUNT_INVALID" + REFUND_ALREADY_PENDING = "REFUND_ALREADY_PENDING" + PAYMENT_NOT_REFUNDABLE = "PAYMENT_NOT_REFUNDABLE" + PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE = "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE" + REFUND_ERROR_PAYMENT_NEEDS_COMPLETION = "REFUND_ERROR_PAYMENT_NEEDS_COMPLETION" + REFUND_DECLINED = "REFUND_DECLINED" + INSUFFICIENT_PERMISSIONS_FOR_REFUND = "INSUFFICIENT_PERMISSIONS_FOR_REFUND" + INVALID_CARD_DATA = "INVALID_CARD_DATA" + SOURCE_USED = "SOURCE_USED" + SOURCE_EXPIRED = "SOURCE_EXPIRED" + UNSUPPORTED_LOYALTY_REWARD_TIER = "UNSUPPORTED_LOYALTY_REWARD_TIER" + LOCATION_MISMATCH = "LOCATION_MISMATCH" + ORDER_UNPAID_NOT_RETURNABLE = "ORDER_UNPAID_NOT_RETURNABLE" + IDEMPOTENCY_KEY_REUSED = "IDEMPOTENCY_KEY_REUSED" + UNEXPECTED_VALUE = "UNEXPECTED_VALUE" + SANDBOX_NOT_SUPPORTED = "SANDBOX_NOT_SUPPORTED" + INVALID_EMAIL_ADDRESS = "INVALID_EMAIL_ADDRESS" + INVALID_PHONE_NUMBER = "INVALID_PHONE_NUMBER" + CHECKOUT_EXPIRED = "CHECKOUT_EXPIRED" + BAD_CERTIFICATE = "BAD_CERTIFICATE" + INVALID_SQUARE_VERSION_FORMAT = "INVALID_SQUARE_VERSION_FORMAT" + API_VERSION_INCOMPATIBLE = "API_VERSION_INCOMPATIBLE" + CARD_PRESENCE_REQUIRED = "CARD_PRESENCE_REQUIRED" + UNSUPPORTED_SOURCE_TYPE = "UNSUPPORTED_SOURCE_TYPE" + CARD_MISMATCH = "CARD_MISMATCH" + PLAID_ERROR = "PLAID_ERROR" + PLAID_ERROR_ITEM_LOGIN_REQUIRED = "PLAID_ERROR_ITEM_LOGIN_REQUIRED" + PLAID_ERROR_RATE_LIMIT = "PLAID_ERROR_RATE_LIMIT" + CARD_DECLINED = "CARD_DECLINED" + VERIFY_CVV_FAILURE = "VERIFY_CVV_FAILURE" + VERIFY_AVS_FAILURE = "VERIFY_AVS_FAILURE" + CARD_DECLINED_CALL_ISSUER = "CARD_DECLINED_CALL_ISSUER" + CARD_DECLINED_VERIFICATION_REQUIRED = "CARD_DECLINED_VERIFICATION_REQUIRED" + BAD_EXPIRATION = "BAD_EXPIRATION" + CHIP_INSERTION_REQUIRED = "CHIP_INSERTION_REQUIRED" + ALLOWABLE_PIN_TRIES_EXCEEDED = "ALLOWABLE_PIN_TRIES_EXCEEDED" + RESERVATION_DECLINED = "RESERVATION_DECLINED" + UNKNOWN_BODY_PARAMETER = "UNKNOWN_BODY_PARAMETER" + NOT_FOUND = "NOT_FOUND" + APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND = "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND" + METHOD_NOT_ALLOWED = "METHOD_NOT_ALLOWED" + NOT_ACCEPTABLE = "NOT_ACCEPTABLE" + REQUEST_TIMEOUT = "REQUEST_TIMEOUT" + CONFLICT = "CONFLICT" + GONE = "GONE" + REQUEST_ENTITY_TOO_LARGE = "REQUEST_ENTITY_TOO_LARGE" + UNSUPPORTED_MEDIA_TYPE = "UNSUPPORTED_MEDIA_TYPE" + UNPROCESSABLE_ENTITY = "UNPROCESSABLE_ENTITY" + RATE_LIMITED = "RATE_LIMITED" + NOT_IMPLEMENTED = "NOT_IMPLEMENTED" + BAD_GATEWAY = "BAD_GATEWAY" + SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE" + TEMPORARY_ERROR = "TEMPORARY_ERROR" + GATEWAY_TIMEOUT = "GATEWAY_TIMEOUT"end + end +end diff --git a/lib/square/types/event.rb b/lib/square/types/event.rb new file mode 100644 index 000000000..7cea184f5 --- /dev/null +++ b/lib/square/types/event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + class Event < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::EventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/event_data.rb b/lib/square/types/event_data.rb new file mode 100644 index 000000000..c46c21c96 --- /dev/null +++ b/lib/square/types/event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class EventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :deleted, Internal::Types::Boolean, optional: true, nullable: false + field :object, Internal::Types::Hash[String, Internal::Types::Hash[String, ]], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/event_metadata.rb b/lib/square/types/event_metadata.rb new file mode 100644 index 000000000..4da3853ed --- /dev/null +++ b/lib/square/types/event_metadata.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Contains metadata about a particular [Event](entity:Event). + class EventMetadata < Internal::Types::Model + field :event_id, String, optional: true, nullable: false + field :api_version, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/event_type_metadata.rb b/lib/square/types/event_type_metadata.rb new file mode 100644 index 000000000..800a96722 --- /dev/null +++ b/lib/square/types/event_type_metadata.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Contains the metadata of a webhook event type. + class EventTypeMetadata < Internal::Types::Model + field :event_type, String, optional: true, nullable: false + field :api_version_introduced, String, optional: true, nullable: false + field :release_status, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/exclude_strategy.rb b/lib/square/types/exclude_strategy.rb new file mode 100644 index 000000000..7dbc8077f --- /dev/null +++ b/lib/square/types/exclude_strategy.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module ExcludeStrategy + extend Square::Internal::Types::Enum + LEAST_EXPENSIVE = "LEAST_EXPENSIVE" + MOST_EXPENSIVE = "MOST_EXPENSIVE"end + end +end diff --git a/lib/square/types/external_payment_details.rb b/lib/square/types/external_payment_details.rb new file mode 100644 index 000000000..1bcc5bc9f --- /dev/null +++ b/lib/square/types/external_payment_details.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class ExternalPaymentDetails < Internal::Types::Model + field :type, String, optional: false, nullable: false + field :source, String, optional: false, nullable: false + field :source_id, String, optional: true, nullable: false + field :source_fee_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/filter_value.rb b/lib/square/types/filter_value.rb new file mode 100644 index 000000000..2df5b9b39 --- /dev/null +++ b/lib/square/types/filter_value.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class FilterValue < Internal::Types::Model + field :all, Internal::Types::Array[String], optional: true, nullable: false + field :any, Internal::Types::Array[String], optional: true, nullable: false + field :none, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/float_number_range.rb b/lib/square/types/float_number_range.rb new file mode 100644 index 000000000..1427d8186 --- /dev/null +++ b/lib/square/types/float_number_range.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Specifies a decimal number range. + class FloatNumberRange < Internal::Types::Model + field :start_at, String, optional: true, nullable: false + field :end_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/fulfillment.rb b/lib/square/types/fulfillment.rb new file mode 100644 index 000000000..020b1bcc1 --- /dev/null +++ b/lib/square/types/fulfillment.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class Fulfillment < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :type, Square::Types::FulfillmentType, optional: true, nullable: false + field :state, Square::Types::FulfillmentState, optional: true, nullable: false + field :line_item_application, Square::Types::FulfillmentFulfillmentLineItemApplication, optional: true, nullable: false + field :entries, Internal::Types::Array[Square::Types::FulfillmentFulfillmentEntry], optional: true, nullable: false + field :metadata, Internal::Types::Hash[String, String], optional: true, nullable: false + field :pickup_details, Square::Types::FulfillmentPickupDetails, optional: true, nullable: false + field :shipment_details, Square::Types::FulfillmentShipmentDetails, optional: true, nullable: false + field :delivery_details, Square::Types::FulfillmentDeliveryDetails, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/fulfillment_delivery_details.rb b/lib/square/types/fulfillment_delivery_details.rb new file mode 100644 index 000000000..12f092117 --- /dev/null +++ b/lib/square/types/fulfillment_delivery_details.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes delivery details of an order fulfillment. + class FulfillmentDeliveryDetails < Internal::Types::Model + field :recipient, Square::Types::FulfillmentRecipient, optional: true, nullable: false + field :schedule_type, Square::Types::FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType, optional: true, nullable: false + field :placed_at, String, optional: true, nullable: false + field :deliver_at, String, optional: true, nullable: false + field :prep_time_duration, String, optional: true, nullable: false + field :delivery_window_duration, String, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :completed_at, String, optional: true, nullable: false + field :in_progress_at, String, optional: true, nullable: false + field :rejected_at, String, optional: true, nullable: false + field :ready_at, String, optional: true, nullable: false + field :delivered_at, String, optional: true, nullable: false + field :canceled_at, String, optional: true, nullable: false + field :cancel_reason, String, optional: true, nullable: false + field :courier_pickup_at, String, optional: true, nullable: false + field :courier_pickup_window_duration, String, optional: true, nullable: false + field :is_no_contact_delivery, Internal::Types::Boolean, optional: true, nullable: false + field :dropoff_notes, String, optional: true, nullable: false + field :courier_provider_name, String, optional: true, nullable: false + field :courier_support_phone_number, String, optional: true, nullable: false + field :square_delivery_id, String, optional: true, nullable: false + field :external_delivery_id, String, optional: true, nullable: false + field :managed_delivery, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/fulfillment_delivery_details_order_fulfillment_delivery_details_schedule_type.rb b/lib/square/types/fulfillment_delivery_details_order_fulfillment_delivery_details_schedule_type.rb new file mode 100644 index 000000000..ae92799e8 --- /dev/null +++ b/lib/square/types/fulfillment_delivery_details_order_fulfillment_delivery_details_schedule_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType + extend Square::Internal::Types::Enum + SCHEDULED = "SCHEDULED" + ASAP = "ASAP"end + end +end diff --git a/lib/square/types/fulfillment_fulfillment_entry.rb b/lib/square/types/fulfillment_fulfillment_entry.rb new file mode 100644 index 000000000..502e87946 --- /dev/null +++ b/lib/square/types/fulfillment_fulfillment_entry.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class FulfillmentFulfillmentEntry < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :line_item_uid, String, optional: false, nullable: false + field :quantity, String, optional: false, nullable: false + field :metadata, Internal::Types::Hash[String, String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/fulfillment_fulfillment_line_item_application.rb b/lib/square/types/fulfillment_fulfillment_line_item_application.rb new file mode 100644 index 000000000..8d8a0063e --- /dev/null +++ b/lib/square/types/fulfillment_fulfillment_line_item_application.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module FulfillmentFulfillmentLineItemApplication + extend Square::Internal::Types::Enum + ALL = "ALL" + ENTRY_LIST = "ENTRY_LIST"end + end +end diff --git a/lib/square/types/fulfillment_pickup_details.rb b/lib/square/types/fulfillment_pickup_details.rb new file mode 100644 index 000000000..490f902cf --- /dev/null +++ b/lib/square/types/fulfillment_pickup_details.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Square + module Types + # Contains details necessary to fulfill a pickup order. + class FulfillmentPickupDetails < Internal::Types::Model + field :recipient, Square::Types::FulfillmentRecipient, optional: true, nullable: false + field :expires_at, String, optional: true, nullable: false + field :auto_complete_duration, String, optional: true, nullable: false + field :schedule_type, Square::Types::FulfillmentPickupDetailsScheduleType, optional: true, nullable: false + field :pickup_at, String, optional: true, nullable: false + field :pickup_window_duration, String, optional: true, nullable: false + field :prep_time_duration, String, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :placed_at, String, optional: true, nullable: false + field :accepted_at, String, optional: true, nullable: false + field :rejected_at, String, optional: true, nullable: false + field :ready_at, String, optional: true, nullable: false + field :expired_at, String, optional: true, nullable: false + field :picked_up_at, String, optional: true, nullable: false + field :canceled_at, String, optional: true, nullable: false + field :cancel_reason, String, optional: true, nullable: false + field :is_curbside_pickup, Internal::Types::Boolean, optional: true, nullable: false + field :curbside_pickup_details, Square::Types::FulfillmentPickupDetailsCurbsidePickupDetails, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/fulfillment_pickup_details_curbside_pickup_details.rb b/lib/square/types/fulfillment_pickup_details_curbside_pickup_details.rb new file mode 100644 index 000000000..0da1b2ee6 --- /dev/null +++ b/lib/square/types/fulfillment_pickup_details_curbside_pickup_details.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Specific details for curbside pickup. + class FulfillmentPickupDetailsCurbsidePickupDetails < Internal::Types::Model + field :curbside_details, String, optional: true, nullable: false + field :buyer_arrived_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/fulfillment_pickup_details_schedule_type.rb b/lib/square/types/fulfillment_pickup_details_schedule_type.rb new file mode 100644 index 000000000..b44369775 --- /dev/null +++ b/lib/square/types/fulfillment_pickup_details_schedule_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module FulfillmentPickupDetailsScheduleType + extend Square::Internal::Types::Enum + SCHEDULED = "SCHEDULED" + ASAP = "ASAP"end + end +end diff --git a/lib/square/types/fulfillment_recipient.rb b/lib/square/types/fulfillment_recipient.rb new file mode 100644 index 000000000..1c8caac2b --- /dev/null +++ b/lib/square/types/fulfillment_recipient.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Information about the fulfillment recipient. + class FulfillmentRecipient < Internal::Types::Model + field :customer_id, String, optional: true, nullable: false + field :display_name, String, optional: true, nullable: false + field :email_address, String, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :address, Square::Types::Address, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/fulfillment_shipment_details.rb b/lib/square/types/fulfillment_shipment_details.rb new file mode 100644 index 000000000..e38872ee2 --- /dev/null +++ b/lib/square/types/fulfillment_shipment_details.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Square + module Types + # Contains the details necessary to fulfill a shipment order. + class FulfillmentShipmentDetails < Internal::Types::Model + field :recipient, Square::Types::FulfillmentRecipient, optional: true, nullable: false + field :carrier, String, optional: true, nullable: false + field :shipping_note, String, optional: true, nullable: false + field :shipping_type, String, optional: true, nullable: false + field :tracking_number, String, optional: true, nullable: false + field :tracking_url, String, optional: true, nullable: false + field :placed_at, String, optional: true, nullable: false + field :in_progress_at, String, optional: true, nullable: false + field :packaged_at, String, optional: true, nullable: false + field :expected_shipped_at, String, optional: true, nullable: false + field :shipped_at, String, optional: true, nullable: false + field :canceled_at, String, optional: true, nullable: false + field :cancel_reason, String, optional: true, nullable: false + field :failed_at, String, optional: true, nullable: false + field :failure_reason, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/fulfillment_state.rb b/lib/square/types/fulfillment_state.rb new file mode 100644 index 000000000..ec8d06c8d --- /dev/null +++ b/lib/square/types/fulfillment_state.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + module FulfillmentState + extend Square::Internal::Types::Enum + PROPOSED = "PROPOSED" + RESERVED = "RESERVED" + PREPARED = "PREPARED" + COMPLETED = "COMPLETED" + CANCELED = "CANCELED" + FAILED = "FAILED"end + end +end diff --git a/lib/square/types/fulfillment_type.rb b/lib/square/types/fulfillment_type.rb new file mode 100644 index 000000000..8bf7cd31f --- /dev/null +++ b/lib/square/types/fulfillment_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module FulfillmentType + extend Square::Internal::Types::Enum + PICKUP = "PICKUP" + SHIPMENT = "SHIPMENT" + DELIVERY = "DELIVERY"end + end +end diff --git a/lib/square/types/get_bank_account_by_v_1_id_response.rb b/lib/square/types/get_bank_account_by_v_1_id_response.rb new file mode 100644 index 000000000..8bb06d0d8 --- /dev/null +++ b/lib/square/types/get_bank_account_by_v_1_id_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Response object returned by GetBankAccountByV1Id. + class GetBankAccountByV1IdResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :bank_account, Square::Types::BankAccount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_bank_account_response.rb b/lib/square/types/get_bank_account_response.rb new file mode 100644 index 000000000..518591ceb --- /dev/null +++ b/lib/square/types/get_bank_account_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Response object returned by `GetBankAccount`. + class GetBankAccountResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :bank_account, Square::Types::BankAccount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_booking_response.rb b/lib/square/types/get_booking_response.rb new file mode 100644 index 000000000..e8a1df0b3 --- /dev/null +++ b/lib/square/types/get_booking_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetBookingResponse < Internal::Types::Model + field :booking, Square::Types::Booking, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_break_type_response.rb b/lib/square/types/get_break_type_response.rb new file mode 100644 index 000000000..899d11931 --- /dev/null +++ b/lib/square/types/get_break_type_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class GetBreakTypeResponse < Internal::Types::Model + field :break_type, Square::Types::BreakType, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_business_booking_profile_response.rb b/lib/square/types/get_business_booking_profile_response.rb new file mode 100644 index 000000000..d446e6e82 --- /dev/null +++ b/lib/square/types/get_business_booking_profile_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetBusinessBookingProfileResponse < Internal::Types::Model + field :business_booking_profile, Square::Types::BusinessBookingProfile, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_card_response.rb b/lib/square/types/get_card_response.rb new file mode 100644 index 000000000..b7f188585 --- /dev/null +++ b/lib/square/types/get_card_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [RetrieveCard](api-endpoint:Cards-RetrieveCard) endpoint. + # + # Note: if there are errors processing the request, the card field will not be + # present. + class GetCardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :card, Square::Types::Card, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_cash_drawer_shift_response.rb b/lib/square/types/get_cash_drawer_shift_response.rb new file mode 100644 index 000000000..e930ed293 --- /dev/null +++ b/lib/square/types/get_cash_drawer_shift_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetCashDrawerShiftResponse < Internal::Types::Model + field :cash_drawer_shift, Square::Types::CashDrawerShift, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_catalog_object_response.rb b/lib/square/types/get_catalog_object_response.rb new file mode 100644 index 000000000..2a484d02b --- /dev/null +++ b/lib/square/types/get_catalog_object_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class GetCatalogObjectResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :object, Square::Types::CatalogObject, optional: true, nullable: false + field :related_objects, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_customer_custom_attribute_definition_response.rb b/lib/square/types/get_customer_custom_attribute_definition_response.rb new file mode 100644 index 000000000..0b743996f --- /dev/null +++ b/lib/square/types/get_customer_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class GetCustomerCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_customer_custom_attribute_response.rb b/lib/square/types/get_customer_custom_attribute_response.rb new file mode 100644 index 000000000..de4ef6dd4 --- /dev/null +++ b/lib/square/types/get_customer_custom_attribute_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class GetCustomerCustomAttributeResponse < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_customer_group_response.rb b/lib/square/types/get_customer_group_response.rb new file mode 100644 index 000000000..040bb851b --- /dev/null +++ b/lib/square/types/get_customer_group_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [RetrieveCustomerGroup](api-endpoint:CustomerGroups-RetrieveCustomerGroup) endpoint. + # + # Either `errors` or `group` is present in a given response (never both). + class GetCustomerGroupResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :group, Square::Types::CustomerGroup, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_customer_response.rb b/lib/square/types/get_customer_response.rb new file mode 100644 index 000000000..2554b307b --- /dev/null +++ b/lib/square/types/get_customer_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class GetCustomerResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :customer, Square::Types::Customer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_customer_segment_response.rb b/lib/square/types/get_customer_segment_response.rb new file mode 100644 index 000000000..4f97ea423 --- /dev/null +++ b/lib/square/types/get_customer_segment_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class GetCustomerSegmentResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :segment, Square::Types::CustomerSegment, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_device_code_response.rb b/lib/square/types/get_device_code_response.rb new file mode 100644 index 000000000..a1eb5eeaf --- /dev/null +++ b/lib/square/types/get_device_code_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetDeviceCodeResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :device_code, Square::Types::DeviceCode, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_device_response.rb b/lib/square/types/get_device_response.rb new file mode 100644 index 000000000..71fa2b0f7 --- /dev/null +++ b/lib/square/types/get_device_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetDeviceResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :device, Square::Types::Device, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_dispute_evidence_response.rb b/lib/square/types/get_dispute_evidence_response.rb new file mode 100644 index 000000000..d50f9e9a7 --- /dev/null +++ b/lib/square/types/get_dispute_evidence_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields in a `RetrieveDisputeEvidence` response. + class GetDisputeEvidenceResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :evidence, Square::Types::DisputeEvidence, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_dispute_response.rb b/lib/square/types/get_dispute_response.rb new file mode 100644 index 000000000..ae6c33eff --- /dev/null +++ b/lib/square/types/get_dispute_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines fields in a `RetrieveDispute` response. + class GetDisputeResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :dispute, Square::Types::Dispute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_employee_response.rb b/lib/square/types/get_employee_response.rb new file mode 100644 index 000000000..5560c5539 --- /dev/null +++ b/lib/square/types/get_employee_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetEmployeeResponse < Internal::Types::Model + field :employee, Square::Types::Employee, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_employee_wage_response.rb b/lib/square/types/get_employee_wage_response.rb new file mode 100644 index 000000000..2f9d8728a --- /dev/null +++ b/lib/square/types/get_employee_wage_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class GetEmployeeWageResponse < Internal::Types::Model + field :employee_wage, Square::Types::EmployeeWage, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_gift_card_from_gan_response.rb b/lib/square/types/get_gift_card_from_gan_response.rb new file mode 100644 index 000000000..64966b949 --- /dev/null +++ b/lib/square/types/get_gift_card_from_gan_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains a `GiftCard`. This response might contain a set of `Error` objects + # if the request resulted in errors. + class GetGiftCardFromGanResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :gift_card, Square::Types::GiftCard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_gift_card_from_nonce_response.rb b/lib/square/types/get_gift_card_from_nonce_response.rb new file mode 100644 index 000000000..8b2fedaca --- /dev/null +++ b/lib/square/types/get_gift_card_from_nonce_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains a `GiftCard` object. If the request resulted in errors, + # the response contains a set of `Error` objects. + class GetGiftCardFromNonceResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :gift_card, Square::Types::GiftCard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_gift_card_response.rb b/lib/square/types/get_gift_card_response.rb new file mode 100644 index 000000000..626e6e26c --- /dev/null +++ b/lib/square/types/get_gift_card_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains a `GiftCard`. The response might contain a set of `Error` objects + # if the request resulted in errors. + class GetGiftCardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :gift_card, Square::Types::GiftCard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_inventory_adjustment_response.rb b/lib/square/types/get_inventory_adjustment_response.rb new file mode 100644 index 000000000..eb26a469d --- /dev/null +++ b/lib/square/types/get_inventory_adjustment_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetInventoryAdjustmentResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :adjustment, Square::Types::InventoryAdjustment, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_inventory_changes_response.rb b/lib/square/types/get_inventory_changes_response.rb new file mode 100644 index 000000000..74f422c6b --- /dev/null +++ b/lib/square/types/get_inventory_changes_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class GetInventoryChangesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :changes, Internal::Types::Array[Square::Types::InventoryChange], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_inventory_count_response.rb b/lib/square/types/get_inventory_count_response.rb new file mode 100644 index 000000000..84eb28ff3 --- /dev/null +++ b/lib/square/types/get_inventory_count_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class GetInventoryCountResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :counts, Internal::Types::Array[Square::Types::InventoryCount], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_inventory_physical_count_response.rb b/lib/square/types/get_inventory_physical_count_response.rb new file mode 100644 index 000000000..98fd1a316 --- /dev/null +++ b/lib/square/types/get_inventory_physical_count_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetInventoryPhysicalCountResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :count, Square::Types::InventoryPhysicalCount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_inventory_transfer_response.rb b/lib/square/types/get_inventory_transfer_response.rb new file mode 100644 index 000000000..7c788c408 --- /dev/null +++ b/lib/square/types/get_inventory_transfer_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetInventoryTransferResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :transfer, Square::Types::InventoryTransfer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_invoice_response.rb b/lib/square/types/get_invoice_response.rb new file mode 100644 index 000000000..f2a5b052e --- /dev/null +++ b/lib/square/types/get_invoice_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes a `GetInvoice` response. + class GetInvoiceResponse < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_location_response.rb b/lib/square/types/get_location_response.rb new file mode 100644 index 000000000..6f6b5ffe9 --- /dev/null +++ b/lib/square/types/get_location_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that the [RetrieveLocation](api-endpoint:Locations-RetrieveLocation) + # endpoint returns in a response. + class GetLocationResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :location, Square::Types::Location, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_loyalty_account_response.rb b/lib/square/types/get_loyalty_account_response.rb new file mode 100644 index 000000000..f415c3f79 --- /dev/null +++ b/lib/square/types/get_loyalty_account_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that includes the loyalty account. + class GetLoyaltyAccountResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :loyalty_account, Square::Types::LoyaltyAccount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_loyalty_program_response.rb b/lib/square/types/get_loyalty_program_response.rb new file mode 100644 index 000000000..cea05bec3 --- /dev/null +++ b/lib/square/types/get_loyalty_program_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains the loyalty program. + class GetLoyaltyProgramResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :program, Square::Types::LoyaltyProgram, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_loyalty_promotion_response.rb b/lib/square/types/get_loyalty_promotion_response.rb new file mode 100644 index 000000000..8986f429f --- /dev/null +++ b/lib/square/types/get_loyalty_promotion_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveLoyaltyPromotionPromotions](api-endpoint:Loyalty-RetrieveLoyaltyPromotion) response. + class GetLoyaltyPromotionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :loyalty_promotion, Square::Types::LoyaltyPromotion, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_loyalty_reward_response.rb b/lib/square/types/get_loyalty_reward_response.rb new file mode 100644 index 000000000..68c4497ac --- /dev/null +++ b/lib/square/types/get_loyalty_reward_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that includes the loyalty reward. + class GetLoyaltyRewardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :reward, Square::Types::LoyaltyReward, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_merchant_response.rb b/lib/square/types/get_merchant_response.rb new file mode 100644 index 000000000..de1f2abda --- /dev/null +++ b/lib/square/types/get_merchant_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The response object returned by the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) endpoint. + class GetMerchantResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :merchant, Square::Types::Merchant, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_order_response.rb b/lib/square/types/get_order_response.rb new file mode 100644 index 000000000..c18497e21 --- /dev/null +++ b/lib/square/types/get_order_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetOrderResponse < Internal::Types::Model + field :order, Square::Types::Order, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_payment_link_response.rb b/lib/square/types/get_payment_link_response.rb new file mode 100644 index 000000000..179a46317 --- /dev/null +++ b/lib/square/types/get_payment_link_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetPaymentLinkResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :payment_link, Square::Types::PaymentLink, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_payment_refund_response.rb b/lib/square/types/get_payment_refund_response.rb new file mode 100644 index 000000000..de452c33c --- /dev/null +++ b/lib/square/types/get_payment_refund_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response returned by [GetRefund](api-endpoint:Refunds-GetPaymentRefund). + # + # Note: If there are errors processing the request, the refund field might not be + # present or it might be present in a FAILED state. + class GetPaymentRefundResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :refund, Square::Types::PaymentRefund, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_payment_response.rb b/lib/square/types/get_payment_response.rb new file mode 100644 index 000000000..86dc7f566 --- /dev/null +++ b/lib/square/types/get_payment_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response returned by [GetPayment](api-endpoint:Payments-GetPayment). + class GetPaymentResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :payment, Square::Types::Payment, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_payout_response.rb b/lib/square/types/get_payout_response.rb new file mode 100644 index 000000000..08ece4023 --- /dev/null +++ b/lib/square/types/get_payout_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetPayoutResponse < Internal::Types::Model + field :payout, Square::Types::Payout, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_shift_response.rb b/lib/square/types/get_shift_response.rb new file mode 100644 index 000000000..61efc44eb --- /dev/null +++ b/lib/square/types/get_shift_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class GetShiftResponse < Internal::Types::Model + field :shift, Square::Types::Shift, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_snippet_response.rb b/lib/square/types/get_snippet_response.rb new file mode 100644 index 000000000..ff98d5967 --- /dev/null +++ b/lib/square/types/get_snippet_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a `RetrieveSnippet` response. The response can include either `snippet` or `errors`. + class GetSnippetResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :snippet, Square::Types::Snippet, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_subscription_response.rb b/lib/square/types/get_subscription_response.rb new file mode 100644 index 000000000..f6e8ffc4f --- /dev/null +++ b/lib/square/types/get_subscription_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response from the + # [RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) endpoint. + class GetSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::Subscription, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_team_member_booking_profile_response.rb b/lib/square/types/get_team_member_booking_profile_response.rb new file mode 100644 index 000000000..984a89508 --- /dev/null +++ b/lib/square/types/get_team_member_booking_profile_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetTeamMemberBookingProfileResponse < Internal::Types::Model + field :team_member_booking_profile, Square::Types::TeamMemberBookingProfile, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_team_member_response.rb b/lib/square/types/get_team_member_response.rb new file mode 100644 index 000000000..5f0ca8adb --- /dev/null +++ b/lib/square/types/get_team_member_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from a retrieve request containing a `TeamMember` object or error messages. + class GetTeamMemberResponse < Internal::Types::Model + field :team_member, Square::Types::TeamMember, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_team_member_wage_response.rb b/lib/square/types/get_team_member_wage_response.rb new file mode 100644 index 000000000..974e282b5 --- /dev/null +++ b/lib/square/types/get_team_member_wage_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class GetTeamMemberWageResponse < Internal::Types::Model + field :team_member_wage, Square::Types::TeamMemberWage, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_terminal_action_response.rb b/lib/square/types/get_terminal_action_response.rb new file mode 100644 index 000000000..f25105db8 --- /dev/null +++ b/lib/square/types/get_terminal_action_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetTerminalActionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :action, Square::Types::TerminalAction, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_terminal_checkout_response.rb b/lib/square/types/get_terminal_checkout_response.rb new file mode 100644 index 000000000..921ef71f0 --- /dev/null +++ b/lib/square/types/get_terminal_checkout_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetTerminalCheckoutResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :checkout, Square::Types::TerminalCheckout, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_terminal_refund_response.rb b/lib/square/types/get_terminal_refund_response.rb new file mode 100644 index 000000000..05a4d8e7b --- /dev/null +++ b/lib/square/types/get_terminal_refund_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class GetTerminalRefundResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :refund, Square::Types::TerminalRefund, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_transaction_response.rb b/lib/square/types/get_transaction_response.rb new file mode 100644 index 000000000..57b04d267 --- /dev/null +++ b/lib/square/types/get_transaction_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class GetTransactionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :transaction, Square::Types::Transaction, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_vendor_response.rb b/lib/square/types/get_vendor_response.rb new file mode 100644 index 000000000..5df07f152 --- /dev/null +++ b/lib/square/types/get_vendor_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an output from a call to [RetrieveVendor](api-endpoint:Vendors-RetrieveVendor). + class GetVendorResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :vendor, Square::Types::Vendor, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_wage_setting_response.rb b/lib/square/types/get_wage_setting_response.rb new file mode 100644 index 000000000..77729520f --- /dev/null +++ b/lib/square/types/get_wage_setting_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from a retrieve request containing the specified `WageSetting` object or error messages. + class GetWageSettingResponse < Internal::Types::Model + field :wage_setting, Square::Types::WageSetting, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/get_webhook_subscription_response.rb b/lib/square/types/get_webhook_subscription_response.rb new file mode 100644 index 000000000..248756789 --- /dev/null +++ b/lib/square/types/get_webhook_subscription_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [RetrieveWebhookSubscription](api-endpoint:WebhookSubscriptions-RetrieveWebhookSubscription) endpoint. + # + # Note: if there are errors processing the request, the [Subscription](entity:WebhookSubscription) will not be + # present. + class GetWebhookSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::WebhookSubscription, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card.rb b/lib/square/types/gift_card.rb new file mode 100644 index 000000000..843dd69e8 --- /dev/null +++ b/lib/square/types/gift_card.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a Square gift card. + class GiftCard < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :type, Square::Types::GiftCardType, optional: false, nullable: false + field :gan_source, Square::Types::GiftCardGanSource, optional: true, nullable: false + field :state, Square::Types::GiftCardStatus, optional: true, nullable: false + field :balance_money, Square::Types::Money, optional: true, nullable: false + field :gan, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :customer_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity.rb b/lib/square/types/gift_card_activity.rb new file mode 100644 index 000000000..19653849f --- /dev/null +++ b/lib/square/types/gift_card_activity.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an action performed on a [gift card](entity:GiftCard) that affects its state or balance. + # A gift card activity contains information about a specific activity type. For example, a `REDEEM` activity + # includes a `redeem_activity_details` field that contains information about the redemption. + class GiftCardActivity < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :type, Square::Types::GiftCardActivityType, optional: false, nullable: false + field :location_id, String, optional: false, nullable: false + field :created_at, String, optional: true, nullable: false + field :gift_card_id, String, optional: true, nullable: false + field :gift_card_gan, String, optional: true, nullable: false + field :gift_card_balance_money, Square::Types::Money, optional: true, nullable: false + field :load_activity_details, Square::Types::GiftCardActivityLoad, optional: true, nullable: false + field :activate_activity_details, Square::Types::GiftCardActivityActivate, optional: true, nullable: false + field :redeem_activity_details, Square::Types::GiftCardActivityRedeem, optional: true, nullable: false + field :clear_balance_activity_details, Square::Types::GiftCardActivityClearBalance, optional: true, nullable: false + field :deactivate_activity_details, Square::Types::GiftCardActivityDeactivate, optional: true, nullable: false + field :adjust_increment_activity_details, Square::Types::GiftCardActivityAdjustIncrement, optional: true, nullable: false + field :adjust_decrement_activity_details, Square::Types::GiftCardActivityAdjustDecrement, optional: true, nullable: false + field :refund_activity_details, Square::Types::GiftCardActivityRefund, optional: true, nullable: false + field :unlinked_activity_refund_activity_details, Square::Types::GiftCardActivityUnlinkedActivityRefund, optional: true, nullable: false + field :import_activity_details, Square::Types::GiftCardActivityImport, optional: true, nullable: false + field :block_activity_details, Square::Types::GiftCardActivityBlock, optional: true, nullable: false + field :unblock_activity_details, Square::Types::GiftCardActivityUnblock, optional: true, nullable: false + field :import_reversal_activity_details, Square::Types::GiftCardActivityImportReversal, optional: true, nullable: false + field :transfer_balance_to_activity_details, Square::Types::GiftCardActivityTransferBalanceTo, optional: true, nullable: false + field :transfer_balance_from_activity_details, Square::Types::GiftCardActivityTransferBalanceFrom, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_activate.rb b/lib/square/types/gift_card_activity_activate.rb new file mode 100644 index 000000000..ca4856383 --- /dev/null +++ b/lib/square/types/gift_card_activity_activate.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about an `ACTIVATE` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityActivate < Internal::Types::Model + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + field :line_item_uid, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :buyer_payment_instrument_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_adjust_decrement.rb b/lib/square/types/gift_card_activity_adjust_decrement.rb new file mode 100644 index 000000000..b6021cf03 --- /dev/null +++ b/lib/square/types/gift_card_activity_adjust_decrement.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about an `ADJUST_DECREMENT` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityAdjustDecrement < Internal::Types::Model + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :reason, Square::Types::GiftCardActivityAdjustDecrementReason, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_adjust_decrement_reason.rb b/lib/square/types/gift_card_activity_adjust_decrement_reason.rb new file mode 100644 index 000000000..30fc6901e --- /dev/null +++ b/lib/square/types/gift_card_activity_adjust_decrement_reason.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module GiftCardActivityAdjustDecrementReason + extend Square::Internal::Types::Enum + SUSPICIOUS_ACTIVITY = "SUSPICIOUS_ACTIVITY" + BALANCE_ACCIDENTALLY_INCREASED = "BALANCE_ACCIDENTALLY_INCREASED" + SUPPORT_ISSUE = "SUPPORT_ISSUE" + PURCHASE_WAS_REFUNDED = "PURCHASE_WAS_REFUNDED"end + end +end diff --git a/lib/square/types/gift_card_activity_adjust_increment.rb b/lib/square/types/gift_card_activity_adjust_increment.rb new file mode 100644 index 000000000..1dc882bbd --- /dev/null +++ b/lib/square/types/gift_card_activity_adjust_increment.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about an `ADJUST_INCREMENT` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityAdjustIncrement < Internal::Types::Model + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :reason, Square::Types::GiftCardActivityAdjustIncrementReason, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_adjust_increment_reason.rb b/lib/square/types/gift_card_activity_adjust_increment_reason.rb new file mode 100644 index 000000000..2e7c4a052 --- /dev/null +++ b/lib/square/types/gift_card_activity_adjust_increment_reason.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module GiftCardActivityAdjustIncrementReason + extend Square::Internal::Types::Enum + COMPLIMENTARY = "COMPLIMENTARY" + SUPPORT_ISSUE = "SUPPORT_ISSUE" + TRANSACTION_VOIDED = "TRANSACTION_VOIDED"end + end +end diff --git a/lib/square/types/gift_card_activity_block.rb b/lib/square/types/gift_card_activity_block.rb new file mode 100644 index 000000000..2aa00304d --- /dev/null +++ b/lib/square/types/gift_card_activity_block.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about a `BLOCK` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityBlock < Internal::Types::Model + field :reason, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_clear_balance.rb b/lib/square/types/gift_card_activity_clear_balance.rb new file mode 100644 index 000000000..778a844a5 --- /dev/null +++ b/lib/square/types/gift_card_activity_clear_balance.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about a `CLEAR_BALANCE` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityClearBalance < Internal::Types::Model + field :reason, Square::Types::GiftCardActivityClearBalanceReason, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_clear_balance_reason.rb b/lib/square/types/gift_card_activity_clear_balance_reason.rb new file mode 100644 index 000000000..bd1f5d105 --- /dev/null +++ b/lib/square/types/gift_card_activity_clear_balance_reason.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module GiftCardActivityClearBalanceReason + extend Square::Internal::Types::Enum + SUSPICIOUS_ACTIVITY = "SUSPICIOUS_ACTIVITY" + REUSE_GIFTCARD = "REUSE_GIFTCARD" + UNKNOWN_REASON = "UNKNOWN_REASON"end + end +end diff --git a/lib/square/types/gift_card_activity_created_event.rb b/lib/square/types/gift_card_activity_created_event.rb new file mode 100644 index 000000000..ed466bd0a --- /dev/null +++ b/lib/square/types/gift_card_activity_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [gift card activity](entity:GiftCardActivity) is created. + class GiftCardActivityCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::GiftCardActivityCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_created_event_data.rb b/lib/square/types/gift_card_activity_created_event_data.rb new file mode 100644 index 000000000..4eaa0e132 --- /dev/null +++ b/lib/square/types/gift_card_activity_created_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the data associated with a `gift_card.activity.created` event. + class GiftCardActivityCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::GiftCardActivityCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_created_event_object.rb b/lib/square/types/gift_card_activity_created_event_object.rb new file mode 100644 index 000000000..56383a2ce --- /dev/null +++ b/lib/square/types/gift_card_activity_created_event_object.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the gift card activity associated with a + # `gift_card.activity.created` event. + class GiftCardActivityCreatedEventObject < Internal::Types::Model + field :gift_card_activity, Square::Types::GiftCardActivity, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_deactivate.rb b/lib/square/types/gift_card_activity_deactivate.rb new file mode 100644 index 000000000..e15df0dbc --- /dev/null +++ b/lib/square/types/gift_card_activity_deactivate.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about a `DEACTIVATE` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityDeactivate < Internal::Types::Model + field :reason, Square::Types::GiftCardActivityDeactivateReason, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_deactivate_reason.rb b/lib/square/types/gift_card_activity_deactivate_reason.rb new file mode 100644 index 000000000..3f5948c31 --- /dev/null +++ b/lib/square/types/gift_card_activity_deactivate_reason.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module GiftCardActivityDeactivateReason + extend Square::Internal::Types::Enum + SUSPICIOUS_ACTIVITY = "SUSPICIOUS_ACTIVITY" + UNKNOWN_REASON = "UNKNOWN_REASON" + CHARGEBACK_DEACTIVATE = "CHARGEBACK_DEACTIVATE"end + end +end diff --git a/lib/square/types/gift_card_activity_import.rb b/lib/square/types/gift_card_activity_import.rb new file mode 100644 index 000000000..38f6326e5 --- /dev/null +++ b/lib/square/types/gift_card_activity_import.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about an `IMPORT` [gift card activity type](entity:GiftCardActivityType). + # This activity type is used when Square imports a third-party gift card, in which case the + # `gan_source` of the gift card is set to `OTHER`. + class GiftCardActivityImport < Internal::Types::Model + field :amount_money, Square::Types::Money, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_import_reversal.rb b/lib/square/types/gift_card_activity_import_reversal.rb new file mode 100644 index 000000000..298e391d2 --- /dev/null +++ b/lib/square/types/gift_card_activity_import_reversal.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about an `IMPORT_REVERSAL` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityImportReversal < Internal::Types::Model + field :amount_money, Square::Types::Money, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_load.rb b/lib/square/types/gift_card_activity_load.rb new file mode 100644 index 000000000..00ec24e3a --- /dev/null +++ b/lib/square/types/gift_card_activity_load.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about a `LOAD` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityLoad < Internal::Types::Model + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + field :line_item_uid, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :buyer_payment_instrument_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_redeem.rb b/lib/square/types/gift_card_activity_redeem.rb new file mode 100644 index 000000000..94c93d585 --- /dev/null +++ b/lib/square/types/gift_card_activity_redeem.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about a `REDEEM` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityRedeem < Internal::Types::Model + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :payment_id, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :status, Square::Types::GiftCardActivityRedeemStatus, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_redeem_status.rb b/lib/square/types/gift_card_activity_redeem_status.rb new file mode 100644 index 000000000..9e046b33a --- /dev/null +++ b/lib/square/types/gift_card_activity_redeem_status.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module GiftCardActivityRedeemStatus + extend Square::Internal::Types::Enum + PENDING = "PENDING" + COMPLETED = "COMPLETED" + CANCELED = "CANCELED"end + end +end diff --git a/lib/square/types/gift_card_activity_refund.rb b/lib/square/types/gift_card_activity_refund.rb new file mode 100644 index 000000000..2b5f54303 --- /dev/null +++ b/lib/square/types/gift_card_activity_refund.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about a `REFUND` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityRefund < Internal::Types::Model + field :redeem_activity_id, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_transfer_balance_from.rb b/lib/square/types/gift_card_activity_transfer_balance_from.rb new file mode 100644 index 000000000..3e90ae118 --- /dev/null +++ b/lib/square/types/gift_card_activity_transfer_balance_from.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityTransferBalanceFrom < Internal::Types::Model + field :transfer_to_gift_card_id, String, optional: false, nullable: false + field :amount_money, Square::Types::Money, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_transfer_balance_to.rb b/lib/square/types/gift_card_activity_transfer_balance_to.rb new file mode 100644 index 000000000..48f3d493b --- /dev/null +++ b/lib/square/types/gift_card_activity_transfer_balance_to.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityTransferBalanceTo < Internal::Types::Model + field :transfer_from_gift_card_id, String, optional: false, nullable: false + field :amount_money, Square::Types::Money, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_type.rb b/lib/square/types/gift_card_activity_type.rb new file mode 100644 index 000000000..3e9e4d56f --- /dev/null +++ b/lib/square/types/gift_card_activity_type.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + module GiftCardActivityType + extend Square::Internal::Types::Enum + ACTIVATE = "ACTIVATE" + LOAD = "LOAD" + REDEEM = "REDEEM" + CLEAR_BALANCE = "CLEAR_BALANCE" + DEACTIVATE = "DEACTIVATE" + ADJUST_INCREMENT = "ADJUST_INCREMENT" + ADJUST_DECREMENT = "ADJUST_DECREMENT" + REFUND = "REFUND" + UNLINKED_ACTIVITY_REFUND = "UNLINKED_ACTIVITY_REFUND" + IMPORT = "IMPORT" + BLOCK = "BLOCK" + UNBLOCK = "UNBLOCK" + IMPORT_REVERSAL = "IMPORT_REVERSAL" + TRANSFER_BALANCE_FROM = "TRANSFER_BALANCE_FROM" + TRANSFER_BALANCE_TO = "TRANSFER_BALANCE_TO"end + end +end diff --git a/lib/square/types/gift_card_activity_unblock.rb b/lib/square/types/gift_card_activity_unblock.rb new file mode 100644 index 000000000..03e1c7cf9 --- /dev/null +++ b/lib/square/types/gift_card_activity_unblock.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about an `UNBLOCK` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityUnblock < Internal::Types::Model + field :reason, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_unlinked_activity_refund.rb b/lib/square/types/gift_card_activity_unlinked_activity_refund.rb new file mode 100644 index 000000000..4814cdf7c --- /dev/null +++ b/lib/square/types/gift_card_activity_unlinked_activity_refund.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](entity:GiftCardActivityType). + class GiftCardActivityUnlinkedActivityRefund < Internal::Types::Model + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :reference_id, String, optional: true, nullable: false + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_updated_event.rb b/lib/square/types/gift_card_activity_updated_event.rb new file mode 100644 index 000000000..b9b2fd77f --- /dev/null +++ b/lib/square/types/gift_card_activity_updated_event.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [gift card activity](entity:GiftCardActivity) is updated. + # Subscribe to this event to be notified about the following changes: + # - An update to the `REDEEM` activity for a gift card redemption made from a Square product (such as Square Point of Sale). + # These redemptions are initially assigned a `PENDING` state, but then change to a `COMPLETED` or `CANCELED` state. + # - An update to the `IMPORT` activity for an imported gift card when the balance is later adjusted by Square. + class GiftCardActivityUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::GiftCardActivityUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_updated_event_data.rb b/lib/square/types/gift_card_activity_updated_event_data.rb new file mode 100644 index 000000000..7953ce202 --- /dev/null +++ b/lib/square/types/gift_card_activity_updated_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `gift_card.activity.updated` event. + class GiftCardActivityUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::GiftCardActivityUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_activity_updated_event_object.rb b/lib/square/types/gift_card_activity_updated_event_object.rb new file mode 100644 index 000000000..eb7239d95 --- /dev/null +++ b/lib/square/types/gift_card_activity_updated_event_object.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the gift card activity associated with a + # `gift_card.activity.updated` event. + class GiftCardActivityUpdatedEventObject < Internal::Types::Model + field :gift_card_activity, Square::Types::GiftCardActivity, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_created_event.rb b/lib/square/types/gift_card_created_event.rb new file mode 100644 index 000000000..e0b23b49c --- /dev/null +++ b/lib/square/types/gift_card_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [gift card](entity:GiftCard) is created. + class GiftCardCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::GiftCardCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_created_event_data.rb b/lib/square/types/gift_card_created_event_data.rb new file mode 100644 index 000000000..ba0d40849 --- /dev/null +++ b/lib/square/types/gift_card_created_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `gift_card.created` event. + class GiftCardCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::GiftCardCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_created_event_object.rb b/lib/square/types/gift_card_created_event_object.rb new file mode 100644 index 000000000..62b44b610 --- /dev/null +++ b/lib/square/types/gift_card_created_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the gift card associated with a `gift_card.created` event. + class GiftCardCreatedEventObject < Internal::Types::Model + field :gift_card, Square::Types::GiftCard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_customer_linked_event.rb b/lib/square/types/gift_card_customer_linked_event.rb new file mode 100644 index 000000000..041e60431 --- /dev/null +++ b/lib/square/types/gift_card_customer_linked_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [customer](entity:Customer) is linked to a [gift card](entity:GiftCard). + class GiftCardCustomerLinkedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::GiftCardCustomerLinkedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_customer_linked_event_data.rb b/lib/square/types/gift_card_customer_linked_event_data.rb new file mode 100644 index 000000000..6154e7d61 --- /dev/null +++ b/lib/square/types/gift_card_customer_linked_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `gift_card.customer_linked` event. + class GiftCardCustomerLinkedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::GiftCardCustomerLinkedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_customer_linked_event_object.rb b/lib/square/types/gift_card_customer_linked_event_object.rb new file mode 100644 index 000000000..b21c253ac --- /dev/null +++ b/lib/square/types/gift_card_customer_linked_event_object.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the gift card and customer ID associated with a + # `gift_card.customer_linked` event. + class GiftCardCustomerLinkedEventObject < Internal::Types::Model + field :gift_card, Square::Types::GiftCard, optional: true, nullable: false + field :linked_customer_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_customer_unlinked_event.rb b/lib/square/types/gift_card_customer_unlinked_event.rb new file mode 100644 index 000000000..93d0f86a1 --- /dev/null +++ b/lib/square/types/gift_card_customer_unlinked_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [customer](entity:Customer) is unlinked from a [gift card](entity:GiftCard). + class GiftCardCustomerUnlinkedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::GiftCardCustomerUnlinkedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_customer_unlinked_event_data.rb b/lib/square/types/gift_card_customer_unlinked_event_data.rb new file mode 100644 index 000000000..2822a0d2f --- /dev/null +++ b/lib/square/types/gift_card_customer_unlinked_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `gift_card.customer_unlinked` event. + class GiftCardCustomerUnlinkedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::GiftCardCustomerUnlinkedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_customer_unlinked_event_object.rb b/lib/square/types/gift_card_customer_unlinked_event_object.rb new file mode 100644 index 000000000..d51ffdd54 --- /dev/null +++ b/lib/square/types/gift_card_customer_unlinked_event_object.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the gift card and the customer ID associated with a + # `gift_card.customer_linked` event. + class GiftCardCustomerUnlinkedEventObject < Internal::Types::Model + field :gift_card, Square::Types::GiftCard, optional: true, nullable: false + field :unlinked_customer_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_gan_source.rb b/lib/square/types/gift_card_gan_source.rb new file mode 100644 index 000000000..b9f8ffd9d --- /dev/null +++ b/lib/square/types/gift_card_gan_source.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module GiftCardGanSource + extend Square::Internal::Types::Enum + SQUARE = "SQUARE" + OTHER = "OTHER"end + end +end diff --git a/lib/square/types/gift_card_status.rb b/lib/square/types/gift_card_status.rb new file mode 100644 index 000000000..01f652a96 --- /dev/null +++ b/lib/square/types/gift_card_status.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module GiftCardStatus + extend Square::Internal::Types::Enum + ACTIVE = "ACTIVE" + DEACTIVATED = "DEACTIVATED" + BLOCKED = "BLOCKED" + PENDING = "PENDING"end + end +end diff --git a/lib/square/types/gift_card_type.rb b/lib/square/types/gift_card_type.rb new file mode 100644 index 000000000..0b5493837 --- /dev/null +++ b/lib/square/types/gift_card_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module GiftCardType + extend Square::Internal::Types::Enum + PHYSICAL = "PHYSICAL" + DIGITAL = "DIGITAL"end + end +end diff --git a/lib/square/types/gift_card_updated_event.rb b/lib/square/types/gift_card_updated_event.rb new file mode 100644 index 000000000..2672e3fc1 --- /dev/null +++ b/lib/square/types/gift_card_updated_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [gift card](entity:GiftCard) is updated. This includes + # changes to the state, balance, and customer association. + class GiftCardUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::GiftCardUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_updated_event_data.rb b/lib/square/types/gift_card_updated_event_data.rb new file mode 100644 index 000000000..4117221d3 --- /dev/null +++ b/lib/square/types/gift_card_updated_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `gift_card.updated` event. + class GiftCardUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::GiftCardUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/gift_card_updated_event_object.rb b/lib/square/types/gift_card_updated_event_object.rb new file mode 100644 index 000000000..7f901251b --- /dev/null +++ b/lib/square/types/gift_card_updated_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the gift card associated with a `gift_card.updated` event. + class GiftCardUpdatedEventObject < Internal::Types::Model + field :gift_card, Square::Types::GiftCard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/inventory_adjustment.rb b/lib/square/types/inventory_adjustment.rb new file mode 100644 index 000000000..e9dcef961 --- /dev/null +++ b/lib/square/types/inventory_adjustment.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a change in state or quantity of product inventory at a + # particular time and location. + class InventoryAdjustment < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :from_state, Square::Types::InventoryState, optional: true, nullable: false + field :to_state, Square::Types::InventoryState, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_object_type, String, optional: true, nullable: false + field :quantity, String, optional: true, nullable: false + field :total_price_money, Square::Types::Money, optional: true, nullable: false + field :occurred_at, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :source, Square::Types::SourceApplication, optional: true, nullable: false + field :employee_id, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :transaction_id, String, optional: true, nullable: false + field :refund_id, String, optional: true, nullable: false + field :purchase_order_id, String, optional: true, nullable: false + field :goods_receipt_id, String, optional: true, nullable: false + field :adjustment_group, Square::Types::InventoryAdjustmentGroup, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/inventory_adjustment_group.rb b/lib/square/types/inventory_adjustment_group.rb new file mode 100644 index 000000000..331ff764b --- /dev/null +++ b/lib/square/types/inventory_adjustment_group.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class InventoryAdjustmentGroup < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :root_adjustment_id, String, optional: true, nullable: false + field :from_state, Square::Types::InventoryState, optional: true, nullable: false + field :to_state, Square::Types::InventoryState, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/inventory_alert_type.rb b/lib/square/types/inventory_alert_type.rb new file mode 100644 index 000000000..368d3adb4 --- /dev/null +++ b/lib/square/types/inventory_alert_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module InventoryAlertType + extend Square::Internal::Types::Enum + NONE = "NONE" + LOW_QUANTITY = "LOW_QUANTITY"end + end +end diff --git a/lib/square/types/inventory_change.rb b/lib/square/types/inventory_change.rb new file mode 100644 index 000000000..79695697a --- /dev/null +++ b/lib/square/types/inventory_change.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a single physical count, inventory, adjustment, or transfer + # that is part of the history of inventory changes for a particular + # [CatalogObject](entity:CatalogObject) instance. + class InventoryChange < Internal::Types::Model + field :type, Square::Types::InventoryChangeType, optional: true, nullable: false + field :physical_count, Square::Types::InventoryPhysicalCount, optional: true, nullable: false + field :adjustment, Square::Types::InventoryAdjustment, optional: true, nullable: false + field :transfer, Square::Types::InventoryTransfer, optional: true, nullable: false + field :measurement_unit, Square::Types::CatalogMeasurementUnit, optional: true, nullable: false + field :measurement_unit_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/inventory_change_type.rb b/lib/square/types/inventory_change_type.rb new file mode 100644 index 000000000..283d7e008 --- /dev/null +++ b/lib/square/types/inventory_change_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module InventoryChangeType + extend Square::Internal::Types::Enum + PHYSICAL_COUNT = "PHYSICAL_COUNT" + ADJUSTMENT = "ADJUSTMENT" + TRANSFER = "TRANSFER"end + end +end diff --git a/lib/square/types/inventory_count.rb b/lib/square/types/inventory_count.rb new file mode 100644 index 000000000..a69b78797 --- /dev/null +++ b/lib/square/types/inventory_count.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class InventoryCount < Internal::Types::Model + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_object_type, String, optional: true, nullable: false + field :state, Square::Types::InventoryState, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :quantity, String, optional: true, nullable: false + field :calculated_at, String, optional: true, nullable: false + field :is_estimated, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/inventory_count_updated_event.rb b/lib/square/types/inventory_count_updated_event.rb new file mode 100644 index 000000000..7dbbe90e1 --- /dev/null +++ b/lib/square/types/inventory_count_updated_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when the quantity is updated for a + # [CatalogItemVariation](entity:CatalogItemVariation). + class InventoryCountUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::InventoryCountUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/inventory_count_updated_event_data.rb b/lib/square/types/inventory_count_updated_event_data.rb new file mode 100644 index 000000000..2e2bfd7bf --- /dev/null +++ b/lib/square/types/inventory_count_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class InventoryCountUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::InventoryCountUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/inventory_count_updated_event_object.rb b/lib/square/types/inventory_count_updated_event_object.rb new file mode 100644 index 000000000..b46011fd0 --- /dev/null +++ b/lib/square/types/inventory_count_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class InventoryCountUpdatedEventObject < Internal::Types::Model + field :inventory_counts, Internal::Types::Array[Square::Types::InventoryCount], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/inventory_physical_count.rb b/lib/square/types/inventory_physical_count.rb new file mode 100644 index 000000000..8ed5f2dd7 --- /dev/null +++ b/lib/square/types/inventory_physical_count.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class InventoryPhysicalCount < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_object_type, String, optional: true, nullable: false + field :state, Square::Types::InventoryState, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :quantity, String, optional: true, nullable: false + field :source, Square::Types::SourceApplication, optional: true, nullable: false + field :employee_id, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :occurred_at, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/inventory_state.rb b/lib/square/types/inventory_state.rb new file mode 100644 index 000000000..ed405b812 --- /dev/null +++ b/lib/square/types/inventory_state.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Square + module Types + module InventoryState + extend Square::Internal::Types::Enum + CUSTOM = "CUSTOM" + IN_STOCK = "IN_STOCK" + SOLD = "SOLD" + RETURNED_BY_CUSTOMER = "RETURNED_BY_CUSTOMER" + RESERVED_FOR_SALE = "RESERVED_FOR_SALE" + SOLD_ONLINE = "SOLD_ONLINE" + ORDERED_FROM_VENDOR = "ORDERED_FROM_VENDOR" + RECEIVED_FROM_VENDOR = "RECEIVED_FROM_VENDOR" + IN_TRANSIT_TO = "IN_TRANSIT_TO" + NONE = "NONE" + WASTE = "WASTE" + UNLINKED_RETURN = "UNLINKED_RETURN" + COMPOSED = "COMPOSED" + DECOMPOSED = "DECOMPOSED" + SUPPORTED_BY_NEWER_VERSION = "SUPPORTED_BY_NEWER_VERSION" + IN_TRANSIT = "IN_TRANSIT"end + end +end diff --git a/lib/square/types/inventory_transfer.rb b/lib/square/types/inventory_transfer.rb new file mode 100644 index 000000000..ec88df8b9 --- /dev/null +++ b/lib/square/types/inventory_transfer.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the transfer of a quantity of product inventory at a + # particular time from one location to another. + class InventoryTransfer < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :state, Square::Types::InventoryState, optional: true, nullable: false + field :from_location_id, String, optional: true, nullable: false + field :to_location_id, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_object_type, String, optional: true, nullable: false + field :quantity, String, optional: true, nullable: false + field :occurred_at, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :source, Square::Types::SourceApplication, optional: true, nullable: false + field :employee_id, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice.rb b/lib/square/types/invoice.rb new file mode 100644 index 000000000..737149a6e --- /dev/null +++ b/lib/square/types/invoice.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class Invoice < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + field :primary_recipient, Square::Types::InvoiceRecipient, optional: true, nullable: false + field :payment_requests, Internal::Types::Array[Square::Types::InvoicePaymentRequest], optional: true, nullable: false + field :delivery_method, Square::Types::InvoiceDeliveryMethod, optional: true, nullable: false + field :invoice_number, String, optional: true, nullable: false + field :title, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :scheduled_at, String, optional: true, nullable: false + field :public_url, String, optional: true, nullable: false + field :next_payment_amount_money, Square::Types::Money, optional: true, nullable: false + field :status, Square::Types::InvoiceStatus, optional: true, nullable: false + field :timezone, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :accepted_payment_methods, Square::Types::InvoiceAcceptedPaymentMethods, optional: true, nullable: false + field :custom_fields, Internal::Types::Array[Square::Types::InvoiceCustomField], optional: true, nullable: false + field :subscription_id, String, optional: true, nullable: false + field :sale_or_service_date, String, optional: true, nullable: false + field :payment_conditions, String, optional: true, nullable: false + field :store_payment_method_enabled, Internal::Types::Boolean, optional: true, nullable: false + field :attachments, Internal::Types::Array[Square::Types::InvoiceAttachment], optional: true, nullable: false + field :creator_team_member_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_accepted_payment_methods.rb b/lib/square/types/invoice_accepted_payment_methods.rb new file mode 100644 index 000000000..22b724b4b --- /dev/null +++ b/lib/square/types/invoice_accepted_payment_methods.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # The payment methods that customers can use to pay an [invoice](entity:Invoice) on the Square-hosted invoice payment page. + class InvoiceAcceptedPaymentMethods < Internal::Types::Model + field :card, Internal::Types::Boolean, optional: true, nullable: false + field :square_gift_card, Internal::Types::Boolean, optional: true, nullable: false + field :bank_account, Internal::Types::Boolean, optional: true, nullable: false + field :buy_now_pay_later, Internal::Types::Boolean, optional: true, nullable: false + field :cash_app_pay, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_attachment.rb b/lib/square/types/invoice_attachment.rb new file mode 100644 index 000000000..e9f295344 --- /dev/null +++ b/lib/square/types/invoice_attachment.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a file attached to an [invoice](entity:Invoice). + class InvoiceAttachment < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :filename, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :filesize, Integer, optional: true, nullable: false + field :hash, String, optional: true, nullable: false + field :mime_type, String, optional: true, nullable: false + field :uploaded_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_automatic_payment_source.rb b/lib/square/types/invoice_automatic_payment_source.rb new file mode 100644 index 000000000..ff6506edb --- /dev/null +++ b/lib/square/types/invoice_automatic_payment_source.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module InvoiceAutomaticPaymentSource + extend Square::Internal::Types::Enum + NONE = "NONE" + CARD_ON_FILE = "CARD_ON_FILE" + BANK_ON_FILE = "BANK_ON_FILE"end + end +end diff --git a/lib/square/types/invoice_canceled_event.rb b/lib/square/types/invoice_canceled_event.rb new file mode 100644 index 000000000..4025923dd --- /dev/null +++ b/lib/square/types/invoice_canceled_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an [Invoice](entity:Invoice) is canceled. + class InvoiceCanceledEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::InvoiceCanceledEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_canceled_event_data.rb b/lib/square/types/invoice_canceled_event_data.rb new file mode 100644 index 000000000..9b76b0b36 --- /dev/null +++ b/lib/square/types/invoice_canceled_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceCanceledEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::InvoiceCanceledEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_canceled_event_object.rb b/lib/square/types/invoice_canceled_event_object.rb new file mode 100644 index 000000000..f04b8b5ad --- /dev/null +++ b/lib/square/types/invoice_canceled_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceCanceledEventObject < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_created_event.rb b/lib/square/types/invoice_created_event.rb new file mode 100644 index 000000000..bac3cf6bd --- /dev/null +++ b/lib/square/types/invoice_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an [Invoice](entity:Invoice) is created. + class InvoiceCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::InvoiceCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_created_event_data.rb b/lib/square/types/invoice_created_event_data.rb new file mode 100644 index 000000000..2bcaf1174 --- /dev/null +++ b/lib/square/types/invoice_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::InvoiceCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_created_event_object.rb b/lib/square/types/invoice_created_event_object.rb new file mode 100644 index 000000000..b0d7b2fa1 --- /dev/null +++ b/lib/square/types/invoice_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceCreatedEventObject < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_custom_field.rb b/lib/square/types/invoice_custom_field.rb new file mode 100644 index 000000000..035a4fbc3 --- /dev/null +++ b/lib/square/types/invoice_custom_field.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class InvoiceCustomField < Internal::Types::Model + field :label, String, optional: true, nullable: false + field :value, String, optional: true, nullable: false + field :placement, Square::Types::InvoiceCustomFieldPlacement, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_custom_field_placement.rb b/lib/square/types/invoice_custom_field_placement.rb new file mode 100644 index 000000000..f6e2998bd --- /dev/null +++ b/lib/square/types/invoice_custom_field_placement.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module InvoiceCustomFieldPlacement + extend Square::Internal::Types::Enum + ABOVE_LINE_ITEMS = "ABOVE_LINE_ITEMS" + BELOW_LINE_ITEMS = "BELOW_LINE_ITEMS"end + end +end diff --git a/lib/square/types/invoice_deleted_event.rb b/lib/square/types/invoice_deleted_event.rb new file mode 100644 index 000000000..c3061beb7 --- /dev/null +++ b/lib/square/types/invoice_deleted_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a draft [Invoice](entity:Invoice) is deleted. + class InvoiceDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::InvoiceDeletedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_deleted_event_data.rb b/lib/square/types/invoice_deleted_event_data.rb new file mode 100644 index 000000000..2b6b35218 --- /dev/null +++ b/lib/square/types/invoice_deleted_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceDeletedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :deleted, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_delivery_method.rb b/lib/square/types/invoice_delivery_method.rb new file mode 100644 index 000000000..cf7a9a67b --- /dev/null +++ b/lib/square/types/invoice_delivery_method.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module InvoiceDeliveryMethod + extend Square::Internal::Types::Enum + EMAIL = "EMAIL" + SHARE_MANUALLY = "SHARE_MANUALLY" + SMS = "SMS"end + end +end diff --git a/lib/square/types/invoice_filter.rb b/lib/square/types/invoice_filter.rb new file mode 100644 index 000000000..1ec0b25d3 --- /dev/null +++ b/lib/square/types/invoice_filter.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes query filters to apply. + class InvoiceFilter < Internal::Types::Model + field :location_ids, Internal::Types::Array[String], optional: false, nullable: false + field :customer_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_payment_made_event.rb b/lib/square/types/invoice_payment_made_event.rb new file mode 100644 index 000000000..a739d4b73 --- /dev/null +++ b/lib/square/types/invoice_payment_made_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a payment that is associated with an [invoice](entity:Invoice) is completed. + # For more information about invoice payments, see [Pay an invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#pay-invoice). + class InvoicePaymentMadeEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::InvoicePaymentMadeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_payment_made_event_data.rb b/lib/square/types/invoice_payment_made_event_data.rb new file mode 100644 index 000000000..6c177aacf --- /dev/null +++ b/lib/square/types/invoice_payment_made_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoicePaymentMadeEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::InvoicePaymentMadeEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_payment_made_event_object.rb b/lib/square/types/invoice_payment_made_event_object.rb new file mode 100644 index 000000000..c9d1ea11d --- /dev/null +++ b/lib/square/types/invoice_payment_made_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoicePaymentMadeEventObject < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_payment_reminder.rb b/lib/square/types/invoice_payment_reminder.rb new file mode 100644 index 000000000..83a5c9720 --- /dev/null +++ b/lib/square/types/invoice_payment_reminder.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes a payment request reminder (automatic notification) that Square sends + # to the customer. You configure a reminder relative to the payment request + # `due_date`. + class InvoicePaymentReminder < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :relative_scheduled_days, Integer, optional: true, nullable: false + field :message, String, optional: true, nullable: false + field :status, Square::Types::InvoicePaymentReminderStatus, optional: true, nullable: false + field :sent_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_payment_reminder_status.rb b/lib/square/types/invoice_payment_reminder_status.rb new file mode 100644 index 000000000..b8d5e5e66 --- /dev/null +++ b/lib/square/types/invoice_payment_reminder_status.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module InvoicePaymentReminderStatus + extend Square::Internal::Types::Enum + PENDING = "PENDING" + NOT_APPLICABLE = "NOT_APPLICABLE" + SENT = "SENT"end + end +end diff --git a/lib/square/types/invoice_payment_request.rb b/lib/square/types/invoice_payment_request.rb new file mode 100644 index 000000000..75cc42068 --- /dev/null +++ b/lib/square/types/invoice_payment_request.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a payment request for an [invoice](entity:Invoice). Invoices can specify a maximum + # of 13 payment requests, with up to 12 `INSTALLMENT` request types. For more information, + # see [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). + # + # Adding `INSTALLMENT` payment requests to an invoice requires an + # [Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). + class InvoicePaymentRequest < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :request_method, Square::Types::InvoiceRequestMethod, optional: true, nullable: false + field :request_type, Square::Types::InvoiceRequestType, optional: true, nullable: false + field :due_date, String, optional: true, nullable: false + field :fixed_amount_requested_money, Square::Types::Money, optional: true, nullable: false + field :percentage_requested, String, optional: true, nullable: false + field :tipping_enabled, Internal::Types::Boolean, optional: true, nullable: false + field :automatic_payment_source, Square::Types::InvoiceAutomaticPaymentSource, optional: true, nullable: false + field :card_id, String, optional: true, nullable: false + field :reminders, Internal::Types::Array[Square::Types::InvoicePaymentReminder], optional: true, nullable: false + field :computed_amount_money, Square::Types::Money, optional: true, nullable: false + field :total_completed_amount_money, Square::Types::Money, optional: true, nullable: false + field :rounding_adjustment_included_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_published_event.rb b/lib/square/types/invoice_published_event.rb new file mode 100644 index 000000000..eb4448eea --- /dev/null +++ b/lib/square/types/invoice_published_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an [Invoice](entity:Invoice) transitions from a draft to a non-draft status. + class InvoicePublishedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::InvoicePublishedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_published_event_data.rb b/lib/square/types/invoice_published_event_data.rb new file mode 100644 index 000000000..eee593444 --- /dev/null +++ b/lib/square/types/invoice_published_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoicePublishedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::InvoicePublishedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_published_event_object.rb b/lib/square/types/invoice_published_event_object.rb new file mode 100644 index 000000000..6b3df319c --- /dev/null +++ b/lib/square/types/invoice_published_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoicePublishedEventObject < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_query.rb b/lib/square/types/invoice_query.rb new file mode 100644 index 000000000..8dcc92f66 --- /dev/null +++ b/lib/square/types/invoice_query.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes query criteria for searching invoices. + class InvoiceQuery < Internal::Types::Model + field :filter, Square::Types::InvoiceFilter, optional: false, nullable: false + field :sort, Square::Types::InvoiceSort, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_recipient.rb b/lib/square/types/invoice_recipient.rb new file mode 100644 index 000000000..9d7ce2d0f --- /dev/null +++ b/lib/square/types/invoice_recipient.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class InvoiceRecipient < Internal::Types::Model + field :customer_id, String, optional: true, nullable: false + field :given_name, String, optional: true, nullable: false + field :family_name, String, optional: true, nullable: false + field :email_address, String, optional: true, nullable: false + field :address, Square::Types::Address, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :company_name, String, optional: true, nullable: false + field :tax_ids, Square::Types::InvoiceRecipientTaxIds, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_recipient_tax_ids.rb b/lib/square/types/invoice_recipient_tax_ids.rb new file mode 100644 index 000000000..bab1e7eb7 --- /dev/null +++ b/lib/square/types/invoice_recipient_tax_ids.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class InvoiceRecipientTaxIds < Internal::Types::Model + field :eu_vat, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_refunded_event.rb b/lib/square/types/invoice_refunded_event.rb new file mode 100644 index 000000000..2272930f2 --- /dev/null +++ b/lib/square/types/invoice_refunded_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a refund is applied toward a payment of an [invoice](entity:Invoice). + # For more information about invoice refunds, see [Refund an invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#refund-invoice). + class InvoiceRefundedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::InvoiceRefundedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_refunded_event_data.rb b/lib/square/types/invoice_refunded_event_data.rb new file mode 100644 index 000000000..c6937bc61 --- /dev/null +++ b/lib/square/types/invoice_refunded_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceRefundedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::InvoiceRefundedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_refunded_event_object.rb b/lib/square/types/invoice_refunded_event_object.rb new file mode 100644 index 000000000..c43e3a9ca --- /dev/null +++ b/lib/square/types/invoice_refunded_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceRefundedEventObject < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_request_method.rb b/lib/square/types/invoice_request_method.rb new file mode 100644 index 000000000..0d7dbdd3d --- /dev/null +++ b/lib/square/types/invoice_request_method.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + module InvoiceRequestMethod + extend Square::Internal::Types::Enum + EMAIL = "EMAIL" + CHARGE_CARD_ON_FILE = "CHARGE_CARD_ON_FILE" + SHARE_MANUALLY = "SHARE_MANUALLY" + CHARGE_BANK_ON_FILE = "CHARGE_BANK_ON_FILE" + SMS = "SMS" + SMS_CHARGE_CARD_ON_FILE = "SMS_CHARGE_CARD_ON_FILE" + SMS_CHARGE_BANK_ON_FILE = "SMS_CHARGE_BANK_ON_FILE"end + end +end diff --git a/lib/square/types/invoice_request_type.rb b/lib/square/types/invoice_request_type.rb new file mode 100644 index 000000000..a6956fdcf --- /dev/null +++ b/lib/square/types/invoice_request_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module InvoiceRequestType + extend Square::Internal::Types::Enum + BALANCE = "BALANCE" + DEPOSIT = "DEPOSIT" + INSTALLMENT = "INSTALLMENT"end + end +end diff --git a/lib/square/types/invoice_scheduled_charge_failed_event.rb b/lib/square/types/invoice_scheduled_charge_failed_event.rb new file mode 100644 index 000000000..0cbd2cb3b --- /dev/null +++ b/lib/square/types/invoice_scheduled_charge_failed_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an automatic scheduled payment for an [Invoice](entity:Invoice) has failed. + class InvoiceScheduledChargeFailedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::InvoiceScheduledChargeFailedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_scheduled_charge_failed_event_data.rb b/lib/square/types/invoice_scheduled_charge_failed_event_data.rb new file mode 100644 index 000000000..36a1961df --- /dev/null +++ b/lib/square/types/invoice_scheduled_charge_failed_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceScheduledChargeFailedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::InvoiceScheduledChargeFailedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_scheduled_charge_failed_event_object.rb b/lib/square/types/invoice_scheduled_charge_failed_event_object.rb new file mode 100644 index 000000000..470a409d1 --- /dev/null +++ b/lib/square/types/invoice_scheduled_charge_failed_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceScheduledChargeFailedEventObject < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_sort.rb b/lib/square/types/invoice_sort.rb new file mode 100644 index 000000000..84d9f2d99 --- /dev/null +++ b/lib/square/types/invoice_sort.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Identifies the sort field and sort order. + class InvoiceSort < Internal::Types::Model + field :field, String, optional: false, nullable: false + field :order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_status.rb b/lib/square/types/invoice_status.rb new file mode 100644 index 000000000..bec70adaa --- /dev/null +++ b/lib/square/types/invoice_status.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + module InvoiceStatus + extend Square::Internal::Types::Enum + DRAFT = "DRAFT" + UNPAID = "UNPAID" + SCHEDULED = "SCHEDULED" + PARTIALLY_PAID = "PARTIALLY_PAID" + PAID = "PAID" + PARTIALLY_REFUNDED = "PARTIALLY_REFUNDED" + REFUNDED = "REFUNDED" + CANCELED = "CANCELED" + FAILED = "FAILED" + PAYMENT_PENDING = "PAYMENT_PENDING"end + end +end diff --git a/lib/square/types/invoice_updated_event.rb b/lib/square/types/invoice_updated_event.rb new file mode 100644 index 000000000..e030a219f --- /dev/null +++ b/lib/square/types/invoice_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an [Invoice](entity:Invoice) is updated. + class InvoiceUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::InvoiceUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_updated_event_data.rb b/lib/square/types/invoice_updated_event_data.rb new file mode 100644 index 000000000..5b2ce685c --- /dev/null +++ b/lib/square/types/invoice_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::InvoiceUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/invoice_updated_event_object.rb b/lib/square/types/invoice_updated_event_object.rb new file mode 100644 index 000000000..1c32165fe --- /dev/null +++ b/lib/square/types/invoice_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class InvoiceUpdatedEventObject < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/item_variation_location_overrides.rb b/lib/square/types/item_variation_location_overrides.rb new file mode 100644 index 000000000..715e00c68 --- /dev/null +++ b/lib/square/types/item_variation_location_overrides.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`. + class ItemVariationLocationOverrides < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + field :price_money, Square::Types::Money, optional: true, nullable: false + field :pricing_type, Square::Types::CatalogPricingType, optional: true, nullable: false + field :track_inventory, Internal::Types::Boolean, optional: true, nullable: false + field :inventory_alert_type, Square::Types::InventoryAlertType, optional: true, nullable: false + field :inventory_alert_threshold, Integer, optional: true, nullable: false + field :sold_out, Internal::Types::Boolean, optional: true, nullable: false + field :sold_out_valid_until, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/job.rb b/lib/square/types/job.rb new file mode 100644 index 000000000..450cfd967 --- /dev/null +++ b/lib/square/types/job.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a job that can be assigned to [team members](entity:TeamMember). This object defines the + # job's title and tip eligibility. Compensation is defined in a [job assignment](entity:JobAssignment) + # in a team member's wage setting. + class Job < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :title, String, optional: true, nullable: false + field :is_tip_eligible, Internal::Types::Boolean, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/job_assignment.rb b/lib/square/types/job_assignment.rb new file mode 100644 index 000000000..d79404c0e --- /dev/null +++ b/lib/square/types/job_assignment.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a job assigned to a [team member](entity:TeamMember), including the compensation the team + # member earns for the job. Job assignments are listed in the team member's [wage setting](entity:WageSetting). + class JobAssignment < Internal::Types::Model + field :job_title, String, optional: true, nullable: false + field :pay_type, Square::Types::JobAssignmentPayType, optional: false, nullable: false + field :hourly_rate, Square::Types::Money, optional: true, nullable: false + field :annual_rate, Square::Types::Money, optional: true, nullable: false + field :weekly_hours, Integer, optional: true, nullable: false + field :job_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/job_assignment_pay_type.rb b/lib/square/types/job_assignment_pay_type.rb new file mode 100644 index 000000000..ad1577e84 --- /dev/null +++ b/lib/square/types/job_assignment_pay_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module JobAssignmentPayType + extend Square::Internal::Types::Enum + NONE = "NONE" + HOURLY = "HOURLY" + SALARY = "SALARY"end + end +end diff --git a/lib/square/types/job_created_event.rb b/lib/square/types/job_created_event.rb new file mode 100644 index 000000000..90fe002e7 --- /dev/null +++ b/lib/square/types/job_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a Job is created. + class JobCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::JobCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/job_created_event_data.rb b/lib/square/types/job_created_event_data.rb new file mode 100644 index 000000000..574dc2ac5 --- /dev/null +++ b/lib/square/types/job_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class JobCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::JobCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/job_created_event_object.rb b/lib/square/types/job_created_event_object.rb new file mode 100644 index 000000000..cc9f24c6e --- /dev/null +++ b/lib/square/types/job_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class JobCreatedEventObject < Internal::Types::Model + field :job, Square::Types::Job, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/job_updated_event.rb b/lib/square/types/job_updated_event.rb new file mode 100644 index 000000000..b6a3c4378 --- /dev/null +++ b/lib/square/types/job_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a Job is updated. + class JobUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::JobUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/job_updated_event_data.rb b/lib/square/types/job_updated_event_data.rb new file mode 100644 index 000000000..efe1845a1 --- /dev/null +++ b/lib/square/types/job_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class JobUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::JobUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/job_updated_event_object.rb b/lib/square/types/job_updated_event_object.rb new file mode 100644 index 000000000..12c1ce23b --- /dev/null +++ b/lib/square/types/job_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class JobUpdatedEventObject < Internal::Types::Model + field :job, Square::Types::Job, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_created_event.rb b/lib/square/types/labor_scheduled_shift_created_event.rb new file mode 100644 index 000000000..9f6002215 --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_created_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [ScheduledShift](entity:ScheduledShift) is created. + class LaborScheduledShiftCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LaborScheduledShiftCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_created_event_data.rb b/lib/square/types/labor_scheduled_shift_created_event_data.rb new file mode 100644 index 000000000..d79ce5865 --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborScheduledShiftCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LaborScheduledShiftCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_created_event_object.rb b/lib/square/types/labor_scheduled_shift_created_event_object.rb new file mode 100644 index 000000000..8ec3d5531 --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborScheduledShiftCreatedEventObject < Internal::Types::Model + field :scheduled_shift, Square::Types::ScheduledShift, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_deleted_event.rb b/lib/square/types/labor_scheduled_shift_deleted_event.rb new file mode 100644 index 000000000..099293f63 --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_deleted_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [ScheduledShift](entity:ScheduledShift) is deleted. + class LaborScheduledShiftDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LaborScheduledShiftDeletedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_deleted_event_data.rb b/lib/square/types/labor_scheduled_shift_deleted_event_data.rb new file mode 100644 index 000000000..864a4e6d7 --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_deleted_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborScheduledShiftDeletedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :deleted, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_published_event.rb b/lib/square/types/labor_scheduled_shift_published_event.rb new file mode 100644 index 000000000..95260e18c --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_published_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [ScheduledShift](entity:ScheduledShift) is published. + class LaborScheduledShiftPublishedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LaborScheduledShiftPublishedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_published_event_data.rb b/lib/square/types/labor_scheduled_shift_published_event_data.rb new file mode 100644 index 000000000..db05aef88 --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_published_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborScheduledShiftPublishedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LaborScheduledShiftPublishedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_published_event_object.rb b/lib/square/types/labor_scheduled_shift_published_event_object.rb new file mode 100644 index 000000000..8f008d716 --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_published_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborScheduledShiftPublishedEventObject < Internal::Types::Model + field :scheduled_shift, Square::Types::ScheduledShift, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_updated_event.rb b/lib/square/types/labor_scheduled_shift_updated_event.rb new file mode 100644 index 000000000..c3c549377 --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_updated_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [ScheduledShift](entity:ScheduledShift) is updated. + class LaborScheduledShiftUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LaborScheduledShiftUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_updated_event_data.rb b/lib/square/types/labor_scheduled_shift_updated_event_data.rb new file mode 100644 index 000000000..a34064f1f --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborScheduledShiftUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LaborScheduledShiftUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_scheduled_shift_updated_event_object.rb b/lib/square/types/labor_scheduled_shift_updated_event_object.rb new file mode 100644 index 000000000..002df54b0 --- /dev/null +++ b/lib/square/types/labor_scheduled_shift_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborScheduledShiftUpdatedEventObject < Internal::Types::Model + field :scheduled_shift, Square::Types::ScheduledShift, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_shift_created_event.rb b/lib/square/types/labor_shift_created_event.rb new file mode 100644 index 000000000..0a21a36a3 --- /dev/null +++ b/lib/square/types/labor_shift_created_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a worker starts a [Shift](entity:Shift). + # + # Deprecated at Square API version 2025-05-21. Replaced by `labor.timecard.created`. + class LaborShiftCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LaborShiftCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_shift_created_event_data.rb b/lib/square/types/labor_shift_created_event_data.rb new file mode 100644 index 000000000..74244baed --- /dev/null +++ b/lib/square/types/labor_shift_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborShiftCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LaborShiftCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_shift_created_event_object.rb b/lib/square/types/labor_shift_created_event_object.rb new file mode 100644 index 000000000..c3bf0d27a --- /dev/null +++ b/lib/square/types/labor_shift_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborShiftCreatedEventObject < Internal::Types::Model + field :shift, Square::Types::Shift, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_shift_deleted_event.rb b/lib/square/types/labor_shift_deleted_event.rb new file mode 100644 index 000000000..5fbdf4f62 --- /dev/null +++ b/lib/square/types/labor_shift_deleted_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Shift](entity:Shift) is deleted. + # + # Deprecated at Square API version 2025-05-21. Replaced by `labor.timecard.deleted`. + class LaborShiftDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LaborShiftDeletedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_shift_deleted_event_data.rb b/lib/square/types/labor_shift_deleted_event_data.rb new file mode 100644 index 000000000..caf0b6376 --- /dev/null +++ b/lib/square/types/labor_shift_deleted_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborShiftDeletedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :deleted, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_shift_updated_event.rb b/lib/square/types/labor_shift_updated_event.rb new file mode 100644 index 000000000..2c6c2e289 --- /dev/null +++ b/lib/square/types/labor_shift_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Shift](entity:Shift) is updated. + # + # Deprecated at Square API version 2025-05-21. Replaced by `labor.timecard.updated`. + class LaborShiftUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LaborShiftUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_shift_updated_event_data.rb b/lib/square/types/labor_shift_updated_event_data.rb new file mode 100644 index 000000000..96ead0e7b --- /dev/null +++ b/lib/square/types/labor_shift_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborShiftUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LaborShiftUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_shift_updated_event_object.rb b/lib/square/types/labor_shift_updated_event_object.rb new file mode 100644 index 000000000..3243fa697 --- /dev/null +++ b/lib/square/types/labor_shift_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborShiftUpdatedEventObject < Internal::Types::Model + field :shift, Square::Types::Shift, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_timecard_created_event.rb b/lib/square/types/labor_timecard_created_event.rb new file mode 100644 index 000000000..7cde66d5f --- /dev/null +++ b/lib/square/types/labor_timecard_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a worker starts a [Timecard](entity:Timecard). + class LaborTimecardCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LaborTimecardCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_timecard_created_event_data.rb b/lib/square/types/labor_timecard_created_event_data.rb new file mode 100644 index 000000000..c41e31e34 --- /dev/null +++ b/lib/square/types/labor_timecard_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborTimecardCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LaborTimecardCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_timecard_created_event_object.rb b/lib/square/types/labor_timecard_created_event_object.rb new file mode 100644 index 000000000..b4d7d1f79 --- /dev/null +++ b/lib/square/types/labor_timecard_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborTimecardCreatedEventObject < Internal::Types::Model + field :timecard, Square::Types::Timecard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_timecard_deleted_event.rb b/lib/square/types/labor_timecard_deleted_event.rb new file mode 100644 index 000000000..090431c21 --- /dev/null +++ b/lib/square/types/labor_timecard_deleted_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Timecard](entity:Timecard) is deleted. + class LaborTimecardDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LaborTimecardDeletedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_timecard_deleted_event_data.rb b/lib/square/types/labor_timecard_deleted_event_data.rb new file mode 100644 index 000000000..edd295b8a --- /dev/null +++ b/lib/square/types/labor_timecard_deleted_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborTimecardDeletedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :deleted, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_timecard_updated_event.rb b/lib/square/types/labor_timecard_updated_event.rb new file mode 100644 index 000000000..46ad7d4d1 --- /dev/null +++ b/lib/square/types/labor_timecard_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Timecard](entity:Timecard) is updated. + class LaborTimecardUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LaborTimecardUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_timecard_updated_event_data.rb b/lib/square/types/labor_timecard_updated_event_data.rb new file mode 100644 index 000000000..d5be2f334 --- /dev/null +++ b/lib/square/types/labor_timecard_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborTimecardUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LaborTimecardUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/labor_timecard_updated_event_object.rb b/lib/square/types/labor_timecard_updated_event_object.rb new file mode 100644 index 000000000..218341786 --- /dev/null +++ b/lib/square/types/labor_timecard_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LaborTimecardUpdatedEventObject < Internal::Types::Model + field :timecard, Square::Types::Timecard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/link_customer_to_gift_card_response.rb b/lib/square/types/link_customer_to_gift_card_response.rb new file mode 100644 index 000000000..f82877697 --- /dev/null +++ b/lib/square/types/link_customer_to_gift_card_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains the linked `GiftCard` object. If the request resulted in errors, + # the response contains a set of `Error` objects. + class LinkCustomerToGiftCardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :gift_card, Square::Types::GiftCard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_bank_accounts_response.rb b/lib/square/types/list_bank_accounts_response.rb new file mode 100644 index 000000000..2c91a8f50 --- /dev/null +++ b/lib/square/types/list_bank_accounts_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Response object returned by ListBankAccounts. + class ListBankAccountsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :bank_accounts, Internal::Types::Array[Square::Types::BankAccount], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_booking_custom_attribute_definitions_response.rb b/lib/square/types/list_booking_custom_attribute_definitions_response.rb new file mode 100644 index 000000000..0cc1d8b3b --- /dev/null +++ b/lib/square/types/list_booking_custom_attribute_definitions_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [ListBookingCustomAttributeDefinitions](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributeDefinitions) response. + # Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response. + # If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. + class ListBookingCustomAttributeDefinitionsResponse < Internal::Types::Model + field :custom_attribute_definitions, Internal::Types::Array[Square::Types::CustomAttributeDefinition], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_booking_custom_attributes_response.rb b/lib/square/types/list_booking_custom_attributes_response.rb new file mode 100644 index 000000000..19c43f0be --- /dev/null +++ b/lib/square/types/list_booking_custom_attributes_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [ListBookingCustomAttributes](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributes) response. + # Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional + # results are available, the `cursor` field is also present along with `custom_attributes`. + class ListBookingCustomAttributesResponse < Internal::Types::Model + field :custom_attributes, Internal::Types::Array[Square::Types::CustomAttribute], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_bookings_response.rb b/lib/square/types/list_bookings_response.rb new file mode 100644 index 000000000..43d2bc456 --- /dev/null +++ b/lib/square/types/list_bookings_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class ListBookingsResponse < Internal::Types::Model + field :bookings, Internal::Types::Array[Square::Types::Booking], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_break_types_response.rb b/lib/square/types/list_break_types_response.rb new file mode 100644 index 000000000..3cee61743 --- /dev/null +++ b/lib/square/types/list_break_types_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class ListBreakTypesResponse < Internal::Types::Model + field :break_types, Internal::Types::Array[Square::Types::BreakType], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_cards_response.rb b/lib/square/types/list_cards_response.rb new file mode 100644 index 000000000..eca56d390 --- /dev/null +++ b/lib/square/types/list_cards_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [ListCards](api-endpoint:Cards-ListCards) endpoint. + # + # Note: if there are errors processing the request, the card field will not be + # present. + class ListCardsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :cards, Internal::Types::Array[Square::Types::Card], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_cash_drawer_shift_events_response.rb b/lib/square/types/list_cash_drawer_shift_events_response.rb new file mode 100644 index 000000000..aa5bbdf32 --- /dev/null +++ b/lib/square/types/list_cash_drawer_shift_events_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class ListCashDrawerShiftEventsResponse < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :cash_drawer_shift_events, Internal::Types::Array[Square::Types::CashDrawerShiftEvent], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_cash_drawer_shifts_response.rb b/lib/square/types/list_cash_drawer_shifts_response.rb new file mode 100644 index 000000000..55de3579a --- /dev/null +++ b/lib/square/types/list_cash_drawer_shifts_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class ListCashDrawerShiftsResponse < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :cash_drawer_shifts, Internal::Types::Array[Square::Types::CashDrawerShiftSummary], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_catalog_response.rb b/lib/square/types/list_catalog_response.rb new file mode 100644 index 000000000..e823c3cfe --- /dev/null +++ b/lib/square/types/list_catalog_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class ListCatalogResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :objects, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_customer_custom_attribute_definitions_response.rb b/lib/square/types/list_customer_custom_attribute_definitions_response.rb new file mode 100644 index 000000000..3d048ad11 --- /dev/null +++ b/lib/square/types/list_customer_custom_attribute_definitions_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [ListCustomerCustomAttributeDefinitions](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributeDefinitions) response. + # Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response. + # If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. + class ListCustomerCustomAttributeDefinitionsResponse < Internal::Types::Model + field :custom_attribute_definitions, Internal::Types::Array[Square::Types::CustomAttributeDefinition], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_customer_custom_attributes_response.rb b/lib/square/types/list_customer_custom_attributes_response.rb new file mode 100644 index 000000000..f17cad45b --- /dev/null +++ b/lib/square/types/list_customer_custom_attributes_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [ListCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributes) response. + # Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional + # results are available, the `cursor` field is also present along with `custom_attributes`. + class ListCustomerCustomAttributesResponse < Internal::Types::Model + field :custom_attributes, Internal::Types::Array[Square::Types::CustomAttribute], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_customer_groups_response.rb b/lib/square/types/list_customer_groups_response.rb new file mode 100644 index 000000000..06a91753e --- /dev/null +++ b/lib/square/types/list_customer_groups_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [ListCustomerGroups](api-endpoint:CustomerGroups-ListCustomerGroups) endpoint. + # + # Either `errors` or `groups` is present in a given response (never both). + class ListCustomerGroupsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :groups, Internal::Types::Array[Square::Types::CustomerGroup], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_customer_segments_response.rb b/lib/square/types/list_customer_segments_response.rb new file mode 100644 index 000000000..620985f85 --- /dev/null +++ b/lib/square/types/list_customer_segments_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class ListCustomerSegmentsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :segments, Internal::Types::Array[Square::Types::CustomerSegment], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_customers_response.rb b/lib/square/types/list_customers_response.rb new file mode 100644 index 000000000..815da474d --- /dev/null +++ b/lib/square/types/list_customers_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class ListCustomersResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :customers, Internal::Types::Array[Square::Types::Customer], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :count, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_device_codes_response.rb b/lib/square/types/list_device_codes_response.rb new file mode 100644 index 000000000..5c9de3136 --- /dev/null +++ b/lib/square/types/list_device_codes_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class ListDeviceCodesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :device_codes, Internal::Types::Array[Square::Types::DeviceCode], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_devices_response.rb b/lib/square/types/list_devices_response.rb new file mode 100644 index 000000000..6e2a0e095 --- /dev/null +++ b/lib/square/types/list_devices_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class ListDevicesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :devices, Internal::Types::Array[Square::Types::Device], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_dispute_evidence_response.rb b/lib/square/types/list_dispute_evidence_response.rb new file mode 100644 index 000000000..808699b25 --- /dev/null +++ b/lib/square/types/list_dispute_evidence_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields in a `ListDisputeEvidence` response. + class ListDisputeEvidenceResponse < Internal::Types::Model + field :evidence, Internal::Types::Array[Square::Types::DisputeEvidence], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_disputes_response.rb b/lib/square/types/list_disputes_response.rb new file mode 100644 index 000000000..b136f34b3 --- /dev/null +++ b/lib/square/types/list_disputes_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines fields in a `ListDisputes` response. + class ListDisputesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :disputes, Internal::Types::Array[Square::Types::Dispute], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_employee_wages_response.rb b/lib/square/types/list_employee_wages_response.rb new file mode 100644 index 000000000..02824e63a --- /dev/null +++ b/lib/square/types/list_employee_wages_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # The response to a request for a set of `EmployeeWage` objects. The response contains + # a set of `EmployeeWage` objects. + class ListEmployeeWagesResponse < Internal::Types::Model + field :employee_wages, Internal::Types::Array[Square::Types::EmployeeWage], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_employees_response.rb b/lib/square/types/list_employees_response.rb new file mode 100644 index 000000000..c67e274e1 --- /dev/null +++ b/lib/square/types/list_employees_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class ListEmployeesResponse < Internal::Types::Model + field :employees, Internal::Types::Array[Square::Types::Employee], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_event_types_response.rb b/lib/square/types/list_event_types_response.rb new file mode 100644 index 000000000..f2dacd5df --- /dev/null +++ b/lib/square/types/list_event_types_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [ListEventTypes](api-endpoint:Events-ListEventTypes) endpoint. + # + # Note: if there are errors processing the request, the event types field will not be + # present. + class ListEventTypesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :event_types, Internal::Types::Array[String], optional: true, nullable: false + field :metadata, Internal::Types::Array[Square::Types::EventTypeMetadata], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_gift_card_activities_response.rb b/lib/square/types/list_gift_card_activities_response.rb new file mode 100644 index 000000000..a96a23509 --- /dev/null +++ b/lib/square/types/list_gift_card_activities_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains a list of `GiftCardActivity` objects. If the request resulted in errors, + # the response contains a set of `Error` objects. + class ListGiftCardActivitiesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :gift_card_activities, Internal::Types::Array[Square::Types::GiftCardActivity], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_gift_cards_response.rb b/lib/square/types/list_gift_cards_response.rb new file mode 100644 index 000000000..38f0bf754 --- /dev/null +++ b/lib/square/types/list_gift_cards_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains a list of `GiftCard` objects. If the request resulted in errors, + # the response contains a set of `Error` objects. + class ListGiftCardsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :gift_cards, Internal::Types::Array[Square::Types::GiftCard], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_invoices_response.rb b/lib/square/types/list_invoices_response.rb new file mode 100644 index 000000000..dc3a247c8 --- /dev/null +++ b/lib/square/types/list_invoices_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes a `ListInvoice` response. + class ListInvoicesResponse < Internal::Types::Model + field :invoices, Internal::Types::Array[Square::Types::Invoice], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_jobs_response.rb b/lib/square/types/list_jobs_response.rb new file mode 100644 index 000000000..c81f8c694 --- /dev/null +++ b/lib/square/types/list_jobs_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [ListJobs](api-endpoint:Team-ListJobs) response. Either `jobs` or `errors` + # is present in the response. If additional results are available, the `cursor` field is also present. + class ListJobsResponse < Internal::Types::Model + field :jobs, Internal::Types::Array[Square::Types::Job], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_location_booking_profiles_response.rb b/lib/square/types/list_location_booking_profiles_response.rb new file mode 100644 index 000000000..1f2aa78f1 --- /dev/null +++ b/lib/square/types/list_location_booking_profiles_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class ListLocationBookingProfilesResponse < Internal::Types::Model + field :location_booking_profiles, Internal::Types::Array[Square::Types::LocationBookingProfile], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_location_custom_attribute_definitions_response.rb b/lib/square/types/list_location_custom_attribute_definitions_response.rb new file mode 100644 index 000000000..2802a16cb --- /dev/null +++ b/lib/square/types/list_location_custom_attribute_definitions_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [ListLocationCustomAttributeDefinitions](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributeDefinitions) response. + # Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response. + # If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. + class ListLocationCustomAttributeDefinitionsResponse < Internal::Types::Model + field :custom_attribute_definitions, Internal::Types::Array[Square::Types::CustomAttributeDefinition], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_location_custom_attributes_response.rb b/lib/square/types/list_location_custom_attributes_response.rb new file mode 100644 index 000000000..83fad6dce --- /dev/null +++ b/lib/square/types/list_location_custom_attributes_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [ListLocationCustomAttributes](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributes) response. + # Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional + # results are available, the `cursor` field is also present along with `custom_attributes`. + class ListLocationCustomAttributesResponse < Internal::Types::Model + field :custom_attributes, Internal::Types::Array[Square::Types::CustomAttribute], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_locations_response.rb b/lib/square/types/list_locations_response.rb new file mode 100644 index 000000000..9adc9f404 --- /dev/null +++ b/lib/square/types/list_locations_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of a request + # to the [ListLocations](api-endpoint:Locations-ListLocations) endpoint. + # + # Either `errors` or `locations` is present in a given response (never both). + class ListLocationsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :locations, Internal::Types::Array[Square::Types::Location], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_loyalty_programs_response.rb b/lib/square/types/list_loyalty_programs_response.rb new file mode 100644 index 000000000..277c869df --- /dev/null +++ b/lib/square/types/list_loyalty_programs_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains all loyalty programs. + class ListLoyaltyProgramsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :programs, Internal::Types::Array[Square::Types::LoyaltyProgram], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_loyalty_promotions_response.rb b/lib/square/types/list_loyalty_promotions_response.rb new file mode 100644 index 000000000..5cfe6973d --- /dev/null +++ b/lib/square/types/list_loyalty_promotions_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) response. + # One of `loyalty_promotions`, an empty object, or `errors` is present in the response. + # If additional results are available, the `cursor` field is also present along with `loyalty_promotions`. + class ListLoyaltyPromotionsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :loyalty_promotions, Internal::Types::Array[Square::Types::LoyaltyPromotion], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_merchant_custom_attribute_definitions_response.rb b/lib/square/types/list_merchant_custom_attribute_definitions_response.rb new file mode 100644 index 000000000..0690f561c --- /dev/null +++ b/lib/square/types/list_merchant_custom_attribute_definitions_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [ListMerchantCustomAttributeDefinitions](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributeDefinitions) response. + # Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response. + # If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. + class ListMerchantCustomAttributeDefinitionsResponse < Internal::Types::Model + field :custom_attribute_definitions, Internal::Types::Array[Square::Types::CustomAttributeDefinition], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_merchant_custom_attributes_response.rb b/lib/square/types/list_merchant_custom_attributes_response.rb new file mode 100644 index 000000000..cbdaad3bf --- /dev/null +++ b/lib/square/types/list_merchant_custom_attributes_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [ListMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributes) response. + # Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional + # results are available, the `cursor` field is also present along with `custom_attributes`. + class ListMerchantCustomAttributesResponse < Internal::Types::Model + field :custom_attributes, Internal::Types::Array[Square::Types::CustomAttribute], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_merchants_response.rb b/lib/square/types/list_merchants_response.rb new file mode 100644 index 000000000..fda9aceed --- /dev/null +++ b/lib/square/types/list_merchants_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The response object returned by the [ListMerchant](api-endpoint:Merchants-ListMerchants) endpoint. + class ListMerchantsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :merchant, Internal::Types::Array[Square::Types::Merchant], optional: true, nullable: false + field :cursor, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_order_custom_attribute_definitions_response.rb b/lib/square/types/list_order_custom_attribute_definitions_response.rb new file mode 100644 index 000000000..5265dd232 --- /dev/null +++ b/lib/square/types/list_order_custom_attribute_definitions_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from listing order custom attribute definitions. + class ListOrderCustomAttributeDefinitionsResponse < Internal::Types::Model + field :custom_attribute_definitions, Internal::Types::Array[Square::Types::CustomAttributeDefinition], optional: false, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_order_custom_attributes_response.rb b/lib/square/types/list_order_custom_attributes_response.rb new file mode 100644 index 000000000..f9ef7e8f3 --- /dev/null +++ b/lib/square/types/list_order_custom_attributes_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from listing order custom attributes. + class ListOrderCustomAttributesResponse < Internal::Types::Model + field :custom_attributes, Internal::Types::Array[Square::Types::CustomAttribute], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_payment_links_response.rb b/lib/square/types/list_payment_links_response.rb new file mode 100644 index 000000000..2cae21163 --- /dev/null +++ b/lib/square/types/list_payment_links_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class ListPaymentLinksResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :payment_links, Internal::Types::Array[Square::Types::PaymentLink], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_payment_refunds_request_sort_field.rb b/lib/square/types/list_payment_refunds_request_sort_field.rb new file mode 100644 index 000000000..b4da17998 --- /dev/null +++ b/lib/square/types/list_payment_refunds_request_sort_field.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module ListPaymentRefundsRequestSortField + extend Square::Internal::Types::Enum + CREATED_AT = "CREATED_AT" + UPDATED_AT = "UPDATED_AT"end + end +end diff --git a/lib/square/types/list_payment_refunds_response.rb b/lib/square/types/list_payment_refunds_response.rb new file mode 100644 index 000000000..bc193bcba --- /dev/null +++ b/lib/square/types/list_payment_refunds_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response returned by [ListPaymentRefunds](api-endpoint:Refunds-ListPaymentRefunds). + # + # Either `errors` or `refunds` is present in a given response (never both). + class ListPaymentRefundsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :refunds, Internal::Types::Array[Square::Types::PaymentRefund], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_payments_request_sort_field.rb b/lib/square/types/list_payments_request_sort_field.rb new file mode 100644 index 000000000..e185d9069 --- /dev/null +++ b/lib/square/types/list_payments_request_sort_field.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module ListPaymentsRequestSortField + extend Square::Internal::Types::Enum + CREATED_AT = "CREATED_AT" + OFFLINE_CREATED_AT = "OFFLINE_CREATED_AT" + UPDATED_AT = "UPDATED_AT"end + end +end diff --git a/lib/square/types/list_payments_response.rb b/lib/square/types/list_payments_response.rb new file mode 100644 index 000000000..c36639a4f --- /dev/null +++ b/lib/square/types/list_payments_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response returned by [ListPayments](api-endpoint:Payments-ListPayments). + class ListPaymentsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :payments, Internal::Types::Array[Square::Types::Payment], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_payout_entries_response.rb b/lib/square/types/list_payout_entries_response.rb new file mode 100644 index 000000000..0c60ed8f3 --- /dev/null +++ b/lib/square/types/list_payout_entries_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The response to retrieve payout records entries. + class ListPayoutEntriesResponse < Internal::Types::Model + field :payout_entries, Internal::Types::Array[Square::Types::PayoutEntry], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_payouts_response.rb b/lib/square/types/list_payouts_response.rb new file mode 100644 index 000000000..acf635883 --- /dev/null +++ b/lib/square/types/list_payouts_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The response to retrieve payout records entries. + class ListPayoutsResponse < Internal::Types::Model + field :payouts, Internal::Types::Array[Square::Types::Payout], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_sites_response.rb b/lib/square/types/list_sites_response.rb new file mode 100644 index 000000000..60d2949ce --- /dev/null +++ b/lib/square/types/list_sites_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a `ListSites` response. The response can include either `sites` or `errors`. + class ListSitesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :sites, Internal::Types::Array[Square::Types::Site], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_subscription_events_response.rb b/lib/square/types/list_subscription_events_response.rb new file mode 100644 index 000000000..0007d00b1 --- /dev/null +++ b/lib/square/types/list_subscription_events_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response from the + # [ListSubscriptionEvents](api-endpoint:Subscriptions-ListSubscriptionEvents). + class ListSubscriptionEventsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription_events, Internal::Types::Array[Square::Types::SubscriptionEvent], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_team_member_booking_profiles_response.rb b/lib/square/types/list_team_member_booking_profiles_response.rb new file mode 100644 index 000000000..91cd83aee --- /dev/null +++ b/lib/square/types/list_team_member_booking_profiles_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class ListTeamMemberBookingProfilesResponse < Internal::Types::Model + field :team_member_booking_profiles, Internal::Types::Array[Square::Types::TeamMemberBookingProfile], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_team_member_wages_response.rb b/lib/square/types/list_team_member_wages_response.rb new file mode 100644 index 000000000..677774045 --- /dev/null +++ b/lib/square/types/list_team_member_wages_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # The response to a request for a set of `TeamMemberWage` objects. The response contains + # a set of `TeamMemberWage` objects. + class ListTeamMemberWagesResponse < Internal::Types::Model + field :team_member_wages, Internal::Types::Array[Square::Types::TeamMemberWage], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_transactions_response.rb b/lib/square/types/list_transactions_response.rb new file mode 100644 index 000000000..7c595efc6 --- /dev/null +++ b/lib/square/types/list_transactions_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class ListTransactionsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :transactions, Internal::Types::Array[Square::Types::Transaction], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_webhook_event_types_response.rb b/lib/square/types/list_webhook_event_types_response.rb new file mode 100644 index 000000000..c30cf7434 --- /dev/null +++ b/lib/square/types/list_webhook_event_types_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [ListWebhookEventTypes](api-endpoint:WebhookSubscriptions-ListWebhookEventTypes) endpoint. + # + # Note: if there are errors processing the request, the event types field will not be + # present. + class ListWebhookEventTypesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :event_types, Internal::Types::Array[String], optional: true, nullable: false + field :metadata, Internal::Types::Array[Square::Types::EventTypeMetadata], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_webhook_subscriptions_response.rb b/lib/square/types/list_webhook_subscriptions_response.rb new file mode 100644 index 000000000..34aecbca9 --- /dev/null +++ b/lib/square/types/list_webhook_subscriptions_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [ListWebhookSubscriptions](api-endpoint:WebhookSubscriptions-ListWebhookSubscriptions) endpoint. + # + # Note: if there are errors processing the request, the subscriptions field will not be + # present. + class ListWebhookSubscriptionsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscriptions, Internal::Types::Array[Square::Types::WebhookSubscription], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/list_workweek_configs_response.rb b/lib/square/types/list_workweek_configs_response.rb new file mode 100644 index 000000000..4c69b73cf --- /dev/null +++ b/lib/square/types/list_workweek_configs_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class ListWorkweekConfigsResponse < Internal::Types::Model + field :workweek_configs, Internal::Types::Array[Square::Types::WorkweekConfig], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location.rb b/lib/square/types/location.rb new file mode 100644 index 000000000..783173f44 --- /dev/null +++ b/lib/square/types/location.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). + class Location < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :address, Square::Types::Address, optional: true, nullable: false + field :timezone, String, optional: true, nullable: false + field :capabilities, Internal::Types::Array[Square::Types::LocationCapability], optional: true, nullable: false + field :status, Square::Types::LocationStatus, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :merchant_id, String, optional: true, nullable: false + field :country, Square::Types::Country, optional: true, nullable: false + field :language_code, String, optional: true, nullable: false + field :currency, Square::Types::Currency, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :business_name, String, optional: true, nullable: false + field :type, Square::Types::LocationType, optional: true, nullable: false + field :website_url, String, optional: true, nullable: false + field :business_hours, Square::Types::BusinessHours, optional: true, nullable: false + field :business_email, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :twitter_username, String, optional: true, nullable: false + field :instagram_username, String, optional: true, nullable: false + field :facebook_url, String, optional: true, nullable: false + field :coordinates, Square::Types::Coordinates, optional: true, nullable: false + field :logo_url, String, optional: true, nullable: false + field :pos_background_url, String, optional: true, nullable: false + field :mcc, String, optional: true, nullable: false + field :full_format_logo_url, String, optional: true, nullable: false + field :tax_ids, Square::Types::TaxIds, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_booking_profile.rb b/lib/square/types/location_booking_profile.rb new file mode 100644 index 000000000..780dd83b3 --- /dev/null +++ b/lib/square/types/location_booking_profile.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The booking profile of a seller's location, including the location's ID and whether the location is enabled for online booking. + class LocationBookingProfile < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + field :booking_site_url, String, optional: true, nullable: false + field :online_booking_enabled, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_capability.rb b/lib/square/types/location_capability.rb new file mode 100644 index 000000000..908a6802c --- /dev/null +++ b/lib/square/types/location_capability.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module LocationCapability + extend Square::Internal::Types::Enum + CREDIT_CARD_PROCESSING = "CREDIT_CARD_PROCESSING" + AUTOMATIC_TRANSFERS = "AUTOMATIC_TRANSFERS" + UNLINKED_REFUNDS = "UNLINKED_REFUNDS"end + end +end diff --git a/lib/square/types/location_created_event.rb b/lib/square/types/location_created_event.rb new file mode 100644 index 000000000..dba3f778c --- /dev/null +++ b/lib/square/types/location_created_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Location](entity:Location) is created. + class LocationCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LocationCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_created_event_data.rb b/lib/square/types/location_created_event_data.rb new file mode 100644 index 000000000..b9cc1bd48 --- /dev/null +++ b/lib/square/types/location_created_event_data.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class LocationCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_custom_attribute_definition_owned_created_event.rb b/lib/square/types/location_custom_attribute_definition_owned_created_event.rb new file mode 100644 index 000000000..9abd0630e --- /dev/null +++ b/lib/square/types/location_custom_attribute_definition_owned_created_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a location [custom attribute definition](entity:CustomAttributeDefinition) + # is created by the subscribing application. + class LocationCustomAttributeDefinitionOwnedCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_custom_attribute_definition_owned_deleted_event.rb b/lib/square/types/location_custom_attribute_definition_owned_deleted_event.rb new file mode 100644 index 000000000..29cb5c6df --- /dev/null +++ b/lib/square/types/location_custom_attribute_definition_owned_deleted_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a location [custom attribute definition](entity:CustomAttributeDefinition) + # created by the subscribing application is deleted. A custom attribute definition can only be deleted by + # the application that created it. + class LocationCustomAttributeDefinitionOwnedDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_custom_attribute_definition_owned_updated_event.rb b/lib/square/types/location_custom_attribute_definition_owned_updated_event.rb new file mode 100644 index 000000000..32bb2d211 --- /dev/null +++ b/lib/square/types/location_custom_attribute_definition_owned_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a location [custom attribute definition](entity:CustomAttributeDefinition) + # created by the subscribing application is updated. A custom attribute definition can only be updated + # by the application that created it. + class LocationCustomAttributeDefinitionOwnedUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_custom_attribute_definition_visible_created_event.rb b/lib/square/types/location_custom_attribute_definition_visible_created_event.rb new file mode 100644 index 000000000..f7ae4cdb0 --- /dev/null +++ b/lib/square/types/location_custom_attribute_definition_visible_created_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a location [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to the subscribing application is created. A notification is sent when your application + # creates a custom attribute definition or another application creates a custom attribute definition whose + # `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + class LocationCustomAttributeDefinitionVisibleCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_custom_attribute_definition_visible_deleted_event.rb b/lib/square/types/location_custom_attribute_definition_visible_deleted_event.rb new file mode 100644 index 000000000..4b342beb4 --- /dev/null +++ b/lib/square/types/location_custom_attribute_definition_visible_deleted_event.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a location [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to the subscribing application is deleted. A custom attribute definition can only + # be deleted by the application that created it. A notification is sent when your application deletes + # a custom attribute definition or when another application deletes a custom attribute definition whose + # `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + class LocationCustomAttributeDefinitionVisibleDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_custom_attribute_definition_visible_updated_event.rb b/lib/square/types/location_custom_attribute_definition_visible_updated_event.rb new file mode 100644 index 000000000..4f4e932f1 --- /dev/null +++ b/lib/square/types/location_custom_attribute_definition_visible_updated_event.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a location [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to the subscribing application is updated. A custom attribute definition can only be updated + # by the application that created it. A notification is sent when your application updates a custom attribute + # definition or when another application updates a custom attribute definition whose `visibility` is + # `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + class LocationCustomAttributeDefinitionVisibleUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_custom_attribute_owned_deleted_event.rb b/lib/square/types/location_custom_attribute_owned_deleted_event.rb new file mode 100644 index 000000000..ab380103e --- /dev/null +++ b/lib/square/types/location_custom_attribute_owned_deleted_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a location [custom attribute](entity:CustomAttribute) + # owned by the subscribing application is deleted. Custom attributes are owned by the + # application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition). + # Custom attributes whose `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application. + class LocationCustomAttributeOwnedDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_custom_attribute_owned_updated_event.rb b/lib/square/types/location_custom_attribute_owned_updated_event.rb new file mode 100644 index 000000000..b47e1b856 --- /dev/null +++ b/lib/square/types/location_custom_attribute_owned_updated_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a location [custom attribute](entity:CustomAttribute) owned by the + # subscribing application is created or updated. Custom attributes are owned by the application that created + # the corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose + # `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application. + class LocationCustomAttributeOwnedUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_custom_attribute_visible_deleted_event.rb b/lib/square/types/location_custom_attribute_visible_deleted_event.rb new file mode 100644 index 000000000..0b3db9dcd --- /dev/null +++ b/lib/square/types/location_custom_attribute_visible_deleted_event.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a location [custom attribute](entity:CustomAttribute) that is visible to the + # subscribing application is deleted. A notification is sent when: + # - Your application deletes a custom attribute owned by your application, regardless of the `visibility` setting. + # - Any application deletes a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY` + # or `VISIBILITY_READ_WRITE_VALUES`. + # + # Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application, but those set to + # `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the owner. Custom attributes are owned + # by the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition). + class LocationCustomAttributeVisibleDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_custom_attribute_visible_updated_event.rb b/lib/square/types/location_custom_attribute_visible_updated_event.rb new file mode 100644 index 000000000..cbbc007c1 --- /dev/null +++ b/lib/square/types/location_custom_attribute_visible_updated_event.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a location [custom attribute](entity:CustomAttribute) that is visible + # to the subscribing application is created or updated. A notification is sent when: + # - Your application creates or updates a custom attribute owned by your application, regardless of the `visibility` setting. + # - Any application creates or updates a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY` + # or `VISIBILITY_READ_WRITE_VALUES`. + # + # Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application, but those set to + # `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or updated by the owner. Custom attributes are owned + # by the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition). + class LocationCustomAttributeVisibleUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_settings_updated_event.rb b/lib/square/types/location_settings_updated_event.rb new file mode 100644 index 000000000..1ec94d606 --- /dev/null +++ b/lib/square/types/location_settings_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when online checkout location settings are updated + class LocationSettingsUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LocationSettingsUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_settings_updated_event_data.rb b/lib/square/types/location_settings_updated_event_data.rb new file mode 100644 index 000000000..a844546cc --- /dev/null +++ b/lib/square/types/location_settings_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class LocationSettingsUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LocationSettingsUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_settings_updated_event_object.rb b/lib/square/types/location_settings_updated_event_object.rb new file mode 100644 index 000000000..b69246987 --- /dev/null +++ b/lib/square/types/location_settings_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LocationSettingsUpdatedEventObject < Internal::Types::Model + field :location_settings, Square::Types::CheckoutLocationSettings, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_status.rb b/lib/square/types/location_status.rb new file mode 100644 index 000000000..4e2a1c3b2 --- /dev/null +++ b/lib/square/types/location_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module LocationStatus + extend Square::Internal::Types::Enum + ACTIVE = "ACTIVE" + INACTIVE = "INACTIVE"end + end +end diff --git a/lib/square/types/location_type.rb b/lib/square/types/location_type.rb new file mode 100644 index 000000000..105a52c51 --- /dev/null +++ b/lib/square/types/location_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module LocationType + extend Square::Internal::Types::Enum + PHYSICAL = "PHYSICAL" + MOBILE = "MOBILE"end + end +end diff --git a/lib/square/types/location_updated_event.rb b/lib/square/types/location_updated_event.rb new file mode 100644 index 000000000..02e98f0d0 --- /dev/null +++ b/lib/square/types/location_updated_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Location](entity:Location) is updated. + class LocationUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LocationUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/location_updated_event_data.rb b/lib/square/types/location_updated_event_data.rb new file mode 100644 index 000000000..0d9b0aac4 --- /dev/null +++ b/lib/square/types/location_updated_event_data.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class LocationUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account.rb b/lib/square/types/loyalty_account.rb new file mode 100644 index 000000000..9a4f661d5 --- /dev/null +++ b/lib/square/types/loyalty_account.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes a loyalty account in a [loyalty program](entity:LoyaltyProgram). For more information, see + # [Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). + class LoyaltyAccount < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :program_id, String, optional: false, nullable: false + field :balance, Integer, optional: true, nullable: false + field :lifetime_points, Integer, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :enrolled_at, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :mapping, Square::Types::LoyaltyAccountMapping, optional: true, nullable: false + field :expiring_point_deadlines, Internal::Types::Array[Square::Types::LoyaltyAccountExpiringPointDeadline], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_created_event.rb b/lib/square/types/loyalty_account_created_event.rb new file mode 100644 index 000000000..4c5eef74c --- /dev/null +++ b/lib/square/types/loyalty_account_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [loyalty account](entity:LoyaltyAccount) is created. + class LoyaltyAccountCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LoyaltyAccountCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_created_event_data.rb b/lib/square/types/loyalty_account_created_event_data.rb new file mode 100644 index 000000000..98c253b0a --- /dev/null +++ b/lib/square/types/loyalty_account_created_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `loyalty.account.created` event. + class LoyaltyAccountCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LoyaltyAccountCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_created_event_object.rb b/lib/square/types/loyalty_account_created_event_object.rb new file mode 100644 index 000000000..a8948c7bb --- /dev/null +++ b/lib/square/types/loyalty_account_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LoyaltyAccountCreatedEventObject < Internal::Types::Model + field :loyalty_account, Square::Types::LoyaltyAccount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_deleted_event.rb b/lib/square/types/loyalty_account_deleted_event.rb new file mode 100644 index 000000000..f6cdb19fa --- /dev/null +++ b/lib/square/types/loyalty_account_deleted_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [loyalty account](entity:LoyaltyAccount) is deleted. + class LoyaltyAccountDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LoyaltyAccountDeletedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_deleted_event_data.rb b/lib/square/types/loyalty_account_deleted_event_data.rb new file mode 100644 index 000000000..b0c170e56 --- /dev/null +++ b/lib/square/types/loyalty_account_deleted_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `loyalty.account.deleted` event. + class LoyaltyAccountDeletedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LoyaltyAccountDeletedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_deleted_event_object.rb b/lib/square/types/loyalty_account_deleted_event_object.rb new file mode 100644 index 000000000..ec2618962 --- /dev/null +++ b/lib/square/types/loyalty_account_deleted_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LoyaltyAccountDeletedEventObject < Internal::Types::Model + field :loyalty_account, Square::Types::LoyaltyAccount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_expiring_point_deadline.rb b/lib/square/types/loyalty_account_expiring_point_deadline.rb new file mode 100644 index 000000000..66eca2bc1 --- /dev/null +++ b/lib/square/types/loyalty_account_expiring_point_deadline.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a set of points for a loyalty account that are scheduled to expire on a specific date. + class LoyaltyAccountExpiringPointDeadline < Internal::Types::Model + field :points, Integer, optional: false, nullable: false + field :expires_at, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_mapping.rb b/lib/square/types/loyalty_account_mapping.rb new file mode 100644 index 000000000..32ab39e99 --- /dev/null +++ b/lib/square/types/loyalty_account_mapping.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class LoyaltyAccountMapping < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_updated_event.rb b/lib/square/types/loyalty_account_updated_event.rb new file mode 100644 index 000000000..c500412cc --- /dev/null +++ b/lib/square/types/loyalty_account_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [loyalty account](entity:LoyaltyAccount) is updated. + class LoyaltyAccountUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LoyaltyAccountUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_updated_event_data.rb b/lib/square/types/loyalty_account_updated_event_data.rb new file mode 100644 index 000000000..c7688b390 --- /dev/null +++ b/lib/square/types/loyalty_account_updated_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `loyalty.account.updated` event. + class LoyaltyAccountUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LoyaltyAccountUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_account_updated_event_object.rb b/lib/square/types/loyalty_account_updated_event_object.rb new file mode 100644 index 000000000..7f3a93bb1 --- /dev/null +++ b/lib/square/types/loyalty_account_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LoyaltyAccountUpdatedEventObject < Internal::Types::Model + field :loyalty_account, Square::Types::LoyaltyAccount, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event.rb b/lib/square/types/loyalty_event.rb new file mode 100644 index 000000000..127a949ce --- /dev/null +++ b/lib/square/types/loyalty_event.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class LoyaltyEvent < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :type, Square::Types::LoyaltyEventType, optional: false, nullable: false + field :created_at, String, optional: true, nullable: false + field :accumulate_points, Square::Types::LoyaltyEventAccumulatePoints, optional: true, nullable: false + field :create_reward, Square::Types::LoyaltyEventCreateReward, optional: true, nullable: false + field :redeem_reward, Square::Types::LoyaltyEventRedeemReward, optional: true, nullable: false + field :delete_reward, Square::Types::LoyaltyEventDeleteReward, optional: true, nullable: false + field :adjust_points, Square::Types::LoyaltyEventAdjustPoints, optional: true, nullable: false + field :loyalty_account_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :source, Square::Types::LoyaltyEventSource, optional: false, nullable: false + field :expire_points, Square::Types::LoyaltyEventExpirePoints, optional: true, nullable: false + field :other_event, Square::Types::LoyaltyEventOther, optional: true, nullable: false + field :accumulate_promotion_points, Square::Types::LoyaltyEventAccumulatePromotionPoints, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_accumulate_points.rb b/lib/square/types/loyalty_event_accumulate_points.rb new file mode 100644 index 000000000..c17988ea7 --- /dev/null +++ b/lib/square/types/loyalty_event_accumulate_points.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Provides metadata when the event `type` is `ACCUMULATE_POINTS`. + class LoyaltyEventAccumulatePoints < Internal::Types::Model + field :loyalty_program_id, String, optional: true, nullable: false + field :points, Integer, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_accumulate_promotion_points.rb b/lib/square/types/loyalty_event_accumulate_promotion_points.rb new file mode 100644 index 000000000..d6f48f770 --- /dev/null +++ b/lib/square/types/loyalty_event_accumulate_promotion_points.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. + class LoyaltyEventAccumulatePromotionPoints < Internal::Types::Model + field :loyalty_program_id, String, optional: true, nullable: false + field :loyalty_promotion_id, String, optional: true, nullable: false + field :points, Integer, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_adjust_points.rb b/lib/square/types/loyalty_event_adjust_points.rb new file mode 100644 index 000000000..823be57ef --- /dev/null +++ b/lib/square/types/loyalty_event_adjust_points.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Provides metadata when the event `type` is `ADJUST_POINTS`. + class LoyaltyEventAdjustPoints < Internal::Types::Model + field :loyalty_program_id, String, optional: true, nullable: false + field :points, Integer, optional: false, nullable: false + field :reason, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_create_reward.rb b/lib/square/types/loyalty_event_create_reward.rb new file mode 100644 index 000000000..b4df5a036 --- /dev/null +++ b/lib/square/types/loyalty_event_create_reward.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Provides metadata when the event `type` is `CREATE_REWARD`. + class LoyaltyEventCreateReward < Internal::Types::Model + field :loyalty_program_id, String, optional: true, nullable: false + field :reward_id, String, optional: true, nullable: false + field :points, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_created_event.rb b/lib/square/types/loyalty_event_created_event.rb new file mode 100644 index 000000000..0c8de80b1 --- /dev/null +++ b/lib/square/types/loyalty_event_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [loyalty event](entity:LoyaltyEvent) is created. + class LoyaltyEventCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LoyaltyEventCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_created_event_data.rb b/lib/square/types/loyalty_event_created_event_data.rb new file mode 100644 index 000000000..a95da8fd0 --- /dev/null +++ b/lib/square/types/loyalty_event_created_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `loyalty.event.created` event. + class LoyaltyEventCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LoyaltyEventCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_created_event_object.rb b/lib/square/types/loyalty_event_created_event_object.rb new file mode 100644 index 000000000..25183aa75 --- /dev/null +++ b/lib/square/types/loyalty_event_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class LoyaltyEventCreatedEventObject < Internal::Types::Model + field :loyalty_event, Square::Types::LoyaltyEvent, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_date_time_filter.rb b/lib/square/types/loyalty_event_date_time_filter.rb new file mode 100644 index 000000000..f1ecbd945 --- /dev/null +++ b/lib/square/types/loyalty_event_date_time_filter.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Filter events by date time range. + class LoyaltyEventDateTimeFilter < Internal::Types::Model + field :created_at, Square::Types::TimeRange, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_delete_reward.rb b/lib/square/types/loyalty_event_delete_reward.rb new file mode 100644 index 000000000..62d0dcf57 --- /dev/null +++ b/lib/square/types/loyalty_event_delete_reward.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Provides metadata when the event `type` is `DELETE_REWARD`. + class LoyaltyEventDeleteReward < Internal::Types::Model + field :loyalty_program_id, String, optional: true, nullable: false + field :reward_id, String, optional: true, nullable: false + field :points, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_expire_points.rb b/lib/square/types/loyalty_event_expire_points.rb new file mode 100644 index 000000000..8ec713032 --- /dev/null +++ b/lib/square/types/loyalty_event_expire_points.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Provides metadata when the event `type` is `EXPIRE_POINTS`. + class LoyaltyEventExpirePoints < Internal::Types::Model + field :loyalty_program_id, String, optional: true, nullable: false + field :points, Integer, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_filter.rb b/lib/square/types/loyalty_event_filter.rb new file mode 100644 index 000000000..856745a66 --- /dev/null +++ b/lib/square/types/loyalty_event_filter.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # The filtering criteria. If the request specifies multiple filters, + # the endpoint uses a logical AND to evaluate them. + class LoyaltyEventFilter < Internal::Types::Model + field :loyalty_account_filter, Square::Types::LoyaltyEventLoyaltyAccountFilter, optional: true, nullable: false + field :type_filter, Square::Types::LoyaltyEventTypeFilter, optional: true, nullable: false + field :date_time_filter, Square::Types::LoyaltyEventDateTimeFilter, optional: true, nullable: false + field :location_filter, Square::Types::LoyaltyEventLocationFilter, optional: true, nullable: false + field :order_filter, Square::Types::LoyaltyEventOrderFilter, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_location_filter.rb b/lib/square/types/loyalty_event_location_filter.rb new file mode 100644 index 000000000..68aba4d6a --- /dev/null +++ b/lib/square/types/loyalty_event_location_filter.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Filter events by location. + class LoyaltyEventLocationFilter < Internal::Types::Model + field :location_ids, Internal::Types::Array[String], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_loyalty_account_filter.rb b/lib/square/types/loyalty_event_loyalty_account_filter.rb new file mode 100644 index 000000000..9284c9ba8 --- /dev/null +++ b/lib/square/types/loyalty_event_loyalty_account_filter.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Filter events by loyalty account. + class LoyaltyEventLoyaltyAccountFilter < Internal::Types::Model + field :loyalty_account_id, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_order_filter.rb b/lib/square/types/loyalty_event_order_filter.rb new file mode 100644 index 000000000..4200bfd66 --- /dev/null +++ b/lib/square/types/loyalty_event_order_filter.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Filter events by the order associated with the event. + class LoyaltyEventOrderFilter < Internal::Types::Model + field :order_id, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_other.rb b/lib/square/types/loyalty_event_other.rb new file mode 100644 index 000000000..f4ff31486 --- /dev/null +++ b/lib/square/types/loyalty_event_other.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Provides metadata when the event `type` is `OTHER`. + class LoyaltyEventOther < Internal::Types::Model + field :loyalty_program_id, String, optional: true, nullable: false + field :points, Integer, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_query.rb b/lib/square/types/loyalty_event_query.rb new file mode 100644 index 000000000..71dabb611 --- /dev/null +++ b/lib/square/types/loyalty_event_query.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a query used to search for loyalty events. + class LoyaltyEventQuery < Internal::Types::Model + field :filter, Square::Types::LoyaltyEventFilter, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_redeem_reward.rb b/lib/square/types/loyalty_event_redeem_reward.rb new file mode 100644 index 000000000..20c311e9a --- /dev/null +++ b/lib/square/types/loyalty_event_redeem_reward.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Provides metadata when the event `type` is `REDEEM_REWARD`. + class LoyaltyEventRedeemReward < Internal::Types::Model + field :loyalty_program_id, String, optional: true, nullable: false + field :reward_id, String, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_event_source.rb b/lib/square/types/loyalty_event_source.rb new file mode 100644 index 000000000..76d253e51 --- /dev/null +++ b/lib/square/types/loyalty_event_source.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module LoyaltyEventSource + extend Square::Internal::Types::Enum + SQUARE = "SQUARE" + LOYALTY_API = "LOYALTY_API"end + end +end diff --git a/lib/square/types/loyalty_event_type.rb b/lib/square/types/loyalty_event_type.rb new file mode 100644 index 000000000..63d6e2466 --- /dev/null +++ b/lib/square/types/loyalty_event_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + module LoyaltyEventType + extend Square::Internal::Types::Enum + ACCUMULATE_POINTS = "ACCUMULATE_POINTS" + CREATE_REWARD = "CREATE_REWARD" + REDEEM_REWARD = "REDEEM_REWARD" + DELETE_REWARD = "DELETE_REWARD" + ADJUST_POINTS = "ADJUST_POINTS" + EXPIRE_POINTS = "EXPIRE_POINTS" + OTHER = "OTHER" + ACCUMULATE_PROMOTION_POINTS = "ACCUMULATE_PROMOTION_POINTS"end + end +end diff --git a/lib/square/types/loyalty_event_type_filter.rb b/lib/square/types/loyalty_event_type_filter.rb new file mode 100644 index 000000000..e63e55598 --- /dev/null +++ b/lib/square/types/loyalty_event_type_filter.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Filter events by event type. + class LoyaltyEventTypeFilter < Internal::Types::Model + field :types, Internal::Types::Array[Square::Types::LoyaltyEventType], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program.rb b/lib/square/types/loyalty_program.rb new file mode 100644 index 000000000..57bfc4638 --- /dev/null +++ b/lib/square/types/loyalty_program.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class LoyaltyProgram < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :status, Square::Types::LoyaltyProgramStatus, optional: true, nullable: false + field :reward_tiers, Internal::Types::Array[Square::Types::LoyaltyProgramRewardTier], optional: true, nullable: false + field :expiration_policy, Square::Types::LoyaltyProgramExpirationPolicy, optional: true, nullable: false + field :terminology, Square::Types::LoyaltyProgramTerminology, optional: true, nullable: false + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :accrual_rules, Internal::Types::Array[Square::Types::LoyaltyProgramAccrualRule], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_accrual_rule.rb b/lib/square/types/loyalty_program_accrual_rule.rb new file mode 100644 index 000000000..a9b418034 --- /dev/null +++ b/lib/square/types/loyalty_program_accrual_rule.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an accrual rule, which defines how buyers can earn points from the base [loyalty program](entity:LoyaltyProgram). + class LoyaltyProgramAccrualRule < Internal::Types::Model + field :accrual_type, Square::Types::LoyaltyProgramAccrualRuleType, optional: false, nullable: false + field :points, Integer, optional: true, nullable: false + field :visit_data, Square::Types::LoyaltyProgramAccrualRuleVisitData, optional: true, nullable: false + field :spend_data, Square::Types::LoyaltyProgramAccrualRuleSpendData, optional: true, nullable: false + field :item_variation_data, Square::Types::LoyaltyProgramAccrualRuleItemVariationData, optional: true, nullable: false + field :category_data, Square::Types::LoyaltyProgramAccrualRuleCategoryData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_accrual_rule_category_data.rb b/lib/square/types/loyalty_program_accrual_rule_category_data.rb new file mode 100644 index 000000000..a8ec814a3 --- /dev/null +++ b/lib/square/types/loyalty_program_accrual_rule_category_data.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents additional data for rules with the `CATEGORY` accrual type. + class LoyaltyProgramAccrualRuleCategoryData < Internal::Types::Model + field :category_id, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_accrual_rule_item_variation_data.rb b/lib/square/types/loyalty_program_accrual_rule_item_variation_data.rb new file mode 100644 index 000000000..ff9b6ab92 --- /dev/null +++ b/lib/square/types/loyalty_program_accrual_rule_item_variation_data.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents additional data for rules with the `ITEM_VARIATION` accrual type. + class LoyaltyProgramAccrualRuleItemVariationData < Internal::Types::Model + field :item_variation_id, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_accrual_rule_spend_data.rb b/lib/square/types/loyalty_program_accrual_rule_spend_data.rb new file mode 100644 index 000000000..0756c9604 --- /dev/null +++ b/lib/square/types/loyalty_program_accrual_rule_spend_data.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents additional data for rules with the `SPEND` accrual type. + class LoyaltyProgramAccrualRuleSpendData < Internal::Types::Model + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :excluded_category_ids, Internal::Types::Array[String], optional: true, nullable: false + field :excluded_item_variation_ids, Internal::Types::Array[String], optional: true, nullable: false + field :tax_mode, Square::Types::LoyaltyProgramAccrualRuleTaxMode, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_accrual_rule_tax_mode.rb b/lib/square/types/loyalty_program_accrual_rule_tax_mode.rb new file mode 100644 index 000000000..a4b8592ec --- /dev/null +++ b/lib/square/types/loyalty_program_accrual_rule_tax_mode.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module LoyaltyProgramAccrualRuleTaxMode + extend Square::Internal::Types::Enum + BEFORE_TAX = "BEFORE_TAX" + AFTER_TAX = "AFTER_TAX"end + end +end diff --git a/lib/square/types/loyalty_program_accrual_rule_type.rb b/lib/square/types/loyalty_program_accrual_rule_type.rb new file mode 100644 index 000000000..0f6f0b76f --- /dev/null +++ b/lib/square/types/loyalty_program_accrual_rule_type.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module LoyaltyProgramAccrualRuleType + extend Square::Internal::Types::Enum + VISIT = "VISIT" + SPEND = "SPEND" + ITEM_VARIATION = "ITEM_VARIATION" + CATEGORY = "CATEGORY"end + end +end diff --git a/lib/square/types/loyalty_program_accrual_rule_visit_data.rb b/lib/square/types/loyalty_program_accrual_rule_visit_data.rb new file mode 100644 index 000000000..8c00e8c23 --- /dev/null +++ b/lib/square/types/loyalty_program_accrual_rule_visit_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents additional data for rules with the `VISIT` accrual type. + class LoyaltyProgramAccrualRuleVisitData < Internal::Types::Model + field :minimum_amount_money, Square::Types::Money, optional: true, nullable: false + field :tax_mode, Square::Types::LoyaltyProgramAccrualRuleTaxMode, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_created_event.rb b/lib/square/types/loyalty_program_created_event.rb new file mode 100644 index 000000000..2906190da --- /dev/null +++ b/lib/square/types/loyalty_program_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [loyalty program](entity:LoyaltyProgram) is created. + class LoyaltyProgramCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LoyaltyProgramCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_created_event_data.rb b/lib/square/types/loyalty_program_created_event_data.rb new file mode 100644 index 000000000..eccaf5a3c --- /dev/null +++ b/lib/square/types/loyalty_program_created_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `loyalty.program.created` event. + class LoyaltyProgramCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LoyaltyProgramCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_created_event_object.rb b/lib/square/types/loyalty_program_created_event_object.rb new file mode 100644 index 000000000..f195414c1 --- /dev/null +++ b/lib/square/types/loyalty_program_created_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the loyalty program associated with a `loyalty.program.created` event. + class LoyaltyProgramCreatedEventObject < Internal::Types::Model + field :loyalty_program, Square::Types::LoyaltyProgram, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_expiration_policy.rb b/lib/square/types/loyalty_program_expiration_policy.rb new file mode 100644 index 000000000..0af317123 --- /dev/null +++ b/lib/square/types/loyalty_program_expiration_policy.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes when the loyalty program expires. + class LoyaltyProgramExpirationPolicy < Internal::Types::Model + field :expiration_duration, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_reward_tier.rb b/lib/square/types/loyalty_program_reward_tier.rb new file mode 100644 index 000000000..51e8ea830 --- /dev/null +++ b/lib/square/types/loyalty_program_reward_tier.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class LoyaltyProgramRewardTier < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :points, Integer, optional: false, nullable: false + field :name, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :pricing_rule_reference, Square::Types::CatalogObjectReference, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_status.rb b/lib/square/types/loyalty_program_status.rb new file mode 100644 index 000000000..5e8bf6b72 --- /dev/null +++ b/lib/square/types/loyalty_program_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module LoyaltyProgramStatus + extend Square::Internal::Types::Enum + INACTIVE = "INACTIVE" + ACTIVE = "ACTIVE"end + end +end diff --git a/lib/square/types/loyalty_program_terminology.rb b/lib/square/types/loyalty_program_terminology.rb new file mode 100644 index 000000000..1b2d4aa94 --- /dev/null +++ b/lib/square/types/loyalty_program_terminology.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the naming used for loyalty points. + class LoyaltyProgramTerminology < Internal::Types::Model + field :one, String, optional: false, nullable: false + field :other, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_updated_event.rb b/lib/square/types/loyalty_program_updated_event.rb new file mode 100644 index 000000000..121435843 --- /dev/null +++ b/lib/square/types/loyalty_program_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [loyalty program](entity:LoyaltyProgram) is updated. + class LoyaltyProgramUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LoyaltyProgramUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_updated_event_data.rb b/lib/square/types/loyalty_program_updated_event_data.rb new file mode 100644 index 000000000..9ab1e813b --- /dev/null +++ b/lib/square/types/loyalty_program_updated_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `loyalty.program.updated` event. + class LoyaltyProgramUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LoyaltyProgramUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_program_updated_event_object.rb b/lib/square/types/loyalty_program_updated_event_object.rb new file mode 100644 index 000000000..427e083fb --- /dev/null +++ b/lib/square/types/loyalty_program_updated_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the loyalty program associated with a `loyalty.program.updated` event. + class LoyaltyProgramUpdatedEventObject < Internal::Types::Model + field :loyalty_program, Square::Types::LoyaltyProgram, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion.rb b/lib/square/types/loyalty_promotion.rb new file mode 100644 index 000000000..26efe2a88 --- /dev/null +++ b/lib/square/types/loyalty_promotion.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a promotion for a [loyalty program](entity:LoyaltyProgram). Loyalty promotions enable buyers + # to earn extra points on top of those earned from the base program. + # + # A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. + class LoyaltyPromotion < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :name, String, optional: false, nullable: false + field :incentive, Square::Types::LoyaltyPromotionIncentive, optional: false, nullable: false + field :available_time, Square::Types::LoyaltyPromotionAvailableTimeData, optional: false, nullable: false + field :trigger_limit, Square::Types::LoyaltyPromotionTriggerLimit, optional: true, nullable: false + field :status, Square::Types::LoyaltyPromotionStatus, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :canceled_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :loyalty_program_id, String, optional: true, nullable: false + field :minimum_spend_amount_money, Square::Types::Money, optional: true, nullable: false + field :qualifying_item_variation_ids, Internal::Types::Array[String], optional: true, nullable: false + field :qualifying_category_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_available_time_data.rb b/lib/square/types/loyalty_promotion_available_time_data.rb new file mode 100644 index 000000000..68c88d823 --- /dev/null +++ b/lib/square/types/loyalty_promotion_available_time_data.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents scheduling information that determines when purchases can qualify to earn points + # from a [loyalty promotion](entity:LoyaltyPromotion). + class LoyaltyPromotionAvailableTimeData < Internal::Types::Model + field :start_date, String, optional: true, nullable: false + field :end_date, String, optional: true, nullable: false + field :time_periods, Internal::Types::Array[String], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_created_event.rb b/lib/square/types/loyalty_promotion_created_event.rb new file mode 100644 index 000000000..6e55a1cd9 --- /dev/null +++ b/lib/square/types/loyalty_promotion_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [loyalty promotion](entity:LoyaltyPromotion) is created. + class LoyaltyPromotionCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LoyaltyPromotionCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_created_event_data.rb b/lib/square/types/loyalty_promotion_created_event_data.rb new file mode 100644 index 000000000..c5b1abc52 --- /dev/null +++ b/lib/square/types/loyalty_promotion_created_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `loyalty.promotion.created` event. + class LoyaltyPromotionCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LoyaltyPromotionCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_created_event_object.rb b/lib/square/types/loyalty_promotion_created_event_object.rb new file mode 100644 index 000000000..f46be08fa --- /dev/null +++ b/lib/square/types/loyalty_promotion_created_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the loyalty promotion associated with a `loyalty.promotion.created` event. + class LoyaltyPromotionCreatedEventObject < Internal::Types::Model + field :loyalty_promotion, Square::Types::LoyaltyPromotion, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_incentive.rb b/lib/square/types/loyalty_promotion_incentive.rb new file mode 100644 index 000000000..4ef325397 --- /dev/null +++ b/lib/square/types/loyalty_promotion_incentive.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents how points for a [loyalty promotion](entity:LoyaltyPromotion) are calculated, + # either by multiplying the points earned from the base program or by adding a specified number + # of points to the points earned from the base program. + class LoyaltyPromotionIncentive < Internal::Types::Model + field :type, Square::Types::LoyaltyPromotionIncentiveType, optional: false, nullable: false + field :points_multiplier_data, Square::Types::LoyaltyPromotionIncentivePointsMultiplierData, optional: true, nullable: false + field :points_addition_data, Square::Types::LoyaltyPromotionIncentivePointsAdditionData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_incentive_points_addition_data.rb b/lib/square/types/loyalty_promotion_incentive_points_addition_data.rb new file mode 100644 index 000000000..75ad1fd89 --- /dev/null +++ b/lib/square/types/loyalty_promotion_incentive_points_addition_data.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive). + class LoyaltyPromotionIncentivePointsAdditionData < Internal::Types::Model + field :points_addition, Integer, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_incentive_points_multiplier_data.rb b/lib/square/types/loyalty_promotion_incentive_points_multiplier_data.rb new file mode 100644 index 000000000..53d2202e5 --- /dev/null +++ b/lib/square/types/loyalty_promotion_incentive_points_multiplier_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive). + class LoyaltyPromotionIncentivePointsMultiplierData < Internal::Types::Model + field :points_multiplier, Integer, optional: true, nullable: false + field :multiplier, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_incentive_type.rb b/lib/square/types/loyalty_promotion_incentive_type.rb new file mode 100644 index 000000000..664509570 --- /dev/null +++ b/lib/square/types/loyalty_promotion_incentive_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module LoyaltyPromotionIncentiveType + extend Square::Internal::Types::Enum + POINTS_MULTIPLIER = "POINTS_MULTIPLIER" + POINTS_ADDITION = "POINTS_ADDITION"end + end +end diff --git a/lib/square/types/loyalty_promotion_status.rb b/lib/square/types/loyalty_promotion_status.rb new file mode 100644 index 000000000..cbfb4aa68 --- /dev/null +++ b/lib/square/types/loyalty_promotion_status.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module LoyaltyPromotionStatus + extend Square::Internal::Types::Enum + ACTIVE = "ACTIVE" + ENDED = "ENDED" + CANCELED = "CANCELED" + SCHEDULED = "SCHEDULED"end + end +end diff --git a/lib/square/types/loyalty_promotion_trigger_limit.rb b/lib/square/types/loyalty_promotion_trigger_limit.rb new file mode 100644 index 000000000..985b99054 --- /dev/null +++ b/lib/square/types/loyalty_promotion_trigger_limit.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the number of times a buyer can earn points during a [loyalty promotion](entity:LoyaltyPromotion). + # If this field is not set, buyers can trigger the promotion an unlimited number of times to earn points during + # the time that the promotion is available. + # + # A purchase that is disqualified from earning points because of this limit might qualify for another active promotion. + class LoyaltyPromotionTriggerLimit < Internal::Types::Model + field :times, Integer, optional: false, nullable: false + field :interval, Square::Types::LoyaltyPromotionTriggerLimitInterval, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_trigger_limit_interval.rb b/lib/square/types/loyalty_promotion_trigger_limit_interval.rb new file mode 100644 index 000000000..d9ee2bb13 --- /dev/null +++ b/lib/square/types/loyalty_promotion_trigger_limit_interval.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module LoyaltyPromotionTriggerLimitInterval + extend Square::Internal::Types::Enum + ALL_TIME = "ALL_TIME" + DAY = "DAY"end + end +end diff --git a/lib/square/types/loyalty_promotion_updated_event.rb b/lib/square/types/loyalty_promotion_updated_event.rb new file mode 100644 index 000000000..463d03766 --- /dev/null +++ b/lib/square/types/loyalty_promotion_updated_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [loyalty promotion](entity:LoyaltyPromotion) is updated. This event is + # invoked only when a loyalty promotion is canceled. + class LoyaltyPromotionUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::LoyaltyPromotionUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_updated_event_data.rb b/lib/square/types/loyalty_promotion_updated_event_data.rb new file mode 100644 index 000000000..5c761ef63 --- /dev/null +++ b/lib/square/types/loyalty_promotion_updated_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # The data associated with a `loyalty.promotion.updated` event. + class LoyaltyPromotionUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::LoyaltyPromotionUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_promotion_updated_event_object.rb b/lib/square/types/loyalty_promotion_updated_event_object.rb new file mode 100644 index 000000000..746806b2c --- /dev/null +++ b/lib/square/types/loyalty_promotion_updated_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that contains the loyalty promotion associated with a `loyalty.promotion.updated` event. + class LoyaltyPromotionUpdatedEventObject < Internal::Types::Model + field :loyalty_promotion, Square::Types::LoyaltyPromotion, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_reward.rb b/lib/square/types/loyalty_reward.rb new file mode 100644 index 000000000..8497eb6a5 --- /dev/null +++ b/lib/square/types/loyalty_reward.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a contract to redeem loyalty points for a [reward tier](entity:LoyaltyProgramRewardTier) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. + # For more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards). + class LoyaltyReward < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :status, Square::Types::LoyaltyRewardStatus, optional: true, nullable: false + field :loyalty_account_id, String, optional: false, nullable: false + field :reward_tier_id, String, optional: false, nullable: false + field :points, Integer, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :redeemed_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/loyalty_reward_status.rb b/lib/square/types/loyalty_reward_status.rb new file mode 100644 index 000000000..c4ec7d208 --- /dev/null +++ b/lib/square/types/loyalty_reward_status.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module LoyaltyRewardStatus + extend Square::Internal::Types::Enum + ISSUED = "ISSUED" + REDEEMED = "REDEEMED" + DELETED = "DELETED"end + end +end diff --git a/lib/square/types/measurement_unit.rb b/lib/square/types/measurement_unit.rb new file mode 100644 index 000000000..2e46b226f --- /dev/null +++ b/lib/square/types/measurement_unit.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # 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`. + class MeasurementUnit < Internal::Types::Model + field :custom_unit, Square::Types::MeasurementUnitCustom, optional: true, nullable: false + field :area_unit, Square::Types::MeasurementUnitArea, optional: true, nullable: false + field :length_unit, Square::Types::MeasurementUnitLength, optional: true, nullable: false + field :volume_unit, Square::Types::MeasurementUnitVolume, optional: true, nullable: false + field :weight_unit, Square::Types::MeasurementUnitWeight, optional: true, nullable: false + field :generic_unit, String, optional: true, nullable: false + field :time_unit, Square::Types::MeasurementUnitTime, optional: true, nullable: false + field :type, Square::Types::MeasurementUnitUnitType, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/measurement_unit_area.rb b/lib/square/types/measurement_unit_area.rb new file mode 100644 index 000000000..c02c15072 --- /dev/null +++ b/lib/square/types/measurement_unit_area.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + module MeasurementUnitArea + extend Square::Internal::Types::Enum + IMPERIAL_ACRE = "IMPERIAL_ACRE" + IMPERIAL_SQUARE_INCH = "IMPERIAL_SQUARE_INCH" + IMPERIAL_SQUARE_FOOT = "IMPERIAL_SQUARE_FOOT" + IMPERIAL_SQUARE_YARD = "IMPERIAL_SQUARE_YARD" + IMPERIAL_SQUARE_MILE = "IMPERIAL_SQUARE_MILE" + METRIC_SQUARE_CENTIMETER = "METRIC_SQUARE_CENTIMETER" + METRIC_SQUARE_METER = "METRIC_SQUARE_METER" + METRIC_SQUARE_KILOMETER = "METRIC_SQUARE_KILOMETER"end + end +end diff --git a/lib/square/types/measurement_unit_custom.rb b/lib/square/types/measurement_unit_custom.rb new file mode 100644 index 000000000..9dc70bc7f --- /dev/null +++ b/lib/square/types/measurement_unit_custom.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The information needed to define a custom unit, provided by the seller. + class MeasurementUnitCustom < Internal::Types::Model + field :name, String, optional: false, nullable: false + field :abbreviation, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/measurement_unit_length.rb b/lib/square/types/measurement_unit_length.rb new file mode 100644 index 000000000..9bc9cbe78 --- /dev/null +++ b/lib/square/types/measurement_unit_length.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + module MeasurementUnitLength + extend Square::Internal::Types::Enum + IMPERIAL_INCH = "IMPERIAL_INCH" + IMPERIAL_FOOT = "IMPERIAL_FOOT" + IMPERIAL_YARD = "IMPERIAL_YARD" + IMPERIAL_MILE = "IMPERIAL_MILE" + METRIC_MILLIMETER = "METRIC_MILLIMETER" + METRIC_CENTIMETER = "METRIC_CENTIMETER" + METRIC_METER = "METRIC_METER" + METRIC_KILOMETER = "METRIC_KILOMETER"end + end +end diff --git a/lib/square/types/measurement_unit_time.rb b/lib/square/types/measurement_unit_time.rb new file mode 100644 index 000000000..59e22967f --- /dev/null +++ b/lib/square/types/measurement_unit_time.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + module MeasurementUnitTime + extend Square::Internal::Types::Enum + GENERIC_MILLISECOND = "GENERIC_MILLISECOND" + GENERIC_SECOND = "GENERIC_SECOND" + GENERIC_MINUTE = "GENERIC_MINUTE" + GENERIC_HOUR = "GENERIC_HOUR" + GENERIC_DAY = "GENERIC_DAY"end + end +end diff --git a/lib/square/types/measurement_unit_unit_type.rb b/lib/square/types/measurement_unit_unit_type.rb new file mode 100644 index 000000000..18705c63a --- /dev/null +++ b/lib/square/types/measurement_unit_unit_type.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + module MeasurementUnitUnitType + extend Square::Internal::Types::Enum + TYPE_CUSTOM = "TYPE_CUSTOM" + TYPE_AREA = "TYPE_AREA" + TYPE_LENGTH = "TYPE_LENGTH" + TYPE_VOLUME = "TYPE_VOLUME" + TYPE_WEIGHT = "TYPE_WEIGHT" + TYPE_GENERIC = "TYPE_GENERIC"end + end +end diff --git a/lib/square/types/measurement_unit_volume.rb b/lib/square/types/measurement_unit_volume.rb new file mode 100644 index 000000000..f4ea8c0b9 --- /dev/null +++ b/lib/square/types/measurement_unit_volume.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + module MeasurementUnitVolume + extend Square::Internal::Types::Enum + GENERIC_FLUID_OUNCE = "GENERIC_FLUID_OUNCE" + GENERIC_SHOT = "GENERIC_SHOT" + GENERIC_CUP = "GENERIC_CUP" + GENERIC_PINT = "GENERIC_PINT" + GENERIC_QUART = "GENERIC_QUART" + GENERIC_GALLON = "GENERIC_GALLON" + IMPERIAL_CUBIC_INCH = "IMPERIAL_CUBIC_INCH" + IMPERIAL_CUBIC_FOOT = "IMPERIAL_CUBIC_FOOT" + IMPERIAL_CUBIC_YARD = "IMPERIAL_CUBIC_YARD" + METRIC_MILLILITER = "METRIC_MILLILITER" + METRIC_LITER = "METRIC_LITER"end + end +end diff --git a/lib/square/types/measurement_unit_weight.rb b/lib/square/types/measurement_unit_weight.rb new file mode 100644 index 000000000..076cb572a --- /dev/null +++ b/lib/square/types/measurement_unit_weight.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + module MeasurementUnitWeight + extend Square::Internal::Types::Enum + IMPERIAL_WEIGHT_OUNCE = "IMPERIAL_WEIGHT_OUNCE" + IMPERIAL_POUND = "IMPERIAL_POUND" + IMPERIAL_STONE = "IMPERIAL_STONE" + METRIC_MILLIGRAM = "METRIC_MILLIGRAM" + METRIC_GRAM = "METRIC_GRAM" + METRIC_KILOGRAM = "METRIC_KILOGRAM"end + end +end diff --git a/lib/square/types/merchant.rb b/lib/square/types/merchant.rb new file mode 100644 index 000000000..fc0a259c7 --- /dev/null +++ b/lib/square/types/merchant.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a business that sells with Square. + class Merchant < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :business_name, String, optional: true, nullable: false + field :country, Square::Types::Country, optional: false, nullable: false + field :language_code, String, optional: true, nullable: false + field :currency, Square::Types::Currency, optional: true, nullable: false + field :status, Square::Types::MerchantStatus, optional: true, nullable: false + field :main_location_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_custom_attribute_definition_owned_created_event.rb b/lib/square/types/merchant_custom_attribute_definition_owned_created_event.rb new file mode 100644 index 000000000..9f2782529 --- /dev/null +++ b/lib/square/types/merchant_custom_attribute_definition_owned_created_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) + # is created by the subscribing application. Subscribe to this event to be notified + # when your application creates a merchant custom attribute definition. + class MerchantCustomAttributeDefinitionOwnedCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_custom_attribute_definition_owned_deleted_event.rb b/lib/square/types/merchant_custom_attribute_definition_owned_deleted_event.rb new file mode 100644 index 000000000..9d9460cc3 --- /dev/null +++ b/lib/square/types/merchant_custom_attribute_definition_owned_deleted_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) + # is deleted by the subscribing application. Subscribe to this event to be notified + # when your application deletes a merchant custom attribute definition. + class MerchantCustomAttributeDefinitionOwnedDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_custom_attribute_definition_owned_updated_event.rb b/lib/square/types/merchant_custom_attribute_definition_owned_updated_event.rb new file mode 100644 index 000000000..69e82d1f1 --- /dev/null +++ b/lib/square/types/merchant_custom_attribute_definition_owned_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) + # is updated by the subscribing application. Subscribe to this event to be notified + # when your application updates a merchant custom attribute definition. + class MerchantCustomAttributeDefinitionOwnedUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_custom_attribute_definition_visible_created_event.rb b/lib/square/types/merchant_custom_attribute_definition_visible_created_event.rb new file mode 100644 index 000000000..77c6a5fe2 --- /dev/null +++ b/lib/square/types/merchant_custom_attribute_definition_visible_created_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to the subscribing application is created. A notification is sent when your application + # creates a custom attribute definition or another application creates a custom attribute definition whose + # `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + class MerchantCustomAttributeDefinitionVisibleCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_custom_attribute_definition_visible_deleted_event.rb b/lib/square/types/merchant_custom_attribute_definition_visible_deleted_event.rb new file mode 100644 index 000000000..887fa1049 --- /dev/null +++ b/lib/square/types/merchant_custom_attribute_definition_visible_deleted_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to the subscribing application is deleted. A notification is sent when your application + # deletes a custom attribute definition or another application deletes a custom attribute definition whose + # `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + class MerchantCustomAttributeDefinitionVisibleDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_custom_attribute_definition_visible_updated_event.rb b/lib/square/types/merchant_custom_attribute_definition_visible_updated_event.rb new file mode 100644 index 000000000..509959565 --- /dev/null +++ b/lib/square/types/merchant_custom_attribute_definition_visible_updated_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) + # that is visible to the subscribing application is updated. A notification is sent when your application + # updates a custom attribute definition or another application updates a custom attribute definition whose + # `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + class MerchantCustomAttributeDefinitionVisibleUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_custom_attribute_owned_deleted_event.rb b/lib/square/types/merchant_custom_attribute_owned_deleted_event.rb new file mode 100644 index 000000000..145358e9d --- /dev/null +++ b/lib/square/types/merchant_custom_attribute_owned_deleted_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant [custom attribute](entity:CustomAttribute) + # associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is + # owned by the subscribing application is deleted. Subscribe to this event to be notified + # when your application deletes a merchant custom attribute. + class MerchantCustomAttributeOwnedDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_custom_attribute_owned_updated_event.rb b/lib/square/types/merchant_custom_attribute_owned_updated_event.rb new file mode 100644 index 000000000..611d15d45 --- /dev/null +++ b/lib/square/types/merchant_custom_attribute_owned_updated_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant [custom attribute](entity:CustomAttribute) + # associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is + # owned by the subscribing application is updated. Subscribe to this event to be notified + # when your application updates a merchant custom attribute. + class MerchantCustomAttributeOwnedUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_custom_attribute_visible_deleted_event.rb b/lib/square/types/merchant_custom_attribute_visible_deleted_event.rb new file mode 100644 index 000000000..e4d3665d6 --- /dev/null +++ b/lib/square/types/merchant_custom_attribute_visible_deleted_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant [custom attribute](entity:CustomAttribute) with + # the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted. + # An application that subscribes to this event is notified when a merchant custom attribute is deleted + # by any application for which the subscribing application has read access to the merchant custom attribute. + class MerchantCustomAttributeVisibleDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_custom_attribute_visible_updated_event.rb b/lib/square/types/merchant_custom_attribute_visible_updated_event.rb new file mode 100644 index 000000000..49d67211c --- /dev/null +++ b/lib/square/types/merchant_custom_attribute_visible_updated_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant [custom attribute](entity:CustomAttribute) with + # the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated. + # An application that subscribes to this event is notified when a merchant custom attribute is updated + # by any application for which the subscribing application has read access to the merchant custom attribute. + class MerchantCustomAttributeVisibleUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_settings_updated_event.rb b/lib/square/types/merchant_settings_updated_event.rb new file mode 100644 index 000000000..63c3dc91d --- /dev/null +++ b/lib/square/types/merchant_settings_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when online checkout merchant settings are updated + class MerchantSettingsUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::MerchantSettingsUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_settings_updated_event_data.rb b/lib/square/types/merchant_settings_updated_event_data.rb new file mode 100644 index 000000000..53ba8d907 --- /dev/null +++ b/lib/square/types/merchant_settings_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class MerchantSettingsUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::MerchantSettingsUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_settings_updated_event_object.rb b/lib/square/types/merchant_settings_updated_event_object.rb new file mode 100644 index 000000000..6305573a5 --- /dev/null +++ b/lib/square/types/merchant_settings_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class MerchantSettingsUpdatedEventObject < Internal::Types::Model + field :merchant_settings, Square::Types::CheckoutMerchantSettings, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/merchant_status.rb b/lib/square/types/merchant_status.rb new file mode 100644 index 000000000..9aee39b5c --- /dev/null +++ b/lib/square/types/merchant_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module MerchantStatus + extend Square::Internal::Types::Enum + ACTIVE = "ACTIVE" + INACTIVE = "INACTIVE"end + end +end diff --git a/lib/square/types/modifier_location_overrides.rb b/lib/square/types/modifier_location_overrides.rb new file mode 100644 index 000000000..ed9a1cc96 --- /dev/null +++ b/lib/square/types/modifier_location_overrides.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Location-specific overrides for specified properties of a `CatalogModifier` object. + class ModifierLocationOverrides < Internal::Types::Model + field :location_id, String, optional: true, nullable: false + field :price_money, Square::Types::Money, optional: true, nullable: false + field :sold_out, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/money.rb b/lib/square/types/money.rb new file mode 100644 index 000000000..63ac286f2 --- /dev/null +++ b/lib/square/types/money.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class Money < Internal::Types::Model + field :amount, Integer, optional: true, nullable: false + field :currency, Square::Types::Currency, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/oauth_authorization_revoked_event.rb b/lib/square/types/oauth_authorization_revoked_event.rb new file mode 100644 index 000000000..aefce4ae2 --- /dev/null +++ b/lib/square/types/oauth_authorization_revoked_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a merchant/application revokes all access tokens and refresh tokens granted to an application. + class OauthAuthorizationRevokedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::OauthAuthorizationRevokedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/oauth_authorization_revoked_event_data.rb b/lib/square/types/oauth_authorization_revoked_event_data.rb new file mode 100644 index 000000000..3d5d21652 --- /dev/null +++ b/lib/square/types/oauth_authorization_revoked_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class OauthAuthorizationRevokedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::OauthAuthorizationRevokedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/oauth_authorization_revoked_event_object.rb b/lib/square/types/oauth_authorization_revoked_event_object.rb new file mode 100644 index 000000000..800eb407e --- /dev/null +++ b/lib/square/types/oauth_authorization_revoked_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class OauthAuthorizationRevokedEventObject < Internal::Types::Model + field :revocation, Square::Types::OauthAuthorizationRevokedEventRevocationObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/oauth_authorization_revoked_event_revocation_object.rb b/lib/square/types/oauth_authorization_revoked_event_revocation_object.rb new file mode 100644 index 000000000..ca35e0881 --- /dev/null +++ b/lib/square/types/oauth_authorization_revoked_event_revocation_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class OauthAuthorizationRevokedEventRevocationObject < Internal::Types::Model + field :revoked_at, String, optional: true, nullable: false + field :revoker_type, Square::Types::OauthAuthorizationRevokedEventRevokerType, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/oauth_authorization_revoked_event_revoker_type.rb b/lib/square/types/oauth_authorization_revoked_event_revoker_type.rb new file mode 100644 index 000000000..37b5050e8 --- /dev/null +++ b/lib/square/types/oauth_authorization_revoked_event_revoker_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module OauthAuthorizationRevokedEventRevokerType + extend Square::Internal::Types::Enum + APPLICATION = "APPLICATION" + MERCHANT = "MERCHANT" + SQUARE = "SQUARE"end + end +end diff --git a/lib/square/types/obtain_token_response.rb b/lib/square/types/obtain_token_response.rb new file mode 100644 index 000000000..3df6631ae --- /dev/null +++ b/lib/square/types/obtain_token_response.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) response. + class ObtainTokenResponse < Internal::Types::Model + field :access_token, String, optional: true, nullable: false + field :token_type, String, optional: true, nullable: false + field :expires_at, String, optional: true, nullable: false + field :merchant_id, String, optional: true, nullable: false + field :subscription_id, String, optional: true, nullable: false + field :plan_id, String, optional: true, nullable: false + field :id_token, String, optional: true, nullable: false + field :refresh_token, String, optional: true, nullable: false + field :short_lived, Internal::Types::Boolean, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :refresh_token_expires_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/offline_payment_details.rb b/lib/square/types/offline_payment_details.rb new file mode 100644 index 000000000..6128a8fe0 --- /dev/null +++ b/lib/square/types/offline_payment_details.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Details specific to offline payments. + class OfflinePaymentDetails < Internal::Types::Model + field :client_created_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order.rb b/lib/square/types/order.rb new file mode 100644 index 000000000..d3270bf8f --- /dev/null +++ b/lib/square/types/order.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class Order < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :location_id, String, optional: false, nullable: false + field :reference_id, String, optional: true, nullable: false + field :source, Square::Types::OrderSource, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :line_items, Internal::Types::Array[Square::Types::OrderLineItem], optional: true, nullable: false + field :taxes, Internal::Types::Array[Square::Types::OrderLineItemTax], optional: true, nullable: false + field :discounts, Internal::Types::Array[Square::Types::OrderLineItemDiscount], optional: true, nullable: false + field :service_charges, Internal::Types::Array[Square::Types::OrderServiceCharge], optional: true, nullable: false + field :fulfillments, Internal::Types::Array[Square::Types::Fulfillment], optional: true, nullable: false + field :returns, Internal::Types::Array[Square::Types::OrderReturn], optional: true, nullable: false + field :return_amounts, Square::Types::OrderMoneyAmounts, optional: true, nullable: false + field :net_amounts, Square::Types::OrderMoneyAmounts, optional: true, nullable: false + field :rounding_adjustment, Square::Types::OrderRoundingAdjustment, optional: true, nullable: false + field :tenders, Internal::Types::Array[Square::Types::Tender], optional: true, nullable: false + field :refunds, Internal::Types::Array[Square::Types::Refund], optional: true, nullable: false + field :metadata, Internal::Types::Hash[String, String], optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :closed_at, String, optional: true, nullable: false + field :state, Square::Types::OrderState, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :total_money, Square::Types::Money, optional: true, nullable: false + field :total_tax_money, Square::Types::Money, optional: true, nullable: false + field :total_discount_money, Square::Types::Money, optional: true, nullable: false + field :total_tip_money, Square::Types::Money, optional: true, nullable: false + field :total_service_charge_money, Square::Types::Money, optional: true, nullable: false + field :ticket_name, String, optional: true, nullable: false + field :pricing_options, Square::Types::OrderPricingOptions, optional: true, nullable: false + field :rewards, Internal::Types::Array[Square::Types::OrderReward], optional: true, nullable: false + field :net_amount_due_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_created.rb b/lib/square/types/order_created.rb new file mode 100644 index 000000000..1cfb2267c --- /dev/null +++ b/lib/square/types/order_created.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + class OrderCreated < Internal::Types::Model + field :order_id, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :state, Square::Types::OrderState, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_created_event.rb b/lib/square/types/order_created_event.rb new file mode 100644 index 000000000..60e2cbfc7 --- /dev/null +++ b/lib/square/types/order_created_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an [Order](entity:Order) is created. This event is + # triggered only by the [CreateOrder](api-endpoint:Orders-CreateOrder) endpoint call. + # + # Creating an order in the Point of Sale app will **not** publish this event. + class OrderCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::OrderCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_created_event_data.rb b/lib/square/types/order_created_event_data.rb new file mode 100644 index 000000000..70fc79fe5 --- /dev/null +++ b/lib/square/types/order_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class OrderCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::OrderCreatedObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_created_object.rb b/lib/square/types/order_created_object.rb new file mode 100644 index 000000000..6b3525643 --- /dev/null +++ b/lib/square/types/order_created_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class OrderCreatedObject < Internal::Types::Model + field :order_created, Square::Types::OrderCreated, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_custom_attribute_definition_owned_created_event.rb b/lib/square/types/order_custom_attribute_definition_owned_created_event.rb new file mode 100644 index 000000000..1f07859d4 --- /dev/null +++ b/lib/square/types/order_custom_attribute_definition_owned_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is created. + class OrderCustomAttributeDefinitionOwnedCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_custom_attribute_definition_owned_deleted_event.rb b/lib/square/types/order_custom_attribute_definition_owned_deleted_event.rb new file mode 100644 index 000000000..996524287 --- /dev/null +++ b/lib/square/types/order_custom_attribute_definition_owned_deleted_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted. + class OrderCustomAttributeDefinitionOwnedDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_custom_attribute_definition_owned_updated_event.rb b/lib/square/types/order_custom_attribute_definition_owned_updated_event.rb new file mode 100644 index 000000000..9f3c8faaf --- /dev/null +++ b/lib/square/types/order_custom_attribute_definition_owned_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated. + class OrderCustomAttributeDefinitionOwnedUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_custom_attribute_definition_visible_created_event.rb b/lib/square/types/order_custom_attribute_definition_visible_created_event.rb new file mode 100644 index 000000000..fbf3964e6 --- /dev/null +++ b/lib/square/types/order_custom_attribute_definition_visible_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is created. + class OrderCustomAttributeDefinitionVisibleCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_custom_attribute_definition_visible_deleted_event.rb b/lib/square/types/order_custom_attribute_definition_visible_deleted_event.rb new file mode 100644 index 000000000..1d9cdbe0d --- /dev/null +++ b/lib/square/types/order_custom_attribute_definition_visible_deleted_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is deleted. + class OrderCustomAttributeDefinitionVisibleDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_custom_attribute_definition_visible_updated_event.rb b/lib/square/types/order_custom_attribute_definition_visible_updated_event.rb new file mode 100644 index 000000000..1f1cb1fca --- /dev/null +++ b/lib/square/types/order_custom_attribute_definition_visible_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is updated. + class OrderCustomAttributeDefinitionVisibleUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeDefinitionEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_custom_attribute_owned_deleted_event.rb b/lib/square/types/order_custom_attribute_owned_deleted_event.rb new file mode 100644 index 000000000..584644db3 --- /dev/null +++ b/lib/square/types/order_custom_attribute_owned_deleted_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted. + class OrderCustomAttributeOwnedDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_custom_attribute_owned_updated_event.rb b/lib/square/types/order_custom_attribute_owned_updated_event.rb new file mode 100644 index 000000000..9304cd738 --- /dev/null +++ b/lib/square/types/order_custom_attribute_owned_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated. + class OrderCustomAttributeOwnedUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_custom_attribute_visible_deleted_event.rb b/lib/square/types/order_custom_attribute_visible_deleted_event.rb new file mode 100644 index 000000000..d65f70409 --- /dev/null +++ b/lib/square/types/order_custom_attribute_visible_deleted_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is deleted. + class OrderCustomAttributeVisibleDeletedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_custom_attribute_visible_updated_event.rb b/lib/square/types/order_custom_attribute_visible_updated_event.rb new file mode 100644 index 000000000..673fc67ce --- /dev/null +++ b/lib/square/types/order_custom_attribute_visible_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is updated. + class OrderCustomAttributeVisibleUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::CustomAttributeEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_entry.rb b/lib/square/types/order_entry.rb new file mode 100644 index 000000000..e47a24091 --- /dev/null +++ b/lib/square/types/order_entry.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # A lightweight description of an [order](entity:Order) that is returned when + # `returned_entries` is `true` on a [SearchOrdersRequest](api-endpoint:Orders-SearchOrders). + class OrderEntry < Internal::Types::Model + field :order_id, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_fulfillment_delivery_details_schedule_type.rb b/lib/square/types/order_fulfillment_delivery_details_schedule_type.rb new file mode 100644 index 000000000..86edd92fc --- /dev/null +++ b/lib/square/types/order_fulfillment_delivery_details_schedule_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderFulfillmentDeliveryDetailsScheduleType + extend Square::Internal::Types::Enum + SCHEDULED = "SCHEDULED" + ASAP = "ASAP"end + end +end diff --git a/lib/square/types/order_fulfillment_fulfillment_line_item_application.rb b/lib/square/types/order_fulfillment_fulfillment_line_item_application.rb new file mode 100644 index 000000000..64d27e406 --- /dev/null +++ b/lib/square/types/order_fulfillment_fulfillment_line_item_application.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderFulfillmentFulfillmentLineItemApplication + extend Square::Internal::Types::Enum + ALL = "ALL" + ENTRY_LIST = "ENTRY_LIST"end + end +end diff --git a/lib/square/types/order_fulfillment_pickup_details_schedule_type.rb b/lib/square/types/order_fulfillment_pickup_details_schedule_type.rb new file mode 100644 index 000000000..d253ec74b --- /dev/null +++ b/lib/square/types/order_fulfillment_pickup_details_schedule_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderFulfillmentPickupDetailsScheduleType + extend Square::Internal::Types::Enum + SCHEDULED = "SCHEDULED" + ASAP = "ASAP"end + end +end diff --git a/lib/square/types/order_fulfillment_state.rb b/lib/square/types/order_fulfillment_state.rb new file mode 100644 index 000000000..7fa4a7d7c --- /dev/null +++ b/lib/square/types/order_fulfillment_state.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderFulfillmentState + extend Square::Internal::Types::Enum + PROPOSED = "PROPOSED" + RESERVED = "RESERVED" + PREPARED = "PREPARED" + COMPLETED = "COMPLETED" + CANCELED = "CANCELED" + FAILED = "FAILED"end + end +end diff --git a/lib/square/types/order_fulfillment_type.rb b/lib/square/types/order_fulfillment_type.rb new file mode 100644 index 000000000..17f98f297 --- /dev/null +++ b/lib/square/types/order_fulfillment_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderFulfillmentType + extend Square::Internal::Types::Enum + PICKUP = "PICKUP" + SHIPMENT = "SHIPMENT" + DELIVERY = "DELIVERY"end + end +end diff --git a/lib/square/types/order_fulfillment_updated.rb b/lib/square/types/order_fulfillment_updated.rb new file mode 100644 index 000000000..838bc6c04 --- /dev/null +++ b/lib/square/types/order_fulfillment_updated.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + class OrderFulfillmentUpdated < Internal::Types::Model + field :order_id, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :state, Square::Types::OrderState, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :fulfillment_update, Internal::Types::Array[Square::Types::OrderFulfillmentUpdatedUpdate], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_fulfillment_updated_event.rb b/lib/square/types/order_fulfillment_updated_event.rb new file mode 100644 index 000000000..8722a1117 --- /dev/null +++ b/lib/square/types/order_fulfillment_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an [OrderFulfillment](entity:OrderFulfillment) + # is created or updated. This event is triggered only by the + # [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint call. + class OrderFulfillmentUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::OrderFulfillmentUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_fulfillment_updated_event_data.rb b/lib/square/types/order_fulfillment_updated_event_data.rb new file mode 100644 index 000000000..9991d3c16 --- /dev/null +++ b/lib/square/types/order_fulfillment_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class OrderFulfillmentUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::OrderFulfillmentUpdatedObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_fulfillment_updated_object.rb b/lib/square/types/order_fulfillment_updated_object.rb new file mode 100644 index 000000000..a4b039434 --- /dev/null +++ b/lib/square/types/order_fulfillment_updated_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class OrderFulfillmentUpdatedObject < Internal::Types::Model + field :order_fulfillment_updated, Square::Types::OrderFulfillmentUpdated, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_fulfillment_updated_update.rb b/lib/square/types/order_fulfillment_updated_update.rb new file mode 100644 index 000000000..57f85cb59 --- /dev/null +++ b/lib/square/types/order_fulfillment_updated_update.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Information about fulfillment updates. + class OrderFulfillmentUpdatedUpdate < Internal::Types::Model + field :fulfillment_uid, String, optional: true, nullable: false + field :old_state, Square::Types::FulfillmentState, optional: true, nullable: false + field :new_state, Square::Types::FulfillmentState, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item.rb b/lib/square/types/order_line_item.rb new file mode 100644 index 000000000..ce3e51da6 --- /dev/null +++ b/lib/square/types/order_line_item.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a line item in an order. Each line item describes a different + # product to purchase, with its own quantity and price details. + class OrderLineItem < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :quantity, String, optional: false, nullable: false + field :quantity_unit, Square::Types::OrderQuantityUnit, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :variation_name, String, optional: true, nullable: false + field :item_type, Square::Types::OrderLineItemItemType, optional: true, nullable: false + field :metadata, Internal::Types::Hash[String, String], optional: true, nullable: false + field :modifiers, Internal::Types::Array[Square::Types::OrderLineItemModifier], optional: true, nullable: false + field :applied_taxes, Internal::Types::Array[Square::Types::OrderLineItemAppliedTax], optional: true, nullable: false + field :applied_discounts, Internal::Types::Array[Square::Types::OrderLineItemAppliedDiscount], optional: true, nullable: false + field :applied_service_charges, Internal::Types::Array[Square::Types::OrderLineItemAppliedServiceCharge], optional: true, nullable: false + field :base_price_money, Square::Types::Money, optional: true, nullable: false + field :variation_total_price_money, Square::Types::Money, optional: true, nullable: false + field :gross_sales_money, Square::Types::Money, optional: true, nullable: false + field :total_tax_money, Square::Types::Money, optional: true, nullable: false + field :total_discount_money, Square::Types::Money, optional: true, nullable: false + field :total_money, Square::Types::Money, optional: true, nullable: false + field :pricing_blocklists, Square::Types::OrderLineItemPricingBlocklists, optional: true, nullable: false + field :total_service_charge_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item_applied_discount.rb b/lib/square/types/order_line_item_applied_discount.rb new file mode 100644 index 000000000..f0623496d --- /dev/null +++ b/lib/square/types/order_line_item_applied_discount.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class OrderLineItemAppliedDiscount < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :discount_uid, String, optional: false, nullable: false + field :applied_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item_applied_service_charge.rb b/lib/square/types/order_line_item_applied_service_charge.rb new file mode 100644 index 000000000..098535d03 --- /dev/null +++ b/lib/square/types/order_line_item_applied_service_charge.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class OrderLineItemAppliedServiceCharge < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :service_charge_uid, String, optional: false, nullable: false + field :applied_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item_applied_tax.rb b/lib/square/types/order_line_item_applied_tax.rb new file mode 100644 index 000000000..c2bd7c257 --- /dev/null +++ b/lib/square/types/order_line_item_applied_tax.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class OrderLineItemAppliedTax < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :tax_uid, String, optional: false, nullable: false + field :applied_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item_discount.rb b/lib/square/types/order_line_item_discount.rb new file mode 100644 index 000000000..d6c5c79c5 --- /dev/null +++ b/lib/square/types/order_line_item_discount.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class OrderLineItemDiscount < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :type, Square::Types::OrderLineItemDiscountType, optional: true, nullable: false + field :percentage, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :applied_money, Square::Types::Money, optional: true, nullable: false + field :metadata, Internal::Types::Hash[String, String], optional: true, nullable: false + field :scope, Square::Types::OrderLineItemDiscountScope, optional: true, nullable: false + field :reward_ids, Internal::Types::Array[String], optional: true, nullable: false + field :pricing_rule_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item_discount_scope.rb b/lib/square/types/order_line_item_discount_scope.rb new file mode 100644 index 000000000..c0c31bb6b --- /dev/null +++ b/lib/square/types/order_line_item_discount_scope.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderLineItemDiscountScope + extend Square::Internal::Types::Enum + OTHER_DISCOUNT_SCOPE = "OTHER_DISCOUNT_SCOPE" + LINE_ITEM = "LINE_ITEM" + ORDER = "ORDER"end + end +end diff --git a/lib/square/types/order_line_item_discount_type.rb b/lib/square/types/order_line_item_discount_type.rb new file mode 100644 index 000000000..17b4c846a --- /dev/null +++ b/lib/square/types/order_line_item_discount_type.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderLineItemDiscountType + extend Square::Internal::Types::Enum + UNKNOWN_DISCOUNT = "UNKNOWN_DISCOUNT" + FIXED_PERCENTAGE = "FIXED_PERCENTAGE" + FIXED_AMOUNT = "FIXED_AMOUNT" + VARIABLE_PERCENTAGE = "VARIABLE_PERCENTAGE" + VARIABLE_AMOUNT = "VARIABLE_AMOUNT"end + end +end diff --git a/lib/square/types/order_line_item_item_type.rb b/lib/square/types/order_line_item_item_type.rb new file mode 100644 index 000000000..57866021b --- /dev/null +++ b/lib/square/types/order_line_item_item_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderLineItemItemType + extend Square::Internal::Types::Enum + ITEM = "ITEM" + CUSTOM_AMOUNT = "CUSTOM_AMOUNT" + GIFT_CARD = "GIFT_CARD"end + end +end diff --git a/lib/square/types/order_line_item_modifier.rb b/lib/square/types/order_line_item_modifier.rb new file mode 100644 index 000000000..7774ce028 --- /dev/null +++ b/lib/square/types/order_line_item_modifier.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # A [CatalogModifier](entity:CatalogModifier). + class OrderLineItemModifier < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :quantity, String, optional: true, nullable: false + field :base_price_money, Square::Types::Money, optional: true, nullable: false + field :total_price_money, Square::Types::Money, optional: true, nullable: false + field :metadata, Internal::Types::Hash[String, String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item_pricing_blocklists.rb b/lib/square/types/order_line_item_pricing_blocklists.rb new file mode 100644 index 000000000..8c6c4073d --- /dev/null +++ b/lib/square/types/order_line_item_pricing_blocklists.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class OrderLineItemPricingBlocklists < Internal::Types::Model + field :blocked_discounts, Internal::Types::Array[Square::Types::OrderLineItemPricingBlocklistsBlockedDiscount], optional: true, nullable: false + field :blocked_taxes, Internal::Types::Array[Square::Types::OrderLineItemPricingBlocklistsBlockedTax], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item_pricing_blocklists_blocked_discount.rb b/lib/square/types/order_line_item_pricing_blocklists_blocked_discount.rb new file mode 100644 index 000000000..6e4b4a2eb --- /dev/null +++ b/lib/square/types/order_line_item_pricing_blocklists_blocked_discount.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class OrderLineItemPricingBlocklistsBlockedDiscount < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :discount_uid, String, optional: true, nullable: false + field :discount_catalog_object_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item_pricing_blocklists_blocked_tax.rb b/lib/square/types/order_line_item_pricing_blocklists_blocked_tax.rb new file mode 100644 index 000000000..1190f52f5 --- /dev/null +++ b/lib/square/types/order_line_item_pricing_blocklists_blocked_tax.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class OrderLineItemPricingBlocklistsBlockedTax < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :tax_uid, String, optional: true, nullable: false + field :tax_catalog_object_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item_tax.rb b/lib/square/types/order_line_item_tax.rb new file mode 100644 index 000000000..da5c83865 --- /dev/null +++ b/lib/square/types/order_line_item_tax.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class OrderLineItemTax < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :type, Square::Types::OrderLineItemTaxType, optional: true, nullable: false + field :percentage, String, optional: true, nullable: false + field :metadata, Internal::Types::Hash[String, String], optional: true, nullable: false + field :applied_money, Square::Types::Money, optional: true, nullable: false + field :scope, Square::Types::OrderLineItemTaxScope, optional: true, nullable: false + field :auto_applied, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_line_item_tax_scope.rb b/lib/square/types/order_line_item_tax_scope.rb new file mode 100644 index 000000000..61284a8e2 --- /dev/null +++ b/lib/square/types/order_line_item_tax_scope.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderLineItemTaxScope + extend Square::Internal::Types::Enum + OTHER_TAX_SCOPE = "OTHER_TAX_SCOPE" + LINE_ITEM = "LINE_ITEM" + ORDER = "ORDER"end + end +end diff --git a/lib/square/types/order_line_item_tax_type.rb b/lib/square/types/order_line_item_tax_type.rb new file mode 100644 index 000000000..5c79164e5 --- /dev/null +++ b/lib/square/types/order_line_item_tax_type.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderLineItemTaxType + extend Square::Internal::Types::Enum + UNKNOWN_TAX = "UNKNOWN_TAX" + ADDITIVE = "ADDITIVE" + INCLUSIVE = "INCLUSIVE"end + end +end diff --git a/lib/square/types/order_money_amounts.rb b/lib/square/types/order_money_amounts.rb new file mode 100644 index 000000000..b9d33edd7 --- /dev/null +++ b/lib/square/types/order_money_amounts.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # A collection of various money amounts. + class OrderMoneyAmounts < Internal::Types::Model + field :total_money, Square::Types::Money, optional: true, nullable: false + field :tax_money, Square::Types::Money, optional: true, nullable: false + field :discount_money, Square::Types::Money, optional: true, nullable: false + field :tip_money, Square::Types::Money, optional: true, nullable: false + field :service_charge_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_pricing_options.rb b/lib/square/types/order_pricing_options.rb new file mode 100644 index 000000000..96c81bff4 --- /dev/null +++ b/lib/square/types/order_pricing_options.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Pricing options for an order. The options affect how the order's price is calculated. + # They can be used, for example, to apply automatic price adjustments that are based on preconfigured + # [pricing rules](entity:CatalogPricingRule). + class OrderPricingOptions < Internal::Types::Model + field :auto_apply_discounts, Internal::Types::Boolean, optional: true, nullable: false + field :auto_apply_taxes, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_quantity_unit.rb b/lib/square/types/order_quantity_unit.rb new file mode 100644 index 000000000..6c96efb8f --- /dev/null +++ b/lib/square/types/order_quantity_unit.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Contains the measurement unit for a quantity and a precision that + # specifies the number of digits after the decimal point for decimal quantities. + class OrderQuantityUnit < Internal::Types::Model + field :measurement_unit, Square::Types::MeasurementUnit, optional: true, nullable: false + field :precision, Integer, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_return.rb b/lib/square/types/order_return.rb new file mode 100644 index 000000000..cd31dd22d --- /dev/null +++ b/lib/square/types/order_return.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order. + class OrderReturn < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :source_order_id, String, optional: true, nullable: false + field :return_line_items, Internal::Types::Array[Square::Types::OrderReturnLineItem], optional: true, nullable: false + field :return_service_charges, Internal::Types::Array[Square::Types::OrderReturnServiceCharge], optional: true, nullable: false + field :return_taxes, Internal::Types::Array[Square::Types::OrderReturnTax], optional: true, nullable: false + field :return_discounts, Internal::Types::Array[Square::Types::OrderReturnDiscount], optional: true, nullable: false + field :return_tips, Internal::Types::Array[Square::Types::OrderReturnTip], optional: true, nullable: false + field :rounding_adjustment, Square::Types::OrderRoundingAdjustment, optional: true, nullable: false + field :return_amounts, Square::Types::OrderMoneyAmounts, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_return_discount.rb b/lib/square/types/order_return_discount.rb new file mode 100644 index 000000000..891d6ff91 --- /dev/null +++ b/lib/square/types/order_return_discount.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class OrderReturnDiscount < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :source_discount_uid, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :type, Square::Types::OrderLineItemDiscountType, optional: true, nullable: false + field :percentage, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :applied_money, Square::Types::Money, optional: true, nullable: false + field :scope, Square::Types::OrderLineItemDiscountScope, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_return_line_item.rb b/lib/square/types/order_return_line_item.rb new file mode 100644 index 000000000..0f8efe0e5 --- /dev/null +++ b/lib/square/types/order_return_line_item.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Square + module Types + # The line item being returned in an order. + class OrderReturnLineItem < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :source_line_item_uid, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :quantity, String, optional: false, nullable: false + field :quantity_unit, Square::Types::OrderQuantityUnit, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :variation_name, String, optional: true, nullable: false + field :item_type, Square::Types::OrderLineItemItemType, optional: true, nullable: false + field :return_modifiers, Internal::Types::Array[Square::Types::OrderReturnLineItemModifier], optional: true, nullable: false + field :applied_taxes, Internal::Types::Array[Square::Types::OrderLineItemAppliedTax], optional: true, nullable: false + field :applied_discounts, Internal::Types::Array[Square::Types::OrderLineItemAppliedDiscount], optional: true, nullable: false + field :base_price_money, Square::Types::Money, optional: true, nullable: false + field :variation_total_price_money, Square::Types::Money, optional: true, nullable: false + field :gross_return_money, Square::Types::Money, optional: true, nullable: false + field :total_tax_money, Square::Types::Money, optional: true, nullable: false + field :total_discount_money, Square::Types::Money, optional: true, nullable: false + field :total_money, Square::Types::Money, optional: true, nullable: false + field :applied_service_charges, Internal::Types::Array[Square::Types::OrderLineItemAppliedServiceCharge], optional: true, nullable: false + field :total_service_charge_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_return_line_item_modifier.rb b/lib/square/types/order_return_line_item_modifier.rb new file mode 100644 index 000000000..09717d034 --- /dev/null +++ b/lib/square/types/order_return_line_item_modifier.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # A line item modifier being returned. + class OrderReturnLineItemModifier < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :source_modifier_uid, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :base_price_money, Square::Types::Money, optional: true, nullable: false + field :total_price_money, Square::Types::Money, optional: true, nullable: false + field :quantity, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_return_service_charge.rb b/lib/square/types/order_return_service_charge.rb new file mode 100644 index 000000000..111ba8859 --- /dev/null +++ b/lib/square/types/order_return_service_charge.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the service charge applied to the original order. + class OrderReturnServiceCharge < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :source_service_charge_uid, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :percentage, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :applied_money, Square::Types::Money, optional: true, nullable: false + field :total_money, Square::Types::Money, optional: true, nullable: false + field :total_tax_money, Square::Types::Money, optional: true, nullable: false + field :calculation_phase, Square::Types::OrderServiceChargeCalculationPhase, optional: true, nullable: false + field :taxable, Internal::Types::Boolean, optional: true, nullable: false + field :applied_taxes, Internal::Types::Array[Square::Types::OrderLineItemAppliedTax], optional: true, nullable: false + field :treatment_type, Square::Types::OrderServiceChargeTreatmentType, optional: true, nullable: false + field :scope, Square::Types::OrderServiceChargeScope, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_return_tax.rb b/lib/square/types/order_return_tax.rb new file mode 100644 index 000000000..d6504da65 --- /dev/null +++ b/lib/square/types/order_return_tax.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class OrderReturnTax < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :source_tax_uid, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :type, Square::Types::OrderLineItemTaxType, optional: true, nullable: false + field :percentage, String, optional: true, nullable: false + field :applied_money, Square::Types::Money, optional: true, nullable: false + field :scope, Square::Types::OrderLineItemTaxScope, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_return_tip.rb b/lib/square/types/order_return_tip.rb new file mode 100644 index 000000000..8ae66ebac --- /dev/null +++ b/lib/square/types/order_return_tip.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # A tip being returned. + class OrderReturnTip < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :applied_money, Square::Types::Money, optional: true, nullable: false + field :source_tender_uid, String, optional: true, nullable: false + field :source_tender_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_reward.rb b/lib/square/types/order_reward.rb new file mode 100644 index 000000000..a0537da73 --- /dev/null +++ b/lib/square/types/order_reward.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class OrderReward < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :reward_tier_id, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/order_rounding_adjustment.rb b/lib/square/types/order_rounding_adjustment.rb new file mode 100644 index 000000000..3a0874fc0 --- /dev/null +++ b/lib/square/types/order_rounding_adjustment.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class OrderRoundingAdjustment < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_service_charge.rb b/lib/square/types/order_service_charge.rb new file mode 100644 index 000000000..ba5ca226f --- /dev/null +++ b/lib/square/types/order_service_charge.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a service charge applied to an order. + class OrderServiceCharge < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :catalog_object_id, String, optional: true, nullable: false + field :catalog_version, Integer, optional: true, nullable: false + field :percentage, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :applied_money, Square::Types::Money, optional: true, nullable: false + field :total_money, Square::Types::Money, optional: true, nullable: false + field :total_tax_money, Square::Types::Money, optional: true, nullable: false + field :calculation_phase, Square::Types::OrderServiceChargeCalculationPhase, optional: true, nullable: false + field :taxable, Internal::Types::Boolean, optional: true, nullable: false + field :applied_taxes, Internal::Types::Array[Square::Types::OrderLineItemAppliedTax], optional: true, nullable: false + field :metadata, Internal::Types::Hash[String, String], optional: true, nullable: false + field :type, Square::Types::OrderServiceChargeType, optional: true, nullable: false + field :treatment_type, Square::Types::OrderServiceChargeTreatmentType, optional: true, nullable: false + field :scope, Square::Types::OrderServiceChargeScope, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_service_charge_calculation_phase.rb b/lib/square/types/order_service_charge_calculation_phase.rb new file mode 100644 index 000000000..fba711e7a --- /dev/null +++ b/lib/square/types/order_service_charge_calculation_phase.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderServiceChargeCalculationPhase + extend Square::Internal::Types::Enum + SUBTOTAL_PHASE = "SUBTOTAL_PHASE" + TOTAL_PHASE = "TOTAL_PHASE" + APPORTIONED_PERCENTAGE_PHASE = "APPORTIONED_PERCENTAGE_PHASE" + APPORTIONED_AMOUNT_PHASE = "APPORTIONED_AMOUNT_PHASE"end + end +end diff --git a/lib/square/types/order_service_charge_scope.rb b/lib/square/types/order_service_charge_scope.rb new file mode 100644 index 000000000..e48c83205 --- /dev/null +++ b/lib/square/types/order_service_charge_scope.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderServiceChargeScope + extend Square::Internal::Types::Enum + OTHER_SERVICE_CHARGE_SCOPE = "OTHER_SERVICE_CHARGE_SCOPE" + LINE_ITEM = "LINE_ITEM" + ORDER = "ORDER"end + end +end diff --git a/lib/square/types/order_service_charge_treatment_type.rb b/lib/square/types/order_service_charge_treatment_type.rb new file mode 100644 index 000000000..2a815fca7 --- /dev/null +++ b/lib/square/types/order_service_charge_treatment_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderServiceChargeTreatmentType + extend Square::Internal::Types::Enum + LINE_ITEM_TREATMENT = "LINE_ITEM_TREATMENT" + APPORTIONED_TREATMENT = "APPORTIONED_TREATMENT"end + end +end diff --git a/lib/square/types/order_service_charge_type.rb b/lib/square/types/order_service_charge_type.rb new file mode 100644 index 000000000..e8b3d7aef --- /dev/null +++ b/lib/square/types/order_service_charge_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderServiceChargeType + extend Square::Internal::Types::Enum + AUTO_GRATUITY = "AUTO_GRATUITY" + CUSTOM = "CUSTOM"end + end +end diff --git a/lib/square/types/order_source.rb b/lib/square/types/order_source.rb new file mode 100644 index 000000000..f4a56f768 --- /dev/null +++ b/lib/square/types/order_source.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the origination details of an order. + class OrderSource < Internal::Types::Model + field :name, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_state.rb b/lib/square/types/order_state.rb new file mode 100644 index 000000000..8253bd936 --- /dev/null +++ b/lib/square/types/order_state.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module OrderState + extend Square::Internal::Types::Enum + OPEN = "OPEN" + COMPLETED = "COMPLETED" + CANCELED = "CANCELED" + DRAFT = "DRAFT"end + end +end diff --git a/lib/square/types/order_updated.rb b/lib/square/types/order_updated.rb new file mode 100644 index 000000000..abe5b1672 --- /dev/null +++ b/lib/square/types/order_updated.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + class OrderUpdated < Internal::Types::Model + field :order_id, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :state, Square::Types::OrderState, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_updated_event.rb b/lib/square/types/order_updated_event.rb new file mode 100644 index 000000000..25c380208 --- /dev/null +++ b/lib/square/types/order_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when an [Order](entity:Order) is updated. This + # event is triggered by the [UpdateOrder](api-endpoint:Orders-UpdateOrder) + # endpoint call, Order Manager, or the Square Dashboard. + class OrderUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::OrderUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_updated_event_data.rb b/lib/square/types/order_updated_event_data.rb new file mode 100644 index 000000000..2c0876e36 --- /dev/null +++ b/lib/square/types/order_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class OrderUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::OrderUpdatedObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/order_updated_object.rb b/lib/square/types/order_updated_object.rb new file mode 100644 index 000000000..b93ff3e20 --- /dev/null +++ b/lib/square/types/order_updated_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class OrderUpdatedObject < Internal::Types::Model + field :order_updated, Square::Types::OrderUpdated, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/pause_subscription_response.rb b/lib/square/types/pause_subscription_response.rb new file mode 100644 index 000000000..cc8228cf2 --- /dev/null +++ b/lib/square/types/pause_subscription_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response from the + # [PauseSubscription](api-endpoint:Subscriptions-PauseSubscription) endpoint. + class PauseSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::Subscription, optional: true, nullable: false + field :actions, Internal::Types::Array[Square::Types::SubscriptionAction], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/pay_order_response.rb b/lib/square/types/pay_order_response.rb new file mode 100644 index 000000000..247867fcb --- /dev/null +++ b/lib/square/types/pay_order_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of a request to the + # [PayOrder](api-endpoint:Orders-PayOrder) endpoint. + class PayOrderResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :order, Square::Types::Order, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment.rb b/lib/square/types/payment.rb new file mode 100644 index 000000000..086e66636 --- /dev/null +++ b/lib/square/types/payment.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a payment processed by the Square API. + class Payment < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :tip_money, Square::Types::Money, optional: true, nullable: false + field :total_money, Square::Types::Money, optional: true, nullable: false + field :app_fee_money, Square::Types::Money, optional: true, nullable: false + field :approved_money, Square::Types::Money, optional: true, nullable: false + field :processing_fee, Internal::Types::Array[Square::Types::ProcessingFee], optional: true, nullable: false + field :refunded_money, Square::Types::Money, optional: true, nullable: false + field :status, String, optional: true, nullable: false + field :delay_duration, String, optional: true, nullable: false + field :delay_action, String, optional: true, nullable: false + field :delayed_until, String, optional: true, nullable: false + field :source_type, String, optional: true, nullable: false + field :card_details, Square::Types::CardPaymentDetails, optional: true, nullable: false + field :cash_details, Square::Types::CashPaymentDetails, optional: true, nullable: false + field :bank_account_details, Square::Types::BankAccountPaymentDetails, optional: true, nullable: false + field :external_details, Square::Types::ExternalPaymentDetails, optional: true, nullable: false + field :wallet_details, Square::Types::DigitalWalletDetails, optional: true, nullable: false + field :buy_now_pay_later_details, Square::Types::BuyNowPayLaterDetails, optional: true, nullable: false + field :square_account_details, Square::Types::SquareAccountDetails, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :employee_id, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :refund_ids, Internal::Types::Array[String], optional: true, nullable: false + field :risk_evaluation, Square::Types::RiskEvaluation, optional: true, nullable: false + field :terminal_checkout_id, String, optional: true, nullable: false + field :buyer_email_address, String, optional: true, nullable: false + field :billing_address, Square::Types::Address, optional: true, nullable: false + field :shipping_address, Square::Types::Address, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :statement_description_identifier, String, optional: true, nullable: false + field :capabilities, Internal::Types::Array[String], optional: true, nullable: false + field :receipt_number, String, optional: true, nullable: false + field :receipt_url, String, optional: true, nullable: false + field :device_details, Square::Types::DeviceDetails, optional: true, nullable: false + field :application_details, Square::Types::ApplicationDetails, optional: true, nullable: false + field :is_offline_payment, Internal::Types::Boolean, optional: true, nullable: false + field :offline_payment_details, Square::Types::OfflinePaymentDetails, optional: true, nullable: false + field :version_token, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_app_fee_refund_detail.rb b/lib/square/types/payment_balance_activity_app_fee_refund_detail.rb new file mode 100644 index 000000000..e16125aef --- /dev/null +++ b/lib/square/types/payment_balance_activity_app_fee_refund_detail.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityAppFeeRefundDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + field :refund_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_app_fee_revenue_detail.rb b/lib/square/types/payment_balance_activity_app_fee_revenue_detail.rb new file mode 100644 index 000000000..2437e5e39 --- /dev/null +++ b/lib/square/types/payment_balance_activity_app_fee_revenue_detail.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityAppFeeRevenueDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_automatic_savings_detail.rb b/lib/square/types/payment_balance_activity_automatic_savings_detail.rb new file mode 100644 index 000000000..1d8a80cae --- /dev/null +++ b/lib/square/types/payment_balance_activity_automatic_savings_detail.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityAutomaticSavingsDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + field :payout_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_automatic_savings_reversed_detail.rb b/lib/square/types/payment_balance_activity_automatic_savings_reversed_detail.rb new file mode 100644 index 000000000..1481f7a30 --- /dev/null +++ b/lib/square/types/payment_balance_activity_automatic_savings_reversed_detail.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityAutomaticSavingsReversedDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + field :payout_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_charge_detail.rb b/lib/square/types/payment_balance_activity_charge_detail.rb new file mode 100644 index 000000000..380af0fdb --- /dev/null +++ b/lib/square/types/payment_balance_activity_charge_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityChargeDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_deposit_fee_detail.rb b/lib/square/types/payment_balance_activity_deposit_fee_detail.rb new file mode 100644 index 000000000..d343ee840 --- /dev/null +++ b/lib/square/types/payment_balance_activity_deposit_fee_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityDepositFeeDetail < Internal::Types::Model + field :payout_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_deposit_fee_reversed_detail.rb b/lib/square/types/payment_balance_activity_deposit_fee_reversed_detail.rb new file mode 100644 index 000000000..460c76246 --- /dev/null +++ b/lib/square/types/payment_balance_activity_deposit_fee_reversed_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityDepositFeeReversedDetail < Internal::Types::Model + field :payout_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_dispute_detail.rb b/lib/square/types/payment_balance_activity_dispute_detail.rb new file mode 100644 index 000000000..cb0e9d02d --- /dev/null +++ b/lib/square/types/payment_balance_activity_dispute_detail.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityDisputeDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + field :dispute_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_fee_detail.rb b/lib/square/types/payment_balance_activity_fee_detail.rb new file mode 100644 index 000000000..bea0b12c2 --- /dev/null +++ b/lib/square/types/payment_balance_activity_fee_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityFeeDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_free_processing_detail.rb b/lib/square/types/payment_balance_activity_free_processing_detail.rb new file mode 100644 index 000000000..17f117c32 --- /dev/null +++ b/lib/square/types/payment_balance_activity_free_processing_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityFreeProcessingDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_hold_adjustment_detail.rb b/lib/square/types/payment_balance_activity_hold_adjustment_detail.rb new file mode 100644 index 000000000..f3c0f3b8e --- /dev/null +++ b/lib/square/types/payment_balance_activity_hold_adjustment_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityHoldAdjustmentDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_open_dispute_detail.rb b/lib/square/types/payment_balance_activity_open_dispute_detail.rb new file mode 100644 index 000000000..1b6bef85c --- /dev/null +++ b/lib/square/types/payment_balance_activity_open_dispute_detail.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityOpenDisputeDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + field :dispute_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_other_adjustment_detail.rb b/lib/square/types/payment_balance_activity_other_adjustment_detail.rb new file mode 100644 index 000000000..f685d9621 --- /dev/null +++ b/lib/square/types/payment_balance_activity_other_adjustment_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityOtherAdjustmentDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_other_detail.rb b/lib/square/types/payment_balance_activity_other_detail.rb new file mode 100644 index 000000000..48755e44a --- /dev/null +++ b/lib/square/types/payment_balance_activity_other_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityOtherDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_refund_detail.rb b/lib/square/types/payment_balance_activity_refund_detail.rb new file mode 100644 index 000000000..d34f5e988 --- /dev/null +++ b/lib/square/types/payment_balance_activity_refund_detail.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityRefundDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + field :refund_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_release_adjustment_detail.rb b/lib/square/types/payment_balance_activity_release_adjustment_detail.rb new file mode 100644 index 000000000..2b9aa48ff --- /dev/null +++ b/lib/square/types/payment_balance_activity_release_adjustment_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityReleaseAdjustmentDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_reserve_hold_detail.rb b/lib/square/types/payment_balance_activity_reserve_hold_detail.rb new file mode 100644 index 000000000..91b09b0f5 --- /dev/null +++ b/lib/square/types/payment_balance_activity_reserve_hold_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityReserveHoldDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_reserve_release_detail.rb b/lib/square/types/payment_balance_activity_reserve_release_detail.rb new file mode 100644 index 000000000..17fe9f976 --- /dev/null +++ b/lib/square/types/payment_balance_activity_reserve_release_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityReserveReleaseDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_square_capital_payment_detail.rb b/lib/square/types/payment_balance_activity_square_capital_payment_detail.rb new file mode 100644 index 000000000..bea87c205 --- /dev/null +++ b/lib/square/types/payment_balance_activity_square_capital_payment_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivitySquareCapitalPaymentDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_square_capital_reversed_payment_detail.rb b/lib/square/types/payment_balance_activity_square_capital_reversed_payment_detail.rb new file mode 100644 index 000000000..261e89f81 --- /dev/null +++ b/lib/square/types/payment_balance_activity_square_capital_reversed_payment_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivitySquareCapitalReversedPaymentDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_square_payroll_transfer_detail.rb b/lib/square/types/payment_balance_activity_square_payroll_transfer_detail.rb new file mode 100644 index 000000000..ff1328c1d --- /dev/null +++ b/lib/square/types/payment_balance_activity_square_payroll_transfer_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivitySquarePayrollTransferDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_square_payroll_transfer_reversed_detail.rb b/lib/square/types/payment_balance_activity_square_payroll_transfer_reversed_detail.rb new file mode 100644 index 000000000..796ae9bf4 --- /dev/null +++ b/lib/square/types/payment_balance_activity_square_payroll_transfer_reversed_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivitySquarePayrollTransferReversedDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_tax_on_fee_detail.rb b/lib/square/types/payment_balance_activity_tax_on_fee_detail.rb new file mode 100644 index 000000000..f85d587cb --- /dev/null +++ b/lib/square/types/payment_balance_activity_tax_on_fee_detail.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityTaxOnFeeDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + field :tax_rate_description, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_third_party_fee_detail.rb b/lib/square/types/payment_balance_activity_third_party_fee_detail.rb new file mode 100644 index 000000000..c087203d6 --- /dev/null +++ b/lib/square/types/payment_balance_activity_third_party_fee_detail.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityThirdPartyFeeDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_balance_activity_third_party_fee_refund_detail.rb b/lib/square/types/payment_balance_activity_third_party_fee_refund_detail.rb new file mode 100644 index 000000000..2c394d6a0 --- /dev/null +++ b/lib/square/types/payment_balance_activity_third_party_fee_refund_detail.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentBalanceActivityThirdPartyFeeRefundDetail < Internal::Types::Model + field :payment_id, String, optional: true, nullable: false + field :refund_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_created_event.rb b/lib/square/types/payment_created_event.rb new file mode 100644 index 000000000..793352479 --- /dev/null +++ b/lib/square/types/payment_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Payment](entity:Payment) is created. + class PaymentCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::PaymentCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_created_event_data.rb b/lib/square/types/payment_created_event_data.rb new file mode 100644 index 000000000..8785b2149 --- /dev/null +++ b/lib/square/types/payment_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::PaymentCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_created_event_object.rb b/lib/square/types/payment_created_event_object.rb new file mode 100644 index 000000000..bdaaa3931 --- /dev/null +++ b/lib/square/types/payment_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentCreatedEventObject < Internal::Types::Model + field :payment, Square::Types::Payment, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_link.rb b/lib/square/types/payment_link.rb new file mode 100644 index 000000000..3da35e980 --- /dev/null +++ b/lib/square/types/payment_link.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentLink < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :version, Integer, optional: false, nullable: false + field :description, String, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + field :checkout_options, Square::Types::CheckoutOptions, optional: true, nullable: false + field :pre_populated_data, Square::Types::PrePopulatedData, optional: true, nullable: false + field :url, String, optional: true, nullable: false + field :long_url, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :payment_note, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_link_related_resources.rb b/lib/square/types/payment_link_related_resources.rb new file mode 100644 index 000000000..037f7eea1 --- /dev/null +++ b/lib/square/types/payment_link_related_resources.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentLinkRelatedResources < Internal::Types::Model + field :orders, Internal::Types::Array[Square::Types::Order], optional: true, nullable: false + field :subscription_plans, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_options.rb b/lib/square/types/payment_options.rb new file mode 100644 index 000000000..c073acd90 --- /dev/null +++ b/lib/square/types/payment_options.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentOptions < Internal::Types::Model + field :autocomplete, Internal::Types::Boolean, optional: true, nullable: false + field :delay_duration, String, optional: true, nullable: false + field :accept_partial_authorization, Internal::Types::Boolean, optional: true, nullable: false + field :delay_action, Square::Types::PaymentOptionsDelayAction, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_options_delay_action.rb b/lib/square/types/payment_options_delay_action.rb new file mode 100644 index 000000000..6c949d85c --- /dev/null +++ b/lib/square/types/payment_options_delay_action.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module PaymentOptionsDelayAction + extend Square::Internal::Types::Enum + CANCEL = "CANCEL" + COMPLETE = "COMPLETE"end + end +end diff --git a/lib/square/types/payment_refund.rb b/lib/square/types/payment_refund.rb new file mode 100644 index 000000000..1d6da42b5 --- /dev/null +++ b/lib/square/types/payment_refund.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a refund of a payment made using Square. Contains information about + # the original payment and the amount of money refunded. + class PaymentRefund < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :status, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :unlinked, Internal::Types::Boolean, optional: true, nullable: false + field :destination_type, String, optional: true, nullable: false + field :destination_details, Square::Types::DestinationDetails, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :app_fee_money, Square::Types::Money, optional: true, nullable: false + field :processing_fee, Internal::Types::Array[Square::Types::ProcessingFee], optional: true, nullable: false + field :payment_id, String, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + field :reason, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :terminal_refund_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_updated_event.rb b/lib/square/types/payment_updated_event.rb new file mode 100644 index 000000000..e9a4cfb22 --- /dev/null +++ b/lib/square/types/payment_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Payment](entity:Payment) is updated. + # Typically the `payment.status`, or `card_details.status` fields are updated + # as a payment is canceled, authorized, or completed. + class PaymentUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::PaymentUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_updated_event_data.rb b/lib/square/types/payment_updated_event_data.rb new file mode 100644 index 000000000..62f759f24 --- /dev/null +++ b/lib/square/types/payment_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::PaymentUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payment_updated_event_object.rb b/lib/square/types/payment_updated_event_object.rb new file mode 100644 index 000000000..6167d7eb5 --- /dev/null +++ b/lib/square/types/payment_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PaymentUpdatedEventObject < Internal::Types::Model + field :payment, Square::Types::Payment, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout.rb b/lib/square/types/payout.rb new file mode 100644 index 000000000..2126b9d4b --- /dev/null +++ b/lib/square/types/payout.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Square + module Types + # An accounting of the amount owed the seller and record of the actual transfer to their + # external bank account or to the Square balance. + class Payout < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :status, Square::Types::PayoutStatus, optional: true, nullable: false + field :location_id, String, optional: false, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :destination, Square::Types::Destination, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :type, Square::Types::PayoutType, optional: true, nullable: false + field :payout_fee, Internal::Types::Array[Square::Types::PayoutFee], optional: true, nullable: false + field :arrival_date, String, optional: true, nullable: false + field :end_to_end_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_entry.rb b/lib/square/types/payout_entry.rb new file mode 100644 index 000000000..b3b922df1 --- /dev/null +++ b/lib/square/types/payout_entry.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Square + module Types + # 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 + class PayoutEntry < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :payout_id, String, optional: false, nullable: false + field :effective_at, String, optional: true, nullable: false + field :type, Square::Types::ActivityType, optional: true, nullable: false + field :gross_amount_money, Square::Types::Money, optional: true, nullable: false + field :fee_amount_money, Square::Types::Money, optional: true, nullable: false + field :net_amount_money, Square::Types::Money, optional: true, nullable: false + field :type_app_fee_revenue_details, Square::Types::PaymentBalanceActivityAppFeeRevenueDetail, optional: true, nullable: false + field :type_app_fee_refund_details, Square::Types::PaymentBalanceActivityAppFeeRefundDetail, optional: true, nullable: false + field :type_automatic_savings_details, Square::Types::PaymentBalanceActivityAutomaticSavingsDetail, optional: true, nullable: false + field :type_automatic_savings_reversed_details, Square::Types::PaymentBalanceActivityAutomaticSavingsReversedDetail, optional: true, nullable: false + field :type_charge_details, Square::Types::PaymentBalanceActivityChargeDetail, optional: true, nullable: false + field :type_deposit_fee_details, Square::Types::PaymentBalanceActivityDepositFeeDetail, optional: true, nullable: false + field :type_deposit_fee_reversed_details, Square::Types::PaymentBalanceActivityDepositFeeReversedDetail, optional: true, nullable: false + field :type_dispute_details, Square::Types::PaymentBalanceActivityDisputeDetail, optional: true, nullable: false + field :type_fee_details, Square::Types::PaymentBalanceActivityFeeDetail, optional: true, nullable: false + field :type_free_processing_details, Square::Types::PaymentBalanceActivityFreeProcessingDetail, optional: true, nullable: false + field :type_hold_adjustment_details, Square::Types::PaymentBalanceActivityHoldAdjustmentDetail, optional: true, nullable: false + field :type_open_dispute_details, Square::Types::PaymentBalanceActivityOpenDisputeDetail, optional: true, nullable: false + field :type_other_details, Square::Types::PaymentBalanceActivityOtherDetail, optional: true, nullable: false + field :type_other_adjustment_details, Square::Types::PaymentBalanceActivityOtherAdjustmentDetail, optional: true, nullable: false + field :type_refund_details, Square::Types::PaymentBalanceActivityRefundDetail, optional: true, nullable: false + field :type_release_adjustment_details, Square::Types::PaymentBalanceActivityReleaseAdjustmentDetail, optional: true, nullable: false + field :type_reserve_hold_details, Square::Types::PaymentBalanceActivityReserveHoldDetail, optional: true, nullable: false + field :type_reserve_release_details, Square::Types::PaymentBalanceActivityReserveReleaseDetail, optional: true, nullable: false + field :type_square_capital_payment_details, Square::Types::PaymentBalanceActivitySquareCapitalPaymentDetail, optional: true, nullable: false + field :type_square_capital_reversed_payment_details, Square::Types::PaymentBalanceActivitySquareCapitalReversedPaymentDetail, optional: true, nullable: false + field :type_tax_on_fee_details, Square::Types::PaymentBalanceActivityTaxOnFeeDetail, optional: true, nullable: false + field :type_third_party_fee_details, Square::Types::PaymentBalanceActivityThirdPartyFeeDetail, optional: true, nullable: false + field :type_third_party_fee_refund_details, Square::Types::PaymentBalanceActivityThirdPartyFeeRefundDetail, optional: true, nullable: false + field :type_square_payroll_transfer_details, Square::Types::PaymentBalanceActivitySquarePayrollTransferDetail, optional: true, nullable: false + field :type_square_payroll_transfer_reversed_details, Square::Types::PaymentBalanceActivitySquarePayrollTransferReversedDetail, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_failed_event.rb b/lib/square/types/payout_failed_event.rb new file mode 100644 index 000000000..b20fec69d --- /dev/null +++ b/lib/square/types/payout_failed_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Payout](entity:Payout) has failed. + class PayoutFailedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::PayoutFailedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_failed_event_data.rb b/lib/square/types/payout_failed_event_data.rb new file mode 100644 index 000000000..388c9afe5 --- /dev/null +++ b/lib/square/types/payout_failed_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class PayoutFailedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::PayoutFailedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_failed_event_object.rb b/lib/square/types/payout_failed_event_object.rb new file mode 100644 index 000000000..4659fd1e2 --- /dev/null +++ b/lib/square/types/payout_failed_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PayoutFailedEventObject < Internal::Types::Model + field :payout, Square::Types::Payout, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_fee.rb b/lib/square/types/payout_fee.rb new file mode 100644 index 000000000..7b5a94c50 --- /dev/null +++ b/lib/square/types/payout_fee.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a payout fee that can incur as part of a payout. + class PayoutFee < Internal::Types::Model + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :effective_at, String, optional: true, nullable: false + field :type, Square::Types::PayoutFeeType, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_fee_type.rb b/lib/square/types/payout_fee_type.rb new file mode 100644 index 000000000..60222f4dd --- /dev/null +++ b/lib/square/types/payout_fee_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module PayoutFeeType + extend Square::Internal::Types::Enum + TRANSFER_FEE = "TRANSFER_FEE" + TAX_ON_TRANSFER_FEE = "TAX_ON_TRANSFER_FEE"end + end +end diff --git a/lib/square/types/payout_paid_event.rb b/lib/square/types/payout_paid_event.rb new file mode 100644 index 000000000..0f4cdc919 --- /dev/null +++ b/lib/square/types/payout_paid_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Payout](entity:Payout) is complete. + class PayoutPaidEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::PayoutPaidEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_paid_event_data.rb b/lib/square/types/payout_paid_event_data.rb new file mode 100644 index 000000000..acaeffa46 --- /dev/null +++ b/lib/square/types/payout_paid_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class PayoutPaidEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::PayoutPaidEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_paid_event_object.rb b/lib/square/types/payout_paid_event_object.rb new file mode 100644 index 000000000..5142db2b6 --- /dev/null +++ b/lib/square/types/payout_paid_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PayoutPaidEventObject < Internal::Types::Model + field :payout, Square::Types::Payout, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_sent_event.rb b/lib/square/types/payout_sent_event.rb new file mode 100644 index 000000000..8e213f77c --- /dev/null +++ b/lib/square/types/payout_sent_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Payout](entity:Payout) is sent. + class PayoutSentEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::PayoutSentEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_sent_event_data.rb b/lib/square/types/payout_sent_event_data.rb new file mode 100644 index 000000000..b6858c663 --- /dev/null +++ b/lib/square/types/payout_sent_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class PayoutSentEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::PayoutSentEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_sent_event_object.rb b/lib/square/types/payout_sent_event_object.rb new file mode 100644 index 000000000..a59f29b3f --- /dev/null +++ b/lib/square/types/payout_sent_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class PayoutSentEventObject < Internal::Types::Model + field :payout, Square::Types::Payout, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/payout_status.rb b/lib/square/types/payout_status.rb new file mode 100644 index 000000000..a2c9e93bb --- /dev/null +++ b/lib/square/types/payout_status.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module PayoutStatus + extend Square::Internal::Types::Enum + SENT = "SENT" + FAILED = "FAILED" + PAID = "PAID"end + end +end diff --git a/lib/square/types/payout_type.rb b/lib/square/types/payout_type.rb new file mode 100644 index 000000000..74d779482 --- /dev/null +++ b/lib/square/types/payout_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module PayoutType + extend Square::Internal::Types::Enum + BATCH = "BATCH" + SIMPLE = "SIMPLE"end + end +end diff --git a/lib/square/types/phase.rb b/lib/square/types/phase.rb new file mode 100644 index 000000000..8028b6014 --- /dev/null +++ b/lib/square/types/phase.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a phase, which can override subscription phases as defined by plan_id + class Phase < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :ordinal, Integer, optional: true, nullable: false + field :order_template_id, String, optional: true, nullable: false + field :plan_phase_uid, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/phase_input.rb b/lib/square/types/phase_input.rb new file mode 100644 index 000000000..89bc72ce1 --- /dev/null +++ b/lib/square/types/phase_input.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the arguments used to construct a new phase. + class PhaseInput < Internal::Types::Model + field :ordinal, Integer, optional: false, nullable: false + field :order_template_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/pre_populated_data.rb b/lib/square/types/pre_populated_data.rb new file mode 100644 index 000000000..6f66a5134 --- /dev/null +++ b/lib/square/types/pre_populated_data.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class PrePopulatedData < Internal::Types::Model + field :buyer_email, String, optional: true, nullable: false + field :buyer_phone_number, String, optional: true, nullable: false + field :buyer_address, Square::Types::Address, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/processing_fee.rb b/lib/square/types/processing_fee.rb new file mode 100644 index 000000000..c3d76eeee --- /dev/null +++ b/lib/square/types/processing_fee.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the Square processing fee. + class ProcessingFee < Internal::Types::Model + field :effective_at, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/product.rb b/lib/square/types/product.rb new file mode 100644 index 000000000..842030cfc --- /dev/null +++ b/lib/square/types/product.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + module Product + extend Square::Internal::Types::Enum + SQUARE_POS = "SQUARE_POS" + EXTERNAL_API = "EXTERNAL_API" + BILLING = "BILLING" + APPOINTMENTS = "APPOINTMENTS" + INVOICES = "INVOICES" + ONLINE_STORE = "ONLINE_STORE" + PAYROLL = "PAYROLL" + DASHBOARD = "DASHBOARD" + ITEM_LIBRARY_IMPORT = "ITEM_LIBRARY_IMPORT" + OTHER = "OTHER"end + end +end diff --git a/lib/square/types/publish_invoice_response.rb b/lib/square/types/publish_invoice_response.rb new file mode 100644 index 000000000..7b3e9e9b5 --- /dev/null +++ b/lib/square/types/publish_invoice_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes a `PublishInvoice` response. + class PublishInvoiceResponse < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/publish_scheduled_shift_response.rb b/lib/square/types/publish_scheduled_shift_response.rb new file mode 100644 index 000000000..4e7b2fce9 --- /dev/null +++ b/lib/square/types/publish_scheduled_shift_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) response. + # Either `scheduled_shift` or `errors` is present in the response. + class PublishScheduledShiftResponse < Internal::Types::Model + field :scheduled_shift, Square::Types::ScheduledShift, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/qr_code_options.rb b/lib/square/types/qr_code_options.rb new file mode 100644 index 000000000..e700e58c4 --- /dev/null +++ b/lib/square/types/qr_code_options.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Fields to describe the action that displays QR-Codes. + class QrCodeOptions < Internal::Types::Model + field :title, String, optional: false, nullable: false + field :body, String, optional: false, nullable: false + field :barcode_contents, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/quick_pay.rb b/lib/square/types/quick_pay.rb new file mode 100644 index 000000000..06994c6d1 --- /dev/null +++ b/lib/square/types/quick_pay.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class QuickPay < Internal::Types::Model + field :name, String, optional: false, nullable: false + field :price_money, Square::Types::Money, optional: false, nullable: false + field :location_id, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/range.rb b/lib/square/types/range.rb new file mode 100644 index 000000000..8eb3c5c2f --- /dev/null +++ b/lib/square/types/range.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The range of a number value between the specified lower and upper bounds. + class Range < Internal::Types::Model + field :min, String, optional: true, nullable: false + field :max, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/receipt_options.rb b/lib/square/types/receipt_options.rb new file mode 100644 index 000000000..bc2bfbae5 --- /dev/null +++ b/lib/square/types/receipt_options.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes receipt action fields. + class ReceiptOptions < Internal::Types::Model + field :payment_id, String, optional: false, nullable: false + field :print_only, Internal::Types::Boolean, optional: true, nullable: false + field :is_duplicate, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/redeem_loyalty_reward_response.rb b/lib/square/types/redeem_loyalty_reward_response.rb new file mode 100644 index 000000000..d133c5304 --- /dev/null +++ b/lib/square/types/redeem_loyalty_reward_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that includes the `LoyaltyEvent` published for redeeming the reward. + class RedeemLoyaltyRewardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :event, Square::Types::LoyaltyEvent, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/refund.rb b/lib/square/types/refund.rb new file mode 100644 index 000000000..65dbfdbc4 --- /dev/null +++ b/lib/square/types/refund.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a refund processed for a Square transaction. + class Refund < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :location_id, String, optional: false, nullable: false + field :transaction_id, String, optional: true, nullable: false + field :tender_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :reason, String, optional: false, nullable: false + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :status, Square::Types::RefundStatus, optional: false, nullable: false + field :processing_fee_money, Square::Types::Money, optional: true, nullable: false + field :additional_recipients, Internal::Types::Array[Square::Types::AdditionalRecipient], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/refund_created_event.rb b/lib/square/types/refund_created_event.rb new file mode 100644 index 000000000..074935994 --- /dev/null +++ b/lib/square/types/refund_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Refund](entity:PaymentRefund) is created. + class RefundCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::RefundCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/refund_created_event_data.rb b/lib/square/types/refund_created_event_data.rb new file mode 100644 index 000000000..dc51a0272 --- /dev/null +++ b/lib/square/types/refund_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class RefundCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::RefundCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/refund_created_event_object.rb b/lib/square/types/refund_created_event_object.rb new file mode 100644 index 000000000..f5f1d33f5 --- /dev/null +++ b/lib/square/types/refund_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class RefundCreatedEventObject < Internal::Types::Model + field :refund, Square::Types::PaymentRefund, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/refund_payment_response.rb b/lib/square/types/refund_payment_response.rb new file mode 100644 index 000000000..44bdf49c0 --- /dev/null +++ b/lib/square/types/refund_payment_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response returned by + # [RefundPayment](api-endpoint:Refunds-RefundPayment). + # + # If there are errors processing the request, the `refund` field might not be + # present, or it might be present with a status of `FAILED`. + class RefundPaymentResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :refund, Square::Types::PaymentRefund, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/refund_status.rb b/lib/square/types/refund_status.rb new file mode 100644 index 000000000..e8c7c6c3e --- /dev/null +++ b/lib/square/types/refund_status.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module RefundStatus + extend Square::Internal::Types::Enum + PENDING = "PENDING" + APPROVED = "APPROVED" + REJECTED = "REJECTED" + FAILED = "FAILED"end + end +end diff --git a/lib/square/types/refund_updated_event.rb b/lib/square/types/refund_updated_event.rb new file mode 100644 index 000000000..1942a90a1 --- /dev/null +++ b/lib/square/types/refund_updated_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Refund](entity:PaymentRefund) is updated. + # Typically the `refund.status` changes when a refund is completed. + class RefundUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::RefundUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/refund_updated_event_data.rb b/lib/square/types/refund_updated_event_data.rb new file mode 100644 index 000000000..3b0cc6de7 --- /dev/null +++ b/lib/square/types/refund_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class RefundUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::RefundUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/refund_updated_event_object.rb b/lib/square/types/refund_updated_event_object.rb new file mode 100644 index 000000000..c2d005626 --- /dev/null +++ b/lib/square/types/refund_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class RefundUpdatedEventObject < Internal::Types::Model + field :refund, Square::Types::PaymentRefund, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/register_domain_response.rb b/lib/square/types/register_domain_response.rb new file mode 100644 index 000000000..dc2ed3c20 --- /dev/null +++ b/lib/square/types/register_domain_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [RegisterDomain](api-endpoint:ApplePay-RegisterDomain) endpoint. + # + # Either `errors` or `status` are present in a given response (never both). + class RegisterDomainResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :status, Square::Types::RegisterDomainResponseStatus, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/register_domain_response_status.rb b/lib/square/types/register_domain_response_status.rb new file mode 100644 index 000000000..e0bb4fd5d --- /dev/null +++ b/lib/square/types/register_domain_response_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module RegisterDomainResponseStatus + extend Square::Internal::Types::Enum + PENDING = "PENDING" + VERIFIED = "VERIFIED"end + end +end diff --git a/lib/square/types/remove_group_from_customer_response.rb b/lib/square/types/remove_group_from_customer_response.rb new file mode 100644 index 000000000..ac28a5203 --- /dev/null +++ b/lib/square/types/remove_group_from_customer_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [RemoveGroupFromCustomer](api-endpoint:Customers-RemoveGroupFromCustomer) + # endpoint. + class RemoveGroupFromCustomerResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/resume_subscription_response.rb b/lib/square/types/resume_subscription_response.rb new file mode 100644 index 000000000..b9e2434c0 --- /dev/null +++ b/lib/square/types/resume_subscription_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response from the + # [ResumeSubscription](api-endpoint:Subscriptions-ResumeSubscription) endpoint. + class ResumeSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::Subscription, optional: true, nullable: false + field :actions, Internal::Types::Array[Square::Types::SubscriptionAction], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_booking_custom_attribute_definition_response.rb b/lib/square/types/retrieve_booking_custom_attribute_definition_response.rb new file mode 100644 index 000000000..96b15e8a0 --- /dev/null +++ b/lib/square/types/retrieve_booking_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class RetrieveBookingCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_booking_custom_attribute_response.rb b/lib/square/types/retrieve_booking_custom_attribute_response.rb new file mode 100644 index 000000000..d66748fe2 --- /dev/null +++ b/lib/square/types/retrieve_booking_custom_attribute_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveBookingCustomAttribute](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttribute) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class RetrieveBookingCustomAttributeResponse < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_job_response.rb b/lib/square/types/retrieve_job_response.rb new file mode 100644 index 000000000..df26ad3a7 --- /dev/null +++ b/lib/square/types/retrieve_job_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveJob](api-endpoint:Team-RetrieveJob) response. Either `job` or `errors` + # is present in the response. + class RetrieveJobResponse < Internal::Types::Model + field :job, Square::Types::Job, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_location_booking_profile_response.rb b/lib/square/types/retrieve_location_booking_profile_response.rb new file mode 100644 index 000000000..9716f455f --- /dev/null +++ b/lib/square/types/retrieve_location_booking_profile_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class RetrieveLocationBookingProfileResponse < Internal::Types::Model + field :location_booking_profile, Square::Types::LocationBookingProfile, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_location_custom_attribute_definition_response.rb b/lib/square/types/retrieve_location_custom_attribute_definition_response.rb new file mode 100644 index 000000000..b4af0d30c --- /dev/null +++ b/lib/square/types/retrieve_location_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class RetrieveLocationCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_location_custom_attribute_response.rb b/lib/square/types/retrieve_location_custom_attribute_response.rb new file mode 100644 index 000000000..33e851877 --- /dev/null +++ b/lib/square/types/retrieve_location_custom_attribute_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveLocationCustomAttribute](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttribute) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class RetrieveLocationCustomAttributeResponse < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_location_settings_response.rb b/lib/square/types/retrieve_location_settings_response.rb new file mode 100644 index 000000000..22e03b1e0 --- /dev/null +++ b/lib/square/types/retrieve_location_settings_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class RetrieveLocationSettingsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :location_settings, Square::Types::CheckoutLocationSettings, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_merchant_custom_attribute_definition_response.rb b/lib/square/types/retrieve_merchant_custom_attribute_definition_response.rb new file mode 100644 index 000000000..a033d477a --- /dev/null +++ b/lib/square/types/retrieve_merchant_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class RetrieveMerchantCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_merchant_custom_attribute_response.rb b/lib/square/types/retrieve_merchant_custom_attribute_response.rb new file mode 100644 index 000000000..8d86dba58 --- /dev/null +++ b/lib/square/types/retrieve_merchant_custom_attribute_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttribute) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class RetrieveMerchantCustomAttributeResponse < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_merchant_settings_response.rb b/lib/square/types/retrieve_merchant_settings_response.rb new file mode 100644 index 000000000..2799ec6db --- /dev/null +++ b/lib/square/types/retrieve_merchant_settings_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class RetrieveMerchantSettingsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :merchant_settings, Square::Types::CheckoutMerchantSettings, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_order_custom_attribute_definition_response.rb b/lib/square/types/retrieve_order_custom_attribute_definition_response.rb new file mode 100644 index 000000000..68487dabd --- /dev/null +++ b/lib/square/types/retrieve_order_custom_attribute_definition_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from getting an order custom attribute definition. + class RetrieveOrderCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_order_custom_attribute_response.rb b/lib/square/types/retrieve_order_custom_attribute_response.rb new file mode 100644 index 000000000..479bf7ad6 --- /dev/null +++ b/lib/square/types/retrieve_order_custom_attribute_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from getting an order custom attribute. + class RetrieveOrderCustomAttributeResponse < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_scheduled_shift_response.rb b/lib/square/types/retrieve_scheduled_shift_response.rb new file mode 100644 index 000000000..2db771855 --- /dev/null +++ b/lib/square/types/retrieve_scheduled_shift_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [RetrieveScheduledShift](api-endpoint:Labor-RetrieveScheduledShift) response. + # Either `scheduled_shift` or `errors` is present in the response. + class RetrieveScheduledShiftResponse < Internal::Types::Model + field :scheduled_shift, Square::Types::ScheduledShift, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_timecard_response.rb b/lib/square/types/retrieve_timecard_response.rb new file mode 100644 index 000000000..c6d3fc021 --- /dev/null +++ b/lib/square/types/retrieve_timecard_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # A response to a request to get a `Timecard`. The response contains + # the requested `Timecard` object and might contain a set of `Error` objects if + # the request resulted in errors. + class RetrieveTimecardResponse < Internal::Types::Model + field :timecard, Square::Types::Timecard, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/retrieve_token_status_response.rb b/lib/square/types/retrieve_token_status_response.rb new file mode 100644 index 000000000..70ddca58a --- /dev/null +++ b/lib/square/types/retrieve_token_status_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the `RetrieveTokenStatus` endpoint. + class RetrieveTokenStatusResponse < Internal::Types::Model + field :scopes, Internal::Types::Array[String], optional: true, nullable: false + field :expires_at, String, optional: true, nullable: false + field :client_id, String, optional: true, nullable: false + field :merchant_id, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/revoke_token_response.rb b/lib/square/types/revoke_token_response.rb new file mode 100644 index 000000000..88d18fcd7 --- /dev/null +++ b/lib/square/types/revoke_token_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class RevokeTokenResponse < Internal::Types::Model + field :success, Internal::Types::Boolean, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/risk_evaluation.rb b/lib/square/types/risk_evaluation.rb new file mode 100644 index 000000000..9572de783 --- /dev/null +++ b/lib/square/types/risk_evaluation.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class RiskEvaluation < Internal::Types::Model + field :created_at, String, optional: true, nullable: false + field :risk_level, Square::Types::RiskEvaluationRiskLevel, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/risk_evaluation_risk_level.rb b/lib/square/types/risk_evaluation_risk_level.rb new file mode 100644 index 000000000..7838c45af --- /dev/null +++ b/lib/square/types/risk_evaluation_risk_level.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module RiskEvaluationRiskLevel + extend Square::Internal::Types::Enum + PENDING = "PENDING" + NORMAL = "NORMAL" + MODERATE = "MODERATE" + HIGH = "HIGH"end + end +end diff --git a/lib/square/types/save_card_options.rb b/lib/square/types/save_card_options.rb new file mode 100644 index 000000000..d6271f713 --- /dev/null +++ b/lib/square/types/save_card_options.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes save-card action fields. + class SaveCardOptions < Internal::Types::Model + field :customer_id, String, optional: false, nullable: false + field :card_id, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/scheduled_shift.rb b/lib/square/types/scheduled_shift.rb new file mode 100644 index 000000000..3a8546ab6 --- /dev/null +++ b/lib/square/types/scheduled_shift.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a specific time slot in a work schedule. This object is used to manage the + # lifecycle of a scheduled shift from the draft to published state. A scheduled shift contains + # the latest draft shift details and current published shift details. + class ScheduledShift < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :draft_shift_details, Square::Types::ScheduledShiftDetails, optional: true, nullable: false + field :published_shift_details, Square::Types::ScheduledShiftDetails, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/scheduled_shift_details.rb b/lib/square/types/scheduled_shift_details.rb new file mode 100644 index 000000000..6ca5fd129 --- /dev/null +++ b/lib/square/types/scheduled_shift_details.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents shift details for draft and published versions of a [scheduled shift](entity:ScheduledShift), + # such as job ID, team member assignment, and start and end times. + class ScheduledShiftDetails < Internal::Types::Model + field :team_member_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :job_id, String, optional: true, nullable: false + field :start_at, String, optional: true, nullable: false + field :end_at, String, optional: true, nullable: false + field :notes, String, optional: true, nullable: false + field :is_deleted, Internal::Types::Boolean, optional: true, nullable: false + field :timezone, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/scheduled_shift_filter.rb b/lib/square/types/scheduled_shift_filter.rb new file mode 100644 index 000000000..67cc89ff5 --- /dev/null +++ b/lib/square/types/scheduled_shift_filter.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines filter criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) + # request. Multiple filters in a query are combined as an `AND` operation. + class ScheduledShiftFilter < Internal::Types::Model + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :start, Square::Types::TimeRange, optional: true, nullable: false + field :end_, Square::Types::TimeRange, optional: true, nullable: false + field :workday, Square::Types::ScheduledShiftWorkday, optional: true, nullable: false + field :team_member_ids, Internal::Types::Array[String], optional: true, nullable: false + field :assignment_status, Square::Types::ScheduledShiftFilterAssignmentStatus, optional: true, nullable: false + field :scheduled_shift_statuses, Internal::Types::Array[Square::Types::ScheduledShiftFilterScheduledShiftStatus], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/scheduled_shift_filter_assignment_status.rb b/lib/square/types/scheduled_shift_filter_assignment_status.rb new file mode 100644 index 000000000..c4e8b46f9 --- /dev/null +++ b/lib/square/types/scheduled_shift_filter_assignment_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module ScheduledShiftFilterAssignmentStatus + extend Square::Internal::Types::Enum + ASSIGNED = "ASSIGNED" + UNASSIGNED = "UNASSIGNED"end + end +end diff --git a/lib/square/types/scheduled_shift_filter_scheduled_shift_status.rb b/lib/square/types/scheduled_shift_filter_scheduled_shift_status.rb new file mode 100644 index 000000000..463602260 --- /dev/null +++ b/lib/square/types/scheduled_shift_filter_scheduled_shift_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module ScheduledShiftFilterScheduledShiftStatus + extend Square::Internal::Types::Enum + DRAFT = "DRAFT" + PUBLISHED = "PUBLISHED"end + end +end diff --git a/lib/square/types/scheduled_shift_notification_audience.rb b/lib/square/types/scheduled_shift_notification_audience.rb new file mode 100644 index 000000000..7402e805a --- /dev/null +++ b/lib/square/types/scheduled_shift_notification_audience.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module ScheduledShiftNotificationAudience + extend Square::Internal::Types::Enum + ALL = "ALL" + AFFECTED = "AFFECTED" + NONE = "NONE"end + end +end diff --git a/lib/square/types/scheduled_shift_query.rb b/lib/square/types/scheduled_shift_query.rb new file mode 100644 index 000000000..df5f18643 --- /dev/null +++ b/lib/square/types/scheduled_shift_query.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents filter and sort criteria for the `query` field in a + # [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. + class ScheduledShiftQuery < Internal::Types::Model + field :filter, Square::Types::ScheduledShiftFilter, optional: true, nullable: false + field :sort, Square::Types::ScheduledShiftSort, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/scheduled_shift_sort.rb b/lib/square/types/scheduled_shift_sort.rb new file mode 100644 index 000000000..0e676c3db --- /dev/null +++ b/lib/square/types/scheduled_shift_sort.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines sort criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) + # request. + class ScheduledShiftSort < Internal::Types::Model + field :field, Square::Types::ScheduledShiftSortField, optional: true, nullable: false + field :order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/scheduled_shift_sort_field.rb b/lib/square/types/scheduled_shift_sort_field.rb new file mode 100644 index 000000000..0f19d6f05 --- /dev/null +++ b/lib/square/types/scheduled_shift_sort_field.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module ScheduledShiftSortField + extend Square::Internal::Types::Enum + START_AT = "START_AT" + END_AT = "END_AT" + CREATED_AT = "CREATED_AT" + UPDATED_AT = "UPDATED_AT"end + end +end diff --git a/lib/square/types/scheduled_shift_workday.rb b/lib/square/types/scheduled_shift_workday.rb new file mode 100644 index 000000000..07d6490d6 --- /dev/null +++ b/lib/square/types/scheduled_shift_workday.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # A `ScheduledShift` search query filter parameter that sets a range of days that + # a `Shift` must start or end in before passing the filter condition. + class ScheduledShiftWorkday < Internal::Types::Model + field :date_range, Square::Types::DateRange, optional: true, nullable: false + field :match_scheduled_shifts_by, Square::Types::ScheduledShiftWorkdayMatcher, optional: true, nullable: false + field :default_timezone, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/scheduled_shift_workday_matcher.rb b/lib/square/types/scheduled_shift_workday_matcher.rb new file mode 100644 index 000000000..93687995f --- /dev/null +++ b/lib/square/types/scheduled_shift_workday_matcher.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module ScheduledShiftWorkdayMatcher + extend Square::Internal::Types::Enum + START_AT = "START_AT" + END_AT = "END_AT" + INTERSECTION = "INTERSECTION"end + end +end diff --git a/lib/square/types/search_availability_filter.rb b/lib/square/types/search_availability_filter.rb new file mode 100644 index 000000000..0b84b4716 --- /dev/null +++ b/lib/square/types/search_availability_filter.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # A query filter to search for buyer-accessible availabilities by. + class SearchAvailabilityFilter < Internal::Types::Model + field :start_at_range, Square::Types::TimeRange, optional: false, nullable: false + field :location_id, String, optional: true, nullable: false + field :segment_filters, Internal::Types::Array[Square::Types::SegmentFilter], optional: true, nullable: false + field :booking_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_availability_query.rb b/lib/square/types/search_availability_query.rb new file mode 100644 index 000000000..b3527d444 --- /dev/null +++ b/lib/square/types/search_availability_query.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # The query used to search for buyer-accessible availabilities of bookings. + class SearchAvailabilityQuery < Internal::Types::Model + field :filter, Square::Types::SearchAvailabilityFilter, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/search_availability_response.rb b/lib/square/types/search_availability_response.rb new file mode 100644 index 000000000..d92f6c64e --- /dev/null +++ b/lib/square/types/search_availability_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class SearchAvailabilityResponse < Internal::Types::Model + field :availabilities, Internal::Types::Array[Square::Types::Availability], optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_catalog_items_request_stock_level.rb b/lib/square/types/search_catalog_items_request_stock_level.rb new file mode 100644 index 000000000..1c2c82ef5 --- /dev/null +++ b/lib/square/types/search_catalog_items_request_stock_level.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module SearchCatalogItemsRequestStockLevel + extend Square::Internal::Types::Enum + OUT = "OUT" + LOW = "LOW"end + end +end diff --git a/lib/square/types/search_catalog_items_response.rb b/lib/square/types/search_catalog_items_response.rb new file mode 100644 index 000000000..eb44d5eb7 --- /dev/null +++ b/lib/square/types/search_catalog_items_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response body returned from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. + class SearchCatalogItemsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :items, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :matched_variation_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_catalog_objects_response.rb b/lib/square/types/search_catalog_objects_response.rb new file mode 100644 index 000000000..8e026b643 --- /dev/null +++ b/lib/square/types/search_catalog_objects_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + class SearchCatalogObjectsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :objects, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + field :related_objects, Internal::Types::Array[Square::Types::CatalogObject], optional: true, nullable: false + field :latest_time, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_customers_response.rb b/lib/square/types/search_customers_response.rb new file mode 100644 index 000000000..48fba18ee --- /dev/null +++ b/lib/square/types/search_customers_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class SearchCustomersResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :customers, Internal::Types::Array[Square::Types::Customer], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :count, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_events_filter.rb b/lib/square/types/search_events_filter.rb new file mode 100644 index 000000000..bf9f3d078 --- /dev/null +++ b/lib/square/types/search_events_filter.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Criteria to filter events by. + class SearchEventsFilter < Internal::Types::Model + field :event_types, Internal::Types::Array[String], optional: true, nullable: false + field :merchant_ids, Internal::Types::Array[String], optional: true, nullable: false + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :created_at, Square::Types::TimeRange, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_events_query.rb b/lib/square/types/search_events_query.rb new file mode 100644 index 000000000..517df0b2b --- /dev/null +++ b/lib/square/types/search_events_query.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Contains query criteria for the search. + class SearchEventsQuery < Internal::Types::Model + field :filter, Square::Types::SearchEventsFilter, optional: true, nullable: false + field :sort, Square::Types::SearchEventsSort, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_events_response.rb b/lib/square/types/search_events_response.rb new file mode 100644 index 000000000..be6ced3d3 --- /dev/null +++ b/lib/square/types/search_events_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [SearchEvents](api-endpoint:Events-SearchEvents) endpoint. + # + # Note: if there are errors processing the request, the events field will not be + # present. + class SearchEventsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :events, Internal::Types::Array[Square::Types::Event], optional: true, nullable: false + field :metadata, Internal::Types::Array[Square::Types::EventMetadata], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_events_sort.rb b/lib/square/types/search_events_sort.rb new file mode 100644 index 000000000..e284c781f --- /dev/null +++ b/lib/square/types/search_events_sort.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Criteria to sort events by. + class SearchEventsSort < Internal::Types::Model + field :field, String, optional: true, nullable: false + field :order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_invoices_response.rb b/lib/square/types/search_invoices_response.rb new file mode 100644 index 000000000..a750da416 --- /dev/null +++ b/lib/square/types/search_invoices_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes a `SearchInvoices` response. + class SearchInvoicesResponse < Internal::Types::Model + field :invoices, Internal::Types::Array[Square::Types::Invoice], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_loyalty_accounts_request_loyalty_account_query.rb b/lib/square/types/search_loyalty_accounts_request_loyalty_account_query.rb new file mode 100644 index 000000000..52bbb6073 --- /dev/null +++ b/lib/square/types/search_loyalty_accounts_request_loyalty_account_query.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The search criteria for the loyalty accounts. + class SearchLoyaltyAccountsRequestLoyaltyAccountQuery < Internal::Types::Model + field :mappings, Internal::Types::Array[Square::Types::LoyaltyAccountMapping], optional: true, nullable: false + field :customer_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_loyalty_accounts_response.rb b/lib/square/types/search_loyalty_accounts_response.rb new file mode 100644 index 000000000..da834201a --- /dev/null +++ b/lib/square/types/search_loyalty_accounts_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that includes loyalty accounts that satisfy the search criteria. + class SearchLoyaltyAccountsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :loyalty_accounts, Internal::Types::Array[Square::Types::LoyaltyAccount], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_loyalty_events_response.rb b/lib/square/types/search_loyalty_events_response.rb new file mode 100644 index 000000000..46d57677a --- /dev/null +++ b/lib/square/types/search_loyalty_events_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains loyalty events that satisfy the search + # criteria, in order by the `created_at` date. + class SearchLoyaltyEventsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :events, Internal::Types::Array[Square::Types::LoyaltyEvent], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_loyalty_rewards_request_loyalty_reward_query.rb b/lib/square/types/search_loyalty_rewards_request_loyalty_reward_query.rb new file mode 100644 index 000000000..68c377457 --- /dev/null +++ b/lib/square/types/search_loyalty_rewards_request_loyalty_reward_query.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The set of search requirements. + class SearchLoyaltyRewardsRequestLoyaltyRewardQuery < Internal::Types::Model + field :loyalty_account_id, String, optional: false, nullable: false + field :status, Square::Types::LoyaltyRewardStatus, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_loyalty_rewards_response.rb b/lib/square/types/search_loyalty_rewards_response.rb new file mode 100644 index 000000000..400dba1c6 --- /dev/null +++ b/lib/square/types/search_loyalty_rewards_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that includes the loyalty rewards satisfying the search criteria. + class SearchLoyaltyRewardsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :rewards, Internal::Types::Array[Square::Types::LoyaltyReward], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_orders_customer_filter.rb b/lib/square/types/search_orders_customer_filter.rb new file mode 100644 index 000000000..94e3bbca3 --- /dev/null +++ b/lib/square/types/search_orders_customer_filter.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A filter based on the order `customer_id` and any tender `customer_id` + # associated with the order. It does not filter based on the + # [FulfillmentRecipient](entity:FulfillmentRecipient) `customer_id`. + class SearchOrdersCustomerFilter < Internal::Types::Model + field :customer_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_orders_date_time_filter.rb b/lib/square/types/search_orders_date_time_filter.rb new file mode 100644 index 000000000..56cf81305 --- /dev/null +++ b/lib/square/types/search_orders_date_time_filter.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Square + module Types + # Filter for `Order` objects based on whether their `CREATED_AT`, + # `CLOSED_AT`, or `UPDATED_AT` timestamps fall within a specified time range. + # You can specify the time range and which timestamp to filter for. You can filter + # for only one time range at a time. + # + # For each time range, the start time and end time are inclusive. If the end time + # is absent, it defaults to the time of the first request for the cursor. + # + # __Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, + # you must set the `sort_field` in [OrdersSort](entity:SearchOrdersSort) + # to the same field you filter for. For example, if you set the `CLOSED_AT` field + # in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to + # `CLOSED_AT`. Otherwise, `SearchOrders` throws an error. + # [Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range) + class SearchOrdersDateTimeFilter < Internal::Types::Model + field :created_at, Square::Types::TimeRange, optional: true, nullable: false + field :updated_at, Square::Types::TimeRange, optional: true, nullable: false + field :closed_at, Square::Types::TimeRange, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_orders_filter.rb b/lib/square/types/search_orders_filter.rb new file mode 100644 index 000000000..9b2d9ece3 --- /dev/null +++ b/lib/square/types/search_orders_filter.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Filtering criteria to use for a `SearchOrders` request. Multiple filters + # are ANDed together. + class SearchOrdersFilter < Internal::Types::Model + field :state_filter, Square::Types::SearchOrdersStateFilter, optional: true, nullable: false + field :date_time_filter, Square::Types::SearchOrdersDateTimeFilter, optional: true, nullable: false + field :fulfillment_filter, Square::Types::SearchOrdersFulfillmentFilter, optional: true, nullable: false + field :source_filter, Square::Types::SearchOrdersSourceFilter, optional: true, nullable: false + field :customer_filter, Square::Types::SearchOrdersCustomerFilter, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_orders_fulfillment_filter.rb b/lib/square/types/search_orders_fulfillment_filter.rb new file mode 100644 index 000000000..0d73c24e7 --- /dev/null +++ b/lib/square/types/search_orders_fulfillment_filter.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Filter based on [order fulfillment](entity:Fulfillment) information. + class SearchOrdersFulfillmentFilter < Internal::Types::Model + field :fulfillment_types, Internal::Types::Array[Square::Types::FulfillmentType], optional: true, nullable: false + field :fulfillment_states, Internal::Types::Array[Square::Types::FulfillmentState], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_orders_query.rb b/lib/square/types/search_orders_query.rb new file mode 100644 index 000000000..87e9fa5c6 --- /dev/null +++ b/lib/square/types/search_orders_query.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Contains query criteria for the search. + class SearchOrdersQuery < Internal::Types::Model + field :filter, Square::Types::SearchOrdersFilter, optional: true, nullable: false + field :sort, Square::Types::SearchOrdersSort, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_orders_response.rb b/lib/square/types/search_orders_response.rb new file mode 100644 index 000000000..4032981dc --- /dev/null +++ b/lib/square/types/search_orders_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Either the `order_entries` or `orders` field is set, depending on whether + # `return_entries` is set on the [SearchOrdersRequest](api-endpoint:Orders-SearchOrders). + class SearchOrdersResponse < Internal::Types::Model + field :order_entries, Internal::Types::Array[Square::Types::OrderEntry], optional: true, nullable: false + field :orders, Internal::Types::Array[Square::Types::Order], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_orders_sort.rb b/lib/square/types/search_orders_sort.rb new file mode 100644 index 000000000..7ee13f492 --- /dev/null +++ b/lib/square/types/search_orders_sort.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Sorting criteria for a `SearchOrders` request. Results can only be sorted + # by a timestamp field. + class SearchOrdersSort < Internal::Types::Model + field :sort_field, Square::Types::SearchOrdersSortField, optional: false, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_orders_sort_field.rb b/lib/square/types/search_orders_sort_field.rb new file mode 100644 index 000000000..91a16ca92 --- /dev/null +++ b/lib/square/types/search_orders_sort_field.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module SearchOrdersSortField + extend Square::Internal::Types::Enum + CREATED_AT = "CREATED_AT" + UPDATED_AT = "UPDATED_AT" + CLOSED_AT = "CLOSED_AT"end + end +end diff --git a/lib/square/types/search_orders_source_filter.rb b/lib/square/types/search_orders_source_filter.rb new file mode 100644 index 000000000..4099d7be3 --- /dev/null +++ b/lib/square/types/search_orders_source_filter.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # A filter based on order `source` information. + class SearchOrdersSourceFilter < Internal::Types::Model + field :source_names, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_orders_state_filter.rb b/lib/square/types/search_orders_state_filter.rb new file mode 100644 index 000000000..743325a35 --- /dev/null +++ b/lib/square/types/search_orders_state_filter.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Filter by the current order `state`. + class SearchOrdersStateFilter < Internal::Types::Model + field :states, Internal::Types::Array[Square::Types::OrderState], optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/search_scheduled_shifts_response.rb b/lib/square/types/search_scheduled_shifts_response.rb new file mode 100644 index 000000000..79ec325f7 --- /dev/null +++ b/lib/square/types/search_scheduled_shifts_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) response. + # Either `scheduled_shifts` or `errors` is present in the response. + class SearchScheduledShiftsResponse < Internal::Types::Model + field :scheduled_shifts, Internal::Types::Array[Square::Types::ScheduledShift], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_shifts_response.rb b/lib/square/types/search_shifts_response.rb new file mode 100644 index 000000000..a98fec168 --- /dev/null +++ b/lib/square/types/search_shifts_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class SearchShiftsResponse < Internal::Types::Model + field :shifts, Internal::Types::Array[Square::Types::Shift], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_subscriptions_filter.rb b/lib/square/types/search_subscriptions_filter.rb new file mode 100644 index 000000000..6d4f81be9 --- /dev/null +++ b/lib/square/types/search_subscriptions_filter.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions returned by + # the [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint. + class SearchSubscriptionsFilter < Internal::Types::Model + field :customer_ids, Internal::Types::Array[String], optional: true, nullable: false + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :source_names, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_subscriptions_query.rb b/lib/square/types/search_subscriptions_query.rb new file mode 100644 index 000000000..940a594da --- /dev/null +++ b/lib/square/types/search_subscriptions_query.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a query, consisting of specified query expressions, used to search for subscriptions. + class SearchSubscriptionsQuery < Internal::Types::Model + field :filter, Square::Types::SearchSubscriptionsFilter, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_subscriptions_response.rb b/lib/square/types/search_subscriptions_response.rb new file mode 100644 index 000000000..2eab29c57 --- /dev/null +++ b/lib/square/types/search_subscriptions_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response from the + # [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint. + class SearchSubscriptionsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscriptions, Internal::Types::Array[Square::Types::Subscription], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_team_members_filter.rb b/lib/square/types/search_team_members_filter.rb new file mode 100644 index 000000000..8ea6d2f99 --- /dev/null +++ b/lib/square/types/search_team_members_filter.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Square + module Types + # 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". + class SearchTeamMembersFilter < Internal::Types::Model + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :status, Square::Types::TeamMemberStatus, optional: true, nullable: false + field :is_owner, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_team_members_query.rb b/lib/square/types/search_team_members_query.rb new file mode 100644 index 000000000..2adde9634 --- /dev/null +++ b/lib/square/types/search_team_members_query.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the parameters in a search for `TeamMember` objects. + class SearchTeamMembersQuery < Internal::Types::Model + field :filter, Square::Types::SearchTeamMembersFilter, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_team_members_response.rb b/lib/square/types/search_team_members_response.rb new file mode 100644 index 000000000..ed602e390 --- /dev/null +++ b/lib/square/types/search_team_members_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from a search request containing a filtered list of `TeamMember` objects. + class SearchTeamMembersResponse < Internal::Types::Model + field :team_members, Internal::Types::Array[Square::Types::TeamMember], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_terminal_actions_response.rb b/lib/square/types/search_terminal_actions_response.rb new file mode 100644 index 000000000..c0118d69a --- /dev/null +++ b/lib/square/types/search_terminal_actions_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class SearchTerminalActionsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :action, Internal::Types::Array[Square::Types::TerminalAction], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_terminal_checkouts_response.rb b/lib/square/types/search_terminal_checkouts_response.rb new file mode 100644 index 000000000..8cd8e3ae1 --- /dev/null +++ b/lib/square/types/search_terminal_checkouts_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class SearchTerminalCheckoutsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :checkouts, Internal::Types::Array[Square::Types::TerminalCheckout], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_terminal_refunds_response.rb b/lib/square/types/search_terminal_refunds_response.rb new file mode 100644 index 000000000..0a626fddc --- /dev/null +++ b/lib/square/types/search_terminal_refunds_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class SearchTerminalRefundsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :refunds, Internal::Types::Array[Square::Types::TerminalRefund], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_timecards_response.rb b/lib/square/types/search_timecards_response.rb new file mode 100644 index 000000000..1e0614279 --- /dev/null +++ b/lib/square/types/search_timecards_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # The response to a request for `Timecard` objects. The response contains + # the requested `Timecard` objects and might contain a set of `Error` objects if + # the request resulted in errors. + class SearchTimecardsResponse < Internal::Types::Model + field :timecards, Internal::Types::Array[Square::Types::Timecard], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_vendors_request_filter.rb b/lib/square/types/search_vendors_request_filter.rb new file mode 100644 index 000000000..0a605b365 --- /dev/null +++ b/lib/square/types/search_vendors_request_filter.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines supported query expressions to search for vendors by. + class SearchVendorsRequestFilter < Internal::Types::Model + field :name, Internal::Types::Array[String], optional: true, nullable: false + field :status, Internal::Types::Array[Square::Types::VendorStatus], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_vendors_request_sort.rb b/lib/square/types/search_vendors_request_sort.rb new file mode 100644 index 000000000..1f46e743a --- /dev/null +++ b/lib/square/types/search_vendors_request_sort.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines a sorter used to sort results from [SearchVendors](api-endpoint:Vendors-SearchVendors). + class SearchVendorsRequestSort < Internal::Types::Model + field :field, Square::Types::SearchVendorsRequestSortField, optional: true, nullable: false + field :order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/search_vendors_request_sort_field.rb b/lib/square/types/search_vendors_request_sort_field.rb new file mode 100644 index 000000000..a26877a3e --- /dev/null +++ b/lib/square/types/search_vendors_request_sort_field.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module SearchVendorsRequestSortField + extend Square::Internal::Types::Enum + NAME = "NAME" + CREATED_AT = "CREATED_AT"end + end +end diff --git a/lib/square/types/search_vendors_response.rb b/lib/square/types/search_vendors_response.rb new file mode 100644 index 000000000..fde065dbf --- /dev/null +++ b/lib/square/types/search_vendors_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an output from a call to [SearchVendors](api-endpoint:Vendors-SearchVendors). + class SearchVendorsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :vendors, Internal::Types::Array[Square::Types::Vendor], optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/segment_filter.rb b/lib/square/types/segment_filter.rb new file mode 100644 index 000000000..6426c2e07 --- /dev/null +++ b/lib/square/types/segment_filter.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # A query filter to search for buyer-accessible appointment segments by. + class SegmentFilter < Internal::Types::Model + field :service_variation_id, String, optional: false, nullable: false + field :team_member_id_filter, Square::Types::FilterValue, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/select_option.rb b/lib/square/types/select_option.rb new file mode 100644 index 000000000..0d895a837 --- /dev/null +++ b/lib/square/types/select_option.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class SelectOption < Internal::Types::Model + field :reference_id, String, optional: false, nullable: false + field :title, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/select_options.rb b/lib/square/types/select_options.rb new file mode 100644 index 000000000..f72c7f7f5 --- /dev/null +++ b/lib/square/types/select_options.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class SelectOptions < Internal::Types::Model + field :title, String, optional: false, nullable: false + field :body, String, optional: false, nullable: false + field :options, Internal::Types::Array[Square::Types::SelectOption], optional: false, nullable: false + field :selected_option, Square::Types::SelectOption, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/shift.rb b/lib/square/types/shift.rb new file mode 100644 index 000000000..ed111db26 --- /dev/null +++ b/lib/square/types/shift.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Square + module Types + # A record of the hourly rate, start, and end times for a single work shift + # for an employee. This might include a record of the start and end times for breaks + # taken during the shift. + # + # Deprecated at Square API version 2025-05-21. Replaced by [Timecard](entity:Timecard). + # See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + class Shift < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :employee_id, String, optional: true, nullable: false + field :location_id, String, optional: false, nullable: false + field :timezone, String, optional: true, nullable: false + field :start_at, String, optional: false, nullable: false + field :end_at, String, optional: true, nullable: false + field :wage, Square::Types::ShiftWage, optional: true, nullable: false + field :breaks, Internal::Types::Array[Square::Types::Break], optional: true, nullable: false + field :status, Square::Types::ShiftStatus, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :declared_cash_tip_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/shift_filter.rb b/lib/square/types/shift_filter.rb new file mode 100644 index 000000000..fe9edc4b5 --- /dev/null +++ b/lib/square/types/shift_filter.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines a filter used in a search for `Shift` records. `AND` logic is + # used by Square's servers to apply each filter property specified. + # + # Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + class ShiftFilter < Internal::Types::Model + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :employee_ids, Internal::Types::Array[String], optional: true, nullable: false + field :status, Square::Types::ShiftFilterStatus, optional: true, nullable: false + field :start, Square::Types::TimeRange, optional: true, nullable: false + field :end_, Square::Types::TimeRange, optional: true, nullable: false + field :workday, Square::Types::ShiftWorkday, optional: true, nullable: false + field :team_member_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/shift_filter_status.rb b/lib/square/types/shift_filter_status.rb new file mode 100644 index 000000000..a02b8f642 --- /dev/null +++ b/lib/square/types/shift_filter_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module ShiftFilterStatus + extend Square::Internal::Types::Enum + OPEN = "OPEN" + CLOSED = "CLOSED"end + end +end diff --git a/lib/square/types/shift_query.rb b/lib/square/types/shift_query.rb new file mode 100644 index 000000000..e018440b1 --- /dev/null +++ b/lib/square/types/shift_query.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # The parameters of a `Shift` search query, which includes filter and sort options. + # + # Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + class ShiftQuery < Internal::Types::Model + field :filter, Square::Types::ShiftFilter, optional: true, nullable: false + field :sort, Square::Types::ShiftSort, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/shift_sort.rb b/lib/square/types/shift_sort.rb new file mode 100644 index 000000000..b563cf659 --- /dev/null +++ b/lib/square/types/shift_sort.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Sets the sort order of search results. + # + # Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + class ShiftSort < Internal::Types::Model + field :field, Square::Types::ShiftSortField, optional: true, nullable: false + field :order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/shift_sort_field.rb b/lib/square/types/shift_sort_field.rb new file mode 100644 index 000000000..f4fec195f --- /dev/null +++ b/lib/square/types/shift_sort_field.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module ShiftSortField + extend Square::Internal::Types::Enum + START_AT = "START_AT" + END_AT = "END_AT" + CREATED_AT = "CREATED_AT" + UPDATED_AT = "UPDATED_AT"end + end +end diff --git a/lib/square/types/shift_status.rb b/lib/square/types/shift_status.rb new file mode 100644 index 000000000..d8d7d78e5 --- /dev/null +++ b/lib/square/types/shift_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module ShiftStatus + extend Square::Internal::Types::Enum + OPEN = "OPEN" + CLOSED = "CLOSED"end + end +end diff --git a/lib/square/types/shift_wage.rb b/lib/square/types/shift_wage.rb new file mode 100644 index 000000000..976a86618 --- /dev/null +++ b/lib/square/types/shift_wage.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # The hourly wage rate used to compensate an employee for this shift. + # + # Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + class ShiftWage < Internal::Types::Model + field :title, String, optional: true, nullable: false + field :hourly_rate, Square::Types::Money, optional: true, nullable: false + field :job_id, String, optional: true, nullable: false + field :tip_eligible, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/shift_workday.rb b/lib/square/types/shift_workday.rb new file mode 100644 index 000000000..6aba7e060 --- /dev/null +++ b/lib/square/types/shift_workday.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # A `Shift` search query filter parameter that sets a range of days that + # a `Shift` must start or end in before passing the filter condition. + # + # Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + class ShiftWorkday < Internal::Types::Model + field :date_range, Square::Types::DateRange, optional: true, nullable: false + field :match_shifts_by, Square::Types::ShiftWorkdayMatcher, optional: true, nullable: false + field :default_timezone, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/shift_workday_matcher.rb b/lib/square/types/shift_workday_matcher.rb new file mode 100644 index 000000000..d059f991b --- /dev/null +++ b/lib/square/types/shift_workday_matcher.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module ShiftWorkdayMatcher + extend Square::Internal::Types::Enum + START_AT = "START_AT" + END_AT = "END_AT" + INTERSECTION = "INTERSECTION"end + end +end diff --git a/lib/square/types/shipping_fee.rb b/lib/square/types/shipping_fee.rb new file mode 100644 index 000000000..60c422ac1 --- /dev/null +++ b/lib/square/types/shipping_fee.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class ShippingFee < Internal::Types::Model + field :name, String, optional: true, nullable: false + field :charge, Square::Types::Money, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/signature_image.rb b/lib/square/types/signature_image.rb new file mode 100644 index 000000000..97f27a2aa --- /dev/null +++ b/lib/square/types/signature_image.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class SignatureImage < Internal::Types::Model + field :image_type, String, optional: true, nullable: false + field :data, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/signature_options.rb b/lib/square/types/signature_options.rb new file mode 100644 index 000000000..40f960de3 --- /dev/null +++ b/lib/square/types/signature_options.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class SignatureOptions < Internal::Types::Model + field :title, String, optional: false, nullable: false + field :body, String, optional: false, nullable: false + field :signature, Internal::Types::Array[Square::Types::SignatureImage], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/site.rb b/lib/square/types/site.rb new file mode 100644 index 000000000..4245bbd81 --- /dev/null +++ b/lib/square/types/site.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a Square Online site, which is an online store for a Square seller. + class Site < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :site_title, String, optional: true, nullable: false + field :domain, String, optional: true, nullable: false + field :is_published, Internal::Types::Boolean, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/snippet.rb b/lib/square/types/snippet.rb new file mode 100644 index 000000000..d43db7e34 --- /dev/null +++ b/lib/square/types/snippet.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class Snippet < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :site_id, String, optional: true, nullable: false + field :content, String, optional: false, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/sort_order.rb b/lib/square/types/sort_order.rb new file mode 100644 index 000000000..52eefcc7c --- /dev/null +++ b/lib/square/types/sort_order.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module SortOrder + extend Square::Internal::Types::Enum + DESC = "DESC" + ASC = "ASC"end + end +end diff --git a/lib/square/types/source_application.rb b/lib/square/types/source_application.rb new file mode 100644 index 000000000..f93da1f23 --- /dev/null +++ b/lib/square/types/source_application.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents information about the application used to generate a change. + class SourceApplication < Internal::Types::Model + field :product, Square::Types::Product, optional: true, nullable: false + field :application_id, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/square_account_details.rb b/lib/square/types/square_account_details.rb new file mode 100644 index 000000000..7c04294b7 --- /dev/null +++ b/lib/square/types/square_account_details.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Additional details about Square Account payments. + class SquareAccountDetails < Internal::Types::Model + field :payment_source_token, String, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/standard_unit_description.rb b/lib/square/types/standard_unit_description.rb new file mode 100644 index 000000000..692d59fb7 --- /dev/null +++ b/lib/square/types/standard_unit_description.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Contains the name and abbreviation for standard measurement unit. + class StandardUnitDescription < Internal::Types::Model + field :unit, Square::Types::MeasurementUnit, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :abbreviation, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/standard_unit_description_group.rb b/lib/square/types/standard_unit_description_group.rb new file mode 100644 index 000000000..625c7aa8d --- /dev/null +++ b/lib/square/types/standard_unit_description_group.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Group of standard measurement units. + class StandardUnitDescriptionGroup < Internal::Types::Model + field :standard_unit_descriptions, Internal::Types::Array[Square::Types::StandardUnitDescription], optional: true, nullable: false + field :language_code, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/submit_evidence_response.rb b/lib/square/types/submit_evidence_response.rb new file mode 100644 index 000000000..504821556 --- /dev/null +++ b/lib/square/types/submit_evidence_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields in a `SubmitEvidence` response. + class SubmitEvidenceResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :dispute, Square::Types::Dispute, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription.rb b/lib/square/types/subscription.rb new file mode 100644 index 000000000..53995928f --- /dev/null +++ b/lib/square/types/subscription.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a subscription purchased by a customer. + # + # For more information, see + # [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). + class Subscription < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :plan_variation_id, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :start_date, String, optional: true, nullable: false + field :canceled_date, String, optional: true, nullable: false + field :charged_through_date, String, optional: true, nullable: false + field :status, Square::Types::SubscriptionStatus, optional: true, nullable: false + field :tax_percentage, String, optional: true, nullable: false + field :invoice_ids, Internal::Types::Array[String], optional: true, nullable: false + field :price_override_money, Square::Types::Money, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :card_id, String, optional: true, nullable: false + field :timezone, String, optional: true, nullable: false + field :source, Square::Types::SubscriptionSource, optional: true, nullable: false + field :actions, Internal::Types::Array[Square::Types::SubscriptionAction], optional: true, nullable: false + field :monthly_billing_anchor_date, Integer, optional: true, nullable: false + field :phases, Internal::Types::Array[Square::Types::Phase], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_action.rb b/lib/square/types/subscription_action.rb new file mode 100644 index 000000000..9bb14b987 --- /dev/null +++ b/lib/square/types/subscription_action.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an action as a pending change to a subscription. + class SubscriptionAction < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :type, Square::Types::SubscriptionActionType, optional: true, nullable: false + field :effective_date, String, optional: true, nullable: false + field :monthly_billing_anchor_date, Integer, optional: true, nullable: false + field :phases, Internal::Types::Array[Square::Types::Phase], optional: true, nullable: false + field :new_plan_variation_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_action_type.rb b/lib/square/types/subscription_action_type.rb new file mode 100644 index 000000000..3dd1083dd --- /dev/null +++ b/lib/square/types/subscription_action_type.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + module SubscriptionActionType + extend Square::Internal::Types::Enum + CANCEL = "CANCEL" + PAUSE = "PAUSE" + RESUME = "RESUME" + SWAP_PLAN = "SWAP_PLAN" + CHANGE_BILLING_ANCHOR_DATE = "CHANGE_BILLING_ANCHOR_DATE"end + end +end diff --git a/lib/square/types/subscription_cadence.rb b/lib/square/types/subscription_cadence.rb new file mode 100644 index 000000000..786960b70 --- /dev/null +++ b/lib/square/types/subscription_cadence.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Square + module Types + module SubscriptionCadence + extend Square::Internal::Types::Enum + DAILY = "DAILY" + WEEKLY = "WEEKLY" + EVERY_TWO_WEEKS = "EVERY_TWO_WEEKS" + THIRTY_DAYS = "THIRTY_DAYS" + SIXTY_DAYS = "SIXTY_DAYS" + NINETY_DAYS = "NINETY_DAYS" + MONTHLY = "MONTHLY" + EVERY_TWO_MONTHS = "EVERY_TWO_MONTHS" + QUARTERLY = "QUARTERLY" + EVERY_FOUR_MONTHS = "EVERY_FOUR_MONTHS" + EVERY_SIX_MONTHS = "EVERY_SIX_MONTHS" + ANNUAL = "ANNUAL" + EVERY_TWO_YEARS = "EVERY_TWO_YEARS"end + end +end diff --git a/lib/square/types/subscription_created_event.rb b/lib/square/types/subscription_created_event.rb new file mode 100644 index 000000000..f2b75d0a0 --- /dev/null +++ b/lib/square/types/subscription_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Subscription](entity:Subscription) is created. + class SubscriptionCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::SubscriptionCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_created_event_data.rb b/lib/square/types/subscription_created_event_data.rb new file mode 100644 index 000000000..0bfa6944e --- /dev/null +++ b/lib/square/types/subscription_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class SubscriptionCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::SubscriptionCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_created_event_object.rb b/lib/square/types/subscription_created_event_object.rb new file mode 100644 index 000000000..cccfe363c --- /dev/null +++ b/lib/square/types/subscription_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class SubscriptionCreatedEventObject < Internal::Types::Model + field :subscription, Square::Types::Subscription, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_event.rb b/lib/square/types/subscription_event.rb new file mode 100644 index 000000000..873a808f0 --- /dev/null +++ b/lib/square/types/subscription_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes changes to a subscription and the subscription status. + class SubscriptionEvent < Internal::Types::Model + field :id, String, optional: false, nullable: false + field :subscription_event_type, Square::Types::SubscriptionEventSubscriptionEventType, optional: false, nullable: false + field :effective_date, String, optional: false, nullable: false + field :monthly_billing_anchor_date, Integer, optional: true, nullable: false + field :info, Square::Types::SubscriptionEventInfo, optional: true, nullable: false + field :phases, Internal::Types::Array[Square::Types::Phase], optional: true, nullable: false + field :plan_variation_id, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_event_info.rb b/lib/square/types/subscription_event_info.rb new file mode 100644 index 000000000..c1ba244bc --- /dev/null +++ b/lib/square/types/subscription_event_info.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Provides information about the subscription event. + class SubscriptionEventInfo < Internal::Types::Model + field :detail, String, optional: true, nullable: false + field :code, Square::Types::SubscriptionEventInfoCode, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_event_info_code.rb b/lib/square/types/subscription_event_info_code.rb new file mode 100644 index 000000000..30bdd9fc1 --- /dev/null +++ b/lib/square/types/subscription_event_info_code.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + module SubscriptionEventInfoCode + extend Square::Internal::Types::Enum + LOCATION_NOT_ACTIVE = "LOCATION_NOT_ACTIVE" + LOCATION_CANNOT_ACCEPT_PAYMENT = "LOCATION_CANNOT_ACCEPT_PAYMENT" + CUSTOMER_DELETED = "CUSTOMER_DELETED" + CUSTOMER_NO_EMAIL = "CUSTOMER_NO_EMAIL" + CUSTOMER_NO_NAME = "CUSTOMER_NO_NAME" + USER_PROVIDED = "USER_PROVIDED"end + end +end diff --git a/lib/square/types/subscription_event_subscription_event_type.rb b/lib/square/types/subscription_event_subscription_event_type.rb new file mode 100644 index 000000000..a8cd3763a --- /dev/null +++ b/lib/square/types/subscription_event_subscription_event_type.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + module SubscriptionEventSubscriptionEventType + extend Square::Internal::Types::Enum + START_SUBSCRIPTION = "START_SUBSCRIPTION" + PLAN_CHANGE = "PLAN_CHANGE" + STOP_SUBSCRIPTION = "STOP_SUBSCRIPTION" + DEACTIVATE_SUBSCRIPTION = "DEACTIVATE_SUBSCRIPTION" + RESUME_SUBSCRIPTION = "RESUME_SUBSCRIPTION" + PAUSE_SUBSCRIPTION = "PAUSE_SUBSCRIPTION" + BILLING_ANCHOR_DATE_CHANGED = "BILLING_ANCHOR_DATE_CHANGED"end + end +end diff --git a/lib/square/types/subscription_phase.rb b/lib/square/types/subscription_phase.rb new file mode 100644 index 000000000..1a2796da7 --- /dev/null +++ b/lib/square/types/subscription_phase.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # 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). + class SubscriptionPhase < Internal::Types::Model + field :uid, String, optional: true, nullable: false + field :cadence, Square::Types::SubscriptionCadence, optional: false, nullable: false + field :periods, Integer, optional: true, nullable: false + field :recurring_price_money, Square::Types::Money, optional: true, nullable: false + field :ordinal, Integer, optional: true, nullable: false + field :pricing, Square::Types::SubscriptionPricing, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_pricing.rb b/lib/square/types/subscription_pricing.rb new file mode 100644 index 000000000..f3f76ef9f --- /dev/null +++ b/lib/square/types/subscription_pricing.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes the pricing for the subscription. + class SubscriptionPricing < Internal::Types::Model + field :type, Square::Types::SubscriptionPricingType, optional: true, nullable: false + field :discount_ids, Internal::Types::Array[String], optional: true, nullable: false + field :price_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_pricing_type.rb b/lib/square/types/subscription_pricing_type.rb new file mode 100644 index 000000000..cde4b7a95 --- /dev/null +++ b/lib/square/types/subscription_pricing_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module SubscriptionPricingType + extend Square::Internal::Types::Enum + STATIC = "STATIC" + RELATIVE = "RELATIVE"end + end +end diff --git a/lib/square/types/subscription_source.rb b/lib/square/types/subscription_source.rb new file mode 100644 index 000000000..9206888fa --- /dev/null +++ b/lib/square/types/subscription_source.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # The origination details of the subscription. + class SubscriptionSource < Internal::Types::Model + field :name, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_status.rb b/lib/square/types/subscription_status.rb new file mode 100644 index 000000000..1539cdc5e --- /dev/null +++ b/lib/square/types/subscription_status.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + module SubscriptionStatus + extend Square::Internal::Types::Enum + PENDING = "PENDING" + ACTIVE = "ACTIVE" + CANCELED = "CANCELED" + DEACTIVATED = "DEACTIVATED" + PAUSED = "PAUSED"end + end +end diff --git a/lib/square/types/subscription_test_result.rb b/lib/square/types/subscription_test_result.rb new file mode 100644 index 000000000..7455142a1 --- /dev/null +++ b/lib/square/types/subscription_test_result.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the details of a webhook subscription, including notification URL, + # event types, and signature key. + class SubscriptionTestResult < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :status_code, Integer, optional: true, nullable: false + field :payload, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_updated_event.rb b/lib/square/types/subscription_updated_event.rb new file mode 100644 index 000000000..c44528cd0 --- /dev/null +++ b/lib/square/types/subscription_updated_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Subscription](entity:Subscription) is updated. + # Typically the `subscription.status` is updated as subscriptions become active + # or cancelled. + class SubscriptionUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::SubscriptionUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_updated_event_data.rb b/lib/square/types/subscription_updated_event_data.rb new file mode 100644 index 000000000..868821fd8 --- /dev/null +++ b/lib/square/types/subscription_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class SubscriptionUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::SubscriptionUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/subscription_updated_event_object.rb b/lib/square/types/subscription_updated_event_object.rb new file mode 100644 index 000000000..7ff19f6e2 --- /dev/null +++ b/lib/square/types/subscription_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class SubscriptionUpdatedEventObject < Internal::Types::Model + field :subscription, Square::Types::Subscription, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/swap_plan_response.rb b/lib/square/types/swap_plan_response.rb new file mode 100644 index 000000000..17da9fa27 --- /dev/null +++ b/lib/square/types/swap_plan_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response of the + # [SwapPlan](api-endpoint:Subscriptions-SwapPlan) endpoint. + class SwapPlanResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::Subscription, optional: true, nullable: false + field :actions, Internal::Types::Array[Square::Types::SubscriptionAction], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/tax_calculation_phase.rb b/lib/square/types/tax_calculation_phase.rb new file mode 100644 index 000000000..41df60b09 --- /dev/null +++ b/lib/square/types/tax_calculation_phase.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module TaxCalculationPhase + extend Square::Internal::Types::Enum + TAX_SUBTOTAL_PHASE = "TAX_SUBTOTAL_PHASE" + TAX_TOTAL_PHASE = "TAX_TOTAL_PHASE"end + end +end diff --git a/lib/square/types/tax_ids.rb b/lib/square/types/tax_ids.rb new file mode 100644 index 000000000..11a533964 --- /dev/null +++ b/lib/square/types/tax_ids.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Identifiers for the location used by various governments for tax purposes. + class TaxIds < Internal::Types::Model + field :eu_vat, String, optional: true, nullable: false + field :fr_siret, String, optional: true, nullable: false + field :fr_naf, String, optional: true, nullable: false + field :es_nif, String, optional: true, nullable: false + field :jp_qii, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/tax_inclusion_type.rb b/lib/square/types/tax_inclusion_type.rb new file mode 100644 index 000000000..7358bdd19 --- /dev/null +++ b/lib/square/types/tax_inclusion_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module TaxInclusionType + extend Square::Internal::Types::Enum + ADDITIVE = "ADDITIVE" + INCLUSIVE = "INCLUSIVE"end + end +end diff --git a/lib/square/types/team_member.rb b/lib/square/types/team_member.rb new file mode 100644 index 000000000..9b7bde4a3 --- /dev/null +++ b/lib/square/types/team_member.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Square + module Types + # A record representing an individual team member for a business. + class TeamMember < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :is_owner, Internal::Types::Boolean, optional: true, nullable: false + field :status, Square::Types::TeamMemberStatus, optional: true, nullable: false + field :given_name, String, optional: true, nullable: false + field :family_name, String, optional: true, nullable: false + field :email_address, String, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :assigned_locations, Square::Types::TeamMemberAssignedLocations, optional: true, nullable: false + field :wage_setting, Square::Types::WageSetting, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_assigned_locations.rb b/lib/square/types/team_member_assigned_locations.rb new file mode 100644 index 000000000..37b774008 --- /dev/null +++ b/lib/square/types/team_member_assigned_locations.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # An object that represents a team member's assignment to locations. + class TeamMemberAssignedLocations < Internal::Types::Model + field :assignment_type, Square::Types::TeamMemberAssignedLocationsAssignmentType, optional: true, nullable: false + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_assigned_locations_assignment_type.rb b/lib/square/types/team_member_assigned_locations_assignment_type.rb new file mode 100644 index 000000000..de748b0ad --- /dev/null +++ b/lib/square/types/team_member_assigned_locations_assignment_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module TeamMemberAssignedLocationsAssignmentType + extend Square::Internal::Types::Enum + ALL_CURRENT_AND_FUTURE_LOCATIONS = "ALL_CURRENT_AND_FUTURE_LOCATIONS" + EXPLICIT_LOCATIONS = "EXPLICIT_LOCATIONS"end + end +end diff --git a/lib/square/types/team_member_booking_profile.rb b/lib/square/types/team_member_booking_profile.rb new file mode 100644 index 000000000..cbff3f48f --- /dev/null +++ b/lib/square/types/team_member_booking_profile.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class TeamMemberBookingProfile < Internal::Types::Model + field :team_member_id, String, optional: true, nullable: false + field :description, String, optional: true, nullable: false + field :display_name, String, optional: true, nullable: false + field :is_bookable, Internal::Types::Boolean, optional: true, nullable: false + field :profile_image_url, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_created_event.rb b/lib/square/types/team_member_created_event.rb new file mode 100644 index 000000000..5d4435bdd --- /dev/null +++ b/lib/square/types/team_member_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a Team Member is created. + class TeamMemberCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::TeamMemberCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_created_event_data.rb b/lib/square/types/team_member_created_event_data.rb new file mode 100644 index 000000000..ef0df7866 --- /dev/null +++ b/lib/square/types/team_member_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TeamMemberCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::TeamMemberCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_created_event_object.rb b/lib/square/types/team_member_created_event_object.rb new file mode 100644 index 000000000..a2e3c9662 --- /dev/null +++ b/lib/square/types/team_member_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TeamMemberCreatedEventObject < Internal::Types::Model + field :team_member, Square::Types::TeamMember, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_invitation_status.rb b/lib/square/types/team_member_invitation_status.rb new file mode 100644 index 000000000..ea9941002 --- /dev/null +++ b/lib/square/types/team_member_invitation_status.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module TeamMemberInvitationStatus + extend Square::Internal::Types::Enum + UNINVITED = "UNINVITED" + PENDING = "PENDING" + ACCEPTED = "ACCEPTED"end + end +end diff --git a/lib/square/types/team_member_status.rb b/lib/square/types/team_member_status.rb new file mode 100644 index 000000000..9d555d2b3 --- /dev/null +++ b/lib/square/types/team_member_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module TeamMemberStatus + extend Square::Internal::Types::Enum + ACTIVE = "ACTIVE" + INACTIVE = "INACTIVE"end + end +end diff --git a/lib/square/types/team_member_updated_event.rb b/lib/square/types/team_member_updated_event.rb new file mode 100644 index 000000000..413ea6999 --- /dev/null +++ b/lib/square/types/team_member_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a Team Member is updated. + class TeamMemberUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::TeamMemberUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_updated_event_data.rb b/lib/square/types/team_member_updated_event_data.rb new file mode 100644 index 000000000..a6575973e --- /dev/null +++ b/lib/square/types/team_member_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TeamMemberUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::TeamMemberUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_updated_event_object.rb b/lib/square/types/team_member_updated_event_object.rb new file mode 100644 index 000000000..9c9480716 --- /dev/null +++ b/lib/square/types/team_member_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TeamMemberUpdatedEventObject < Internal::Types::Model + field :team_member, Square::Types::TeamMember, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_wage.rb b/lib/square/types/team_member_wage.rb new file mode 100644 index 000000000..07cbda647 --- /dev/null +++ b/lib/square/types/team_member_wage.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + # Job and wage information for a [team member](entity:TeamMember). + # This convenience object provides details needed to specify the `wage` + # field for a [timecard](entity:Timecard). + class TeamMemberWage < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :title, String, optional: true, nullable: false + field :hourly_rate, Square::Types::Money, optional: true, nullable: false + field :job_id, String, optional: true, nullable: false + field :tip_eligible, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_wage_setting_updated_event.rb b/lib/square/types/team_member_wage_setting_updated_event.rb new file mode 100644 index 000000000..e69550ee7 --- /dev/null +++ b/lib/square/types/team_member_wage_setting_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a Wage Setting is updated. + class TeamMemberWageSettingUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::TeamMemberWageSettingUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_wage_setting_updated_event_data.rb b/lib/square/types/team_member_wage_setting_updated_event_data.rb new file mode 100644 index 000000000..b56d2e4f1 --- /dev/null +++ b/lib/square/types/team_member_wage_setting_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TeamMemberWageSettingUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::TeamMemberWageSettingUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/team_member_wage_setting_updated_event_object.rb b/lib/square/types/team_member_wage_setting_updated_event_object.rb new file mode 100644 index 000000000..33d701282 --- /dev/null +++ b/lib/square/types/team_member_wage_setting_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TeamMemberWageSettingUpdatedEventObject < Internal::Types::Model + field :wage_setting, Square::Types::WageSetting, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/tender.rb b/lib/square/types/tender.rb new file mode 100644 index 000000000..181896e05 --- /dev/null +++ b/lib/square/types/tender.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a tender (i.e., a method of payment) used in a Square transaction. + class Tender < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :transaction_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: true, nullable: false + field :tip_money, Square::Types::Money, optional: true, nullable: false + field :processing_fee_money, Square::Types::Money, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :type, Square::Types::TenderType, optional: false, nullable: false + field :card_details, Square::Types::TenderCardDetails, optional: true, nullable: false + field :cash_details, Square::Types::TenderCashDetails, optional: true, nullable: false + field :bank_account_details, Square::Types::TenderBankAccountDetails, optional: true, nullable: false + field :buy_now_pay_later_details, Square::Types::TenderBuyNowPayLaterDetails, optional: true, nullable: false + field :square_account_details, Square::Types::TenderSquareAccountDetails, optional: true, nullable: false + field :additional_recipients, Internal::Types::Array[Square::Types::AdditionalRecipient], optional: true, nullable: false + field :payment_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/tender_bank_account_details.rb b/lib/square/types/tender_bank_account_details.rb new file mode 100644 index 000000000..bc0809f5f --- /dev/null +++ b/lib/square/types/tender_bank_account_details.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the details of a tender with `type` `BANK_ACCOUNT`. + # + # See [BankAccountPaymentDetails](entity:BankAccountPaymentDetails) + # for more exposed details of a bank account payment. + class TenderBankAccountDetails < Internal::Types::Model + field :status, Square::Types::TenderBankAccountDetailsStatus, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/tender_bank_account_details_status.rb b/lib/square/types/tender_bank_account_details_status.rb new file mode 100644 index 000000000..089f1dc30 --- /dev/null +++ b/lib/square/types/tender_bank_account_details_status.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module TenderBankAccountDetailsStatus + extend Square::Internal::Types::Enum + PENDING = "PENDING" + COMPLETED = "COMPLETED" + FAILED = "FAILED"end + end +end diff --git a/lib/square/types/tender_buy_now_pay_later_details.rb b/lib/square/types/tender_buy_now_pay_later_details.rb new file mode 100644 index 000000000..eca92c616 --- /dev/null +++ b/lib/square/types/tender_buy_now_pay_later_details.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. + class TenderBuyNowPayLaterDetails < Internal::Types::Model + field :buy_now_pay_later_brand, Square::Types::TenderBuyNowPayLaterDetailsBrand, optional: true, nullable: false + field :status, Square::Types::TenderBuyNowPayLaterDetailsStatus, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/tender_buy_now_pay_later_details_brand.rb b/lib/square/types/tender_buy_now_pay_later_details_brand.rb new file mode 100644 index 000000000..849ccc6f2 --- /dev/null +++ b/lib/square/types/tender_buy_now_pay_later_details_brand.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module TenderBuyNowPayLaterDetailsBrand + extend Square::Internal::Types::Enum + OTHER_BRAND = "OTHER_BRAND" + AFTERPAY = "AFTERPAY"end + end +end diff --git a/lib/square/types/tender_buy_now_pay_later_details_status.rb b/lib/square/types/tender_buy_now_pay_later_details_status.rb new file mode 100644 index 000000000..2a132ac7d --- /dev/null +++ b/lib/square/types/tender_buy_now_pay_later_details_status.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module TenderBuyNowPayLaterDetailsStatus + extend Square::Internal::Types::Enum + AUTHORIZED = "AUTHORIZED" + CAPTURED = "CAPTURED" + VOIDED = "VOIDED" + FAILED = "FAILED"end + end +end diff --git a/lib/square/types/tender_card_details.rb b/lib/square/types/tender_card_details.rb new file mode 100644 index 000000000..69f077962 --- /dev/null +++ b/lib/square/types/tender_card_details.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` + class TenderCardDetails < Internal::Types::Model + field :status, Square::Types::TenderCardDetailsStatus, optional: true, nullable: false + field :card, Square::Types::Card, optional: true, nullable: false + field :entry_method, Square::Types::TenderCardDetailsEntryMethod, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/tender_card_details_entry_method.rb b/lib/square/types/tender_card_details_entry_method.rb new file mode 100644 index 000000000..8118a502d --- /dev/null +++ b/lib/square/types/tender_card_details_entry_method.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + module TenderCardDetailsEntryMethod + extend Square::Internal::Types::Enum + SWIPED = "SWIPED" + KEYED = "KEYED" + EMV = "EMV" + ON_FILE = "ON_FILE" + CONTACTLESS = "CONTACTLESS"end + end +end diff --git a/lib/square/types/tender_card_details_status.rb b/lib/square/types/tender_card_details_status.rb new file mode 100644 index 000000000..75f266141 --- /dev/null +++ b/lib/square/types/tender_card_details_status.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module TenderCardDetailsStatus + extend Square::Internal::Types::Enum + AUTHORIZED = "AUTHORIZED" + CAPTURED = "CAPTURED" + VOIDED = "VOIDED" + FAILED = "FAILED"end + end +end diff --git a/lib/square/types/tender_cash_details.rb b/lib/square/types/tender_cash_details.rb new file mode 100644 index 000000000..f3a8265ce --- /dev/null +++ b/lib/square/types/tender_cash_details.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the details of a tender with `type` `CASH`. + class TenderCashDetails < Internal::Types::Model + field :buyer_tendered_money, Square::Types::Money, optional: true, nullable: false + field :change_back_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/tender_square_account_details.rb b/lib/square/types/tender_square_account_details.rb new file mode 100644 index 000000000..8585a62bf --- /dev/null +++ b/lib/square/types/tender_square_account_details.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the details of a tender with `type` `SQUARE_ACCOUNT`. + class TenderSquareAccountDetails < Internal::Types::Model + field :status, Square::Types::TenderSquareAccountDetailsStatus, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/tender_square_account_details_status.rb b/lib/square/types/tender_square_account_details_status.rb new file mode 100644 index 000000000..e33175dbe --- /dev/null +++ b/lib/square/types/tender_square_account_details_status.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module TenderSquareAccountDetailsStatus + extend Square::Internal::Types::Enum + AUTHORIZED = "AUTHORIZED" + CAPTURED = "CAPTURED" + VOIDED = "VOIDED" + FAILED = "FAILED"end + end +end diff --git a/lib/square/types/tender_type.rb b/lib/square/types/tender_type.rb new file mode 100644 index 000000000..84f68dc65 --- /dev/null +++ b/lib/square/types/tender_type.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Square + module Types + module TenderType + extend Square::Internal::Types::Enum + CARD = "CARD" + CASH = "CASH" + THIRD_PARTY_CARD = "THIRD_PARTY_CARD" + SQUARE_GIFT_CARD = "SQUARE_GIFT_CARD" + NO_SALE = "NO_SALE" + BANK_ACCOUNT = "BANK_ACCOUNT" + WALLET = "WALLET" + BUY_NOW_PAY_LATER = "BUY_NOW_PAY_LATER" + SQUARE_ACCOUNT = "SQUARE_ACCOUNT" + OTHER = "OTHER"end + end +end diff --git a/lib/square/types/terminal_action.rb b/lib/square/types/terminal_action.rb new file mode 100644 index 000000000..a50eab4a3 --- /dev/null +++ b/lib/square/types/terminal_action.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an action processed by the Square Terminal. + class TerminalAction < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :device_id, String, optional: true, nullable: false + field :deadline_duration, String, optional: true, nullable: false + field :status, String, optional: true, nullable: false + field :cancel_reason, Square::Types::ActionCancelReason, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :app_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, Square::Types::TerminalActionActionType, optional: true, nullable: false + field :qr_code_options, Square::Types::QrCodeOptions, optional: true, nullable: false + field :save_card_options, Square::Types::SaveCardOptions, optional: true, nullable: false + field :signature_options, Square::Types::SignatureOptions, optional: true, nullable: false + field :confirmation_options, Square::Types::ConfirmationOptions, optional: true, nullable: false + field :receipt_options, Square::Types::ReceiptOptions, optional: true, nullable: false + field :data_collection_options, Square::Types::DataCollectionOptions, optional: true, nullable: false + field :select_options, Square::Types::SelectOptions, optional: true, nullable: false + field :device_metadata, Square::Types::DeviceMetadata, optional: true, nullable: false + field :await_next_action, Internal::Types::Boolean, optional: true, nullable: false + field :await_next_action_duration, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_action_action_type.rb b/lib/square/types/terminal_action_action_type.rb new file mode 100644 index 000000000..46642130b --- /dev/null +++ b/lib/square/types/terminal_action_action_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + module TerminalActionActionType + extend Square::Internal::Types::Enum + QR_CODE = "QR_CODE" + PING = "PING" + SAVE_CARD = "SAVE_CARD" + SIGNATURE = "SIGNATURE" + CONFIRMATION = "CONFIRMATION" + RECEIPT = "RECEIPT" + DATA_COLLECTION = "DATA_COLLECTION" + SELECT = "SELECT"end + end +end diff --git a/lib/square/types/terminal_action_created_event.rb b/lib/square/types/terminal_action_created_event.rb new file mode 100644 index 000000000..2376b4ef2 --- /dev/null +++ b/lib/square/types/terminal_action_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a TerminalAction is created. + class TerminalActionCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::TerminalActionCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_action_created_event_data.rb b/lib/square/types/terminal_action_created_event_data.rb new file mode 100644 index 000000000..3b0a9992d --- /dev/null +++ b/lib/square/types/terminal_action_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalActionCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::TerminalActionCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_action_created_event_object.rb b/lib/square/types/terminal_action_created_event_object.rb new file mode 100644 index 000000000..3744cfe2d --- /dev/null +++ b/lib/square/types/terminal_action_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalActionCreatedEventObject < Internal::Types::Model + field :action, Square::Types::TerminalAction, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_action_query.rb b/lib/square/types/terminal_action_query.rb new file mode 100644 index 000000000..b6e4c5c0e --- /dev/null +++ b/lib/square/types/terminal_action_query.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalActionQuery < Internal::Types::Model + field :filter, Square::Types::TerminalActionQueryFilter, optional: true, nullable: false + field :sort, Square::Types::TerminalActionQuerySort, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_action_query_filter.rb b/lib/square/types/terminal_action_query_filter.rb new file mode 100644 index 000000000..8fa2e33d4 --- /dev/null +++ b/lib/square/types/terminal_action_query_filter.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalActionQueryFilter < Internal::Types::Model + field :device_id, String, optional: true, nullable: false + field :created_at, Square::Types::TimeRange, optional: true, nullable: false + field :status, String, optional: true, nullable: false + field :type, Square::Types::TerminalActionActionType, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_action_query_sort.rb b/lib/square/types/terminal_action_query_sort.rb new file mode 100644 index 000000000..7011c49bc --- /dev/null +++ b/lib/square/types/terminal_action_query_sort.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalActionQuerySort < Internal::Types::Model + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_action_updated_event.rb b/lib/square/types/terminal_action_updated_event.rb new file mode 100644 index 000000000..2bbfdf2b5 --- /dev/null +++ b/lib/square/types/terminal_action_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a TerminalAction is updated. + class TerminalActionUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::TerminalActionUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_action_updated_event_data.rb b/lib/square/types/terminal_action_updated_event_data.rb new file mode 100644 index 000000000..76b277154 --- /dev/null +++ b/lib/square/types/terminal_action_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalActionUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::TerminalActionUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_action_updated_event_object.rb b/lib/square/types/terminal_action_updated_event_object.rb new file mode 100644 index 000000000..fe747a395 --- /dev/null +++ b/lib/square/types/terminal_action_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalActionUpdatedEventObject < Internal::Types::Model + field :action, Square::Types::TerminalAction, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_checkout.rb b/lib/square/types/terminal_checkout.rb new file mode 100644 index 000000000..7070c1ae9 --- /dev/null +++ b/lib/square/types/terminal_checkout.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a checkout processed by the Square Terminal. + class TerminalCheckout < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :reference_id, String, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + field :payment_options, Square::Types::PaymentOptions, optional: true, nullable: false + field :device_options, Square::Types::DeviceCheckoutOptions, optional: false, nullable: false + field :deadline_duration, String, optional: true, nullable: false + field :status, String, optional: true, nullable: false + field :cancel_reason, Square::Types::ActionCancelReason, optional: true, nullable: false + field :payment_ids, Internal::Types::Array[String], optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :app_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :payment_type, Square::Types::CheckoutOptionsPaymentType, optional: true, nullable: false + field :team_member_id, String, optional: true, nullable: false + field :customer_id, String, optional: true, nullable: false + field :app_fee_money, Square::Types::Money, optional: true, nullable: false + field :statement_description_identifier, String, optional: true, nullable: false + field :tip_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_checkout_created_event.rb b/lib/square/types/terminal_checkout_created_event.rb new file mode 100644 index 000000000..d7ce61caf --- /dev/null +++ b/lib/square/types/terminal_checkout_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [TerminalCheckout](entity:TerminalCheckout) is created. + class TerminalCheckoutCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::TerminalCheckoutCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_checkout_created_event_data.rb b/lib/square/types/terminal_checkout_created_event_data.rb new file mode 100644 index 000000000..776394d81 --- /dev/null +++ b/lib/square/types/terminal_checkout_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalCheckoutCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::TerminalCheckoutCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_checkout_created_event_object.rb b/lib/square/types/terminal_checkout_created_event_object.rb new file mode 100644 index 000000000..fdf25f335 --- /dev/null +++ b/lib/square/types/terminal_checkout_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalCheckoutCreatedEventObject < Internal::Types::Model + field :checkout, Square::Types::TerminalCheckout, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_checkout_query.rb b/lib/square/types/terminal_checkout_query.rb new file mode 100644 index 000000000..1ea90fe6c --- /dev/null +++ b/lib/square/types/terminal_checkout_query.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalCheckoutQuery < Internal::Types::Model + field :filter, Square::Types::TerminalCheckoutQueryFilter, optional: true, nullable: false + field :sort, Square::Types::TerminalCheckoutQuerySort, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_checkout_query_filter.rb b/lib/square/types/terminal_checkout_query_filter.rb new file mode 100644 index 000000000..ded8e66c7 --- /dev/null +++ b/lib/square/types/terminal_checkout_query_filter.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalCheckoutQueryFilter < Internal::Types::Model + field :device_id, String, optional: true, nullable: false + field :created_at, Square::Types::TimeRange, optional: true, nullable: false + field :status, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_checkout_query_sort.rb b/lib/square/types/terminal_checkout_query_sort.rb new file mode 100644 index 000000000..34afa2569 --- /dev/null +++ b/lib/square/types/terminal_checkout_query_sort.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalCheckoutQuerySort < Internal::Types::Model + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_checkout_updated_event.rb b/lib/square/types/terminal_checkout_updated_event.rb new file mode 100644 index 000000000..92f162453 --- /dev/null +++ b/lib/square/types/terminal_checkout_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [TerminalCheckout](entity:TerminalCheckout) is updated. + class TerminalCheckoutUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::TerminalCheckoutUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_checkout_updated_event_data.rb b/lib/square/types/terminal_checkout_updated_event_data.rb new file mode 100644 index 000000000..9d37f57b7 --- /dev/null +++ b/lib/square/types/terminal_checkout_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalCheckoutUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::TerminalCheckoutUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_checkout_updated_event_object.rb b/lib/square/types/terminal_checkout_updated_event_object.rb new file mode 100644 index 000000000..4b3fe1afd --- /dev/null +++ b/lib/square/types/terminal_checkout_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalCheckoutUpdatedEventObject < Internal::Types::Model + field :checkout, Square::Types::TerminalCheckout, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_refund.rb b/lib/square/types/terminal_refund.rb new file mode 100644 index 000000000..32c6750ad --- /dev/null +++ b/lib/square/types/terminal_refund.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. + class TerminalRefund < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :refund_id, String, optional: true, nullable: false + field :payment_id, String, optional: false, nullable: false + field :order_id, String, optional: true, nullable: false + field :amount_money, Square::Types::Money, optional: false, nullable: false + field :reason, String, optional: false, nullable: false + field :device_id, String, optional: false, nullable: false + field :deadline_duration, String, optional: true, nullable: false + field :status, String, optional: true, nullable: false + field :cancel_reason, Square::Types::ActionCancelReason, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :app_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_refund_created_event.rb b/lib/square/types/terminal_refund_created_event.rb new file mode 100644 index 000000000..f7e333981 --- /dev/null +++ b/lib/square/types/terminal_refund_created_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a Terminal API refund is created. + class TerminalRefundCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::TerminalRefundCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_refund_created_event_data.rb b/lib/square/types/terminal_refund_created_event_data.rb new file mode 100644 index 000000000..b05b29b8e --- /dev/null +++ b/lib/square/types/terminal_refund_created_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalRefundCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::TerminalRefundCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_refund_created_event_object.rb b/lib/square/types/terminal_refund_created_event_object.rb new file mode 100644 index 000000000..71e9a1c45 --- /dev/null +++ b/lib/square/types/terminal_refund_created_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalRefundCreatedEventObject < Internal::Types::Model + field :refund, Square::Types::TerminalRefund, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_refund_query.rb b/lib/square/types/terminal_refund_query.rb new file mode 100644 index 000000000..79e3f2dee --- /dev/null +++ b/lib/square/types/terminal_refund_query.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalRefundQuery < Internal::Types::Model + field :filter, Square::Types::TerminalRefundQueryFilter, optional: true, nullable: false + field :sort, Square::Types::TerminalRefundQuerySort, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_refund_query_filter.rb b/lib/square/types/terminal_refund_query_filter.rb new file mode 100644 index 000000000..e67662955 --- /dev/null +++ b/lib/square/types/terminal_refund_query_filter.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalRefundQueryFilter < Internal::Types::Model + field :device_id, String, optional: true, nullable: false + field :created_at, Square::Types::TimeRange, optional: true, nullable: false + field :status, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_refund_query_sort.rb b/lib/square/types/terminal_refund_query_sort.rb new file mode 100644 index 000000000..a1df9beae --- /dev/null +++ b/lib/square/types/terminal_refund_query_sort.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalRefundQuerySort < Internal::Types::Model + field :sort_order, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_refund_updated_event.rb b/lib/square/types/terminal_refund_updated_event.rb new file mode 100644 index 000000000..3787d4830 --- /dev/null +++ b/lib/square/types/terminal_refund_updated_event.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a Terminal API refund is updated. + class TerminalRefundUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::TerminalRefundUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_refund_updated_event_data.rb b/lib/square/types/terminal_refund_updated_event_data.rb new file mode 100644 index 000000000..4f615cf31 --- /dev/null +++ b/lib/square/types/terminal_refund_updated_event_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalRefundUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::TerminalRefundUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/terminal_refund_updated_event_object.rb b/lib/square/types/terminal_refund_updated_event_object.rb new file mode 100644 index 000000000..56d35f666 --- /dev/null +++ b/lib/square/types/terminal_refund_updated_event_object.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class TerminalRefundUpdatedEventObject < Internal::Types::Model + field :refund, Square::Types::TerminalRefund, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/test_webhook_subscription_response.rb b/lib/square/types/test_webhook_subscription_response.rb new file mode 100644 index 000000000..b4f6c97f2 --- /dev/null +++ b/lib/square/types/test_webhook_subscription_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [TestWebhookSubscription](api-endpoint:WebhookSubscriptions-TestWebhookSubscription) endpoint. + # + # Note: If there are errors processing the request, the [SubscriptionTestResult](entity:SubscriptionTestResult) field is not + # present. + class TestWebhookSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription_test_result, Square::Types::SubscriptionTestResult, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/time_range.rb b/lib/square/types/time_range.rb new file mode 100644 index 000000000..781a1d319 --- /dev/null +++ b/lib/square/types/time_range.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class TimeRange < Internal::Types::Model + field :start_at, String, optional: true, nullable: false + field :end_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/timecard.rb b/lib/square/types/timecard.rb new file mode 100644 index 000000000..f9be9ae5f --- /dev/null +++ b/lib/square/types/timecard.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Square + module Types + # A record of the hourly rate, start time, and end time of a single timecard (shift) + # for a team member. This might include a record of the start and end times of breaks + # taken during the shift. + class Timecard < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :location_id, String, optional: false, nullable: false + field :timezone, String, optional: true, nullable: false + field :start_at, String, optional: false, nullable: false + field :end_at, String, optional: true, nullable: false + field :wage, Square::Types::TimecardWage, optional: true, nullable: false + field :breaks, Internal::Types::Array[Square::Types::Break], optional: true, nullable: false + field :status, Square::Types::TimecardStatus, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :team_member_id, String, optional: false, nullable: false + field :declared_cash_tip_money, Square::Types::Money, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/timecard_filter.rb b/lib/square/types/timecard_filter.rb new file mode 100644 index 000000000..a5f631870 --- /dev/null +++ b/lib/square/types/timecard_filter.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines a filter used in a search for `Timecard` records. `AND` logic is + # used by Square's servers to apply each filter property specified. + class TimecardFilter < Internal::Types::Model + field :location_ids, Internal::Types::Array[String], optional: true, nullable: false + field :status, Square::Types::TimecardFilterStatus, optional: true, nullable: false + field :start, Square::Types::TimeRange, optional: true, nullable: false + field :end_, Square::Types::TimeRange, optional: true, nullable: false + field :workday, Square::Types::TimecardWorkday, optional: true, nullable: false + field :team_member_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/timecard_filter_status.rb b/lib/square/types/timecard_filter_status.rb new file mode 100644 index 000000000..a90eeb8ed --- /dev/null +++ b/lib/square/types/timecard_filter_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module TimecardFilterStatus + extend Square::Internal::Types::Enum + OPEN = "OPEN" + CLOSED = "CLOSED"end + end +end diff --git a/lib/square/types/timecard_query.rb b/lib/square/types/timecard_query.rb new file mode 100644 index 000000000..d6628797e --- /dev/null +++ b/lib/square/types/timecard_query.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The parameters of a `Timecard` search query, which includes filter and sort options. + class TimecardQuery < Internal::Types::Model + field :filter, Square::Types::TimecardFilter, optional: true, nullable: false + field :sort, Square::Types::TimecardSort, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/timecard_sort.rb b/lib/square/types/timecard_sort.rb new file mode 100644 index 000000000..e3d25c6fe --- /dev/null +++ b/lib/square/types/timecard_sort.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Sets the sort order of search results. + class TimecardSort < Internal::Types::Model + field :field, Square::Types::TimecardSortField, optional: true, nullable: false + field :order, Square::Types::SortOrder, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/timecard_sort_field.rb b/lib/square/types/timecard_sort_field.rb new file mode 100644 index 000000000..f6e38c45f --- /dev/null +++ b/lib/square/types/timecard_sort_field.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + module TimecardSortField + extend Square::Internal::Types::Enum + START_AT = "START_AT" + END_AT = "END_AT" + CREATED_AT = "CREATED_AT" + UPDATED_AT = "UPDATED_AT"end + end +end diff --git a/lib/square/types/timecard_status.rb b/lib/square/types/timecard_status.rb new file mode 100644 index 000000000..f27346110 --- /dev/null +++ b/lib/square/types/timecard_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module TimecardStatus + extend Square::Internal::Types::Enum + OPEN = "OPEN" + CLOSED = "CLOSED"end + end +end diff --git a/lib/square/types/timecard_wage.rb b/lib/square/types/timecard_wage.rb new file mode 100644 index 000000000..58a54a64b --- /dev/null +++ b/lib/square/types/timecard_wage.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # The hourly wage rate used to compensate a team member for a [timecard](entity:Timecard). + class TimecardWage < Internal::Types::Model + field :title, String, optional: true, nullable: false + field :hourly_rate, Square::Types::Money, optional: true, nullable: false + field :job_id, String, optional: true, nullable: false + field :tip_eligible, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/timecard_workday.rb b/lib/square/types/timecard_workday.rb new file mode 100644 index 000000000..96ab52d24 --- /dev/null +++ b/lib/square/types/timecard_workday.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # A `Timecard` search query filter parameter that sets a range of days that + # a `Timecard` must start or end in before passing the filter condition. + class TimecardWorkday < Internal::Types::Model + field :date_range, Square::Types::DateRange, optional: true, nullable: false + field :match_timecards_by, Square::Types::TimecardWorkdayMatcher, optional: true, nullable: false + field :default_timezone, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/timecard_workday_matcher.rb b/lib/square/types/timecard_workday_matcher.rb new file mode 100644 index 000000000..53c922e0f --- /dev/null +++ b/lib/square/types/timecard_workday_matcher.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module TimecardWorkdayMatcher + extend Square::Internal::Types::Enum + START_AT = "START_AT" + END_AT = "END_AT" + INTERSECTION = "INTERSECTION"end + end +end diff --git a/lib/square/types/tip_settings.rb b/lib/square/types/tip_settings.rb new file mode 100644 index 000000000..9aae14667 --- /dev/null +++ b/lib/square/types/tip_settings.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + class TipSettings < Internal::Types::Model + field :allow_tipping, Internal::Types::Boolean, optional: true, nullable: false + field :separate_tip_screen, Internal::Types::Boolean, optional: true, nullable: false + field :custom_tip_field, Internal::Types::Boolean, optional: true, nullable: false + field :tip_percentages, Internal::Types::Array[Integer], optional: true, nullable: false + field :smart_tipping, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/transaction.rb b/lib/square/types/transaction.rb new file mode 100644 index 000000000..e0c859b4e --- /dev/null +++ b/lib/square/types/transaction.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class Transaction < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :tenders, Internal::Types::Array[Square::Types::Tender], optional: true, nullable: false + field :refunds, Internal::Types::Array[Square::Types::Refund], optional: true, nullable: false + field :reference_id, String, optional: true, nullable: false + field :product, Square::Types::TransactionProduct, optional: true, nullable: false + field :client_id, String, optional: true, nullable: false + field :shipping_address, Square::Types::Address, optional: true, nullable: false + field :order_id, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/transaction_product.rb b/lib/square/types/transaction_product.rb new file mode 100644 index 000000000..05918f551 --- /dev/null +++ b/lib/square/types/transaction_product.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + module TransactionProduct + extend Square::Internal::Types::Enum + REGISTER = "REGISTER" + EXTERNAL_API = "EXTERNAL_API" + BILLING = "BILLING" + APPOINTMENTS = "APPOINTMENTS" + INVOICES = "INVOICES" + ONLINE_STORE = "ONLINE_STORE" + PAYROLL = "PAYROLL" + OTHER = "OTHER"end + end +end diff --git a/lib/square/types/transaction_type.rb b/lib/square/types/transaction_type.rb new file mode 100644 index 000000000..81d3596b2 --- /dev/null +++ b/lib/square/types/transaction_type.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module TransactionType + extend Square::Internal::Types::Enum + DEBIT = "DEBIT" + CREDIT = "CREDIT"end + end +end diff --git a/lib/square/types/unlink_customer_from_gift_card_response.rb b/lib/square/types/unlink_customer_from_gift_card_response.rb new file mode 100644 index 000000000..246858091 --- /dev/null +++ b/lib/square/types/unlink_customer_from_gift_card_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # A response that contains the unlinked `GiftCard` object. If the request resulted in errors, + # the response contains a set of `Error` objects. + class UnlinkCustomerFromGiftCardResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :gift_card, Square::Types::GiftCard, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_booking_custom_attribute_definition_response.rb b/lib/square/types/update_booking_custom_attribute_definition_response.rb new file mode 100644 index 000000000..a890b1133 --- /dev/null +++ b/lib/square/types/update_booking_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class UpdateBookingCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_booking_response.rb b/lib/square/types/update_booking_response.rb new file mode 100644 index 000000000..55600008d --- /dev/null +++ b/lib/square/types/update_booking_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class UpdateBookingResponse < Internal::Types::Model + field :booking, Square::Types::Booking, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_break_type_response.rb b/lib/square/types/update_break_type_response.rb new file mode 100644 index 000000000..4ae7a8f5d --- /dev/null +++ b/lib/square/types/update_break_type_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class UpdateBreakTypeResponse < Internal::Types::Model + field :break_type, Square::Types::BreakType, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_catalog_image_request.rb b/lib/square/types/update_catalog_image_request.rb new file mode 100644 index 000000000..4998aacaa --- /dev/null +++ b/lib/square/types/update_catalog_image_request.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + class UpdateCatalogImageRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/update_catalog_image_response.rb b/lib/square/types/update_catalog_image_response.rb new file mode 100644 index 000000000..4e59f1216 --- /dev/null +++ b/lib/square/types/update_catalog_image_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class UpdateCatalogImageResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :image, Square::Types::CatalogObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_customer_custom_attribute_definition_response.rb b/lib/square/types/update_customer_custom_attribute_definition_response.rb new file mode 100644 index 000000000..2a5817b6e --- /dev/null +++ b/lib/square/types/update_customer_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class UpdateCustomerCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_customer_group_response.rb b/lib/square/types/update_customer_group_response.rb new file mode 100644 index 000000000..e4d3cd7ff --- /dev/null +++ b/lib/square/types/update_customer_group_response.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [UpdateCustomerGroup](api-endpoint:CustomerGroups-UpdateCustomerGroup) endpoint. + # + # Either `errors` or `group` is present in a given response (never both). + class UpdateCustomerGroupResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :group, Square::Types::CustomerGroup, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_customer_response.rb b/lib/square/types/update_customer_response.rb new file mode 100644 index 000000000..bb5ca9ac6 --- /dev/null +++ b/lib/square/types/update_customer_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [UpdateCustomer](api-endpoint:Customers-UpdateCustomer) or + # [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint. + # + # Either `errors` or `customer` is present in a given response (never both). + class UpdateCustomerResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :customer, Square::Types::Customer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_invoice_response.rb b/lib/square/types/update_invoice_response.rb new file mode 100644 index 000000000..a576c63eb --- /dev/null +++ b/lib/square/types/update_invoice_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Describes a `UpdateInvoice` response. + class UpdateInvoiceResponse < Internal::Types::Model + field :invoice, Square::Types::Invoice, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_item_modifier_lists_response.rb b/lib/square/types/update_item_modifier_lists_response.rb new file mode 100644 index 000000000..319c3d183 --- /dev/null +++ b/lib/square/types/update_item_modifier_lists_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class UpdateItemModifierListsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_item_taxes_response.rb b/lib/square/types/update_item_taxes_response.rb new file mode 100644 index 000000000..c6da36bd9 --- /dev/null +++ b/lib/square/types/update_item_taxes_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class UpdateItemTaxesResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_job_response.rb b/lib/square/types/update_job_response.rb new file mode 100644 index 000000000..42f457908 --- /dev/null +++ b/lib/square/types/update_job_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [UpdateJob](api-endpoint:Team-UpdateJob) response. Either `job` or `errors` + # is present in the response. + class UpdateJobResponse < Internal::Types::Model + field :job, Square::Types::Job, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_location_custom_attribute_definition_response.rb b/lib/square/types/update_location_custom_attribute_definition_response.rb new file mode 100644 index 000000000..bae1fb1f3 --- /dev/null +++ b/lib/square/types/update_location_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class UpdateLocationCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_location_response.rb b/lib/square/types/update_location_response.rb new file mode 100644 index 000000000..d49c48e2d --- /dev/null +++ b/lib/square/types/update_location_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # The response object returned by the [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint. + class UpdateLocationResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :location, Square::Types::Location, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_location_settings_response.rb b/lib/square/types/update_location_settings_response.rb new file mode 100644 index 000000000..7b2b36a0d --- /dev/null +++ b/lib/square/types/update_location_settings_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class UpdateLocationSettingsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :location_settings, Square::Types::CheckoutLocationSettings, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_merchant_custom_attribute_definition_response.rb b/lib/square/types/update_merchant_custom_attribute_definition_response.rb new file mode 100644 index 000000000..30c72d4f1 --- /dev/null +++ b/lib/square/types/update_merchant_custom_attribute_definition_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class UpdateMerchantCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_merchant_settings_response.rb b/lib/square/types/update_merchant_settings_response.rb new file mode 100644 index 000000000..8273f0e19 --- /dev/null +++ b/lib/square/types/update_merchant_settings_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class UpdateMerchantSettingsResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :merchant_settings, Square::Types::CheckoutMerchantSettings, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_order_custom_attribute_definition_response.rb b/lib/square/types/update_order_custom_attribute_definition_response.rb new file mode 100644 index 000000000..b9e4bbfea --- /dev/null +++ b/lib/square/types/update_order_custom_attribute_definition_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from updating an order custom attribute definition. + class UpdateOrderCustomAttributeDefinitionResponse < Internal::Types::Model + field :custom_attribute_definition, Square::Types::CustomAttributeDefinition, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_order_response.rb b/lib/square/types/update_order_response.rb new file mode 100644 index 000000000..9b162191a --- /dev/null +++ b/lib/square/types/update_order_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. + class UpdateOrderResponse < Internal::Types::Model + field :order, Square::Types::Order, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_payment_link_response.rb b/lib/square/types/update_payment_link_response.rb new file mode 100644 index 000000000..2ea5a8941 --- /dev/null +++ b/lib/square/types/update_payment_link_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class UpdatePaymentLinkResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :payment_link, Square::Types::PaymentLink, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_payment_response.rb b/lib/square/types/update_payment_response.rb new file mode 100644 index 000000000..bed195a8d --- /dev/null +++ b/lib/square/types/update_payment_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the response returned by + # [UpdatePayment](api-endpoint:Payments-UpdatePayment). + class UpdatePaymentResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :payment, Square::Types::Payment, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_scheduled_shift_response.rb b/lib/square/types/update_scheduled_shift_response.rb new file mode 100644 index 000000000..b09cb00ca --- /dev/null +++ b/lib/square/types/update_scheduled_shift_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [UpdateScheduledShift](api-endpoint:Labor-UpdateScheduledShift) response. + # Either `scheduled_shift` or `errors` is present in the response. + class UpdateScheduledShiftResponse < Internal::Types::Model + field :scheduled_shift, Square::Types::ScheduledShift, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_shift_response.rb b/lib/square/types/update_shift_response.rb new file mode 100644 index 000000000..7628443b5 --- /dev/null +++ b/lib/square/types/update_shift_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class UpdateShiftResponse < Internal::Types::Model + field :shift, Square::Types::Shift, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_subscription_response.rb b/lib/square/types/update_subscription_response.rb new file mode 100644 index 000000000..94175e805 --- /dev/null +++ b/lib/square/types/update_subscription_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines output parameters in a response from the + # [UpdateSubscription](api-endpoint:Subscriptions-UpdateSubscription) endpoint. + class UpdateSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::Subscription, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_team_member_request.rb b/lib/square/types/update_team_member_request.rb new file mode 100644 index 000000000..edfca8064 --- /dev/null +++ b/lib/square/types/update_team_member_request.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an update request for a `TeamMember` object. + class UpdateTeamMemberRequest < Internal::Types::Model + field :team_member, Square::Types::TeamMember, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_team_member_response.rb b/lib/square/types/update_team_member_response.rb new file mode 100644 index 000000000..04d32b468 --- /dev/null +++ b/lib/square/types/update_team_member_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from an update request containing the updated `TeamMember` object or error messages. + class UpdateTeamMemberResponse < Internal::Types::Model + field :team_member, Square::Types::TeamMember, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_timecard_response.rb b/lib/square/types/update_timecard_response.rb new file mode 100644 index 000000000..580e2ffbf --- /dev/null +++ b/lib/square/types/update_timecard_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # The response to a request to update a `Timecard`. The response contains + # the updated `Timecard` object and might contain a set of `Error` objects if + # the request resulted in errors. + class UpdateTimecardResponse < Internal::Types::Model + field :timecard, Square::Types::Timecard, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_vendor_request.rb b/lib/square/types/update_vendor_request.rb new file mode 100644 index 000000000..1a6b814c5 --- /dev/null +++ b/lib/square/types/update_vendor_request.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an input to a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor). + class UpdateVendorRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :vendor, Square::Types::Vendor, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/update_vendor_response.rb b/lib/square/types/update_vendor_response.rb new file mode 100644 index 000000000..6794d346c --- /dev/null +++ b/lib/square/types/update_vendor_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an output from a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor). + class UpdateVendorResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :vendor, Square::Types::Vendor, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_wage_setting_response.rb b/lib/square/types/update_wage_setting_response.rb new file mode 100644 index 000000000..42ba7724f --- /dev/null +++ b/lib/square/types/update_wage_setting_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from an update request containing the updated `WageSetting` object + # or error messages. + class UpdateWageSettingResponse < Internal::Types::Model + field :wage_setting, Square::Types::WageSetting, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_webhook_subscription_response.rb b/lib/square/types/update_webhook_subscription_response.rb new file mode 100644 index 000000000..0f480d9f6 --- /dev/null +++ b/lib/square/types/update_webhook_subscription_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [UpdateWebhookSubscription](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscription) endpoint. + # + # Note: If there are errors processing the request, the [Subscription](entity:WebhookSubscription) is not + # present. + class UpdateWebhookSubscriptionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :subscription, Square::Types::WebhookSubscription, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_webhook_subscription_signature_key_response.rb b/lib/square/types/update_webhook_subscription_signature_key_response.rb new file mode 100644 index 000000000..fe9b8027b --- /dev/null +++ b/lib/square/types/update_webhook_subscription_signature_key_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) endpoint. + # + # Note: If there are errors processing the request, the [Subscription](entity:WebhookSubscription) is not + # present. + class UpdateWebhookSubscriptionSignatureKeyResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :signature_key, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/update_workweek_config_response.rb b/lib/square/types/update_workweek_config_response.rb new file mode 100644 index 000000000..b49cc4cbe --- /dev/null +++ b/lib/square/types/update_workweek_config_response.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class UpdateWorkweekConfigResponse < Internal::Types::Model + field :workweek_config, Square::Types::WorkweekConfig, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/upsert_booking_custom_attribute_response.rb b/lib/square/types/upsert_booking_custom_attribute_response.rb new file mode 100644 index 000000000..e779a3a27 --- /dev/null +++ b/lib/square/types/upsert_booking_custom_attribute_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class UpsertBookingCustomAttributeResponse < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/upsert_catalog_object_response.rb b/lib/square/types/upsert_catalog_object_response.rb new file mode 100644 index 000000000..73cf1cdf7 --- /dev/null +++ b/lib/square/types/upsert_catalog_object_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + class UpsertCatalogObjectResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :catalog_object, Square::Types::CatalogObject, optional: true, nullable: false + field :id_mappings, Internal::Types::Array[Square::Types::CatalogIdMapping], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/upsert_customer_custom_attribute_response.rb b/lib/square/types/upsert_customer_custom_attribute_response.rb new file mode 100644 index 000000000..826176075 --- /dev/null +++ b/lib/square/types/upsert_customer_custom_attribute_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class UpsertCustomerCustomAttributeResponse < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/upsert_location_custom_attribute_response.rb b/lib/square/types/upsert_location_custom_attribute_response.rb new file mode 100644 index 000000000..885bf07af --- /dev/null +++ b/lib/square/types/upsert_location_custom_attribute_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class UpsertLocationCustomAttributeResponse < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/upsert_merchant_custom_attribute_response.rb b/lib/square/types/upsert_merchant_custom_attribute_response.rb new file mode 100644 index 000000000..b82b866da --- /dev/null +++ b/lib/square/types/upsert_merchant_custom_attribute_response.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) response. + # Either `custom_attribute_definition` or `errors` is present in the response. + class UpsertMerchantCustomAttributeResponse < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/upsert_order_custom_attribute_response.rb b/lib/square/types/upsert_order_custom_attribute_response.rb new file mode 100644 index 000000000..b82fb6a21 --- /dev/null +++ b/lib/square/types/upsert_order_custom_attribute_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a response from upserting order custom attribute definitions. + class UpsertOrderCustomAttributeResponse < Internal::Types::Model + field :custom_attribute, Square::Types::CustomAttribute, optional: true, nullable: false + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/upsert_snippet_response.rb b/lib/square/types/upsert_snippet_response.rb new file mode 100644 index 000000000..e3d3cf982 --- /dev/null +++ b/lib/square/types/upsert_snippet_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents an `UpsertSnippet` response. The response can include either `snippet` or `errors`. + class UpsertSnippetResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :snippet, Square::Types::Snippet, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/v_1_money.rb b/lib/square/types/v_1_money.rb new file mode 100644 index 000000000..6d4ce4c48 --- /dev/null +++ b/lib/square/types/v_1_money.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class V1Money < Internal::Types::Model + field :amount, Integer, optional: true, nullable: false + field :currency_code, Square::Types::Currency, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/v_1_order.rb b/lib/square/types/v_1_order.rb new file mode 100644 index 000000000..2e425adca --- /dev/null +++ b/lib/square/types/v_1_order.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Square + module Types + # V1Order + class V1Order < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :buyer_email, String, optional: true, nullable: false + field :recipient_name, String, optional: true, nullable: false + field :recipient_phone_number, String, optional: true, nullable: false + field :state, Square::Types::V1OrderState, optional: true, nullable: false + field :shipping_address, Square::Types::Address, optional: true, nullable: false + field :subtotal_money, Square::Types::V1Money, optional: true, nullable: false + field :total_shipping_money, Square::Types::V1Money, optional: true, nullable: false + field :total_tax_money, Square::Types::V1Money, optional: true, nullable: false + field :total_price_money, Square::Types::V1Money, optional: true, nullable: false + field :total_discount_money, Square::Types::V1Money, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :expires_at, String, optional: true, nullable: false + field :payment_id, String, optional: true, nullable: false + field :buyer_note, String, optional: true, nullable: false + field :completed_note, String, optional: true, nullable: false + field :refunded_note, String, optional: true, nullable: false + field :canceled_note, String, optional: true, nullable: false + field :tender, Square::Types::V1Tender, optional: true, nullable: false + field :order_history, Internal::Types::Array[Square::Types::V1OrderHistoryEntry], optional: true, nullable: false + field :promo_code, String, optional: true, nullable: false + field :btc_receive_address, String, optional: true, nullable: false + field :btc_price_satoshi, Integer, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/v_1_order_history_entry.rb b/lib/square/types/v_1_order_history_entry.rb new file mode 100644 index 000000000..7198e8330 --- /dev/null +++ b/lib/square/types/v_1_order_history_entry.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # V1OrderHistoryEntry + class V1OrderHistoryEntry < Internal::Types::Model + field :action, Square::Types::V1OrderHistoryEntryAction, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/v_1_order_history_entry_action.rb b/lib/square/types/v_1_order_history_entry_action.rb new file mode 100644 index 000000000..16ba4546e --- /dev/null +++ b/lib/square/types/v_1_order_history_entry_action.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + module V1OrderHistoryEntryAction + extend Square::Internal::Types::Enum + ORDER_PLACED = "ORDER_PLACED" + DECLINED = "DECLINED" + PAYMENT_RECEIVED = "PAYMENT_RECEIVED" + CANCELED = "CANCELED" + COMPLETED = "COMPLETED" + REFUNDED = "REFUNDED" + EXPIRED = "EXPIRED"end + end +end diff --git a/lib/square/types/v_1_order_state.rb b/lib/square/types/v_1_order_state.rb new file mode 100644 index 000000000..d79fbab92 --- /dev/null +++ b/lib/square/types/v_1_order_state.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Square + module Types + module V1OrderState + extend Square::Internal::Types::Enum + PENDING = "PENDING" + OPEN = "OPEN" + COMPLETED = "COMPLETED" + CANCELED = "CANCELED" + REFUNDED = "REFUNDED" + REJECTED = "REJECTED"end + end +end diff --git a/lib/square/types/v_1_tender.rb b/lib/square/types/v_1_tender.rb new file mode 100644 index 000000000..6a00e7fc2 --- /dev/null +++ b/lib/square/types/v_1_tender.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Square + module Types + # 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. + class V1Tender < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :type, Square::Types::V1TenderType, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :employee_id, String, optional: true, nullable: false + field :receipt_url, String, optional: true, nullable: false + field :card_brand, Square::Types::V1TenderCardBrand, optional: true, nullable: false + field :pan_suffix, String, optional: true, nullable: false + field :entry_method, Square::Types::V1TenderEntryMethod, optional: true, nullable: false + field :payment_note, String, optional: true, nullable: false + field :total_money, Square::Types::V1Money, optional: true, nullable: false + field :tendered_money, Square::Types::V1Money, optional: true, nullable: false + field :tendered_at, String, optional: true, nullable: false + field :settled_at, String, optional: true, nullable: false + field :change_back_money, Square::Types::V1Money, optional: true, nullable: false + field :refunded_money, Square::Types::V1Money, optional: true, nullable: false + field :is_exchange, Internal::Types::Boolean, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/v_1_tender_card_brand.rb b/lib/square/types/v_1_tender_card_brand.rb new file mode 100644 index 000000000..81c788dfb --- /dev/null +++ b/lib/square/types/v_1_tender_card_brand.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + module V1TenderCardBrand + extend Square::Internal::Types::Enum + OTHER_BRAND = "OTHER_BRAND" + VISA = "VISA" + MASTER_CARD = "MASTER_CARD" + AMERICAN_EXPRESS = "AMERICAN_EXPRESS" + DISCOVER = "DISCOVER" + DISCOVER_DINERS = "DISCOVER_DINERS" + JCB = "JCB" + CHINA_UNIONPAY = "CHINA_UNIONPAY" + SQUARE_GIFT_CARD = "SQUARE_GIFT_CARD"end + end +end diff --git a/lib/square/types/v_1_tender_entry_method.rb b/lib/square/types/v_1_tender_entry_method.rb new file mode 100644 index 000000000..44fabc513 --- /dev/null +++ b/lib/square/types/v_1_tender_entry_method.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + module V1TenderEntryMethod + extend Square::Internal::Types::Enum + MANUAL = "MANUAL" + SCANNED = "SCANNED" + SQUARE_CASH = "SQUARE_CASH" + SQUARE_WALLET = "SQUARE_WALLET" + SWIPED = "SWIPED" + WEB_FORM = "WEB_FORM" + OTHER = "OTHER"end + end +end diff --git a/lib/square/types/v_1_tender_type.rb b/lib/square/types/v_1_tender_type.rb new file mode 100644 index 000000000..d42a012f2 --- /dev/null +++ b/lib/square/types/v_1_tender_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + module V1TenderType + extend Square::Internal::Types::Enum + CREDIT_CARD = "CREDIT_CARD" + CASH = "CASH" + THIRD_PARTY_CARD = "THIRD_PARTY_CARD" + NO_SALE = "NO_SALE" + SQUARE_WALLET = "SQUARE_WALLET" + SQUARE_GIFT_CARD = "SQUARE_GIFT_CARD" + UNKNOWN = "UNKNOWN" + OTHER = "OTHER"end + end +end diff --git a/lib/square/types/v_1_update_order_request_action.rb b/lib/square/types/v_1_update_order_request_action.rb new file mode 100644 index 000000000..8b47c5502 --- /dev/null +++ b/lib/square/types/v_1_update_order_request_action.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module V1UpdateOrderRequestAction + extend Square::Internal::Types::Enum + COMPLETE = "COMPLETE" + CANCEL = "CANCEL" + REFUND = "REFUND"end + end +end diff --git a/lib/square/types/vendor.rb b/lib/square/types/vendor.rb new file mode 100644 index 000000000..cfee541fd --- /dev/null +++ b/lib/square/types/vendor.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a supplier to a seller. + class Vendor < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :address, Square::Types::Address, optional: true, nullable: false + field :contacts, Internal::Types::Array[Square::Types::VendorContact], optional: true, nullable: false + field :account_number, String, optional: true, nullable: false + field :note, String, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :status, Square::Types::VendorStatus, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/vendor_contact.rb b/lib/square/types/vendor_contact.rb new file mode 100644 index 000000000..d9c1de67c --- /dev/null +++ b/lib/square/types/vendor_contact.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents a contact of a [Vendor](entity:Vendor). + class VendorContact < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :email_address, String, optional: true, nullable: false + field :phone_number, String, optional: true, nullable: false + field :removed, Internal::Types::Boolean, optional: true, nullable: false + field :ordinal, Integer, optional: false, nullable: false + + end + end +end diff --git a/lib/square/types/vendor_created_event.rb b/lib/square/types/vendor_created_event.rb new file mode 100644 index 000000000..9b723932a --- /dev/null +++ b/lib/square/types/vendor_created_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Vendor](entity:Vendor) is created. + class VendorCreatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::VendorCreatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/vendor_created_event_data.rb b/lib/square/types/vendor_created_event_data.rb new file mode 100644 index 000000000..3342f17e8 --- /dev/null +++ b/lib/square/types/vendor_created_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the `vendor.created` event data structure. + class VendorCreatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::VendorCreatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/vendor_created_event_object.rb b/lib/square/types/vendor_created_event_object.rb new file mode 100644 index 000000000..382074c5e --- /dev/null +++ b/lib/square/types/vendor_created_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class VendorCreatedEventObject < Internal::Types::Model + field :operation, String, optional: true, nullable: false + field :vendor, Square::Types::Vendor, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/vendor_status.rb b/lib/square/types/vendor_status.rb new file mode 100644 index 000000000..ab1cc9a46 --- /dev/null +++ b/lib/square/types/vendor_status.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Square + module Types + module VendorStatus + extend Square::Internal::Types::Enum + ACTIVE = "ACTIVE" + INACTIVE = "INACTIVE"end + end +end diff --git a/lib/square/types/vendor_updated_event.rb b/lib/square/types/vendor_updated_event.rb new file mode 100644 index 000000000..58351387f --- /dev/null +++ b/lib/square/types/vendor_updated_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Square + module Types + # Published when a [Vendor](entity:Vendor) is updated. + class VendorUpdatedEvent < Internal::Types::Model + field :merchant_id, String, optional: true, nullable: false + field :location_id, String, optional: true, nullable: false + field :type, String, optional: true, nullable: false + field :event_id, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :data, Square::Types::VendorUpdatedEventData, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/vendor_updated_event_data.rb b/lib/square/types/vendor_updated_event_data.rb new file mode 100644 index 000000000..5435038a2 --- /dev/null +++ b/lib/square/types/vendor_updated_event_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the `vendor.updated` event data structure. + class VendorUpdatedEventData < Internal::Types::Model + field :type, String, optional: true, nullable: false + field :id, String, optional: true, nullable: false + field :object, Square::Types::VendorUpdatedEventObject, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/vendor_updated_event_object.rb b/lib/square/types/vendor_updated_event_object.rb new file mode 100644 index 000000000..aa617febf --- /dev/null +++ b/lib/square/types/vendor_updated_event_object.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + class VendorUpdatedEventObject < Internal::Types::Model + field :operation, String, optional: true, nullable: false + field :vendor, Square::Types::Vendor, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/visibility_filter.rb b/lib/square/types/visibility_filter.rb new file mode 100644 index 000000000..ff0e2ca15 --- /dev/null +++ b/lib/square/types/visibility_filter.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Square + module Types + module VisibilityFilter + extend Square::Internal::Types::Enum + ALL = "ALL" + READ = "READ" + READ_WRITE = "READ_WRITE"end + end +end diff --git a/lib/square/types/void_transaction_response.rb b/lib/square/types/void_transaction_response.rb new file mode 100644 index 000000000..10ffda6d1 --- /dev/null +++ b/lib/square/types/void_transaction_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Square + module Types + # Defines the fields that are included in the response body of + # a request to the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint. + class VoidTransactionResponse < Internal::Types::Model + field :errors, Internal::Types::Array[Square::Types::Error], optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/wage_setting.rb b/lib/square/types/wage_setting.rb new file mode 100644 index 000000000..e7bf65e6d --- /dev/null +++ b/lib/square/types/wage_setting.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents information about the overtime exemption status, job assignments, and compensation + # for a [team member](entity:TeamMember). + class WageSetting < Internal::Types::Model + field :team_member_id, String, optional: true, nullable: false + field :job_assignments, Internal::Types::Array[Square::Types::JobAssignment], optional: true, nullable: false + field :is_overtime_exempt, Internal::Types::Boolean, optional: true, nullable: false + field :version, Integer, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/webhook_subscription.rb b/lib/square/types/webhook_subscription.rb new file mode 100644 index 000000000..78b9f8f9a --- /dev/null +++ b/lib/square/types/webhook_subscription.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Square + module Types + # Represents the details of a webhook subscription, including notification URL, + # event types, and signature key. + class WebhookSubscription < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :name, String, optional: true, nullable: false + field :enabled, Internal::Types::Boolean, optional: true, nullable: false + field :event_types, Internal::Types::Array[String], optional: true, nullable: false + field :notification_url, String, optional: true, nullable: false + field :api_version, String, optional: true, nullable: false + field :signature_key, String, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/types/weekday.rb b/lib/square/types/weekday.rb new file mode 100644 index 000000000..4a28deb6b --- /dev/null +++ b/lib/square/types/weekday.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Square + module Types + module Weekday + extend Square::Internal::Types::Enum + MON = "MON" + TUE = "TUE" + WED = "WED" + THU = "THU" + FRI = "FRI" + SAT = "SAT" + SUN = "SUN"end + end +end diff --git a/lib/square/types/workweek_config.rb b/lib/square/types/workweek_config.rb new file mode 100644 index 000000000..ffce149df --- /dev/null +++ b/lib/square/types/workweek_config.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Square + module Types + # Sets the day of the week and hour of the day that a business starts a + # workweek. This is used to calculate overtime pay. + class WorkweekConfig < Internal::Types::Model + field :id, String, optional: true, nullable: false + field :start_of_week, Square::Types::Weekday, optional: false, nullable: false + field :start_of_day_local_time, String, optional: false, nullable: false + field :version, Integer, optional: true, nullable: false + field :created_at, String, optional: true, nullable: false + field :updated_at, String, optional: true, nullable: false + + end + end +end diff --git a/lib/square/v_1_transactions/client.rb b/lib/square/v_1_transactions/client.rb new file mode 100644 index 000000000..670754c13 --- /dev/null +++ b/lib/square/v_1_transactions/client.rb @@ -0,0 +1,53 @@ + +module Square + module V1Transactions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::V1Transactions::Client] + def initialize(client) + @client = client + end + + # Provides summary information for a merchant's online store orders. + # + # @return [Array[Square::Types::V1Order]] + def v_1_list_orders(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return + else + raise _response.body + end + end + + # Provides comprehensive information for a single online store order, including the order's history. + # + # @return [Square::Types::V1Order] + def v_1_retrieve_order(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::V1Order.load(_response.body) + else + raise _response.body + end + end + + # Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: + # + # @return [Square::Types::V1Order] + def v_1_update_order(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::V1Order.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/v_1_transactions/types/v_1_list_orders_request.rb b/lib/square/v_1_transactions/types/v_1_list_orders_request.rb new file mode 100644 index 000000000..91c7278b8 --- /dev/null +++ b/lib/square/v_1_transactions/types/v_1_list_orders_request.rb @@ -0,0 +1,14 @@ + +module Square + module V1Transactions + module Types + class V1ListOrdersRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :order, Square::Types::SortOrder, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + field :batch_token, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/v_1_transactions/types/v_1_retrieve_order_request.rb b/lib/square/v_1_transactions/types/v_1_retrieve_order_request.rb new file mode 100644 index 000000000..73e467ca5 --- /dev/null +++ b/lib/square/v_1_transactions/types/v_1_retrieve_order_request.rb @@ -0,0 +1,12 @@ + +module Square + module V1Transactions + module Types + class V1RetrieveOrderRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :order_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/v_1_transactions/types/v_1_update_order_request.rb b/lib/square/v_1_transactions/types/v_1_update_order_request.rb new file mode 100644 index 000000000..d792fb5a2 --- /dev/null +++ b/lib/square/v_1_transactions/types/v_1_update_order_request.rb @@ -0,0 +1,17 @@ + +module Square + module V1Transactions + module Types + class V1UpdateOrderRequest < Internal::Types::Model + field :location_id, String, optional: false, nullable: false + field :order_id, String, optional: false, nullable: false + field :action, Square::Types::V1UpdateOrderRequestAction, optional: false, nullable: false + field :shipped_tracking_number, String, optional: true, nullable: false + field :completed_note, String, optional: true, nullable: false + field :refunded_note, String, optional: true, nullable: false + field :canceled_note, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/vendors/client.rb b/lib/square/vendors/client.rb new file mode 100644 index 000000000..147f93cda --- /dev/null +++ b/lib/square/vendors/client.rb @@ -0,0 +1,105 @@ + +module Square + module Vendors + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Vendors::Client] + def initialize(client) + @client = client + end + + # Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a seller. + # + # @return [Square::Types::BatchCreateVendorsResponse] + def batch_create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchCreateVendorsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs. + # + # @return [Square::Types::BatchGetVendorsResponse] + def batch_get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchGetVendorsResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers to a seller. + # + # @return [Square::Types::BatchUpdateVendorsResponse] + def batch_update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::BatchUpdateVendorsResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a single [Vendor](entity:Vendor) object to represent a supplier to a seller. + # + # @return [Square::Types::CreateVendorResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateVendorResponse.load(_response.body) + else + raise _response.body + end + end + + # Searches for vendors using a filter against supported [Vendor](entity:Vendor) properties and a supported sorter. + # + # @return [Square::Types::SearchVendorsResponse] + def search(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::SearchVendorsResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves the vendor of a specified [Vendor](entity:Vendor) ID. + # + # @return [Square::Types::GetVendorResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetVendorResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates an existing [Vendor](entity:Vendor) object as a supplier to a seller. + # + # @return [Square::Types::UpdateVendorResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateVendorResponse.load(_response.body) + else + raise _response.body + end + end + + end + end +end diff --git a/lib/square/vendors/types/batch_create_vendors_request.rb b/lib/square/vendors/types/batch_create_vendors_request.rb new file mode 100644 index 000000000..8722c50b0 --- /dev/null +++ b/lib/square/vendors/types/batch_create_vendors_request.rb @@ -0,0 +1,11 @@ + +module Square + module Vendors + module Types + class BatchCreateVendorsRequest < Internal::Types::Model + field :vendors, Internal::Types::Hash[String, Square::Types::Vendor], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/vendors/types/batch_get_vendors_request.rb b/lib/square/vendors/types/batch_get_vendors_request.rb new file mode 100644 index 000000000..8e127c73d --- /dev/null +++ b/lib/square/vendors/types/batch_get_vendors_request.rb @@ -0,0 +1,11 @@ + +module Square + module Vendors + module Types + class BatchGetVendorsRequest < Internal::Types::Model + field :vendor_ids, Internal::Types::Array[String], optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/vendors/types/batch_update_vendors_request.rb b/lib/square/vendors/types/batch_update_vendors_request.rb new file mode 100644 index 000000000..efb8365cb --- /dev/null +++ b/lib/square/vendors/types/batch_update_vendors_request.rb @@ -0,0 +1,11 @@ + +module Square + module Vendors + module Types + class BatchUpdateVendorsRequest < Internal::Types::Model + field :vendors, Internal::Types::Hash[String, Square::Types::UpdateVendorRequest], optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/vendors/types/create_vendor_request.rb b/lib/square/vendors/types/create_vendor_request.rb new file mode 100644 index 000000000..3ad64a751 --- /dev/null +++ b/lib/square/vendors/types/create_vendor_request.rb @@ -0,0 +1,12 @@ + +module Square + module Vendors + module Types + class CreateVendorRequest < Internal::Types::Model + field :idempotency_key, String, optional: false, nullable: false + field :vendor, Square::Types::Vendor, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/vendors/types/get_vendors_request.rb b/lib/square/vendors/types/get_vendors_request.rb new file mode 100644 index 000000000..5595187e3 --- /dev/null +++ b/lib/square/vendors/types/get_vendors_request.rb @@ -0,0 +1,11 @@ + +module Square + module Vendors + module Types + class GetVendorsRequest < Internal::Types::Model + field :vendor_id, String, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/vendors/types/search_vendors_request.rb b/lib/square/vendors/types/search_vendors_request.rb new file mode 100644 index 000000000..c95323f07 --- /dev/null +++ b/lib/square/vendors/types/search_vendors_request.rb @@ -0,0 +1,13 @@ + +module Square + module Vendors + module Types + class SearchVendorsRequest < Internal::Types::Model + field :filter, Square::Types::SearchVendorsRequestFilter, optional: true, nullable: false + field :sort, Square::Types::SearchVendorsRequestSort, optional: true, nullable: false + field :cursor, String, optional: true, nullable: false + + end + end + end +end diff --git a/lib/square/vendors/types/update_vendors_request.rb b/lib/square/vendors/types/update_vendors_request.rb new file mode 100644 index 000000000..4ba280d40 --- /dev/null +++ b/lib/square/vendors/types/update_vendors_request.rb @@ -0,0 +1,12 @@ + +module Square + module Vendors + module Types + class UpdateVendorsRequest < Internal::Types::Model + field :vendor_id, String, optional: false, nullable: false + field :body, Square::Types::UpdateVendorRequest, optional: false, nullable: false + + end + end + end +end diff --git a/lib/square/webhooks/client.rb b/lib/square/webhooks/client.rb new file mode 100644 index 000000000..c6b745975 --- /dev/null +++ b/lib/square/webhooks/client.rb @@ -0,0 +1,14 @@ + +module Square + module Webhooks + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Webhooks::Client] + def initialize(client) + @client = client + end + + end + end +end diff --git a/lib/square/webhooks/event_types/client.rb b/lib/square/webhooks/event_types/client.rb new file mode 100644 index 000000000..6a286022d --- /dev/null +++ b/lib/square/webhooks/event_types/client.rb @@ -0,0 +1,29 @@ + +module Square + module Webhooks + module EventTypes + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Webhooks::EventTypes::Client] + def initialize(client) + @client = client + end + + # Lists all webhook event types that can be subscribed to. + # + # @return [Square::Types::ListWebhookEventTypesResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListWebhookEventTypesResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/webhooks/event_types/types/list_event_types_request.rb b/lib/square/webhooks/event_types/types/list_event_types_request.rb new file mode 100644 index 000000000..f7df93c3e --- /dev/null +++ b/lib/square/webhooks/event_types/types/list_event_types_request.rb @@ -0,0 +1,13 @@ + +module Square + module Webhooks + module EventTypes + module Types + class ListEventTypesRequest < Internal::Types::Model + field :api_version, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/webhooks/subscriptions/client.rb b/lib/square/webhooks/subscriptions/client.rb new file mode 100644 index 000000000..986e550a6 --- /dev/null +++ b/lib/square/webhooks/subscriptions/client.rb @@ -0,0 +1,107 @@ + +module Square + module Webhooks + module Subscriptions + class Client + # @option client [Square::Internal::Http::RawClient] + # + # @return [Square::Webhooks::Subscriptions::Client] + def initialize(client) + @client = client + end + + # Lists all webhook subscriptions owned by your application. + # + # @return [Square::Types::ListWebhookSubscriptionsResponse] + def list(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::ListWebhookSubscriptionsResponse.load(_response.body) + else + raise _response.body + end + end + + # Creates a webhook subscription. + # + # @return [Square::Types::CreateWebhookSubscriptionResponse] + def create(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::CreateWebhookSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + # Retrieves a webhook subscription identified by its ID. + # + # @return [Square::Types::GetWebhookSubscriptionResponse] + def get(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::GetWebhookSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates a webhook subscription. + # + # @return [Square::Types::UpdateWebhookSubscriptionResponse] + def update(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateWebhookSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + # Deletes a webhook subscription. + # + # @return [Square::Types::DeleteWebhookSubscriptionResponse] + def delete(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::DeleteWebhookSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + # Updates a webhook subscription by replacing the existing signature key with a new one. + # + # @return [Square::Types::UpdateWebhookSubscriptionSignatureKeyResponse] + def update_signature_key(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::UpdateWebhookSubscriptionSignatureKeyResponse.load(_response.body) + else + raise _response.body + end + end + + # Tests a webhook subscription by sending a test event to the notification URL. + # + # @return [Square::Types::TestWebhookSubscriptionResponse] + def test(request_options: {}, **params) + _request = params + _response = @client.send(_request) + if _response.code >= "200" && _response.code < "300" + return Square::Types::TestWebhookSubscriptionResponse.load(_response.body) + else + raise _response.body + end + end + + end + end + end +end diff --git a/lib/square/webhooks/subscriptions/types/create_webhook_subscription_request.rb b/lib/square/webhooks/subscriptions/types/create_webhook_subscription_request.rb new file mode 100644 index 000000000..8c254f7d9 --- /dev/null +++ b/lib/square/webhooks/subscriptions/types/create_webhook_subscription_request.rb @@ -0,0 +1,14 @@ + +module Square + module Webhooks + module Subscriptions + module Types + class CreateWebhookSubscriptionRequest < Internal::Types::Model + field :idempotency_key, String, optional: true, nullable: false + field :subscription, Square::Types::WebhookSubscription, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/webhooks/subscriptions/types/delete_subscriptions_request.rb b/lib/square/webhooks/subscriptions/types/delete_subscriptions_request.rb new file mode 100644 index 000000000..206d152df --- /dev/null +++ b/lib/square/webhooks/subscriptions/types/delete_subscriptions_request.rb @@ -0,0 +1,13 @@ + +module Square + module Webhooks + module Subscriptions + module Types + class DeleteSubscriptionsRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/webhooks/subscriptions/types/get_subscriptions_request.rb b/lib/square/webhooks/subscriptions/types/get_subscriptions_request.rb new file mode 100644 index 000000000..5e345d9b2 --- /dev/null +++ b/lib/square/webhooks/subscriptions/types/get_subscriptions_request.rb @@ -0,0 +1,13 @@ + +module Square + module Webhooks + module Subscriptions + module Types + class GetSubscriptionsRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + + end + end + end + end +end diff --git a/lib/square/webhooks/subscriptions/types/list_subscriptions_request.rb b/lib/square/webhooks/subscriptions/types/list_subscriptions_request.rb new file mode 100644 index 000000000..8bf50e99a --- /dev/null +++ b/lib/square/webhooks/subscriptions/types/list_subscriptions_request.rb @@ -0,0 +1,16 @@ + +module Square + module Webhooks + module Subscriptions + module Types + class ListSubscriptionsRequest < Internal::Types::Model + field :cursor, String, optional: true, nullable: false + field :include_disabled, Internal::Types::Boolean, optional: true, nullable: false + field :sort_order, Square::Types::SortOrder, optional: true, nullable: false + field :limit, Integer, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/webhooks/subscriptions/types/test_webhook_subscription_request.rb b/lib/square/webhooks/subscriptions/types/test_webhook_subscription_request.rb new file mode 100644 index 000000000..ceacce525 --- /dev/null +++ b/lib/square/webhooks/subscriptions/types/test_webhook_subscription_request.rb @@ -0,0 +1,14 @@ + +module Square + module Webhooks + module Subscriptions + module Types + class TestWebhookSubscriptionRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :event_type, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/webhooks/subscriptions/types/update_webhook_subscription_request.rb b/lib/square/webhooks/subscriptions/types/update_webhook_subscription_request.rb new file mode 100644 index 000000000..197364084 --- /dev/null +++ b/lib/square/webhooks/subscriptions/types/update_webhook_subscription_request.rb @@ -0,0 +1,14 @@ + +module Square + module Webhooks + module Subscriptions + module Types + class UpdateWebhookSubscriptionRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :subscription, Square::Types::WebhookSubscription, optional: true, nullable: false + + end + end + end + end +end diff --git a/lib/square/webhooks/subscriptions/types/update_webhook_subscription_signature_key_request.rb b/lib/square/webhooks/subscriptions/types/update_webhook_subscription_signature_key_request.rb new file mode 100644 index 000000000..8fd2948fa --- /dev/null +++ b/lib/square/webhooks/subscriptions/types/update_webhook_subscription_signature_key_request.rb @@ -0,0 +1,14 @@ + +module Square + module Webhooks + module Subscriptions + module Types + class UpdateWebhookSubscriptionSignatureKeyRequest < Internal::Types::Model + field :subscription_id, String, optional: false, nullable: false + field :idempotency_key, String, optional: true, nullable: false + + end + end + end + end +end diff --git a/test/integration/helpers.rb b/test/integration/helpers.rb new file mode 100644 index 000000000..0696d5276 --- /dev/null +++ b/test/integration/helpers.rb @@ -0,0 +1,115 @@ +require 'securerandom' +require_relative '../../lib/square' +require_relative '../../lib/square_legacy' + +module Helpers + def create_client + token = ENV['TEST_SQUARE_TOKEN'] || ENV['SQUARE_SANDBOX_TOKEN'] + raise 'TEST_SQUARE_TOKEN or SQUARE_SANDBOX_TOKEN is not set' unless token + + Square::Client.new( + token: token, + base_url: Square::Environment::SANDBOX, + ) + end + + def create_legacy_client + token = ENV['TEST_SQUARE_TOKEN'] || ENV['SQUARE_SANDBOX_TOKEN'] + raise 'TEST_SQUARE_TOKEN or SQUARE_SANDBOX_TOKEN is not set' unless token + + SquareLegacy::Client.new( + access_token: token, + environment: 'sandbox' + ) + end + + def new_test_uuid + SecureRandom.uuid + end + + def new_test_square_temp_id + "##{SecureRandom.uuid}" + end + + def new_test_money(amount) + Square::Types::Money.new( + amount: amount, + currency: 'USD' + ) + end + + def get_test_file + file_path = File.join(__dir__, 'testdata', 'image.jpeg') + File.open(file_path, 'rb') + end + + def get_default_location_id(client) + response = client.locations.list + response.locations.first.id + end + + def create_location(client) + response = client.locations.create( + location: { + name: "Test Location #{new_test_uuid}" + } + ) + response.location.id + end + + def create_test_catalog_item(opts = {}) + variation = Square::Types::CatalogObject.new( + type: 'ITEM_VARIATION', + id: "##{new_test_uuid}", + present_at_all_locations: true, + item_variation_data: { + name: opts[:variation_name] || "Variation #{new_test_uuid}", + track_inventory: true, + pricing_type: 'FIXED_PRICING', + price_money: { + amount: opts[:price] || 1000, + currency: opts[:currency] || 'USD' + } + } + ) + + Square::Types::CatalogObject.new( + type: 'ITEM', + id: "##{new_test_uuid}", + present_at_all_locations: true, + item_data: { + name: opts[:name] || "Item #{new_test_uuid}", + description: opts[:description] || 'Test item description', + abbreviation: opts[:abbreviation] || 'TST', + variations: [variation] + } + ) + end + + def test_address + Square::Types::Address.new( + address_line_1: '500 Electric Ave', + address_line_2: 'Suite 600', + locality: 'New York', + administrative_district_level_1: 'NY', + postal_code: '10003', + country: 'US' + ) + end + + def create_test_customer_request + Square::Types::CustomerRequest.new( + idempotency_key: new_test_uuid, + given_name: 'Amelia', + family_name: 'Earhart', + phone_number: '1-212-555-4240', + note: 'test customer', + address: test_address + ) + end + + def create_test_customer(client) + response = client.customers.create(create_test_customer_request) + response.customer.id + end +end diff --git a/test/integration/integration_test_base.rb b/test/integration/integration_test_base.rb new file mode 100644 index 000000000..54599d7ab --- /dev/null +++ b/test/integration/integration_test_base.rb @@ -0,0 +1,16 @@ +require 'json' +require 'minitest/autorun' +require 'minitest/hell' +require 'minitest/pride' +require 'minitest/proveit' +require_relative 'helpers' + +class IntegrationTestBase < Minitest::Test + parallelize_me! + include Square + + # Initializes the base test controller + def setup_class + @client = create_client + end +end diff --git a/test/integration/test_cash_drawers.rb b/test/integration/test_cash_drawers.rb new file mode 100644 index 000000000..ecb1076a0 --- /dev/null +++ b/test/integration/test_cash_drawers.rb @@ -0,0 +1,22 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + + +class CashDrawersTest < IntegrationTestBase + def setup + setup_class + end + + def test_list_cash_drawer_shifts + start_time = Time.now - 3600 # 1 hour ago + end_time = Time.now + + response = @client.cash_drawers.shifts.list( + location_id: get_default_location_id(@client), + begin_time: start_time.iso8601, + end_time: end_time.iso8601 + ) + + refute_nil(response) + end +end diff --git a/test/integration/test_catalog_serial.rb b/test/integration/test_catalog_serial.rb new file mode 100644 index 000000000..84289ba6f --- /dev/null +++ b/test/integration/test_catalog_serial.rb @@ -0,0 +1,368 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class CatalogSerialTest < IntegrationTestBase + MAX_CATALOG_PAGE_SIZE = 100 + MAX_RETRIES_CATALOG = 5 + MAX_TIMEOUT = 120 + + def setup + setup_class + @catalog_modifier_list_id = nil + @catalog_modifier_id = nil + @catalog_tax_id = nil + end + + def sleep(seconds) + sleep(seconds) + end + + def delete_all_catalog_objects(client) + catalog_objects_resp = client.catalog.list + object_ids = [] + + catalog_objects_resp.data.each do |catalog_object| + next unless catalog_object.id + + object_ids << catalog_object.id + + next unless catalog_object.respond_to?(:item_data) + + variation = catalog_object.item_data&.variations&.first + next unless variation&.id + + object_ids << variation.id + end + + client.catalog.batch_delete(object_ids: object_ids) + end + + def test_bulk_create_and_iterate_through_paginated_catalog_objects + delete_all_catalog_objects(@client) + sleep(2) # Wait after deletion + + # Setup: Create 200 catalog objects with 1 CatalogItemVariation each + catalog_objects = Array.new(200) { create_test_catalog_item } + + # Create the catalog objects in a bulk request + create_catalog_objects_resp = @client.catalog.batch_upsert( + idempotency_key: new_test_uuid, + batches: [ + { + objects: catalog_objects + } + ] + ) + + assert_equal 200, create_catalog_objects_resp.objects.length + sleep(2) # Wait after bulk creation + + # List all catalog objects + number_of_pages = 0 + catalog_objects_resp = @client.catalog.list + number_of_pages += 1 + assert_equal MAX_CATALOG_PAGE_SIZE, catalog_objects_resp.data.length + + while catalog_objects_resp.has_next_page? + sleep(1) # Wait between page requests + catalog_objects_resp = catalog_objects_resp.get_next_page + number_of_pages += 1 + end + + assert number_of_pages > 1 + sleep(2) # Wait before cleanup + + delete_catalog_objects_resp = delete_all_catalog_objects(@client) + assert_equal 200, delete_catalog_objects_resp.deleted_object_ids.length + end + + def test_upload_catalog_image + # Add retry logic for the image upload + max_retries = 5 + last_error = nil + + max_retries.times do |attempt| + begin + # If this isn't the first attempt, wait before retrying + if attempt > 0 + puts "Attempt #{attempt + 1} for image upload..." + # Increase wait time between retries exponentially + sleep(2 ** attempt * 5) + end + + puts "Starting image upload attempt #{attempt + 1}" + + # Setup: Load a test image file + image_file = get_test_file + puts 'Test file loaded' + + # Setup: Create a catalog object to associate the image with + catalog_object = create_test_catalog_item + + # Add delay before catalog creation + sleep(3) + puts 'Creating catalog object...' + + create_catalog_resp = @client.catalog.batch_upsert( + idempotency_key: new_test_uuid, + batches: [ + { + objects: [catalog_object] + } + ] + ) + + puts 'Catalog object created' + assert_equal 1, create_catalog_resp.objects.length + created_catalog_object = create_catalog_resp.objects.first + assert created_catalog_object + + # Add delay before image upload + sleep(5) + puts 'Uploading image...' + + # Create a new catalog image + image_name = "Test Image #{new_test_uuid}" + create_catalog_image_resp = @client.catalog.images.create( + image_file: image_file, + request: { + idempotency_key: new_test_uuid, + object_id: created_catalog_object.id, + image: { + type: "IMAGE", + id: new_test_square_temp_id, + image_data: { + name: image_name + } + } + } + ) + + puts 'Image uploaded successfully' + assert create_catalog_image_resp.image + + # Add delay before cleanup + sleep(3) + puts 'Starting cleanup...' + + # Cleanup: Delete the created catalog object and image + @client.catalog.batch_delete( + object_ids: [created_catalog_object.id, create_catalog_image_resp.image.id] + ) + + puts 'Cleanup completed' + # If we get here, the test succeeded, so break out of retry loop + return + + rescue => error + last_error = error + puts "Attempt #{attempt + 1} failed with error: #{error}" + # If this was the last attempt, the error will be thrown below + end + end + + # If we get here, all retries failed + puts 'All image upload attempts failed' + raise last_error + end + + def test_upsert_catalog_object + coffee = create_test_catalog_item( + name: "Coffee", + description: "Strong coffee", + abbreviation: "C", + price: 100, + variation_name: "Colombian Fair Trade" + ) + + sleep(2) # Wait before upsert + + response = @client.catalog.object.upsert( + object: coffee, + idempotency_key: new_test_uuid + ) + + catalog_object = response.catalog_object + + assert response + assert catalog_object + assert_equal "ITEM", catalog_object.type + assert_equal 1, catalog_object.item_data.variations.length + + variation = catalog_object.item_data.variations.first + assert_equal "Colombian Fair Trade", variation.item_variation_data.name + end + + def test_catalog_info + sleep(2) # Wait before info request + response = @client.catalog.info + assert response + end + + def test_list_catalog + sleep(2) # Wait before list request + response = @client.catalog.list + assert response + end + + def test_search_catalog_objects + sleep(2) # Wait before search + response = @client.catalog.search(limit: 1) + assert response + end + + def test_search_catalog_items + sleep(2) # Wait before search items + response = @client.catalog.search_items(limit: 1) + assert response + end + + def test_batch_upsert_catalog_objects + sleep(2) # Wait before batch upsert + + modifier = Square::Types::CatalogObjectModifier.new( + type: "MODIFIER", + id: "#temp-modifier-id", + modifier_data: Square::Types::CatalogModifier.new( + name: "Limited Time Only Price", + price_money: Square::Types::Money.new( + amount: 200, + currency: "USD" + ) + ) + ) + + modifier_list = Square::Types::CatalogObjectModifierList.new( + type: "MODIFIER_LIST", + id: "#temp-modifier-list-id", + modifier_list_data: Square::Types::CatalogModifierList.new( + name: "Special weekend deals", + modifiers: [modifier] + ) + ) + + tax = Square::Types::CatalogObjectTax.new( + type: "TAX", + id: "#temp-tax-id", + tax_data: Square::Types::CatalogTax.new( + name: "Online only Tax", + calculation_phase: "TAX_SUBTOTAL_PHASE", + inclusion_type: "ADDITIVE", + percentage: "5.0", + applies_to_custom_amounts: true, + enabled: true + ) + ) + + response = @client.catalog.batch_upsert( + idempotency_key: new_test_uuid, + batches: [ + { + objects: [tax, modifier_list] + } + ] + ) + + assert response + assert_equal 2, response.objects.length + + # Store IDs for later use + response.id_mappings&.each do |mapping| + case mapping.client_object_id + when "#temp-tax-id" + @catalog_tax_id = mapping.object_id + when "#temp-modifier-id" + @catalog_modifier_id = mapping.object_id + when "#temp-modifier-list-id" + @catalog_modifier_list_id = mapping.object_id + end + end + end + + def test_retrieve_catalog_object + sleep(2) # Wait before test start + + # First create a catalog object + coffee = create_test_catalog_item + create_resp = @client.catalog.object.upsert( + object: coffee, + idempotency_key: new_test_uuid + ) + + sleep(2) # Wait before retrieve + + # Then retrieve it + response = @client.catalog.object.get(object_id: create_resp.catalog_object.id) + assert response.object + assert_equal create_resp.catalog_object.id, response.object.id + + sleep(2) # Wait before cleanup + + # Cleanup + @client.catalog.object.delete(object_id: create_resp.catalog_object.id) + end + + def test_batch_retrieve_catalog_objects + sleep(2) # Wait before batch retrieve + + # Use the IDs created in the batch upsert test + response = @client.catalog.batch_get( + object_ids: [@catalog_modifier_id, @catalog_modifier_list_id, @catalog_tax_id] + ) + + assert response.objects + assert_equal 3, response.objects.length + assert_equal [@catalog_modifier_id, @catalog_modifier_list_id, @catalog_tax_id].sort, + response.objects.map(&:id).sort + end + + def test_update_item_taxes + sleep(2) # Wait before test start + + # First create a test item + item = create_test_catalog_item + create_resp = @client.catalog.object.upsert( + object: item, + idempotency_key: new_test_uuid + ) + + sleep(2) # Wait before update + + response = @client.catalog.update_item_taxes( + item_ids: [create_resp.catalog_object.id], + taxes_to_enable: [@catalog_tax_id] + ) + + assert response.updated_at + + sleep(2) # Wait before cleanup + + # Cleanup + @client.catalog.object.delete(object_id: create_resp.catalog_object.id) + end + + def test_update_item_modifier_lists + sleep(2) # Wait before test start + + # First create a test item + item = create_test_catalog_item + create_resp = @client.catalog.object.upsert( + object: item, + idempotency_key: new_test_uuid + ) + + sleep(2) # Wait before update + + response = @client.catalog.update_item_modifier_lists( + item_ids: [create_resp.catalog_object.id], + modifier_lists_to_enable: [@catalog_modifier_list_id] + ) + + assert response.updated_at + + sleep(2) # Wait before cleanup + + # Cleanup + @client.catalog.object.delete(object_id: create_resp.catalog_object.id) + end +end \ No newline at end of file diff --git a/test/integration/test_client_utils.rb b/test/integration/test_client_utils.rb new file mode 100644 index 000000000..2a3710427 --- /dev/null +++ b/test/integration/test_client_utils.rb @@ -0,0 +1,30 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class ClientUtilsTest < IntegrationTestBase + def setup + setup_class + end + + def test_should_generate_a_new_uuid + uuid = new_test_uuid + assert_match /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, uuid + end + + def test_should_generate_a_new_square_temporary_id + temp_id = new_test_square_temp_id + assert_match /^#[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, temp_id + end + + def test_should_create_a_new_money_object + amount = 1000 + money = new_test_money(amount) + expected_money = Square::Types::Money.new(amount: amount, currency: "USD") + assert_equal expected_money, money + end + + def test_should_get_the_default_location_id + location_id = get_default_location_id(@client) + refute_nil location_id + end +end diff --git a/test/integration/test_customer_groups.rb b/test/integration/test_customer_groups.rb new file mode 100644 index 000000000..14c14be88 --- /dev/null +++ b/test/integration/test_customer_groups.rb @@ -0,0 +1,89 @@ +import { Square, SquareClient, SquareError } from "../../src"; +import { createClient, newTestUuid } from "./helpers"; + +async function createTestCustomerGroup(client: SquareClient): Promise { + return await client.customers.groups.create({ + idempotencyKey: newTestUuid(), + group: { + name: `Default-${newTestUuid()}`, + }, + }); +} + +function deleteTestCustomerGroup(client: SquareClient, groupId: string): Promise { + return client.customers.groups.delete({ groupId }); +} + +describe("CustomerGroups API", () => { + const client = createClient(); + + it("should create and list a customer group", async () => { + // create + const response = await createTestCustomerGroup(client); + + expect(response.group).toBeDefined(); + expect(response.group?.name).toBeDefined(); + + // list + const listResponse = await client.customers.groups.list(); + + expect(listResponse.data).toBeDefined(); + expect(listResponse.data.length).toBeGreaterThan(0); + + // Cleanup + await deleteTestCustomerGroup(client, response.group?.id!); + }); + + it("should retrieve a customer group", async () => { + const createResponse = await createTestCustomerGroup(client); + + const getResponse = await client.customers.groups.get({ groupId: createResponse.group?.id! }); + + expect(getResponse.group).toEqual(expect.objectContaining(createResponse.group)); + + // Cleanup + await deleteTestCustomerGroup(client, createResponse.group?.id!); + }); + + it("should update a customer group", async () => { + const createResponse = await createTestCustomerGroup(client); + + const newName = `Updated-${newTestUuid()}`; + const updateResponse = await client.customers.groups.update({ + groupId: createResponse.group?.id!, + group: { name: newName }, + }); + + expect(updateResponse.group).toEqual(expect.objectContaining({ name: newName })); + + // Cleanup + await deleteTestCustomerGroup(client, createResponse.group?.id!); + }); + + it("should delete a customer group", async () => { + const createResponse = await createTestCustomerGroup(client); + + const deleteResponse = await deleteTestCustomerGroup(client, createResponse.group?.id!); + + expect(deleteResponse).toBeDefined(); + expect(deleteResponse.errors).toBeUndefined(); + }); + + it("should handle error when retrieving non-existent group", async () => { + const nonExistentId = "non-existent-id"; + + expect(async () => await client.customers.groups.get({ groupId: nonExistentId })).rejects.toThrow(SquareError); + }); + + it("should handle error when creating group with invalid data", async () => { + expect( + async () => + await client.customers.groups.create({ + idempotencyKey: newTestUuid(), + group: { + name: "", // Empty name should be invalid + }, + }), + ).rejects.toThrow(SquareError); + }); +}); diff --git a/test/integration/test_customer_segments.rb b/test/integration/test_customer_segments.rb new file mode 100644 index 000000000..8798cca8e --- /dev/null +++ b/test/integration/test_customer_segments.rb @@ -0,0 +1,25 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class CustomerSegmentsTest < IntegrationTestBase + def setup + setup_class + end + + def test_should_list_customer_segments + response = @client.customers.segments.list + + refute_nil response.data + assert response.data.length > 0 + end + + def test_should_retrieve_a_customer_segment + list_response = @client.customers.segments.list + segment_id = list_response.data.first.id + + response = @client.customers.segments.get(segment_id: segment_id) + + refute_nil response.segment + refute_nil response.segment.name + end +end diff --git a/test/integration/test_devices.rb b/test/integration/test_devices.rb new file mode 100644 index 000000000..64eadddfc --- /dev/null +++ b/test/integration/test_devices.rb @@ -0,0 +1,42 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class DevicesTest < IntegrationTestBase + def setup + setup_class + create_response = @client.devices.codes.create( + idempotency_key: new_test_uuid, + device_code: Square::Types::DeviceCode.new( + product_type: "TERMINAL_API" + ) + ) + @device_code_id = create_response.device_code.id + end + + def test_should_list_device_codes + response = @client.devices.codes.list + refute_nil response + refute_nil response.data + assert response.data.length > 0 + end + + def test_should_create_device_code + response = @client.devices.codes.create( + idempotency_key: new_test_uuid, + device_code: Square::Types::DeviceCode.new( + product_type: "TERMINAL_API" + ) + ) + + refute_nil response.device_code + assert_equal "TERMINAL_API", response.device_code.product_type + end + + def test_should_get_device_code + response = @client.devices.codes.get(id: @device_code_id) + + refute_nil response.device_code + assert_equal @device_code_id, response.device_code.id + assert_equal "TERMINAL_API", response.device_code.product_type + end +end diff --git a/test/integration/test_legacy.rb b/test/integration/test_legacy.rb new file mode 100644 index 000000000..ac219dcec --- /dev/null +++ b/test/integration/test_legacy.rb @@ -0,0 +1,15 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class LegacyTest < IntegrationTestBase + def setup + setup_class + end + + def test_should_list_locations + response = @legacy_client.locations_api.list_locations + + refute_nil response.result.locations + assert response.result.locations.length > 0 + end +end diff --git a/test/integration/test_locations.rb b/test/integration/test_locations.rb new file mode 100644 index 000000000..2605d3198 --- /dev/null +++ b/test/integration/test_locations.rb @@ -0,0 +1,15 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class LocationsTest < IntegrationTestBase + def setup + setup_class + end + + def test_should_list_locations + response = @client.locations.list + + refute_nil response.locations + assert response.locations.length > 0 + end +end diff --git a/test/integration/test_merchants.rb b/test/integration/test_merchants.rb new file mode 100644 index 000000000..41d5c16c6 --- /dev/null +++ b/test/integration/test_merchants.rb @@ -0,0 +1,25 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class MerchantsTest < IntegrationTestBase + def setup + setup_class + # Get first merchant ID + merchant_response = @client.merchants.list + @merchant_id = merchant_response.data.first.id + end + + def test_should_list_merchants + response = @client.merchants.list + + refute_nil response.data + assert response.data.length > 0 + end + + def test_should_retrieve_merchant + response = @client.merchants.get(merchant_id: @merchant_id) + + refute_nil response.merchant + assert_equal @merchant_id, response.merchant.id + end +end diff --git a/test/integration/test_mobile_authorization.rb b/test/integration/test_mobile_authorization.rb new file mode 100644 index 000000000..7b20bd152 --- /dev/null +++ b/test/integration/test_mobile_authorization.rb @@ -0,0 +1,17 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class MobileAuthorizationTest < IntegrationTestBase + def setup + setup_class + end + + def test_should_create_mobile_authorization_code + response = @client.mobile.authorization_code( + location_id: get_default_location_id(@client) + ) + + refute_nil response.authorization_code + refute_nil response.expires_at + end +end diff --git a/test/integration/test_orders.rb b/test/integration/test_orders.rb new file mode 100644 index 000000000..eebafb56a --- /dev/null +++ b/test/integration/test_orders.rb @@ -0,0 +1,130 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class OrdersTest < IntegrationTestBase + def setup + setup_class + @location_id = get_default_location_id(@client) + + # Create initial order for testing + order_response = @client.orders.create( + idempotency_key: new_test_uuid, + order: Square::Types::Order.new( + location_id: @location_id, + line_items: [ + Square::Types::OrderLineItem.new( + name: "New Item", + quantity: "1", + base_price_money: Square::Types::Money.new( + amount: 100, + currency: "USD" + ) + ) + ] + ) + ) + + @order_id = order_response.order.id + @line_item_uid = order_response.order.line_items.first.uid + end + + def test_should_create_order + response = @client.orders.create( + idempotency_key: new_test_uuid, + order: Square::Types::Order.new( + location_id: @location_id, + line_items: [ + Square::Types::OrderLineItem.new( + name: "New Item", + quantity: "1", + base_price_money: Square::Types::Money.new( + amount: 100, + currency: "USD" + ) + ) + ] + ) + ) + + refute_nil response.order + assert_equal @location_id, response.order.location_id + assert_equal "New Item", response.order.line_items.first.name + end + + def test_should_batch_retrieve_orders + response = @client.orders.batch_get(order_ids: [@order_id]) + + refute_nil response.orders + assert_equal @order_id, response.orders.first.id + end + + def test_should_search_orders + response = @client.orders.search( + limit: 1, + location_ids: [@location_id] + ) + + refute_nil response.orders + assert response.orders.length > 0 + end + + def test_should_update_order + response = @client.orders.update( + order_id: @order_id, + idempotency_key: new_test_uuid, + order: Square::Types::Order.new( + version: 1, + location_id: @location_id, + line_items: [ + Square::Types::OrderLineItem.new( + name: "Updated Item", + quantity: "1", + base_price_money: Square::Types::Money.new( + amount: 0, + currency: "USD" + ), + note: nil + ) + ] + ), + fields_to_clear: ["line_items[#{@line_item_uid}]"] + ) + + refute_nil response.order + assert_equal @order_id, response.order.id + assert_equal "Updated Item", response.order.line_items.first.name + end + + def test_should_pay_order + response = @client.orders.pay( + order_id: @order_id, + idempotency_key: new_test_uuid, + order_version: 2, + payment_ids: [] + ) + + refute_nil response.order + assert_equal @order_id, response.order.id + end + + def test_should_calculate_order + response = @client.orders.calculate( + order: Square::Types::Order.new( + location_id: @location_id, + line_items: [ + Square::Types::OrderLineItem.new( + name: "New Item", + quantity: "1", + base_price_money: Square::Types::Money.new( + amount: 100, + currency: "USD" + ) + ) + ] + ) + ) + + refute_nil response.order + refute_nil response.order.total_money + end +end diff --git a/test/integration/test_payments.rb b/test/integration/test_payments.rb new file mode 100644 index 000000000..a3bdd3356 --- /dev/null +++ b/test/integration/test_payments.rb @@ -0,0 +1,114 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class PaymentsTest < IntegrationTestBase + def setup + setup_class + @location_id = get_default_location_id(@client) + + # Create initial payment for testing + payment_response = @client.payments.create( + source_id: "cnon:card-nonce-ok", + idempotency_key: new_test_uuid, + amount_money: Square::Types::Money.new( + amount: 200, + currency: "USD" + ), + app_fee_money: Square::Types::Money.new( + amount: 10, + currency: "USD" + ), + autocomplete: false + ) + @payment_id = payment_response.payment.id + end + + def test_should_list_payments + response = @client.payments.list + + refute_nil response.data + assert response.data.length > 0 + end + + def test_should_create_payment + response = @client.payments.create( + source_id: "cnon:card-nonce-ok", + idempotency_key: new_test_uuid, + amount_money: Square::Types::Money.new( + amount: 200, + currency: "USD" + ), + app_fee_money: Square::Types::Money.new( + amount: 10, + currency: "USD" + ), + autocomplete: true + ) + + refute_nil response.payment + assert_equal 10, response.payment.app_fee_money.amount + assert_equal "USD", response.payment.app_fee_money.currency + assert_equal 200, response.payment.amount_money.amount + assert_equal "USD", response.payment.amount_money.currency + end + + def test_should_get_payment + response = @client.payments.get(payment_id: @payment_id) + + refute_nil response.payment + assert_equal @payment_id, response.payment.id + end + + def test_should_cancel_payment + response = @client.payments.cancel(payment_id: @payment_id) + + refute_nil response.payment + assert_equal @payment_id, response.payment.id + end + + def test_should_cancel_payment_by_idempotency_key + idempotency_key = new_test_uuid + + # Create payment to cancel + @client.payments.create( + source_id: "cnon:card-nonce-ok", + idempotency_key: idempotency_key, + amount_money: Square::Types::Money.new( + amount: 200, + currency: "USD" + ), + app_fee_money: Square::Types::Money.new( + amount: 10, + currency: "USD" + ), + autocomplete: false + ) + + # Cancel by idempotency key + response = @client.payments.cancel_by_idempotency_key(idempotency_key: idempotency_key) + + refute_nil response + end + + def test_should_complete_payment + # Create payment to complete + create_response = @client.payments.create( + source_id: "cnon:card-nonce-ok", + idempotency_key: new_test_uuid, + amount_money: Square::Types::Money.new( + amount: 200, + currency: "USD" + ), + app_fee_money: Square::Types::Money.new( + amount: 10, + currency: "USD" + ), + autocomplete: false + ) + + response = @client.payments.complete(payment_id: create_response.payment.id) + + refute_nil response.payment + assert_equal "COMPLETED", response.payment.status + end +end diff --git a/test/integration/test_refunds.rb b/test/integration/test_refunds.rb new file mode 100644 index 000000000..155518b57 --- /dev/null +++ b/test/integration/test_refunds.rb @@ -0,0 +1,84 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class RefundsTest < IntegrationTestBase + def setup + setup_class + # Create payment for testing refunds + payment_response = @client.payments.create( + source_id: "cnon:card-nonce-ok", + idempotency_key: new_test_uuid, + amount_money: Square::Types::Money.new( + amount: 200, + currency: "USD" + ), + app_fee_money: Square::Types::Money.new( + amount: 10, + currency: "USD" + ), + autocomplete: true + ) + @payment_id = payment_response.payment.id + + # Create initial refund for testing + refund_response = @client.refunds.refund_payment( + idempotency_key: new_test_uuid, + payment_id: @payment_id, + amount_money: Square::Types::Money.new( + amount: 200, + currency: "USD" + ) + ) + @refund_id = refund_response.refund.id + end + + def test_should_list_payment_refunds + response = @client.refunds.list + + refute_nil response.data + assert response.data.length > 0 + end + + def test_should_refund_payment + # Create new payment to refund + payment_response = @client.payments.create( + source_id: "cnon:card-nonce-ok", + idempotency_key: new_test_uuid, + amount_money: Square::Types::Money.new( + amount: 200, + currency: "USD" + ), + app_fee_money: Square::Types::Money.new( + amount: 10, + currency: "USD" + ), + autocomplete: true + ) + + response = @client.refunds.refund_payment( + idempotency_key: new_test_uuid, + payment_id: payment_response.payment.id, + amount_money: Square::Types::Money.new( + amount: 200, + currency: "USD" + ) + ) + + refute_nil response.refund + assert_equal payment_response.payment.id, response.refund.payment_id + end + + def test_should_get_payment_refund + response = @client.refunds.get(refund_id: @refund_id) + + refute_nil response.refund + assert_equal @refund_id, response.refund.id + assert_equal @payment_id, response.refund.payment_id + end + + def test_should_handle_invalid_refund_id + assert_raises(Square::SquareError) do + @client.refunds.get(refund_id: "invalid-id") + end + end +end diff --git a/test/integration/test_teams.rb b/test/integration/test_teams.rb new file mode 100644 index 000000000..a6cd895fe --- /dev/null +++ b/test/integration/test_teams.rb @@ -0,0 +1,84 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class TeamsTest < IntegrationTestBase + def setup + setup_class + end + + def test_should_bulk_update_team_members_with_mix_of_successes_and_failures + # Get default location ID + locations_response = @client.locations.list + location_id = locations_response.locations.first.id + refute_nil location_id + + # SETUP: Create 3 team members (should always be successful) + create_members_resp = @client.team_members.batch_create( + team_members: { + new_test_uuid => { + team_member: create_test_team_member([location_id]) + }, + new_test_uuid => { + team_member: create_test_team_member([location_id]) + }, + new_test_uuid => { + team_member: create_test_team_member([location_id]) + } + } + ) + + refute_nil create_members_resp.team_members + + created_member_ids = [] + create_members_resp.team_members.values.each do |response| + member_id = response.team_member.id + refute_nil member_id + assert_nil response.errors + created_member_ids << member_id + end + + # Update 3 team members in a bulk request, with 2 successful updates and 1 + # invalid update (location ID is invalid). This should result in a 200 + # response, with 2 nested success responses and 1 nested error response. + update_team_members_resp = @client.team_members.batch_update( + team_members: { + created_member_ids[0] => { + team_member: create_test_team_member([location_id]) + }, + created_member_ids[1] => { + team_member: create_test_team_member([location_id]) + }, + created_member_ids[2] => { + team_member: create_test_team_member(["INVALID_LocationID"]) + } + } + ) + + team_members = update_team_members_resp.team_members + assert_equal 3, team_members.keys.length + + member1_errors = team_members[created_member_ids[0]].errors + member2_errors = team_members[created_member_ids[1]].errors + member3_errors = team_members[created_member_ids[2]].errors + + assert_nil member1_errors + assert_nil member2_errors + refute_nil member3_errors + assert_equal "INVALID_VALUE", member3_errors.first.code + assert_equal "Expected the assigned_locations.location_ids to be valid", member3_errors.first.detail + end + + private + + # Helper function to create a test team member + def create_test_team_member(location_ids) + Square::Types::TeamMember.new( + assigned_locations: Square::Types::TeamMemberAssignedLocations.new( + assignment_type: "EXPLICIT_LOCATIONS", + location_ids: location_ids + ), + family_name: "Doe", + given_name: "Jane" + ) + end +end diff --git a/test/integration/test_terminal.rb b/test/integration/test_terminal.rb new file mode 100644 index 000000000..810cd4b3d --- /dev/null +++ b/test/integration/test_terminal.rb @@ -0,0 +1,64 @@ +require_relative 'helpers' +require_relative 'integration_test_base' + +class TerminalTest < IntegrationTestBase + def setup + setup_class + @sandbox_device_id = "da40d603-c2ea-4a65-8cfd-f42e36dab0c7" + + # Create terminal checkout for testing + checkout_response = @client.terminal.checkouts.create( + idempotency_key: new_test_uuid, + checkout: Square::Types::TerminalCheckout.new( + device_options: Square::Types::DeviceCheckoutOptions.new( + device_id: @sandbox_device_id + ), + amount_money: Square::Types::Money.new( + amount: 100, + currency: "USD" + ) + ) + ) + @checkout_id = checkout_response.checkout.id + end + + def test_should_create_terminal_checkout + response = @client.terminal.checkouts.create( + idempotency_key: new_test_uuid, + checkout: Square::Types::TerminalCheckout.new( + device_options: Square::Types::DeviceCheckoutOptions.new( + device_id: @sandbox_device_id + ), + amount_money: Square::Types::Money.new( + amount: 100, + currency: "USD" + ) + ) + ) + + refute_nil response.checkout + assert_equal @sandbox_device_id, response.checkout.device_options.device_id + assert_equal 100, response.checkout.amount_money.amount + end + + def test_should_search_terminal_checkouts + response = @client.terminal.checkouts.search(limit: 1) + + refute_nil response.checkouts + assert response.checkouts.length > 0 + end + + def test_should_get_terminal_checkout + response = @client.terminal.checkouts.get(checkout_id: @checkout_id) + + refute_nil response.checkout + assert_equal @checkout_id, response.checkout.id + end + + def test_should_cancel_terminal_checkout + response = @client.terminal.checkouts.cancel(checkout_id: @checkout_id) + + refute_nil response.checkout + assert_equal "CANCELED", response.checkout.status + end +end diff --git a/test/integration/testdata/image.jpeg b/test/integration/testdata/image.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..bb7bca31c80aa62f49084f293b61fd967129b965 GIT binary patch literal 53611 zcmeI52Ut^C+W1kigMbu~s-Q>_kltY!3_T#yOF)58gwR8i;=l+J1Ox;mF`)F`YY-5T z8j2(kdhdkZk@m;g-C1UKcGsEl`+xiG6X4;Vd-I-i-t)WXyt((3_Z;>dju4S6%PYwf zoj7rVNb%^G=&+wi?#tPq`uUQ`pGx3MIBhWe=b}+cmDL5vnNjxe-V%-Kl!$awI-=@=MD66eoyI z5S=@9=FF)hnV$qsoIFLzXPS^dO5s>@o&S3cC%?7#RazEm*kBHVRr2$B~Q=5_xpfZ^K5uP+`P9pFj8X-XcctSI3(K#?ePpAXXK}P| z{PpJZX8FzeRASat1K3?$pj6htP7B{u-N&)5x0Vy$Pir;R^H(kpK{yT|*N`O$5tow2 z3>Xtq+Q7Zk311w(Zj*zgQxG?b^_)F00Axwgh0a^=I2??pUb#@v=HNqXHKm3(%gn^N;WYx zD8nkotqW=5zUMOCGgIFLgQTsh86Sq%CZmBuJ1+jlA*{iB2{5L(XD%>-eiD5*_k(f; zH)h0=P0hnFo@t}Rim=wL;*q?D80Q>~!G@{bzGXc#ba^-X;`o~Pg8Oa0$pQRJH^-f- z&381ktBcTPiL$-n$Ho^)Jlw=583%mqD|1f=NLC=7LKkI3hPwS~nLurX3 zm{R9(J&OijmC{<=5`b6l?XKR!fJVn4s~@9}eZ0QYoV!n9EkC=Sg`{1mAhRP(LjJtENO*yjaa(|FGKv)*_7+L5%=c5R&MM;Rov_z8hBI)Efy&-7NB^ z`uv6Fy0Mlbn5BF~QT&fMBM$yPkOe*$&83`q8);FObgyO&Kx|;;C}<5>;cH_+G5v8H z{BL8P%B&Ld;g=zcJ7rehvz6(!pqt%NQX`;PV)n?qrmP}4*{BQ}tm56*YL)KS{#3g) zfYCJdkf_XU?|XOx<3k+quCF9B-yj`TI*2jO*=;vM(>;G`V(bb(0@|=G*5kzm&Y~1T z0s&?8h0@%u1NsF*v%43QtFOL=wLTf!BCBU)GtBv92O<%dy8=*cwXoh~>wLsoCj-I8 zezgCn8EVX(nC1V>heIUT2|~RBV3faZ7_FnXxi%eU{Aw(<-_}rt=9B`J$&ccAg^ zz3YA^>P^JtA8e@DJ5bMUWIPre-n;x;1ivY8DsPD1=QcBi8YN4q=6npz<5G(T2)qds zbGkVfWv4czlp2)-S5Q*%TfF@|k+wuBo=ZI+Dck`m)$xu;Q^C^(l9dp*#~#hxuX^qr z+O!9~&wE~SNZ%Xfoy$1x9DvtRg3Ly-lsa#_WyhLTD@L8Y%ltUIZ+>h+A6$u3$C{L6 zB5ek4D@SNKC~QgafeT|9R2dMuyb)!Ec>`jb7~83-VSHHVfna%2UK{g!n-IoG991op7orIwydLdH@mOK z8D|_t@lqorQK7{5<-XlPqKC_Qe)A?Qn;Mc|tk9x?s;STdK;_J)8p>@NYTh{3t(O=o zT8v{)2nLzLxS`!3Xtze@@*gL|q}=N9&aBi1y31T)l%z3qHi5H?R-e&1w(m9)Z0@H(q!<2 z2u1Natios)qnNFw?RdisSW}C^Q2;7VAD2U-wEcr{kC$M5X~*!PLJ}-%)nu=ol2gVz zbA4%b*W7Az5qzafPbzMZR|Js^(5|0$$V5_UKC z;|u_erj)z|9d8g*o~9<&PO8c{Vn(={Eh|jlQQ-yFhRe=Qh?3JRE$Rp5a0LYi>nS)= zs{z8)v%1r;V2rU;PK)C73M!axjORIzu~Z7Z8j-3Tdnp`^;54VJBW`lO7OXfDN(v1S zg<{yD-9VR4)BPu3QSjd>LiWt@>POcW2V~(+!0yr})VhDL@B=$E^PP!ZcmqQpJQjJ! zaNd;*EGb}jWiMhwbM;g2Z5p^|W-_M4{4$62c=r^JvL`6^*|Tx}R?4xBm6~Cbpa5-$ z_m1vMhO!@ShAt!xs9RavtVg-EnU!{WCs*(diQ`>n(wDl+BX2gB8S-&Z&NXw&kdTUfdzkQvE}~j|(Zo z28rcEImIB#NBBpq!Adk0r~L*=477$;ZT&|10U0&s2^jGTWOE8YGVNiY-qd%GDFh^0 zMA6*7utTCcf6oJU!!D5xtxOC89(TbZKjiKDsqmWma>78kw_y({sj3&^0q^) z3$?M2tv;jQwWbv7bCY+$&dodN-M~~0Poh)FP&9jSY|@>E)%KRWImpB0rkOWLkQ|FK zkR=ZKFbZr^$6!{Oi}CbUF6srG&c=)p2~F>QUy=Q$w_f>Ku5A@Io9RM zKS8ICLss0-2W*H1{)VTzpp}Em!VzmGN`-nxOYiQfqH`{NHBv;c>sZ%jp+$U zE`|~udiKML!7B*Ws`(I)2M9V+kdr$SDlmkYPE1^R^D7nq!0Cl2lQY|&x|U7KqN^y% zUNl<(KG@AnFq;LLmu8fWrHpPl@)m>02j8S4Y4Scn0v2#K-_aJmPgb=C6Y&1{{v+I zAqpLtQ?r-;oTz_)kk`qjAr)$iwRxOSwne>pH!RyUcOc|-fl3UUE2D;{22;N7BtjdQ z6{K~imZ{hc@@_Y4#@Yh#ba=7YytqhIz3vL|kVt8Ge^uwx$A8G@&s;dsxm9mA#s%57 zb1;lujEc({7I?hYGqsRQhU08B@7y1Euou)EM?~uwrg$9^dFCw)!Y{PsOef8Xf6_JL zuyyY;`fOc(^G2)MjK+5QU9T#y((=fS&-Ib|~uNPr`w2Ia-3op(|36}Mx|wcIXPnZ=NPK)WWx5;}Z}+JhHkg1MpI z871dmMnxunJbL<|q;x4B9ASO#bt=q`$~7`*unGsbDg5|>pRxXPS?y$Por`6z-oCTt zZImW7C|Mc3dEFhM`wLy#{ML!@^ehc{SIuPsuE{tSIxUOmE$ZmC4QF!qzp405j{I#? zC${|>8hn}by?L&C!6x(e!~ib6m2dpuiTWjoR$#{X>Z0)2eK`_GY+JAhntePRQr?JT ztQA>x_y5&gjP&a=OIu-xcYXii=L13@Bh!fV%i_YA|z6zw}uIlXHI)Y(!`C zO~ot}egMC!hX#W1e0voa8?(wSxP41icj=#ou{Q8%bq6yJ1=!11gY_Zh9T*&@Wu|)~ zp6wh;XlCa8!aO25FNTOgw`Y5JWcq=7e1V)2P{!qs_=SNStQ=E5cDz5(9H|kqC@gks z8phG5sW0$YYSYgTEdN3+qogS@8+Yzux_?r@OE19`$NH*v}_IR$epMUXnC6O1M1`%ol6s*Y(3_!X%JMcUSp(vOa3a*^t@#27g8r!KHBd+D?b4S&WwrJ1gOuHBV z;{GjiBhh)L-41I`I>=;icH!W;n@Tg73s!6I_*)~@5_bf_Hrywg<2z-&)gZK9pB<0The&I{%Z^V^|sEaGc-#OJT z@B{193-GzHcOZwyK4XxO+P&hidGnEqx3Bsfn|+YJjMD9-So))JHBZ67shx*MPng%c z?~C`0s>O7dE>)mLUwt!$h=Ot)=Mz!@fun~+Pn(gs1B-4xH~C>ZbT$X#ojqwK(p}a_ zDw(yMhyt!oa{M7tXt+Y^_?pjYY9?NM2L0)8riY-@Bxf_Hy)P-SsX$u|Cv~TdXN$Ad zJ}ReD#>}=H5`Z@UG)s1n*8r^?V%_m&Ud6Gae9?*D8yxI;n(1rZ`Gyau-}{Po$>-bM zI`J}IxbpIys%xBrfh#jugUl%`8ppfuX^M$p6q?!dZBR!n?*OQoWbCyJVc(2{m3lL& zMwSt|Be&9;O$RFsg$lX8=P8KGwAySl&iBP*X9h-lQZn-K2NrtSwAES+jXq;T=(5?%DWVQ@LBMX2rmmz2=4E?`u&q{l_A|Fryn+X z#vX6Ul3|{oQ!yD1Q?=n7p#5g)6P=TsrrsMIv9Ar8+Ymm;us?MOQ?HDf=N*O0Qdm}(o`pkdKc2pbp{P7Sbt15(k} z{TGF`VXC3$eD@1dr(K-Eby;_8&g6TiM6{%!egxI~=1}Y`?1}YSPmH!$YNBDg4F^Jy z3>;Hz0Yp-GkXLJ2p@VE2ot`z+Pu!HZzSrl~abKxBQ4zW$ZrZJ=23fY~o&1b&Xr1SMY(xT!I+h{BYmV#jOymYA{f6 z#|5ElH#m@Cixdi;!f-!Gh|dzYPBM^VLg7hRhA%;ou8yag$5&)}QJna;QqYbuQv#B;l+sYJMpLdAzTcF3#AcGm3poII68zYH%E@Y@01dx-4@ ziRw#!r3%&}>gEFU(L?rZ1Jm@n$leX?L2BS44X@`%esNJ&nCMM)gjKc1J={JnQQr}- zqD%5B{ZVr5W)U_8-K|(G7!(xBCuugbGqV0myJscVe72_|XlamGM)}TlZeJfMzN}0K z(_aexnX_wauXWeleyF}AlG)jFE+MgDVea|c?|zXY*R7E?H29Sxz^bn7;)e|&jVfnnJW#7c~>z_$4-C5D7i6`;0 zSy+(obrdPwj-DNNR7uBlX}c%j5F8)zoDVSP7R%JkAfaLGwTpw~wMo#PeViXyH4U1a zjmdzS&shiND_gbG#)fT8#^u&C$E>;eFgX~z^_y`m^$&hvEB2MD-_lg#bRD115^^4m zQcx-{iq3fC$yFsFY}>0r^RI&W4@_A<~yX+PWR+E z|5LJU_oV9v)O}{If7bZnyv^>)YzWxUpZvJYp9-Hi`+BSz@s4!cvC=r@{a+rKz!!dz zq%IkEZcRb^N8|w_jOUi4l5R-Idw#Lb$5%?b`$R1bL@XUv`q~T2En+@%rU^y5_RpW3 zy=8EL%ho}ybW*>L8_d|up6wnr)b4X9J8N{$^pNQFjzY}VLFJn&xQh>+51sY4bxQm) z+b{C`*C%H~-{~)ik*3T(sP0?Xs-RvSG_%=F%R*I;9{K97~KAHX^3)>-OVk zrqzj$3^~JnB1d{Yp3Gu&u12!vq6?Z~R?q;Bb-jR_ za*vz2CS`Nm`C%OzB#eCc6#r(;<&N0Zu$>)SkwOW;54JSe1zghtG*n)!6k!>jsF0rf(f8e2LP&mKaT1x}vjMnBEAB%F?ZvC8~(63tScCxzz`hHCu_|Q*m8Q8!N zQ-MIWGQ1yzPCg14w?tBDxzWWslUcRb^6{;j^~a6uNcUQbrSx0i(l>9n+ZVJ1pF?Lw zNzrNbu6o^H(tlWOFeffUR#G}>#W~Bi?!zpZhLSnqrA`~Pw&3}Tx4Qp;o2w_8*nb{? zT* z?#k1qE^tbC(QBuPd(DB$6*=R!$Y`$xacPg2I1)<-u5|Db*%&mNor*q#luV%N_JK*m z6s7L4!pp3l2gi!??}MjgcpNSQ7~*){wX0>%z;y@8?8^H%EnKXzjEs@a1+ZpXq2PTe z#%SJelm>3IEtfS2#jXTv00Eul^+8nhPmbmAA5aq?55$4ux7$~OA>Py;Kk=B$e|ucV zW9t5s;JGu?XBHGb@IKKu=~V9cOF4-M<^13I+92G|e^N{T@iL*_{*4L24*iY9pFIBi z$2vm${A$F6_W3tdg!cJ25`XeYXrF%tc!FSu{#KR9PDf7Cwo!%-70kD@#Ac+9ySl{4}-N9NQRk>1b*-iMUPLt+TLD>-a#Q zk3)8PDeZ=(T(GRresPFkf7PI28XqVZlM%-o0hPQuWho7tbO~ILx$roSJ76N3uF0W6 zI(kW1r@%DMMn2{B@P{yogN|du~I!wwp#1~Ujtiw zAp2xvFi2b+EGL}^6grwomTx7IR~O^9veCq2k_shTElK=5@zYv8!ujvwvASvJ#HonC zsnY1f6eU=)ofxRp;r~~?Un#K@4W0S~9FYf7XYm8M|cK;f{x_D$u;`z**0J_I^GiFZZsckE} zqrP)O3txNLKK5GCM7>b4m+8@JynY$bhSd_WgR0-vh_L`M$668x1!4mLu>;^}N-h=O zU#H}z~rCf-b% z8TA3jbv*xIs&WjsR>(jFsU|H;#z1qn>U?}n)L*uyAgMB7A!&VLI!1xFifXB{AI7uM zw}D?kTBWo+RRe$!IA9Jdtql9fyK@k zx*co+QbYK>Ikd=!&UsQQe}8yqY>C+7ct%g`9PB#1Shi0`?cdF&>IA90wt8`*?3l!V zLT6fK(`4@<(epzh+LG=L-EblAbq}>nI@)7e5?%9uEsV;rBsZe%XGJn-X(7bQg*sP- zVBBDIM%fe&=GpYA7P~sjup^A3WerwzfpK$8&eEV}iN(Ly)PV9hgg!i8=)b0Xad~13 z)ulEX|NP<&$A)a`YVSLl*^-rJ!Fty+-aVkZucJUxy;;N1q{B&T7N))$o0RTQx2^Ky zmkI;YA-{86zwbmuMIK30c%5uMNYH^j;z@23R3sWWCUN4;G&{5D;;m{I@_qLAKNjzA zuh$o3*E~BW@+X7-ZH^|bLud9xhjKL^u)xBYOEdVN9#8Y)(8TKeAyK{Wb3>b%%tm@df9nuHhs28j_{%h|@orGuFmm zn6tk~e?>~Coc&!BN3XoUojZ5aDkWjgX#DOI()Y(Q`wy5wQ@Ne5qJ9KanDNN z6BwtY&rn)3)$ufWA4j4K4~ecG@Ii7Da#&)L-{1hU*&io1p(bsgZ5ME~puQUIucZKje^WXY9BilwVr_K9}hs4gY zDU^=0^7R0m&f{|}O~jP8VWABGVE)QJ?<_A ztPe;rirqvPgX;ZkUs)<57(R&inNW+ZhBhAL?ya~z5jg&Z@?SEZz*Go-Se7$3x}!5Z zElh8x`P5>2Vfr%KF|$rmNGHpmt}(ld1~CYq1YWr-Fk`3Fhk}cz8{kvh*<3uWbKvVX zZ@`l)5!-hbw`$d0a`i)5t*WQrF-~1+Ds=6J-q2JpQ~1%wDGetsRWzs!^Kg^{H!V1- zV*DC>Gcj=;@%NOE+_bcWdt!D&^@2I^EUz8nnl*Ml*CxJwa~$r58dD`X@15DiAIA^Ip>`%AdKAR>CUSyaN9~Nr*tRN zk9@<`-b>di%-DpAU&}l%ZqqrXo#eZD)c)ql&t9nrGBG;fGS&&D)GOFo{-5N7T=mnkpzd;$l*xG3XY zglmQY!38T8D9tXz9M{j~d;rdr&=NRQa>vnzxYtoG2X)e+EN#+a+ij_MYBFkmzt*Wt zyKzy|qO-LK(pvA&apYbrgJoA~gM7pTDFvVRA*}y)SRkQSfPn$LFjGZR5Ri(gS*;e&Z=+M3Mc4ZUU!;mNQn=~ zuT{CFSiI*FL-yIq%|1}Ly`!^xiDA`$@kj1ui=H`~txylyt?y~J1#F>0yA6_WcHjQA zLKnV29(T|C)6*)Fenz0rN;|vs%=g1*AfYMM?$a-sU9Q{v3pZ$*ymM|QLy?!(Ak5Np zhr}k&4xTd{Y0dwS%RusJVWeFbXNfAh{iF1#iCut{P+D?{LpsnZ8^N2p_cqc*`y*%( zAn7@~ZO!1?hrHgsf-^Fiq1pD8ka#$<8=X2@@u79D3l8q7*R5mnwnnm)z{ab!OAt8} zwq=dDb46(-3$8NOg{Dx9w3T2iPmFlX>-`}YgSK$#^DmlUN=VK=mkQD4u++tklUOXa z1KXIC6wVeM9j%(-`RI|yJ;l`2)No?{q{eVItvl#QHr29+F`Qau5B-eDYmZvoCAgJ< z&&ctHb>hF|8S8kNeltuc=+9XGZ;T}VtnNPx5bo&DWC(ZkXB2-j@J$B6|E&&$s{1n{ zLe>2l#h(lis_xGKzoI+#XW4%iAhgk+$q?G;&nW(6;49iFS!BkBx{THKM8iYGrDE60 zhF+D<9dQ@0)!C(ymNu4_*HoA0m_;m>Nk1`j^DP)N-M(dqrS}N zY)`mbKXNQD(z9aU?Ot(|+IpHDbV`x7Z%Q~m?L(CWi&tvk@PQyd|rh zgm+#iwNr{UzgltGWJ#_7I&B22SiCE`aCPxTK1qC5AClHRIdkO4hATbv$g8-3 zlwhE2;=N;e{|7WXG2WW$%R44#CGXo>Qob^x+9j2kNgD!9>%!CRF0L45O-CQCj^ummj5Zj>KpJg^g|q zFtC|5yGw^k9;5VcgAA(U@xey)KU7g|A%X@rA-9`Ji#}%BIPNk6!Ye>Iw!P#H*;Rf}NT1IOjsCe5v{a(Jwd&m?x6RBtQWE~iN&4itss7m4 zpj##az>nwx)oGqeE#KY69cg{{tZI`S=jv`CTQ`VnF2f9~UaOdbKk7d5+YY6mnC#j3 zg}(p$lYWUVtW4%^H};l!R(33(|2U<~)=?;i14!pS5IM7}PaG`YJ-tJ1uDR%bM%GZ9 zfgj?|p zpGTx(u->oTqVSUrh-d3@GFYmr*QUg9c1pW@z)onx`3C0Gr+b(tgr>f}rm(h@kYsvf zs;Zw61>lW^e+$Kmcht(oAsA^y557ya?Xob-E=Yi}tQqDKB!Mm`S57M$D3wouOI-_A zb?OC(m(-Q4Z}1;%BqyM@!aMOSuDZ!7ExOurqesr+<3D=%VAF(->---uS)GU|d)U8$ zKTe|-98W!(8g@07ZDQU#4oDq%YM9F_tSaWpuK+~hD;gASeqIV%QV=ofs%hI$DJV?*sMl5@Ql7(vLb8)A->8R~0#cTcP_($nnztvX zfvq7H5*Y}jD2FUM>u1qfleIEp?Q%A4d35q?v01GT`x_H*mUlfBF2MoB7MdFJcCleC zK8Hj+(7y7jlZXja5*Wt+LCV8EqfS&J^ zXmzLa(VmA(w+NdX683-m|G$IfJJPM!{wV|)xby+XEx9qhZ1+;FF_GvNpa1 zJuh%d8vlC9$Z<>hyTkwEYa_onMV8K6ymcbVm#30)x#}9ndhp6jw}Iglwgtz$@A(ju z!w5Zcij4jrbBe5yu*_&n0QwSGx|oTs=i7%Bnp8>g$^YKs_zvANcob* ztQbATr`Dz8` zwEmC?ZH#2u@v-u))pPk2TH=mPUZ3B!TP*vH;^wO#i)a_tXU;J&Tx zrp$;eUxY^7O_TO4??y(I8;bb(MFau`aWYj#Qx87(CCl)y z+PedX3p2l|YyXltd|kaC)+RaL#2KZ7>Cf&I{A9zQP=G4&LOoJ8@NhT~xYelzjA7HF z^Wkd=rFGeZesS%;aQYV6yCc{BA2p7=uR`EQuKoMA*_vi>7hWx^^0z*3%i3AT0xepy z;~}xS;w~oB(zY|xs@;0y!5~F8_m=k8E&IdY(zQPsvum+o?$LIjp(_e3<5utb@!YzG z-dc33$+@LQ)+zUOH9FDV%dspOaF<@nH{HvjMvij1pZ)37csDOke;B43kX>GY`lTxM zi&c~lodsy_)9pGTbB87s5TV%>M zNm3Lp{i_!@V0A&Qfgox9LZ|bWSzzZZ@cfjprqSQvCYwJbPpLaO%;c1xPrAw}711{dsiW1nYKJ_M{d9m}3&1q@5GPm-st8C-u zPCo7rk=a5^BJWIWW^Q)cFw7a+&WUrI!RV~S&snS2DOf-(c)Y$2LI{W(U$YY)!~jUhHJgr{vU0J;LrN4e+}u5C zN>6L}MN`#cbDlR#glGWm5H#a^7iC{|)zNxWY6 z4%;Eoa2g8?ofTpsO9jssM$@GuV|3(*?`ie(8`ckYqjBs)h;#L*m~-2vJJr!^N#A%! zDxyoNRRYYHGVMQx`3l%*QRFJM&Ltm)B&R%`w2%^A1vV``OeO|DHA&&TKDxNzKF@5aS$W{f^;%tsg3 z*ZJlTrr-JmvhB_UnB%>1UCwXQ{XjtK4}&0e>Clph1f%lxE`AFo1hK$17~@6b8^81J z|EBoau1#L^E#_zYqx~U4eYbsl)XVA9qYd)rm0NF3`5ED(Fg_7uS!G(a#EpC{FCNf_HUWMyy?OI#QD{u9mIiL8P=e7m(-03rwinG-8z-M?MD-XjPp?yBtQ-tEeU@6Z6&_;}$$);87;ckqF9}n2 zmu>?k@*uJq{iPAa{5}iObyiKcY7J$$8@aM4sRj2a7xsOs$L@TSeO*q;F6yiQSf@aS zaO4fk-mOna9P*y5FHY=fu~<>b656#dj45}TR%?00k#P;fNm2;4E(#Y8V1Izg!Is8D zBT2Q&3RU(qUPPC~U)?sHsm4qARw?(PQ$|^T0`Ry5<=4<4>HK-(LrOoe@@|8d ziqKQka&C>Hih~uc-o~vKkyR@u0u*Jc80d#W%QcnfzLNJ>ja=bZv5x2{+qTzO>Xd*b zb#dreZ`7w=G$&qKbX01lN*pCa_uGp8uB&O6jKlmkOz7x?Y{sU8NDRy+*%n-7H+!Om zJd;A{?5>qwuG7Ynrd+W8G)wB!^Kk3xod&oLAjx$;VnzMTc^0}Ia*KPt&uwf(6>6`v z9ug_W6>eKC5R)tWop%}uFe-PbB`$Z6OCpygraPLCDoY}M^#5pX>d_3h)?wP2;qihaLv67kMn zep{bW9ssW9aRTl_1-KawxSN&`s5n{wn37M@)LrGLU2Z@4dLCS<=n|oC0vic{p0?(Q zobSI`8Nu$;*89@%rVaJc8~l}K!PGzl!!zSO)+_-R2P34wisel))Vs{Pbtx{M8qxPs zsmAeZq50o#m)rA49&J7%9IUo9p;o!C6wc^zuPJ%>81gPaV!Zp`^|RIRCqi6@GT2>W zv-lKN8(RwLAS}uC?1@M@IcW=^bR6(%6xgzsfweLf_tP%7w3n!h-PO2Cb{&Iz9kMQ- z%{O#>u0YvfW!`W5YTvH|$P+qfQ_`UraMg(;J$+J^Slq>ip|Q%k&@5J1bo^Ol7*p@U zx8LQK=+qd4yu)}QgWmkX!+iREzdpB%wrie@*1R-aNfb50@DvkO*WF3jv^rJhQ~w(U zoqNSNmHm{2=vkZW7~;h+A3?@~W`r zq8ywvAY~g|wpyfSwzR7)4GkD%qkBxcXw(#uz1dQ77iO!%7fXHHg|62=Dsn}_TKhs{ za<3#yOiVm4HjyIjx2xb+U%g67d1&p3z8$>Q610uoD5InQW6iM>{dt*Y+y>*p6H|+6*i? z0XGcUBrB$s=Pv2DhUw+mo;_diX}m0&^?85#f-wE*h(RtTL03GaD*C*Wxnk5Ar1-jA zRuk4VR@%$?R%A>uyAt%u|Q zTv&>dne+86G6vJ;sQXX2WyuIO@Ro%dh74q6?a=T=_Swvfkp?Wu33E`FRJ6ip)m4sm zaNxKlN0k8=@3R)V%qEvb39hAq&#;d-lpIY#{_dZZ_iL`7#Rx}Qma6-do?`6Fj(N{t z**0KXP(XLv_fqZct{C*-2m9SrHB5Am02@sM8kJF@X#?E4wG9PyEH7eBJ;R(wA1zozKFSLOtc>?89i zMUDMOzb0wBO~}Ek&3R43qPO*1OLpst4Q}_FNF^&Dyh$zxNzZE7w`Nfx#nDlrQzg5D zqzpk_20dd1y6u?p+lwLMT6S^m92NUb=X}X|j1DBWxk5K$AqP?du!WE}Fz>rpr#|WP zP+zSK=;fUXR@xcrP>FSJT97egGn#|pQ@CV=>bX0esy1A!`-NhYB~Me?SYhVl$7Kww z)B6}ts>blEHbq#fglhF_)bZG+zo;W_a=sRc=eagO=>`gY zdbIa@Is9GzY($}c?p5l(!G{eCB3uirEBfkoMZH;_Lb@u&m{DE+tAa(scqmo+MpSW> zfN6lX6t`e(;j}7@_RIF0vu`*akFKCE)-zLv_c$+dq^gfzv6vf6$q8)_H+);RGz5ge z*ew7oy`_bTQLHC%8Abx>X1N285Z;SeaSrOd2Qhu3ReCMfx_4bQ4m77%hxhwXKIf$w z8CdqDmfiE(uDWJ)2X`A;&89mo)W5U2B#ZJ`cllf^pw#Q*sLw_p1r{zA2k5JZ89ppF z)yYUNOw1q0m9f?F-uKi>zhC9PFKuEes&MV^h5e=>@rrTXk-_Di@n#9+nr8`r7kB{u zl2RzxV>88t9*Q#PY6;YHDFfvS!>s0avW?PAadf`Bfe+BL>7y9N8`zpv*;Qmms&WXn zcT&W+{H91SlSb8bhu%^ne}ClmhtiZ9Ui~gXL*EL1mVWNKC|0%jyyE`VN3`~$moyyq zuH(S<3rv0Y>XI~EG*xiM@wO28DoKsaL9y5Jd*a)Zqio`h+kvC@?j?O4vQ+o9z#C;q z@S44}yUQasyYp+`gejR(cc-I<} zeT6H;vUe}9DH$nl8>@MVt>7vBtOEN&e1kU2a%3}o%z$OzDvyY0c(Ix5P^>22wKmX` zBL;oc^RuqHn`}2TO#_$Ujwq0adxsbyjE5$RBF#c&%7=;qv?!;q-p@TGYVqCp95k27 zbE)bo1KBd8eGG3vrT@o#hB!{3HIGEBM~n>Lpy9jnf&=9;&aJbz5YCNhGnvIWjwoR+ zMo=OHM#_^Tt8;ZEhUXOB&s9t6?6p6J=xbuhG`XpdU@QIm&a6ZK57 z#z-M7NNA=T=u7IdCv^67Y3XRl^41s+1Zc71;FhNkKJtsZk=Zo6xrq+8fSOoi*SxDB zfr<^Qy_IxzR1VgRbKEyuU>p$#`r!bYoScLxcGSy;&ABCKF+*u8{fW8Qo_dZddVyqx z)~w5}SPz~U4yt?rHn&y%(xO4BnskUzcdFtoRU|J^ra{pqFj01}SVmf=(`95-N55&M zmejoI^T>elQkw)Dx9RS?s}{_qy|0_@9TJTv?UZ=XG6>Pl9uh?tOkl0A?8%**8;WUT zU1J2VJQ@O47&R8-23N?-?$=-s?%f|ENz;!h7ylATXDYImE4e%ts!tn38mk(UMhsh=mMwtR!UKK8KiH0;K$#rb5 z=3kWV9a*zDBuZ89ReLvH;ZK4T+VdS`^FbYrIOmRt!9Sa@Kih5B6)mZVzBS5S>YSuC zL9bul-z1HgfEgJkzVq-Z=L5!cWC>V)T6n!sQmXBOPgQl<&~i>o@wwBI97+oP(OIZy zdb;+dTrqd(2$`QTT|!D)PY$&(GlZuIUPJXdhN<7km;tSqyl%s#zf%mZ%H__$>7cwY z#Tk`qI4y%ZD(2f7bvdb&$}finBqz~tN50155@ZMj2m}ZO2m}ZO2m}ZO2m}ZO2m}ZO t2m}ZO2m}ZO2m}ZO2m}ZO2m}ZO2m}ZO2m}ZO2m}ZO2n7BW0hz Date: Mon, 18 Aug 2025 12:05:34 -0400 Subject: [PATCH 03/31] Pull in base test infra files from demo (#160) * pull in test helper infra from demo * pull in base catalog tests --------- Co-authored-by: jsklan --- .../catalog}/test_catalog_serial.rb | 0 .../square/integration/catalog/test_client.rb | 77 +++++ .../square/integration/catalog/test_object.rb | 42 +++ test/{ => square}/integration/helpers.rb | 0 .../integration/integration_test_base.rb | 0 .../integration/test_cash_drawers.rb | 0 .../integration/test_client_utils.rb | 0 .../integration/test_customer_groups.rb | 0 .../integration/test_customer_segments.rb | 0 test/{ => square}/integration/test_devices.rb | 0 test/{ => square}/integration/test_legacy.rb | 0 .../integration/test_locations.rb | 0 .../integration/test_merchants.rb | 0 .../integration/test_mobile_authorization.rb | 0 test/{ => square}/integration/test_orders.rb | 0 .../{ => square}/integration/test_payments.rb | 0 test/{ => square}/integration/test_refunds.rb | 0 test/{ => square}/integration/test_teams.rb | 0 .../{ => square}/integration/test_terminal.rb | 0 .../integration/testdata/image.jpeg | Bin .../internal/multipart/test_form_data.rb | 315 ++++++++++++++++++ test/square/internal/types/test_array.rb | 37 ++ test/square/internal/types/test_boolean.rb | 35 ++ test/square/internal/types/test_enum.rb | 42 +++ test/square/internal/types/test_hash.rb | 50 +++ test/square/internal/types/test_model.rb | 124 +++++++ test/square/internal/types/test_union.rb | 52 +++ test/square/internal/types/test_utils.rb | 216 ++++++++++++ test/square/test_helper.rb | 19 ++ test/{ => square_legacy}/api/api_test_base.rb | 0 .../api/test_catalog_api.rb | 0 .../api/test_customers_api.rb | 0 .../api/test_employees_api.rb | 0 .../{ => square_legacy}/api/test_labor_api.rb | 0 .../api/test_locations_api.rb | 0 .../api/test_merchants_api.rb | 0 .../api/test_payments_api.rb | 0 .../api/test_refunds_api.rb | 0 .../http_response_catcher.rb | 0 .../webhooks/test_webhooks_helper.rb | 0 40 files changed, 1009 insertions(+) rename test/{integration => square/integration/catalog}/test_catalog_serial.rb (100%) create mode 100644 test/square/integration/catalog/test_client.rb create mode 100644 test/square/integration/catalog/test_object.rb rename test/{ => square}/integration/helpers.rb (100%) rename test/{ => square}/integration/integration_test_base.rb (100%) rename test/{ => square}/integration/test_cash_drawers.rb (100%) rename test/{ => square}/integration/test_client_utils.rb (100%) rename test/{ => square}/integration/test_customer_groups.rb (100%) rename test/{ => square}/integration/test_customer_segments.rb (100%) rename test/{ => square}/integration/test_devices.rb (100%) rename test/{ => square}/integration/test_legacy.rb (100%) rename test/{ => square}/integration/test_locations.rb (100%) rename test/{ => square}/integration/test_merchants.rb (100%) rename test/{ => square}/integration/test_mobile_authorization.rb (100%) rename test/{ => square}/integration/test_orders.rb (100%) rename test/{ => square}/integration/test_payments.rb (100%) rename test/{ => square}/integration/test_refunds.rb (100%) rename test/{ => square}/integration/test_teams.rb (100%) rename test/{ => square}/integration/test_terminal.rb (100%) rename test/{ => square}/integration/testdata/image.jpeg (100%) create mode 100644 test/square/internal/multipart/test_form_data.rb create mode 100644 test/square/internal/types/test_array.rb create mode 100644 test/square/internal/types/test_boolean.rb create mode 100644 test/square/internal/types/test_enum.rb create mode 100644 test/square/internal/types/test_hash.rb create mode 100644 test/square/internal/types/test_model.rb create mode 100644 test/square/internal/types/test_union.rb create mode 100644 test/square/internal/types/test_utils.rb create mode 100644 test/square/test_helper.rb rename test/{ => square_legacy}/api/api_test_base.rb (100%) rename test/{ => square_legacy}/api/test_catalog_api.rb (100%) rename test/{ => square_legacy}/api/test_customers_api.rb (100%) rename test/{ => square_legacy}/api/test_employees_api.rb (100%) rename test/{ => square_legacy}/api/test_labor_api.rb (100%) rename test/{ => square_legacy}/api/test_locations_api.rb (100%) rename test/{ => square_legacy}/api/test_merchants_api.rb (100%) rename test/{ => square_legacy}/api/test_payments_api.rb (100%) rename test/{ => square_legacy}/api/test_refunds_api.rb (100%) rename test/{ => square_legacy}/http_response_catcher.rb (100%) rename test/{ => square_legacy}/webhooks/test_webhooks_helper.rb (100%) diff --git a/test/integration/test_catalog_serial.rb b/test/square/integration/catalog/test_catalog_serial.rb similarity index 100% rename from test/integration/test_catalog_serial.rb rename to test/square/integration/catalog/test_catalog_serial.rb diff --git a/test/square/integration/catalog/test_client.rb b/test/square/integration/catalog/test_client.rb new file mode 100644 index 000000000..671692024 --- /dev/null +++ b/test/square/integration/catalog/test_client.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +require "test_helper" + +describe Square::Catalog::Client do + describe "#batch_upsert" do + it "creates multiple catalog objects" do + skip "Skipping for now." + + response = client.catalog.batch_upsert( + request: { + idempotency_key: SecureRandom.uuid, + batches: [ + { + objects: [ + { + type: "ITEM", + id: "##{SecureRandom.uuid}", + present_at_all_locations: true, + item_data: { + name: "Coffee", + description: "Strong coffee", + abbreviation: "C", + variations: [ + { + type: "ITEM_VARIATION", + id: "##{SecureRandom.uuid}", + present_at_all_locations: true, + item_variation_data: { + name: "Kona Coffee", + track_inventory: false, + pricing_type: "FIXED_PRICING", + price_money: { + amount: 1000, + currency: "USD" + } + } + } + ] + } + }, + { + type: "ITEM", + id: "##{SecureRandom.uuid}", + present_at_all_locations: true, + item_data: { + name: "Tea", + description: "Strong tea", + abbreviation: "T", + variations: [ + { + type: "ITEM_VARIATION", + id: "##{SecureRandom.uuid}", + present_at_all_locations: true, + item_variation_data: { + name: "Gunpowder Green", + track_inventory: false, + pricing_type: "FIXED_PRICING", + price_money: { + amount: 2000, + currency: "USD" + } + } + } + ] + } + } + ] + } + ] + } + ) + + refute_nil response + end + end +end diff --git a/test/square/integration/catalog/test_object.rb b/test/square/integration/catalog/test_object.rb new file mode 100644 index 000000000..5a4288084 --- /dev/null +++ b/test/square/integration/catalog/test_object.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +require "test_helper" + +describe Square::Catalog::Object::Client do + describe "#upsert" do + it "upserts an object" do + skip "Skipping for now." + + response = client.catalog.object.upsert(request: { + idempotency_key: SecureRandom.uuid, + object: { + type: "ITEM", + id: "##{SecureRandom.uuid}", + present_at_all_locations: true, + item_data: { + name: "Coffee", + description: "Strong coffee", + abbreviation: "C", + variations: [ + { + type: "ITEM_VARIATION", + id: "##{SecureRandom.uuid}", + present_at_all_locations: true, + item_variation_data: { + name: "Kona Coffee", + track_inventory: false, + pricing_type: "FIXED_PRICING", + price_money: { + amount: 1000, + currency: "USD" + } + } + } + ] + } + } + }) + refute_nil response + end + end +end diff --git a/test/integration/helpers.rb b/test/square/integration/helpers.rb similarity index 100% rename from test/integration/helpers.rb rename to test/square/integration/helpers.rb diff --git a/test/integration/integration_test_base.rb b/test/square/integration/integration_test_base.rb similarity index 100% rename from test/integration/integration_test_base.rb rename to test/square/integration/integration_test_base.rb diff --git a/test/integration/test_cash_drawers.rb b/test/square/integration/test_cash_drawers.rb similarity index 100% rename from test/integration/test_cash_drawers.rb rename to test/square/integration/test_cash_drawers.rb diff --git a/test/integration/test_client_utils.rb b/test/square/integration/test_client_utils.rb similarity index 100% rename from test/integration/test_client_utils.rb rename to test/square/integration/test_client_utils.rb diff --git a/test/integration/test_customer_groups.rb b/test/square/integration/test_customer_groups.rb similarity index 100% rename from test/integration/test_customer_groups.rb rename to test/square/integration/test_customer_groups.rb diff --git a/test/integration/test_customer_segments.rb b/test/square/integration/test_customer_segments.rb similarity index 100% rename from test/integration/test_customer_segments.rb rename to test/square/integration/test_customer_segments.rb diff --git a/test/integration/test_devices.rb b/test/square/integration/test_devices.rb similarity index 100% rename from test/integration/test_devices.rb rename to test/square/integration/test_devices.rb diff --git a/test/integration/test_legacy.rb b/test/square/integration/test_legacy.rb similarity index 100% rename from test/integration/test_legacy.rb rename to test/square/integration/test_legacy.rb diff --git a/test/integration/test_locations.rb b/test/square/integration/test_locations.rb similarity index 100% rename from test/integration/test_locations.rb rename to test/square/integration/test_locations.rb diff --git a/test/integration/test_merchants.rb b/test/square/integration/test_merchants.rb similarity index 100% rename from test/integration/test_merchants.rb rename to test/square/integration/test_merchants.rb diff --git a/test/integration/test_mobile_authorization.rb b/test/square/integration/test_mobile_authorization.rb similarity index 100% rename from test/integration/test_mobile_authorization.rb rename to test/square/integration/test_mobile_authorization.rb diff --git a/test/integration/test_orders.rb b/test/square/integration/test_orders.rb similarity index 100% rename from test/integration/test_orders.rb rename to test/square/integration/test_orders.rb diff --git a/test/integration/test_payments.rb b/test/square/integration/test_payments.rb similarity index 100% rename from test/integration/test_payments.rb rename to test/square/integration/test_payments.rb diff --git a/test/integration/test_refunds.rb b/test/square/integration/test_refunds.rb similarity index 100% rename from test/integration/test_refunds.rb rename to test/square/integration/test_refunds.rb diff --git a/test/integration/test_teams.rb b/test/square/integration/test_teams.rb similarity index 100% rename from test/integration/test_teams.rb rename to test/square/integration/test_teams.rb diff --git a/test/integration/test_terminal.rb b/test/square/integration/test_terminal.rb similarity index 100% rename from test/integration/test_terminal.rb rename to test/square/integration/test_terminal.rb diff --git a/test/integration/testdata/image.jpeg b/test/square/integration/testdata/image.jpeg similarity index 100% rename from test/integration/testdata/image.jpeg rename to test/square/integration/testdata/image.jpeg diff --git a/test/square/internal/multipart/test_form_data.rb b/test/square/internal/multipart/test_form_data.rb new file mode 100644 index 000000000..d51a9e724 --- /dev/null +++ b/test/square/internal/multipart/test_form_data.rb @@ -0,0 +1,315 @@ +# frozen_string_literal: true + +require "minitest/autorun" +require "stringio" +require "json" + +require_relative "../../../../lib/square/file_param" +require_relative "../../../../lib/square/internal/multipart/multipart_form_data_part" +require_relative "../../../../lib/square/internal/multipart/multipart_form_data" +require_relative "../../../../lib/square/internal/multipart/multipart_encoder" + +class MockFile + attr_reader :name, :content, :content_type + + def initialize(name:, content:, content_type: nil) + @name = name + @content = content + @content_type = content_type + end + + def read + @content + end +end + +class MultipartTest < Minitest::Test + def test_empty_form_data + form_data = Square::Internal::Multipart::FormData.new + body = form_data.encode + + assert_equal "", body + end + + def test_write_field + [ + { + desc: "empty field", + field: "empty", + value: "" + }, + { + desc: "simple field", + field: "greeting", + value: "hello world" + }, + { + desc: "field with content type", + field: "message", + value: "hello", + content_type: "text/plain" + } + ].each do |test_case| + form_data = Square::Internal::Multipart::FormData.new + content_type_arg = test_case[:content_type] + + form_data.add( + name: test_case[:field], + value: test_case[:value], + content_type: content_type_arg + ) + + content_type = form_data.content_type + body = form_data.encode + + # Extract the boundary from the content type + boundary = content_type.match(/boundary=([^;]+)/)[1] + + # Verify the field was encoded properly + assert_includes body, "--#{boundary}" + assert_includes body, "Content-Disposition: form-data; name=\"#{test_case[:field]}\"" + + assert_includes body, "Content-Type: #{content_type_arg}" if content_type_arg + + assert_includes body, test_case[:value] + end + end + + def test_write_file_param + [ + { + desc: "file param with content type", + field: "file", + filename: "test.txt", + content: "hello world", + content_type: "text/plain" + }, + { + desc: "file param with override content type", + field: "file", + filename: "test.txt", + content: "hello world", + content_type: "text/plain", + override_content_type: "application/octet-stream" + } + ].each do |test_case| + form_data = Square::Internal::Multipart::FormData.new + + file_param = Square::FileParam.from_string( + content: test_case[:content], + filename: test_case[:filename], + content_type: test_case[:content_type] + ) + + form_data.add_part( + file_param.to_form_data_part( + name: test_case[:field], + content_type: test_case[:override_content_type] + ) + ) + + content_type = form_data.content_type + body = form_data.encode + + # Extract the boundary from the content type + boundary = content_type.match(/boundary=([^;]+)/)[1] + + # Verify the file param was encoded properly + assert_includes body, "--#{boundary}" + assert_includes body, + "Content-Disposition: form-data; name=\"#{test_case[:field]}\"; filename=\"#{test_case[:filename]}\"" + + expected_content_type = test_case[:override_content_type] || test_case[:content_type] + assert_includes body, "Content-Type: #{expected_content_type}" if expected_content_type + + assert_includes body, test_case[:content] + end + end + + def test_write_json + [ + { + desc: "struct", + field: "data", + value: { name: "test", value: 123 } + }, + { + desc: "map", + field: "data", + value: { key: "value" } + } + ].each do |test_case| + form_data = Square::Internal::Multipart::FormData.new + + form_data.add( + name: test_case[:field], + value: test_case[:value].to_json, + content_type: "application/json" + ) + + content_type = form_data.content_type + body = form_data.encode + + # Extract the boundary from the content type + boundary = content_type.match(/boundary=([^;]+)/)[1] + + # Verify the JSON was encoded properly + assert_includes body, "--#{boundary}" + assert_includes body, "Content-Disposition: form-data; name=\"#{test_case[:field]}\"" + assert_includes body, "Content-Type: application/json" + assert_includes body, test_case[:value].to_json + end + end + + def test_complex_form + form_data = Square::Internal::Multipart::FormData.new + + # Add multiple fields and files + form_data.add(name: "foo", value: "bar") + form_data.add(name: "baz", value: "qux") + + part = Square::FileParam.from_string( + content: "Hello, world!", + filename: "file.txt", + content_type: "text/plain" + ) + + form_data.add_part(part.to_form_data_part(name: "file")) + form_data.add(name: "data", value: { key: "value" }.to_json, content_type: "application/json") + + content_type = form_data.content_type + body = form_data.encode + + # Extract the boundary from the content type + boundary = content_type.match(/boundary=([^;]+)/)[1] + + # Verify all parts are in the body + assert_includes body, "--#{boundary}" + assert_includes body, "Content-Disposition: form-data; name=\"foo\"" + assert_includes body, "bar" + assert_includes body, "Content-Disposition: form-data; name=\"baz\"" + assert_includes body, "qux" + assert_includes body, "Content-Disposition: form-data; name=\"file\"; filename=\"file.txt\"" + assert_includes body, "Content-Type: text/plain" + assert_includes body, "Hello, world!" + assert_includes body, "Content-Disposition: form-data; name=\"data\"" + assert_includes body, "Content-Type: application/json" + assert_includes body, "{\"key\":\"value\"}" + end + + def test_file_param_from_filepath + # Create a temporary file for testing + file_content = "Test file content" + temp_file = Tempfile.new(["test", ".txt"]) + begin + temp_file.write(file_content) + temp_file.rewind + + file_param = Square::FileParam.from_filepath( + filepath: temp_file.path, + content_type: "text/plain" + ) + + # Verify the file param was created properly + form_data = Square::Internal::Multipart::FormData.new + form_data.add_part(file_param.to_form_data_part(name: "file")) + + content_type = form_data.content_type + body = form_data.encode + + # Extract the boundary from the content type + boundary = content_type.match(/boundary=([^;]+)/)[1] + + # Verify the file was encoded properly + assert_includes body, "--#{boundary}" + assert_includes body, + "Content-Disposition: form-data; name=\"file\"; filename=\"#{File.basename(temp_file.path)}\"" + assert_includes body, "Content-Type: text/plain" + assert_includes body, file_content + ensure + # Close and delete the temporary file + temp_file.close + temp_file.unlink + end + end + + def test_file_param_from_string + file_content = "Test string content" + filename = "string.txt" + content_type = "text/plain" + + file_param = Square::FileParam.from_string( + content: file_content, + filename: filename, + content_type: content_type + ) + + # Verify the file param was created properly + form_data = Square::Internal::Multipart::FormData.new + form_data.add_part(file_param.to_form_data_part(name: "file")) + + content_type = form_data.content_type + body = form_data.encode + + # Extract the boundary from the content type + boundary = content_type.match(/boundary=([^;]+)/)[1] + + # Verify the file was encoded properly + assert_includes body, "--#{boundary}" + assert_includes body, "Content-Disposition: form-data; name=\"file\"; filename=\"#{filename}\"" + assert_includes body, "Content-Type: text/plain" + assert_includes body, file_content + end + + def test_encoder_file_reading_in_chunks + file_size = 1024 * 100 # 100KB + large_content = "x" * file_size + + temp_file = Tempfile.new(["large", ".dat"]) + begin + temp_file.write(large_content) + temp_file.rewind + + form_data = Square::Internal::Multipart::FormData.new + form_data.add_file( + name: "large_file", + file: temp_file, + content_type: "application/octet-stream" + ) + + content_type = form_data.content_type + body = form_data.encode + + boundary = content_type.match(/boundary=([^;]+)/)[1] + + assert_includes body, "--#{boundary}" + assert_includes body, + "Content-Disposition: form-data; name=\"large_file\"; filename=\"#{File.basename(temp_file.path)}\"" + assert_includes body, "Content-Type: application/octet-stream" + + content_start = body.index("Content-Type: application/octet-stream\r\n\r\n") + + "Content-Type: application/octet-stream\r\n\r\n".length + + content_end = body.index("\r\n--#{boundary}", content_start) + + actual_content = body[content_start...content_end] + + assert_equal file_size, actual_content.length + + # Verify the content is correct (checking first, middle, and last parts). + assert_equal "x" * 100, actual_content[0...100] + assert_equal "x" * 100, actual_content[((file_size / 2) - 50)...((file_size / 2) + 50)] + assert_equal "x" * 100, actual_content[(file_size - 100)...file_size] + ensure + # Close and delete the temporary file. + temp_file.close + temp_file.unlink + end + end + + def test_error_handling_for_missing_file + assert_raises(StandardError) do + Square::FileParam.from_filepath(filepath: "nonexistent_file.txt") + end + end +end diff --git a/test/square/internal/types/test_array.rb b/test/square/internal/types/test_array.rb new file mode 100644 index 000000000..1cb863d9f --- /dev/null +++ b/test/square/internal/types/test_array.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require "test_helper" + +describe Square::Internal::Types::Array do + module TestArray + StringArray = Square::Internal::Types::Array[String] + end + + describe "#initialize" do + it "sets the type" do + assert_equal String, TestArray::StringArray.type + end + end + + describe "#coerce" do + it "does not perform coercion if not an array" do + assert_equal 1, TestArray::StringArray.coerce(1) + end + + it "raises an error if not an array and strictness is on" do + assert_raises Square::Internal::Errors::TypeError do + TestArray::StringArray.coerce(1, strict: true) + end + end + + it "coerces the elements" do + assert_equal %w[foobar 1 true], TestArray::StringArray.coerce(["foobar", 1, true]) + end + + it "raises an error if element of array is not coercable and strictness is on" do + assert_raises Square::Internal::Errors::TypeError do + TestArray::StringArray.coerce([Object.new], strict: true) + end + end + end +end diff --git a/test/square/internal/types/test_boolean.rb b/test/square/internal/types/test_boolean.rb new file mode 100644 index 000000000..eaa552add --- /dev/null +++ b/test/square/internal/types/test_boolean.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require "test_helper" + +describe Square::Internal::Types::Boolean do + describe ".coerce" do + it "coerces true/false" do + assert Square::Internal::Types::Boolean.coerce(true) + refute Square::Internal::Types::Boolean.coerce(false) + end + + it "coerces an Integer" do + assert Square::Internal::Types::Boolean.coerce(1) + refute Square::Internal::Types::Boolean.coerce(0) + end + + it "coerces a String" do + assert Square::Internal::Types::Boolean.coerce("1") + assert Square::Internal::Types::Boolean.coerce("true") + refute Square::Internal::Types::Boolean.coerce("0") + end + + it "passes through other values with strictness off" do + obj = Object.new + + assert_equal obj, Square::Internal::Types::Boolean.coerce(obj) + end + + it "raises an error with other values with strictness on" do + assert_raises Square::Internal::Errors::TypeError do + Square::Internal::Types::Boolean.coerce(Object.new, strict: true) + end + end + end +end diff --git a/test/square/internal/types/test_enum.rb b/test/square/internal/types/test_enum.rb new file mode 100644 index 000000000..e920cff01 --- /dev/null +++ b/test/square/internal/types/test_enum.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +require "test_helper" + +describe Square::Internal::Types::Enum do + module EnumTest + module ExampleEnum + extend Square::Internal::Types::Enum + + FOO = :foo + BAR = :bar + + finalize! + end + end + + describe "#values" do + it "defines values" do + assert_equal %i[foo bar].sort, EnumTest::ExampleEnum.values.sort + end + end + + describe "#coerce" do + it "coerces an existing member" do + assert_equal :foo, EnumTest::ExampleEnum.coerce(:foo) + end + + it "coerces a string version of a member" do + assert_equal :foo, EnumTest::ExampleEnum.coerce("foo") + end + + it "returns the value if not a member with strictness off" do + assert_equal 1, EnumTest::ExampleEnum.coerce(1) + end + + it "raises an error if value is not a member with strictness on" do + assert_raises Square::Internal::Errors::TypeError do + EnumTest::ExampleEnum.coerce(1, strict: true) + end + end + end +end diff --git a/test/square/internal/types/test_hash.rb b/test/square/internal/types/test_hash.rb new file mode 100644 index 000000000..c454f985a --- /dev/null +++ b/test/square/internal/types/test_hash.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +require "test_helper" + +describe Square::Internal::Types::Hash do + module TestHash + SymbolStringHash = Square::Internal::Types::Hash[Symbol, String] + end + + describe ".[]" do + it "defines the key and value type" do + assert_equal Symbol, TestHash::SymbolStringHash.key_type + assert_equal String, TestHash::SymbolStringHash.value_type + end + end + + describe "#coerce" do + it "coerces the keys" do + assert_equal %i[foo bar], TestHash::SymbolStringHash.coerce({ "foo" => "1", :bar => "2" }).keys + end + + it "coerces the values" do + assert_equal %w[foo 1], TestHash::SymbolStringHash.coerce({ foo: :foo, bar: 1 }).values + end + + it "passes through other values with strictness off" do + obj = Object.new + + assert_equal obj, TestHash::SymbolStringHash.coerce(obj) + end + + it "raises an error with other values with strictness on" do + assert_raises Square::Internal::Errors::TypeError do + TestHash::SymbolStringHash.coerce(Object.new, strict: true) + end + end + + it "raises an error with non-coercable key types with strictness on" do + assert_raises Square::Internal::Errors::TypeError do + TestHash::SymbolStringHash.coerce({ Object.new => 1 }, strict: true) + end + end + + it "raises an error with non-coercable value types with strictness on" do + assert_raises Square::Internal::Errors::TypeError do + TestHash::SymbolStringHash.coerce({ "foobar" => Object.new }, strict: true) + end + end + end +end diff --git a/test/square/internal/types/test_model.rb b/test/square/internal/types/test_model.rb new file mode 100644 index 000000000..5b612bbb5 --- /dev/null +++ b/test/square/internal/types/test_model.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +require "test_helper" + +describe Square::Internal::Types::Model do + module StringInteger + extend Square::Internal::Types::Union + + member String + member Integer + end + + class ExampleModel < Square::Internal::Types::Model + field :name, String + field :rating, StringInteger, optional: true + field :year, Integer, optional: true, nullable: true, api_name: "yearOfRelease" + end + + class ExampleModelInheritance < ExampleModel + field :director, String + end + + class ExampleWithDefaults < ExampleModel + field :type, String, default: "example" + end + + class ExampleChild < Square::Internal::Types::Model + field :value, String + end + + class ExampleParent < Square::Internal::Types::Model + field :child, ExampleChild + end + + describe ".field" do + before do + @example = ExampleModel.new(name: "Inception", rating: 4) + end + + it "defines fields on model" do + assert_equal %i[name rating year], ExampleModel.fields.keys + end + + it "defines fields from parent models" do + assert_equal %i[name rating year director], ExampleModelInheritance.fields.keys + end + + it "sets the field's type" do + assert_equal String, ExampleModel.fields[:name].type + assert_equal StringInteger, ExampleModel.fields[:rating].type + end + + it "sets the `default` option" do + assert_equal "example", ExampleWithDefaults.fields[:type].default + end + + it "defines the accessors" do + assert_respond_to @example, :name + assert_respond_to @example, :rating + end + + it "defines the setters" do + assert_respond_to @example, :name= + assert_respond_to @example, :rating= + end + end + + describe "#initialize" do + it "sets the data" do + example = ExampleModel.new(name: "Inception", rating: 4) + + assert_equal "Inception", example.name + assert_equal 4, example.rating + end + + it "allows extra fields to be set" do + example = ExampleModel.new(name: "Inception", rating: 4, director: "Christopher Nolan") + + assert_equal "Christopher Nolan", example.director + end + + it "sets the defaults where applicable" do + example_using_defaults = ExampleWithDefaults.new + + assert_equal "example", example_using_defaults.type + + example_without_defaults = ExampleWithDefaults.new(type: "not example") + + assert_equal "not example", example_without_defaults.type + end + + it "coerces child models" do + parent = ExampleParent.new(child: { value: "foobar" }) + + assert_kind_of ExampleChild, parent.child + end + + it "uses the api_name to pull the value" do + example = ExampleModel.new({ name: "Inception", yearOfRelease: 2014 }) + + assert_equal 2014, example.year + refute_respond_to example, :yearOfRelease + end + end + + describe "#to_h" do + it "adds optional and nullable fields to output" do + example = ExampleModel.new( + name: "Inception" + ) + + output = example.to_h + + assert_equal "Inception", output[:name] + + # `rating` is optional but not nullable, so we don't return it at all if it is not present + refute_includes output.keys, :rating + + # `year` is optional AND nullable, so we return a nil value + assert_includes output.keys, :yearOfRelease + assert_nil output[:yearOfRelease] + end + end +end diff --git a/test/square/internal/types/test_union.rb b/test/square/internal/types/test_union.rb new file mode 100644 index 000000000..44df2446e --- /dev/null +++ b/test/square/internal/types/test_union.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +require "test_helper" +describe Square::Internal::Types::Union do + class Rectangle < Square::Internal::Types::Model + literal :type, "square" + + field :area, Float + end + + class Circle < Square::Internal::Types::Model + literal :type, "circle" + + field :area, Float + end + + module Shape + extend Square::Internal::Types::Union + + discriminant :type + + member -> { Rectangle }, key: "rect" + member -> { Circle }, key: "circle" + end + + module StringOrInteger + extend Square::Internal::Types::Union + + member String + member Integer + end + + describe "#coerce" do + it "coerces hashes into member models with discriminated unions" do + circle = Shape.coerce({ type: "circle", area: 4.0 }) + + assert_instance_of Circle, circle + end + end + + describe "#member" do + it "defines Model members" do + assert Shape.member?(Rectangle) + assert Shape.member?(Circle) + end + + it "defines other members" do + assert StringOrInteger.member?(String) + assert StringOrInteger.member?(Integer) + end + end +end diff --git a/test/square/internal/types/test_utils.rb b/test/square/internal/types/test_utils.rb new file mode 100644 index 000000000..5de25395b --- /dev/null +++ b/test/square/internal/types/test_utils.rb @@ -0,0 +1,216 @@ +# frozen_string_literal: true + +require "test_helper" + +describe Square::Internal::Types::Utils do + Utils = Square::Internal::Types::Utils + + module TestUtils + class M < Square::Internal::Types::Model + field :value, String + end + + class UnionMemberA < Square::Internal::Types::Model + literal :type, "A" + field :only_on_a, String + end + + class UnionMemberB < Square::Internal::Types::Model + literal :type, "B" + field :only_on_b, String + end + + module U + extend Square::Internal::Types::Union + + discriminant :type + + member -> { UnionMemberA }, key: "A" + member -> { UnionMemberB }, key: "B" + end + + SymbolStringHash = Square::Internal::Types::Hash[Symbol, String] + SymbolModelHash = -> { Square::Internal::Types::Hash[Symbol, TestUtils::M] } + end + + describe ".coerce" do + describe "NilClass" do + it "always returns nil" do + assert_nil Utils.coerce(NilClass, "foobar") + assert_nil Utils.coerce(NilClass, 1) + assert_nil Utils.coerce(NilClass, Object.new) + end + end + + describe "String" do + it "coerces from String, Symbol, Numeric, or Boolean" do + assert_equal "foobar", Utils.coerce(String, "foobar") + assert_equal "foobar", Utils.coerce(String, :foobar) + assert_equal "1", Utils.coerce(String, 1) + assert_equal "1.0", Utils.coerce(String, 1.0) + assert_equal "true", Utils.coerce(String, true) + end + + it "passes through value if it cannot be coerced and not strict" do + obj = Object.new + + assert_equal obj, Utils.coerce(String, obj) + end + + it "raises an error if value cannot be coerced and strict" do + assert_raises Square::Internal::Errors::TypeError do + Utils.coerce(String, Object.new, strict: true) + end + end + end + + describe "Symbol" do + it "coerces from Symbol, String" do + assert_equal :foobar, Utils.coerce(Symbol, :foobar) + assert_equal :foobar, Utils.coerce(Symbol, "foobar") + end + + it "passes through value if it cannot be coerced and not strict" do + obj = Object.new + + assert_equal obj, Utils.coerce(Symbol, obj) + end + + it "raises an error if value cannot be coerced and strict" do + assert_raises Square::Internal::Errors::TypeError do + Utils.coerce(Symbol, Object.new, strict: true) + end + end + end + + describe "Integer" do + it "coerces from Numeric, String, Time" do + assert_equal 1, Utils.coerce(Integer, 1) + assert_equal 1, Utils.coerce(Integer, 1.0) + assert_equal 1, Utils.coerce(Integer, Complex.rect(1)) + assert_equal 1, Utils.coerce(Integer, Rational(1)) + assert_equal 1, Utils.coerce(Integer, "1") + assert_equal 1_713_916_800, Utils.coerce(Integer, Time.utc(2024, 4, 24)) + end + + it "passes through value if it cannot be coerced and not strict" do + obj = Object.new + + assert_equal obj, Utils.coerce(Integer, obj) + end + + it "raises an error if value cannot be coerced and strict" do + assert_raises Square::Internal::Errors::TypeError do + Utils.coerce(Integer, Object.new, strict: true) + end + end + end + + describe "Float" do + it "coerces from Numeric, Time" do + assert_in_delta(1.0, Utils.coerce(Float, 1.0)) + assert_in_delta(1.0, Utils.coerce(Float, 1)) + assert_in_delta(1.0, Utils.coerce(Float, Complex.rect(1))) + assert_in_delta(1.0, Utils.coerce(Float, Rational(1))) + assert_in_delta(1_713_916_800.0, Utils.coerce(Integer, Time.utc(2024, 4, 24))) + end + + it "passes through value if it cannot be coerced and not strict" do + obj = Object.new + + assert_equal obj, Utils.coerce(Float, obj) + end + + it "raises an error if value cannot be coerced and strict" do + assert_raises Square::Internal::Errors::TypeError do + Utils.coerce(Float, Object.new, strict: true) + end + end + end + + describe "Model" do + it "coerces a hash" do + result = Utils.coerce(TestUtils::M, { value: "foobar" }) + + assert_kind_of TestUtils::M, result + assert_equal "foobar", result.value + end + + it "coerces a hash when the target is a type function" do + result = Utils.coerce(-> { TestUtils::M }, { value: "foobar" }) + + assert_kind_of TestUtils::M, result + assert_equal "foobar", result.value + end + + it "will not coerce non-hashes" do + assert_equal "foobar", Utils.coerce(TestUtils::M, "foobar") + end + end + + describe "Enum" do + module ExampleEnum + extend Square::Internal::Types::Enum + + FOO = :FOO + BAR = :BAR + + finalize! + end + + it "coerces into a Symbol version of the member value" do + assert_equal :FOO, Utils.coerce(ExampleEnum, "FOO") + end + + it "returns given value if not a member" do + assert_equal "NOPE", Utils.coerce(ExampleEnum, "NOPE") + end + end + + describe "Array" do + StringArray = Square::Internal::Types::Array[String] + ModelArray = -> { Square::Internal::Types::Array[TestUtils::M] } + UnionArray = -> { Square::Internal::Types::Array[TestUtils::U] } + + it "coerces an array of literals" do + skip "TODO: Fix me!" + + assert_equal %w[a b c], Utils.coerce(StringArray, %w[a b c]) + assert_equal ["1", "2.0", "true"], Utils.coerce(StringArray, [1, 2.0, true]) + assert_equal ["1", "2.0", "true"], Utils.coerce(StringArray, Set.new([1, 2.0, true])) + end + + it "coerces an array of Models" do + assert_equal [TestUtils::M.new(value: "foobar"), TestUtils::M.new(value: "bizbaz")], + Utils.coerce(ModelArray, [{ value: "foobar" }, { value: "bizbaz" }]) + + assert_equal [TestUtils::M.new(value: "foobar"), TestUtils::M.new(value: "bizbaz")], + Utils.coerce(ModelArray, [TestUtils::M.new(value: "foobar"), TestUtils::M.new(value: "bizbaz")]) + end + + it "coerces an array of model unions" do + assert_equal [TestUtils::UnionMemberA.new(type: "A", only_on_a: "A"), TestUtils::UnionMemberB.new(type: "B", only_on_b: "B")], + Utils.coerce(UnionArray, [{ type: "A", only_on_a: "A" }, { type: "B", only_on_b: "B" }]) + end + + it "returns given value if not an array" do + skip "TODO: Fix me!" + + assert_equal 1, Utils.coerce(StringArray, 1) + end + end + + describe "Hash" do + it "coerces the keys and values" do + ssh_res = Utils.coerce(TestUtils::SymbolStringHash, { "foo" => "bar", "biz" => "2" }) + + assert_equal "bar", ssh_res[:foo] + assert_equal "2", ssh_res[:biz] + + smh_res = Utils.coerce(TestUtils::SymbolModelHash, { "foo" => { "value" => "foo" } }) + + assert_equal TestUtils::M.new(value: "foo"), smh_res[:foo] + end + end + end +end diff --git a/test/square/test_helper.rb b/test/square/test_helper.rb new file mode 100644 index 000000000..70b6da8ee --- /dev/null +++ b/test/square/test_helper.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +$LOAD_PATH.unshift File.expand_path("../lib", __dir__) +require "square" + +def test_token + @test_token ||= ENV.fetch("SQUARE_TOKEN", nil) || ENV.fetch("TEST_SQUARE_TOKEN", nil) || "test_token" +end + +def client + @client ||= Square::Client.new( + token: test_token + ) +end + +require "minitest/autorun" +require "minitest/rg" + + diff --git a/test/api/api_test_base.rb b/test/square_legacy/api/api_test_base.rb similarity index 100% rename from test/api/api_test_base.rb rename to test/square_legacy/api/api_test_base.rb diff --git a/test/api/test_catalog_api.rb b/test/square_legacy/api/test_catalog_api.rb similarity index 100% rename from test/api/test_catalog_api.rb rename to test/square_legacy/api/test_catalog_api.rb diff --git a/test/api/test_customers_api.rb b/test/square_legacy/api/test_customers_api.rb similarity index 100% rename from test/api/test_customers_api.rb rename to test/square_legacy/api/test_customers_api.rb diff --git a/test/api/test_employees_api.rb b/test/square_legacy/api/test_employees_api.rb similarity index 100% rename from test/api/test_employees_api.rb rename to test/square_legacy/api/test_employees_api.rb diff --git a/test/api/test_labor_api.rb b/test/square_legacy/api/test_labor_api.rb similarity index 100% rename from test/api/test_labor_api.rb rename to test/square_legacy/api/test_labor_api.rb diff --git a/test/api/test_locations_api.rb b/test/square_legacy/api/test_locations_api.rb similarity index 100% rename from test/api/test_locations_api.rb rename to test/square_legacy/api/test_locations_api.rb diff --git a/test/api/test_merchants_api.rb b/test/square_legacy/api/test_merchants_api.rb similarity index 100% rename from test/api/test_merchants_api.rb rename to test/square_legacy/api/test_merchants_api.rb diff --git a/test/api/test_payments_api.rb b/test/square_legacy/api/test_payments_api.rb similarity index 100% rename from test/api/test_payments_api.rb rename to test/square_legacy/api/test_payments_api.rb diff --git a/test/api/test_refunds_api.rb b/test/square_legacy/api/test_refunds_api.rb similarity index 100% rename from test/api/test_refunds_api.rb rename to test/square_legacy/api/test_refunds_api.rb diff --git a/test/http_response_catcher.rb b/test/square_legacy/http_response_catcher.rb similarity index 100% rename from test/http_response_catcher.rb rename to test/square_legacy/http_response_catcher.rb diff --git a/test/webhooks/test_webhooks_helper.rb b/test/square_legacy/webhooks/test_webhooks_helper.rb similarity index 100% rename from test/webhooks/test_webhooks_helper.rb rename to test/square_legacy/webhooks/test_webhooks_helper.rb From 8a27a1f65c51c00b97316f1f09325202983e0f4f Mon Sep 17 00:00:00 2001 From: Fern Support <126544928+fern-support@users.noreply.github.com> Date: Mon, 18 Aug 2025 13:15:56 -0400 Subject: [PATCH 04/31] manually fix circular references with forward declarations (#161) Co-authored-by: jsklan --- .fernignore | 8 +++++++- lib/square/types/catalog_object_category.rb | 6 ++++++ lib/square/types/catalog_object_item.rb | 6 ++++++ lib/square/types/catalog_object_item_option.rb | 6 ++++++ lib/square/types/catalog_object_modifier_list.rb | 6 ++++++ lib/square/types/catalog_object_subscription_plan.rb | 6 ++++++ 6 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.fernignore b/.fernignore index 75d1cd07f..f63ee6578 100644 --- a/.fernignore +++ b/.fernignore @@ -1,4 +1,10 @@ lib/square_legacy/ lib/square_legacy.rb Gemfile -Rakefile \ No newline at end of file +Rakefile + +lib/square/types/catalog_object_category.rb +lib/square/types/catalog_object_subscription_plan.rb +lib/square/types/catalog_object_item_option.rb +lib/square/types/catalog_object_modifier_list.rb +lib/square/types/catalog_object_item.rb diff --git a/lib/square/types/catalog_object_category.rb b/lib/square/types/catalog_object_category.rb index 11326a5cc..53ac61e97 100644 --- a/lib/square/types/catalog_object_category.rb +++ b/lib/square/types/catalog_object_category.rb @@ -6,6 +6,12 @@ module Types # 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. class CatalogObjectCategory < Internal::Types::Model + + # Manual Forward Declarations + class Square::Types::CatalogCategory < Internal::Types::Model; end + class Square::Types::CatalogCustomAttributeValue < Internal::Types::Model; end + class Square::Types::CatalogV1Id < Internal::Types::Model; end + field :id, String, optional: true, nullable: false field :ordinal, Integer, optional: true, nullable: false field :type, String, optional: false, nullable: false diff --git a/lib/square/types/catalog_object_item.rb b/lib/square/types/catalog_object_item.rb index 74746be61..9f5144923 100644 --- a/lib/square/types/catalog_object_item.rb +++ b/lib/square/types/catalog_object_item.rb @@ -3,6 +3,12 @@ module Square module Types class CatalogObjectItem < Internal::Types::Model + + # Manual Forward Declarations + class Square::Types::CatalogItem < Internal::Types::Model; end + class Square::Types::CatalogCustomAttributeValue < Internal::Types::Model; end + class Square::Types::CatalogV1Id < Internal::Types::Model; end + field :type, String, optional: false, nullable: false field :item_data, Square::Types::CatalogItem, optional: true, nullable: false field :id, String, optional: false, nullable: false diff --git a/lib/square/types/catalog_object_item_option.rb b/lib/square/types/catalog_object_item_option.rb index 271df701b..f8da70337 100644 --- a/lib/square/types/catalog_object_item_option.rb +++ b/lib/square/types/catalog_object_item_option.rb @@ -3,6 +3,12 @@ module Square module Types class CatalogObjectItemOption < Internal::Types::Model + + # Manual Forward Declarations + class Square::Types::CatalogItemOption < Internal::Types::Model; end + class Square::Types::CatalogCustomAttributeValue < Internal::Types::Model; end + class Square::Types::CatalogV1Id < Internal::Types::Model; end + field :type, String, optional: false, nullable: false field :item_option_data, Square::Types::CatalogItemOption, optional: true, nullable: false field :id, String, optional: false, nullable: false diff --git a/lib/square/types/catalog_object_modifier_list.rb b/lib/square/types/catalog_object_modifier_list.rb index 9da9c04d8..2459e0dd5 100644 --- a/lib/square/types/catalog_object_modifier_list.rb +++ b/lib/square/types/catalog_object_modifier_list.rb @@ -3,6 +3,12 @@ module Square module Types class CatalogObjectModifierList < Internal::Types::Model + + # Manual Forward Declarations + class Square::Types::CatalogModifierList < Internal::Types::Model; end + class Square::Types::CatalogCustomAttributeValue < Internal::Types::Model; end + class Square::Types::CatalogV1Id < Internal::Types::Model; end + field :type, String, optional: false, nullable: false field :modifier_list_data, Square::Types::CatalogModifierList, optional: true, nullable: false field :id, String, optional: false, nullable: false diff --git a/lib/square/types/catalog_object_subscription_plan.rb b/lib/square/types/catalog_object_subscription_plan.rb index ade12b8f3..dbaf95a0f 100644 --- a/lib/square/types/catalog_object_subscription_plan.rb +++ b/lib/square/types/catalog_object_subscription_plan.rb @@ -3,6 +3,12 @@ module Square module Types class CatalogObjectSubscriptionPlan < Internal::Types::Model + + # Manual Forward Declarations + class Square::Types::CatalogSubscriptionPlan < Internal::Types::Model; end + class Square::Types::CatalogCustomAttributeValue < Internal::Types::Model; end + class Square::Types::CatalogV1Id < Internal::Types::Model; end + field :type, String, optional: false, nullable: false field :subscription_plan_data, Square::Types::CatalogSubscriptionPlan, optional: true, nullable: false field :id, String, optional: false, nullable: false From bf89fee4b146b6679addae7d98b1b46abd2b8aee Mon Sep 17 00:00:00 2001 From: Chris Mallinson Date: Mon, 18 Aug 2025 15:00:21 -0400 Subject: [PATCH 05/31] Updating Rakefile --- Rakefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Rakefile b/Rakefile index fa395a88f..6ec8da12b 100644 --- a/Rakefile +++ b/Rakefile @@ -3,12 +3,12 @@ require "bundler/gem_tasks" require "minitest/test_task" -# Minitest::TestTask.create +Minitest::TestTask.create -# require "rubocop/rake_task" +require "rubocop/rake_task" -# RuboCop::RakeTask.new +RuboCop::RakeTask.new -# task default: %i[test] +task default: %i[test] -# task lint: %i[rubocop] +task lint: %i[rubocop] \ No newline at end of file From 74eba23b03ff3b5bbd7d44dbad913a2afbff9054 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 15:14:50 -0400 Subject: [PATCH 06/31] :herb: Fern Regeneration -- August 18, 2025 (#164) * update fernignore (#163) * update fernignore * remove ignores --------- Co-authored-by: jsklan * SDK regeneration --------- Co-authored-by: Fern Support <126544928+fern-support@users.noreply.github.com> Co-authored-by: jsklan Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> --- .fernignore | 10 +- .github/ISSUE_TEMPLATE/bug_report.md | 33 - .github/ISSUE_TEMPLATE/config.yml | 11 - .github/labeler.yml | 21 - .github/pull_request_template.md | 4 - .github/workflows/publish.yml | 43 - .github/workflows/ruby.yml | 65 - .mock/definition/__package__.yml | 34581 +++++++ .mock/definition/api.yml | 19 + .mock/definition/applePay.yml | 80 + .mock/definition/bankAccounts.yml | 212 + .mock/definition/bookings.yml | 881 + .../bookings/customAttributeDefinitions.yml | 398 + .../definition/bookings/customAttributes.yml | 546 + .../definition/bookings/locationProfiles.yml | 54 + .../bookings/teamMemberProfiles.yml | 105 + .mock/definition/cards.yml | 355 + .mock/definition/cashDrawers/shifts.yml | 264 + .mock/definition/catalog.yml | 1204 + .mock/definition/catalog/images.yml | 148 + .mock/definition/catalog/object.yml | 390 + .mock/definition/checkout.yml | 229 + .mock/definition/checkout/paymentLinks.yml | 448 + .mock/definition/customers.yml | 1152 + .mock/definition/customers/cards.yml | 177 + .../customers/customAttributeDefinitions.yml | 588 + .../definition/customers/customAttributes.yml | 384 + .mock/definition/customers/groups.yml | 307 + .mock/definition/customers/segments.yml | 117 + .mock/definition/devices.yml | 203 + .mock/definition/devices/codes.yml | 200 + .mock/definition/disputes.yml | 406 + .mock/definition/disputes/evidence.yml | 160 + .mock/definition/employees.yml | 106 + .mock/definition/events.yml | 192 + .mock/definition/giftCards.yml | 482 + .mock/definition/giftCards/activities.yml | 324 + .mock/definition/inventory.yml | 815 + .mock/definition/invoices.yml | 1207 + .mock/definition/labor.yml | 1023 + .mock/definition/labor/breakTypes.yml | 275 + .mock/definition/labor/employeeWages.yml | 117 + .mock/definition/labor/shifts.yml | 461 + .mock/definition/labor/teamMemberWages.yml | 127 + .mock/definition/labor/workweekConfigs.yml | 101 + .mock/definition/locations.yml | 796 + .../locations/customAttributeDefinitions.yml | 403 + .../definition/locations/customAttributes.yml | 557 + .mock/definition/locations/transactions.yml | 331 + .mock/definition/loyalty.yml | 137 + .mock/definition/loyalty/accounts.yml | 472 + .mock/definition/loyalty/programs.yml | 274 + .../loyalty/programs/promotions.yml | 464 + .mock/definition/loyalty/rewards.yml | 380 + .mock/definition/merchants.yml | 116 + .../merchants/customAttributeDefinitions.yml | 405 + .../definition/merchants/customAttributes.yml | 532 + .mock/definition/mobile.yml | 78 + .mock/definition/oAuth.yml | 376 + .mock/definition/orders.yml | 1718 + .../orders/customAttributeDefinitions.yml | 388 + .mock/definition/orders/customAttributes.yml | 561 + .mock/definition/payments.yml | 1618 + .mock/definition/payouts.yml | 282 + .mock/definition/refunds.yml | 489 + .mock/definition/sites.yml | 52 + .mock/definition/snippets.yml | 162 + .mock/definition/subscriptions.yml | 1239 + .mock/definition/team.yml | 218 + .mock/definition/teamMembers.yml | 777 + .mock/definition/teamMembers/wageSetting.yml | 174 + .mock/definition/terminal.yml | 238 + .mock/definition/terminal/actions.yml | 456 + .mock/definition/terminal/checkouts.yml | 362 + .mock/definition/terminal/refunds.yml | 261 + .mock/definition/v1Transactions.yml | 372 + .mock/definition/vendors.yml | 544 + .mock/definition/webhooks/eventTypes.yml | 44 + .mock/definition/webhooks/subscriptions.yml | 383 + .mock/fern.config.json | 4 + .mock/openapi/openapi.json | 76800 ++++++++++++++++ CHANGELOG.md | 1056 - CONTRIBUTING.md | 21 - Jenkinsfile | 10 - LICENSE | 31 +- README.md | 190 - doc/api/apple-pay.md | 59 - doc/api/bank-accounts.md | 120 - doc/api/booking-custom-attributes.md | 532 - doc/api/bookings.md | 547 - doc/api/cards.md | 179 - doc/api/cash-drawers.md | 148 - doc/api/catalog.md | 845 - doc/api/checkout.md | 493 - doc/api/customer-custom-attributes.md | 509 - doc/api/customer-groups.md | 204 - doc/api/customer-segments.md | 82 - doc/api/customers.md | 728 - doc/api/devices.md | 203 - doc/api/disputes.md | 374 - doc/api/employees.md | 86 - doc/api/events.md | 134 - doc/api/gift-card-activities.md | 109 - doc/api/gift-cards.md | 296 - doc/api/inventory.md | 612 - doc/api/invoices.md | 533 - doc/api/labor.md | 751 - doc/api/location-custom-attributes.md | 529 - doc/api/locations.md | 193 - doc/api/loyalty.md | 863 - doc/api/merchant-custom-attributes.md | 528 - doc/api/merchants.md | 89 - doc/api/mobile-authorization.md | 57 - doc/api/o-auth.md | 170 - doc/api/order-custom-attributes.md | 560 - doc/api/orders.md | 490 - doc/api/payments.md | 358 - doc/api/payouts.md | 137 - doc/api/refunds.md | 155 - doc/api/sites.md | 37 - doc/api/snippets.md | 142 - doc/api/subscriptions.md | 557 - doc/api/team.md | 648 - doc/api/terminal.md | 602 - doc/api/transactions.md | 203 - doc/api/v1-transactions.md | 151 - doc/api/vendors.md | 293 - doc/api/webhook-subscriptions.md | 337 - doc/auth/oauth-2-bearer-token.md | 25 - doc/client.md | 123 - doc/http-request.md | 15 - doc/http-response.md | 15 - doc/models/accept-dispute-response.md | 64 - doc/models/accepted-payment-methods.md | 27 - .../accumulate-loyalty-points-request.md | 31 - .../accumulate-loyalty-points-response.md | 99 - doc/models/ach-details.md | 27 - doc/models/action-cancel-reason.md | 15 - doc/models/activity-type.md | 70 - doc/models/add-group-to-customer-response.md | 31 - doc/models/additional-recipient.md | 32 - doc/models/address.md | 41 - doc/models/adjust-loyalty-points-request.md | 31 - doc/models/adjust-loyalty-points-response.md | 63 - doc/models/afterpay-details.md | 23 - ...ication-details-external-square-product.md | 24 - doc/models/application-details.md | 25 - doc/models/application-type.md | 13 - doc/models/appointment-segment.md | 34 - doc/models/archived-state.md | 19 - doc/models/availability.md | 36 - doc/models/bank-account-payment-details.md | 34 - doc/models/bank-account-status.md | 17 - doc/models/bank-account-type.md | 19 - doc/models/bank-account.md | 55 - doc/models/batch-change-inventory-request.md | 67 - doc/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 - doc/models/batch-retrieve-orders-request.md | 29 - doc/models/batch-retrieve-orders-response.md | 121 - .../batch-upsert-catalog-objects-request.md | 261 - .../batch-upsert-catalog-objects-response.md | 340 - doc/models/booking-booking-source.md | 18 - .../booking-creator-details-creator-type.md | 16 - 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 - doc/models/booking-status.md | 20 - doc/models/booking.md | 44 - doc/models/break-type.md | 38 - doc/models/break.md | 35 - doc/models/bulk-create-customer-data.md | 38 - doc/models/bulk-create-customers-request.md | 61 - doc/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 - doc/models/bulk-create-vendors-response.md | 80 - ...elete-booking-custom-attributes-request.md | 28 - ...lete-booking-custom-attributes-response.md | 39 - doc/models/bulk-delete-customers-request.md | 28 - doc/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 - doc/models/bulk-retrieve-bookings-request.md | 27 - doc/models/bulk-retrieve-bookings-response.md | 89 - doc/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 - doc/models/bulk-retrieve-vendors-request.md | 25 - doc/models/bulk-retrieve-vendors-response.md | 109 - doc/models/bulk-swap-plan-request.md | 28 - doc/models/bulk-swap-plan-response.md | 39 - doc/models/bulk-update-customer-data.md | 39 - doc/models/bulk-update-customers-request.md | 43 - doc/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 - doc/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 - doc/models/business-appointment-settings.md | 41 - ...business-booking-profile-booking-policy.md | 16 - ...ooking-profile-customer-timezone-choice.md | 16 - doc/models/business-booking-profile.md | 34 - doc/models/business-hours-period.md | 27 - 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 - doc/models/calculate-order-request.md | 98 - doc/models/calculate-order-response.md | 231 - doc/models/cancel-booking-request.md | 23 - doc/models/cancel-booking-response.md | 42 - doc/models/cancel-invoice-request.md | 23 - 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 - doc/models/cancel-payment-response.md | 98 - doc/models/cancel-subscription-response.md | 146 - doc/models/cancel-terminal-action-response.md | 57 - .../cancel-terminal-checkout-response.md | 79 - doc/models/cancel-terminal-refund-response.md | 69 - doc/models/capture-transaction-response.md | 31 - doc/models/card-brand.md | 28 - doc/models/card-co-brand.md | 17 - doc/models/card-payment-details.md | 48 - doc/models/card-payment-timeline.md | 27 - doc/models/card-prepaid-type.md | 17 - doc/models/card-type.md | 17 - doc/models/card.md | 44 - doc/models/cash-app-details.md | 27 - doc/models/cash-drawer-device.md | 23 - doc/models/cash-drawer-event-type.md | 25 - doc/models/cash-drawer-shift-event.md | 33 - doc/models/cash-drawer-shift-state.md | 17 - doc/models/cash-drawer-shift-summary.md | 41 - doc/models/cash-drawer-shift.md | 50 - doc/models/cash-payment-details.md | 32 - doc/models/catalog-availability-period.md | 27 - doc/models/catalog-category-type.md | 17 - 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 - doc/models/catalog-custom-attribute-value.md | 36 - .../catalog-discount-modify-tax-basis.md | 14 - doc/models/catalog-discount-type.md | 18 - doc/models/catalog-discount.md | 49 - doc/models/catalog-ecom-seo-data.md | 27 - doc/models/catalog-id-mapping.md | 35 - doc/models/catalog-image.md | 34 - doc/models/catalog-info-response-limits.md | 35 - 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 - doc/models/catalog-item-modifier-list-info.md | 43 - doc/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 - doc/models/catalog-item-option.md | 104 - doc/models/catalog-item-product-type.md | 23 - doc/models/catalog-item-variation.md | 56 - doc/models/catalog-item.md | 51 - doc/models/catalog-measurement-unit.md | 35 - .../catalog-modifier-list-modifier-type.md | 16 - .../catalog-modifier-list-selection-type.md | 16 - doc/models/catalog-modifier-list.md | 93 - doc/models/catalog-modifier-override.md | 25 - doc/models/catalog-modifier.md | 71 - doc/models/catalog-object-batch.md | 113 - doc/models/catalog-object-category.md | 27 - doc/models/catalog-object-reference.md | 27 - doc/models/catalog-object-type.md | 34 - doc/models/catalog-object.md | 153 - doc/models/catalog-pricing-rule.md | 42 - doc/models/catalog-pricing-type.md | 16 - doc/models/catalog-product-set.md | 41 - 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 - doc/models/catalog-query-prefix.md | 25 - doc/models/catalog-query-range.md | 27 - doc/models/catalog-query-set.md | 28 - doc/models/catalog-query-sorted-attribute.md | 27 - doc/models/catalog-query-text.md | 25 - doc/models/catalog-query.md | 82 - doc/models/catalog-quick-amount-type.md | 16 - doc/models/catalog-quick-amount.md | 32 - .../catalog-quick-amounts-settings-option.md | 17 - doc/models/catalog-quick-amounts-settings.md | 46 - doc/models/catalog-stock-conversion.md | 29 - .../catalog-subscription-plan-variation.md | 56 - doc/models/catalog-subscription-plan.md | 194 - doc/models/catalog-tax.md | 46 - doc/models/catalog-time-period.md | 23 - 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 - doc/models/change-timing.md | 16 - .../charge-request-additional-recipient.md | 31 - doc/models/charge-request.md | 73 - 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 - doc/models/checkout-options-payment-type.md | 20 - doc/models/checkout-options.md | 45 - doc/models/checkout.md | 37 - doc/models/clearpay-details.md | 23 - doc/models/clone-order-request.md | 28 - doc/models/clone-order-response.md | 333 - doc/models/collected-data.md | 21 - doc/models/complete-payment-request.md | 27 - doc/models/complete-payment-response.md | 107 - doc/models/component-component-type.md | 20 - doc/models/component.md | 54 - doc/models/confirmation-decision.md | 21 - doc/models/confirmation-options.md | 31 - doc/models/coordinates.md | 25 - doc/models/country.md | 265 - ...ing-custom-attribute-definition-request.md | 34 - ...ng-custom-attribute-definition-response.md | 38 - doc/models/create-booking-request.md | 29 - doc/models/create-booking-response.md | 42 - doc/models/create-break-type-request.md | 34 - doc/models/create-break-type-response.md | 55 - doc/models/create-card-request.md | 47 - doc/models/create-card-response.md | 72 - doc/models/create-catalog-image-request.md | 66 - doc/models/create-catalog-image-response.md | 70 - doc/models/create-checkout-request.md | 179 - doc/models/create-checkout-response.md | 172 - doc/models/create-customer-card-request.md | 39 - doc/models/create-customer-card-response.md | 56 - ...mer-custom-attribute-definition-request.md | 34 - ...er-custom-attribute-definition-response.md | 57 - doc/models/create-customer-group-request.md | 31 - doc/models/create-customer-group-response.md | 40 - doc/models/create-customer-request.md | 51 - 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 - 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 - doc/models/create-invoice-request.md | 83 - doc/models/create-invoice-response.md | 106 - doc/models/create-job-request.md | 31 - doc/models/create-job-response.md | 40 - ...ion-custom-attribute-definition-request.md | 34 - ...on-custom-attribute-definition-response.md | 45 - doc/models/create-location-request.md | 40 - doc/models/create-location-response.md | 74 - doc/models/create-loyalty-account-request.md | 35 - doc/models/create-loyalty-account-response.md | 46 - .../create-loyalty-promotion-request.md | 59 - .../create-loyalty-promotion-response.md | 75 - doc/models/create-loyalty-reward-request.md | 33 - doc/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 - doc/models/create-order-request.md | 121 - doc/models/create-order-response.md | 329 - doc/models/create-payment-link-request.md | 83 - doc/models/create-payment-link-response.md | 266 - doc/models/create-payment-request.md | 68 - doc/models/create-payment-response.md | 114 - doc/models/create-refund-request.md | 35 - doc/models/create-refund-response.md | 68 - doc/models/create-shift-request.md | 56 - doc/models/create-shift-response.md | 82 - doc/models/create-subscription-request.md | 53 - doc/models/create-subscription-response.md | 67 - doc/models/create-team-member-request.md | 63 - doc/models/create-team-member-response.md | 94 - doc/models/create-terminal-action-request.md | 34 - doc/models/create-terminal-action-response.md | 51 - .../create-terminal-checkout-request.md | 53 - .../create-terminal-checkout-response.md | 67 - doc/models/create-terminal-refund-request.md | 36 - doc/models/create-terminal-refund-response.md | 56 - doc/models/create-vendor-request.md | 37 - doc/models/create-vendor-response.md | 50 - .../create-webhook-subscription-request.md | 35 - .../create-webhook-subscription-response.md | 49 - doc/models/currency.md | 198 - .../custom-attribute-definition-visibility.md | 20 - doc/models/custom-attribute-definition.md | 38 - doc/models/custom-attribute-filter.md | 41 - doc/models/custom-attribute.md | 46 - doc/models/custom-field.md | 25 - doc/models/customer-address-filter.md | 29 - doc/models/customer-creation-source-filter.md | 32 - 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 - doc/models/customer-details.md | 25 - doc/models/customer-filter.md | 55 - doc/models/customer-group.md | 32 - doc/models/customer-inclusion-exclusion.md | 17 - doc/models/customer-preferences.md | 23 - doc/models/customer-query.md | 53 - doc/models/customer-segment.md | 32 - doc/models/customer-sort-field.md | 16 - doc/models/customer-sort.md | 26 - doc/models/customer-tax-ids.md | 24 - doc/models/customer-text-filter.md | 27 - doc/models/customer.md | 54 - .../data-collection-options-input-type.md | 16 - doc/models/data-collection-options.md | 29 - doc/models/date-range.md | 26 - 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 - doc/models/delete-catalog-object-response.md | 35 - doc/models/delete-customer-card-response.md | 37 - ...er-custom-attribute-definition-response.md | 36 - ...lete-customer-custom-attribute-response.md | 43 - doc/models/delete-customer-group-response.md | 43 - doc/models/delete-customer-request.md | 24 - doc/models/delete-customer-response.md | 31 - .../delete-dispute-evidence-response.md | 42 - .../delete-invoice-attachment-response.md | 36 - doc/models/delete-invoice-request.md | 23 - doc/models/delete-invoice-response.md | 36 - ...on-custom-attribute-definition-response.md | 42 - ...lete-location-custom-attribute-response.md | 37 - doc/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 - doc/models/delete-payment-link-response.md | 32 - doc/models/delete-shift-response.md | 31 - 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 - doc/models/destination-details.md | 50 - doc/models/destination-type.md | 18 - doc/models/destination.md | 25 - doc/models/device-attributes-device-type.md | 15 - doc/models/device-attributes.md | 34 - doc/models/device-checkout-options.md | 37 - doc/models/device-code-status.md | 18 - 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 - doc/models/device-details.md | 27 - doc/models/device-metadata.md | 36 - doc/models/device-status-category.md | 15 - doc/models/device-status.md | 21 - doc/models/device.md | 125 - doc/models/digital-wallet-details.md | 31 - doc/models/disable-card-response.md | 66 - 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 - doc/models/dispute-evidence-file.md | 25 - doc/models/dispute-evidence-type.md | 29 - doc/models/dispute-evidence.md | 34 - doc/models/dispute-reason.md | 24 - doc/models/dispute-state.md | 22 - doc/models/dispute.md | 45 - doc/models/disputed-payment.md | 23 - doc/models/ecom-visibility.md | 18 - doc/models/employee-status.md | 18 - doc/models/employee-wage.md | 32 - doc/models/employee.md | 38 - doc/models/enable-events-response.md | 34 - doc/models/error-category.md | 23 - doc/models/error-code.md | 165 - doc/models/error.md | 31 - doc/models/event-data.md | 30 - doc/models/event-metadata.md | 25 - doc/models/event-type-metadata.md | 27 - doc/models/event.md | 30 - doc/models/exclude-strategy.md | 17 - doc/models/external-payment-details.md | 34 - doc/models/filter-value.md | 42 - doc/models/float-number-range.md | 25 - ...fillment-delivery-details-schedule-type.md | 16 - doc/models/fulfillment-delivery-details.md | 61 - doc/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 - doc/models/fulfillment-recipient.md | 37 - doc/models/fulfillment-shipment-details.md | 53 - doc/models/fulfillment-state.md | 20 - doc/models/fulfillment-type.md | 17 - doc/models/fulfillment.md | 48 - .../get-bank-account-by-v1-id-response.md | 62 - doc/models/get-bank-account-response.md | 50 - doc/models/get-break-type-response.md | 49 - doc/models/get-device-code-response.md | 41 - doc/models/get-device-response.md | 191 - doc/models/get-employee-wage-response.md | 54 - doc/models/get-invoice-response.md | 106 - doc/models/get-payment-refund-response.md | 100 - doc/models/get-payment-response.md | 101 - doc/models/get-payout-response.md | 54 - doc/models/get-shift-response.md | 82 - doc/models/get-team-member-wage-response.md | 44 - doc/models/get-terminal-action-response.md | 51 - doc/models/get-terminal-checkout-response.md | 66 - doc/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 - doc/models/gift-card-activity-block-reason.md | 15 - 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 - doc/models/gift-card-activity-deactivate.md | 23 - .../gift-card-activity-import-reversal.md | 26 - doc/models/gift-card-activity-import.md | 28 - 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 - 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 - doc/models/gift-card-activity.md | 55 - doc/models/gift-card-gan-source.md | 17 - doc/models/gift-card-status.md | 18 - doc/models/gift-card-type.md | 16 - doc/models/gift-card.md | 38 - doc/models/inventory-adjustment-group.md | 27 - doc/models/inventory-adjustment.md | 46 - doc/models/inventory-alert-type.md | 16 - doc/models/inventory-change-type.md | 17 - doc/models/inventory-change.md | 64 - doc/models/inventory-count.md | 35 - doc/models/inventory-physical-count.md | 41 - doc/models/inventory-state.md | 30 - doc/models/inventory-transfer.md | 40 - .../invoice-accepted-payment-methods.md | 31 - doc/models/invoice-attachment.md | 33 - .../invoice-automatic-payment-source.md | 17 - doc/models/invoice-custom-field-placement.md | 17 - doc/models/invoice-custom-field.md | 31 - doc/models/invoice-delivery-method.md | 17 - doc/models/invoice-filter.md | 32 - doc/models/invoice-payment-reminder-status.md | 17 - doc/models/invoice-payment-reminder.md | 33 - doc/models/invoice-payment-request.md | 47 - doc/models/invoice-query.md | 36 - doc/models/invoice-recipient-tax-ids.md | 25 - doc/models/invoice-recipient.md | 45 - doc/models/invoice-request-method.md | 24 - doc/models/invoice-request-type.md | 18 - doc/models/invoice-sort-field.md | 15 - doc/models/invoice-sort.md | 25 - doc/models/invoice-status.md | 24 - doc/models/invoice.md | 63 - .../item-variation-location-overrides.md | 37 - doc/models/job-assignment-pay-type.md | 17 - doc/models/job-assignment.md | 40 - 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 - doc/models/list-bookings-request.md | 31 - doc/models/list-bookings-response.md | 52 - doc/models/list-break-types-request.md | 27 - doc/models/list-break-types-response.md | 63 - doc/models/list-cards-request.md | 32 - doc/models/list-cards-response.md | 64 - .../list-cash-drawer-shift-events-request.md | 25 - .../list-cash-drawer-shift-events-response.md | 99 - doc/models/list-cash-drawer-shifts-request.md | 31 - .../list-cash-drawer-shifts-response.md | 59 - doc/models/list-catalog-request.md | 25 - 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 - doc/models/list-customer-groups-request.md | 26 - doc/models/list-customer-groups-response.md | 62 - doc/models/list-customer-segments-request.md | 25 - doc/models/list-customer-segments-response.md | 73 - doc/models/list-customers-request.md | 32 - doc/models/list-customers-response.md | 98 - doc/models/list-device-codes-request.md | 31 - doc/models/list-device-codes-response.md | 69 - doc/models/list-devices-request.md | 27 - doc/models/list-devices-response.md | 368 - doc/models/list-dispute-evidence-request.md | 23 - doc/models/list-dispute-evidence-response.md | 45 - doc/models/list-disputes-request.md | 31 - doc/models/list-disputes-response.md | 77 - doc/models/list-employee-wages-request.md | 27 - doc/models/list-employee-wages-response.md | 72 - doc/models/list-employees-request.md | 27 - doc/models/list-employees-response.md | 52 - 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 - doc/models/list-gift-cards-request.md | 32 - doc/models/list-gift-cards-response.md | 72 - doc/models/list-invoices-request.md | 27 - doc/models/list-invoices-response.md | 196 - doc/models/list-jobs-request.md | 23 - 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 - doc/models/list-locations-response.md | 99 - doc/models/list-loyalty-programs-response.md | 110 - doc/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 - doc/models/list-merchants-request.md | 23 - 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 - doc/models/list-payment-refunds-request.md | 40 - doc/models/list-payment-refunds-response.md | 97 - doc/models/list-payments-request.md | 44 - doc/models/list-payments-response.md | 105 - doc/models/list-payout-entries-request.md | 25 - doc/models/list-payout-entries-response.md | 84 - doc/models/list-payouts-request.md | 33 - doc/models/list-payouts-response.md | 97 - doc/models/list-refunds-request.md | 32 - doc/models/list-refunds-response.md | 66 - 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 - doc/models/list-team-member-wages-request.md | 27 - doc/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 - doc/models/list-workweek-configs-request.md | 25 - doc/models/list-workweek-configs-response.md | 45 - doc/models/location-booking-profile.md | 27 - doc/models/location-capability.md | 17 - doc/models/location-status.md | 16 - doc/models/location-type.md | 16 - doc/models/location.md | 61 - ...loyalty-account-expiring-point-deadline.md | 25 - doc/models/loyalty-account-mapping-type.md | 15 - doc/models/loyalty-account-mapping.md | 30 - doc/models/loyalty-account.md | 38 - doc/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 - doc/models/loyalty-event-date-time-filter.md | 26 - doc/models/loyalty-event-delete-reward.md | 27 - doc/models/loyalty-event-expire-points.md | 25 - doc/models/loyalty-event-filter.md | 53 - doc/models/loyalty-event-location-filter.md | 27 - .../loyalty-event-loyalty-account-filter.md | 23 - doc/models/loyalty-event-order-filter.md | 23 - doc/models/loyalty-event-other.md | 25 - doc/models/loyalty-event-query.md | 50 - doc/models/loyalty-event-redeem-reward.md | 27 - doc/models/loyalty-event-source.md | 16 - doc/models/loyalty-event-type-filter.md | 27 - doc/models/loyalty-event-type.md | 22 - 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 - doc/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 - doc/models/loyalty-program-status.md | 16 - doc/models/loyalty-program-terminology.md | 25 - 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 - doc/models/loyalty-promotion-status.md | 18 - ...oyalty-promotion-trigger-limit-interval.md | 17 - doc/models/loyalty-promotion-trigger-limit.md | 29 - doc/models/loyalty-promotion.md | 63 - doc/models/loyalty-reward-status.md | 17 - doc/models/loyalty-reward.md | 38 - doc/models/measurement-unit-area.md | 22 - doc/models/measurement-unit-custom.md | 25 - doc/models/measurement-unit-generic.md | 13 - doc/models/measurement-unit-length.md | 22 - doc/models/measurement-unit-time.md | 19 - doc/models/measurement-unit-unit-type.md | 20 - doc/models/measurement-unit-volume.md | 25 - doc/models/measurement-unit-weight.md | 20 - doc/models/measurement-unit.md | 39 - doc/models/merchant-status.md | 14 - doc/models/merchant.md | 35 - doc/models/modifier-location-overrides.md | 30 - doc/models/money.md | 30 - doc/models/obtain-token-request.md | 36 - doc/models/obtain-token-response.md | 36 - doc/models/offline-payment-details.md | 23 - doc/models/order-created-object.md | 27 - doc/models/order-created.md | 29 - 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 - doc/models/order-fulfillment-state.md | 20 - 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 - 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 - doc/models/order-line-item-discount-scope.md | 17 - doc/models/order-line-item-discount-type.md | 19 - doc/models/order-line-item-discount.md | 43 - doc/models/order-line-item-item-type.md | 17 - 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 - doc/models/order-line-item-tax-type.md | 17 - doc/models/order-line-item-tax.md | 40 - doc/models/order-line-item.md | 64 - doc/models/order-money-amounts.md | 46 - doc/models/order-pricing-options.md | 27 - doc/models/order-quantity-unit.md | 39 - doc/models/order-return-discount.md | 41 - doc/models/order-return-line-item-modifier.md | 34 - doc/models/order-return-line-item.md | 62 - doc/models/order-return-service-charge.md | 41 - doc/models/order-return-tax.md | 39 - doc/models/order-return-tip.md | 32 - doc/models/order-return.md | 95 - 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 - doc/models/order-service-charge.md | 42 - doc/models/order-source.md | 23 - doc/models/order-state.md | 18 - doc/models/order-updated-object.md | 27 - doc/models/order-updated.md | 30 - doc/models/order.md | 88 - doc/models/pagination-cursor.md | 24 - doc/models/pause-subscription-request.md | 32 - doc/models/pause-subscription-response.md | 84 - doc/models/pay-order-request.md | 31 - 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 - doc/models/payment-link-related-resources.md | 223 - doc/models/payment-link.md | 59 - doc/models/payment-options-delay-action.md | 17 - doc/models/payment-options.md | 27 - doc/models/payment-refund.md | 75 - doc/models/payment-sort-field.md | 15 - doc/models/payment.md | 76 - doc/models/payout-entry.md | 70 - doc/models/payout-fee-type.md | 16 - doc/models/payout-fee.md | 30 - doc/models/payout-status.md | 17 - doc/models/payout-type.md | 19 - doc/models/payout.md | 47 - doc/models/phase-input.md | 25 - doc/models/phase.md | 29 - doc/models/pre-populated-data.md | 35 - doc/models/processing-fee.md | 30 - doc/models/product-type.md | 13 - doc/models/product.md | 24 - doc/models/publish-invoice-request.md | 25 - doc/models/publish-invoice-response.md | 107 - doc/models/qr-code-options.md | 27 - doc/models/quantity-ratio.md | 25 - doc/models/quick-pay.md | 32 - doc/models/range.md | 25 - doc/models/receipt-options.md | 27 - doc/models/redeem-loyalty-reward-request.md | 25 - doc/models/redeem-loyalty-reward-response.md | 70 - doc/models/refund-payment-request.md | 48 - doc/models/refund-payment-response.md | 89 - doc/models/refund-status.md | 18 - doc/models/refund.md | 75 - doc/models/register-domain-request.md | 24 - doc/models/register-domain-response-status.md | 16 - doc/models/register-domain-response.md | 47 - .../remove-group-from-customer-response.md | 38 - doc/models/resume-subscription-request.md | 26 - doc/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 - doc/models/retrieve-card-response.md | 66 - .../retrieve-cash-drawer-shift-request.md | 21 - .../retrieve-cash-drawer-shift-response.md | 77 - doc/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 - 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 - doc/models/retrieve-order-response.md | 231 - doc/models/retrieve-payment-link-response.md | 69 - doc/models/retrieve-snippet-response.md | 38 - doc/models/retrieve-subscription-request.md | 24 - doc/models/retrieve-subscription-response.md | 62 - ...ve-team-member-booking-profile-response.md | 29 - doc/models/retrieve-team-member-response.md | 82 - doc/models/retrieve-token-status-response.md | 48 - doc/models/retrieve-transaction-response.md | 190 - doc/models/retrieve-vendor-response.md | 44 - doc/models/retrieve-wage-setting-response.md | 66 - .../retrieve-webhook-subscription-response.md | 49 - doc/models/revoke-token-request.md | 27 - doc/models/revoke-token-response.md | 30 - doc/models/risk-evaluation-risk-level.md | 16 - doc/models/risk-evaluation.md | 30 - 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 - doc/models/search-availability-response.md | 276 - ...earch-catalog-items-request-stock-level.md | 16 - doc/models/search-catalog-items-request.md | 69 - doc/models/search-catalog-items-response.md | 89 - doc/models/search-catalog-objects-request.md | 41 - doc/models/search-catalog-objects-response.md | 231 - doc/models/search-customers-request.md | 64 - doc/models/search-customers-response.md | 131 - doc/models/search-events-filter.md | 43 - doc/models/search-events-query.md | 44 - doc/models/search-events-request.md | 49 - doc/models/search-events-response.md | 85 - doc/models/search-events-sort-field.md | 15 - doc/models/search-events-sort.md | 25 - doc/models/search-invoices-request.md | 41 - doc/models/search-invoices-response.md | 191 - ...-accounts-request-loyalty-account-query.md | 45 - doc/models/search-loyalty-accounts-request.md | 40 - .../search-loyalty-accounts-response.md | 56 - doc/models/search-loyalty-events-request.md | 56 - doc/models/search-loyalty-events-response.md | 146 - ...ty-rewards-request-loyalty-reward-query.md | 25 - doc/models/search-loyalty-rewards-request.md | 30 - doc/models/search-loyalty-rewards-response.md | 89 - doc/models/search-orders-customer-filter.md | 29 - doc/models/search-orders-date-time-filter.md | 49 - doc/models/search-orders-filter.md | 67 - .../search-orders-fulfillment-filter.md | 30 - doc/models/search-orders-query.md | 69 - doc/models/search-orders-request.md | 78 - doc/models/search-orders-response.md | 225 - doc/models/search-orders-sort-field.md | 17 - doc/models/search-orders-sort.md | 26 - doc/models/search-orders-source-filter.md | 27 - doc/models/search-orders-state-filter.md | 27 - doc/models/search-shifts-request.md | 57 - doc/models/search-shifts-response.md | 120 - doc/models/search-subscriptions-filter.md | 39 - doc/models/search-subscriptions-query.md | 34 - doc/models/search-subscriptions-request.md | 44 - doc/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 - doc/models/search-team-members-response.md | 284 - doc/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 - doc/models/search-terminal-refunds-request.md | 37 - .../search-terminal-refunds-response.md | 72 - doc/models/search-vendors-request-filter.md | 33 - .../search-vendors-request-sort-field.md | 16 - doc/models/search-vendors-request-sort.md | 25 - doc/models/search-vendors-request.md | 55 - doc/models/search-vendors-response.md | 61 - doc/models/segment-filter.md | 40 - doc/models/select-option.md | 23 - doc/models/select-options.md | 35 - doc/models/shift-filter-status.md | 16 - doc/models/shift-filter.md | 48 - doc/models/shift-query.md | 44 - doc/models/shift-sort-field.md | 18 - doc/models/shift-sort.md | 25 - doc/models/shift-status.md | 16 - doc/models/shift-wage.md | 32 - doc/models/shift-workday-matcher.md | 17 - doc/models/shift-workday.md | 31 - doc/models/shift.md | 52 - doc/models/shipping-fee.md | 26 - doc/models/signature-image.md | 23 - doc/models/signature-options.md | 38 - doc/models/site.md | 32 - doc/models/snippet-response.md | 42 - doc/models/snippet.md | 31 - doc/models/sort-order.md | 16 - doc/models/source-application.md | 27 - doc/models/square-account-details.md | 38 - doc/models/standard-unit-description-group.md | 68 - doc/models/standard-unit-description.md | 36 - doc/models/submit-evidence-response.md | 64 - doc/models/subscription-action-type.md | 19 - doc/models/subscription-action.md | 45 - doc/models/subscription-cadence.md | 27 - doc/models/subscription-event-info-code.md | 20 - doc/models/subscription-event-info.md | 25 - ...scription-event-subscription-event-type.md | 21 - doc/models/subscription-event.md | 51 - doc/models/subscription-phase.md | 46 - doc/models/subscription-pricing-type.md | 16 - doc/models/subscription-pricing.md | 33 - doc/models/subscription-source.md | 23 - doc/models/subscription-status.md | 19 - doc/models/subscription-test-result.md | 32 - doc/models/subscription.md | 48 - doc/models/swap-plan-request.md | 31 - doc/models/swap-plan-response.md | 88 - doc/models/tax-calculation-phase.md | 16 - doc/models/tax-ids.md | 31 - doc/models/tax-inclusion-type.md | 16 - ...mber-assigned-locations-assignment-type.md | 16 - doc/models/team-member-assigned-locations.md | 28 - doc/models/team-member-booking-profile.md | 31 - doc/models/team-member-invitation-status.md | 17 - doc/models/team-member-status.md | 16 - doc/models/team-member-wage.md | 36 - 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 - doc/models/tender-card-details.md | 33 - doc/models/tender-cash-details.md | 31 - .../tender-square-account-details-status.md | 16 - doc/models/tender-square-account-details.md | 23 - doc/models/tender-type.md | 24 - doc/models/tender.md | 44 - doc/models/terminal-action-action-type.md | 22 - doc/models/terminal-action-query-filter.md | 30 - doc/models/terminal-action-query-sort.md | 21 - doc/models/terminal-action-query.md | 42 - doc/models/terminal-action.md | 46 - doc/models/terminal-checkout-query-filter.md | 28 - doc/models/terminal-checkout-query-sort.md | 21 - doc/models/terminal-checkout-query.md | 32 - doc/models/terminal-checkout.md | 71 - doc/models/terminal-refund-query-filter.md | 28 - doc/models/terminal-refund-query-sort.md | 21 - doc/models/terminal-refund-query.md | 32 - doc/models/terminal-refund.md | 47 - .../test-webhook-subscription-request.md | 23 - .../test-webhook-subscription-response.md | 48 - doc/models/time-range.md | 29 - doc/models/tip-settings.md | 33 - doc/models/transaction-product.md | 22 - doc/models/transaction-type.md | 16 - 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 - doc/models/update-booking-request.md | 29 - doc/models/update-booking-response.md | 50 - doc/models/update-break-type-request.md | 32 - doc/models/update-break-type-response.md | 43 - doc/models/update-catalog-image-request.md | 29 - doc/models/update-catalog-image-response.md | 77 - ...mer-custom-attribute-definition-request.md | 34 - ...er-custom-attribute-definition-response.md | 57 - doc/models/update-customer-group-request.md | 29 - doc/models/update-customer-group-response.md | 52 - doc/models/update-customer-request.md | 42 - doc/models/update-customer-response.md | 73 - doc/models/update-invoice-request.md | 56 - 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 - doc/models/update-job-request.md | 29 - doc/models/update-job-response.md | 52 - ...ion-custom-attribute-definition-request.md | 34 - ...on-custom-attribute-definition-response.md | 57 - doc/models/update-location-request.md | 57 - 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 - doc/models/update-order-request.md | 64 - doc/models/update-order-response.md | 187 - doc/models/update-payment-link-request.md | 52 - doc/models/update-payment-link-response.md | 78 - doc/models/update-payment-request.md | 39 - doc/models/update-payment-response.md | 111 - doc/models/update-shift-request.md | 56 - doc/models/update-shift-response.md | 82 - doc/models/update-subscription-request.md | 32 - doc/models/update-subscription-response.md | 58 - doc/models/update-team-member-request.md | 61 - doc/models/update-team-member-response.md | 82 - doc/models/update-vendor-request.md | 39 - doc/models/update-vendor-response.md | 71 - doc/models/update-wage-setting-request.md | 58 - doc/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 - doc/models/update-workweek-config-request.md | 30 - doc/models/update-workweek-config-response.md | 53 - ...upsert-booking-custom-attribute-request.md | 43 - ...psert-booking-custom-attribute-response.md | 63 - doc/models/upsert-catalog-object-request.md | 80 - doc/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 - doc/models/upsert-snippet-request.md | 29 - doc/models/upsert-snippet-response.md | 44 - doc/models/v1-device.md | 23 - doc/models/v1-list-orders-request.md | 25 - doc/models/v1-list-orders-response.md | 50 - doc/models/v1-money.md | 23 - doc/models/v1-order-history-entry-action.md | 19 - doc/models/v1-order-history-entry.md | 25 - doc/models/v1-order-state.md | 18 - doc/models/v1-order.md | 64 - doc/models/v1-phone-number.md | 25 - doc/models/v1-tender-card-brand.md | 23 - doc/models/v1-tender-entry-method.md | 19 - doc/models/v1-tender-type.md | 20 - doc/models/v1-tender.md | 63 - doc/models/v1-update-order-request-action.md | 15 - doc/models/v1-update-order-request.md | 31 - doc/models/vendor-contact.md | 33 - doc/models/vendor-status.md | 17 - doc/models/vendor.md | 42 - doc/models/visibility-filter.md | 17 - doc/models/void-transaction-response.md | 43 - doc/models/wage-setting.md | 76 - doc/models/webhook-subscription.md | 38 - doc/models/weekday.md | 21 - doc/models/workweek-config.md | 34 - doc/utility-classes.md | 35 - examples/customers.rb | 48 - lib/square.rb | 3 +- lib/square/client.rb | 1 + .../types/catalog_item_modifier_list_info.rb | 6 +- lib/square/types/catalog_modifier_override.rb | 4 +- lib/square/types/catalog_object.rb | 40 + .../catalog_object_availability_period.rb | 11 - lib/square/types/catalog_object_base.rb | 1 - lib/square/types/catalog_object_category.rb | 7 - ...alog_object_custom_attribute_definition.rb | 11 - lib/square/types/catalog_object_discount.rb | 11 - lib/square/types/catalog_object_image.rb | 11 - lib/square/types/catalog_object_item.rb | 17 - .../types/catalog_object_item_option.rb | 17 - .../types/catalog_object_item_option_value.rb | 11 - .../types/catalog_object_item_variation.rb | 11 - .../types/catalog_object_measurement_unit.rb | 11 - lib/square/types/catalog_object_modifier.rb | 11 - .../types/catalog_object_modifier_list.rb | 17 - .../types/catalog_object_pricing_rule.rb | 11 - .../types/catalog_object_product_set.rb | 11 - .../catalog_object_quick_amounts_settings.rb | 11 - .../types/catalog_object_subscription_plan.rb | 17 - ...alog_object_subscription_plan_variation.rb | 11 - lib/square/types/catalog_object_tax.rb | 11 - .../types/catalog_object_time_period.rb | 11 - lib/square/types/custom_attribute.rb | 2 +- .../types/custom_attribute_definition.rb | 2 +- lib/square/types/event_data.rb | 2 +- spec/user_journey_spec.rb | 145 - 1289 files changed, 141377 insertions(+), 68768 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/labeler.yml delete mode 100644 .github/pull_request_template.md delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/ruby.yml create mode 100644 .mock/definition/__package__.yml create mode 100644 .mock/definition/api.yml create mode 100644 .mock/definition/applePay.yml create mode 100644 .mock/definition/bankAccounts.yml create mode 100644 .mock/definition/bookings.yml create mode 100644 .mock/definition/bookings/customAttributeDefinitions.yml create mode 100644 .mock/definition/bookings/customAttributes.yml create mode 100644 .mock/definition/bookings/locationProfiles.yml create mode 100644 .mock/definition/bookings/teamMemberProfiles.yml create mode 100644 .mock/definition/cards.yml create mode 100644 .mock/definition/cashDrawers/shifts.yml create mode 100644 .mock/definition/catalog.yml create mode 100644 .mock/definition/catalog/images.yml create mode 100644 .mock/definition/catalog/object.yml create mode 100644 .mock/definition/checkout.yml create mode 100644 .mock/definition/checkout/paymentLinks.yml create mode 100644 .mock/definition/customers.yml create mode 100644 .mock/definition/customers/cards.yml create mode 100644 .mock/definition/customers/customAttributeDefinitions.yml create mode 100644 .mock/definition/customers/customAttributes.yml create mode 100644 .mock/definition/customers/groups.yml create mode 100644 .mock/definition/customers/segments.yml create mode 100644 .mock/definition/devices.yml create mode 100644 .mock/definition/devices/codes.yml create mode 100644 .mock/definition/disputes.yml create mode 100644 .mock/definition/disputes/evidence.yml create mode 100644 .mock/definition/employees.yml create mode 100644 .mock/definition/events.yml create mode 100644 .mock/definition/giftCards.yml create mode 100644 .mock/definition/giftCards/activities.yml create mode 100644 .mock/definition/inventory.yml create mode 100644 .mock/definition/invoices.yml create mode 100644 .mock/definition/labor.yml create mode 100644 .mock/definition/labor/breakTypes.yml create mode 100644 .mock/definition/labor/employeeWages.yml create mode 100644 .mock/definition/labor/shifts.yml create mode 100644 .mock/definition/labor/teamMemberWages.yml create mode 100644 .mock/definition/labor/workweekConfigs.yml create mode 100644 .mock/definition/locations.yml create mode 100644 .mock/definition/locations/customAttributeDefinitions.yml create mode 100644 .mock/definition/locations/customAttributes.yml create mode 100644 .mock/definition/locations/transactions.yml create mode 100644 .mock/definition/loyalty.yml create mode 100644 .mock/definition/loyalty/accounts.yml create mode 100644 .mock/definition/loyalty/programs.yml create mode 100644 .mock/definition/loyalty/programs/promotions.yml create mode 100644 .mock/definition/loyalty/rewards.yml create mode 100644 .mock/definition/merchants.yml create mode 100644 .mock/definition/merchants/customAttributeDefinitions.yml create mode 100644 .mock/definition/merchants/customAttributes.yml create mode 100644 .mock/definition/mobile.yml create mode 100644 .mock/definition/oAuth.yml create mode 100644 .mock/definition/orders.yml create mode 100644 .mock/definition/orders/customAttributeDefinitions.yml create mode 100644 .mock/definition/orders/customAttributes.yml create mode 100644 .mock/definition/payments.yml create mode 100644 .mock/definition/payouts.yml create mode 100644 .mock/definition/refunds.yml create mode 100644 .mock/definition/sites.yml create mode 100644 .mock/definition/snippets.yml create mode 100644 .mock/definition/subscriptions.yml create mode 100644 .mock/definition/team.yml create mode 100644 .mock/definition/teamMembers.yml create mode 100644 .mock/definition/teamMembers/wageSetting.yml create mode 100644 .mock/definition/terminal.yml create mode 100644 .mock/definition/terminal/actions.yml create mode 100644 .mock/definition/terminal/checkouts.yml create mode 100644 .mock/definition/terminal/refunds.yml create mode 100644 .mock/definition/v1Transactions.yml create mode 100644 .mock/definition/vendors.yml create mode 100644 .mock/definition/webhooks/eventTypes.yml create mode 100644 .mock/definition/webhooks/subscriptions.yml create mode 100644 .mock/fern.config.json create mode 100644 .mock/openapi/openapi.json delete mode 100644 CHANGELOG.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Jenkinsfile delete mode 100644 README.md delete mode 100644 doc/api/apple-pay.md delete mode 100644 doc/api/bank-accounts.md delete mode 100644 doc/api/booking-custom-attributes.md delete mode 100644 doc/api/bookings.md delete mode 100644 doc/api/cards.md delete mode 100644 doc/api/cash-drawers.md delete mode 100644 doc/api/catalog.md delete mode 100644 doc/api/checkout.md delete mode 100644 doc/api/customer-custom-attributes.md delete mode 100644 doc/api/customer-groups.md delete mode 100644 doc/api/customer-segments.md delete mode 100644 doc/api/customers.md delete mode 100644 doc/api/devices.md delete mode 100644 doc/api/disputes.md delete mode 100644 doc/api/employees.md delete mode 100644 doc/api/events.md delete mode 100644 doc/api/gift-card-activities.md delete mode 100644 doc/api/gift-cards.md delete mode 100644 doc/api/inventory.md delete mode 100644 doc/api/invoices.md delete mode 100644 doc/api/labor.md delete mode 100644 doc/api/location-custom-attributes.md delete mode 100644 doc/api/locations.md delete mode 100644 doc/api/loyalty.md delete mode 100644 doc/api/merchant-custom-attributes.md delete mode 100644 doc/api/merchants.md delete mode 100644 doc/api/mobile-authorization.md delete mode 100644 doc/api/o-auth.md delete mode 100644 doc/api/order-custom-attributes.md delete mode 100644 doc/api/orders.md delete mode 100644 doc/api/payments.md delete mode 100644 doc/api/payouts.md delete mode 100644 doc/api/refunds.md delete mode 100644 doc/api/sites.md delete mode 100644 doc/api/snippets.md delete mode 100644 doc/api/subscriptions.md delete mode 100644 doc/api/team.md delete mode 100644 doc/api/terminal.md delete mode 100644 doc/api/transactions.md delete mode 100644 doc/api/v1-transactions.md delete mode 100644 doc/api/vendors.md delete mode 100644 doc/api/webhook-subscriptions.md delete mode 100644 doc/auth/oauth-2-bearer-token.md delete mode 100644 doc/client.md delete mode 100644 doc/http-request.md delete mode 100644 doc/http-response.md delete mode 100644 doc/models/accept-dispute-response.md delete mode 100644 doc/models/accepted-payment-methods.md delete mode 100644 doc/models/accumulate-loyalty-points-request.md delete mode 100644 doc/models/accumulate-loyalty-points-response.md delete mode 100644 doc/models/ach-details.md delete mode 100644 doc/models/action-cancel-reason.md delete mode 100644 doc/models/activity-type.md delete mode 100644 doc/models/add-group-to-customer-response.md delete mode 100644 doc/models/additional-recipient.md delete mode 100644 doc/models/address.md delete mode 100644 doc/models/adjust-loyalty-points-request.md delete mode 100644 doc/models/adjust-loyalty-points-response.md delete mode 100644 doc/models/afterpay-details.md delete mode 100644 doc/models/application-details-external-square-product.md delete mode 100644 doc/models/application-details.md delete mode 100644 doc/models/application-type.md delete mode 100644 doc/models/appointment-segment.md delete mode 100644 doc/models/archived-state.md delete mode 100644 doc/models/availability.md delete mode 100644 doc/models/bank-account-payment-details.md delete mode 100644 doc/models/bank-account-status.md delete mode 100644 doc/models/bank-account-type.md delete mode 100644 doc/models/bank-account.md delete mode 100644 doc/models/batch-change-inventory-request.md delete mode 100644 doc/models/batch-change-inventory-response.md delete mode 100644 doc/models/batch-delete-catalog-objects-request.md delete mode 100644 doc/models/batch-delete-catalog-objects-response.md delete mode 100644 doc/models/batch-retrieve-catalog-objects-request.md delete mode 100644 doc/models/batch-retrieve-catalog-objects-response.md delete mode 100644 doc/models/batch-retrieve-inventory-changes-request.md delete mode 100644 doc/models/batch-retrieve-inventory-changes-response.md delete mode 100644 doc/models/batch-retrieve-inventory-counts-request.md delete mode 100644 doc/models/batch-retrieve-inventory-counts-response.md delete mode 100644 doc/models/batch-retrieve-orders-request.md delete mode 100644 doc/models/batch-retrieve-orders-response.md delete mode 100644 doc/models/batch-upsert-catalog-objects-request.md delete mode 100644 doc/models/batch-upsert-catalog-objects-response.md delete mode 100644 doc/models/booking-booking-source.md delete mode 100644 doc/models/booking-creator-details-creator-type.md delete mode 100644 doc/models/booking-creator-details.md delete mode 100644 doc/models/booking-custom-attribute-delete-request.md delete mode 100644 doc/models/booking-custom-attribute-delete-response.md delete mode 100644 doc/models/booking-custom-attribute-upsert-request.md delete mode 100644 doc/models/booking-custom-attribute-upsert-response.md delete mode 100644 doc/models/booking-status.md delete mode 100644 doc/models/booking.md delete mode 100644 doc/models/break-type.md delete mode 100644 doc/models/break.md delete mode 100644 doc/models/bulk-create-customer-data.md delete mode 100644 doc/models/bulk-create-customers-request.md delete mode 100644 doc/models/bulk-create-customers-response.md delete mode 100644 doc/models/bulk-create-team-members-request.md delete mode 100644 doc/models/bulk-create-team-members-response.md delete mode 100644 doc/models/bulk-create-vendors-request.md delete mode 100644 doc/models/bulk-create-vendors-response.md delete mode 100644 doc/models/bulk-delete-booking-custom-attributes-request.md delete mode 100644 doc/models/bulk-delete-booking-custom-attributes-response.md delete mode 100644 doc/models/bulk-delete-customers-request.md delete mode 100644 doc/models/bulk-delete-customers-response.md delete mode 100644 doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md delete mode 100644 doc/models/bulk-delete-location-custom-attributes-request.md delete mode 100644 doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md delete mode 100644 doc/models/bulk-delete-location-custom-attributes-response.md delete mode 100644 doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md delete mode 100644 doc/models/bulk-delete-merchant-custom-attributes-request.md delete mode 100644 doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md delete mode 100644 doc/models/bulk-delete-merchant-custom-attributes-response.md delete mode 100644 doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md delete mode 100644 doc/models/bulk-delete-order-custom-attributes-request.md delete mode 100644 doc/models/bulk-delete-order-custom-attributes-response.md delete mode 100644 doc/models/bulk-retrieve-bookings-request.md delete mode 100644 doc/models/bulk-retrieve-bookings-response.md delete mode 100644 doc/models/bulk-retrieve-customers-request.md delete mode 100644 doc/models/bulk-retrieve-customers-response.md delete mode 100644 doc/models/bulk-retrieve-team-member-booking-profiles-request.md delete mode 100644 doc/models/bulk-retrieve-team-member-booking-profiles-response.md delete mode 100644 doc/models/bulk-retrieve-vendors-request.md delete mode 100644 doc/models/bulk-retrieve-vendors-response.md delete mode 100644 doc/models/bulk-swap-plan-request.md delete mode 100644 doc/models/bulk-swap-plan-response.md delete mode 100644 doc/models/bulk-update-customer-data.md delete mode 100644 doc/models/bulk-update-customers-request.md delete mode 100644 doc/models/bulk-update-customers-response.md delete mode 100644 doc/models/bulk-update-team-members-request.md delete mode 100644 doc/models/bulk-update-team-members-response.md delete mode 100644 doc/models/bulk-update-vendors-request.md delete mode 100644 doc/models/bulk-update-vendors-response.md delete mode 100644 doc/models/bulk-upsert-booking-custom-attributes-request.md delete mode 100644 doc/models/bulk-upsert-booking-custom-attributes-response.md delete mode 100644 doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md delete mode 100644 doc/models/bulk-upsert-customer-custom-attributes-request.md delete mode 100644 doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md delete mode 100644 doc/models/bulk-upsert-customer-custom-attributes-response.md delete mode 100644 doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md delete mode 100644 doc/models/bulk-upsert-location-custom-attributes-request.md delete mode 100644 doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md delete mode 100644 doc/models/bulk-upsert-location-custom-attributes-response.md delete mode 100644 doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md delete mode 100644 doc/models/bulk-upsert-merchant-custom-attributes-request.md delete mode 100644 doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md delete mode 100644 doc/models/bulk-upsert-merchant-custom-attributes-response.md delete mode 100644 doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md delete mode 100644 doc/models/bulk-upsert-order-custom-attributes-request.md delete mode 100644 doc/models/bulk-upsert-order-custom-attributes-response.md delete mode 100644 doc/models/business-appointment-settings-alignment-time.md delete mode 100644 doc/models/business-appointment-settings-booking-location-type.md delete mode 100644 doc/models/business-appointment-settings-cancellation-policy.md delete mode 100644 doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md delete mode 100644 doc/models/business-appointment-settings.md delete mode 100644 doc/models/business-booking-profile-booking-policy.md delete mode 100644 doc/models/business-booking-profile-customer-timezone-choice.md delete mode 100644 doc/models/business-booking-profile.md delete mode 100644 doc/models/business-hours-period.md delete mode 100644 doc/models/business-hours.md delete mode 100644 doc/models/buy-now-pay-later-details.md delete mode 100644 doc/models/calculate-loyalty-points-request.md delete mode 100644 doc/models/calculate-loyalty-points-response.md delete mode 100644 doc/models/calculate-order-request.md delete mode 100644 doc/models/calculate-order-response.md delete mode 100644 doc/models/cancel-booking-request.md delete mode 100644 doc/models/cancel-booking-response.md delete mode 100644 doc/models/cancel-invoice-request.md delete mode 100644 doc/models/cancel-invoice-response.md delete mode 100644 doc/models/cancel-loyalty-promotion-response.md delete mode 100644 doc/models/cancel-payment-by-idempotency-key-request.md delete mode 100644 doc/models/cancel-payment-by-idempotency-key-response.md delete mode 100644 doc/models/cancel-payment-response.md delete mode 100644 doc/models/cancel-subscription-response.md delete mode 100644 doc/models/cancel-terminal-action-response.md delete mode 100644 doc/models/cancel-terminal-checkout-response.md delete mode 100644 doc/models/cancel-terminal-refund-response.md delete mode 100644 doc/models/capture-transaction-response.md delete mode 100644 doc/models/card-brand.md delete mode 100644 doc/models/card-co-brand.md delete mode 100644 doc/models/card-payment-details.md delete mode 100644 doc/models/card-payment-timeline.md delete mode 100644 doc/models/card-prepaid-type.md delete mode 100644 doc/models/card-type.md delete mode 100644 doc/models/card.md delete mode 100644 doc/models/cash-app-details.md delete mode 100644 doc/models/cash-drawer-device.md delete mode 100644 doc/models/cash-drawer-event-type.md delete mode 100644 doc/models/cash-drawer-shift-event.md delete mode 100644 doc/models/cash-drawer-shift-state.md delete mode 100644 doc/models/cash-drawer-shift-summary.md delete mode 100644 doc/models/cash-drawer-shift.md delete mode 100644 doc/models/cash-payment-details.md delete mode 100644 doc/models/catalog-availability-period.md delete mode 100644 doc/models/catalog-category-type.md delete mode 100644 doc/models/catalog-category.md delete mode 100644 doc/models/catalog-custom-attribute-definition-app-visibility.md delete mode 100644 doc/models/catalog-custom-attribute-definition-number-config.md delete mode 100644 doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md delete mode 100644 doc/models/catalog-custom-attribute-definition-selection-config.md delete mode 100644 doc/models/catalog-custom-attribute-definition-seller-visibility.md delete mode 100644 doc/models/catalog-custom-attribute-definition-string-config.md delete mode 100644 doc/models/catalog-custom-attribute-definition-type.md delete mode 100644 doc/models/catalog-custom-attribute-definition.md delete mode 100644 doc/models/catalog-custom-attribute-value.md delete mode 100644 doc/models/catalog-discount-modify-tax-basis.md delete mode 100644 doc/models/catalog-discount-type.md delete mode 100644 doc/models/catalog-discount.md delete mode 100644 doc/models/catalog-ecom-seo-data.md delete mode 100644 doc/models/catalog-id-mapping.md delete mode 100644 doc/models/catalog-image.md delete mode 100644 doc/models/catalog-info-response-limits.md delete mode 100644 doc/models/catalog-info-response.md delete mode 100644 doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md delete mode 100644 doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md delete mode 100644 doc/models/catalog-item-food-and-beverage-details-dietary-preference.md delete mode 100644 doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md delete mode 100644 doc/models/catalog-item-food-and-beverage-details-ingredient.md delete mode 100644 doc/models/catalog-item-food-and-beverage-details.md delete mode 100644 doc/models/catalog-item-modifier-list-info.md delete mode 100644 doc/models/catalog-item-option-for-item.md delete mode 100644 doc/models/catalog-item-option-value-for-item-variation.md delete mode 100644 doc/models/catalog-item-option-value.md delete mode 100644 doc/models/catalog-item-option.md delete mode 100644 doc/models/catalog-item-product-type.md delete mode 100644 doc/models/catalog-item-variation.md delete mode 100644 doc/models/catalog-item.md delete mode 100644 doc/models/catalog-measurement-unit.md delete mode 100644 doc/models/catalog-modifier-list-modifier-type.md delete mode 100644 doc/models/catalog-modifier-list-selection-type.md delete mode 100644 doc/models/catalog-modifier-list.md delete mode 100644 doc/models/catalog-modifier-override.md delete mode 100644 doc/models/catalog-modifier.md delete mode 100644 doc/models/catalog-object-batch.md delete mode 100644 doc/models/catalog-object-category.md delete mode 100644 doc/models/catalog-object-reference.md delete mode 100644 doc/models/catalog-object-type.md delete mode 100644 doc/models/catalog-object.md delete mode 100644 doc/models/catalog-pricing-rule.md delete mode 100644 doc/models/catalog-pricing-type.md delete mode 100644 doc/models/catalog-product-set.md delete mode 100644 doc/models/catalog-query-exact.md delete mode 100644 doc/models/catalog-query-item-variations-for-item-option-values.md delete mode 100644 doc/models/catalog-query-items-for-item-options.md delete mode 100644 doc/models/catalog-query-items-for-modifier-list.md delete mode 100644 doc/models/catalog-query-items-for-tax.md delete mode 100644 doc/models/catalog-query-prefix.md delete mode 100644 doc/models/catalog-query-range.md delete mode 100644 doc/models/catalog-query-set.md delete mode 100644 doc/models/catalog-query-sorted-attribute.md delete mode 100644 doc/models/catalog-query-text.md delete mode 100644 doc/models/catalog-query.md delete mode 100644 doc/models/catalog-quick-amount-type.md delete mode 100644 doc/models/catalog-quick-amount.md delete mode 100644 doc/models/catalog-quick-amounts-settings-option.md delete mode 100644 doc/models/catalog-quick-amounts-settings.md delete mode 100644 doc/models/catalog-stock-conversion.md delete mode 100644 doc/models/catalog-subscription-plan-variation.md delete mode 100644 doc/models/catalog-subscription-plan.md delete mode 100644 doc/models/catalog-tax.md delete mode 100644 doc/models/catalog-time-period.md delete mode 100644 doc/models/catalog-v1-id.md delete mode 100644 doc/models/category-path-to-root-node.md delete mode 100644 doc/models/change-billing-anchor-date-request.md delete mode 100644 doc/models/change-billing-anchor-date-response.md delete mode 100644 doc/models/change-timing.md delete mode 100644 doc/models/charge-request-additional-recipient.md delete mode 100644 doc/models/charge-request.md delete mode 100644 doc/models/charge-response.md delete mode 100644 doc/models/checkout-location-settings-branding-button-shape.md delete mode 100644 doc/models/checkout-location-settings-branding-header-type.md delete mode 100644 doc/models/checkout-location-settings-branding.md delete mode 100644 doc/models/checkout-location-settings-coupons.md delete mode 100644 doc/models/checkout-location-settings-policy.md delete mode 100644 doc/models/checkout-location-settings-tipping.md delete mode 100644 doc/models/checkout-location-settings.md delete mode 100644 doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md delete mode 100644 doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md delete mode 100644 doc/models/checkout-merchant-settings-payment-methods-payment-method.md delete mode 100644 doc/models/checkout-merchant-settings-payment-methods.md delete mode 100644 doc/models/checkout-merchant-settings.md delete mode 100644 doc/models/checkout-options-payment-type.md delete mode 100644 doc/models/checkout-options.md delete mode 100644 doc/models/checkout.md delete mode 100644 doc/models/clearpay-details.md delete mode 100644 doc/models/clone-order-request.md delete mode 100644 doc/models/clone-order-response.md delete mode 100644 doc/models/collected-data.md delete mode 100644 doc/models/complete-payment-request.md delete mode 100644 doc/models/complete-payment-response.md delete mode 100644 doc/models/component-component-type.md delete mode 100644 doc/models/component.md delete mode 100644 doc/models/confirmation-decision.md delete mode 100644 doc/models/confirmation-options.md delete mode 100644 doc/models/coordinates.md delete mode 100644 doc/models/country.md delete mode 100644 doc/models/create-booking-custom-attribute-definition-request.md delete mode 100644 doc/models/create-booking-custom-attribute-definition-response.md delete mode 100644 doc/models/create-booking-request.md delete mode 100644 doc/models/create-booking-response.md delete mode 100644 doc/models/create-break-type-request.md delete mode 100644 doc/models/create-break-type-response.md delete mode 100644 doc/models/create-card-request.md delete mode 100644 doc/models/create-card-response.md delete mode 100644 doc/models/create-catalog-image-request.md delete mode 100644 doc/models/create-catalog-image-response.md delete mode 100644 doc/models/create-checkout-request.md delete mode 100644 doc/models/create-checkout-response.md delete mode 100644 doc/models/create-customer-card-request.md delete mode 100644 doc/models/create-customer-card-response.md delete mode 100644 doc/models/create-customer-custom-attribute-definition-request.md delete mode 100644 doc/models/create-customer-custom-attribute-definition-response.md delete mode 100644 doc/models/create-customer-group-request.md delete mode 100644 doc/models/create-customer-group-response.md delete mode 100644 doc/models/create-customer-request.md delete mode 100644 doc/models/create-customer-response.md delete mode 100644 doc/models/create-device-code-request.md delete mode 100644 doc/models/create-device-code-response.md delete mode 100644 doc/models/create-dispute-evidence-file-request.md delete mode 100644 doc/models/create-dispute-evidence-file-response.md delete mode 100644 doc/models/create-dispute-evidence-text-request.md delete mode 100644 doc/models/create-dispute-evidence-text-response.md delete mode 100644 doc/models/create-gift-card-activity-request.md delete mode 100644 doc/models/create-gift-card-activity-response.md delete mode 100644 doc/models/create-gift-card-request.md delete mode 100644 doc/models/create-gift-card-response.md delete mode 100644 doc/models/create-invoice-attachment-request.md delete mode 100644 doc/models/create-invoice-attachment-response.md delete mode 100644 doc/models/create-invoice-request.md delete mode 100644 doc/models/create-invoice-response.md delete mode 100644 doc/models/create-job-request.md delete mode 100644 doc/models/create-job-response.md delete mode 100644 doc/models/create-location-custom-attribute-definition-request.md delete mode 100644 doc/models/create-location-custom-attribute-definition-response.md delete mode 100644 doc/models/create-location-request.md delete mode 100644 doc/models/create-location-response.md delete mode 100644 doc/models/create-loyalty-account-request.md delete mode 100644 doc/models/create-loyalty-account-response.md delete mode 100644 doc/models/create-loyalty-promotion-request.md delete mode 100644 doc/models/create-loyalty-promotion-response.md delete mode 100644 doc/models/create-loyalty-reward-request.md delete mode 100644 doc/models/create-loyalty-reward-response.md delete mode 100644 doc/models/create-merchant-custom-attribute-definition-request.md delete mode 100644 doc/models/create-merchant-custom-attribute-definition-response.md delete mode 100644 doc/models/create-mobile-authorization-code-request.md delete mode 100644 doc/models/create-mobile-authorization-code-response.md delete mode 100644 doc/models/create-order-custom-attribute-definition-request.md delete mode 100644 doc/models/create-order-custom-attribute-definition-response.md delete mode 100644 doc/models/create-order-request.md delete mode 100644 doc/models/create-order-response.md delete mode 100644 doc/models/create-payment-link-request.md delete mode 100644 doc/models/create-payment-link-response.md delete mode 100644 doc/models/create-payment-request.md delete mode 100644 doc/models/create-payment-response.md delete mode 100644 doc/models/create-refund-request.md delete mode 100644 doc/models/create-refund-response.md delete mode 100644 doc/models/create-shift-request.md delete mode 100644 doc/models/create-shift-response.md delete mode 100644 doc/models/create-subscription-request.md delete mode 100644 doc/models/create-subscription-response.md delete mode 100644 doc/models/create-team-member-request.md delete mode 100644 doc/models/create-team-member-response.md delete mode 100644 doc/models/create-terminal-action-request.md delete mode 100644 doc/models/create-terminal-action-response.md delete mode 100644 doc/models/create-terminal-checkout-request.md delete mode 100644 doc/models/create-terminal-checkout-response.md delete mode 100644 doc/models/create-terminal-refund-request.md delete mode 100644 doc/models/create-terminal-refund-response.md delete mode 100644 doc/models/create-vendor-request.md delete mode 100644 doc/models/create-vendor-response.md delete mode 100644 doc/models/create-webhook-subscription-request.md delete mode 100644 doc/models/create-webhook-subscription-response.md delete mode 100644 doc/models/currency.md delete mode 100644 doc/models/custom-attribute-definition-visibility.md delete mode 100644 doc/models/custom-attribute-definition.md delete mode 100644 doc/models/custom-attribute-filter.md delete mode 100644 doc/models/custom-attribute.md delete mode 100644 doc/models/custom-field.md delete mode 100644 doc/models/customer-address-filter.md delete mode 100644 doc/models/customer-creation-source-filter.md delete mode 100644 doc/models/customer-creation-source.md delete mode 100644 doc/models/customer-custom-attribute-filter-value.md delete mode 100644 doc/models/customer-custom-attribute-filter.md delete mode 100644 doc/models/customer-custom-attribute-filters.md delete mode 100644 doc/models/customer-details.md delete mode 100644 doc/models/customer-filter.md delete mode 100644 doc/models/customer-group.md delete mode 100644 doc/models/customer-inclusion-exclusion.md delete mode 100644 doc/models/customer-preferences.md delete mode 100644 doc/models/customer-query.md delete mode 100644 doc/models/customer-segment.md delete mode 100644 doc/models/customer-sort-field.md delete mode 100644 doc/models/customer-sort.md delete mode 100644 doc/models/customer-tax-ids.md delete mode 100644 doc/models/customer-text-filter.md delete mode 100644 doc/models/customer.md delete mode 100644 doc/models/data-collection-options-input-type.md delete mode 100644 doc/models/data-collection-options.md delete mode 100644 doc/models/date-range.md delete mode 100644 doc/models/day-of-week.md delete mode 100644 doc/models/delete-booking-custom-attribute-definition-response.md delete mode 100644 doc/models/delete-booking-custom-attribute-response.md delete mode 100644 doc/models/delete-break-type-response.md delete mode 100644 doc/models/delete-catalog-object-response.md delete mode 100644 doc/models/delete-customer-card-response.md delete mode 100644 doc/models/delete-customer-custom-attribute-definition-response.md delete mode 100644 doc/models/delete-customer-custom-attribute-response.md delete mode 100644 doc/models/delete-customer-group-response.md delete mode 100644 doc/models/delete-customer-request.md delete mode 100644 doc/models/delete-customer-response.md delete mode 100644 doc/models/delete-dispute-evidence-response.md delete mode 100644 doc/models/delete-invoice-attachment-response.md delete mode 100644 doc/models/delete-invoice-request.md delete mode 100644 doc/models/delete-invoice-response.md delete mode 100644 doc/models/delete-location-custom-attribute-definition-response.md delete mode 100644 doc/models/delete-location-custom-attribute-response.md delete mode 100644 doc/models/delete-loyalty-reward-response.md delete mode 100644 doc/models/delete-merchant-custom-attribute-definition-response.md delete mode 100644 doc/models/delete-merchant-custom-attribute-response.md delete mode 100644 doc/models/delete-order-custom-attribute-definition-response.md delete mode 100644 doc/models/delete-order-custom-attribute-response.md delete mode 100644 doc/models/delete-payment-link-response.md delete mode 100644 doc/models/delete-shift-response.md delete mode 100644 doc/models/delete-snippet-response.md delete mode 100644 doc/models/delete-subscription-action-response.md delete mode 100644 doc/models/delete-webhook-subscription-response.md delete mode 100644 doc/models/deprecated-create-dispute-evidence-file-request.md delete mode 100644 doc/models/deprecated-create-dispute-evidence-file-response.md delete mode 100644 doc/models/deprecated-create-dispute-evidence-text-request.md delete mode 100644 doc/models/deprecated-create-dispute-evidence-text-response.md delete mode 100644 doc/models/destination-details-card-refund-details.md delete mode 100644 doc/models/destination-details-cash-refund-details.md delete mode 100644 doc/models/destination-details-external-refund-details.md delete mode 100644 doc/models/destination-details.md delete mode 100644 doc/models/destination-type.md delete mode 100644 doc/models/destination.md delete mode 100644 doc/models/device-attributes-device-type.md delete mode 100644 doc/models/device-attributes.md delete mode 100644 doc/models/device-checkout-options.md delete mode 100644 doc/models/device-code-status.md delete mode 100644 doc/models/device-code.md delete mode 100644 doc/models/device-component-details-application-details.md delete mode 100644 doc/models/device-component-details-battery-details.md delete mode 100644 doc/models/device-component-details-card-reader-details.md delete mode 100644 doc/models/device-component-details-ethernet-details.md delete mode 100644 doc/models/device-component-details-external-power.md delete mode 100644 doc/models/device-component-details-measurement.md delete mode 100644 doc/models/device-component-details-network-interface-details.md delete mode 100644 doc/models/device-component-details-wi-fi-details.md delete mode 100644 doc/models/device-details.md delete mode 100644 doc/models/device-metadata.md delete mode 100644 doc/models/device-status-category.md delete mode 100644 doc/models/device-status.md delete mode 100644 doc/models/device.md delete mode 100644 doc/models/digital-wallet-details.md delete mode 100644 doc/models/disable-card-response.md delete mode 100644 doc/models/disable-events-response.md delete mode 100644 doc/models/dismiss-terminal-action-response.md delete mode 100644 doc/models/dismiss-terminal-checkout-response.md delete mode 100644 doc/models/dismiss-terminal-refund-response.md delete mode 100644 doc/models/dispute-evidence-file.md delete mode 100644 doc/models/dispute-evidence-type.md delete mode 100644 doc/models/dispute-evidence.md delete mode 100644 doc/models/dispute-reason.md delete mode 100644 doc/models/dispute-state.md delete mode 100644 doc/models/dispute.md delete mode 100644 doc/models/disputed-payment.md delete mode 100644 doc/models/ecom-visibility.md delete mode 100644 doc/models/employee-status.md delete mode 100644 doc/models/employee-wage.md delete mode 100644 doc/models/employee.md delete mode 100644 doc/models/enable-events-response.md delete mode 100644 doc/models/error-category.md delete mode 100644 doc/models/error-code.md delete mode 100644 doc/models/error.md delete mode 100644 doc/models/event-data.md delete mode 100644 doc/models/event-metadata.md delete mode 100644 doc/models/event-type-metadata.md delete mode 100644 doc/models/event.md delete mode 100644 doc/models/exclude-strategy.md delete mode 100644 doc/models/external-payment-details.md delete mode 100644 doc/models/filter-value.md delete mode 100644 doc/models/float-number-range.md delete mode 100644 doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md delete mode 100644 doc/models/fulfillment-delivery-details.md delete mode 100644 doc/models/fulfillment-fulfillment-entry.md delete mode 100644 doc/models/fulfillment-fulfillment-line-item-application.md delete mode 100644 doc/models/fulfillment-pickup-details-curbside-pickup-details.md delete mode 100644 doc/models/fulfillment-pickup-details-schedule-type.md delete mode 100644 doc/models/fulfillment-pickup-details.md delete mode 100644 doc/models/fulfillment-recipient.md delete mode 100644 doc/models/fulfillment-shipment-details.md delete mode 100644 doc/models/fulfillment-state.md delete mode 100644 doc/models/fulfillment-type.md delete mode 100644 doc/models/fulfillment.md delete mode 100644 doc/models/get-bank-account-by-v1-id-response.md delete mode 100644 doc/models/get-bank-account-response.md delete mode 100644 doc/models/get-break-type-response.md delete mode 100644 doc/models/get-device-code-response.md delete mode 100644 doc/models/get-device-response.md delete mode 100644 doc/models/get-employee-wage-response.md delete mode 100644 doc/models/get-invoice-response.md delete mode 100644 doc/models/get-payment-refund-response.md delete mode 100644 doc/models/get-payment-response.md delete mode 100644 doc/models/get-payout-response.md delete mode 100644 doc/models/get-shift-response.md delete mode 100644 doc/models/get-team-member-wage-response.md delete mode 100644 doc/models/get-terminal-action-response.md delete mode 100644 doc/models/get-terminal-checkout-response.md delete mode 100644 doc/models/get-terminal-refund-response.md delete mode 100644 doc/models/gift-card-activity-activate.md delete mode 100644 doc/models/gift-card-activity-adjust-decrement-reason.md delete mode 100644 doc/models/gift-card-activity-adjust-decrement.md delete mode 100644 doc/models/gift-card-activity-adjust-increment-reason.md delete mode 100644 doc/models/gift-card-activity-adjust-increment.md delete mode 100644 doc/models/gift-card-activity-block-reason.md delete mode 100644 doc/models/gift-card-activity-block.md delete mode 100644 doc/models/gift-card-activity-clear-balance-reason.md delete mode 100644 doc/models/gift-card-activity-clear-balance.md delete mode 100644 doc/models/gift-card-activity-deactivate-reason.md delete mode 100644 doc/models/gift-card-activity-deactivate.md delete mode 100644 doc/models/gift-card-activity-import-reversal.md delete mode 100644 doc/models/gift-card-activity-import.md delete mode 100644 doc/models/gift-card-activity-load.md delete mode 100644 doc/models/gift-card-activity-redeem-status.md delete mode 100644 doc/models/gift-card-activity-redeem.md delete mode 100644 doc/models/gift-card-activity-refund.md delete mode 100644 doc/models/gift-card-activity-transfer-balance-from.md delete mode 100644 doc/models/gift-card-activity-transfer-balance-to.md delete mode 100644 doc/models/gift-card-activity-type.md delete mode 100644 doc/models/gift-card-activity-unblock-reason.md delete mode 100644 doc/models/gift-card-activity-unblock.md delete mode 100644 doc/models/gift-card-activity-unlinked-activity-refund.md delete mode 100644 doc/models/gift-card-activity.md delete mode 100644 doc/models/gift-card-gan-source.md delete mode 100644 doc/models/gift-card-status.md delete mode 100644 doc/models/gift-card-type.md delete mode 100644 doc/models/gift-card.md delete mode 100644 doc/models/inventory-adjustment-group.md delete mode 100644 doc/models/inventory-adjustment.md delete mode 100644 doc/models/inventory-alert-type.md delete mode 100644 doc/models/inventory-change-type.md delete mode 100644 doc/models/inventory-change.md delete mode 100644 doc/models/inventory-count.md delete mode 100644 doc/models/inventory-physical-count.md delete mode 100644 doc/models/inventory-state.md delete mode 100644 doc/models/inventory-transfer.md delete mode 100644 doc/models/invoice-accepted-payment-methods.md delete mode 100644 doc/models/invoice-attachment.md delete mode 100644 doc/models/invoice-automatic-payment-source.md delete mode 100644 doc/models/invoice-custom-field-placement.md delete mode 100644 doc/models/invoice-custom-field.md delete mode 100644 doc/models/invoice-delivery-method.md delete mode 100644 doc/models/invoice-filter.md delete mode 100644 doc/models/invoice-payment-reminder-status.md delete mode 100644 doc/models/invoice-payment-reminder.md delete mode 100644 doc/models/invoice-payment-request.md delete mode 100644 doc/models/invoice-query.md delete mode 100644 doc/models/invoice-recipient-tax-ids.md delete mode 100644 doc/models/invoice-recipient.md delete mode 100644 doc/models/invoice-request-method.md delete mode 100644 doc/models/invoice-request-type.md delete mode 100644 doc/models/invoice-sort-field.md delete mode 100644 doc/models/invoice-sort.md delete mode 100644 doc/models/invoice-status.md delete mode 100644 doc/models/invoice.md delete mode 100644 doc/models/item-variation-location-overrides.md delete mode 100644 doc/models/job-assignment-pay-type.md delete mode 100644 doc/models/job-assignment.md delete mode 100644 doc/models/job.md delete mode 100644 doc/models/link-customer-to-gift-card-request.md delete mode 100644 doc/models/link-customer-to-gift-card-response.md delete mode 100644 doc/models/list-bank-accounts-request.md delete mode 100644 doc/models/list-bank-accounts-response.md delete mode 100644 doc/models/list-booking-custom-attribute-definitions-request.md delete mode 100644 doc/models/list-booking-custom-attribute-definitions-response.md delete mode 100644 doc/models/list-booking-custom-attributes-request.md delete mode 100644 doc/models/list-booking-custom-attributes-response.md delete mode 100644 doc/models/list-bookings-request.md delete mode 100644 doc/models/list-bookings-response.md delete mode 100644 doc/models/list-break-types-request.md delete mode 100644 doc/models/list-break-types-response.md delete mode 100644 doc/models/list-cards-request.md delete mode 100644 doc/models/list-cards-response.md delete mode 100644 doc/models/list-cash-drawer-shift-events-request.md delete mode 100644 doc/models/list-cash-drawer-shift-events-response.md delete mode 100644 doc/models/list-cash-drawer-shifts-request.md delete mode 100644 doc/models/list-cash-drawer-shifts-response.md delete mode 100644 doc/models/list-catalog-request.md delete mode 100644 doc/models/list-catalog-response.md delete mode 100644 doc/models/list-customer-custom-attribute-definitions-request.md delete mode 100644 doc/models/list-customer-custom-attribute-definitions-response.md delete mode 100644 doc/models/list-customer-custom-attributes-request.md delete mode 100644 doc/models/list-customer-custom-attributes-response.md delete mode 100644 doc/models/list-customer-groups-request.md delete mode 100644 doc/models/list-customer-groups-response.md delete mode 100644 doc/models/list-customer-segments-request.md delete mode 100644 doc/models/list-customer-segments-response.md delete mode 100644 doc/models/list-customers-request.md delete mode 100644 doc/models/list-customers-response.md delete mode 100644 doc/models/list-device-codes-request.md delete mode 100644 doc/models/list-device-codes-response.md delete mode 100644 doc/models/list-devices-request.md delete mode 100644 doc/models/list-devices-response.md delete mode 100644 doc/models/list-dispute-evidence-request.md delete mode 100644 doc/models/list-dispute-evidence-response.md delete mode 100644 doc/models/list-disputes-request.md delete mode 100644 doc/models/list-disputes-response.md delete mode 100644 doc/models/list-employee-wages-request.md delete mode 100644 doc/models/list-employee-wages-response.md delete mode 100644 doc/models/list-employees-request.md delete mode 100644 doc/models/list-employees-response.md delete mode 100644 doc/models/list-event-types-request.md delete mode 100644 doc/models/list-event-types-response.md delete mode 100644 doc/models/list-gift-card-activities-request.md delete mode 100644 doc/models/list-gift-card-activities-response.md delete mode 100644 doc/models/list-gift-cards-request.md delete mode 100644 doc/models/list-gift-cards-response.md delete mode 100644 doc/models/list-invoices-request.md delete mode 100644 doc/models/list-invoices-response.md delete mode 100644 doc/models/list-jobs-request.md delete mode 100644 doc/models/list-jobs-response.md delete mode 100644 doc/models/list-location-booking-profiles-request.md delete mode 100644 doc/models/list-location-booking-profiles-response.md delete mode 100644 doc/models/list-location-custom-attribute-definitions-request.md delete mode 100644 doc/models/list-location-custom-attribute-definitions-response.md delete mode 100644 doc/models/list-location-custom-attributes-request.md delete mode 100644 doc/models/list-location-custom-attributes-response.md delete mode 100644 doc/models/list-locations-response.md delete mode 100644 doc/models/list-loyalty-programs-response.md delete mode 100644 doc/models/list-loyalty-promotions-request.md delete mode 100644 doc/models/list-loyalty-promotions-response.md delete mode 100644 doc/models/list-merchant-custom-attribute-definitions-request.md delete mode 100644 doc/models/list-merchant-custom-attribute-definitions-response.md delete mode 100644 doc/models/list-merchant-custom-attributes-request.md delete mode 100644 doc/models/list-merchant-custom-attributes-response.md delete mode 100644 doc/models/list-merchants-request.md delete mode 100644 doc/models/list-merchants-response.md delete mode 100644 doc/models/list-order-custom-attribute-definitions-request.md delete mode 100644 doc/models/list-order-custom-attribute-definitions-response.md delete mode 100644 doc/models/list-order-custom-attributes-request.md delete mode 100644 doc/models/list-order-custom-attributes-response.md delete mode 100644 doc/models/list-payment-links-request.md delete mode 100644 doc/models/list-payment-links-response.md delete mode 100644 doc/models/list-payment-refunds-request.md delete mode 100644 doc/models/list-payment-refunds-response.md delete mode 100644 doc/models/list-payments-request.md delete mode 100644 doc/models/list-payments-response.md delete mode 100644 doc/models/list-payout-entries-request.md delete mode 100644 doc/models/list-payout-entries-response.md delete mode 100644 doc/models/list-payouts-request.md delete mode 100644 doc/models/list-payouts-response.md delete mode 100644 doc/models/list-refunds-request.md delete mode 100644 doc/models/list-refunds-response.md delete mode 100644 doc/models/list-sites-response.md delete mode 100644 doc/models/list-subscription-events-request.md delete mode 100644 doc/models/list-subscription-events-response.md delete mode 100644 doc/models/list-team-member-booking-profiles-request.md delete mode 100644 doc/models/list-team-member-booking-profiles-response.md delete mode 100644 doc/models/list-team-member-wages-request.md delete mode 100644 doc/models/list-team-member-wages-response.md delete mode 100644 doc/models/list-transactions-request.md delete mode 100644 doc/models/list-transactions-response.md delete mode 100644 doc/models/list-webhook-event-types-request.md delete mode 100644 doc/models/list-webhook-event-types-response.md delete mode 100644 doc/models/list-webhook-subscriptions-request.md delete mode 100644 doc/models/list-webhook-subscriptions-response.md delete mode 100644 doc/models/list-workweek-configs-request.md delete mode 100644 doc/models/list-workweek-configs-response.md delete mode 100644 doc/models/location-booking-profile.md delete mode 100644 doc/models/location-capability.md delete mode 100644 doc/models/location-status.md delete mode 100644 doc/models/location-type.md delete mode 100644 doc/models/location.md delete mode 100644 doc/models/loyalty-account-expiring-point-deadline.md delete mode 100644 doc/models/loyalty-account-mapping-type.md delete mode 100644 doc/models/loyalty-account-mapping.md delete mode 100644 doc/models/loyalty-account.md delete mode 100644 doc/models/loyalty-event-accumulate-points.md delete mode 100644 doc/models/loyalty-event-accumulate-promotion-points.md delete mode 100644 doc/models/loyalty-event-adjust-points.md delete mode 100644 doc/models/loyalty-event-create-reward.md delete mode 100644 doc/models/loyalty-event-date-time-filter.md delete mode 100644 doc/models/loyalty-event-delete-reward.md delete mode 100644 doc/models/loyalty-event-expire-points.md delete mode 100644 doc/models/loyalty-event-filter.md delete mode 100644 doc/models/loyalty-event-location-filter.md delete mode 100644 doc/models/loyalty-event-loyalty-account-filter.md delete mode 100644 doc/models/loyalty-event-order-filter.md delete mode 100644 doc/models/loyalty-event-other.md delete mode 100644 doc/models/loyalty-event-query.md delete mode 100644 doc/models/loyalty-event-redeem-reward.md delete mode 100644 doc/models/loyalty-event-source.md delete mode 100644 doc/models/loyalty-event-type-filter.md delete mode 100644 doc/models/loyalty-event-type.md delete mode 100644 doc/models/loyalty-event.md delete mode 100644 doc/models/loyalty-program-accrual-rule-category-data.md delete mode 100644 doc/models/loyalty-program-accrual-rule-item-variation-data.md delete mode 100644 doc/models/loyalty-program-accrual-rule-spend-data.md delete mode 100644 doc/models/loyalty-program-accrual-rule-tax-mode.md delete mode 100644 doc/models/loyalty-program-accrual-rule-type.md delete mode 100644 doc/models/loyalty-program-accrual-rule-visit-data.md delete mode 100644 doc/models/loyalty-program-accrual-rule.md delete mode 100644 doc/models/loyalty-program-expiration-policy.md delete mode 100644 doc/models/loyalty-program-reward-definition-scope.md delete mode 100644 doc/models/loyalty-program-reward-definition-type.md delete mode 100644 doc/models/loyalty-program-reward-definition.md delete mode 100644 doc/models/loyalty-program-reward-tier.md delete mode 100644 doc/models/loyalty-program-status.md delete mode 100644 doc/models/loyalty-program-terminology.md delete mode 100644 doc/models/loyalty-program.md delete mode 100644 doc/models/loyalty-promotion-available-time-data.md delete mode 100644 doc/models/loyalty-promotion-incentive-points-addition-data.md delete mode 100644 doc/models/loyalty-promotion-incentive-points-multiplier-data.md delete mode 100644 doc/models/loyalty-promotion-incentive-type.md delete mode 100644 doc/models/loyalty-promotion-incentive.md delete mode 100644 doc/models/loyalty-promotion-status.md delete mode 100644 doc/models/loyalty-promotion-trigger-limit-interval.md delete mode 100644 doc/models/loyalty-promotion-trigger-limit.md delete mode 100644 doc/models/loyalty-promotion.md delete mode 100644 doc/models/loyalty-reward-status.md delete mode 100644 doc/models/loyalty-reward.md delete mode 100644 doc/models/measurement-unit-area.md delete mode 100644 doc/models/measurement-unit-custom.md delete mode 100644 doc/models/measurement-unit-generic.md delete mode 100644 doc/models/measurement-unit-length.md delete mode 100644 doc/models/measurement-unit-time.md delete mode 100644 doc/models/measurement-unit-unit-type.md delete mode 100644 doc/models/measurement-unit-volume.md delete mode 100644 doc/models/measurement-unit-weight.md delete mode 100644 doc/models/measurement-unit.md delete mode 100644 doc/models/merchant-status.md delete mode 100644 doc/models/merchant.md delete mode 100644 doc/models/modifier-location-overrides.md delete mode 100644 doc/models/money.md delete mode 100644 doc/models/obtain-token-request.md delete mode 100644 doc/models/obtain-token-response.md delete mode 100644 doc/models/offline-payment-details.md delete mode 100644 doc/models/order-created-object.md delete mode 100644 doc/models/order-created.md delete mode 100644 doc/models/order-entry.md delete mode 100644 doc/models/order-fulfillment-delivery-details-schedule-type.md delete mode 100644 doc/models/order-fulfillment-delivery-details.md delete mode 100644 doc/models/order-fulfillment-fulfillment-entry.md delete mode 100644 doc/models/order-fulfillment-fulfillment-line-item-application.md delete mode 100644 doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md delete mode 100644 doc/models/order-fulfillment-pickup-details-schedule-type.md delete mode 100644 doc/models/order-fulfillment-pickup-details.md delete mode 100644 doc/models/order-fulfillment-recipient.md delete mode 100644 doc/models/order-fulfillment-shipment-details.md delete mode 100644 doc/models/order-fulfillment-state.md delete mode 100644 doc/models/order-fulfillment-type.md delete mode 100644 doc/models/order-fulfillment-updated-object.md delete mode 100644 doc/models/order-fulfillment-updated-update.md delete mode 100644 doc/models/order-fulfillment-updated.md delete mode 100644 doc/models/order-fulfillment.md delete mode 100644 doc/models/order-line-item-applied-discount.md delete mode 100644 doc/models/order-line-item-applied-service-charge.md delete mode 100644 doc/models/order-line-item-applied-tax.md delete mode 100644 doc/models/order-line-item-discount-scope.md delete mode 100644 doc/models/order-line-item-discount-type.md delete mode 100644 doc/models/order-line-item-discount.md delete mode 100644 doc/models/order-line-item-item-type.md delete mode 100644 doc/models/order-line-item-modifier.md delete mode 100644 doc/models/order-line-item-pricing-blocklists-blocked-discount.md delete mode 100644 doc/models/order-line-item-pricing-blocklists-blocked-tax.md delete mode 100644 doc/models/order-line-item-pricing-blocklists.md delete mode 100644 doc/models/order-line-item-tax-scope.md delete mode 100644 doc/models/order-line-item-tax-type.md delete mode 100644 doc/models/order-line-item-tax.md delete mode 100644 doc/models/order-line-item.md delete mode 100644 doc/models/order-money-amounts.md delete mode 100644 doc/models/order-pricing-options.md delete mode 100644 doc/models/order-quantity-unit.md delete mode 100644 doc/models/order-return-discount.md delete mode 100644 doc/models/order-return-line-item-modifier.md delete mode 100644 doc/models/order-return-line-item.md delete mode 100644 doc/models/order-return-service-charge.md delete mode 100644 doc/models/order-return-tax.md delete mode 100644 doc/models/order-return-tip.md delete mode 100644 doc/models/order-return.md delete mode 100644 doc/models/order-reward.md delete mode 100644 doc/models/order-rounding-adjustment.md delete mode 100644 doc/models/order-service-charge-calculation-phase.md delete mode 100644 doc/models/order-service-charge-scope.md delete mode 100644 doc/models/order-service-charge-treatment-type.md delete mode 100644 doc/models/order-service-charge-type.md delete mode 100644 doc/models/order-service-charge.md delete mode 100644 doc/models/order-source.md delete mode 100644 doc/models/order-state.md delete mode 100644 doc/models/order-updated-object.md delete mode 100644 doc/models/order-updated.md delete mode 100644 doc/models/order.md delete mode 100644 doc/models/pagination-cursor.md delete mode 100644 doc/models/pause-subscription-request.md delete mode 100644 doc/models/pause-subscription-response.md delete mode 100644 doc/models/pay-order-request.md delete mode 100644 doc/models/pay-order-response.md delete mode 100644 doc/models/payment-balance-activity-app-fee-refund-detail.md delete mode 100644 doc/models/payment-balance-activity-app-fee-revenue-detail.md delete mode 100644 doc/models/payment-balance-activity-automatic-savings-detail.md delete mode 100644 doc/models/payment-balance-activity-automatic-savings-reversed-detail.md delete mode 100644 doc/models/payment-balance-activity-charge-detail.md delete mode 100644 doc/models/payment-balance-activity-deposit-fee-detail.md delete mode 100644 doc/models/payment-balance-activity-deposit-fee-reversed-detail.md delete mode 100644 doc/models/payment-balance-activity-dispute-detail.md delete mode 100644 doc/models/payment-balance-activity-fee-detail.md delete mode 100644 doc/models/payment-balance-activity-free-processing-detail.md delete mode 100644 doc/models/payment-balance-activity-hold-adjustment-detail.md delete mode 100644 doc/models/payment-balance-activity-open-dispute-detail.md delete mode 100644 doc/models/payment-balance-activity-other-adjustment-detail.md delete mode 100644 doc/models/payment-balance-activity-other-detail.md delete mode 100644 doc/models/payment-balance-activity-refund-detail.md delete mode 100644 doc/models/payment-balance-activity-release-adjustment-detail.md delete mode 100644 doc/models/payment-balance-activity-reserve-hold-detail.md delete mode 100644 doc/models/payment-balance-activity-reserve-release-detail.md delete mode 100644 doc/models/payment-balance-activity-square-capital-payment-detail.md delete mode 100644 doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md delete mode 100644 doc/models/payment-balance-activity-square-payroll-transfer-detail.md delete mode 100644 doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md delete mode 100644 doc/models/payment-balance-activity-tax-on-fee-detail.md delete mode 100644 doc/models/payment-balance-activity-third-party-fee-detail.md delete mode 100644 doc/models/payment-balance-activity-third-party-fee-refund-detail.md delete mode 100644 doc/models/payment-link-related-resources.md delete mode 100644 doc/models/payment-link.md delete mode 100644 doc/models/payment-options-delay-action.md delete mode 100644 doc/models/payment-options.md delete mode 100644 doc/models/payment-refund.md delete mode 100644 doc/models/payment-sort-field.md delete mode 100644 doc/models/payment.md delete mode 100644 doc/models/payout-entry.md delete mode 100644 doc/models/payout-fee-type.md delete mode 100644 doc/models/payout-fee.md delete mode 100644 doc/models/payout-status.md delete mode 100644 doc/models/payout-type.md delete mode 100644 doc/models/payout.md delete mode 100644 doc/models/phase-input.md delete mode 100644 doc/models/phase.md delete mode 100644 doc/models/pre-populated-data.md delete mode 100644 doc/models/processing-fee.md delete mode 100644 doc/models/product-type.md delete mode 100644 doc/models/product.md delete mode 100644 doc/models/publish-invoice-request.md delete mode 100644 doc/models/publish-invoice-response.md delete mode 100644 doc/models/qr-code-options.md delete mode 100644 doc/models/quantity-ratio.md delete mode 100644 doc/models/quick-pay.md delete mode 100644 doc/models/range.md delete mode 100644 doc/models/receipt-options.md delete mode 100644 doc/models/redeem-loyalty-reward-request.md delete mode 100644 doc/models/redeem-loyalty-reward-response.md delete mode 100644 doc/models/refund-payment-request.md delete mode 100644 doc/models/refund-payment-response.md delete mode 100644 doc/models/refund-status.md delete mode 100644 doc/models/refund.md delete mode 100644 doc/models/register-domain-request.md delete mode 100644 doc/models/register-domain-response-status.md delete mode 100644 doc/models/register-domain-response.md delete mode 100644 doc/models/remove-group-from-customer-response.md delete mode 100644 doc/models/resume-subscription-request.md delete mode 100644 doc/models/resume-subscription-response.md delete mode 100644 doc/models/retrieve-booking-custom-attribute-definition-request.md delete mode 100644 doc/models/retrieve-booking-custom-attribute-definition-response.md delete mode 100644 doc/models/retrieve-booking-custom-attribute-request.md delete mode 100644 doc/models/retrieve-booking-custom-attribute-response.md delete mode 100644 doc/models/retrieve-booking-response.md delete mode 100644 doc/models/retrieve-business-booking-profile-response.md delete mode 100644 doc/models/retrieve-card-response.md delete mode 100644 doc/models/retrieve-cash-drawer-shift-request.md delete mode 100644 doc/models/retrieve-cash-drawer-shift-response.md delete mode 100644 doc/models/retrieve-catalog-object-request.md delete mode 100644 doc/models/retrieve-catalog-object-response.md delete mode 100644 doc/models/retrieve-customer-custom-attribute-definition-request.md delete mode 100644 doc/models/retrieve-customer-custom-attribute-definition-response.md delete mode 100644 doc/models/retrieve-customer-custom-attribute-request.md delete mode 100644 doc/models/retrieve-customer-custom-attribute-response.md delete mode 100644 doc/models/retrieve-customer-group-response.md delete mode 100644 doc/models/retrieve-customer-response.md delete mode 100644 doc/models/retrieve-customer-segment-response.md delete mode 100644 doc/models/retrieve-dispute-evidence-response.md delete mode 100644 doc/models/retrieve-dispute-response.md delete mode 100644 doc/models/retrieve-employee-response.md delete mode 100644 doc/models/retrieve-gift-card-from-gan-request.md delete mode 100644 doc/models/retrieve-gift-card-from-gan-response.md delete mode 100644 doc/models/retrieve-gift-card-from-nonce-request.md delete mode 100644 doc/models/retrieve-gift-card-from-nonce-response.md delete mode 100644 doc/models/retrieve-gift-card-response.md delete mode 100644 doc/models/retrieve-inventory-adjustment-response.md delete mode 100644 doc/models/retrieve-inventory-changes-request.md delete mode 100644 doc/models/retrieve-inventory-changes-response.md delete mode 100644 doc/models/retrieve-inventory-count-request.md delete mode 100644 doc/models/retrieve-inventory-count-response.md delete mode 100644 doc/models/retrieve-inventory-physical-count-response.md delete mode 100644 doc/models/retrieve-inventory-transfer-response.md delete mode 100644 doc/models/retrieve-job-response.md delete mode 100644 doc/models/retrieve-location-booking-profile-response.md delete mode 100644 doc/models/retrieve-location-custom-attribute-definition-request.md delete mode 100644 doc/models/retrieve-location-custom-attribute-definition-response.md delete mode 100644 doc/models/retrieve-location-custom-attribute-request.md delete mode 100644 doc/models/retrieve-location-custom-attribute-response.md delete mode 100644 doc/models/retrieve-location-response.md delete mode 100644 doc/models/retrieve-location-settings-response.md delete mode 100644 doc/models/retrieve-loyalty-account-response.md delete mode 100644 doc/models/retrieve-loyalty-program-response.md delete mode 100644 doc/models/retrieve-loyalty-promotion-response.md delete mode 100644 doc/models/retrieve-loyalty-reward-response.md delete mode 100644 doc/models/retrieve-merchant-custom-attribute-definition-request.md delete mode 100644 doc/models/retrieve-merchant-custom-attribute-definition-response.md delete mode 100644 doc/models/retrieve-merchant-custom-attribute-request.md delete mode 100644 doc/models/retrieve-merchant-custom-attribute-response.md delete mode 100644 doc/models/retrieve-merchant-response.md delete mode 100644 doc/models/retrieve-merchant-settings-response.md delete mode 100644 doc/models/retrieve-order-custom-attribute-definition-request.md delete mode 100644 doc/models/retrieve-order-custom-attribute-definition-response.md delete mode 100644 doc/models/retrieve-order-custom-attribute-request.md delete mode 100644 doc/models/retrieve-order-custom-attribute-response.md delete mode 100644 doc/models/retrieve-order-response.md delete mode 100644 doc/models/retrieve-payment-link-response.md delete mode 100644 doc/models/retrieve-snippet-response.md delete mode 100644 doc/models/retrieve-subscription-request.md delete mode 100644 doc/models/retrieve-subscription-response.md delete mode 100644 doc/models/retrieve-team-member-booking-profile-response.md delete mode 100644 doc/models/retrieve-team-member-response.md delete mode 100644 doc/models/retrieve-token-status-response.md delete mode 100644 doc/models/retrieve-transaction-response.md delete mode 100644 doc/models/retrieve-vendor-response.md delete mode 100644 doc/models/retrieve-wage-setting-response.md delete mode 100644 doc/models/retrieve-webhook-subscription-response.md delete mode 100644 doc/models/revoke-token-request.md delete mode 100644 doc/models/revoke-token-response.md delete mode 100644 doc/models/risk-evaluation-risk-level.md delete mode 100644 doc/models/risk-evaluation.md delete mode 100644 doc/models/save-card-options.md delete mode 100644 doc/models/search-availability-filter.md delete mode 100644 doc/models/search-availability-query.md delete mode 100644 doc/models/search-availability-request.md delete mode 100644 doc/models/search-availability-response.md delete mode 100644 doc/models/search-catalog-items-request-stock-level.md delete mode 100644 doc/models/search-catalog-items-request.md delete mode 100644 doc/models/search-catalog-items-response.md delete mode 100644 doc/models/search-catalog-objects-request.md delete mode 100644 doc/models/search-catalog-objects-response.md delete mode 100644 doc/models/search-customers-request.md delete mode 100644 doc/models/search-customers-response.md delete mode 100644 doc/models/search-events-filter.md delete mode 100644 doc/models/search-events-query.md delete mode 100644 doc/models/search-events-request.md delete mode 100644 doc/models/search-events-response.md delete mode 100644 doc/models/search-events-sort-field.md delete mode 100644 doc/models/search-events-sort.md delete mode 100644 doc/models/search-invoices-request.md delete mode 100644 doc/models/search-invoices-response.md delete mode 100644 doc/models/search-loyalty-accounts-request-loyalty-account-query.md delete mode 100644 doc/models/search-loyalty-accounts-request.md delete mode 100644 doc/models/search-loyalty-accounts-response.md delete mode 100644 doc/models/search-loyalty-events-request.md delete mode 100644 doc/models/search-loyalty-events-response.md delete mode 100644 doc/models/search-loyalty-rewards-request-loyalty-reward-query.md delete mode 100644 doc/models/search-loyalty-rewards-request.md delete mode 100644 doc/models/search-loyalty-rewards-response.md delete mode 100644 doc/models/search-orders-customer-filter.md delete mode 100644 doc/models/search-orders-date-time-filter.md delete mode 100644 doc/models/search-orders-filter.md delete mode 100644 doc/models/search-orders-fulfillment-filter.md delete mode 100644 doc/models/search-orders-query.md delete mode 100644 doc/models/search-orders-request.md delete mode 100644 doc/models/search-orders-response.md delete mode 100644 doc/models/search-orders-sort-field.md delete mode 100644 doc/models/search-orders-sort.md delete mode 100644 doc/models/search-orders-source-filter.md delete mode 100644 doc/models/search-orders-state-filter.md delete mode 100644 doc/models/search-shifts-request.md delete mode 100644 doc/models/search-shifts-response.md delete mode 100644 doc/models/search-subscriptions-filter.md delete mode 100644 doc/models/search-subscriptions-query.md delete mode 100644 doc/models/search-subscriptions-request.md delete mode 100644 doc/models/search-subscriptions-response.md delete mode 100644 doc/models/search-team-members-filter.md delete mode 100644 doc/models/search-team-members-query.md delete mode 100644 doc/models/search-team-members-request.md delete mode 100644 doc/models/search-team-members-response.md delete mode 100644 doc/models/search-terminal-actions-request.md delete mode 100644 doc/models/search-terminal-actions-response.md delete mode 100644 doc/models/search-terminal-checkouts-request.md delete mode 100644 doc/models/search-terminal-checkouts-response.md delete mode 100644 doc/models/search-terminal-refunds-request.md delete mode 100644 doc/models/search-terminal-refunds-response.md delete mode 100644 doc/models/search-vendors-request-filter.md delete mode 100644 doc/models/search-vendors-request-sort-field.md delete mode 100644 doc/models/search-vendors-request-sort.md delete mode 100644 doc/models/search-vendors-request.md delete mode 100644 doc/models/search-vendors-response.md delete mode 100644 doc/models/segment-filter.md delete mode 100644 doc/models/select-option.md delete mode 100644 doc/models/select-options.md delete mode 100644 doc/models/shift-filter-status.md delete mode 100644 doc/models/shift-filter.md delete mode 100644 doc/models/shift-query.md delete mode 100644 doc/models/shift-sort-field.md delete mode 100644 doc/models/shift-sort.md delete mode 100644 doc/models/shift-status.md delete mode 100644 doc/models/shift-wage.md delete mode 100644 doc/models/shift-workday-matcher.md delete mode 100644 doc/models/shift-workday.md delete mode 100644 doc/models/shift.md delete mode 100644 doc/models/shipping-fee.md delete mode 100644 doc/models/signature-image.md delete mode 100644 doc/models/signature-options.md delete mode 100644 doc/models/site.md delete mode 100644 doc/models/snippet-response.md delete mode 100644 doc/models/snippet.md delete mode 100644 doc/models/sort-order.md delete mode 100644 doc/models/source-application.md delete mode 100644 doc/models/square-account-details.md delete mode 100644 doc/models/standard-unit-description-group.md delete mode 100644 doc/models/standard-unit-description.md delete mode 100644 doc/models/submit-evidence-response.md delete mode 100644 doc/models/subscription-action-type.md delete mode 100644 doc/models/subscription-action.md delete mode 100644 doc/models/subscription-cadence.md delete mode 100644 doc/models/subscription-event-info-code.md delete mode 100644 doc/models/subscription-event-info.md delete mode 100644 doc/models/subscription-event-subscription-event-type.md delete mode 100644 doc/models/subscription-event.md delete mode 100644 doc/models/subscription-phase.md delete mode 100644 doc/models/subscription-pricing-type.md delete mode 100644 doc/models/subscription-pricing.md delete mode 100644 doc/models/subscription-source.md delete mode 100644 doc/models/subscription-status.md delete mode 100644 doc/models/subscription-test-result.md delete mode 100644 doc/models/subscription.md delete mode 100644 doc/models/swap-plan-request.md delete mode 100644 doc/models/swap-plan-response.md delete mode 100644 doc/models/tax-calculation-phase.md delete mode 100644 doc/models/tax-ids.md delete mode 100644 doc/models/tax-inclusion-type.md delete mode 100644 doc/models/team-member-assigned-locations-assignment-type.md delete mode 100644 doc/models/team-member-assigned-locations.md delete mode 100644 doc/models/team-member-booking-profile.md delete mode 100644 doc/models/team-member-invitation-status.md delete mode 100644 doc/models/team-member-status.md delete mode 100644 doc/models/team-member-wage.md delete mode 100644 doc/models/team-member.md delete mode 100644 doc/models/tender-bank-account-details-status.md delete mode 100644 doc/models/tender-bank-account-details.md delete mode 100644 doc/models/tender-buy-now-pay-later-details-brand.md delete mode 100644 doc/models/tender-buy-now-pay-later-details-status.md delete mode 100644 doc/models/tender-buy-now-pay-later-details.md delete mode 100644 doc/models/tender-card-details-entry-method.md delete mode 100644 doc/models/tender-card-details-status.md delete mode 100644 doc/models/tender-card-details.md delete mode 100644 doc/models/tender-cash-details.md delete mode 100644 doc/models/tender-square-account-details-status.md delete mode 100644 doc/models/tender-square-account-details.md delete mode 100644 doc/models/tender-type.md delete mode 100644 doc/models/tender.md delete mode 100644 doc/models/terminal-action-action-type.md delete mode 100644 doc/models/terminal-action-query-filter.md delete mode 100644 doc/models/terminal-action-query-sort.md delete mode 100644 doc/models/terminal-action-query.md delete mode 100644 doc/models/terminal-action.md delete mode 100644 doc/models/terminal-checkout-query-filter.md delete mode 100644 doc/models/terminal-checkout-query-sort.md delete mode 100644 doc/models/terminal-checkout-query.md delete mode 100644 doc/models/terminal-checkout.md delete mode 100644 doc/models/terminal-refund-query-filter.md delete mode 100644 doc/models/terminal-refund-query-sort.md delete mode 100644 doc/models/terminal-refund-query.md delete mode 100644 doc/models/terminal-refund.md delete mode 100644 doc/models/test-webhook-subscription-request.md delete mode 100644 doc/models/test-webhook-subscription-response.md delete mode 100644 doc/models/time-range.md delete mode 100644 doc/models/tip-settings.md delete mode 100644 doc/models/transaction-product.md delete mode 100644 doc/models/transaction-type.md delete mode 100644 doc/models/transaction.md delete mode 100644 doc/models/unlink-customer-from-gift-card-request.md delete mode 100644 doc/models/unlink-customer-from-gift-card-response.md delete mode 100644 doc/models/update-booking-custom-attribute-definition-request.md delete mode 100644 doc/models/update-booking-custom-attribute-definition-response.md delete mode 100644 doc/models/update-booking-request.md delete mode 100644 doc/models/update-booking-response.md delete mode 100644 doc/models/update-break-type-request.md delete mode 100644 doc/models/update-break-type-response.md delete mode 100644 doc/models/update-catalog-image-request.md delete mode 100644 doc/models/update-catalog-image-response.md delete mode 100644 doc/models/update-customer-custom-attribute-definition-request.md delete mode 100644 doc/models/update-customer-custom-attribute-definition-response.md delete mode 100644 doc/models/update-customer-group-request.md delete mode 100644 doc/models/update-customer-group-response.md delete mode 100644 doc/models/update-customer-request.md delete mode 100644 doc/models/update-customer-response.md delete mode 100644 doc/models/update-invoice-request.md delete mode 100644 doc/models/update-invoice-response.md delete mode 100644 doc/models/update-item-modifier-lists-request.md delete mode 100644 doc/models/update-item-modifier-lists-response.md delete mode 100644 doc/models/update-item-taxes-request.md delete mode 100644 doc/models/update-item-taxes-response.md delete mode 100644 doc/models/update-job-request.md delete mode 100644 doc/models/update-job-response.md delete mode 100644 doc/models/update-location-custom-attribute-definition-request.md delete mode 100644 doc/models/update-location-custom-attribute-definition-response.md delete mode 100644 doc/models/update-location-request.md delete mode 100644 doc/models/update-location-response.md delete mode 100644 doc/models/update-location-settings-request.md delete mode 100644 doc/models/update-location-settings-response.md delete mode 100644 doc/models/update-merchant-custom-attribute-definition-request.md delete mode 100644 doc/models/update-merchant-custom-attribute-definition-response.md delete mode 100644 doc/models/update-merchant-settings-request.md delete mode 100644 doc/models/update-merchant-settings-response.md delete mode 100644 doc/models/update-order-custom-attribute-definition-request.md delete mode 100644 doc/models/update-order-custom-attribute-definition-response.md delete mode 100644 doc/models/update-order-request.md delete mode 100644 doc/models/update-order-response.md delete mode 100644 doc/models/update-payment-link-request.md delete mode 100644 doc/models/update-payment-link-response.md delete mode 100644 doc/models/update-payment-request.md delete mode 100644 doc/models/update-payment-response.md delete mode 100644 doc/models/update-shift-request.md delete mode 100644 doc/models/update-shift-response.md delete mode 100644 doc/models/update-subscription-request.md delete mode 100644 doc/models/update-subscription-response.md delete mode 100644 doc/models/update-team-member-request.md delete mode 100644 doc/models/update-team-member-response.md delete mode 100644 doc/models/update-vendor-request.md delete mode 100644 doc/models/update-vendor-response.md delete mode 100644 doc/models/update-wage-setting-request.md delete mode 100644 doc/models/update-wage-setting-response.md delete mode 100644 doc/models/update-webhook-subscription-request.md delete mode 100644 doc/models/update-webhook-subscription-response.md delete mode 100644 doc/models/update-webhook-subscription-signature-key-request.md delete mode 100644 doc/models/update-webhook-subscription-signature-key-response.md delete mode 100644 doc/models/update-workweek-config-request.md delete mode 100644 doc/models/update-workweek-config-response.md delete mode 100644 doc/models/upsert-booking-custom-attribute-request.md delete mode 100644 doc/models/upsert-booking-custom-attribute-response.md delete mode 100644 doc/models/upsert-catalog-object-request.md delete mode 100644 doc/models/upsert-catalog-object-response.md delete mode 100644 doc/models/upsert-customer-custom-attribute-request.md delete mode 100644 doc/models/upsert-customer-custom-attribute-response.md delete mode 100644 doc/models/upsert-location-custom-attribute-request.md delete mode 100644 doc/models/upsert-location-custom-attribute-response.md delete mode 100644 doc/models/upsert-merchant-custom-attribute-request.md delete mode 100644 doc/models/upsert-merchant-custom-attribute-response.md delete mode 100644 doc/models/upsert-order-custom-attribute-request.md delete mode 100644 doc/models/upsert-order-custom-attribute-response.md delete mode 100644 doc/models/upsert-snippet-request.md delete mode 100644 doc/models/upsert-snippet-response.md delete mode 100644 doc/models/v1-device.md delete mode 100644 doc/models/v1-list-orders-request.md delete mode 100644 doc/models/v1-list-orders-response.md delete mode 100644 doc/models/v1-money.md delete mode 100644 doc/models/v1-order-history-entry-action.md delete mode 100644 doc/models/v1-order-history-entry.md delete mode 100644 doc/models/v1-order-state.md delete mode 100644 doc/models/v1-order.md delete mode 100644 doc/models/v1-phone-number.md delete mode 100644 doc/models/v1-tender-card-brand.md delete mode 100644 doc/models/v1-tender-entry-method.md delete mode 100644 doc/models/v1-tender-type.md delete mode 100644 doc/models/v1-tender.md delete mode 100644 doc/models/v1-update-order-request-action.md delete mode 100644 doc/models/v1-update-order-request.md delete mode 100644 doc/models/vendor-contact.md delete mode 100644 doc/models/vendor-status.md delete mode 100644 doc/models/vendor.md delete mode 100644 doc/models/visibility-filter.md delete mode 100644 doc/models/void-transaction-response.md delete mode 100644 doc/models/wage-setting.md delete mode 100644 doc/models/webhook-subscription.md delete mode 100644 doc/models/weekday.md delete mode 100644 doc/models/workweek-config.md delete mode 100644 doc/utility-classes.md delete mode 100644 examples/customers.rb create mode 100644 lib/square/types/catalog_object.rb delete mode 100644 spec/user_journey_spec.rb diff --git a/.fernignore b/.fernignore index f63ee6578..b8128b521 100644 --- a/.fernignore +++ b/.fernignore @@ -2,9 +2,7 @@ lib/square_legacy/ lib/square_legacy.rb Gemfile Rakefile - -lib/square/types/catalog_object_category.rb -lib/square/types/catalog_object_subscription_plan.rb -lib/square/types/catalog_object_item_option.rb -lib/square/types/catalog_object_modifier_list.rb -lib/square/types/catalog_object_item.rb +.rubocop +square.gemspec +.gitignore +test/ \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 5c6efcd10..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve Square SDKs -title: '' -labels: '' -assignees: '' - ---- - -## **ATTENTION** -This issue template is for **bugs** or **documentation** errors in this SDK Repo. Please direct all technical support questions, feature requests, API-related issues, and general discussions to our Square-supported developer channels. For public support, [join us in our Square Developer Discord server](https://discord.com/invite/squaredev) or [post in our Developer Forums](https://developer.squareup.com/forums). For private support, [contact our Developer Success Engineers](https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68) directly. - -**Describe the bug** -A clear and concise description of what the bug is. - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**To Reproduce** -Steps to reproduce the bug: -1. (step 1) -2. (step 2) -3. (step 3) -4. ... - -**Screenshots** -If applicable, add screenshots to help explain the bug. - -**Square SDK version** -For example: 17.2.x - -**Additional context** -Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index f38eff76c..000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Square Developer Forums - url: https://developer.squareup.com/forums - about: Public discussion threads for technical support, feature requests, api discussion, and all things related to square development. - - name: Square Developer Discord Server - url: https://discord.com/invite/squaredev - about: Community slack channel for real time support and conversations about building with square. - - name: Developer Support - url: https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68 - about: Private support directly with Square Developer Success Engineers. diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 1d486d977..000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,21 +0,0 @@ - -# configuration settings for labeler - -version: v1 - -labels: - - label: "automerge" - sync: true - matcher: - title: "^Generated PR for Release:" - - - label: "automerge-author" - sync: true - matcher: - author: - - square-sdk-deployer - - - label: "automerge-branch" - sync: true - matcher: - branch: "^release" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 77bc5759f..000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,4 +0,0 @@ -# **ATTENTION** -This repository **cannot** accept Pull Requests. If you wish to proceed with opening this PR, please understand that your code **will not** be pulled into this repository. Consider opening an issue which lays out the problem instead. Thank you very much for your efforts and highlighting issues! - -Please direct all technical support questions, feature requests, API-related issues, and general discussions to our Square-supported developer channels. For public support, [join us in our Square Developer Discord server](https://discord.com/invite/squaredev) or [post in our Developer Forums](https://developer.squareup.com/forums). For private support, [contact our Developer Success Engineers](https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68) directly. diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 95dff15d4..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Publish - -on: [push] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 # Matches your requirement of >= 2.6 - bundler-cache: true - - - name: Install dependencies - run: bundle install - - - name: Run tests - env: - SQUARE_SANDBOX_TOKEN: ${{ secrets.SQUARE_SANDBOX_TOKEN }} - run: bundle exec rake test - - publish: - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - bundler-cache: true - - - name: Build and Push Gem - env: - GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} - run: | - gem build square.gemspec - - gem push square.rb-*.gem --host https://rubygems.org/ \ No newline at end of file diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml deleted file mode 100644 index 322f014b6..000000000 --- a/.github/workflows/ruby.yml +++ /dev/null @@ -1,65 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake -# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby - -name: Ruby - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - test: - env: - SQUARE_ENVIRONMENT: sandbox - SQUARE_SANDBOX_TOKEN: ${{ secrets.SQUARE_SANDBOX_TOKEN }} - - runs-on: ubuntu-latest - continue-on-error: ${{ matrix.experimental }} - strategy: - fail-fast: false - matrix: - ruby-version: ["2.7", "3.0", "3.1 "] - experimental: [false] - include: - - ruby-version: 3.2 - experimental: true - - ruby-version: ruby-head - experimental: true - - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby - # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, - # change this to (see https://github.com/ruby/setup-ruby#versioning): - # uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Run tests - run: bundle exec rake - - labeler: - needs: test - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-latest - steps: - - name: automerge-labeler - uses: fuxingloh/multi-labeler@v1 - - automerge: - needs: labeler - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-latest - steps: - - name: automerge - uses: "pascalgn/automerge-action@v0.14.2" - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - MERGE_LABELS: "automerge,automerge-branch,automerge-author" diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml new file mode 100644 index 000000000..c94bda74c --- /dev/null +++ b/.mock/definition/__package__.yml @@ -0,0 +1,34581 @@ +types: + AchDetails: + docs: >- + ACH-specific details about `BANK_ACCOUNT` type payments with the + `transfer_type` of `ACH`. + properties: + routing_number: + type: optional> + docs: The routing number for the bank account. + validation: + maxLength: 50 + account_number_suffix: + type: optional> + docs: The last few digits of the bank account number. + validation: + minLength: 1 + maxLength: 4 + account_type: + type: optional> + docs: >- + The type of the bank account performing the transfer. The account type + can be `CHECKING`, + + `SAVINGS`, or `UNKNOWN`. + validation: + maxLength: 50 + source: + openapi: openapi/openapi.json + AcceptDisputeResponse: + docs: Defines the fields in an `AcceptDispute` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + dispute: + type: optional + docs: Details about the accepted dispute. + source: + openapi: openapi/openapi.json + AcceptedPaymentMethods: + properties: + apple_pay: + type: optional> + docs: Whether Apple Pay is accepted at checkout. + google_pay: + type: optional> + docs: Whether Google Pay is accepted at checkout. + cash_app_pay: + type: optional> + docs: Whether Cash App Pay is accepted at checkout. + afterpay_clearpay: + type: optional> + docs: Whether Afterpay/Clearpay is accepted at checkout. + source: + openapi: openapi/openapi.json + AccumulateLoyaltyPointsResponse: + docs: >- + Represents an + [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) + response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + event: + type: optional + docs: >- + The resulting loyalty event. Starting in Square version 2022-08-17, + this field is no longer returned. + events: + type: optional> + docs: >- + The resulting loyalty events. If the purchase qualifies for points, + the `ACCUMULATE_POINTS` event + + is always included. When using the Orders API, the + `ACCUMULATE_PROMOTION_POINTS` event is included + + if the purchase also qualifies for a loyalty promotion. + source: + openapi: openapi/openapi.json + ActionCancelReason: + enum: + - BUYER_CANCELED + - SELLER_CANCELED + - TIMED_OUT + source: + openapi: openapi/openapi.json + ActivityType: + enum: + - ADJUSTMENT + - APP_FEE_REFUND + - APP_FEE_REVENUE + - AUTOMATIC_SAVINGS + - AUTOMATIC_SAVINGS_REVERSED + - CHARGE + - DEPOSIT_FEE + - DEPOSIT_FEE_REVERSED + - DISPUTE + - ESCHEATMENT + - FEE + - FREE_PROCESSING + - HOLD_ADJUSTMENT + - INITIAL_BALANCE_CHANGE + - MONEY_TRANSFER + - MONEY_TRANSFER_REVERSAL + - OPEN_DISPUTE + - OTHER + - OTHER_ADJUSTMENT + - PAID_SERVICE_FEE + - PAID_SERVICE_FEE_REFUND + - REDEMPTION_CODE + - REFUND + - RELEASE_ADJUSTMENT + - RESERVE_HOLD + - RESERVE_RELEASE + - RETURNED_PAYOUT + - SQUARE_CAPITAL_PAYMENT + - SQUARE_CAPITAL_REVERSED_PAYMENT + - SUBSCRIPTION_FEE + - SUBSCRIPTION_FEE_PAID_REFUND + - SUBSCRIPTION_FEE_REFUND + - TAX_ON_FEE + - THIRD_PARTY_FEE + - THIRD_PARTY_FEE_REFUND + - PAYOUT + - AUTOMATIC_BITCOIN_CONVERSIONS + - AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED + - CREDIT_CARD_REPAYMENT + - CREDIT_CARD_REPAYMENT_REVERSED + - LOCAL_OFFERS_CASHBACK + - LOCAL_OFFERS_FEE + - PERCENTAGE_PROCESSING_ENROLLMENT + - PERCENTAGE_PROCESSING_DEACTIVATION + - PERCENTAGE_PROCESSING_REPAYMENT + - PERCENTAGE_PROCESSING_REPAYMENT_REVERSED + - PROCESSING_FEE + - PROCESSING_FEE_REFUND + - UNDO_PROCESSING_FEE_REFUND + - GIFT_CARD_LOAD_FEE + - GIFT_CARD_LOAD_FEE_REFUND + - UNDO_GIFT_CARD_LOAD_FEE_REFUND + - BALANCE_FOLDERS_TRANSFER + - BALANCE_FOLDERS_TRANSFER_REVERSED + - GIFT_CARD_POOL_TRANSFER + - GIFT_CARD_POOL_TRANSFER_REVERSED + - SQUARE_PAYROLL_TRANSFER + - SQUARE_PAYROLL_TRANSFER_REVERSED + source: + openapi: openapi/openapi.json + AddGroupToCustomerResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [AddGroupToCustomer](api-endpoint:Customers-AddGroupToCustomer) endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + AdditionalRecipient: + docs: >- + Represents an additional recipient (other than the merchant) receiving a + portion of this tender. + properties: + location_id: + type: string + docs: >- + The location ID for a recipient (other than the merchant) receiving a + portion of this tender. + validation: + minLength: 1 + maxLength: 50 + description: + type: optional> + docs: The description of the additional recipient. + validation: + maxLength: 100 + amount_money: + type: Money + docs: The amount of money distributed to the recipient. + receivable_id: + type: optional> + docs: >- + The unique ID for the RETIRED `AdditionalRecipientReceivable` object. + This field should be empty for any `AdditionalRecipient` objects + created after the retirement. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + Address: + docs: >- + Represents a postal address in a country. + + For more information, see [Working with + Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + properties: + address_line_1: + type: optional> + docs: >- + The first line of the address. + + + Fields that start with `address_line` provide the address's most + specific + + details, like street number, street name, and building name. They do + *not* + + provide less specific details like city, state/province, or country + (these + + details are provided in other fields). + address_line_2: + type: optional> + docs: The second line of the address, if any. + address_line_3: + type: optional> + docs: The third line of the address, if any. + locality: + type: optional> + docs: >- + The city or town of the address. For a full list of field meanings by + country, see [Working with + Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + sublocality: + type: optional> + docs: A civil region within the address's `locality`, if any. + sublocality_2: + type: optional> + docs: A civil region within the address's `sublocality`, if any. + sublocality_3: + type: optional> + docs: A civil region within the address's `sublocality_2`, if any. + administrative_district_level_1: + type: optional> + docs: >- + A civil entity within the address's country. In the US, this + + is the state. For a full list of field meanings by country, see + [Working with + Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + administrative_district_level_2: + type: optional> + docs: |- + A civil entity within the address's `administrative_district_level_1`. + In the US, this is the county. + administrative_district_level_3: + type: optional> + docs: |- + A civil entity within the address's `administrative_district_level_2`, + if any. + postal_code: + type: optional> + docs: >- + The address's postal code. For a full list of field meanings by + country, see [Working with + Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + country: + type: optional + docs: >- + The address's country, in the two-letter format of ISO 3166. For + example, `US` or `FR`. + + See [Country](#type-country) for possible values + first_name: + type: optional> + docs: Optional first name when it's representing recipient. + last_name: + type: optional> + docs: Optional last name when it's representing recipient. + source: + openapi: openapi/openapi.json + AdjustLoyaltyPointsResponse: + docs: >- + Represents an + [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + event: + type: optional + docs: The resulting event data for the adjustment. + source: + openapi: openapi/openapi.json + AfterpayDetails: + docs: Additional details about Afterpay payments. + properties: + email_address: + type: optional> + docs: Email address on the buyer's Afterpay account. + validation: + maxLength: 255 + source: + openapi: openapi/openapi.json + ApplicationDetails: + docs: Details about the application that took the payment. + properties: + square_product: + type: optional + docs: >- + The Square product, such as Square Point of Sale (POS), + + Square Invoices, or Square Virtual Terminal. + + See [ExternalSquareProduct](#type-externalsquareproduct) for possible + values + application_id: + type: optional> + docs: >- + The Square ID assigned to the application used to take the payment. + + Application developers can use this information to identify payments + that + + their application processed. + + For example, if a developer uses a custom application to process + payments, + + this field contains the application ID from the Developer Dashboard. + + If a seller uses a [Square App + Marketplace](https://developer.squareup.com/docs/app-marketplace) + + application to process payments, the field contains the corresponding + application ID. + source: + openapi: openapi/openapi.json + ApplicationDetailsExternalSquareProduct: + enum: + - APPOINTMENTS + - ECOMMERCE_API + - INVOICES + - ONLINE_STORE + - OTHER + - RESTAURANTS + - RETAIL + - SQUARE_POS + - TERMINAL_API + - VIRTUAL_TERMINAL + docs: A list of products to return to external callers. + source: + openapi: openapi/openapi.json + ApplicationType: literal<"TERMINAL_API"> + AppointmentSegment: + docs: Defines an appointment segment of a booking. + properties: + duration_minutes: + type: optional> + docs: The time span in minutes of an appointment segment. + validation: + max: 1500 + service_variation_id: + type: optional> + docs: >- + The ID of the [CatalogItemVariation](entity:CatalogItemVariation) + object representing the service booked in this segment. + validation: + maxLength: 36 + team_member_id: + type: string + docs: >- + The ID of the [TeamMember](entity:TeamMember) object representing the + team member booked in this segment. + validation: + minLength: 1 + maxLength: 32 + service_variation_version: + type: optional> + docs: >- + The current version of the item variation representing the service + booked in this segment. + intermission_minutes: + type: optional + docs: >- + Time between the end of this segment and the beginning of the + subsequent segment. + access: read-only + any_team_member: + type: optional + docs: >- + Whether the customer accepts any team member, instead of a specific + one, to serve this segment. + access: read-only + resource_ids: + type: optional> + docs: >- + The IDs of the seller-accessible resources used for this appointment + segment. + access: read-only + source: + openapi: openapi/openapi.json + ArchivedState: + enum: + - ARCHIVED_STATE_NOT_ARCHIVED + - ARCHIVED_STATE_ARCHIVED + - ARCHIVED_STATE_ALL + docs: |- + Defines the values for the `archived_state` query expression + used in [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + to return the archived, not archived or either type of catalog items. + source: + openapi: openapi/openapi.json + Availability: + docs: >- + Defines an appointment slot that encapsulates the appointment segments, + location and starting time available for booking. + properties: + start_at: + type: optional> + docs: >- + The RFC 3339 timestamp specifying the beginning time of the slot + available for booking. + location_id: + type: optional + docs: The ID of the location available for booking. + validation: + maxLength: 32 + access: read-only + appointment_segments: + type: optional>> + docs: The list of appointment segments available for booking + source: + openapi: openapi/openapi.json + BankAccount: + docs: >- + Represents a bank account. For more information about + + linking a bank account to a Square account, see + + [Bank Accounts + API](https://developer.squareup.com/docs/bank-accounts-api). + properties: + id: + type: string + docs: The unique, Square-issued identifier for the bank account. + validation: + minLength: 1 + maxLength: 30 + account_number_suffix: + type: string + docs: The last few digits of the account number. + validation: + minLength: 1 + country: + type: Country + docs: |- + The ISO 3166 Alpha-2 country code where the bank account is based. + See [Country](#type-country) for possible values + currency: + type: Currency + docs: >- + The 3-character ISO 4217 currency code indicating the operating + + currency of the bank account. For example, the currency code for US + dollars + + is `USD`. + + See [Currency](#type-currency) for possible values + account_type: + type: BankAccountType + docs: |- + The financial purpose of the associated bank account. + See [BankAccountType](#type-bankaccounttype) for possible values + holder_name: + type: string + docs: |- + Name of the account holder. This name must match the name + on the targeted bank account record. + validation: + minLength: 1 + primary_bank_identification_number: + type: string + docs: >- + Primary identifier for the bank. For more information, see + + [Bank Accounts + API](https://developer.squareup.com/docs/bank-accounts-api). + validation: + maxLength: 40 + secondary_bank_identification_number: + type: optional> + docs: >- + Secondary identifier for the bank. For more information, see + + [Bank Accounts + API](https://developer.squareup.com/docs/bank-accounts-api). + validation: + maxLength: 40 + debit_mandate_reference_id: + type: optional> + docs: >- + Reference identifier that will be displayed to UK bank account owners + + when collecting direct debit authorization. Only required for UK bank + accounts. + reference_id: + type: optional> + docs: >- + Client-provided identifier for linking the banking account to an + entity + + in a third-party system (for example, a bank account number or a user + identifier). + location_id: + type: optional> + docs: The location to which the bank account belongs. + status: + type: BankAccountStatus + docs: |- + Read-only. The current verification status of this BankAccount object. + See [BankAccountStatus](#type-bankaccountstatus) for possible values + creditable: + type: boolean + docs: >- + Indicates whether it is possible for Square to send money to this bank + account. + debitable: + type: boolean + docs: |- + Indicates whether it is possible for Square to take money from this + bank account. + fingerprint: + type: optional> + docs: >- + A Square-assigned, unique identifier for the bank account based on the + + account information. The account fingerprint can be used to compare + account + + entries and determine if the they represent the same real-world bank + account. + version: + type: optional + docs: The current version of the `BankAccount`. + bank_name: + type: optional> + docs: |- + Read only. Name of actual financial institution. + For example "Bank of America". + validation: + maxLength: 100 + source: + openapi: openapi/openapi.json + BankAccountCreatedEvent: + docs: |- + Published when you link an external bank account to a Square + account in the Seller Dashboard. Square sets the initial status to + `VERIFICATION_IN_PROGRESS` and publishes the event. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"bank_account.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + BankAccountCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"bank_account"`. + id: + type: optional + docs: ID of the affected bank account. + object: + type: optional + docs: An object containing the created bank account. + source: + openapi: openapi/openapi.json + BankAccountCreatedEventObject: + properties: + bank_account: + type: optional + docs: The created bank account. + source: + openapi: openapi/openapi.json + BankAccountDisabledEvent: + docs: |- + Published when Square sets the status of a + [BankAccount](entity:BankAccount) to `DISABLED`. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"bank_account.disabled"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was disabled, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + BankAccountDisabledEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"bank_account"`. + id: + type: optional + docs: ID of the affected bank account. + object: + type: optional + docs: An object containing the disabled bank account. + source: + openapi: openapi/openapi.json + BankAccountDisabledEventObject: + properties: + bank_account: + type: optional + docs: The disabled bank account. + source: + openapi: openapi/openapi.json + BankAccountPaymentDetails: + docs: Additional details about BANK_ACCOUNT type payments. + properties: + bank_name: + type: optional> + docs: The name of the bank associated with the bank account. + validation: + maxLength: 100 + transfer_type: + type: optional> + docs: The type of the bank transfer. The type can be `ACH` or `UNKNOWN`. + validation: + maxLength: 50 + account_ownership_type: + type: optional> + docs: |- + The ownership type of the bank account performing the transfer. + The type can be `INDIVIDUAL`, `COMPANY`, or `ACCOUNT_TYPE_UNKNOWN`. + validation: + maxLength: 50 + fingerprint: + type: optional> + docs: |- + Uniquely identifies the bank account for this seller and can be used + to determine if payments are from the same bank account. + validation: + maxLength: 255 + country: + type: optional> + docs: >- + The two-letter ISO code representing the country the bank account is + located in. + validation: + minLength: 2 + maxLength: 2 + statement_description: + type: optional> + docs: The statement description as sent to the bank. + validation: + maxLength: 1000 + ach_details: + type: optional + docs: >- + ACH-specific information about the transfer. The information is only + populated + + if the `transfer_type` is `ACH`. + errors: + type: optional>> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + BankAccountStatus: + enum: + - VERIFICATION_IN_PROGRESS + - VERIFIED + - DISABLED + docs: Indicates the current verification status of a `BankAccount` object. + source: + openapi: openapi/openapi.json + BankAccountType: + enum: + - CHECKING + - SAVINGS + - INVESTMENT + - OTHER + - BUSINESS_CHECKING + docs: Indicates the financial purpose of the bank account. + source: + openapi: openapi/openapi.json + BankAccountVerifiedEvent: + docs: |- + Published when Square sets the status of a + [BankAccount](entity:BankAccount) to `VERIFIED`. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"bank_account.verified"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was verified, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + BankAccountVerifiedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"bank_account"`. + id: + type: optional + docs: ID of the affected bank account. + object: + type: optional + docs: An object containing the verified bank account. + source: + openapi: openapi/openapi.json + BankAccountVerifiedEventObject: + properties: + bank_account: + type: optional + docs: The verified bank account. + source: + openapi: openapi/openapi.json + BatchChangeInventoryRequest: + properties: + idempotency_key: + type: string + docs: >- + A client-supplied, universally unique identifier (UUID) for the + + request. + + + See + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + in the + + [API Development 101](https://developer.squareup.com/docs/buildbasics) + section for more + + information. + validation: + minLength: 1 + maxLength: 128 + changes: + type: optional>> + docs: >- + The set of physical counts and inventory adjustments to be made. + + Changes are applied based on the client-supplied timestamp and may be + sent + + out of order. + ignore_unchanged_counts: + type: optional> + docs: >- + Indicates whether the current physical count should be ignored if + + the quantity is unchanged since the last physical count. Default: + `true`. + source: + openapi: openapi/openapi.json + BatchChangeInventoryResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + counts: + type: optional> + docs: The current counts for all objects referenced in the request. + changes: + type: optional> + docs: Changes created for the request. + source: + openapi: openapi/openapi.json + BatchDeleteCatalogObjectsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + deleted_object_ids: + type: optional> + docs: The IDs of all CatalogObjects deleted by this request. + deleted_at: + type: optional + docs: >- + The database + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + of this deletion in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + source: + openapi: openapi/openapi.json + BatchGetCatalogObjectsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + objects: + type: optional> + docs: A list of [CatalogObject](entity:CatalogObject)s returned. + related_objects: + type: optional> + docs: >- + A list of [CatalogObject](entity:CatalogObject)s referenced by the + object in the `objects` field. + source: + openapi: openapi/openapi.json + BatchRetrieveInventoryChangesRequest: + properties: + catalog_object_ids: + type: optional>> + docs: |- + The filter to return results by `CatalogObject` ID. + The filter is only applicable when set. The default value is null. + location_ids: + type: optional>> + docs: |- + The filter to return results by `Location` ID. + The filter is only applicable when set. The default value is null. + types: + type: optional>> + docs: >- + The filter to return results by `InventoryChangeType` values other + than `TRANSFER`. + + The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. + states: + type: optional>> + docs: |- + The filter to return `ADJUSTMENT` query results by + `InventoryState`. This filter is only applied when set. + The default value is null. + updated_after: + type: optional> + docs: |- + The filter to return results with their `calculated_at` value + after the given time as specified in an RFC 3339 timestamp. + The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). + updated_before: + type: optional> + docs: >- + The filter to return results with their `created_at` or + `calculated_at` value + + strictly before the given time as specified in an RFC 3339 timestamp. + + The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for the original + query. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + limit: + type: optional> + docs: The number of [records](entity:InventoryChange) to return. + validation: + min: 1 + max: 1000 + source: + openapi: openapi/openapi.json + BatchGetInventoryChangesResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + changes: + type: optional> + docs: |- + The current calculated inventory changes for the requested objects + and locations. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + source: + openapi: openapi/openapi.json + BatchGetInventoryCountsRequest: + properties: + catalog_object_ids: + type: optional>> + docs: |- + The filter to return results by `CatalogObject` ID. + The filter is applicable only when set. The default is null. + location_ids: + type: optional>> + docs: |- + The filter to return results by `Location` ID. + This filter is applicable only when set. The default is null. + updated_after: + type: optional> + docs: |- + The filter to return results with their `calculated_at` value + after the given time as specified in an RFC 3339 timestamp. + The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for the original + query. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + states: + type: optional>> + docs: >- + The filter to return results by `InventoryState`. The filter is only + applicable when set. + + Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`. + + The default is null. + limit: + type: optional> + docs: The number of [records](entity:InventoryCount) to return. + validation: + min: 1 + max: 1000 + source: + openapi: openapi/openapi.json + BatchGetInventoryCountsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + counts: + type: optional> + docs: |- + The current calculated inventory counts for the requested objects + and locations. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + source: + openapi: openapi/openapi.json + BatchGetOrdersResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `BatchRetrieveOrders` endpoint. + properties: + orders: + type: optional> + docs: >- + The requested orders. This will omit any requested orders that do not + exist. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchUpsertCatalogObjectsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + objects: + type: optional> + docs: The created successfully created CatalogObjects. + updated_at: + type: optional + docs: >- + The database + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + of this update in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + id_mappings: + type: optional> + docs: The mapping between client and server IDs for this upsert. + source: + openapi: openapi/openapi.json + Booking: + docs: >- + Represents a booking as a time-bound service contract for a seller's staff + member to provide a specified service + + at a given location to a requesting customer in one or more appointment + segments. + properties: + id: + type: optional + docs: A unique ID of this object representing a booking. + validation: + maxLength: 36 + access: read-only + version: + type: optional + docs: The revision number for the booking used for optimistic concurrency. + status: + type: optional + docs: >- + The status of the booking, describing where the booking stands with + respect to the booking state machine. + + See [BookingStatus](#type-bookingstatus) for possible values + created_at: + type: optional + docs: The RFC 3339 timestamp specifying the creation time of this booking. + access: read-only + updated_at: + type: optional + docs: >- + The RFC 3339 timestamp specifying the most recent update time of this + booking. + access: read-only + start_at: + type: optional> + docs: The RFC 3339 timestamp specifying the starting time of this booking. + location_id: + type: optional> + docs: >- + The ID of the [Location](entity:Location) object representing the + location where the booked service is provided. Once set when the + booking is created, its value cannot be changed. + validation: + maxLength: 32 + customer_id: + type: optional> + docs: >- + The ID of the [Customer](entity:Customer) object representing the + customer receiving the booked service. + validation: + maxLength: 192 + customer_note: + type: optional> + docs: >- + The free-text field for the customer to supply notes about the + booking. For example, the note can be preferences that cannot be + expressed by supported attributes of a relevant + [CatalogObject](entity:CatalogObject) instance. + validation: + maxLength: 4096 + seller_note: + type: optional> + docs: >- + The free-text field for the seller to supply notes about the booking. + For example, the note can be preferences that cannot be expressed by + supported attributes of a specific + [CatalogObject](entity:CatalogObject) instance. + + This field should not be visible to customers. + validation: + maxLength: 4096 + appointment_segments: + type: optional>> + docs: A list of appointment segments for this booking. + transition_time_minutes: + type: optional + docs: >- + Additional time at the end of a booking. + + Applications should not make this field visible to customers of a + seller. + access: read-only + all_day: + type: optional + docs: Whether the booking is of a full business day. + access: read-only + location_type: + type: optional + docs: >- + The type of location where the booking is held. + + See + [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) + for possible values + creator_details: + type: optional + docs: Information about the booking creator. + source: + type: optional + docs: >- + The source of the booking. + + Access to this field requires seller-level permissions. + + See [BookingBookingSource](#type-bookingbookingsource) for possible + values + address: + type: optional
+ docs: Stores a customer address if the location type is `CUSTOMER_LOCATION`. + source: + openapi: openapi/openapi.json + BookingBookingSource: + enum: + - FIRST_PARTY_MERCHANT + - FIRST_PARTY_BUYER + - THIRD_PARTY_BUYER + - API + docs: Supported sources a booking was created from. + source: + openapi: openapi/openapi.json + BookingCreatedEvent: + docs: >- + Published when a booking is created. + + + To receive this event with buyer-level permissions, you must have + `APPOINTMENTS_READ` set for the OAuth scope. + + To receive this event with seller-level permissions, you must have + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"booking.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + BookingCreatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"booking"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the created booking. + source: + openapi: openapi/openapi.json + BookingCreatedEventObject: + properties: + booking: + type: optional + docs: The created booking. + source: + openapi: openapi/openapi.json + BookingCreatorDetails: + docs: Information about a booking creator. + properties: + creator_type: + type: optional + docs: >- + The seller-accessible type of the creator of the booking. + + See + [BookingCreatorDetailsCreatorType](#type-bookingcreatordetailscreatortype) + for possible values + team_member_id: + type: optional + docs: >- + The ID of the team member who created the booking, when the booking + creator is of the `TEAM_MEMBER` type. + + Access to this field requires seller-level permissions. + validation: + maxLength: 32 + access: read-only + customer_id: + type: optional + docs: >- + The ID of the customer who created the booking, when the booking + creator is of the `CUSTOMER` type. + + Access to this field requires seller-level permissions. + validation: + maxLength: 192 + access: read-only + source: + openapi: openapi/openapi.json + BookingCreatorDetailsCreatorType: + enum: + - TEAM_MEMBER + - CUSTOMER + docs: Supported types of a booking creator. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionOwnedCreatedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + is created by the subscribing application. Subscribe to this event to be + notified + + when your application creates a booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.owned.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionOwnedDeletedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + is deleted by the subscribing application. Subscribe to this event to be + notified + + when your application deletes a booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionOwnedUpdatedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + is updated by the subscribing application. Subscribe to this event to be + notified + + when your application updates a booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionVisibleCreatedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + with the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is created. + + An application that subscribes to this event is notified when a booking + custom attribute definition is created + + by any application for which the subscribing application has read access + to the booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.visible.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionVisibleDeletedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + with the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is deleted. + + An application that subscribes to this event is notified when a booking + custom attribute definition is deleted + + by any application for which the subscribing application has read access + to the booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionVisibleUpdatedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + with the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is updated. + + An application that subscribes to this event is notified when a booking + custom attribute definition is updated + + by any application for which the subscribing application has read access + to the booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDeleteRequest: + docs: >- + Represents an individual delete request in a + [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) + + request. An individual request contains a booking ID, the custom attribute + to delete, and an optional idempotency key. + properties: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + validation: + minLength: 1 + maxLength: 36 + key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match the + `key` of a + + custom attribute definition in the Square seller account. If the + requesting application is not + + the definition owner, you must use the qualified key. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + BookingCustomAttributeDeleteResponse: + docs: >- + Represents a response for an individual upsert request in a + [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) + operation. + properties: + booking_id: + type: optional + docs: >- + The ID of the [booking](entity:Booking) associated with the custom + attribute. + errors: + type: optional> + docs: Any errors that occurred while processing the individual request. + source: + openapi: openapi/openapi.json + BookingCustomAttributeOwnedDeletedEvent: + docs: >- + Published when a booking [custom attribute](entity:CustomAttribute) + + associated with a [custom attribute + definition](entity:CustomAttributeDefinition) that is + + owned by the subscribing application is deleted. + + Subscribe to this event to be notified + + when your application deletes a booking custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeOwnedUpdatedEvent: + docs: >- + Published when a booking [custom attribute](entity:CustomAttribute) + + is updated by the subscribing application. Subscribe to this event to be + notified + + when your application updates a booking custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeUpsertRequest: + docs: >- + Represents an individual upsert request in a + [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) + + request. An individual request contains a booking ID, the custom attribute + to create or update, + + and an optional idempotency key. + properties: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + validation: + minLength: 1 + maxLength: 36 + custom_attribute: + type: CustomAttribute + docs: >- + The custom attribute to create or update, with following fields: + + + - `key`. This key must match the `key` of a custom attribute + definition in the Square seller + + account. If the requesting application is not the definition owner, + you must provide the qualified key. + + + - `value`. This value must conform to the `schema` specified by the + definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for update operations, include this optional field in the + request and set the + + value to the current version of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this individual upsert request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + source: + openapi: openapi/openapi.json + BookingCustomAttributeUpsertResponse: + docs: >- + Represents a response for an individual upsert request in a + [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) + operation. + properties: + booking_id: + type: optional + docs: >- + The ID of the [booking](entity:Booking) associated with the custom + attribute. + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred while processing the individual request. + source: + openapi: openapi/openapi.json + BookingCustomAttributeVisibleDeletedEvent: + docs: >- + Published when a booking [custom attribute](entity:CustomAttribute) with + + the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is deleted. + + An application that subscribes to this event is notified when a booking + custom attribute is deleted + + by any application for which the subscribing application has read access + to the booking custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeVisibleUpdatedEvent: + docs: >- + Published when a booking [custom attribute](entity:CustomAttribute) + + with the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is updated. + + An application that subscribes to this event is notified when a booking + custom attribute is updated + + by any application for which the subscribing application has read access + to the booking custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingStatus: + enum: + - PENDING + - CANCELLED_BY_CUSTOMER + - CANCELLED_BY_SELLER + - DECLINED + - ACCEPTED + - NO_SHOW + docs: Supported booking statuses. + source: + openapi: openapi/openapi.json + BookingUpdatedEvent: + docs: >- + Published when a booking is updated or cancelled. + + + To receive this event with buyer-level permissions, you must have + `APPOINTMENTS_READ` set for the OAuth scope. + + To receive this event with seller-level permissions, you must have + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"booking.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + BookingUpdatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"booking"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the updated booking. + source: + openapi: openapi/openapi.json + BookingUpdatedEventObject: + properties: + booking: + type: optional + docs: The updated booking. + source: + openapi: openapi/openapi.json + Break: + docs: A record of a team member's break on a [timecard](entity:Timecard). + properties: + id: + type: optional + docs: The UUID for this object. + start_at: + type: string + docs: >- + RFC 3339; follows the same timezone information as the + [timecard](entity:Timecard). Precision up to + + the minute is respected; seconds are truncated. + validation: + minLength: 1 + end_at: + type: optional> + docs: >- + RFC 3339; follows the same timezone information as the + [timecard](entity:Timecard). Precision up to + + the minute is respected; seconds are truncated. + break_type_id: + type: string + docs: The [BreakType](entity:BreakType) that this break was templated on. + validation: + minLength: 1 + name: + type: string + docs: A human-readable name. + validation: + minLength: 1 + expected_duration: + type: string + docs: |- + Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of + the break. + + Example for break expected duration of 15 minutes: PT15M + validation: + minLength: 1 + is_paid: + type: boolean + docs: |- + Whether this break counts towards time worked for compensation + purposes. + source: + openapi: openapi/openapi.json + BreakType: + docs: >- + A template for a type of [break](entity:Break) that can be added to a + + [timecard](entity:Timecard), including the expected duration and paid + status. + properties: + id: + type: optional + docs: The UUID for this object. + validation: + maxLength: 255 + location_id: + type: string + docs: The ID of the business location this type of break applies to. + validation: + minLength: 1 + break_name: + type: string + docs: |- + A human-readable name for this type of break. The name is displayed to + team members in Square products. + validation: + minLength: 1 + expected_duration: + type: string + docs: |- + Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of + this break. Precision less than minutes is truncated. + + Example for break expected duration of 15 minutes: PT15M + validation: + minLength: 1 + is_paid: + type: boolean + docs: |- + Whether this break counts towards time worked for compensation + purposes. + version: + type: optional + docs: >- + Used for resolving concurrency issues. The request fails if the + version + + provided does not match the server version at the time of the request. + If a value is not + + provided, Square's servers execute a "blind" write; potentially + + overwriting another writer's data. + created_at: + type: optional + docs: A read-only timestamp in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: A read-only timestamp in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + BulkCreateCustomerData: + docs: >- + Defines the customer data provided in individual create requests for a + + [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) + operation. + properties: + given_name: + type: optional> + docs: >- + The given name (that is, the first name) associated with the customer + profile. + validation: + maxLength: 300 + family_name: + type: optional> + docs: >- + The family name (that is, the last name) associated with the customer + profile. + validation: + maxLength: 300 + company_name: + type: optional> + docs: A business name associated with the customer profile. + validation: + maxLength: 500 + nickname: + type: optional> + docs: A nickname for the customer profile. + validation: + maxLength: 100 + email_address: + type: optional> + docs: The email address associated with the customer profile. + validation: + maxLength: 254 + address: + type: optional
+ docs: >- + The physical address associated with the customer profile. For maximum + length constraints, + + see [Customer + addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address). + + The `first_name` and `last_name` fields are ignored if they are + present in the request. + phone_number: + type: optional> + docs: >- + The phone number associated with the customer profile. The phone + number must be valid + + and can contain 9–16 digits, with an optional `+` prefix and country + code. For more information, + + see [Customer phone + numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + reference_id: + type: optional> + docs: |- + An optional second ID used to associate the customer profile with an + entity in another system. + validation: + maxLength: 100 + note: + type: optional> + docs: A custom note associated with the customer profile. + birthday: + type: optional> + docs: >- + The birthday associated with the customer profile, in `YYYY-MM-DD` or + `MM-DD` format. + + For example, specify `1998-09-21` for September 21, 1998, or `09-21` + for September 21. + + Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the + specified birth year or + + `0000` if a birth year is not specified. + tax_ids: + type: optional + docs: >- + The tax ID associated with the customer profile. This field is + available only for + + customers of sellers in EU countries or the United Kingdom. For more + information, see + + [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + source: + openapi: openapi/openapi.json + BulkCreateCustomersResponse: + docs: >- + Defines the fields included in the response body from the + + [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) + endpoint. + properties: + responses: + type: optional> + docs: >- + A map of responses that correspond to individual create requests, + represented by + + key-value pairs. + + + Each key is the idempotency key that was provided for a create request + and each value + + is the corresponding response. + + If the request succeeds, the value is the new customer profile. + + If the request fails, the value contains any errors that occurred + during the request. + errors: + type: optional> + docs: Any top-level errors that prevented the bulk operation from running. + source: + openapi: openapi/openapi.json + BatchCreateTeamMembersResponse: + docs: >- + Represents a response from a bulk create request containing the created + `TeamMember` objects or error messages. + properties: + team_members: + type: optional> + docs: >- + The successfully created `TeamMember` objects. Each key is the + `idempotency_key` that maps to the `CreateTeamMemberRequest`. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchCreateVendorsResponse: + docs: >- + Represents an output from a call to + [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + responses: + type: optional> + docs: >- + A set of [CreateVendorResponse](entity:CreateVendorResponse) objects + encapsulating successfully created [Vendor](entity:Vendor) + + objects or error responses for failed attempts. The set is represented + by + + a collection of idempotency-key/`Vendor`-object or + idempotency-key/error-object pairs. The idempotency keys correspond to + those specified + + in the input. + source: + openapi: openapi/openapi.json + BulkDeleteBookingCustomAttributesResponse: + docs: >- + Represents a + [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + delete request. + properties: + values: + type: optional> + docs: >- + A map of responses that correspond to individual delete requests. Each + response has the + + same ID as the corresponding request and contains `booking_id` and + `errors` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkDeleteCustomersResponse: + docs: >- + Defines the fields included in the response body from the + + [BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) + endpoint. + properties: + responses: + type: optional> + docs: >- + A map of responses that correspond to individual delete requests, + represented by + + key-value pairs. + + + Each key is the customer ID that was specified for a delete request + and each value + + is the corresponding response. + + If the request succeeds, the value is an empty object (`{ }`). + + If the request fails, the value contains any errors that occurred + during the request. + errors: + type: optional> + docs: Any top-level errors that prevented the bulk operation from running. + source: + openapi: openapi/openapi.json + BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest: + docs: >- + Represents an individual delete request in a + [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) + + request. An individual request contains an optional ID of the associated + custom attribute definition + + and optional key of the associated custom attribute definition. + properties: + key: + type: optional + docs: >- + The key of the associated custom attribute definition. + + Represented as a qualified key if the requesting app is not the + definition owner. + validation: + pattern: ^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$ + access: read-only + source: + openapi: openapi/openapi.json + BulkDeleteLocationCustomAttributesResponse: + docs: >- + Represents a + [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + delete request. + properties: + values: + type: >- + map + docs: >- + A map of responses that correspond to individual delete requests. Each + response has the + + same key as the corresponding request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse: + docs: >- + Represents an individual delete response in a + [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) + + request. + properties: + location_id: + type: optional + docs: The ID of the location associated with the custom attribute. + errors: + type: optional> + docs: >- + Errors that occurred while processing the individual + LocationCustomAttributeDeleteRequest request + source: + openapi: openapi/openapi.json + BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest: + docs: >- + Represents an individual delete request in a + [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) + + request. An individual request contains an optional ID of the associated + custom attribute definition + + and optional key of the associated custom attribute definition. + properties: + key: + type: optional + docs: >- + The key of the associated custom attribute definition. + + Represented as a qualified key if the requesting app is not the + definition owner. + validation: + pattern: ^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$ + access: read-only + source: + openapi: openapi/openapi.json + BulkDeleteMerchantCustomAttributesResponse: + docs: >- + Represents a + [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + delete request. + properties: + values: + type: >- + map + docs: >- + A map of responses that correspond to individual delete requests. Each + response has the + + same key as the corresponding request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse: + docs: >- + Represents an individual delete response in a + [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) + + request. + properties: + errors: + type: optional> + docs: >- + Errors that occurred while processing the individual + MerchantCustomAttributeDeleteRequest request + source: + openapi: openapi/openapi.json + BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute: + docs: Represents one delete within the bulk operation. + properties: + key: + type: optional + docs: >- + The key of the custom attribute to delete. This key must match the + key + + of an existing custom attribute definition. + validation: + pattern: ^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$ + minLength: 1 + access: read-only + order_id: + type: string + docs: The ID of the target [order](entity:Order). + validation: + minLength: 1 + maxLength: 255 + source: + openapi: openapi/openapi.json + BulkDeleteOrderCustomAttributesResponse: + docs: Represents a response from deleting one or more order custom attributes. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + values: + type: map + docs: >2- + A map of responses that correspond to individual delete requests. Each response has the same ID + as the corresponding request and contains either a `custom_attribute` + or an `errors` field. + source: + openapi: openapi/openapi.json + BulkPublishScheduledShiftsData: + docs: >- + Represents options for an individual publish request in a + + [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) + + operation, provided as the value in a key-value pair. + properties: + version: + type: optional + docs: >- + The current version of the scheduled shift, used to enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control. If the provided version doesn't match the server version, the + request fails. + + If omitted, Square executes a blind write, potentially overwriting + data from another publish request. + source: + openapi: openapi/openapi.json + BulkPublishScheduledShiftsResponse: + docs: >- + Represents a + [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) + response. + + Either `scheduled_shifts` or `errors` is present in the response. + properties: + responses: + type: optional> + docs: >- + A map of key-value pairs that represent responses for individual + publish requests. + + The order of responses might differ from the order in which the + requests were provided. + + + - Each key is the scheduled shift ID that was specified for a publish + request. + + - Each value is the corresponding response. If the request succeeds, + the value is the + + published scheduled shift. If the request fails, the value is an + `errors` array containing + + any errors that occurred while processing the request. + errors: + type: optional> + docs: >- + Any top-level errors that prevented the bulk operation from + succeeding. + source: + openapi: openapi/openapi.json + BulkRetrieveBookingsResponse: + docs: Response payload for bulk retrieval of bookings. + properties: + bookings: + type: optional> + docs: >- + Requested bookings returned as a map containing `booking_id` as the + key and `RetrieveBookingResponse` as the value. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkRetrieveCustomersResponse: + docs: >- + Defines the fields included in the response body from the + + [BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) + endpoint. + properties: + responses: + type: optional> + docs: >- + A map of responses that correspond to individual retrieve requests, + represented by + + key-value pairs. + + + Each key is the customer ID that was specified for a retrieve request + and each value + + is the corresponding response. + + If the request succeeds, the value is the requested customer profile. + + If the request fails, the value contains any errors that occurred + during the request. + errors: + type: optional> + docs: Any top-level errors that prevented the bulk operation from running. + source: + openapi: openapi/openapi.json + BulkRetrieveTeamMemberBookingProfilesResponse: + docs: >- + Response payload for the + [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) + endpoint. + properties: + team_member_booking_profiles: + type: optional> + docs: >- + The returned team members' booking profiles, as a map with + `team_member_id` as the key and + [TeamMemberBookingProfile](entity:TeamMemberBookingProfile) the value. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchGetVendorsResponse: + docs: >- + Represents an output from a call to + [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + responses: + type: optional> + docs: >- + The set of [RetrieveVendorResponse](entity:RetrieveVendorResponse) + objects encapsulating successfully retrieved [Vendor](entity:Vendor) + + objects or error responses for failed attempts. The set is represented + by + + a collection of `Vendor`-ID/`Vendor`-object or + `Vendor`-ID/error-object pairs. + source: + openapi: openapi/openapi.json + BulkSwapPlanResponse: + docs: |- + Defines output parameters in a response of the + [BulkSwapPlan](api-endpoint:Subscriptions-BulkSwapPlan) endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + affected_subscriptions: + type: optional + docs: The number of affected subscriptions. + source: + openapi: openapi/openapi.json + BulkUpdateCustomerData: + docs: >- + Defines the customer data provided in individual update requests for a + + [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) + operation. + properties: + given_name: + type: optional> + docs: >- + The given name (that is, the first name) associated with the customer + profile. + validation: + maxLength: 300 + family_name: + type: optional> + docs: >- + The family name (that is, the last name) associated with the customer + profile. + validation: + maxLength: 300 + company_name: + type: optional> + docs: A business name associated with the customer profile. + validation: + maxLength: 500 + nickname: + type: optional> + docs: A nickname for the customer profile. + validation: + maxLength: 100 + email_address: + type: optional> + docs: The email address associated with the customer profile. + validation: + maxLength: 254 + address: + type: optional
+ docs: >- + The physical address associated with the customer profile. For maximum + length constraints, + + see [Customer + addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address). + + The `first_name` and `last_name` fields are ignored if they are + present in the request. + phone_number: + type: optional> + docs: >- + The phone number associated with the customer profile. The phone + number must be valid + + and can contain 9–16 digits, with an optional `+` prefix and country + code. For more information, + + see [Customer phone + numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + reference_id: + type: optional> + docs: |- + An optional second ID used to associate the customer profile with an + entity in another system. + validation: + maxLength: 100 + note: + type: optional> + docs: An custom note associates with the customer profile. + birthday: + type: optional> + docs: >- + The birthday associated with the customer profile, in `YYYY-MM-DD` or + `MM-DD` format. + + For example, specify `1998-09-21` for September 21, 1998, or `09-21` + for September 21. + + Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the + specified birth year or + + `0000` if a birth year is not specified. + tax_ids: + type: optional + docs: >- + The tax ID associated with the customer profile. This field is + available only for + + customers of sellers in EU countries or the United Kingdom. For more + information, see + + [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + version: + type: optional + docs: >- + The current version of the customer profile. + + + As a best practice, you should include this field to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control. + source: + openapi: openapi/openapi.json + BulkUpdateCustomersResponse: + docs: >- + Defines the fields included in the response body from the + + [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) + endpoint. + properties: + responses: + type: optional> + docs: >- + A map of responses that correspond to individual update requests, + represented by + + key-value pairs. + + + Each key is the customer ID that was specified for an update request + and each value + + is the corresponding response. + + If the request succeeds, the value is the updated customer profile. + + If the request fails, the value contains any errors that occurred + during the request. + errors: + type: optional> + docs: Any top-level errors that prevented the bulk operation from running. + source: + openapi: openapi/openapi.json + BatchUpdateTeamMembersResponse: + docs: >- + Represents a response from a bulk update request containing the updated + `TeamMember` objects or error messages. + properties: + team_members: + type: optional> + docs: >- + The successfully updated `TeamMember` objects. Each key is the + `team_member_id` that maps to the `UpdateTeamMemberRequest`. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchUpdateVendorsResponse: + docs: >- + Represents an output from a call to + [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors). + properties: + errors: + type: optional> + docs: Errors encountered when the request fails. + responses: + type: optional> + docs: >- + A set of [UpdateVendorResponse](entity:UpdateVendorResponse) objects + encapsulating successfully created [Vendor](entity:Vendor) + + objects or error responses for failed attempts. The set is represented + by a collection of `Vendor`-ID/`UpdateVendorResponse`-object or + + `Vendor`-ID/error-object pairs. + source: + openapi: openapi/openapi.json + BulkUpsertBookingCustomAttributesResponse: + docs: >- + Represents a + [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + upsert request. + properties: + values: + type: optional> + docs: >- + A map of responses that correspond to individual upsert requests. Each + response has the + + same ID as the corresponding request and contains either a + `booking_id` and `custom_attribute` or an `errors` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest: + docs: >- + Represents an individual upsert request in a + [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + + request. An individual request contains a customer ID, the custom + attribute to create or update, + + and an optional idempotency key. + properties: + customer_id: + type: string + docs: The ID of the target [customer profile](entity:Customer). + validation: + minLength: 1 + custom_attribute: + type: CustomAttribute + docs: >- + The custom attribute to create or update, with following fields: + + + - `key`. This key must match the `key` of a custom attribute + definition in the Square seller + + account. If the requesting application is not the definition owner, + you must provide the qualified key. + + + - `value`. This value must conform to the `schema` specified by the + definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for update operations, include this optional field in the + request and set the + + value to the current version of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this individual upsert request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + source: + openapi: openapi/openapi.json + BatchUpsertCustomerCustomAttributesResponse: + docs: >- + Represents a + [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + upsert request. + properties: + values: + type: >- + optional> + docs: >- + A map of responses that correspond to individual upsert requests. Each + response has the + + same ID as the corresponding request and contains either a + `customer_id` and `custom_attribute` or an `errors` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse: + docs: >- + Represents a response for an individual upsert request in a + [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + operation. + properties: + customer_id: + type: optional + docs: The ID of the customer profile associated with the custom attribute. + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred while processing the individual request. + source: + openapi: openapi/openapi.json + BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest: + docs: >- + Represents an individual upsert request in a + [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + + request. An individual request contains a location ID, the custom + attribute to create or update, + + and an optional idempotency key. + properties: + location_id: + type: string + docs: The ID of the target [location](entity:Location). + validation: + minLength: 1 + custom_attribute: + type: CustomAttribute + docs: >- + The custom attribute to create or update, with following fields: + + - `key`. This key must match the `key` of a custom attribute + definition in the Square seller + + account. If the requesting application is not the definition owner, + you must provide the qualified key. + + - `value`. This value must conform to the `schema` specified by the + definition. + + For more information, see [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).. + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, specify the current version of the custom attribute. + + If this is not important for your application, `version` can be set to + -1. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this individual upsert request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + source: + openapi: openapi/openapi.json + BulkUpsertLocationCustomAttributesResponse: + docs: >- + Represents a + [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + upsert request. + properties: + values: + type: >- + optional> + docs: >- + A map of responses that correspond to individual upsert requests. Each + response has the + + same ID as the corresponding request and contains either a + `location_id` and `custom_attribute` or an `errors` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse: + docs: >- + Represents a response for an individual upsert request in a + [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + operation. + properties: + location_id: + type: optional + docs: The ID of the location associated with the custom attribute. + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred while processing the individual request. + source: + openapi: openapi/openapi.json + BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest: + docs: >- + Represents an individual upsert request in a + [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + + request. An individual request contains a merchant ID, the custom + attribute to create or update, + + and an optional idempotency key. + properties: + merchant_id: + type: string + docs: The ID of the target [merchant](entity:Merchant). + validation: + minLength: 1 + custom_attribute: + type: CustomAttribute + docs: >- + The custom attribute to create or update, with following fields: + + - `key`. This key must match the `key` of a custom attribute + definition in the Square seller + + account. If the requesting application is not the definition owner, + you must provide the qualified key. + + - `value`. This value must conform to the `schema` specified by the + definition. + + For more information, see [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). + + - The version field must match the current version of the custom + attribute definition to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + If this is not important for your application, version can be set to + -1. For any other values, the request fails with a BAD_REQUEST error. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this individual upsert request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + source: + openapi: openapi/openapi.json + BulkUpsertMerchantCustomAttributesResponse: + docs: >- + Represents a + [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + upsert request. + properties: + values: + type: >- + optional> + docs: >- + A map of responses that correspond to individual upsert requests. Each + response has the + + same ID as the corresponding request and contains either a + `merchant_id` and `custom_attribute` or an `errors` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse: + docs: >- + Represents a response for an individual upsert request in a + [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + operation. + properties: + merchant_id: + type: optional + docs: The ID of the merchant associated with the custom attribute. + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred while processing the individual request. + source: + openapi: openapi/openapi.json + BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute: + docs: Represents one upsert within the bulk operation. + properties: + custom_attribute: + type: CustomAttribute + docs: >- + The custom attribute to create or update, with the following fields: + + + - `value`. This value must conform to the `schema` specified by the + definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include this optional field and specify the current version + of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + order_id: + type: string + docs: The ID of the target [order](entity:Order). + validation: + minLength: 1 + maxLength: 255 + source: + openapi: openapi/openapi.json + BulkUpsertOrderCustomAttributesResponse: + docs: Represents a response from a bulk upsert of order custom attributes. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + values: + type: map + docs: ' A map of responses that correspond to individual upsert operations for custom attributes.' + source: + openapi: openapi/openapi.json + BusinessAppointmentSettings: + docs: >- + The service appointment settings, including where and how the service is + provided. + properties: + location_types: + type: >- + optional>> + docs: >- + Types of the location allowed for bookings. + + See + [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) + for possible values + alignment_time: + type: optional + docs: >- + The time unit of the service duration for bookings. + + See + [BusinessAppointmentSettingsAlignmentTime](#type-businessappointmentsettingsalignmenttime) + for possible values + min_booking_lead_time_seconds: + type: optional> + docs: >- + The minimum lead time in seconds before a service can be booked. A + booking must be created at least this amount of time before its + starting time. + max_booking_lead_time_seconds: + type: optional> + docs: >- + The maximum lead time in seconds before a service can be booked. A + booking must be created at most this amount of time before its + starting time. + any_team_member_booking_enabled: + type: optional> + docs: >- + Indicates whether a customer can choose from all available time slots + and have a staff member assigned + + automatically (`true`) or not (`false`). + multiple_service_booking_enabled: + type: optional> + docs: >- + Indicates whether a customer can book multiple services in a single + online booking. + max_appointments_per_day_limit_type: + type: optional + docs: >- + Indicates whether the daily appointment limit applies to team members + or to + + business locations. + + See + [BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType](#type-businessappointmentsettingsmaxappointmentsperdaylimittype) + for possible values + max_appointments_per_day_limit: + type: optional> + docs: >- + The maximum number of daily appointments per team member or per + location. + cancellation_window_seconds: + type: optional> + docs: >- + The cut-off time in seconds for allowing clients to cancel or + reschedule an appointment. + cancellation_fee_money: + type: optional + docs: The flat-fee amount charged for a no-show booking. + cancellation_policy: + type: optional + docs: >- + The cancellation policy adopted by the seller. + + See + [BusinessAppointmentSettingsCancellationPolicy](#type-businessappointmentsettingscancellationpolicy) + for possible values + cancellation_policy_text: + type: optional> + docs: The free-form text of the seller's cancellation policy. + validation: + maxLength: 65536 + skip_booking_flow_staff_selection: + type: optional> + docs: >- + Indicates whether customers has an assigned staff member (`true`) or + can select s staff member of their choice (`false`). + source: + openapi: openapi/openapi.json + BusinessAppointmentSettingsAlignmentTime: + enum: + - SERVICE_DURATION + - QUARTER_HOURLY + - HALF_HOURLY + - HOURLY + docs: Time units of a service duration for bookings. + source: + openapi: openapi/openapi.json + BusinessAppointmentSettingsBookingLocationType: + enum: + - BUSINESS_LOCATION + - CUSTOMER_LOCATION + - PHONE + docs: Supported types of location where service is provided. + source: + openapi: openapi/openapi.json + BusinessAppointmentSettingsCancellationPolicy: + enum: + - CANCELLATION_TREATED_AS_NO_SHOW + - CUSTOM_POLICY + docs: The category of the seller’s cancellation policy. + source: + openapi: openapi/openapi.json + BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType: + enum: + - PER_TEAM_MEMBER + - PER_LOCATION + docs: Types of daily appointment limits. + source: + openapi: openapi/openapi.json + BusinessBookingProfile: + docs: >- + A seller's business booking profile, including booking policy, appointment + settings, etc. + properties: + seller_id: + type: optional> + docs: The ID of the seller, obtainable using the Merchants API. + validation: + maxLength: 32 + created_at: + type: optional + docs: The RFC 3339 timestamp specifying the booking's creation time. + access: read-only + booking_enabled: + type: optional> + docs: Indicates whether the seller is open for booking. + customer_timezone_choice: + type: optional + docs: >- + The choice of customer's time zone information of a booking. + + The Square online booking site and all notifications to customers uses + either the seller location’s time zone + + or the time zone the customer chooses at booking. + + See + [BusinessBookingProfileCustomerTimezoneChoice](#type-businessbookingprofilecustomertimezonechoice) + for possible values + booking_policy: + type: optional + docs: >- + The policy for the seller to automatically accept booking requests + (`ACCEPT_ALL`) or not (`REQUIRES_ACCEPTANCE`). + + See + [BusinessBookingProfileBookingPolicy](#type-businessbookingprofilebookingpolicy) + for possible values + allow_user_cancel: + type: optional> + docs: >- + Indicates whether customers can cancel or reschedule their own + bookings (`true`) or not (`false`). + business_appointment_settings: + type: optional + docs: Settings for appointment-type bookings. + support_seller_level_writes: + type: optional> + docs: >- + Indicates whether the seller's subscription to Square Appointments + supports creating, updating or canceling an appointment through the + API (`true`) or not (`false`) using seller permission. + source: + openapi: openapi/openapi.json + BusinessBookingProfileBookingPolicy: + enum: + - ACCEPT_ALL + - REQUIRES_ACCEPTANCE + docs: Policies for accepting bookings. + source: + openapi: openapi/openapi.json + BusinessBookingProfileCustomerTimezoneChoice: + enum: + - BUSINESS_LOCATION_TIMEZONE + - CUSTOMER_CHOICE + docs: Choices of customer-facing time zone used for bookings. + source: + openapi: openapi/openapi.json + BusinessHours: + docs: The hours of operation for a location. + properties: + periods: + type: optional>> + docs: >- + The list of time periods during which the business is open. There can + be at most 10 periods per day. + source: + openapi: openapi/openapi.json + BusinessHoursPeriod: + docs: Represents a period of time during which a business location is open. + properties: + day_of_week: + type: optional + docs: |- + The day of the week for this time period. + See [DayOfWeek](#type-dayofweek) for possible values + start_local_time: + type: optional> + docs: >- + The start time of a business hours period, specified in local time + using partial-time + + RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 + in the morning. + + Note that the seconds value is always :00, but it is appended for + conformance to the RFC. + end_local_time: + type: optional> + docs: >- + The end time of a business hours period, specified in local time using + partial-time + + RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 + in the evening. + + Note that the seconds value is always :00, but it is appended for + conformance to the RFC. + source: + openapi: openapi/openapi.json + BuyNowPayLaterDetails: + docs: Additional details about a Buy Now Pay Later payment type. + properties: + brand: + type: optional> + docs: |- + The brand used for the Buy Now Pay Later payment. + The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`. + validation: + maxLength: 50 + afterpay_details: + type: optional + docs: >- + Details about an Afterpay payment. These details are only populated if + the `brand` is + + `AFTERPAY`. + clearpay_details: + type: optional + docs: >- + Details about a Clearpay payment. These details are only populated if + the `brand` is + + `CLEARPAY`. + source: + openapi: openapi/openapi.json + CalculateLoyaltyPointsResponse: + docs: >- + Represents a + [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) + response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + points: + type: optional + docs: >- + The number of points that the buyer can earn from the base loyalty + program. + promotion_points: + type: optional + docs: >- + The number of points that the buyer can earn from a loyalty promotion. + To be eligible + + to earn promotion points, the purchase must first qualify for program + points. When `order_id` + + is not provided in the request, this value is always 0. + source: + openapi: openapi/openapi.json + CalculateOrderResponse: + properties: + order: + type: optional + docs: The calculated version of the order provided in the request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CancelBookingResponse: + properties: + booking: + type: optional + docs: The booking that was cancelled. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + CancelInvoiceResponse: + docs: The response returned by the `CancelInvoice` request. + properties: + invoice: + type: optional + docs: The canceled invoice. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + CancelLoyaltyPromotionResponse: + docs: >- + Represents a + [CancelLoyaltyPromotion](api-endpoint:Loyalty-CancelLoyaltyPromotion) + response. + + Either `loyalty_promotion` or `errors` is present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_promotion: + type: optional + docs: The canceled loyalty promotion. + source: + openapi: openapi/openapi.json + CancelPaymentByIdempotencyKeyResponse: + docs: >- + Defines the response returned by + + [CancelPaymentByIdempotencyKey](api-endpoint:Payments-CancelPaymentByIdempotencyKey). + + On success, `errors` is empty. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CancelPaymentResponse: + docs: >- + Defines the response returned by + [CancelPayment](api-endpoint:Payments-CancelPayment). + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + payment: + type: optional + docs: The successfully canceled `Payment` object. + source: + openapi: openapi/openapi.json + CancelSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [CancelSubscription](api-endpoint:Subscriptions-CancelSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: >- + The specified subscription scheduled for cancellation according to the + action created by the request. + actions: + type: optional> + docs: A list of a single `CANCEL` action scheduled for the subscription. + source: + openapi: openapi/openapi.json + CancelTerminalActionResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + action: + type: optional + docs: The canceled `TerminalAction` + source: + openapi: openapi/openapi.json + CancelTerminalCheckoutResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + checkout: + type: optional + docs: The canceled `TerminalCheckout`. + source: + openapi: openapi/openapi.json + CancelTerminalRefundResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refund: + type: optional + docs: The updated `TerminalRefund`. + source: + openapi: openapi/openapi.json + CaptureTransactionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) + endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + Card: + docs: |- + Represents the payment details of a card to be used for payments. These + details are determined by the payment token generated by Web Payments SDK. + properties: + id: + type: optional + docs: Unique ID for this card. Generated by Square. + validation: + maxLength: 64 + access: read-only + card_brand: + type: optional + docs: |- + The card's brand. + See [CardBrand](#type-cardbrand) for possible values + last_4: + type: optional + docs: The last 4 digits of the card number. + validation: + maxLength: 4 + access: read-only + exp_month: + type: optional> + docs: >- + The expiration month of the associated card as an integer between 1 + and 12. + exp_year: + type: optional> + docs: The four-digit year of the card's expiration date. + cardholder_name: + type: optional> + docs: The name of the cardholder. + validation: + maxLength: 96 + billing_address: + type: optional
+ docs: >- + The billing address for this card. `US` postal codes can be provided + as a 5-digit zip code + + or 9-digit ZIP+4 (example: `12345-6789`). For a full list of field + meanings by country, see + + [Working with + Addresses](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-addresses). + fingerprint: + type: optional + docs: >- + Intended as a Square-assigned identifier, based + + on the card number, to identify the card across multiple locations + within a + + single application. + validation: + maxLength: 255 + access: read-only + customer_id: + type: optional> + docs: >- + **Required** The ID of a [customer](entity:Customer) to be associated + with the card. + merchant_id: + type: optional + docs: The ID of the merchant associated with the card. + access: read-only + reference_id: + type: optional> + docs: >- + An optional user-defined reference ID that associates this card with + + another entity in an external system. For example, a customer ID from + an + + external customer management system. + validation: + maxLength: 128 + enabled: + type: optional + docs: Indicates whether or not a card can be used for payments. + access: read-only + card_type: + type: optional + docs: >- + The type of the card. + + The Card object includes this field only in response to Payments API + calls. + + See [CardType](#type-cardtype) for possible values + prepaid_type: + type: optional + docs: |- + Indicates whether the card is prepaid or not. + See [CardPrepaidType](#type-cardprepaidtype) for possible values + bin: + type: optional + docs: >- + The first six digits of the card number, known as the Bank + Identification Number (BIN). Only the Payments API + + returns this field. + validation: + maxLength: 6 + access: read-only + version: + type: optional + docs: >- + Current version number of the card. Increments with each card update. + Requests to update an + + existing Card object will be rejected unless the version in the + request matches the current + + version for the Card. + card_co_brand: + type: optional + docs: >- + The card's co-brand if available. For example, an Afterpay virtual + card would have a + + co-brand of AFTERPAY. + + See [CardCoBrand](#type-cardcobrand) for possible values + issuer_alert: + type: optional + docs: >- + An alert from the issuing bank about the card status. Alerts can + indicate whether + + future charges to the card are likely to fail. For more information, + see + + [Manage Card on File + Declines](https://developer.squareup.com/docs/cards-api/manage-card-on-file-declines). + + + This field is present only if there's an active issuer alert. + + See [IssuerAlert](#type-issueralert) for possible values + issuer_alert_at: + type: optional + docs: >- + The timestamp of when the current issuer alert was received and + processed, in + + RFC 3339 format. + + + This field is present only if there's an active issuer alert. + access: read-only + hsa_fsa: + type: optional + docs: >- + Indicates whether the card is linked to a Health Savings Account (HSA) + or Flexible + + Spending Account (FSA), based on the card BIN. + access: read-only + source: + openapi: openapi/openapi.json + CardAutomaticallyUpdatedEvent: + docs: >- + Published when Square automatically updates the expiration date or + + primary account number (PAN) of a [card](entity:Card) or adds or removes + an issuer alert. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"card.automatically_updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CardAutomaticallyUpdatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"card"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the automatically updated card. + source: + openapi: openapi/openapi.json + CardAutomaticallyUpdatedEventObject: + properties: + card: + type: optional + docs: The automatically updated card. + source: + openapi: openapi/openapi.json + CardBrand: + enum: + - OTHER_BRAND + - VISA + - MASTERCARD + - AMERICAN_EXPRESS + - DISCOVER + - DISCOVER_DINERS + - JCB + - CHINA_UNIONPAY + - SQUARE_GIFT_CARD + - SQUARE_CAPITAL_CARD + - INTERAC + - EFTPOS + - FELICA + - EBT + docs: Indicates a card's brand, such as `VISA` or `MASTERCARD`. + source: + openapi: openapi/openapi.json + CardCoBrand: + enum: + - UNKNOWN + - AFTERPAY + - CLEARPAY + docs: Indicates the brand for a co-branded card. + source: + openapi: openapi/openapi.json + CardCreatedEvent: + docs: Published when a [card](entity:Card) is created or imported. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"card.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CardCreatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"card"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the created card. + source: + openapi: openapi/openapi.json + CardCreatedEventObject: + properties: + card: + type: optional + docs: The created card. + source: + openapi: openapi/openapi.json + CardDisabledEvent: + docs: Published when a [card](entity:Card) is disabled. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"card.disabled"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CardDisabledEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"card"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the disabled card. + source: + openapi: openapi/openapi.json + CardDisabledEventObject: + properties: + card: + type: optional + docs: The disabled card. + source: + openapi: openapi/openapi.json + CardForgottenEvent: + docs: Published when a [card](entity:Card) is GDPR forgotten or vaulted. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"card.forgotten"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CardForgottenEventCard: + properties: + id: + type: optional + docs: Unique ID for this card. Generated by Square. + validation: + maxLength: 64 + access: read-only + customer_id: + type: optional> + docs: >- + The ID of a customer created using the Customers API associated with + the card. + enabled: + type: optional> + docs: Indicates whether or not a card can be used for payments. + reference_id: + type: optional> + docs: >- + An optional user-defined reference ID that associates this card with + + another entity in an external system. For example, a customer ID from + an + + external customer management system. + version: + type: optional + docs: >- + Current version number of the card. Increments with each card update. + Requests to update an + + existing Card object will be rejected unless the version in the + request matches the current + + version for the Card. + merchant_id: + type: optional> + docs: The ID of the merchant associated with the card. + source: + openapi: openapi/openapi.json + CardForgottenEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"card"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the forgotten card. + source: + openapi: openapi/openapi.json + CardForgottenEventObject: + properties: + card: + type: optional + docs: The forgotten card. + source: + openapi: openapi/openapi.json + CardIssuerAlert: + type: literal<"ISSUER_ALERT_CARD_CLOSED"> + docs: Indicates the type of issuer alert for a [card on file](entity:Card). + CardPaymentDetails: + docs: >- + Reflects the current status of a card payment. Contains only + non-confidential information. + properties: + status: + type: optional> + docs: >- + The card payment's current state. The state can be AUTHORIZED, + CAPTURED, VOIDED, or + + FAILED. + validation: + maxLength: 50 + card: + type: optional + docs: The credit card's non-confidential details. + entry_method: + type: optional> + docs: >- + The method used to enter the card's details for the payment. The + method can be + + `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. + validation: + maxLength: 50 + cvv_status: + type: optional> + docs: >- + The status code returned from the Card Verification Value (CVV) check. + The code can be + + `CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`. + validation: + maxLength: 50 + avs_status: + type: optional> + docs: >- + The status code returned from the Address Verification System (AVS) + check. The code can be + + `AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`. + validation: + maxLength: 50 + auth_result_code: + type: optional> + docs: >- + The status code returned by the card issuer that describes the + payment's + + authorization status. + validation: + maxLength: 10 + application_identifier: + type: optional> + docs: >- + For EMV payments, the application ID identifies the EMV application + used for the payment. + validation: + maxLength: 32 + application_name: + type: optional> + docs: >- + For EMV payments, the human-readable name of the EMV application used + for the payment. + validation: + maxLength: 16 + application_cryptogram: + type: optional> + docs: For EMV payments, the cryptogram generated for the payment. + validation: + maxLength: 16 + verification_method: + type: optional> + docs: >- + For EMV payments, the method used to verify the cardholder's identity. + The method can be + + `PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`. + validation: + maxLength: 50 + verification_results: + type: optional> + docs: >- + For EMV payments, the results of the cardholder verification. The + result can be + + `SUCCESS`, `FAILURE`, or `UNKNOWN`. + validation: + maxLength: 50 + statement_description: + type: optional> + docs: >- + The statement description sent to the card networks. + + + Note: The actual statement description varies and is likely to be + truncated and appended with + + additional information on a per issuer basis. + validation: + maxLength: 50 + device_details: + type: optional + docs: |- + __Deprecated__: Use `Payment.device_details` instead. + + Details about the device that took the payment. + card_payment_timeline: + type: optional + docs: The timeline for card payments. + refund_requires_card_presence: + type: optional> + docs: |- + Whether the card must be physically present for the payment to + be refunded. If set to `true`, the card must be present. + errors: + type: optional>> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + CardPaymentTimeline: + docs: The timeline for card payments. + properties: + authorized_at: + type: optional> + docs: The timestamp when the payment was authorized, in RFC 3339 format. + captured_at: + type: optional> + docs: The timestamp when the payment was captured, in RFC 3339 format. + voided_at: + type: optional> + docs: The timestamp when the payment was voided, in RFC 3339 format. + source: + openapi: openapi/openapi.json + CardPrepaidType: + enum: + - UNKNOWN_PREPAID_TYPE + - NOT_PREPAID + - PREPAID + docs: Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. + source: + openapi: openapi/openapi.json + CardType: + enum: + - UNKNOWN_CARD_TYPE + - CREDIT + - DEBIT + docs: Indicates a card's type, such as `CREDIT` or `DEBIT`. + source: + openapi: openapi/openapi.json + CardUpdatedEvent: + docs: >- + Published when a [card](entity:Card) is updated by the seller in the + Square Dashboard. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"card.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CardUpdatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"card"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the updated card. + source: + openapi: openapi/openapi.json + CardUpdatedEventObject: + properties: + card: + type: optional + docs: The updated card. + source: + openapi: openapi/openapi.json + CashAppDetails: + docs: >- + Additional details about `WALLET` type payments with the `brand` of + `CASH_APP`. + properties: + buyer_full_name: + type: optional> + docs: The name of the Cash App account holder. + validation: + maxLength: 255 + buyer_country_code: + type: optional> + docs: >- + The country of the Cash App account holder, in ISO 3166-1-alpha-2 + format. + + + For possible values, see [Country](entity:Country). + validation: + minLength: 2 + maxLength: 2 + buyer_cashtag: + type: optional + docs: $Cashtag of the Cash App account holder. + validation: + minLength: 1 + maxLength: 21 + access: read-only + source: + openapi: openapi/openapi.json + CashDrawerDevice: + properties: + id: + type: optional + docs: The device Square-issued ID + name: + type: optional> + docs: The device merchant-specified name. + source: + openapi: openapi/openapi.json + CashDrawerEventType: + enum: + - NO_SALE + - CASH_TENDER_PAYMENT + - OTHER_TENDER_PAYMENT + - CASH_TENDER_CANCELLED_PAYMENT + - OTHER_TENDER_CANCELLED_PAYMENT + - CASH_TENDER_REFUND + - OTHER_TENDER_REFUND + - PAID_IN + - PAID_OUT + docs: |- + The types of events on a CashDrawerShift. + Each event type represents an employee action on the actual cash drawer + represented by a CashDrawerShift. + source: + openapi: openapi/openapi.json + CashDrawerShift: + docs: >- + This model gives the details of a cash drawer shift. + + The cash_payment_money, cash_refund_money, cash_paid_in_money, + + and cash_paid_out_money fields are all computed by summing their + respective + + event types. + properties: + id: + type: optional + docs: The shift unique ID. + state: + type: optional + docs: >- + The shift current state. + + See [CashDrawerShiftState](#type-cashdrawershiftstate) for possible + values + opened_at: + type: optional> + docs: The time when the shift began, in ISO 8601 format. + ended_at: + type: optional> + docs: The time when the shift ended, in ISO 8601 format. + closed_at: + type: optional> + docs: The time when the shift was closed, in ISO 8601 format. + description: + type: optional> + docs: The free-form text description of a cash drawer by an employee. + opened_cash_money: + type: optional + docs: |- + The amount of money in the cash drawer at the start of the shift. + The amount must be greater than or equal to zero. + cash_payment_money: + type: optional + docs: >- + The amount of money added to the cash drawer from cash payments. + + This is computed by summing all events with the types + CASH_TENDER_PAYMENT and + + CASH_TENDER_CANCELED_PAYMENT. The amount is always greater than or + equal to + + zero. + cash_refunds_money: + type: optional + docs: >- + The amount of money removed from the cash drawer from cash refunds. + + It is computed by summing the events of type CASH_TENDER_REFUND. The + amount + + is always greater than or equal to zero. + cash_paid_in_money: + type: optional + docs: >- + The amount of money added to the cash drawer for reasons other than + cash + + payments. It is computed by summing the events of type PAID_IN. The + amount is + + always greater than or equal to zero. + cash_paid_out_money: + type: optional + docs: >- + The amount of money removed from the cash drawer for reasons other + than + + cash refunds. It is computed by summing the events of type PAID_OUT. + The amount + + is always greater than or equal to zero. + expected_cash_money: + type: optional + docs: >- + The amount of money that should be in the cash drawer at the end of + the + + shift, based on the shift's other money amounts. + + This can be negative if employees have not correctly recorded all the + events + + on the cash drawer. + + cash_paid_out_money is a summation of amounts from cash_payment_money + (zero + + or positive), cash_refunds_money (zero or negative), + cash_paid_in_money (zero + + or positive), and cash_paid_out_money (zero or negative) event types. + closed_cash_money: + type: optional + docs: |- + The amount of money found in the cash drawer at the end of the shift + by an auditing employee. The amount should be positive. + device: + type: optional + docs: >- + The device running Square Point of Sale that was connected to the cash + drawer. + created_at: + type: optional + docs: The shift start time in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The shift updated at time in RFC 3339 format. + access: read-only + location_id: + type: optional + docs: The ID of the location the cash drawer shift belongs to. + access: read-only + team_member_ids: + type: optional> + docs: >- + The IDs of all team members that were logged into Square Point of Sale + at any + + point while the cash drawer shift was open. + access: read-only + opening_team_member_id: + type: optional + docs: The ID of the team member that started the cash drawer shift. + access: read-only + ending_team_member_id: + type: optional + docs: The ID of the team member that ended the cash drawer shift. + access: read-only + closing_team_member_id: + type: optional + docs: >- + The ID of the team member that closed the cash drawer shift by + auditing + + the cash drawer contents. + access: read-only + source: + openapi: openapi/openapi.json + CashDrawerShiftEvent: + properties: + id: + type: optional + docs: The unique ID of the event. + event_type: + type: optional + docs: >- + The type of cash drawer shift event. + + See [CashDrawerEventType](#type-cashdrawereventtype) for possible + values + event_money: + type: optional + docs: >- + The amount of money that was added to or removed from the cash drawer + + in the event. The amount can be positive (for added money) + + or zero (for other tender type payments). The addition or removal of + money can be determined by + + by the event type. + created_at: + type: optional + docs: The event time in RFC 3339 format. + access: read-only + description: + type: optional> + docs: |- + An optional description of the event, entered by the employee that + created the event. + team_member_id: + type: optional + docs: The ID of the team member that created the event. + access: read-only + source: + openapi: openapi/openapi.json + CashDrawerShiftState: + enum: + - OPEN + - ENDED + - CLOSED + docs: The current state of a cash drawer shift. + source: + openapi: openapi/openapi.json + CashDrawerShiftSummary: + docs: >- + The summary of a closed cash drawer shift. + + This model contains only the money counted to start a cash drawer shift, + counted + + at the end of the shift, and the amount that should be in the drawer at + shift + + end based on summing all cash drawer shift events. + properties: + id: + type: optional + docs: The shift unique ID. + state: + type: optional + docs: >- + The shift current state. + + See [CashDrawerShiftState](#type-cashdrawershiftstate) for possible + values + opened_at: + type: optional> + docs: The shift start time in ISO 8601 format. + ended_at: + type: optional> + docs: The shift end time in ISO 8601 format. + closed_at: + type: optional> + docs: The shift close time in ISO 8601 format. + description: + type: optional> + docs: An employee free-text description of a cash drawer shift. + opened_cash_money: + type: optional + docs: |- + The amount of money in the cash drawer at the start of the shift. This + must be a positive amount. + expected_cash_money: + type: optional + docs: >- + The amount of money that should be in the cash drawer at the end of + the + + shift, based on the cash drawer events on the shift. + + The amount is correct if all shift employees accurately recorded their + + cash drawer shift events. Unrecorded events and events with the wrong + amount + + result in an incorrect expected_cash_money amount that can be + negative. + closed_cash_money: + type: optional + docs: >- + The amount of money found in the cash drawer at the end of the shift + by + + an auditing employee. The amount must be greater than or equal to + zero. + created_at: + type: optional + docs: The shift start time in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The shift updated at time in RFC 3339 format. + access: read-only + location_id: + type: optional + docs: The ID of the location the cash drawer shift belongs to. + access: read-only + source: + openapi: openapi/openapi.json + CashPaymentDetails: + docs: >- + Stores details about a cash payment. Contains only non-confidential + information. For more information, see + + [Take Cash + Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). + properties: + buyer_supplied_money: + type: Money + docs: The amount and currency of the money supplied by the buyer. + change_back_money: + type: optional + docs: |- + The amount of change due back to the buyer. + This read-only field is calculated + from the `amount_money` and `buyer_supplied_money` fields. + source: + openapi: openapi/openapi.json + CatalogAvailabilityPeriod: + docs: Represents a time period of availability. + properties: + start_local_time: + type: optional> + docs: >- + The start time of an availability period, specified in local time + using partial-time + + RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 + in the morning. + + Note that the seconds value is always :00, but it is appended for + conformance to the RFC. + end_local_time: + type: optional> + docs: >- + The end time of an availability period, specified in local time using + partial-time + + RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 + in the evening. + + Note that the seconds value is always :00, but it is appended for + conformance to the RFC. + day_of_week: + type: optional + docs: |- + The day of the week for this availability period. + See [DayOfWeek](#type-dayofweek) for possible values + source: + openapi: openapi/openapi.json + CatalogCategory: + docs: A category to which a `CatalogItem` instance belongs. + properties: + name: + type: optional> + docs: >- + The category name. This is a searchable attribute for use in + applicable query filters, and its value length is of Unicode code + points. + validation: + maxLength: 255 + image_ids: + type: optional>> + docs: >- + The IDs of images associated with this `CatalogCategory` instance. + + Currently these images are not displayed by Square, but are free to be + displayed in 3rd party applications. + category_type: + type: optional + docs: >- + The type of the category. + + See [CatalogCategoryType](#type-catalogcategorytype) for possible + values + parent_category: + type: optional + docs: The ID of the parent category of this category instance. + is_top_level: + type: optional> + docs: >- + Indicates whether a category is a top level category, which does not + have any parent_category. + channels: + type: optional>> + docs: >- + A list of IDs representing channels, such as a Square Online site, + where the category can be made visible. + availability_period_ids: + type: optional>> + docs: >- + The IDs of the `CatalogAvailabilityPeriod` objects associated with the + category. + online_visibility: + type: optional> + docs: >- + Indicates whether the category is visible (`true`) or hidden (`false`) + on all of the seller's Square Online sites. + root_category: + type: optional + docs: The top-level category in a category hierarchy. + access: read-only + ecom_seo_data: + type: optional + docs: The SEO data for a seller's Square Online store. + path_to_root: + type: optional>> + docs: >- + The path from the category to its root category. The first node of the + path is the parent of the category + + and the last is the root category. The path is empty if the category + is a root category. + source: + openapi: openapi/openapi.json + CatalogCategoryType: + enum: + - REGULAR_CATEGORY + - MENU_CATEGORY + - KITCHEN_CATEGORY + docs: Indicates the type of a category. + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinition: + docs: >- + Contains information defining a custom attribute. Custom attributes are + + intended to store additional information about a catalog object or to + associate a + + catalog object with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable information, + card details, etc.). + + [Read more about custom + attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) + properties: + type: + type: CatalogCustomAttributeDefinitionType + docs: >- + The type of this custom attribute. Cannot be modified after creation. + + Required. + + See + [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) + for possible values + name: + type: string + docs: >2- + The name of this definition for API and seller-facing UI purposes. + The name must be unique within the (merchant, application) pair. + Required. + + May not be empty and may not exceed 255 characters. Can be modified + after creation. + validation: + minLength: 1 + maxLength: 255 + description: + type: optional> + docs: >- + Seller-oriented description of the meaning of this Custom Attribute, + + any constraints that the seller should observe, etc. May be displayed + as a tooltip in Square UIs. + validation: + maxLength: 255 + source_application: + type: optional + docs: |- + __Read only.__ Contains information about the application that + created this custom attribute definition. + allowed_object_types: + docs: >- + The set of `CatalogObject` types that this custom atttribute may be + applied to. + + Currently, only `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, + and `CATEGORY` are allowed. At least one type must be included. + + See [CatalogObjectType](#type-catalogobjecttype) for possible values + type: list + seller_visibility: + type: optional + docs: >- + The visibility of a custom attribute in seller-facing UIs (including + Square Point + + of Sale applications and Square Dashboard). May be modified. + + See + [CatalogCustomAttributeDefinitionSellerVisibility](#type-catalogcustomattributedefinitionsellervisibility) + for possible values + app_visibility: + type: optional + docs: >- + The visibility of a custom attribute to applications other than the + application + + that created the attribute. + + See + [CatalogCustomAttributeDefinitionAppVisibility](#type-catalogcustomattributedefinitionappvisibility) + for possible values + string_config: + type: optional + docs: Optionally, populated when `type` = `STRING`, unset otherwise. + number_config: + type: optional + docs: Optionally, populated when `type` = `NUMBER`, unset otherwise. + selection_config: + type: optional + docs: Populated when `type` is set to `SELECTION`, unset otherwise. + custom_attribute_usage_count: + type: optional + docs: >- + The number of custom attributes that reference this + + custom attribute definition. Set by the server in response to a + ListCatalog + + request with `include_counts` set to `true`. If the actual count is + greater + + than 100, `custom_attribute_usage_count` will be set to `100`. + access: read-only + key: + type: optional> + docs: >- + The name of the desired custom attribute key that can be used to + access + + the custom attribute value on catalog objects. Cannot be modified + after the + + custom attribute definition has been created. + + Must be between 1 and 60 characters, and may only contain the + characters `[a-zA-Z0-9_-]`. + validation: + pattern: ^[a-zA-Z0-9_-]*$ + minLength: 1 + maxLength: 60 + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionAppVisibility: + enum: + - APP_VISIBILITY_HIDDEN + - APP_VISIBILITY_READ_ONLY + - APP_VISIBILITY_READ_WRITE_VALUES + docs: >- + Defines the visibility of a custom attribute to applications other than + their + + creating application. + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionNumberConfig: + properties: + precision: + type: optional> + docs: |- + An integer between 0 and 5 that represents the maximum number of + positions allowed after the decimal in number custom attribute values + For example: + + - if the precision is 0, the quantity can be 1, 2, 3, etc. + - if the precision is 1, the quantity can be 0.1, 0.2, etc. + - if the precision is 2, the quantity can be 0.01, 0.12, etc. + + Default: 5 + validation: + max: 5 + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionSelectionConfig: + docs: >- + Configuration associated with `SELECTION`-type custom attribute + definitions. + properties: + max_allowed_selections: + type: optional> + docs: >- + The maximum number of selections that can be set. The maximum value + for this + + attribute is 100. The default value is 1. The value can be modified, + but changing the value will not + + affect existing custom attribute values on objects. Clients need to + + handle custom attributes with more selected values than allowed by + this limit. + validation: + max: 100 + allowed_selections: + type: >- + optional>> + docs: >- + The set of valid `CatalogCustomAttributeSelections`. Up to a maximum + of 100 + + selections can be defined. Can be modified. + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection: + docs: A named selection for this `SELECTION`-type custom attribute definition. + properties: + uid: + type: optional> + docs: Unique ID set by Square. + name: + type: string + docs: Selection name, unique within `allowed_selections`. + validation: + minLength: 1 + maxLength: 255 + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionSellerVisibility: + enum: + - SELLER_VISIBILITY_HIDDEN + - SELLER_VISIBILITY_READ_WRITE_VALUES + docs: |- + Defines the visibility of a custom attribute to sellers in Square + client applications, Square APIs or in Square UIs (including Square Point + of Sale applications and Square Dashboard). + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionStringConfig: + docs: >- + Configuration associated with Custom Attribute Definitions of type + `STRING`. + properties: + enforce_uniqueness: + type: optional> + docs: >- + If true, each Custom Attribute instance associated with this Custom + Attribute + + Definition must have a unique value within the seller's catalog. For + + example, this may be used for a value like a SKU that should not be + + duplicated within a seller's catalog. May not be modified after the + + definition has been created. + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionType: + enum: + - STRING + - BOOLEAN + - NUMBER + - SELECTION + docs: Defines the possible types for a custom attribute. + source: + openapi: openapi/openapi.json + CatalogCustomAttributeValue: + docs: >- + An instance of a custom attribute. Custom attributes can be defined and + + added to `ITEM` and `ITEM_VARIATION` type catalog objects. + + [Read more about custom + attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes). + properties: + name: + type: optional> + docs: The name of the custom attribute. + string_value: + type: optional> + docs: >- + The string value of the custom attribute. Populated if `type` = + `STRING`. + custom_attribute_definition_id: + type: optional + docs: >- + The id of the + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + this value belongs to. + access: read-only + type: + type: optional + docs: >- + A copy of type from the associated `CatalogCustomAttributeDefinition`. + + See + [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) + for possible values + number_value: + type: optional> + docs: >- + Populated if `type` = `NUMBER`. Contains a string + + representation of a decimal number, using a `.` as the decimal + separator. + boolean_value: + type: optional> + docs: A `true` or `false` value. Populated if `type` = `BOOLEAN`. + selection_uid_values: + type: optional>> + docs: >- + One or more choices from `allowed_selections`. Populated if `type` = + `SELECTION`. + key: + type: optional + docs: >- + If the associated `CatalogCustomAttributeDefinition` object is defined + by another application, this key is prefixed by the defining + application ID. + + For example, if the CatalogCustomAttributeDefinition has a key + attribute of "cocoa_brand" and the defining application ID is + "abcd1234", this key is "abcd1234:cocoa_brand" + + when the application making the request is different from the + application defining the custom attribute definition. Otherwise, the + key is simply "cocoa_brand". + access: read-only + source: + openapi: openapi/openapi.json + CatalogDiscount: + docs: A discount applicable to items. + properties: + name: + type: optional> + docs: >- + The discount name. This is a searchable attribute for use in + applicable query filters, and its value length is of Unicode code + points. + validation: + maxLength: 255 + discount_type: + type: optional + docs: >- + Indicates whether the discount is a fixed amount or percentage, or + entered at the time of sale. + + See [CatalogDiscountType](#type-catalogdiscounttype) for possible + values + percentage: + type: optional> + docs: >- + The percentage of the discount as a string representation of a decimal + number, using a `.` as the decimal + + separator and without a `%` sign. A value of `7.5` corresponds to + `7.5%`. Specify a percentage of `0` if `discount_type` + + is `VARIABLE_PERCENTAGE`. + + + Do not use this field for amount-based or variable discounts. + amount_money: + type: optional + docs: >- + The amount of the discount. Specify an amount of `0` if + `discount_type` is `VARIABLE_AMOUNT`. + + + Do not use this field for percentage-based or variable discounts. + pin_required: + type: optional> + docs: >- + Indicates whether a mobile staff member needs to enter their PIN to + apply the + + discount to a payment in the Square Point of Sale app. + label_color: + type: optional> + docs: >- + The color of the discount display label in the Square Point of Sale + app. This must be a valid hex color code. + modify_tax_basis: + type: optional + docs: >- + Indicates whether this discount should reduce the price used to + calculate tax. + + + Most discounts should use `MODIFY_TAX_BASIS`. However, in some + circumstances taxes must + + be calculated based on an item's price, ignoring a particular + discount. For example, + + in many US jurisdictions, a manufacturer coupon or instant rebate + reduces the price a + + customer pays but does not reduce the sale price used to calculate how + much sales tax is + + due. In this case, the discount representing that manufacturer coupon + should have + + `DO_NOT_MODIFY_TAX_BASIS` for this field. + + + If you are unsure whether you need to use this field, consult your tax + professional. + + See + [CatalogDiscountModifyTaxBasis](#type-catalogdiscountmodifytaxbasis) + for possible values + maximum_amount_money: + type: optional + docs: >- + For a percentage discount, the maximum absolute value of the discount. + For example, if a + + 50% discount has a `maximum_amount_money` of $20, a $100 purchase will + yield a $20 discount, + + not a $50 discount. + source: + openapi: openapi/openapi.json + CatalogDiscountModifyTaxBasis: + enum: + - MODIFY_TAX_BASIS + - DO_NOT_MODIFY_TAX_BASIS + source: + openapi: openapi/openapi.json + CatalogDiscountType: + enum: + - FIXED_PERCENTAGE + - FIXED_AMOUNT + - VARIABLE_PERCENTAGE + - VARIABLE_AMOUNT + docs: How to apply a CatalogDiscount to a CatalogItem. + source: + openapi: openapi/openapi.json + CatalogEcomSeoData: + docs: SEO data for for a seller's Square Online store. + properties: + page_title: + type: optional> + docs: The SEO title used for the Square Online store. + page_description: + type: optional> + docs: The SEO description used for the Square Online store. + permalink: + type: optional> + docs: The SEO permalink used for the Square Online store. + source: + openapi: openapi/openapi.json + CatalogIdMapping: + docs: >- + A mapping between a temporary client-supplied ID and a permanent + server-generated ID. + + + When calling + [UpsertCatalogObject](api-endpoint:Catalog-UpsertCatalogObject) or + + [BatchUpsertCatalogObjects](api-endpoint:Catalog-BatchUpsertCatalogObjects) + to + + create a [CatalogObject](entity:CatalogObject) instance, you can supply + + a temporary ID for the to-be-created object, especially when the object is + to be referenced + + elsewhere in the same request body. This temporary ID can be any string + unique within + + the call, but must be prefixed by "#". + + + After the request is submitted and the object created, a permanent + server-generated ID is assigned + + to the new object. The permanent ID is unique across the Square catalog. + properties: + client_object_id: + type: optional> + docs: >- + The client-supplied temporary `#`-prefixed ID for a new + `CatalogObject`. + object_id: + type: optional> + docs: The permanent ID for the CatalogObject created by the server. + source: + openapi: openapi/openapi.json + CatalogImage: + docs: >- + An image file to use in Square catalogs. It can be associated with + + `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and + `CatalogModifierList` objects. + + Only the images on items and item variations are exposed in Dashboard. + + Only the first image on an item is displayed in Square Point of Sale + (SPOS). + + Images on items and variations are displayed through Square Online Store. + + Images on other object types are for use by 3rd party application + developers. + properties: + name: + type: optional> + docs: >- + The internal name to identify this image in calls to the Square API. + + This is a searchable attribute for use in applicable query filters + + using the + [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). + + It is not unique and should not be shown in a buyer facing context. + url: + type: optional> + docs: >- + The URL of this image, generated by Square after an image is uploaded + + using the + [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) + endpoint. + + To modify the image, use the UpdateCatalogImage endpoint. Do not + change the URL field. + caption: + type: optional> + docs: >- + A caption that describes what is shown in the image. Displayed in the + + Square Online Store. This is a searchable attribute for use in + applicable query filters + + using the + [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). + photo_studio_order_id: + type: optional> + docs: >- + The immutable order ID for this image object created by the Photo + Studio service in Square Online Store. + source: + openapi: openapi/openapi.json + CatalogInfoResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + limits: + type: optional + docs: Limits that apply to this API. + standard_unit_description_group: + type: optional + docs: Names and abbreviations for standard units. + source: + openapi: openapi/openapi.json + CatalogInfoResponseLimits: + properties: + batch_upsert_max_objects_per_batch: + type: optional> + docs: >- + The maximum number of objects that may appear within a single batch in + a + + `/v2/catalog/batch-upsert` request. + batch_upsert_max_total_objects: + type: optional> + docs: |- + The maximum number of objects that may appear across all batches in a + `/v2/catalog/batch-upsert` request. + batch_retrieve_max_object_ids: + type: optional> + docs: >- + The maximum number of object IDs that may appear in a + `/v2/catalog/batch-retrieve` + + request. + search_max_page_limit: + type: optional> + docs: |- + The maximum number of results that may be returned in a page of a + `/v2/catalog/search` response. + batch_delete_max_object_ids: + type: optional> + docs: |- + The maximum number of object IDs that may be included in a single + `/v2/catalog/batch-delete` request. + update_item_taxes_max_item_ids: + type: optional> + docs: |- + The maximum number of item IDs that may be included in a single + `/v2/catalog/update-item-taxes` request. + update_item_taxes_max_taxes_to_enable: + type: optional> + docs: >- + The maximum number of tax IDs to be enabled that may be included in a + single + + `/v2/catalog/update-item-taxes` request. + update_item_taxes_max_taxes_to_disable: + type: optional> + docs: >- + The maximum number of tax IDs to be disabled that may be included in a + single + + `/v2/catalog/update-item-taxes` request. + update_item_modifier_lists_max_item_ids: + type: optional> + docs: |- + The maximum number of item IDs that may be included in a single + `/v2/catalog/update-item-modifier-lists` request. + update_item_modifier_lists_max_modifier_lists_to_enable: + type: optional> + docs: >- + The maximum number of modifier list IDs to be enabled that may be + included in + + a single `/v2/catalog/update-item-modifier-lists` request. + update_item_modifier_lists_max_modifier_lists_to_disable: + type: optional> + docs: >- + The maximum number of modifier list IDs to be disabled that may be + included in + + a single `/v2/catalog/update-item-modifier-lists` request. + source: + openapi: openapi/openapi.json + CatalogItem: + docs: >- + A [CatalogObject](entity:CatalogObject) instance of the `ITEM` type, also + referred to as an item, in the catalog. + properties: + name: + type: optional> + docs: >- + The item's name. This is a searchable attribute for use in applicable + query filters, its value must not be empty, and the length is of + Unicode code points. + validation: + maxLength: 512 + description: + type: optional> + docs: >- + The item's description. This is a searchable attribute for use in + applicable query filters, and its value length is of Unicode code + points. + + + Deprecated at 2022-07-20, this field is planned to retire in 6 months. + You should migrate to use `description_html` to set the description + + of the [CatalogItem](entity:CatalogItem) instance. The `description` + and `description_html` field values are kept in sync. If you try to + + set the both fields, the `description_html` text value overwrites the + `description` value. Updates in one field are also reflected in the + other, + + except for when you use an early version before Square API 2022-07-20 + and `description_html` is set to blank, setting the `description` + value to null + + does not nullify `description_html`. + validation: + maxLength: 4096 + abbreviation: + type: optional> + docs: >- + The text of the item's display label in the Square Point of Sale app. + Only up to the first five characters of the string are used. + + This attribute is searchable, and its value length is of Unicode code + points. + validation: + maxLength: 24 + label_color: + type: optional> + docs: >- + The color of the item's display label in the Square Point of Sale app. + This must be a valid hex color code. + is_taxable: + type: optional> + docs: >- + Indicates whether the item is taxable (`true`) or non-taxable + (`false`). Default is `true`. + category_id: + type: optional> + docs: >- + The ID of the item's category, if any. Deprecated since 2023-12-13. + Use `CatalogItem.categories`, instead. + tax_ids: + type: optional>> + docs: >- + A set of IDs indicating the taxes enabled for + + this item. When updating an item, any taxes listed here will be added + to the item. + + Taxes may also be added to or deleted from an item using + `UpdateItemTaxes`. + modifier_list_info: + type: optional>> + docs: >- + A set of `CatalogItemModifierListInfo` objects + + representing the modifier lists that apply to this item, along with + the overrides and min + + and max limits that are specific to this item. Modifier lists + + may also be added to or deleted from an item using + `UpdateItemModifierLists`. + variations: + type: optional>> + docs: >- + A list of [CatalogItemVariation](entity:CatalogItemVariation) objects + for this item. An item must have + + at least one variation. + product_type: + type: optional + docs: >- + The product type of the item. Once set, the `product_type` value + cannot be modified. + + + Items of the `LEGACY_SQUARE_ONLINE_SERVICE` and + `LEGACY_SQUARE_ONLINE_MEMBERSHIP` product types can be updated + + but cannot be created using the API. + + See [CatalogItemProductType](#type-catalogitemproducttype) for + possible values + skip_modifier_screen: + type: optional> + docs: >- + If `false`, the Square Point of Sale app will present the + `CatalogItem`'s + + details screen immediately, allowing the merchant to choose + `CatalogModifier`s + + before adding the item to the cart. This is the default behavior. + + + If `true`, the Square Point of Sale app will immediately add the item + to the cart with the pre-selected + + modifiers, and merchants can edit modifiers by drilling down onto the + item's details. + + + Third-party clients are encouraged to implement similar behaviors. + item_options: + type: optional>> + docs: |- + List of item options IDs for this item. Used to manage and group item + variations in a specified order. + + Maximum: 6 item options. + ecom_uri: + type: optional> + docs: >- + Deprecated. A URI pointing to a published e-commerce product page for + the Item. + ecom_image_uris: + type: optional>> + docs: >- + Deprecated. A comma-separated list of encoded URIs pointing to a set + of published e-commerce images for the Item. + image_ids: + type: optional>> + docs: |- + The IDs of images associated with this `CatalogItem` instance. + These images will be shown to customers in Square Online Store. + The first image will show up as the icon for this item in POS. + sort_name: + type: optional> + docs: >- + A name to sort the item by. If this name is unspecified, namely, the + `sort_name` field is absent, the regular `name` field is used for + sorting. + + Its value must not be empty. + + + It is currently supported for sellers of the Japanese locale only. + categories: + type: optional>> + docs: The list of categories. + description_html: + type: optional> + docs: >- + The item's description as expressed in valid HTML elements. The length + of this field value, including those of HTML tags, + + is of Unicode points. With application query filters, the text values + of the HTML elements and attributes are searchable. Invalid or + + unsupported HTML elements or attributes are ignored. + + + Supported HTML elements include: + + - `a`: Link. Supports linking to website URLs, email address, and + telephone numbers. + + - `b`, `strong`: Bold text + + - `br`: Line break + + - `code`: Computer code + + - `div`: Section + + - `h1-h6`: Headings + + - `i`, `em`: Italics + + - `li`: List element + + - `ol`: Numbered list + + - `p`: Paragraph + + - `ul`: Bullet list + + - `u`: Underline + + + + Supported HTML attributes include: + + - `align`: Alignment of the text content + + - `href`: Link destination + + - `rel`: Relationship between link's target and source + + - `target`: Place to open the linked document + validation: + maxLength: 65535 + description_plaintext: + type: optional + docs: >- + A server-generated plaintext version of the `description_html` field, + without formatting tags. + validation: + maxLength: 65535 + access: read-only + channels: + type: optional>> + docs: >- + A list of IDs representing channels, such as a Square Online site, + where the item can be made visible or available. + + This field is read only and cannot be edited. + is_archived: + type: optional> + docs: Indicates whether this item is archived (`true`) or not (`false`). + ecom_seo_data: + type: optional + docs: The SEO data for a seller's Square Online store. + food_and_beverage_details: + type: optional + docs: The food and beverage-specific details for the `FOOD_AND_BEV` item. + reporting_category: + type: optional + docs: The item's reporting category. + is_alcoholic: + type: optional> + docs: Indicates whether this item is alcoholic (`true`) or not (`false`). + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetails: + docs: The food and beverage-specific details of a `FOOD_AND_BEV` item. + properties: + calorie_count: + type: optional> + docs: >- + The calorie count (in the unit of kcal) for the `FOOD_AND_BEV` type of + items. + dietary_preferences: + type: >- + optional>> + docs: The dietary preferences for the `FOOD_AND_BEV` item. + ingredients: + type: optional>> + docs: The ingredients for the `FOOD_AND_BEV` type item. + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetailsDietaryPreference: + docs: >- + Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its + ingredients. + properties: + type: + type: optional + docs: >- + The dietary preference type. Supported values include `STANDARD` and + `CUSTOM` as specified in + `FoodAndBeverageDetails.DietaryPreferenceType`. + + See [DietaryPreferenceType](#type-dietarypreferencetype) for possible + values + standard_name: + type: >- + optional + docs: >- + The name of the dietary preference from a standard pre-defined list. + This should be null if it's a custom dietary preference. + + See [StandardDietaryPreference](#type-standarddietarypreference) for + possible values + custom_name: + type: optional> + docs: >- + The name of a user-defined custom dietary preference. This should be + null if it's a standard dietary preference. + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference: + enum: + - DAIRY_FREE + - GLUTEN_FREE + - HALAL + - KOSHER + - NUT_FREE + - VEGAN + - VEGETARIAN + docs: >- + Standard dietary preferences for food and beverage items that are + recommended on item creation. + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetailsDietaryPreferenceType: + enum: + - STANDARD + - CUSTOM + docs: >- + The type of dietary preference for the `FOOD_AND_BEV` type of items and + integredients. + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetailsIngredient: + docs: Describes the ingredient used in a `FOOD_AND_BEV` item. + properties: + type: + type: optional + docs: >- + The dietary preference type of the ingredient. Supported values + include `STANDARD` and `CUSTOM` as specified in + `FoodAndBeverageDetails.DietaryPreferenceType`. + + See [DietaryPreferenceType](#type-dietarypreferencetype) for possible + values + standard_name: + type: >- + optional + docs: >- + The name of the ingredient from a standard pre-defined list. This + should be null if it's a custom dietary preference. + + See [StandardIngredient](#type-standardingredient) for possible values + custom_name: + type: optional> + docs: >- + The name of a custom user-defined ingredient. This should be null if + it's a standard dietary preference. + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient: + enum: + - CELERY + - CRUSTACEANS + - EGGS + - FISH + - GLUTEN + - LUPIN + - MILK + - MOLLUSCS + - MUSTARD + - PEANUTS + - SESAME + - SOY + - SULPHITES + - TREE_NUTS + docs: >- + Standard ingredients for food and beverage items that are recommended on + item creation. + source: + openapi: openapi/openapi.json + CatalogItemModifierListInfo: + docs: >- + Controls how a modifier list is applied to a specific item. This object + allows for item-specific customization of modifier list behavior + + and provides the ability to override global modifier list settings. + properties: + modifier_list_id: + type: string + docs: >- + The ID of the `CatalogModifierList` controlled by this + `CatalogModifierListInfo`. + validation: + minLength: 1 + modifier_overrides: + type: optional>> + docs: >- + A set of `CatalogModifierOverride` objects that override default + modifier settings for this item. + min_selected_modifiers: + type: optional> + docs: >- + The minimum number of modifiers that must be selected from this + modifier list. + + Values: + + + - 0: No selection is required. + + - -1: Default value, the attribute was not set by the client. When + `max_selected_modifiers` is + + also -1, use the minimum and maximum selection values set on the + `CatalogItemModifierList`. + + - >0: The required minimum modifier selections. This can be larger + than the total `CatalogModifiers` when `allow_quantities` is enabled. + + - < -1: Invalid. Treated as no selection required. + max_selected_modifiers: + type: optional> + docs: >- + The maximum number of modifiers that can be selected. + + Values: + + + - 0: No maximum limit. + + - -1: Default value, the attribute was not set by the client. When + `min_selected_modifiers` is + + also -1, use the minimum and maximum selection values set on the + `CatalogItemModifierList`. + + - >0: The maximum total modifier selections. This can be larger + than the total `CatalogModifiers` when `allow_quantities` is enabled. + + - < -1: Invalid. Treated as no maximum limit. + enabled: + type: optional> + docs: >- + If `true`, enable this `CatalogModifierList`. The default value is + `true`. + ordinal: + type: optional> + docs: >- + The position of this `CatalogItemModifierListInfo` object within the + `modifier_list_info` list applied + + to a `CatalogItem` instance. + allow_quantities: optional + is_conversational: optional + hidden_from_customer_override: optional + source: + openapi: openapi/openapi.json + CatalogItemOption: + docs: A group of variations for a `CatalogItem`. + properties: + name: + type: optional> + docs: >- + The item option's display name for the seller. Must be unique across + + all item options. This is a searchable attribute for use in applicable + query filters. + display_name: + type: optional> + docs: >- + The item option's display name for the customer. This is a searchable + attribute for use in applicable query filters. + description: + type: optional> + docs: >- + The item option's human-readable description. Displayed in the Square + + Point of Sale app for the seller and in the Online Store or on + receipts for + + the buyer. This is a searchable attribute for use in applicable query + filters. + show_colors: + type: optional> + docs: If true, display colors for entries in `values` when present. + values: + type: optional>> + docs: |- + A list of CatalogObjects containing the + `CatalogItemOptionValue`s for this item. + source: + openapi: openapi/openapi.json + CatalogItemOptionForItem: + docs: |2- + An option that can be assigned to an item. + For example, a t-shirt item may offer a color option or a size option. + properties: + item_option_id: + type: optional> + docs: >- + The unique id of the item option, used to form the dimensions of the + item option matrix in a specified order. + source: + openapi: openapi/openapi.json + CatalogItemOptionValue: + docs: |- + An enumerated value that can link a + `CatalogItemVariation` to an item option as one of + its item option values. + properties: + item_option_id: + type: optional> + docs: Unique ID of the associated item option. + name: + type: optional> + docs: >- + Name of this item option value. This is a searchable attribute for use + in applicable query filters. + description: + type: optional> + docs: >- + A human-readable description for the option value. This is a + searchable attribute for use in applicable query filters. + color: + type: optional> + docs: >- + The HTML-supported hex color for the item option (e.g., "#ff8d4e85"). + + Only displayed if `show_colors` is enabled on the parent `ItemOption`. + When + + left unset, `color` defaults to white ("#ffffff") when `show_colors` + is + + enabled on the parent `ItemOption`. + ordinal: + type: optional> + docs: Determines where this option value appears in a list of option values. + source: + openapi: openapi/openapi.json + CatalogItemOptionValueForItemVariation: + docs: >- + A `CatalogItemOptionValue` links an item variation to an item option as + + an item option value. For example, a t-shirt item may offer a color option + and + + a size option. An item option value would represent each variation of + t-shirt: + + For example, "Color:Red, Size:Small" or "Color:Blue, Size:Medium". + properties: + item_option_id: + type: optional> + docs: The unique id of an item option. + item_option_value_id: + type: optional> + docs: The unique id of the selected value for the item option. + source: + openapi: openapi/openapi.json + CatalogItemProductType: + enum: + - REGULAR + - GIFT_CARD + - APPOINTMENTS_SERVICE + - FOOD_AND_BEV + - EVENT + - DIGITAL + - DONATION + - LEGACY_SQUARE_ONLINE_SERVICE + - LEGACY_SQUARE_ONLINE_MEMBERSHIP + docs: >- + The type of a CatalogItem. Connect V2 only allows the creation of + `REGULAR` or `APPOINTMENTS_SERVICE` items. + source: + openapi: openapi/openapi.json + CatalogItemVariation: + docs: >- + An item variation, representing a product for sale, in the Catalog object + model. Each [item](entity:CatalogItem) must have at least one + + item variation and can have at most 250 item variations. + + + An item variation can be sellable, stockable, or both if it has a unit of + measure for its count for the sold number of the variation, the stocked + + number of the variation, or both. For example, when a variation + representing wine is stocked and sold by the bottle, the variation is both + + stockable and sellable. But when a variation of the wine is sold by the + glass, the sold units cannot be used as a measure of the stocked units. + This by-the-glass + + variation is sellable, but not stockable. To accurately keep track of the + wine's inventory count at any time, the sellable count must be + + converted to stockable count. Typically, the seller defines this unit + conversion. For example, 1 bottle equals 5 glasses. The Square API exposes + + the `stockable_conversion` property on the variation to specify the + conversion. Thus, when two glasses of the wine are sold, the sellable + count + + decreases by 2, and the stockable count automatically decreases by 0.4 + bottle according to the conversion. + properties: + item_id: + type: optional> + docs: The ID of the `CatalogItem` associated with this item variation. + name: + type: optional> + docs: >- + The item variation's name. This is a searchable attribute for use in + applicable query filters. + + + Its value has a maximum length of 255 Unicode code points. However, + when the parent [item](entity:CatalogItem) + + uses [item options](entity:CatalogItemOption), this attribute is + auto-generated, read-only, and can be + + longer than 255 Unicode code points. + sku: + type: optional> + docs: >- + The item variation's SKU, if any. This is a searchable attribute for + use in applicable query filters. + upc: + type: optional> + docs: >- + The universal product code (UPC) of the item variation, if any. This + is a searchable attribute for use in applicable query filters. + + + The value of this attribute should be a number of 12-14 digits long. + This restriction is enforced on the Square Seller Dashboard, + + Square Point of Sale or Retail Point of Sale apps, where this + attribute shows in the GTIN field. If a non-compliant UPC value is + assigned + + to this attribute using the API, the value is not editable on the + Seller Dashboard, Square Point of Sale or Retail Point of Sale apps + + unless it is updated to fit the expected format. + ordinal: + type: optional + docs: >- + The order in which this item variation should be displayed. This value + is read-only. On writes, the ordinal + + for each item variation within a parent `CatalogItem` is set according + to the item variations's + + position. On reads, the value is not guaranteed to be sequential or + unique. + access: read-only + pricing_type: + type: optional + docs: >- + Indicates whether the item variation's price is fixed or determined at + the time + + of sale. + + See [CatalogPricingType](#type-catalogpricingtype) for possible values + price_money: + type: optional + docs: The item variation's price, if fixed pricing is used. + location_overrides: + type: optional>> + docs: Per-location price and inventory overrides. + track_inventory: + type: optional> + docs: If `true`, inventory tracking is active for the variation. + inventory_alert_type: + type: optional + docs: >- + Indicates whether the item variation displays an alert when its + inventory quantity is less than or equal + + to its `inventory_alert_threshold`. + + See [InventoryAlertType](#type-inventoryalerttype) for possible values + inventory_alert_threshold: + type: optional> + docs: >- + If the inventory quantity for the variation is less than or equal to + this value and `inventory_alert_type` + + is `LOW_QUANTITY`, the variation displays an alert in the merchant + dashboard. + + + This value is always an integer. + user_data: + type: optional> + docs: >- + Arbitrary user metadata to associate with the item variation. This + attribute value length is of Unicode code points. + validation: + maxLength: 255 + service_duration: + type: optional> + docs: >- + If the `CatalogItem` that owns this item variation is of type + + `APPOINTMENTS_SERVICE`, then this is the duration of the service in + milliseconds. For + + example, a 30 minute appointment would have the value `1800000`, which + is equal to + + 30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per + second). + available_for_booking: + type: optional> + docs: >- + If the `CatalogItem` that owns this item variation is of type + + `APPOINTMENTS_SERVICE`, a bool representing whether this service is + available for booking. + item_option_values: + type: optional>> + docs: |- + List of item option values associated with this item variation. Listed + in the same order as the item options of the parent item. + measurement_unit_id: + type: optional> + docs: >- + ID of the ‘CatalogMeasurementUnit’ that is used to measure the + quantity + + sold of this item variation. If left unset, the item will be sold in + + whole quantities. + sellable: + type: optional> + docs: >- + Whether this variation can be sold. The inventory count of a sellable + variation indicates + + the number of units available for sale. When a variation is both + stockable and sellable, + + its sellable inventory count can be smaller than or equal to its + stockable count. + stockable: + type: optional> + docs: >- + Whether stock is counted directly on this variation (TRUE) or only on + its components (FALSE). + + When a variation is both stockable and sellable, the inventory count + of a stockable variation keeps track of the number of units of this + variation in stock + + and is not an indicator of the number of units of the variation that + can be sold. + image_ids: + type: optional>> + docs: >- + The IDs of images associated with this `CatalogItemVariation` + instance. + + These images will be shown to customers in Square Online Store. + team_member_ids: + type: optional>> + docs: >- + Tokens of employees that can perform the service represented by this + variation. Only valid for + + variations of type `APPOINTMENTS_SERVICE`. + stockable_conversion: + type: optional + docs: >- + The unit conversion rule, as prescribed by the + [CatalogStockConversion](entity:CatalogStockConversion) type, + + that describes how this non-stockable (i.e., sellable/receivable) item + variation is converted + + to/from the stockable item variation sharing the same parent item. + With the stock conversion, + + you can accurately track inventory when an item variation is sold in + one unit, but stocked in + + another unit. + source: + openapi: openapi/openapi.json + CatalogMeasurementUnit: + docs: |- + Represents the unit used to measure a `CatalogItemVariation` and + specifies the precision for decimal quantities. + properties: + measurement_unit: + type: optional + docs: >- + Indicates the unit used to measure the quantity of a catalog item + variation. + precision: + type: optional> + docs: >- + An integer between 0 and 5 that represents the maximum number of + + positions allowed after the decimal in quantities measured with this + unit. + + For example: + + + - if the precision is 0, the quantity can be 1, 2, 3, etc. + + - if the precision is 1, the quantity can be 0.1, 0.2, etc. + + - if the precision is 2, the quantity can be 0.01, 0.12, etc. + + + Default: 3 + source: + openapi: openapi/openapi.json + CatalogModifier: + docs: >- + A modifier that can be applied to items at the time of sale. For example, + a cheese modifier for a burger, or a flavor modifier for a serving of ice + cream. + properties: + name: + type: optional> + docs: >- + The modifier name. This is a searchable attribute for use in + applicable query filters, and its value length is of Unicode code + points. + validation: + maxLength: 255 + price_money: + type: optional + docs: The modifier price. + on_by_default: + type: optional> + docs: >- + When `true`, this modifier is selected by default when displaying the + modifier list. + + This setting can be overridden at the item level using + `CatalogModifierListInfo.modifier_overrides`. + ordinal: + type: optional> + docs: >- + Determines where this `CatalogModifier` appears in the + `CatalogModifierList`. + modifier_list_id: + type: optional> + docs: The ID of the `CatalogModifierList` associated with this modifier. + location_overrides: + type: optional>> + docs: Location-specific price overrides. + image_id: + type: optional> + docs: >- + The ID of the image associated with this `CatalogModifier` instance. + + Currently this image is not displayed by Square, but is free to be + displayed in 3rd party applications. + hidden_online: + type: optional> + docs: >- + When `true`, this modifier is hidden from online ordering channels. + This setting can be overridden at the item level using + `CatalogModifierListInfo.modifier_overrides`. + source: + openapi: openapi/openapi.json + CatalogModifierList: + docs: >- + A container for a list of modifiers, or a text-based modifier. + + For text-based modifiers, this represents text configuration for an item. + (For example, custom text to print on a t-shirt). + + For non text-based modifiers, this represents a list of modifiers that can + be applied to items at the time of sale. + + (For example, a list of condiments for a hot dog, or a list of ice cream + flavors). + + Each element of the modifier list is a `CatalogObject` instance of the + `MODIFIER` type. + properties: + name: + type: optional> + docs: >- + The name of the `CatalogModifierList` instance. This is a searchable + attribute for use in applicable query filters, and its value length is + of + + Unicode code points. + validation: + maxLength: 255 + ordinal: + type: optional> + docs: >- + The position of this `CatalogModifierList` within a list of + `CatalogModifierList` instances. + selection_type: + type: optional + docs: >- + __Deprecated__: Indicates whether a single (`SINGLE`) modifier or + multiple (`MULTIPLE`) modifiers can be selected. Use + + `min_selected_modifiers` and `max_selected_modifiers` instead. + + See + [CatalogModifierListSelectionType](#type-catalogmodifierlistselectiontype) + for possible values + modifiers: + type: optional>> + docs: >- + A non-empty list of `CatalogModifier` objects to be included in the + `CatalogModifierList`, + + for non text-based modifiers when the `modifier_type` attribute is + `LIST`. Each element of this list + + is a `CatalogObject` instance of the `MODIFIER` type, containing the + following attributes: + + ``` + + { + + "id": "{{catalog_modifier_id}}", + + "type": "MODIFIER", + + "modifier_data": {{a CatalogModifier instance>}} + + } + + ``` + image_ids: + type: optional>> + docs: >- + The IDs of images associated with this `CatalogModifierList` instance. + + Currently these images are not displayed on Square products, but may + be displayed in 3rd-party applications. + allow_quantities: + type: optional> + docs: >- + When `true`, allows multiple quantities of the same modifier to be + selected. + is_conversational: + type: optional> + docs: True if modifiers belonging to this list can be used conversationally. + modifier_type: + type: optional + docs: >- + The type of the modifier. + + + When this `modifier_type` value is `TEXT`, the `CatalogModifierList` + represents a text-based modifier. + + When this `modifier_type` value is `LIST`, the `CatalogModifierList` + contains a list of `CatalogModifier` objects. + + See + [CatalogModifierListModifierType](#type-catalogmodifierlistmodifiertype) + for possible values + max_length: + type: optional> + docs: >- + The maximum length, in Unicode points, of the text string of the + text-based modifier as represented by + + this `CatalogModifierList` object with the `modifier_type` set to + `TEXT`. + text_required: + type: optional> + docs: >- + Whether the text string must be a non-empty string (`true`) or not + (`false`) for a text-based modifier + + as represented by this `CatalogModifierList` object with the + `modifier_type` set to `TEXT`. + internal_name: + type: optional> + docs: >- + A note for internal use by the business. + + + For example, for a text-based modifier applied to a T-shirt item, if + the buyer-supplied text of "Hello, Kitty!" + + is to be printed on the T-shirt, this `internal_name` attribute can be + "Use italic face" as + + an instruction for the business to follow. + + + For non text-based modifiers, this `internal_name` attribute can be + + used to include SKUs, internal codes, or supplemental descriptions for + internal use. + validation: + maxLength: 512 + min_selected_modifiers: + type: optional> + docs: >- + The minimum number of modifiers that must be selected from this list. + The value can be overridden with `CatalogItemModifierListInfo`. + + + Values: + + + - 0: No selection is required. + + - -1: Default value, the attribute was not set by the client. Treated + as no selection required. + + - >0: The required minimum modifier selections. This can be larger + than the total `CatalogModifiers` when `allow_quantities` is enabled. + + - < -1: Invalid. Treated as no selection required. + max_selected_modifiers: + type: optional> + docs: >- + The maximum number of modifiers that must be selected from this list. + The value can be overridden with `CatalogItemModifierListInfo`. + + + Values: + + + - 0: No maximum limit. + + - -1: Default value, the attribute was not set by the client. Treated + as no maximum limit. + + - >0: The maximum total modifier selections. This can be larger + than the total `CatalogModifiers` when `allow_quantities` is enabled. + + - < -1: Invalid. Treated as no maximum limit. + hidden_from_customer: + type: optional> + docs: >- + If `true`, modifiers from this list are hidden from customer receipts. + The default value is `false`. + + This setting can be overridden with + `CatalogItemModifierListInfo.hidden_from_customer_override`. + source: + openapi: openapi/openapi.json + CatalogModifierListModifierType: + enum: + - LIST + - TEXT + docs: Defines the type of `CatalogModifierList`. + source: + openapi: openapi/openapi.json + CatalogModifierListSelectionType: + enum: + - SINGLE + - MULTIPLE + docs: Indicates whether a CatalogModifierList supports multiple selections. + source: + openapi: openapi/openapi.json + CatalogModifierOverride: + docs: >- + Options to control how to override the default behavior of the specified + modifier. + properties: + modifier_id: + type: string + docs: >- + The ID of the `CatalogModifier` whose default behavior is being + overridden. + validation: + minLength: 1 + on_by_default: + type: optional> + docs: '__Deprecated__: Use `on_by_default_override` instead.' + hidden_online_override: optional + on_by_default_override: optional + source: + openapi: openapi/openapi.json + CatalogObject: + discriminant: type + base-properties: {} + docs: >- + The wrapper object for the catalog entries of a given object type. + + + Depending on the `type` attribute value, a `CatalogObject` instance + assumes a type-specific data to yield the corresponding type of catalog + object. + + + For example, if `type=ITEM`, the `CatalogObject` instance must have the + ITEM-specific data set on the `item_data` attribute. The resulting + `CatalogObject` instance is also a `CatalogItem` instance. + + + In general, if `type=`, the `CatalogObject` instance must + have the ``-specific data set on the `_data` + attribute. The resulting `CatalogObject` instance is also a + `Catalog` instance. + + + For a more detailed discussion of the Catalog data model, please see the + + [Design a + Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) + guide. + union: + ITEM: CatalogObjectItem + IMAGE: CatalogObjectImage + CATEGORY: CatalogObjectCategory + ITEM_VARIATION: CatalogObjectItemVariation + TAX: CatalogObjectTax + DISCOUNT: CatalogObjectDiscount + MODIFIER_LIST: CatalogObjectModifierList + MODIFIER: CatalogObjectModifier + PRICING_RULE: CatalogObjectPricingRule + PRODUCT_SET: CatalogObjectProductSet + TIME_PERIOD: CatalogObjectTimePeriod + MEASUREMENT_UNIT: CatalogObjectMeasurementUnit + SUBSCRIPTION_PLAN_VARIATION: CatalogObjectSubscriptionPlanVariation + ITEM_OPTION: CatalogObjectItemOption + ITEM_OPTION_VAL: CatalogObjectItemOptionValue + CUSTOM_ATTRIBUTE_DEFINITION: CatalogObjectCustomAttributeDefinition + QUICK_AMOUNTS_SETTINGS: CatalogObjectQuickAmountsSettings + SUBSCRIPTION_PLAN: CatalogObjectSubscriptionPlan + AVAILABILITY_PERIOD: CatalogObjectAvailabilityPeriod + source: + openapi: openapi/openapi.json + CatalogObjectBatch: + docs: A batch of catalog objects. + properties: + objects: + docs: A list of CatalogObjects belonging to this batch. + type: list + source: + openapi: openapi/openapi.json + CatalogObjectCategory: + docs: >- + A category that can be assigned to an item or a parent category that can + be assigned + + to another category. For example, a clothing category can be assigned to a + t-shirt item or + + be made as the parent category to the pants category. + properties: + id: + type: optional + docs: The ID of the object's category. + ordinal: + type: optional> + docs: The order of the object within the context of the category. + category_data: + type: optional + docs: >- + Structured data for a `CatalogCategory`, set for CatalogObjects of + type `CATEGORY`. + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` + + would indicate the UTC time (denoted by `Z`) of August 15, 2016 at + 23:59:33 and 123 milliseconds. + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + If `true`, the object has been deleted from the database. Must be + `false` for new objects + + being inserted. When deleted, the `updated_at` field will equal the + deletion time. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + The Connect v1 IDs for this object at each location where it is + present, where they + + differ from the object's Connect V2 ID. The field will only be present + for objects that + + have been created or modified by legacy APIs. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectBase: + properties: + id: + type: string + docs: >- + An identifier to reference this object in the catalog. When a new + `CatalogObject` + + is inserted, the client should set the id to a temporary identifier + starting with + + a "`#`" character. Other objects being inserted or updated within the + same request + + may use this identifier to refer to the new object. + + + When the server receives the new object, it will supply a unique + identifier that + + replaces the temporary identifier for all future references. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` + + would indicate the UTC time (denoted by `Z`) of August 15, 2016 at + 23:59:33 and 123 milliseconds. + access: read-only + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + supplied + + must match the version in the database, otherwise the write will be + rejected as conflicting. + is_deleted: + type: optional + docs: >- + If `true`, the object has been deleted from the database. Must be + `false` for new objects + + being inserted. When deleted, the `updated_at` field will equal the + deletion time. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + The Connect v1 IDs for this object at each location where it is + present, where they + + differ from the object's Connect V2 ID. The field will only be present + for objects that + + have been created or modified by legacy APIs. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectReference: + docs: >- + A reference to a Catalog object at a specific version. In general this is + + used as an entry point into a graph of catalog objects, where the objects + exist + + at a specific version. + properties: + object_id: + type: optional> + docs: The ID of the referenced object. + catalog_version: + type: optional> + docs: The version of the object. + source: + openapi: openapi/openapi.json + CatalogObjectType: + enum: + - ITEM + - IMAGE + - CATEGORY + - ITEM_VARIATION + - TAX + - DISCOUNT + - MODIFIER_LIST + - MODIFIER + - PRICING_RULE + - PRODUCT_SET + - TIME_PERIOD + - MEASUREMENT_UNIT + - SUBSCRIPTION_PLAN_VARIATION + - ITEM_OPTION + - ITEM_OPTION_VAL + - CUSTOM_ATTRIBUTE_DEFINITION + - QUICK_AMOUNTS_SETTINGS + - SUBSCRIPTION_PLAN + - AVAILABILITY_PERIOD + docs: >- + Possible types of CatalogObjects returned from the catalog, each + + containing type-specific properties in the `*_data` field corresponding to + the specified object type. + source: + openapi: openapi/openapi.json + CatalogPricingRule: + docs: >- + Defines how discounts are automatically applied to a set of items that + match the pricing rule + + during the active time period. + properties: + name: + type: optional> + docs: |- + User-defined name for the pricing rule. For example, "Buy one get one + free" or "10% off". + time_period_ids: + type: optional>> + docs: >- + A list of unique IDs for the catalog time periods when + + this pricing rule is in effect. If left unset, the pricing rule is + always + + in effect. + discount_id: + type: optional> + docs: |- + Unique ID for the `CatalogDiscount` to take off + the price of all matched items. + match_products_id: + type: optional> + docs: >- + Unique ID for the `CatalogProductSet` that will be matched by this + rule. A match rule + + matches within the entire cart, and can match multiple times. This + field will always be set. + apply_products_id: + type: optional> + docs: >- + __Deprecated__: Please use the `exclude_products_id` field to apply + + an exclude set instead. Exclude sets allow better control over + quantity + + ranges and offer more flexibility for which matched items receive a + discount. + + + `CatalogProductSet` to apply the pricing to. + + An apply rule matches within the subset of the cart that fits the + match rules (the match set). + + An apply rule can only match once in the match set. + + If not supplied, the pricing will be applied to all products in the + match set. + + Other products retain their base price, or a price generated by other + rules. + exclude_products_id: + type: optional> + docs: >- + `CatalogProductSet` to exclude from the pricing rule. + + An exclude rule matches within the subset of the cart that fits the + match rules (the match set). + + An exclude rule can only match once in the match set. + + If not supplied, the pricing will be applied to all products in the + match set. + + Other products retain their base price, or a price generated by other + rules. + valid_from_date: + type: optional> + docs: >- + Represents the date the Pricing Rule is valid from. Represented in RFC + 3339 full-date format (YYYY-MM-DD). + valid_from_local_time: + type: optional> + docs: >- + Represents the local time the pricing rule should be valid from. + Represented in RFC 3339 partial-time format + + (HH:MM:SS). Partial seconds will be truncated. + valid_until_date: + type: optional> + docs: >- + Represents the date the Pricing Rule is valid until. Represented in + RFC 3339 full-date format (YYYY-MM-DD). + valid_until_local_time: + type: optional> + docs: >- + Represents the local time the pricing rule should be valid until. + Represented in RFC 3339 partial-time format + + (HH:MM:SS). Partial seconds will be truncated. + exclude_strategy: + type: optional + docs: >- + If an `exclude_products_id` was given, controls which subset of + matched + + products is excluded from any discounts. + + + Default value: `LEAST_EXPENSIVE` + + See [ExcludeStrategy](#type-excludestrategy) for possible values + minimum_order_subtotal_money: + type: optional + docs: |- + The minimum order subtotal (before discounts or taxes are applied) + that must be met before this rule may be applied. + customer_group_ids_any: + type: optional>> + docs: >- + A list of IDs of customer groups, the members of which are eligible + for discounts specified in this pricing rule. + + Notice that a group ID is generated by the Customers API. + + If this field is not set, the specified discount applies to matched + products sold to anyone whether the buyer + + has a customer profile created or not. If this + `customer_group_ids_any` field is set, the specified discount + + applies only to matched products sold to customers belonging to the + specified customer groups. + source: + openapi: openapi/openapi.json + CatalogPricingType: + enum: + - FIXED_PRICING + - VARIABLE_PRICING + docs: >- + Indicates whether the price of a CatalogItemVariation should be entered + manually at the time of sale. + source: + openapi: openapi/openapi.json + CatalogProductSet: + docs: >- + Represents a collection of catalog objects for the purpose of applying a + + `PricingRule`. Including a catalog object will include all of its + subtypes. + + For example, including a category in a product set will include all of its + + items and associated item variations in the product set. Including an item + in + + a product set will also include its item variations. + properties: + name: + type: optional> + docs: |- + User-defined name for the product set. For example, "Clearance Items" + or "Winter Sale Items". + product_ids_any: + type: optional>> + docs: >2- + Unique IDs for any `CatalogObject` included in this product set. Any + number of these catalog objects can be in an order for a pricing rule + to apply. + + + This can be used with `product_ids_all` in a parent + `CatalogProductSet` to + + match groups of products for a bulk discount, such as a discount for + an + + entree and side combo. + + + Only one of `product_ids_all`, `product_ids_any`, or `all_products` + can be set. + + + Max: 500 catalog object IDs. + product_ids_all: + type: optional>> + docs: >- + Unique IDs for any `CatalogObject` included in this product set. + + All objects in this set must be included in an order for a pricing + rule to apply. + + + Only one of `product_ids_all`, `product_ids_any`, or `all_products` + can be set. + + + Max: 500 catalog object IDs. + quantity_exact: + type: optional> + docs: >- + If set, there must be exactly this many items from `products_any` or + `products_all` + + in the cart for the discount to apply. + + + Cannot be combined with either `quantity_min` or `quantity_max`. + quantity_min: + type: optional> + docs: >- + If set, there must be at least this many items from `products_any` or + `products_all` + + in a cart for the discount to apply. See `quantity_exact`. Defaults to + 0 if + + `quantity_exact`, `quantity_min` and `quantity_max` are all + unspecified. + quantity_max: + type: optional> + docs: >- + If set, the pricing rule will apply to a maximum of this many items + from + + `products_any` or `products_all`. + all_products: + type: optional> + docs: >- + If set to `true`, the product set will include every item in the + catalog. + + Only one of `product_ids_all`, `product_ids_any`, or `all_products` + can be set. + source: + openapi: openapi/openapi.json + CatalogQuery: + docs: >- + A query composed of one or more different types of filters to narrow the + scope of targeted objects when calling the `SearchCatalogObjects` + endpoint. + + + Although a query can have multiple filters, only certain query types can + be combined per call to + [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). + + Any combination of the following types may be used together: + + - [exact_query](entity:CatalogQueryExact) + + - [prefix_query](entity:CatalogQueryPrefix) + + - [range_query](entity:CatalogQueryRange) + + - [sorted_attribute_query](entity:CatalogQuerySortedAttribute) + + - [text_query](entity:CatalogQueryText) + + + All other query types cannot be combined with any others. + + + When a query filter is based on an attribute, the attribute must be + searchable. + + Searchable attributes are listed as follows, along their parent types that + can be searched for with applicable query filters. + + + Searchable attribute and objects queryable by searchable attributes: + + - `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, + `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, `CatalogModifierList`, + `CatalogItemOption`, `CatalogItemOptionValue` + + - `description`: `CatalogItem`, `CatalogItemOptionValue` + + - `abbreviation`: `CatalogItem` + + - `upc`: `CatalogItemVariation` + + - `sku`: `CatalogItemVariation` + + - `caption`: `CatalogImage` + + - `display_name`: `CatalogItemOption` + + + For example, to search for [CatalogItem](entity:CatalogItem) objects by + searchable attributes, you can use + + the `"name"`, `"description"`, or `"abbreviation"` attribute in an + applicable query filter. + properties: + sorted_attribute_query: + type: optional + docs: >- + A query expression to sort returned query result by the given + attribute. + exact_query: + type: optional + docs: >- + An exact query expression to return objects with attribute name and + value + + matching the specified attribute name and value exactly. Value + matching is case insensitive. + set_query: + type: optional + docs: >- + A set query expression to return objects with attribute name and value + + matching the specified attribute name and any of the specified + attribute values exactly. + + Value matching is case insensitive. + prefix_query: + type: optional + docs: >- + A prefix query expression to return objects with attribute values + + that have a prefix matching the specified string value. Value matching + is case insensitive. + range_query: + type: optional + docs: |- + A range query expression to return objects with numeric values + that lie in the specified range. + text_query: + type: optional + docs: >- + A text query expression to return objects whose searchable attributes + contain all of the given + + keywords, irrespective of their order. For example, if a `CatalogItem` + contains custom attribute values of + + `{"name": "t-shirt"}` and `{"description": "Small, Purple"}`, the + query filter of `{"keywords": ["shirt", "sma", "purp"]}` + + returns this item. + items_for_tax_query: + type: optional + docs: >- + A query expression to return items that have any of the specified + taxes (as identified by the corresponding `CatalogTax` object IDs) + enabled. + items_for_modifier_list_query: + type: optional + docs: >- + A query expression to return items that have any of the given modifier + list (as identified by the corresponding `CatalogModifierList`s IDs) + enabled. + items_for_item_options_query: + type: optional + docs: >- + A query expression to return items that contains the specified item + options (as identified the corresponding `CatalogItemOption` IDs). + item_variations_for_item_option_values_query: + type: optional + docs: >- + A query expression to return item variations (of the + [CatalogItemVariation](entity:CatalogItemVariation) type) that + + contain all of the specified `CatalogItemOption` IDs. + source: + openapi: openapi/openapi.json + CatalogQueryExact: + docs: >- + The query filter to return the search result by exact match of the + specified attribute name and value. + properties: + attribute_name: + type: string + docs: >- + The name of the attribute to be searched. Matching of the attribute + name is exact. + validation: + minLength: 1 + attribute_value: + type: string + docs: >- + The desired value of the search attribute. Matching of the attribute + value is case insensitive and can be partial. + + For example, if a specified value of "sma", objects with the named + attribute value of "Small", "small" are both matched. + source: + openapi: openapi/openapi.json + CatalogQueryItemVariationsForItemOptionValues: + docs: >- + The query filter to return the item variations containing the specified + item option value IDs. + properties: + item_option_value_ids: + type: optional>> + docs: >- + A set of `CatalogItemOptionValue` IDs to be used to find associated + + `CatalogItemVariation`s. All ItemVariations that contain all of the + given + + Item Option Values (in any order) will be returned. + source: + openapi: openapi/openapi.json + CatalogQueryItemsForItemOptions: + docs: >- + The query filter to return the items containing the specified item option + IDs. + properties: + item_option_ids: + type: optional>> + docs: >- + A set of `CatalogItemOption` IDs to be used to find associated + + `CatalogItem`s. All Items that contain all of the given Item Options + (in any order) + + will be returned. + source: + openapi: openapi/openapi.json + CatalogQueryItemsForModifierList: + docs: >- + The query filter to return the items containing the specified modifier + list IDs. + properties: + modifier_list_ids: + docs: >- + A set of `CatalogModifierList` IDs to be used to find associated + `CatalogItem`s. + type: list + source: + openapi: openapi/openapi.json + CatalogQueryItemsForTax: + docs: The query filter to return the items containing the specified tax IDs. + properties: + tax_ids: + docs: >- + A set of `CatalogTax` IDs to be used to find associated + `CatalogItem`s. + type: list + source: + openapi: openapi/openapi.json + CatalogQueryPrefix: + docs: >- + The query filter to return the search result whose named attribute values + are prefixed by the specified attribute value. + properties: + attribute_name: + type: string + docs: The name of the attribute to be searched. + validation: + minLength: 1 + attribute_prefix: + type: string + docs: The desired prefix of the search attribute value. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + CatalogQueryRange: + docs: >- + The query filter to return the search result whose named attribute values + fall between the specified range. + properties: + attribute_name: + type: string + docs: The name of the attribute to be searched. + validation: + minLength: 1 + attribute_min_value: + type: optional> + docs: The desired minimum value for the search attribute (inclusive). + attribute_max_value: + type: optional> + docs: The desired maximum value for the search attribute (inclusive). + source: + openapi: openapi/openapi.json + CatalogQuerySet: + docs: >- + The query filter to return the search result(s) by exact match of the + specified `attribute_name` and any of + + the `attribute_values`. + properties: + attribute_name: + type: string + docs: >- + The name of the attribute to be searched. Matching of the attribute + name is exact. + validation: + minLength: 1 + attribute_values: + docs: >- + The desired values of the search attribute. Matching of the attribute + values is exact and case insensitive. + + A maximum of 250 values may be searched in a request. + type: list + source: + openapi: openapi/openapi.json + CatalogQuerySortedAttribute: + docs: The query expression to specify the key to sort search results. + properties: + attribute_name: + type: string + docs: The attribute whose value is used as the sort key. + validation: + minLength: 1 + initial_attribute_value: + type: optional> + docs: >- + The first attribute value to be returned by the query. Ascending sorts + will return only + + objects with this value or greater, while descending sorts will return + only objects with this value + + or less. If unset, start at the beginning (for ascending sorts) or end + (for descending sorts). + sort_order: + type: optional + docs: |- + The desired sort order, `"ASC"` (ascending) or `"DESC"` (descending). + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + CatalogQueryText: + docs: >- + The query filter to return the search result whose searchable attribute + values contain all of the specified keywords or tokens, independent of the + token order or case. + properties: + keywords: + docs: >- + A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 + alphanumeric characters are ignored. + type: list + source: + openapi: openapi/openapi.json + CatalogQuickAmount: + docs: Represents a Quick Amount in the Catalog. + properties: + type: + type: CatalogQuickAmountType + docs: >- + Represents the type of the Quick Amount. + + See [CatalogQuickAmountType](#type-catalogquickamounttype) for + possible values + amount: + type: Money + docs: Represents the actual amount of the Quick Amount with Money type. + score: + type: optional> + docs: >- + Describes the ranking of the Quick Amount provided by machine learning + model, in the range [0, 100]. + + MANUAL type amount will always have score = 100. + ordinal: + type: optional> + docs: The order in which this Quick Amount should be displayed. + source: + openapi: openapi/openapi.json + CatalogQuickAmountType: + enum: + - QUICK_AMOUNT_TYPE_MANUAL + - QUICK_AMOUNT_TYPE_AUTO + docs: Determines the type of a specific Quick Amount. + source: + openapi: openapi/openapi.json + CatalogQuickAmountsSettings: + docs: >- + A parent Catalog Object model represents a set of Quick Amounts and the + settings control the amounts. + properties: + option: + type: CatalogQuickAmountsSettingsOption + docs: >- + Represents the option seller currently uses on Quick Amounts. + + See + [CatalogQuickAmountsSettingsOption](#type-catalogquickamountssettingsoption) + for possible values + eligible_for_auto_amounts: + type: optional> + docs: >- + Represents location's eligibility for auto amounts + + The boolean should be consistent with whether there are AUTO amounts + in the `amounts`. + amounts: + type: optional>> + docs: Represents a set of Quick Amounts at this location. + source: + openapi: openapi/openapi.json + CatalogQuickAmountsSettingsOption: + enum: + - DISABLED + - MANUAL + - AUTO + docs: Determines a seller's option on Quick Amounts feature. + source: + openapi: openapi/openapi.json + CatalogStockConversion: + docs: >- + Represents the rule of conversion between a stockable + [CatalogItemVariation](entity:CatalogItemVariation) + + and a non-stockable sell-by or receive-by `CatalogItemVariation` that + + share the same underlying stock. + properties: + stockable_item_variation_id: + type: string + docs: >- + References to the stockable + [CatalogItemVariation](entity:CatalogItemVariation) + + for this stock conversion. Selling, receiving or recounting the + non-stockable `CatalogItemVariation` + + defined with a stock conversion results in adjustments of this + stockable `CatalogItemVariation`. + + This immutable field must reference a stockable `CatalogItemVariation` + + that shares the parent [CatalogItem](entity:CatalogItem) of the + converted `CatalogItemVariation.` + validation: + minLength: 1 + stockable_quantity: + type: string + docs: >- + The quantity of the stockable item variation (as identified by + `stockable_item_variation_id`) + + equivalent to the non-stockable item variation quantity (as specified + in `nonstockable_quantity`) + + as defined by this stock conversion. It accepts a decimal number in a + string format that can take + + up to 10 digits before the decimal point and up to 5 digits after the + decimal point. + validation: + minLength: 1 + maxLength: 16 + nonstockable_quantity: + type: string + docs: >- + The converted equivalent quantity of the non-stockable + [CatalogItemVariation](entity:CatalogItemVariation) + + in its measurement unit. The `stockable_quantity` value and this + `nonstockable_quantity` value together + + define the conversion ratio between stockable item variation and the + non-stockable item variation. + + It accepts a decimal number in a string format that can take up to 10 + digits before the decimal point + + and up to 5 digits after the decimal point. + validation: + minLength: 1 + maxLength: 16 + source: + openapi: openapi/openapi.json + CatalogSubscriptionPlan: + docs: >- + Describes a subscription plan. A subscription plan represents what you + want to sell in a subscription model, and includes references to each of + the associated subscription plan variations. + + For more information, see [Subscription Plans and + Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). + properties: + name: + type: string + docs: The name of the plan. + phases: + type: optional>> + docs: >- + A list of SubscriptionPhase containing the + [SubscriptionPhase](entity:SubscriptionPhase) for this plan. + + This field it required. Not including this field will throw a + REQUIRED_FIELD_MISSING error + subscription_plan_variations: + type: optional>> + docs: The list of subscription plan variations available for this product + eligible_item_ids: + type: optional>> + docs: >- + The list of IDs of `CatalogItems` that are eligible for subscription + by this SubscriptionPlan's variations. + eligible_category_ids: + type: optional>> + docs: >- + The list of IDs of `CatalogCategory` that are eligible for + subscription by this SubscriptionPlan's variations. + all_items: + type: optional> + docs: >- + If true, all items in the merchant's catalog are subscribable by this + SubscriptionPlan. + source: + openapi: openapi/openapi.json + CatalogSubscriptionPlanVariation: + docs: >- + Describes a subscription plan variation. A subscription plan variation + represents how the subscription for a product or service is sold. + + For more information, see [Subscription Plans and + Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). + properties: + name: + type: string + docs: The name of the plan variation. + phases: + docs: >- + A list containing each [SubscriptionPhase](entity:SubscriptionPhase) + for this plan variation. + type: list + subscription_plan_id: + type: optional> + docs: The id of the subscription plan, if there is one. + monthly_billing_anchor_date: + type: optional> + docs: The day of the month the billing period starts. + can_prorate: + type: optional> + docs: Whether bills for this plan variation can be split for proration. + successor_plan_variation_id: + type: optional> + docs: >- + The ID of a "successor" plan variation to this one. If the field is + set, and this object is disabled at all + + locations, it indicates that this variation is deprecated and the + object identified by the successor ID be used in + + its stead. + source: + openapi: openapi/openapi.json + CatalogTax: + docs: A tax applicable to an item. + properties: + name: + type: optional> + docs: >- + The tax's name. This is a searchable attribute for use in applicable + query filters, and its value length is of Unicode code points. + validation: + maxLength: 255 + calculation_phase: + type: optional + docs: >- + Whether the tax is calculated based on a payment's subtotal or total. + + See [TaxCalculationPhase](#type-taxcalculationphase) for possible + values + inclusion_type: + type: optional + docs: |- + Whether the tax is `ADDITIVE` or `INCLUSIVE`. + See [TaxInclusionType](#type-taxinclusiontype) for possible values + percentage: + type: optional> + docs: >- + The percentage of the tax in decimal form, using a `'.'` as the + decimal separator and without a `'%'` sign. + + A value of `7.5` corresponds to 7.5%. For a location-specific tax + rate, contact the tax authority of the location or a tax consultant. + applies_to_custom_amounts: + type: optional> + docs: >- + If `true`, the fee applies to custom amounts entered into the Square + Point of Sale + + app that are not associated with a particular `CatalogItem`. + enabled: + type: optional> + docs: >- + A Boolean flag to indicate whether the tax is displayed as enabled + (`true`) in the Square Point of Sale app or not (`false`). + applies_to_product_set_id: + type: optional> + docs: >- + The ID of a `CatalogProductSet` object. If set, the tax is applicable + to all products in the product set. + source: + openapi: openapi/openapi.json + CatalogTimePeriod: + docs: Represents a time period - either a single period or a repeating period. + properties: + event: + type: optional> + docs: >- + An iCalendar (RFC 5545) + [event](https://tools.ietf.org/html/rfc5545#section-3.6.1), which + + specifies the name, timing, duration and recurrence of this time + period. + + + Example: + + + ``` + + DTSTART:20190707T180000 + + DURATION:P2H + + RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR + + ``` + + + Only `SUMMARY`, `DTSTART`, `DURATION` and `RRULE` fields are + supported. + + `DTSTART` must be in local (unzoned) time format. Note that while + `BEGIN:VEVENT` + + and `END:VEVENT` is not required in the request. The response will + always + + include them. + source: + openapi: openapi/openapi.json + CatalogV1Id: + docs: >- + A Square API V1 identifier of an item, including the object ID and its + associated location ID. + properties: + catalog_v1_id: + type: optional> + docs: >- + The ID for an object used in the Square API V1, if the object ID + differs from the Square API V2 object ID. + location_id: + type: optional> + docs: The ID of the `Location` this Connect V1 ID is associated with. + source: + openapi: openapi/openapi.json + CatalogVersionUpdatedEvent: + docs: Published when the catalog is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + CatalogVersionUpdatedEventCatalogVersion: + properties: + updated_at: + type: optional + docs: Last modification timestamp in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + CatalogVersionUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type. + object: + type: optional + docs: >- + An object containing fields and values relevant to the event. Is + absent if affected object was deleted. + source: + openapi: openapi/openapi.json + CatalogVersionUpdatedEventObject: + properties: + catalog_version: + type: optional + docs: The version of the object. + source: + openapi: openapi/openapi.json + CategoryPathToRootNode: + docs: A node in the path from a retrieved category to its root node. + properties: + category_id: + type: optional> + docs: The category's ID. + category_name: + type: optional> + docs: The category's name. + source: + openapi: openapi/openapi.json + ChangeBillingAnchorDateResponse: + docs: >- + Defines output parameters in a request to the + + [ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The specified subscription for updating billing anchor date. + actions: + type: optional> + docs: A list of a single billing anchor date change for the subscription. + source: + openapi: openapi/openapi.json + ChangeTiming: + enum: + - IMMEDIATE + - END_OF_BILLING_CYCLE + docs: >- + Supported timings when a pending change, as an action, takes place to a + subscription. + source: + openapi: openapi/openapi.json + ChargeRequestAdditionalRecipient: + docs: >- + Represents an additional recipient (other than the merchant) entitled to a + portion of the tender. + + Support is currently limited to USD, CAD and GBP currencies + properties: + location_id: + type: string + docs: >- + The location ID for a recipient (other than the merchant) receiving a + portion of the tender. + validation: + minLength: 1 + maxLength: 50 + description: + type: string + docs: The description of the additional recipient. + validation: + minLength: 1 + maxLength: 100 + amount_money: + type: Money + docs: The amount of money distributed to the recipient. + source: + openapi: openapi/openapi.json + Checkout: + docs: |- + Square Checkout lets merchants accept online payments for supported + payment types using a checkout workflow hosted on squareup.com. + properties: + id: + type: optional + docs: ID generated by Square Checkout when a new checkout is requested. + checkout_page_url: + type: optional> + docs: |- + The URL that the buyer's browser should be redirected to after the + checkout is completed. + ask_for_shipping_address: + type: optional> + docs: >- + If `true`, Square Checkout will collect shipping information on your + + behalf and store that information with the transaction information in + your + + Square Dashboard. + + + Default: `false`. + merchant_support_email: + type: optional> + docs: >- + The email address to display on the Square Checkout confirmation page + + and confirmation email that the buyer can use to contact the merchant. + + + If this value is not set, the confirmation page and email will display + the + + primary email address associated with the merchant's Square account. + + + Default: none; only exists if explicitly set. + pre_populate_buyer_email: + type: optional> + docs: |- + If provided, the buyer's email is pre-populated on the checkout page + as an editable text field. + + Default: none; only exists if explicitly set. + pre_populate_shipping_address: + type: optional
+ docs: |- + If provided, the buyer's shipping info is pre-populated on the + checkout page as editable text fields. + + Default: none; only exists if explicitly set. + redirect_url: + type: optional> + docs: >- + The URL to redirect to after checkout is completed with `checkoutId`, + + Square's `orderId`, `transactionId`, and `referenceId` appended as URL + + parameters. For example, if the provided redirect_url is + + `http://www.example.com/order-complete`, a successful transaction + redirects + + the customer to: + + +
http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx
+ + + If you do not provide a redirect URL, Square Checkout will display an + order + + confirmation page on your behalf; however Square strongly recommends + that + + you provide a redirect URL so you can verify the transaction results + and + + finalize the order through your existing/normal confirmation workflow. + order: + type: optional + docs: Order to be checked out. + created_at: + type: optional + docs: The time when the checkout was created, in RFC 3339 format. + access: read-only + additional_recipients: + type: optional>> + docs: >- + Additional recipients (other than the merchant) receiving a portion of + this checkout. + + For example, fees assessed on the purchase by a third party + integration. + source: + openapi: openapi/openapi.json + CheckoutLocationSettings: + properties: + location_id: + type: optional> + docs: The ID of the location that these settings apply to. + customer_notes_enabled: + type: optional> + docs: Indicates whether customers are allowed to leave notes at checkout. + policies: + type: optional>> + docs: |- + Policy information is displayed at the bottom of the checkout pages. + You can set a maximum of two policies. + branding: + type: optional + docs: The branding settings for this location. + tipping: + type: optional + docs: The tip settings for this location. + coupons: + type: optional + docs: The coupon settings for this location. + updated_at: + type: optional + docs: |- + The timestamp when the settings were last updated, in RFC 3339 format. + Examples for January 25th, 2020 6:25:34pm Pacific Standard Time: + UTC: 2020-01-26T02:25:34Z + Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 + access: read-only + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsBranding: + properties: + header_type: + type: optional + docs: |- + Show the location logo on the checkout page. + See [HeaderType](#type-headertype) for possible values + button_color: + type: optional> + docs: >- + The HTML-supported hex color for the button on the checkout page (for + example, "#FFFFFF"). + validation: + minLength: 7 + maxLength: 7 + button_shape: + type: optional + docs: |- + The shape of the button on the checkout page. + See [ButtonShape](#type-buttonshape) for possible values + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsBrandingButtonShape: + enum: + - SQUARED + - ROUNDED + - PILL + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsBrandingHeaderType: + enum: + - BUSINESS_NAME + - FRAMED_LOGO + - FULL_WIDTH_LOGO + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsCoupons: + properties: + enabled: + type: optional> + docs: Indicates whether coupons are enabled for this location. + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsPolicy: + properties: + uid: + type: optional> + docs: >- + A unique ID to identify the policy when making changes. You must set + the UID for policy updates, but it’s optional when setting new + policies. + title: + type: optional> + docs: >- + The title of the policy. This is required when setting the + description, though you can update it in a different request. + validation: + maxLength: 50 + description: + type: optional> + docs: The description of the policy. + validation: + maxLength: 4096 + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsTipping: + properties: + percentages: + type: optional>> + docs: >- + Set three custom percentage amounts that buyers can select at + checkout. If Smart Tip is enabled, this only applies to transactions + totaling $10 or more. + smart_tipping_enabled: + type: optional> + docs: >- + Enables Smart Tip Amounts. If Smart Tip Amounts is enabled, tipping + works as follows: + + If a transaction is less than $10, the available tipping options + include No Tip, $1, $2, or $3. + + If a transaction is $10 or more, the available tipping options include + No Tip, 15%, 20%, or 25%. + + You can set custom percentage amounts with the `percentages` field. + default_percent: + type: optional> + docs: >- + Set the pre-selected percentage amounts that appear at checkout. If + Smart Tip is enabled, this only applies to transactions totaling $10 + or more. + smart_tips: + type: optional>> + docs: Show the Smart Tip Amounts for this location. + default_smart_tip: + type: optional + docs: >- + Set the pre-selected whole amount that appears at checkout when Smart + Tip is enabled and the transaction amount is less than $10. + source: + openapi: openapi/openapi.json + CheckoutMerchantSettings: + properties: + payment_methods: + type: optional + docs: The set of payment methods accepted for the merchant's account. + updated_at: + type: optional + docs: |- + The timestamp when the settings were last updated, in RFC 3339 format. + Examples for January 25th, 2020 6:25:34pm Pacific Standard Time: + UTC: 2020-01-26T02:25:34Z + Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 + access: read-only + source: + openapi: openapi/openapi.json + CheckoutMerchantSettingsPaymentMethods: + properties: + apple_pay: optional + google_pay: optional + cash_app: optional + afterpay_clearpay: optional + source: + openapi: openapi/openapi.json + CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay: + docs: The settings allowed for AfterpayClearpay. + properties: + order_eligibility_range: + type: >- + optional + docs: >- + Afterpay is shown as an option for order totals falling within the + configured range. + item_eligibility_range: + type: >- + optional + docs: >- + Afterpay is shown as an option for item totals falling within the + configured range. + enabled: + type: optional + docs: Indicates whether the payment method is enabled for the account. + access: read-only + source: + openapi: openapi/openapi.json + CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange: + docs: A range of purchase price that qualifies. + properties: + min: Money + max: Money + source: + openapi: openapi/openapi.json + CheckoutMerchantSettingsPaymentMethodsPaymentMethod: + docs: The settings allowed for a payment method. + properties: + enabled: + type: optional> + docs: Indicates whether the payment method is enabled for the account. + source: + openapi: openapi/openapi.json + CheckoutOptions: + properties: + allow_tipping: + type: optional> + docs: Indicates whether the payment allows tipping. + custom_fields: + type: optional>> + docs: The custom fields requesting information from the buyer. + subscription_plan_id: + type: optional> + docs: >- + The ID of the subscription plan for the buyer to pay and subscribe. + + For more information, see [Subscription Plan + Checkout](https://developer.squareup.com/docs/checkout-api/subscription-plan-checkout). + validation: + maxLength: 255 + redirect_url: + type: optional> + docs: >- + The confirmation page URL to redirect the buyer to after Square + processes the payment. + validation: + maxLength: 2048 + merchant_support_email: + type: optional> + docs: The email address that buyers can use to contact the seller. + validation: + maxLength: 256 + ask_for_shipping_address: + type: optional> + docs: Indicates whether to include the address fields in the payment form. + accepted_payment_methods: + type: optional + docs: The methods allowed for buyers during checkout. + app_fee_money: + type: optional + docs: >- + The amount of money that the developer is taking as a fee for + facilitating the payment on behalf of the seller. + + + The amount cannot be more than 90% of the total amount of the payment. + + + The amount must be specified in the smallest denomination of the + applicable currency (for example, US dollar amounts are specified in + cents). For more information, see [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-monetary-amounts). + + + The fee currency code must match the currency associated with the + seller that is accepting the payment. The application must be from a + developer account in the same country and using the same currency code + as the seller. For more information about the application fee + scenario, see [Take Payments and Collect + Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + + + To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth + permission is required. For more information, see + [Permissions](https://developer.squareup.com/docs/payments-api/collect-fees/additional-considerations#permissions). + shipping_fee: + type: optional + docs: >- + The fee associated with shipping to be applied to the `Order` as a + service charge. + enable_coupon: + type: optional> + docs: >- + Indicates whether to include the `Add coupon` section for the buyer to + provide a Square marketing coupon in the payment form. + enable_loyalty: + type: optional> + docs: >- + Indicates whether to include the `REWARDS` section for the buyer to + opt in to loyalty, redeem rewards in the payment form, or both. + source: + openapi: openapi/openapi.json + CheckoutOptionsPaymentType: + enum: + - CARD_PRESENT + - MANUAL_CARD_ENTRY + - FELICA_ID + - FELICA_QUICPAY + - FELICA_TRANSPORTATION_GROUP + - FELICA_ALL + - PAYPAY + - QR_CODE + source: + openapi: openapi/openapi.json + ClearpayDetails: + docs: Additional details about Clearpay payments. + properties: + email_address: + type: optional> + docs: Email address on the buyer's Clearpay account. + validation: + maxLength: 255 + source: + openapi: openapi/openapi.json + CloneOrderResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the [CloneOrder](api-endpoint:Orders-CloneOrder) endpoint. + properties: + order: + type: optional + docs: The cloned order. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CollectedData: + properties: + input_text: + type: optional + docs: The buyer's input text. + access: read-only + source: + openapi: openapi/openapi.json + CompletePaymentResponse: + docs: >- + Defines the response returned + by[CompletePayment](api-endpoint:Payments-CompletePayment). + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + payment: + type: optional + docs: The successfully completed payment. + source: + openapi: openapi/openapi.json + Component: + docs: The wrapper object for the component entries of a given component type. + properties: + type: + type: ComponentComponentType + docs: >- + The type of this component. Each component type has expected + properties expressed + + in a structured format within its corresponding `*_details` field. + + See [ComponentType](#type-componenttype) for possible values + application_details: + type: optional + docs: >- + Structured data for an `Application`, set for Components of type + `APPLICATION`. + card_reader_details: + type: optional + docs: >- + Structured data for a `CardReader`, set for Components of type + `CARD_READER`. + battery_details: + type: optional + docs: Structured data for a `Battery`, set for Components of type `BATTERY`. + wifi_details: + type: optional + docs: >- + Structured data for a `WiFi` interface, set for Components of type + `WIFI`. + ethernet_details: + type: optional + docs: >- + Structured data for an `Ethernet` interface, set for Components of + type `ETHERNET`. + source: + openapi: openapi/openapi.json + ComponentComponentType: + enum: + - APPLICATION + - CARD_READER + - BATTERY + - WIFI + - ETHERNET + - PRINTER + docs: An enum for ComponentType. + source: + openapi: openapi/openapi.json + ConfirmationDecision: + properties: + has_agreed: + type: optional + docs: The buyer's decision to the displayed terms. + access: read-only + source: + openapi: openapi/openapi.json + ConfirmationOptions: + properties: + title: + type: string + docs: >- + The title text to display in the confirmation screen flow on the + Terminal. + validation: + minLength: 1 + maxLength: 250 + body: + type: string + docs: >- + The agreement details to display in the confirmation flow on the + Terminal. + validation: + minLength: 1 + maxLength: 10000 + agree_button_text: + type: string + docs: >- + The button text to display indicating the customer agrees to the + displayed terms. + validation: + minLength: 1 + maxLength: 250 + disagree_button_text: + type: optional> + docs: >- + The button text to display indicating the customer does not agree to + the displayed terms. + validation: + minLength: 1 + maxLength: 250 + decision: + type: optional + docs: >- + The result of the buyer’s actions when presented with the confirmation + screen. + source: + openapi: openapi/openapi.json + Coordinates: + docs: Latitude and longitude coordinates. + properties: + latitude: + type: optional> + docs: The latitude of the coordinate expressed in degrees. + longitude: + type: optional> + docs: The longitude of the coordinate expressed in degrees. + source: + openapi: openapi/openapi.json + Country: + enum: + - ZZ + - AD + - AE + - AF + - AG + - AI + - AL + - AM + - AO + - AQ + - AR + - AS + - AT + - AU + - AW + - AX + - AZ + - BA + - BB + - BD + - BE + - BF + - BG + - BH + - BI + - BJ + - BL + - BM + - BN + - BO + - BQ + - BR + - BS + - BT + - BV + - BW + - BY + - BZ + - CA + - CC + - CD + - CF + - CG + - CH + - CI + - CK + - CL + - CM + - CN + - CO + - CR + - CU + - CV + - CW + - CX + - CY + - CZ + - DE + - DJ + - DK + - DM + - DO + - DZ + - EC + - EE + - EG + - EH + - ER + - ES + - ET + - FI + - FJ + - FK + - FM + - FO + - FR + - GA + - GB + - GD + - GE + - GF + - GG + - GH + - GI + - GL + - GM + - GN + - GP + - GQ + - GR + - GS + - GT + - GU + - GW + - GY + - HK + - HM + - HN + - HR + - HT + - HU + - ID + - IE + - IL + - IM + - IN + - IO + - IQ + - IR + - IS + - IT + - JE + - JM + - JO + - JP + - KE + - KG + - KH + - KI + - KM + - KN + - KP + - KR + - KW + - KY + - KZ + - LA + - LB + - LC + - LI + - LK + - LR + - LS + - LT + - LU + - LV + - LY + - MA + - MC + - MD + - ME + - MF + - MG + - MH + - MK + - ML + - MM + - MN + - MO + - MP + - MQ + - MR + - MS + - MT + - MU + - MV + - MW + - MX + - MY + - MZ + - NA + - NC + - NE + - NF + - NG + - NI + - NL + - 'NO' + - NP + - NR + - NU + - NZ + - OM + - PA + - PE + - PF + - PG + - PH + - PK + - PL + - PM + - PN + - PR + - PS + - PT + - PW + - PY + - QA + - RE + - RO + - RS + - RU + - RW + - SA + - SB + - SC + - SD + - SE + - SG + - SH + - SI + - SJ + - SK + - SL + - SM + - SN + - SO + - SR + - SS + - ST + - SV + - SX + - SY + - SZ + - TC + - TD + - TF + - TG + - TH + - TJ + - TK + - TL + - TM + - TN + - TO + - TR + - TT + - TV + - TW + - TZ + - UA + - UG + - UM + - US + - UY + - UZ + - VA + - VC + - VE + - VG + - VI + - VN + - VU + - WF + - WS + - YE + - YT + - ZA + - ZM + - ZW + docs: >- + Indicates the country associated with another entity, such as a business. + + Values are in [ISO 3166-1-alpha-2 + format](http://www.iso.org/iso/home/standards/country_codes.htm). + source: + openapi: openapi/openapi.json + CreateBookingCustomAttributeDefinitionResponse: + docs: >- + Represents a + [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The newly created custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateBookingResponse: + properties: + booking: + type: optional + docs: The booking that was created. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateBreakTypeResponse: + docs: >- + The response to the request to create a `BreakType`. The response contains + + the created `BreakType` object and might contain a set of `Error` objects + if + + the request resulted in errors. + properties: + break_type: + type: optional + docs: The `BreakType` that was created by the request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateCardResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [CreateCard](api-endpoint:Cards-CreateCard) endpoint. + + + Note: if there are errors processing the request, the card field will not + be + + present. + properties: + errors: + type: optional> + docs: Errors resulting from the request. + card: + type: optional + docs: The card created by the request. + source: + openapi: openapi/openapi.json + CreateCatalogImageRequest: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this CreateCatalogImage request. + + Keys can be any valid string but must be unique for every + CreateCatalogImage request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 128 + object_id: + type: optional + docs: >- + Unique ID of the `CatalogObject` to attach this `CatalogImage` object + to. Leave this + + field empty to create unattached images, for example if you are + building an integration + + where an image can be attached to catalog items at a later time. + image: + type: CatalogObject + docs: >- + The new `CatalogObject` of the `IMAGE` type, namely, a `CatalogImage` + object, to encapsulate the specified image file. + is_primary: + type: optional + docs: >- + If this is set to `true`, the image created will be the primary, or + first image of the object referenced by `object_id`. + + If the `CatalogObject` already has a primary `CatalogImage`, setting + this field to `true` will replace the primary image. + + If this is set to `false` and you use the Square API version + 2021-12-15 or later, the image id will be appended to the list of + `image_ids` on the object. + + + With Square API version 2021-12-15 or later, the default value is + `false`. Otherwise, the effective default value is `true`. + source: + openapi: openapi/openapi.json + CreateCatalogImageResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + image: + type: optional + docs: |- + The newly created `CatalogImage` including a Square-generated + URL for the encapsulated image file. + source: + openapi: openapi/openapi.json + CreateCheckoutResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `CreateCheckout` endpoint. + properties: + checkout: + type: optional + docs: >- + The newly created `checkout` object associated with the provided + idempotency key. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateCustomerCardResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `CreateCustomerCard` endpoint. + + Either `errors` or `card` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + card: + type: optional + docs: The created card on file. + source: + openapi: openapi/openapi.json + CreateCustomerCustomAttributeDefinitionResponse: + docs: >- + Represents a + [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The new custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateCustomerGroupResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [CreateCustomerGroup](api-endpoint:CustomerGroups-CreateCustomerGroup) + endpoint. + + + Either `errors` or `group` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + group: + type: optional + docs: The successfully created customer group. + source: + openapi: openapi/openapi.json + CreateCustomerResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [CreateCustomer](api-endpoint:Customers-CreateCustomer) + or + + [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) + endpoint. + + + Either `errors` or `customer` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + customer: + type: optional + docs: The created customer. + source: + openapi: openapi/openapi.json + CreateDeviceCodeResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + device_code: + type: optional + docs: The created DeviceCode object containing the device code string. + source: + openapi: openapi/openapi.json + CreateDisputeEvidenceFileRequest: + docs: Defines the parameters for a `CreateDisputeEvidenceFile` request. + properties: + idempotency_key: + type: string + docs: >- + A unique key identifying the request. For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + maxLength: 45 + evidence_type: + type: optional + docs: >- + The type of evidence you are uploading. + + See [DisputeEvidenceType](#type-disputeevidencetype) for possible + values + content_type: + type: optional + docs: >- + The MIME type of the uploaded file. + + The type can be image/heic, image/heif, image/jpeg, application/pdf, + image/png, or image/tiff. + validation: + minLength: 1 + maxLength: 40 + source: + openapi: openapi/openapi.json + CreateDisputeEvidenceFileResponse: + docs: Defines the fields in a `CreateDisputeEvidenceFile` response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + evidence: + type: optional + docs: The metadata of the newly uploaded dispute evidence. + source: + openapi: openapi/openapi.json + CreateDisputeEvidenceTextResponse: + docs: Defines the fields in a `CreateDisputeEvidenceText` response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + evidence: + type: optional + docs: The newly uploaded dispute evidence metadata. + source: + openapi: openapi/openapi.json + CreateGiftCardActivityResponse: + docs: >- + A response that contains a `GiftCardActivity` that was created. + + The response might contain a set of `Error` objects if the request + resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card_activity: + type: optional + docs: The gift card activity that was created. + source: + openapi: openapi/openapi.json + CreateGiftCardResponse: + docs: >- + A response that contains a `GiftCard`. The response might contain a set of + `Error` objects if the request + + resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: The new gift card. + source: + openapi: openapi/openapi.json + CreateInvoiceAttachmentRequestData: + docs: >- + Represents a + [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) + request. + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies the `CreateInvoiceAttachment` request. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 128 + description: + type: optional + docs: The description of the attachment to display on the invoice. + validation: + maxLength: 128 + source: + openapi: openapi/openapi.json + CreateInvoiceAttachmentResponse: + docs: >- + Represents a + [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) + response. + properties: + attachment: + type: optional + docs: Metadata about the attachment that was added to the invoice. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + CreateInvoiceResponse: + docs: The response returned by the `CreateInvoice` request. + properties: + invoice: + type: optional + docs: The newly created invoice. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + CreateJobResponse: + docs: >- + Represents a [CreateJob](api-endpoint:Team-CreateJob) response. Either + `job` or `errors` + + is present in the response. + properties: + job: + type: optional + docs: The new job. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateLocationCustomAttributeDefinitionResponse: + docs: >- + Represents a + [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The new custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateLocationResponse: + docs: >- + The response object returned by the + [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint. + properties: + errors: + type: optional> + docs: >- + Information about + [errors](https://developer.squareup.com/docs/build-basics/handling-errors) + encountered during the request. + location: + type: optional + docs: The newly created `Location` object. + source: + openapi: openapi/openapi.json + CreateLoyaltyAccountResponse: + docs: A response that includes loyalty account created. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_account: + type: optional + docs: The newly created loyalty account. + source: + openapi: openapi/openapi.json + CreateLoyaltyPromotionResponse: + docs: >- + Represents a + [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) + response. + + Either `loyalty_promotion` or `errors` is present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_promotion: + type: optional + docs: The new loyalty promotion. + source: + openapi: openapi/openapi.json + CreateLoyaltyRewardResponse: + docs: A response that includes the loyalty reward created. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + reward: + type: optional + docs: The loyalty reward created. + source: + openapi: openapi/openapi.json + CreateMerchantCustomAttributeDefinitionResponse: + docs: >- + Represents a + [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The new custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateMobileAuthorizationCodeResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `CreateMobileAuthorizationCode` endpoint. + properties: + authorization_code: + type: optional + docs: >- + The generated authorization code that connects a mobile application + instance + + to a Square account. + validation: + maxLength: 191 + expires_at: + type: optional + docs: >- + The timestamp when `authorization_code` expires, in + + [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, + "2016-09-04T23:59:33.123Z"). + validation: + minLength: 20 + maxLength: 48 + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateOrderCustomAttributeDefinitionResponse: + docs: Represents a response from creating an order custom attribute definition. + properties: + custom_attribute_definition: + type: optional + docs: The new custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateOrderRequest: + properties: + order: + type: optional + docs: >- + The order to create. If this field is set, the only other top-level + field that can be + + set is the `idempotency_key`. + idempotency_key: + type: optional + docs: >- + A value you specify that uniquely identifies this + + order among orders you have created. + + + If you are unsure whether a particular order was created successfully, + + you can try it again with the same idempotency key without + + worrying about creating duplicate orders. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + CreateOrderResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `CreateOrder` endpoint. + + Either `errors` or `order` is present in a given response, but never both. + properties: + order: + type: optional + docs: The newly created order. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreatePaymentLinkResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + payment_link: + type: optional + docs: The created payment link. + related_resources: + type: optional + docs: The list of related objects. + source: + openapi: openapi/openapi.json + CreatePaymentResponse: + docs: >- + Defines the response returned by + [CreatePayment](api-endpoint:Payments-CreatePayment). + + + If there are errors processing the request, the `payment` field might not + be + + present, or it might be present with a status of `FAILED`. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + payment: + type: optional + docs: The newly created payment. + source: + openapi: openapi/openapi.json + CreateScheduledShiftResponse: + docs: >- + Represents a + [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) response. + + Either `scheduled_shift` or `errors` is present in the response. + properties: + scheduled_shift: + type: optional + docs: >- + The new scheduled shift. To make the shift public, call + + [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) or + + [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateShiftResponse: + docs: |- + The response to a request to create a `Shift`. The response contains + the created `Shift` object and might contain a set of `Error` objects if + the request resulted in errors. + properties: + shift: + type: optional + docs: The `Shift` that was created on the request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [CreateSubscription](api-endpoint:Subscriptions-CreateSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: >- + The newly created subscription. + + + For more information, see + + [Subscription + object](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#subscription-object). + source: + openapi: openapi/openapi.json + CreateTeamMemberRequest: + docs: Represents a create request for a `TeamMember` object. + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies this `CreateTeamMember` request. + + Keys can be any valid string, but must be unique for every request. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + + + The minimum length is 1 and the maximum length is 45. + team_member: + type: optional + docs: >- + **Required** The data used to create the `TeamMember` object. If you + include `wage_setting`, you must provide + + `job_id` for each job assignment. To get job IDs, call + [ListJobs](api-endpoint:Team-ListJobs). + source: + openapi: openapi/openapi.json + CreateTeamMemberResponse: + docs: >- + Represents a response from a create request containing the created + `TeamMember` object or error messages. + properties: + team_member: + type: optional + docs: The successfully created `TeamMember` object. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateTerminalActionResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + action: + type: optional + docs: The created `TerminalAction` + source: + openapi: openapi/openapi.json + CreateTerminalCheckoutResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + checkout: + type: optional + docs: The created `TerminalCheckout`. + source: + openapi: openapi/openapi.json + CreateTerminalRefundResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refund: + type: optional + docs: The created `TerminalRefund`. + source: + openapi: openapi/openapi.json + CreateTimecardResponse: + docs: >- + The response to a request to create a `Timecard`. The response contains + + the created `Timecard` object and might contain a set of `Error` objects + if + + the request resulted in errors. + properties: + timecard: + type: optional + docs: The `Timecard` that was created on the request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateVendorResponse: + docs: >- + Represents an output from a call to + [CreateVendor](api-endpoint:Vendors-CreateVendor). + properties: + errors: + type: optional> + docs: Errors encountered when the request fails. + vendor: + type: optional + docs: The successfully created [Vendor](entity:Vendor) object. + source: + openapi: openapi/openapi.json + CreateWebhookSubscriptionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) + endpoint. + + + Note: if there are errors processing the request, the + [Subscription](entity:WebhookSubscription) will not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + subscription: + type: optional + docs: The new [Subscription](entity:WebhookSubscription). + source: + openapi: openapi/openapi.json + Currency: + enum: + - UNKNOWN_CURRENCY + - AED + - AFN + - ALL + - AMD + - ANG + - AOA + - ARS + - AUD + - AWG + - AZN + - BAM + - BBD + - BDT + - BGN + - BHD + - BIF + - BMD + - BND + - BOB + - BOV + - BRL + - BSD + - BTN + - BWP + - BYR + - BZD + - CAD + - CDF + - CHE + - CHF + - CHW + - CLF + - CLP + - CNY + - COP + - COU + - CRC + - CUC + - CUP + - CVE + - CZK + - DJF + - DKK + - DOP + - DZD + - EGP + - ERN + - ETB + - EUR + - FJD + - FKP + - GBP + - GEL + - GHS + - GIP + - GMD + - GNF + - GTQ + - GYD + - HKD + - HNL + - HRK + - HTG + - HUF + - IDR + - ILS + - INR + - IQD + - IRR + - ISK + - JMD + - JOD + - JPY + - KES + - KGS + - KHR + - KMF + - KPW + - KRW + - KWD + - KYD + - KZT + - LAK + - LBP + - LKR + - LRD + - LSL + - LTL + - LVL + - LYD + - MAD + - MDL + - MGA + - MKD + - MMK + - MNT + - MOP + - MRO + - MUR + - MVR + - MWK + - MXN + - MXV + - MYR + - MZN + - NAD + - NGN + - NIO + - NOK + - NPR + - NZD + - OMR + - PAB + - PEN + - PGK + - PHP + - PKR + - PLN + - PYG + - QAR + - RON + - RSD + - RUB + - RWF + - SAR + - SBD + - SCR + - SDG + - SEK + - SGD + - SHP + - SLL + - SLE + - SOS + - SRD + - SSP + - STD + - SVC + - SYP + - SZL + - THB + - TJS + - TMT + - TND + - TOP + - TRY + - TTD + - TWD + - TZS + - UAH + - UGX + - USD + - USN + - USS + - UYI + - UYU + - UZS + - VEF + - VND + - VUV + - WST + - XAF + - XAG + - XAU + - XBA + - XBB + - XBC + - XBD + - XCD + - XDR + - XOF + - XPD + - XPF + - XPT + - XTS + - XXX + - YER + - ZAR + - ZMK + - ZMW + - BTC + - XUS + docs: >- + Indicates the associated currency for an amount of money. Values + correspond + + to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). + source: + openapi: openapi/openapi.json + CustomAttribute: + docs: |- + A custom attribute value. Each custom attribute value has a corresponding + `CustomAttributeDefinition` object. + properties: + key: + type: optional> + docs: >- + The identifier + + of the custom attribute definition and its corresponding custom + attributes. This value + + can be a simple key, which is the key that is provided when the custom + attribute definition + + is created, or a qualified key, if the requesting + + application is not the definition owner. The qualified key consists of + the application ID + + of the custom attribute definition owner + + followed by the simple key that was provided when the definition was + created. It has the + + format application_id:simple key. + + + The value for a simple key can contain up to 60 alphanumeric + characters, periods (.), + + underscores (_), and hyphens (-). + validation: + pattern: ^([a-zA-Z0-9\._-]+:)?[a-zA-Z0-9\._-]{1,60}$ + minLength: 1 + value: optional + version: + type: optional + docs: >- + Read only. The current version of the custom attribute. This field is + incremented when the custom attribute is changed. + + When updating an existing custom attribute value, you can provide this + field + + and specify the current version of the custom attribute to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency). + + This field can also be used to enforce strong consistency for reads. + For more information about strong consistency for reads, + + see [Custom Attributes + Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). + visibility: + type: optional + docs: >- + A copy of the `visibility` field value for the associated custom + attribute definition. + + See + [CustomAttributeDefinitionVisibility](#type-customattributedefinitionvisibility) + for possible values + definition: + type: optional + docs: >- + A copy of the associated custom attribute definition object. This + field is only set when + + the optional field is specified on the request. + updated_at: + type: optional + docs: >- + The timestamp that indicates when the custom attribute was created or + was most recently + + updated, in RFC 3339 format. + access: read-only + created_at: + type: optional + docs: >- + The timestamp that indicates when the custom attribute was created, in + RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + CustomAttributeDefinition: + docs: >- + Represents a definition for custom attribute values. A custom attribute + definition + + specifies the key, visibility, schema, and other properties for a custom + attribute. + properties: + key: + type: optional> + docs: >- + The identifier + + of the custom attribute definition and its corresponding custom + attributes. This value + + can be a simple key, which is the key that is provided when the custom + attribute definition + + is created, or a qualified key, if the requesting + + application is not the definition owner. The qualified key consists of + the application ID + + of the custom attribute definition owner + + followed by the simple key that was provided when the definition was + created. It has the + + format application_id:simple key. + + + The value for a simple key can contain up to 60 alphanumeric + characters, periods (.), + + underscores (_), and hyphens (-). + + + This field can not be changed + + after the custom attribute definition is created. This field is + required when creating + + a definition and must be unique per application, seller, and resource + type. + validation: + pattern: ^([a-zA-Z0-9\._-]+:)?[a-zA-Z0-9\._-]{1,60}$ + minLength: 1 + schema: + type: optional>> + docs: >- + The JSON schema for the custom attribute definition, which determines + the data type of the corresponding custom attributes. For more + information, + + see [Custom Attributes + Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). + This field is required when creating a definition. + name: + type: optional> + docs: >- + The name of the custom attribute definition for API and seller-facing + UI purposes. The name must + + be unique within the seller and application pair. This field is + required if the + + `visibility` field is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + validation: + maxLength: 255 + description: + type: optional> + docs: >- + Seller-oriented description of the custom attribute definition, + including any constraints + + that the seller should observe. May be displayed as a tooltip in + Square UIs. This field is + + required if the `visibility` field is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + validation: + maxLength: 255 + visibility: + type: optional + docs: >- + Specifies how the custom attribute definition and its values should be + shared with + + the seller and other applications. If no value is specified, the value + defaults to `VISIBILITY_HIDDEN`. + + See [Visibility](#type-visibility) for possible values + version: + type: optional + docs: >- + Read only. The current version of the custom attribute definition. + + The value is incremented each time the custom attribute definition is + updated. + + When updating a custom attribute definition, you can provide this + field + + and specify the current version of the custom attribute definition to + enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency). + + + On writes, this field must be set to the latest version. Stale writes + are rejected. + + + This field can also be used to enforce strong consistency for reads. + For more information about strong consistency for reads, + + see [Custom Attributes + Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). + updated_at: + type: optional + docs: >- + The timestamp that indicates when the custom attribute definition was + created or most recently updated, + + in RFC 3339 format. + access: read-only + created_at: + type: optional + docs: >- + The timestamp that indicates when the custom attribute definition was + created, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + CustomAttributeDefinitionEventData: + docs: |- + Represents an object in the CustomAttributeDefinition event notification + payload that contains the affected custom attribute definition. + properties: + type: + type: optional> + docs: >- + The type of the event data object. The value is + `"custom_attribute_definition"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the custom attribute definition. + source: + openapi: openapi/openapi.json + CustomAttributeDefinitionEventDataObject: + properties: + custom_attribute_definition: + type: optional + docs: The custom attribute definition. + source: + openapi: openapi/openapi.json + CustomAttributeDefinitionVisibility: + enum: + - VISIBILITY_HIDDEN + - VISIBILITY_READ_ONLY + - VISIBILITY_READ_WRITE_VALUES + docs: >- + The level of permission that a seller or other applications requires to + + view this custom attribute definition. + + The `Visibility` field controls who can read and write the custom + attribute values + + and custom attribute definition. + source: + openapi: openapi/openapi.json + CustomAttributeEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"custom_attribute"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the custom attribute. + source: + openapi: openapi/openapi.json + CustomAttributeEventDataObject: + properties: + custom_attribute: + type: optional + docs: The custom attribute. + source: + openapi: openapi/openapi.json + CustomAttributeFilter: + docs: |- + Supported custom attribute query expressions for calling the + [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + endpoint to search for items or item variations. + properties: + custom_attribute_definition_id: + type: optional> + docs: >- + A query expression to filter items or item variations by matching + their custom attributes' + + `custom_attribute_definition_id` property value against the the + specified id. + + Exactly one of `custom_attribute_definition_id` or `key` must be + specified. + key: + type: optional> + docs: >- + A query expression to filter items or item variations by matching + their custom attributes' + + `key` property value against the specified key. + + Exactly one of `custom_attribute_definition_id` or `key` must be + specified. + string_filter: + type: optional> + docs: >- + A query expression to filter items or item variations by matching + their custom attributes' + + `string_value` property value against the specified text. + + Exactly one of `string_filter`, `number_filter`, + `selection_uids_filter`, or `bool_filter` must be specified. + number_filter: + type: optional + docs: >- + A query expression to filter items or item variations with their + custom attributes + + containing a number value within the specified range. + + Exactly one of `string_filter`, `number_filter`, + `selection_uids_filter`, or `bool_filter` must be specified. + selection_uids_filter: + type: optional>> + docs: >- + A query expression to filter items or item variations by matching + their custom attributes' + + `selection_uid_values` values against the specified selection uids. + + Exactly one of `string_filter`, `number_filter`, + `selection_uids_filter`, or `bool_filter` must be specified. + bool_filter: + type: optional> + docs: >- + A query expression to filter items or item variations by matching + their custom attributes' + + `boolean_value` property values against the specified Boolean + expression. + + Exactly one of `string_filter`, `number_filter`, + `selection_uids_filter`, or `bool_filter` must be specified. + source: + openapi: openapi/openapi.json + CustomField: + docs: >- + Describes a custom form field to add to the checkout page to collect more + information from buyers during checkout. + + For more information, + + see [Specify checkout + options](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#specify-checkout-options-1). + properties: + title: + type: string + docs: The title of the custom field. + validation: + minLength: 1 + maxLength: 50 + source: + openapi: openapi/openapi.json + Customer: + docs: >- + Represents a Square customer profile in the Customer Directory of a Square + seller. + properties: + id: + type: optional + docs: >- + A unique Square-assigned ID for the customer profile. + + + If you need this ID for an API request, use the ID returned when you + created the customer profile or call the + [SearchCustomers](api-endpoint:Customers-SearchCustomers) + + or [ListCustomers](api-endpoint:Customers-ListCustomers) endpoint. + created_at: + type: optional + docs: >- + The timestamp when the customer profile was created, in RFC 3339 + format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp when the customer profile was last updated, in RFC 3339 + format. + access: read-only + given_name: + type: optional> + docs: >- + The given name (that is, the first name) associated with the customer + profile. + family_name: + type: optional> + docs: >- + The family name (that is, the last name) associated with the customer + profile. + nickname: + type: optional> + docs: A nickname for the customer profile. + company_name: + type: optional> + docs: A business name associated with the customer profile. + email_address: + type: optional> + docs: The email address associated with the customer profile. + address: + type: optional
+ docs: The physical address associated with the customer profile. + phone_number: + type: optional> + docs: The phone number associated with the customer profile. + birthday: + type: optional> + docs: >- + The birthday associated with the customer profile, in `YYYY-MM-DD` + format. For example, `1998-09-21` + + represents September 21, 1998, and `0000-09-21` represents September + 21 (without a birth year). + reference_id: + type: optional> + docs: |- + An optional second ID used to associate the customer profile with an + entity in another system. + note: + type: optional> + docs: A custom note associated with the customer profile. + preferences: + type: optional + docs: Represents general customer preferences. + creation_source: + type: optional + docs: >- + The method used to create the customer profile. + + See [CustomerCreationSource](#type-customercreationsource) for + possible values + group_ids: + type: optional>> + docs: >- + The IDs of [customer groups](entity:CustomerGroup) the customer + belongs to. + segment_ids: + type: optional>> + docs: >- + The IDs of [customer segments](entity:CustomerSegment) the customer + belongs to. + version: + type: optional + docs: >- + The Square-assigned version number of the customer profile. The + version number is incremented each time an update is committed to the + customer profile, except for changes to customer segment membership. + tax_ids: + type: optional + docs: >- + The tax ID associated with the customer profile. This field is present + only for customers of sellers in EU countries or the United Kingdom. + + For more information, see [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + source: + openapi: openapi/openapi.json + CustomerAddressFilter: + docs: >- + The customer address filter. This filter is used in a + [CustomerCustomAttributeFilterValue](entity:CustomerCustomAttributeFilterValue) + filter when + + searching by an `Address`-type custom attribute. + properties: + postal_code: + type: optional + docs: The postal code to search for. Only an `exact` match is supported. + country: + type: optional + docs: |- + The country code to search for. + See [Country](#type-country) for possible values + source: + openapi: openapi/openapi.json + CustomerCreatedEvent: + docs: >- + Published when a [customer](entity:Customer) is created. Subscribe to this + event to track customer profiles affected by a merge operation. + + For more information, see [Use Customer + Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). + + + The `customer` object in the event notification does not include the + `segment_ids` field. + properties: + merchant_id: + type: optional> + docs: The ID of the seller associated with the event. + type: + type: optional> + docs: The type of event. For this object, the value is `customer.created`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CustomerCreatedEventData: + docs: The data associated with the event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `customer`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the new customer. + validation: + maxLength: 192 + object: + type: optional + docs: An object that contains the new customer. + source: + openapi: openapi/openapi.json + CustomerCreatedEventEventContext: + docs: Information about the change that triggered the event. + properties: + merge: + type: optional + docs: Information about the merge operation associated with the event. + source: + openapi: openapi/openapi.json + CustomerCreatedEventEventContextMerge: + docs: >- + Information about a merge operation, which creates a new customer using + aggregated properties from two or more existing customers. + properties: + from_customer_ids: + type: optional>> + docs: The IDs of the existing customers that were merged and then deleted. + to_customer_id: + type: optional> + docs: The ID of the new customer created by the merge. + source: + openapi: openapi/openapi.json + CustomerCreatedEventObject: + docs: An object that contains the customer associated with the event. + properties: + customer: + type: optional + docs: The new customer. + event_context: + type: optional + docs: >- + Information about the change that triggered the event. This field is + returned only if the customer is created by a merge operation. + source: + openapi: openapi/openapi.json + CustomerCreationSource: + enum: + - OTHER + - APPOINTMENTS + - COUPON + - DELETION_RECOVERY + - DIRECTORY + - EGIFTING + - EMAIL_COLLECTION + - FEEDBACK + - IMPORT + - INVOICES + - LOYALTY + - MARKETING + - MERGE + - ONLINE_STORE + - INSTANT_PROFILE + - TERMINAL + - THIRD_PARTY + - THIRD_PARTY_IMPORT + - UNMERGE_RECOVERY + docs: Indicates the method used to create the customer profile. + source: + openapi: openapi/openapi.json + CustomerCreationSourceFilter: + docs: >- + The creation source filter. + + + If one or more creation sources are set, customer profiles are included + in, + + or excluded from, the result if they match at least one of the filter + criteria. + properties: + values: + type: optional>> + docs: >- + The list of creation sources used as filtering criteria. + + See [CustomerCreationSource](#type-customercreationsource) for + possible values + rule: + type: optional + docs: >- + Indicates whether a customer profile matching the filter criteria + + should be included in the result or excluded from the result. + + + Default: `INCLUDE`. + + See [CustomerInclusionExclusion](#type-customerinclusionexclusion) for + possible values + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionCreatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + is created by the subscribing application. + + + This event is replaced by + + [customer.custom_attribute_definition.owned.created](webhook:customer.custom_attribute_definition.owned.created). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionCreatedPublicEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to all applications is created. A notification is sent + when any application creates a custom + + attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + + + This event is replaced by + + [customer.custom_attribute_definition.visible.created](webhook:customer.custom_attribute_definition.visible.created), + + which applies to custom attribute definitions that are visible to the + subscribing application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.public.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionDeletedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is deleted. A custom attribute + definition can only be deleted by + + the application that created it. + + + This event is replaced by + + [customer.custom_attribute_definition.owned.deleted](webhook:customer.custom_attribute_definition.owned.deleted). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionDeletedPublicEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to all applications is deleted. A notification is sent + when any application deletes a custom + + attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + + + This event is replaced by + + [customer.custom_attribute_definition.visible.deleted](webhook:customer.custom_attribute_definition.visible.deleted), + + which applies to custom attribute definitions that are visible to the + subscribing application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.public.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionOwnedCreatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + is created by the subscribing application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.owned.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionOwnedDeletedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is deleted. A custom attribute + definition can only be deleted by + + the application that created it. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionOwnedUpdatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is updated. A custom attribute + definition can only be updated by + + the application that created it. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionUpdatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is updated. A custom attribute + definition can only be updated by + + the application that created it. + + + This event is replaced by + + [customer.custom_attribute_definition.owned.updated](webhook:customer.custom_attribute_definition.owned.updated). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionUpdatedPublicEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to all applications is updated. A notification is sent + when any application updates a custom + + attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + + + This event is replaced by + + [customer.custom_attribute_definition.visible.updated](webhook:customer.custom_attribute_definition.visible.updated), + + which applies to custom attribute definitions that are visible to the + subscribing application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.public.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionVisibleCreatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is created. A notification + is sent when your application + + creates a custom attribute definition or another application creates a + custom attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.visible.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionVisibleDeletedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is deleted. A custom + attribute definition can only be deleted + + by the application that created it. A notification is sent when your + application deletes a custom attribute + + definition or when another application deletes a custom attribute + definition whose `visibility` is + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionVisibleUpdatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is updated. A custom + attribute definition can only be updated + + by the application that created it. A notification is sent when your + application updates a custom + + attribute definition or when another application updates a custom + attribute definition whose `visibility` is + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDeletedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) owned + by the + + subscribing application is deleted. Custom attributes are owned by the + application that created the + + corresponding [custom attribute + definition](entity:CustomAttributeDefinition). Custom attributes whose + + `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any + application. + + + This event is replaced by + + [customer.custom_attribute.owned.deleted](webhook:customer.custom_attribute.owned.deleted). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDeletedPublicEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) that + is visible + + to all applications is deleted. A notification is sent when any + application deletes a custom attribute + + whose `visibility` is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + + + This event is replaced by + + [customer.custom_attribute.visible.deleted](webhook:customer.custom_attribute.visible.deleted), + + which applies to custom attributes that are visible to the subscribing + application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.public.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeFilter: + docs: >- + The custom attribute filter. Use this filter in a set of [custom attribute + filters](entity:CustomerCustomAttributeFilters) to search + + based on the value or last updated date of a customer-related [custom + attribute](entity:CustomAttribute). + properties: + key: + type: string + docs: >- + The `key` of the [custom attribute](entity:CustomAttribute) to filter + by. The key is the identifier of the custom attribute + + (and the corresponding custom attribute definition) and can be + retrieved using the [Customer Custom Attributes + API](api:CustomerCustomAttributes). + filter: + type: optional + docs: >- + A filter that corresponds to the data type of the target custom + attribute. For example, provide the `phone` filter to + + search based on the value of a `PhoneNumber`-type custom attribute. + The data type is specified by the schema field of the custom attribute + definition, + + which can be retrieved using the [Customer Custom Attributes + API](api:CustomerCustomAttributes). + + + You must provide this `filter` field, the `updated_at` field, or both. + updated_at: + type: optional + docs: >- + The date range for when the custom attribute was last updated. The + date range can include `start_at`, `end_at`, or + + both. Range boundaries are inclusive. Dates are specified as RFC 3339 + timestamps. + + + You must provide this `updated_at` field, the `filter` field, or both. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeFilterValue: + docs: >- + A type-specific filter used in a [custom attribute + filter](entity:CustomerCustomAttributeFilter) to search based on the + value + + of a customer-related [custom attribute](entity:CustomAttribute). + properties: + email: + type: optional + docs: >- + A filter for a query based on the value of an `Email`-type custom + attribute. This filter is case-insensitive and can + + include `exact` or `fuzzy`, but not both. + + + For an `exact` match, provide the complete email address. + + + For a `fuzzy` match, provide a query expression containing one or more + query tokens to match against the email address. Square removes + + any punctuation (including periods (.), underscores (_), and the @ + symbol) and tokenizes the email addresses on spaces. A match is found + + if a tokenized email address contains all the tokens in the search + query, irrespective of the token order. For example, `Steven gmail` + + matches steven.jones@gmail.com and mygmail@stevensbakery.com. + phone: + type: optional + docs: >- + A filter for a query based on the value of a `PhoneNumber`-type custom + attribute. This filter is case-insensitive and + + can include `exact` or `fuzzy`, but not both. + + + For an `exact` match, provide the complete phone number. This is + always an E.164-compliant phone number that starts + + with the + sign followed by the country code and subscriber number. + For example, the format for a US phone number is +12061112222. + + + For a `fuzzy` match, provide a query expression containing one or more + query tokens to match against the phone number. + + Square removes any punctuation and tokenizes the expression on spaces. + A match is found if a tokenized phone number contains + + all the tokens in the search query, irrespective of the token order. + For example, `415 123 45` is tokenized to `415`, `123`, and `45`, + + which matches +14151234567 and +12345674158, but does not match + +1234156780. Similarly, the expression `415` matches + + +14151234567, +12345674158, and +1234156780. + text: + type: optional + docs: >- + A filter for a query based on the value of a `String`-type custom + attribute. This filter is case-insensitive and + + can include `exact` or `fuzzy`, but not both. + + + For an `exact` match, provide the complete string. + + + For a `fuzzy` match, provide a query expression containing one or more + query tokens in any order that contain complete words + + to match against the string. Square tokenizes the expression using a + grammar-based tokenizer. For example, the expressions `quick brown`, + + `brown quick`, and `quick fox` match "The quick brown fox jumps over + the lazy dog". However, `quick foxes` and `qui` do not match. + selection: + type: optional + docs: >- + A filter for a query based on the display name for a `Selection`-type + custom attribute value. This filter is case-sensitive + + and can contain `any`, `all`, or both. The `none` condition is not + supported. + + + Provide the display name of each item that you want to search for. To + find the display names for the selection, use the + + [Customer Custom Attributes API](api:CustomerCustomAttributes) to + retrieve the corresponding custom attribute definition + + and then check the `schema.items.names` field. For more information, + see + + [Search based on + selection](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#custom-attribute-value-filter-selection). + + + Note that when a `Selection`-type custom attribute is assigned to a + customer profile, the custom attribute value is a list of one + + or more UUIDs (sourced from the `schema.items.enum` field) that map to + the item names. These UUIDs are unique per seller. + date: + type: optional + docs: >- + A filter for a query based on the value of a `Date`-type custom + attribute. + + + Provide a date range for this filter using `start_at`, `end_at`, or + both. Range boundaries are inclusive. Dates can be specified + + in `YYYY-MM-DD` format or as RFC 3339 timestamps. + number: + type: optional + docs: >- + A filter for a query based on the value of a `Number`-type custom + attribute, which can be an integer or a decimal with up to + + 5 digits of precision. + + + Provide a numerical range for this filter using `start_at`, `end_at`, + or both. Range boundaries are inclusive. Numbers are specified + + as decimals or integers. The absolute value of range boundaries must + not exceed `(2^63-1)/10^5`, or 92233720368547. + boolean: + type: optional> + docs: >- + A filter for a query based on the value of a `Boolean`-type custom + attribute. + address: + type: optional + docs: >- + A filter for a query based on the value of an `Address`-type custom + attribute. The filter can include `postal_code`, `country`, or both. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeFilters: + docs: >- + The custom attribute filters in a set of [customer + filters](entity:CustomerFilter) used in a search query. Use this filter + + to search based on [custom attributes](entity:CustomAttribute) that are + assigned to customer profiles. For more information, see + + [Search by custom + attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute). + properties: + filters: + type: optional>> + docs: >- + The custom attribute filters. Each filter must specify `key` and + include the `filter` field with a type-specific filter, + + the `updated_at` field, or both. The provided keys must be unique + within the list of custom attribute filters. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeOwnedDeletedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) owned + by the + + subscribing application is deleted. Custom attributes are owned by the + application that created the + + corresponding [custom attribute + definition](entity:CustomAttributeDefinition). Custom attributes whose + + `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any + application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeOwnedUpdatedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) owned + by the + + subscribing application is created or updated. Custom attributes are owned + by the application that created + + the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). Custom attributes whose + + `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated + by any application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeUpdatedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) owned + by the + + subscribing application is created or updated. Custom attributes are owned + by the application that created + + the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). Custom attributes whose + + `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated + by any application. + + + This event is replaced by + + [customer.custom_attribute.owned.updated](webhook:customer.custom_attribute.owned.updated). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeUpdatedPublicEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) that + is visible + + to all applications is created or updated. A notification is sent when any + application creates or updates + + a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + + + This event is replaced by + + [customer.custom_attribute.visible.updated](webhook:customer.custom_attribute.visible.updated), + + which applies to custom attributes that are visible to the subscribing + application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.public.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeVisibleDeletedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) that + is visible to the + + subscribing application is deleted. A notification is sent when: + + - Your application deletes a custom attribute owned by your application, + regardless of the `visibility` setting. + + - Any application deletes a custom attribute whose `visibility` is + `VISIBILITY_READ_ONLY` + + or `VISIBILITY_READ_WRITE_VALUES`. + + + Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by + any application, but those set to + + `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the + owner. Custom attributes are owned + + by the application that created the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeVisibleUpdatedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) that + is visible to the + + subscribing application is created or updated. A notification is sent + when: + + - Your application creates or updates a custom attribute owned by your + application, regardless of the `visibility` setting. + + - Any application creates or updates a custom attribute whose `visibility` + is `VISIBILITY_READ_ONLY` + + or `VISIBILITY_READ_WRITE_VALUES`. + + + Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or + updated by any application, but those set to + + `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or + updated by the owner. Custom attributes are owned + + by the application that created the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerDeletedEvent: + docs: >- + Published when a [customer](entity:Customer) is deleted. For more + information, see [Use Customer + Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). + + + The `customer` object in the event notification does not include the + following fields: `group_ids` and `segment_ids`. + properties: + merchant_id: + type: optional> + docs: The ID of the seller associated with the event. + type: + type: optional> + docs: The type of event. For this object, the value is `customer.deleted`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CustomerDeletedEventData: + docs: The data associated with the event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `customer`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the deleted customer. + validation: + maxLength: 192 + object: + type: optional + docs: An object that contains the deleted customer. + source: + openapi: openapi/openapi.json + CustomerDeletedEventEventContext: + docs: Information about the change that triggered the event. + properties: + merge: + type: optional + docs: Information about the merge operation associated with the event. + source: + openapi: openapi/openapi.json + CustomerDeletedEventEventContextMerge: + docs: >- + Information about a merge operation, which creates a new customer using + aggregated properties from two or more existing customers. + properties: + from_customer_ids: + type: optional>> + docs: The IDs of the existing customers that were merged and then deleted. + to_customer_id: + type: optional> + docs: The ID of the new customer created by the merge. + source: + openapi: openapi/openapi.json + CustomerDeletedEventObject: + docs: An object that contains the customer associated with the event. + properties: + customer: + type: optional + docs: The deleted customer. + event_context: + type: optional + docs: >- + Information about the change that triggered the event. This field is + returned only if the customer is deleted by a merge operation. + source: + openapi: openapi/openapi.json + CustomerDetails: + docs: Details about the customer making the payment. + properties: + customer_initiated: + type: optional> + docs: Indicates whether the customer initiated the payment. + seller_keyed_in: + type: optional> + docs: >- + Indicates that the seller keyed in payment details on behalf of the + customer. + + This is used to flag a payment as Mail Order / Telephone Order (MOTO). + source: + openapi: openapi/openapi.json + CustomerFilter: + docs: >- + Represents the filtering criteria in a [search + query](entity:CustomerQuery) that defines how to filter + + customer profiles returned in + [SearchCustomers](api-endpoint:Customers-SearchCustomers) results. + properties: + creation_source: + type: optional + docs: A filter to select customers based on their creation source. + created_at: + type: optional + docs: A filter to select customers based on when they were created. + updated_at: + type: optional + docs: A filter to select customers based on when they were last updated. + email_address: + type: optional + docs: >- + A filter to [select customers by their email + address](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-email-address) + + visible to the seller. + + This filter is case-insensitive. + + + For [exact + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-email-address), + this + + filter causes the search to return customer profiles + + whose `email_address` field value are identical to the email address + provided + + in the query. + + + For [fuzzy + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-email-address), + + this filter causes the search to return customer profiles + + whose `email_address` field value has a token-wise partial match + against the filtering + + expression in the query. For example, with `Steven gmail` provided in + a search + + query, the search returns customers whose email address is + `steven.johnson@gmail.com` + + or `mygmail@stevensbakery.com`. Square removes any punctuation + (including periods (.), + + underscores (_), and the @ symbol) and tokenizes the email addresses + on spaces. A match is + + found if a tokenized email address contains all the tokens in the + search query, + + irrespective of the token order. + phone_number: + type: optional + docs: >- + A filter to [select customers by their phone + numbers](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-phone-number) + + visible to the seller. + + + For [exact + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-phone-number), + + this filter returns customers whose phone number matches the specified + query expression. The number in the query must be of an + + E.164-compliant form. In particular, it must include the leading `+` + sign followed by a country code and then a subscriber number. + + For example, the standard E.164 form of a US phone number is + `+12062223333` and an E.164-compliant variation is `+1 (206) + 222-3333`. + + To match the query expression, stored customer phone numbers are + converted to the standard E.164 form. + + + For [fuzzy + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-phone-number), + + this filter returns customers whose phone number matches the token or + tokens provided in the query expression. For example, with `415` + + provided in a search query, the search returns customers with the + phone numbers `+1-415-212-1200`, `+1-212-415-1234`, and `+1 (551) + 234-1567`. + + Similarly, a search query of `415 123` returns customers with the + phone numbers `+1-212-415-1234` and `+1 (551) 234-1567` but not + + `+1-212-415-1200`. A match is found if a tokenized phone number + contains all the tokens in the search query, irrespective of the token + order. + reference_id: + type: optional + docs: >- + A filter to [select customers by their reference + IDs](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-reference-id). + + This filter is case-insensitive. + + + [Exact + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-reference-id) + + of a customer's reference ID against a query's reference ID is + evaluated as an + + exact match between two strings, character by character in the given + order. + + + [Fuzzy + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-reference-id) + + of stored reference IDs against queried reference IDs works + + exactly the same as fuzzy matching on email addresses. + Non-alphanumeric characters + + are replaced by spaces to tokenize stored and queried reference IDs. A + match is found + + if a tokenized stored reference ID contains all tokens specified in + any order in the query. For example, + + a query of `NYC M` matches customer profiles with the `reference_id` + value of `NYC_M_35_JOHNSON` + + and `NYC_27_MURRAY`. + group_ids: + type: optional + docs: >- + A filter to select customers based on the + [groups](entity:CustomerGroup) they belong to. + + Group membership is controlled by sellers and developers. + + + The `group_ids` filter has the following syntax: + + ``` + + "group_ids": { + + "any": ["{group_a_id}", "{group_b_id}", ...], + + "all": ["{group_1_id}", "{group_2_id}", ...], + + "none": ["{group_i_id}", "{group_ii_id}", ...] + + } + + ``` + + + You can use any combination of the `any`, `all`, and `none` fields in + the filter. + + With `any`, the search returns customers in groups `a` or `b` or any + other group specified in the list. + + With `all`, the search returns customers in groups `1` and `2` and all + other groups specified in the list. + + With `none`, the search returns customers not in groups `i` or `ii` or + any other group specified in the list. + + + If any of the search conditions are not met, including when an invalid + or non-existent group ID is provided, + + the result is an empty object (`{}`). + custom_attribute: + type: optional + docs: >- + A filter to select customers based on one or more custom attributes. + + This filter can contain up to 10 custom attribute filters. Each custom + attribute filter specifies filtering criteria for a target custom + + attribute. If multiple custom attribute filters are provided, they are + combined as an `AND` operation. + + + To be valid for a search, the custom attributes must be visible to the + requesting application. For more information, including example + queries, + + see [Search by custom + attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute). + + + Square returns matching customer profiles, which do not contain custom + attributes. To retrieve customer-related custom attributes, + + use the [Customer Custom Attributes + API](api:CustomerCustomAttributes). For example, you can call + + [RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) + using a customer ID from the result set. + segment_ids: + type: optional + docs: >2- + A filter to select customers based on the [segments](entity:CustomerSegment) they belong to. + Segment membership is dynamic and adjusts automatically based on + whether customers meet the segment criteria. + + + You can provide up to three segment IDs in the filter, using any + combination of the `all`, `any`, and `none` fields. + + For the following example, the results include customers who belong to + both segment A and segment B but do not belong to segment C. + + + ``` + + "segment_ids": { + + "all": ["{segment_A_id}", "{segment_B_id}"], + + "none": ["{segment_C_id}"] + + } + + ``` + + + If an invalid or non-existent segment ID is provided in the filter, + Square stops processing the request + + and returns a `400 BAD_REQUEST` error that includes the segment ID. + source: + openapi: openapi/openapi.json + CustomerGroup: + docs: >- + Represents a group of customer profiles. + + + Customer groups can be created, be modified, and have their membership + defined using + + the Customers API or within the Customer Directory in the Square Seller + Dashboard or Point of Sale. + properties: + id: + type: optional + docs: A unique Square-generated ID for the customer group. + validation: + maxLength: 255 + access: read-only + name: + type: string + docs: The name of the customer group. + created_at: + type: optional + docs: The timestamp when the customer group was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp when the customer group was last updated, in RFC 3339 + format. + access: read-only + source: + openapi: openapi/openapi.json + CustomerInclusionExclusion: + enum: + - INCLUDE + - EXCLUDE + docs: |- + Indicates whether customers should be included in, or excluded from, + the result set when they match the filtering criteria. + source: + openapi: openapi/openapi.json + CustomerPreferences: + docs: Represents communication preferences for the customer profile. + properties: + email_unsubscribed: + type: optional> + docs: >- + Indicates whether the customer has unsubscribed from marketing + campaign emails. A value of `true` means that the customer chose to + opt out of email marketing from the current Square seller or from all + Square sellers. This value is read-only from the Customers API. + source: + openapi: openapi/openapi.json + CustomerQuery: + docs: >- + Represents filtering and sorting criteria for a + [SearchCustomers](api-endpoint:Customers-SearchCustomers) request. + properties: + filter: + type: optional + docs: >- + The filtering criteria for the search query. A query can contain + multiple filters in any combination. + + Multiple filters are combined as `AND` statements. + + + __Note:__ Combining multiple filters as `OR` statements is not + supported. Instead, send multiple single-filter + + searches and join the result sets. + sort: + type: optional + docs: |- + Sorting criteria for query results. The default behavior is to sort + customers alphabetically by `given_name` and `family_name`. + source: + openapi: openapi/openapi.json + CustomerSegment: + docs: >- + Represents a group of customer profiles that match one or more predefined + filter criteria. + + + Segments (also known as Smart Groups) are defined and created within the + Customer Directory in the + + Square Seller Dashboard or Point of Sale. + properties: + id: + type: optional + docs: A unique Square-generated ID for the segment. + validation: + maxLength: 255 + access: read-only + name: + type: optional + docs: The name of the segment. + access: read-only + created_at: + type: optional + docs: The timestamp when the segment was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the segment was last updated, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + CustomerSort: + docs: >- + Represents the sorting criteria in a [search query](entity:CustomerQuery) + that defines how to sort + + customer profiles returned in + [SearchCustomers](api-endpoint:Customers-SearchCustomers) results. + properties: + field: + type: optional + docs: >- + Indicates the fields to use as the sort key, which is either the + default set of fields or `created_at`. + + + The default value is `DEFAULT`. + + See [CustomerSortField](#type-customersortfield) for possible values + order: + type: optional + docs: >- + Indicates the order in which results should be sorted based on the + + sort field value. Strings use standard alphabetic comparison + + to determine order. Strings representing numbers are sorted as + strings. + + + The default value is `ASC`. + + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + CustomerSortField: + enum: + - DEFAULT + - CREATED_AT + docs: >- + Specifies customer attributes as the sort key to customer profiles + returned from a search. + source: + openapi: openapi/openapi.json + CustomerTaxIds: + docs: >- + Represents the tax ID associated with a [customer + profile](entity:Customer). The corresponding `tax_ids` field is available + only for customers of sellers in EU countries or the United Kingdom. + + For more information, see [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + properties: + eu_vat: + type: optional> + docs: >- + The EU VAT identification number for the customer. For example, + `IE3426675K`. The ID can contain alphanumeric characters only. + validation: + maxLength: 20 + source: + openapi: openapi/openapi.json + CustomerTextFilter: + docs: >- + A filter to select customers based on exact or fuzzy matching of + + customer attributes against a specified query. Depending on the customer + attributes, + + the filter can be case-sensitive. This filter can be exact or fuzzy, but + it cannot be both. + properties: + exact: + type: optional> + docs: >- + Use the exact filter to select customers whose attributes match + exactly the specified query. + fuzzy: + type: optional> + docs: >- + Use the fuzzy filter to select customers whose attributes match the + specified query + + in a fuzzy manner. When the fuzzy option is used, search queries are + tokenized, and then + + each query token must be matched somewhere in the searched attribute. + For single token queries, + + this is effectively the same behavior as a partial match operation. + source: + openapi: openapi/openapi.json + CustomerUpdatedEvent: + docs: >- + Published when a [customer](entity:Customer) is updated. For more + information, see [Use Customer + Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). + + + Updates to the 'segment_ids' customer field does not invoke a + `customer.updated` event. In addition, the `customer` object in the event + notification does not include this field. + properties: + merchant_id: + type: optional> + docs: The ID of the seller associated with the event. + type: + type: optional> + docs: The type of event. For this object, the value is `customer.updated`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CustomerUpdatedEventData: + docs: The data associated with the event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `customer`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the updated customer. + validation: + maxLength: 192 + object: + type: optional + docs: An object that contains the updated customer. + source: + openapi: openapi/openapi.json + CustomerUpdatedEventObject: + docs: An object that contains the customer associated with the event. + properties: + customer: + type: optional + docs: The updated customer. + source: + openapi: openapi/openapi.json + DataCollectionOptions: + properties: + title: + type: string + docs: The title text to display in the data collection flow on the Terminal. + validation: + minLength: 1 + maxLength: 250 + body: + type: string + docs: >- + The body text to display under the title in the data collection screen + flow on the + + Terminal. + validation: + minLength: 1 + maxLength: 10000 + input_type: + type: DataCollectionOptionsInputType + docs: |- + Represents the type of the input text. + See [InputType](#type-inputtype) for possible values + collected_data: + type: optional + docs: The buyer’s input text from the data collection screen. + source: + openapi: openapi/openapi.json + DataCollectionOptionsInputType: + enum: + - EMAIL + - PHONE_NUMBER + docs: Describes the input type of the data. + source: + openapi: openapi/openapi.json + DateRange: + docs: |- + A range defined by two dates. Used for filtering a query for Connect v2 + objects that have date properties. + properties: + start_date: + type: optional> + docs: >- + A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO + 8601 + + extended format for calendar dates. + + The beginning of a date range (inclusive). + end_date: + type: optional> + docs: >- + A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO + 8601 + + extended format for calendar dates. + + The end of a date range (inclusive). + source: + openapi: openapi/openapi.json + DayOfWeek: + enum: + - SUN + - MON + - TUE + - WED + - THU + - FRI + - SAT + docs: Indicates the specific day of the week. + source: + openapi: openapi/openapi.json + DeleteBookingCustomAttributeDefinitionResponse: + docs: >- + Represents a + [DeleteBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttributeDefinition) + response + + containing error messages when errors occurred during the request. The + successful response does not contain any payload. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteBookingCustomAttributeResponse: + docs: >- + Represents a + [DeleteBookingCustomAttribute](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttribute) + response. + + Either an empty object `{}` (for a successful deletion) or `errors` is + present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteBreakTypeResponse: + docs: >- + The response to a request to delete a `BreakType`. The response might + contain a set + + of `Error` objects if the request resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteCatalogObjectResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + deleted_object_ids: + type: optional> + docs: >- + The IDs of all catalog objects deleted by this request. + + Multiple IDs may be returned when associated objects are also deleted, + for example + + a catalog item variation will be deleted (and its ID included in this + field) + + when its parent catalog item is deleted. + deleted_at: + type: optional + docs: >- + The database + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + of this deletion in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. + source: + openapi: openapi/openapi.json + DeleteCustomerCardResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `DeleteCustomerCard` endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteCustomerCustomAttributeDefinitionResponse: + docs: >- + Represents a response from a delete request containing error messages if + there are any. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteCustomerCustomAttributeResponse: + docs: >- + Represents a + [DeleteCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-DeleteCustomerCustomAttribute) + response. + + Either an empty object `{}` (for a successful deletion) or `errors` is + present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteCustomerGroupResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [DeleteCustomerGroup](api-endpoint:CustomerGroups-DeleteCustomerGroup) + endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteCustomerResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `DeleteCustomer` endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteDisputeEvidenceResponse: + docs: Defines the fields in a `DeleteDisputeEvidence` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + DeleteInvoiceAttachmentResponse: + docs: >- + Represents a + [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) + response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + DeleteInvoiceResponse: + docs: Describes a `DeleteInvoice` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + DeleteLocationCustomAttributeDefinitionResponse: + docs: >- + Represents a response from a delete request containing error messages if + there are any. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteLocationCustomAttributeResponse: + docs: >- + Represents a + [DeleteLocationCustomAttribute](api-endpoint:LocationCustomAttributes-DeleteLocationCustomAttribute) + response. + + Either an empty object `{}` (for a successful deletion) or `errors` is + present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteLoyaltyRewardResponse: + docs: A response returned by the API call. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteMerchantCustomAttributeDefinitionResponse: + docs: >- + Represents a response from a delete request containing error messages if + there are any. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteMerchantCustomAttributeResponse: + docs: >- + Represents a + [DeleteMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-DeleteMerchantCustomAttribute) + response. + + Either an empty object `{}` (for a successful deletion) or `errors` is + present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteOrderCustomAttributeDefinitionResponse: + docs: Represents a response from deleting an order custom attribute definition. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteOrderCustomAttributeResponse: + docs: Represents a response from deleting an order custom attribute. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeletePaymentLinkResponse: + properties: + errors: optional> + id: + type: optional + docs: The ID of the link that is deleted. + cancelled_order_id: + type: optional + docs: >- + The ID of the order that is canceled. When a payment link is deleted, + Square updates the + + the `state` (of the order that the checkout link created) to CANCELED. + source: + openapi: openapi/openapi.json + DeleteShiftResponse: + docs: >- + The response to a request to delete a `Shift`. The response might contain + a set of + + `Error` objects if the request resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteSnippetResponse: + docs: Represents a `DeleteSnippet` response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteSubscriptionActionResponse: + docs: >- + Defines output parameters in a response of the + [DeleteSubscriptionAction](api-endpoint:Subscriptions-DeleteSubscriptionAction) + + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The subscription that has the specified action deleted. + source: + openapi: openapi/openapi.json + DeleteTimecardResponse: + docs: >- + The response to a request to delete a `Timecard`. The response might + contain a set of + + `Error` objects if the request resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteWebhookSubscriptionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [DeleteWebhookSubscription](api-endpoint:WebhookSubscriptions-DeleteWebhookSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + source: + openapi: openapi/openapi.json + Destination: + docs: Information about the destination against which the payout was made. + properties: + type: + type: optional + docs: |- + Type of the destination such as a bank account or debit card. + See [DestinationType](#type-destinationtype) for possible values + id: + type: optional + docs: >- + Square issued unique ID (also known as the instrument ID) associated + with this destination. + source: + openapi: openapi/openapi.json + DestinationDetails: + docs: Details about a refund's destination. + properties: + card_details: + type: optional + docs: >- + Details about a card refund. Only populated if the destination_type is + `CARD`. + cash_details: + type: optional + docs: >- + Details about a cash refund. Only populated if the destination_type is + `CASH`. + external_details: + type: optional + docs: >- + Details about an external refund. Only populated if the + destination_type is `EXTERNAL`. + source: + openapi: openapi/openapi.json + DestinationDetailsCardRefundDetails: + properties: + card: + type: optional + docs: The card's non-confidential details. + entry_method: + type: optional> + docs: >- + The method used to enter the card's details for the refund. The method + can be + + `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. + validation: + maxLength: 50 + auth_result_code: + type: optional> + docs: >- + The authorization code provided by the issuer when a refund is + approved. + validation: + maxLength: 10 + source: + openapi: openapi/openapi.json + DestinationDetailsCashRefundDetails: + docs: >- + Stores details about a cash refund. Contains only non-confidential + information. + properties: + seller_supplied_money: + type: Money + docs: The amount and currency of the money supplied by the seller. + change_back_money: + type: optional + docs: |- + The amount of change due back to the seller. + This read-only field is calculated + from the `amount_money` and `seller_supplied_money` fields. + source: + openapi: openapi/openapi.json + DestinationDetailsExternalRefundDetails: + docs: >- + Stores details about an external refund. Contains only non-confidential + information. + properties: + type: + type: string + docs: >- + The type of external refund the seller paid to the buyer. It can be + one of the + + following: + + - CHECK - Refunded using a physical check. + + - BANK_TRANSFER - Refunded using external bank transfer. + + - OTHER\_GIFT\_CARD - Refunded using a non-Square gift card. + + - CRYPTO - Refunded using a crypto currency. + + - SQUARE_CASH - Refunded using Square Cash App. + + - SOCIAL - Refunded using peer-to-peer payment applications. + + - EXTERNAL - A third-party application gathered this refund outside of + Square. + + - EMONEY - Refunded using an E-money provider. + + - CARD - A credit or debit card that Square does not support. + + - STORED_BALANCE - Use for house accounts, store credit, and so forth. + + - FOOD_VOUCHER - Restaurant voucher provided by employers to employees + to pay for meals + + - OTHER - A type not listed here. + validation: + maxLength: 50 + source: + type: string + docs: |- + A description of the external refund source. For example, + "Food Delivery Service". + validation: + maxLength: 255 + source_id: + type: optional> + docs: An ID to associate the refund to its originating source. + validation: + maxLength: 255 + source: + openapi: openapi/openapi.json + DestinationType: + enum: + - BANK_ACCOUNT + - CARD + - SQUARE_BALANCE + - SQUARE_STORED_BALANCE + docs: List of possible destinations against which a payout can be made. + source: + openapi: openapi/openapi.json + Device: + properties: + id: + type: optional + docs: >- + A synthetic identifier for the device. The identifier includes a + standardized prefix and + + is otherwise an opaque id generated from key device fields. + access: read-only + attributes: + type: DeviceAttributes + docs: A collection of DeviceAttributes representing the device. + components: + type: optional>> + docs: A list of components applicable to the device. + status: + type: optional + docs: The current status of the device. + source: + openapi: openapi/openapi.json + DeviceAttributes: + properties: + type: + type: DeviceAttributesDeviceType + docs: |- + The device type. + See [DeviceType](#type-devicetype) for possible values + manufacturer: + type: string + docs: The maker of the device. + model: + type: optional> + docs: The specific model of the device. + name: + type: optional> + docs: A seller-specified name for the device. + manufacturers_id: + type: optional> + docs: >- + The manufacturer-supplied identifier for the device (where available). + In many cases, + + this identifier will be a serial number. + updated_at: + type: optional + docs: >- + The RFC 3339-formatted value of the most recent update to the device + information. + + (Could represent any field update on the device.) + version: + type: optional + docs: The current version of software installed on the device. + merchant_token: + type: optional> + docs: The merchant_token identifying the merchant controlling the device. + source: + openapi: openapi/openapi.json + DeviceAttributesDeviceType: + type: literal<"TERMINAL"> + docs: An enum identifier of the device type. + DeviceCheckoutOptions: + properties: + device_id: + type: string + docs: >- + The unique ID of the device intended for this `TerminalCheckout`. + + A list of `DeviceCode` objects can be retrieved from the + /v2/devices/codes endpoint. + + Match a `DeviceCode.device_id` value with `device_id` to get the + associated device code. + skip_receipt_screen: + type: optional> + docs: Instructs the device to skip the receipt screen. Defaults to false. + collect_signature: + type: optional> + docs: >- + Indicates that signature collection is desired during checkout. + Defaults to false. + tip_settings: + type: optional + docs: Tip-specific settings. + show_itemized_cart: + type: optional> + docs: >- + Show the itemization screen prior to taking a payment. This field is + only meaningful when the + + checkout includes an order ID. Defaults to true. + source: + openapi: openapi/openapi.json + DeviceCode: + properties: + id: + type: optional + docs: The unique id for this device code. + access: read-only + name: + type: optional> + docs: An optional user-defined name for the device code. + validation: + maxLength: 128 + code: + type: optional + docs: The unique code that can be used to login. + access: read-only + device_id: + type: optional + docs: >- + The unique id of the device that used this code. Populated when the + device is paired up. + access: read-only + product_type: + type: ProductType + docs: The targeting product type of the device code. + location_id: + type: optional> + docs: The location assigned to this code. + validation: + maxLength: 50 + status: + type: optional + docs: |- + The pairing status of the device code. + See [DeviceCodeStatus](#type-devicecodestatus) for possible values + pair_by: + type: optional + docs: >- + When this DeviceCode will expire and no longer login. Timestamp in RFC + 3339 format. + access: read-only + created_at: + type: optional + docs: When this DeviceCode was created. Timestamp in RFC 3339 format. + access: read-only + status_changed_at: + type: optional + docs: >- + When this DeviceCode's status was last changed. Timestamp in RFC 3339 + format. + access: read-only + paired_at: + type: optional + docs: When this DeviceCode was paired. Timestamp in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + DeviceCodePairedEvent: + docs: |- + Published when a Square Terminal has been paired with a + Terminal API client and the device_id of the paired Square Terminal is + available. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"device.code.paired"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DeviceCodePairedEventData: + properties: + type: + type: optional> + docs: Name of the paired object’s type, `"device_code"`. + id: + type: optional + docs: ID of the paired device code. + object: + type: optional + docs: An object containing the paired device code. + source: + openapi: openapi/openapi.json + DeviceCodePairedEventObject: + properties: + device_code: + type: optional + docs: The created terminal checkout + source: + openapi: openapi/openapi.json + DeviceCodeStatus: + enum: + - UNKNOWN + - UNPAIRED + - PAIRED + - EXPIRED + docs: DeviceCode.Status enum. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsApplicationDetails: + properties: + application_type: + type: optional + docs: |- + The type of application. + See [ApplicationType](#type-applicationtype) for possible values + version: + type: optional + docs: The version of the application. + session_location: + type: optional> + docs: The location_id of the session for the application. + device_code_id: + type: optional> + docs: The id of the device code that was used to log in to the device. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsBatteryDetails: + properties: + visible_percent: + type: optional> + docs: The battery charge percentage as displayed on the device. + external_power: + type: optional + docs: |- + The status of external_power. + See [ExternalPower](#type-externalpower) for possible values + source: + openapi: openapi/openapi.json + DeviceComponentDetailsCardReaderDetails: + properties: + version: + type: optional + docs: The version of the card reader. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsEthernetDetails: + properties: + active: + type: optional> + docs: >- + A boolean to represent whether the Ethernet interface is currently + active. + ip_address_v4: + type: optional> + docs: The string representation of the device’s IPv4 address. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsExternalPower: + enum: + - AVAILABLE_CHARGING + - AVAILABLE_NOT_IN_USE + - UNAVAILABLE + - AVAILABLE_INSUFFICIENT + docs: An enum for ExternalPower. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsMeasurement: + docs: A value qualified by unit of measure. + properties: + value: optional> + source: + openapi: openapi/openapi.json + DeviceComponentDetailsWiFiDetails: + properties: + active: + type: optional> + docs: A boolean to represent whether the WiFI interface is currently active. + ssid: + type: optional> + docs: The name of the connected WIFI network. + ip_address_v4: + type: optional> + docs: The string representation of the device’s IPv4 address. + secure_connection: + type: optional> + docs: >- + The security protocol for a secure connection (e.g. WPA2). None + provided if the connection + + is unsecured. + signal_strength: + type: optional + docs: A representation of signal strength of the WIFI network connection. + source: + openapi: openapi/openapi.json + DeviceCreatedEvent: + docs: Published when a Device is created. + properties: + merchant_id: + type: optional> + docs: The merchant the newly created device belongs to. + type: + type: optional> + docs: The type of event this represents. The value is `"device.created"`. + event_id: + type: optional> + docs: A UUID that uniquely identifies this device creation event. + created_at: + type: optional + docs: >- + The time when the device creation event was first created, in RFC 3339 + format. + access: read-only + data: + type: optional + docs: The metadata associated with the device creation event. + source: + openapi: openapi/openapi.json + DeviceCreatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"device"`. + id: + type: optional + docs: The ID of the device. + object: + type: optional + docs: An object containing the created device. + source: + openapi: openapi/openapi.json + DeviceCreatedEventObject: + properties: + device: + type: optional + docs: The created device. + source: + openapi: openapi/openapi.json + DeviceDetails: + docs: Details about the device that took the payment. + properties: + device_id: + type: optional> + docs: The Square-issued ID of the device. + validation: + maxLength: 255 + device_installation_id: + type: optional> + docs: The Square-issued installation ID for the device. + validation: + maxLength: 255 + device_name: + type: optional> + docs: The name of the device set by the seller. + validation: + maxLength: 255 + source: + openapi: openapi/openapi.json + DeviceMetadata: + properties: + battery_percentage: + type: optional> + docs: The Terminal’s remaining battery percentage, between 1-100. + charging_state: + type: optional> + docs: |- + The current charging state of the Terminal. + Options: `CHARGING`, `NOT_CHARGING` + location_id: + type: optional> + docs: >- + The ID of the Square seller business location associated with the + Terminal. + merchant_id: + type: optional> + docs: >- + The ID of the Square merchant account that is currently signed-in to + the Terminal. + network_connection_type: + type: optional> + docs: |- + The Terminal’s current network connection type. + Options: `WIFI`, `ETHERNET` + payment_region: + type: optional> + docs: The country in which the Terminal is authorized to take payments. + serial_number: + type: optional> + docs: >- + The unique identifier assigned to the Terminal, which can be found on + the lower back + + of the device. + os_version: + type: optional> + docs: The current version of the Terminal’s operating system. + app_version: + type: optional> + docs: The current version of the application running on the Terminal. + wifi_network_name: + type: optional> + docs: The name of the Wi-Fi network to which the Terminal is connected. + wifi_network_strength: + type: optional> + docs: |- + The signal strength of the Wi-FI network connection. + Options: `POOR`, `FAIR`, `GOOD`, `EXCELLENT` + ip_address: + type: optional> + docs: The IP address of the Terminal. + source: + openapi: openapi/openapi.json + DeviceStatus: + properties: + category: + type: optional + docs: |- + + See [Category](#type-category) for possible values + source: + openapi: openapi/openapi.json + DeviceStatusCategory: + enum: + - AVAILABLE + - NEEDS_ATTENTION + - OFFLINE + source: + openapi: openapi/openapi.json + DigitalWalletDetails: + docs: >- + Additional details about `WALLET` type payments. Contains only + non-confidential information. + properties: + status: + type: optional> + docs: >- + The status of the `WALLET` payment. The status can be `AUTHORIZED`, + `CAPTURED`, `VOIDED`, or + + `FAILED`. + validation: + maxLength: 50 + brand: + type: optional> + docs: >- + The brand used for the `WALLET` payment. The brand can be `CASH_APP`, + `PAYPAY`, `ALIPAY`, + + `RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or + `UNKNOWN`. + validation: + maxLength: 50 + cash_app_details: + type: optional + docs: Brand-specific details for payments with the `brand` of `CASH_APP`. + source: + openapi: openapi/openapi.json + DisableCardResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [DisableCard](api-endpoint:Cards-DisableCard) endpoint. + + + Note: if there are errors processing the request, the card field will not + be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + card: + type: optional + docs: The retrieved card. + source: + openapi: openapi/openapi.json + DisableEventsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [DisableEvents](api-endpoint:Events-DisableEvents) + endpoint. + + + Note: if there are errors processing the request, the events field will + not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + source: + openapi: openapi/openapi.json + DismissTerminalActionResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + action: + type: optional + docs: Current state of the action to be dismissed. + source: + openapi: openapi/openapi.json + DismissTerminalCheckoutResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + checkout: + type: optional + docs: Current state of the checkout to be dismissed. + source: + openapi: openapi/openapi.json + DismissTerminalRefundResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + refund: + type: optional + docs: Current state of the refund to be dismissed. + source: + openapi: openapi/openapi.json + Dispute: + docs: >- + Represents a + [dispute](https://developer.squareup.com/docs/disputes-api/overview) a + cardholder initiated with their bank. + properties: + dispute_id: + type: optional> + docs: The unique ID for this `Dispute`, generated by Square. + validation: + minLength: 1 + maxLength: 40 + id: + type: optional + docs: The unique ID for this `Dispute`, generated by Square. + validation: + minLength: 1 + maxLength: 40 + amount_money: + type: optional + docs: >- + The disputed amount, which can be less than the total transaction + amount. + + For instance, if multiple items were purchased but the cardholder only + initiates a dispute over some of the items. + reason: + type: optional + docs: |- + The reason why the cardholder initiated the dispute. + See [DisputeReason](#type-disputereason) for possible values + state: + type: optional + docs: |- + The current state of this dispute. + See [DisputeState](#type-disputestate) for possible values + due_at: + type: optional> + docs: >- + The deadline by which the seller must respond to the dispute, in [RFC + 3339 + format](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates). + validation: + minLength: 1 + maxLength: 40 + disputed_payment: + type: optional + docs: The payment challenged in this dispute. + evidence_ids: + type: optional>> + docs: The IDs of the evidence associated with the dispute. + card_brand: + type: optional + docs: |- + The card brand used in the disputed payment. + See [CardBrand](#type-cardbrand) for possible values + created_at: + type: optional + docs: The timestamp when the dispute was created, in RFC 3339 format. + validation: + minLength: 1 + maxLength: 40 + access: read-only + updated_at: + type: optional + docs: The timestamp when the dispute was last updated, in RFC 3339 format. + validation: + minLength: 1 + maxLength: 40 + access: read-only + brand_dispute_id: + type: optional> + docs: >- + The ID of the dispute in the card brand system, generated by the card + brand. + validation: + minLength: 1 + maxLength: 40 + reported_date: + type: optional> + docs: The timestamp when the dispute was reported, in RFC 3339 format. + validation: + minLength: 1 + maxLength: 40 + reported_at: + type: optional> + docs: The timestamp when the dispute was reported, in RFC 3339 format. + validation: + minLength: 1 + maxLength: 40 + version: + type: optional + docs: The current version of the `Dispute`. + location_id: + type: optional> + docs: The ID of the location where the dispute originated. + validation: + minLength: 1 + maxLength: 40 + source: + openapi: openapi/openapi.json + DisputeCreatedEvent: + docs: Published when a [Dispute](entity:Dispute) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeCreatedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeEvidence: + properties: + evidence_id: + type: optional> + docs: The Square-generated ID of the evidence. + validation: + minLength: 1 + maxLength: 40 + id: + type: optional + docs: The Square-generated ID of the evidence. + validation: + minLength: 1 + maxLength: 40 + dispute_id: + type: optional> + docs: The ID of the dispute the evidence is associated with. + validation: + minLength: 1 + maxLength: 40 + evidence_file: + type: optional + docs: Image, PDF, TXT + evidence_text: + type: optional> + docs: Raw text + validation: + minLength: 1 + maxLength: 500 + uploaded_at: + type: optional> + docs: The time when the evidence was uploaded, in RFC 3339 format. + validation: + minLength: 1 + maxLength: 40 + evidence_type: + type: optional + docs: >- + The type of the evidence. + + See [DisputeEvidenceType](#type-disputeevidencetype) for possible + values + source: + openapi: openapi/openapi.json + DisputeEvidenceAddedEvent: + docs: >- + Published when evidence is added to a [Dispute](entity:Dispute) + + from the Disputes Dashboard in the Seller Dashboard, the Square Point of + Sale app, + + or by calling either + [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) + or + [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceAddedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceAddedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeEvidenceCreatedEvent: + docs: >- + Published when evidence is added to a [Dispute](entity:Dispute) + + from the Disputes Dashboard in the Seller Dashboard, the Square Point of + Sale app, + + or by calling either + [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) + or + [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceCreatedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeEvidenceDeletedEvent: + docs: >- + Published when evidence is removed from a [Dispute](entity:Dispute) + + from the Disputes Dashboard in the Seller Dashboard, the Square Point of + Sale app, + + or by calling + [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceDeletedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceDeletedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeEvidenceFile: + docs: A file to be uploaded as dispute evidence. + properties: + filename: + type: optional> + docs: >- + The file name including the file extension. For example: + "receipt.tiff". + validation: + minLength: 1 + maxLength: 40 + filetype: + type: optional> + docs: >- + Dispute evidence files must be application/pdf, image/heic, + image/heif, image/jpeg, image/png, or image/tiff formats. + validation: + minLength: 1 + maxLength: 40 + source: + openapi: openapi/openapi.json + DisputeEvidenceRemovedEvent: + docs: >- + Published when evidence is removed from a [Dispute](entity:Dispute) + + from the Disputes Dashboard in the Seller Dashboard, the Square Point of + Sale app, + + or by calling + [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceRemovedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceRemovedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeEvidenceType: + enum: + - GENERIC_EVIDENCE + - ONLINE_OR_APP_ACCESS_LOG + - AUTHORIZATION_DOCUMENTATION + - CANCELLATION_OR_REFUND_DOCUMENTATION + - CARDHOLDER_COMMUNICATION + - CARDHOLDER_INFORMATION + - PURCHASE_ACKNOWLEDGEMENT + - DUPLICATE_CHARGE_DOCUMENTATION + - PRODUCT_OR_SERVICE_DESCRIPTION + - RECEIPT + - SERVICE_RECEIVED_DOCUMENTATION + - PROOF_OF_DELIVERY_DOCUMENTATION + - RELATED_TRANSACTION_DOCUMENTATION + - REBUTTAL_EXPLANATION + - TRACKING_NUMBER + docs: The type of the dispute evidence. + source: + openapi: openapi/openapi.json + DisputeReason: + enum: + - AMOUNT_DIFFERS + - CANCELLED + - DUPLICATE + - NO_KNOWLEDGE + - NOT_AS_DESCRIBED + - NOT_RECEIVED + - PAID_BY_OTHER_MEANS + - CUSTOMER_REQUESTS_CREDIT + - EMV_LIABILITY_SHIFT + docs: |- + The list of possible reasons why a cardholder might initiate a + dispute with their bank. + source: + openapi: openapi/openapi.json + DisputeState: + enum: + - INQUIRY_EVIDENCE_REQUIRED + - INQUIRY_PROCESSING + - INQUIRY_CLOSED + - EVIDENCE_REQUIRED + - PROCESSING + - WON + - LOST + - ACCEPTED + docs: The list of possible dispute states. + source: + openapi: openapi/openapi.json + DisputeStateChangedEvent: + docs: >- + Published when the state of a [Dispute](entity:Dispute) changes. + + This includes the dispute resolution (WON, LOST) reported by the bank. The + event + + data includes details of what changed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeStateChangedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeStateChangedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeStateUpdatedEvent: + docs: >- + Published when the state of a [Dispute](entity:Dispute) changes. + + This includes the dispute resolution (WON, LOST) reported by the bank. The + event + + data includes details of what changed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeStateUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeStateUpdatedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputedPayment: + docs: The payment the cardholder disputed. + properties: + payment_id: + type: optional> + docs: Square-generated unique ID of the payment being disputed. + validation: + minLength: 1 + maxLength: 192 + source: + openapi: openapi/openapi.json + EcomVisibility: + enum: + - UNINDEXED + - UNAVAILABLE + - HIDDEN + - VISIBLE + docs: Determines item visibility in Ecom (Online Store) and Online Checkout. + source: + openapi: openapi/openapi.json + Employee: + docs: >- + An employee object that is used by the external API. + + + DEPRECATED at version 2020-08-26. Replaced by + [TeamMember](entity:TeamMember). + properties: + id: + type: optional + docs: UUID for this object. + first_name: + type: optional> + docs: The employee's first name. + last_name: + type: optional> + docs: The employee's last name. + email: + type: optional> + docs: The employee's email address + phone_number: + type: optional> + docs: The employee's phone number in E.164 format, i.e. "+12125554250" + location_ids: + type: optional>> + docs: A list of location IDs where this employee has access to. + status: + type: optional + docs: |- + Specifies the status of the employees being fetched. + See [EmployeeStatus](#type-employeestatus) for possible values + is_owner: + type: optional> + docs: |- + Whether this employee is the owner of the merchant. Each merchant + has one owner employee, and that employee has full authority over + the account. + created_at: + type: optional + docs: A read-only timestamp in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: A read-only timestamp in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + EmployeeStatus: + enum: + - ACTIVE + - INACTIVE + docs: >- + The status of the Employee being retrieved. + + + DEPRECATED at version 2020-08-26. Replaced by + [TeamMemberStatus](entity:TeamMemberStatus). + source: + openapi: openapi/openapi.json + EmployeeWage: + docs: >- + The hourly wage rate that an employee earns on a `Shift` for doing the job + specified by the `title` property of this object. Deprecated at version + 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage). + properties: + id: + type: optional + docs: The UUID for this object. + employee_id: + type: optional> + docs: The `Employee` that this wage is assigned to. + title: + type: optional> + docs: The job title that this wage relates to. + hourly_rate: + type: optional + docs: |- + Can be a custom-set hourly wage or the calculated effective hourly + wage based on the annual wage and hours worked per week. + source: + openapi: openapi/openapi.json + EnableEventsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [EnableEvents](api-endpoint:Events-EnableEvents) + endpoint. + + + Note: if there are errors processing the request, the events field will + not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + source: + openapi: openapi/openapi.json + Error: + docs: >- + Represents an error encountered during a request to the Connect API. + + + See [Handling + errors](https://developer.squareup.com/docs/build-basics/handling-errors) + for more information. + properties: + category: + type: ErrorCategory + docs: |- + The high-level category for the error. + See [ErrorCategory](#type-errorcategory) for possible values + code: + type: ErrorCode + docs: |- + The specific code of the error. + See [ErrorCode](#type-errorcode) for possible values + detail: + type: optional + docs: A human-readable description of the error for debugging purposes. + field: + type: optional + docs: |- + The name of the field provided in the original request (if any) that + the error pertains to. + source: + openapi: openapi/openapi.json + ErrorCategory: + enum: + - API_ERROR + - AUTHENTICATION_ERROR + - INVALID_REQUEST_ERROR + - RATE_LIMIT_ERROR + - PAYMENT_METHOD_ERROR + - REFUND_ERROR + - MERCHANT_SUBSCRIPTION_ERROR + - EXTERNAL_VENDOR_ERROR + docs: |- + Indicates which high-level category of error has occurred during a + request to the Connect API. + source: + openapi: openapi/openapi.json + ErrorCode: + enum: + - INTERNAL_SERVER_ERROR + - UNAUTHORIZED + - ACCESS_TOKEN_EXPIRED + - ACCESS_TOKEN_REVOKED + - CLIENT_DISABLED + - FORBIDDEN + - INSUFFICIENT_SCOPES + - APPLICATION_DISABLED + - V1_APPLICATION + - V1_ACCESS_TOKEN + - CARD_PROCESSING_NOT_ENABLED + - MERCHANT_SUBSCRIPTION_NOT_FOUND + - BAD_REQUEST + - MISSING_REQUIRED_PARAMETER + - INCORRECT_TYPE + - INVALID_TIME + - INVALID_TIME_RANGE + - INVALID_VALUE + - INVALID_CURSOR + - UNKNOWN_QUERY_PARAMETER + - CONFLICTING_PARAMETERS + - EXPECTED_JSON_BODY + - INVALID_SORT_ORDER + - VALUE_REGEX_MISMATCH + - VALUE_TOO_SHORT + - VALUE_TOO_LONG + - VALUE_TOO_LOW + - VALUE_TOO_HIGH + - VALUE_EMPTY + - ARRAY_LENGTH_TOO_LONG + - ARRAY_LENGTH_TOO_SHORT + - ARRAY_EMPTY + - EXPECTED_BOOLEAN + - EXPECTED_INTEGER + - EXPECTED_FLOAT + - EXPECTED_STRING + - EXPECTED_OBJECT + - EXPECTED_ARRAY + - EXPECTED_MAP + - EXPECTED_BASE64_ENCODED_BYTE_ARRAY + - INVALID_ARRAY_VALUE + - INVALID_ENUM_VALUE + - INVALID_CONTENT_TYPE + - INVALID_FORM_VALUE + - CUSTOMER_NOT_FOUND + - ONE_INSTRUMENT_EXPECTED + - NO_FIELDS_SET + - TOO_MANY_MAP_ENTRIES + - MAP_KEY_LENGTH_TOO_SHORT + - MAP_KEY_LENGTH_TOO_LONG + - CUSTOMER_MISSING_NAME + - CUSTOMER_MISSING_EMAIL + - INVALID_PAUSE_LENGTH + - INVALID_DATE + - UNSUPPORTED_COUNTRY + - UNSUPPORTED_CURRENCY + - APPLE_TTP_PIN_TOKEN + - CARD_EXPIRED + - INVALID_EXPIRATION + - INVALID_EXPIRATION_YEAR + - INVALID_EXPIRATION_DATE + - UNSUPPORTED_CARD_BRAND + - UNSUPPORTED_ENTRY_METHOD + - INVALID_ENCRYPTED_CARD + - INVALID_CARD + - PAYMENT_AMOUNT_MISMATCH + - GENERIC_DECLINE + - CVV_FAILURE + - ADDRESS_VERIFICATION_FAILURE + - INVALID_ACCOUNT + - CURRENCY_MISMATCH + - INSUFFICIENT_FUNDS + - INSUFFICIENT_PERMISSIONS + - CARDHOLDER_INSUFFICIENT_PERMISSIONS + - INVALID_LOCATION + - TRANSACTION_LIMIT + - VOICE_FAILURE + - PAN_FAILURE + - EXPIRATION_FAILURE + - CARD_NOT_SUPPORTED + - READER_DECLINED + - INVALID_PIN + - MISSING_PIN + - MISSING_ACCOUNT_TYPE + - INVALID_POSTAL_CODE + - INVALID_FEES + - MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED + - PAYMENT_LIMIT_EXCEEDED + - GIFT_CARD_AVAILABLE_AMOUNT + - ACCOUNT_UNUSABLE + - BUYER_REFUSED_PAYMENT + - DELAYED_TRANSACTION_EXPIRED + - DELAYED_TRANSACTION_CANCELED + - DELAYED_TRANSACTION_CAPTURED + - DELAYED_TRANSACTION_FAILED + - CARD_TOKEN_EXPIRED + - CARD_TOKEN_USED + - AMOUNT_TOO_HIGH + - UNSUPPORTED_INSTRUMENT_TYPE + - REFUND_AMOUNT_INVALID + - REFUND_ALREADY_PENDING + - PAYMENT_NOT_REFUNDABLE + - PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE + - REFUND_ERROR_PAYMENT_NEEDS_COMPLETION + - REFUND_DECLINED + - INSUFFICIENT_PERMISSIONS_FOR_REFUND + - INVALID_CARD_DATA + - SOURCE_USED + - SOURCE_EXPIRED + - UNSUPPORTED_LOYALTY_REWARD_TIER + - LOCATION_MISMATCH + - ORDER_UNPAID_NOT_RETURNABLE + - IDEMPOTENCY_KEY_REUSED + - UNEXPECTED_VALUE + - SANDBOX_NOT_SUPPORTED + - INVALID_EMAIL_ADDRESS + - INVALID_PHONE_NUMBER + - CHECKOUT_EXPIRED + - BAD_CERTIFICATE + - INVALID_SQUARE_VERSION_FORMAT + - API_VERSION_INCOMPATIBLE + - CARD_PRESENCE_REQUIRED + - UNSUPPORTED_SOURCE_TYPE + - CARD_MISMATCH + - PLAID_ERROR + - PLAID_ERROR_ITEM_LOGIN_REQUIRED + - PLAID_ERROR_RATE_LIMIT + - CARD_DECLINED + - VERIFY_CVV_FAILURE + - VERIFY_AVS_FAILURE + - CARD_DECLINED_CALL_ISSUER + - CARD_DECLINED_VERIFICATION_REQUIRED + - BAD_EXPIRATION + - CHIP_INSERTION_REQUIRED + - ALLOWABLE_PIN_TRIES_EXCEEDED + - RESERVATION_DECLINED + - UNKNOWN_BODY_PARAMETER + - NOT_FOUND + - APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND + - METHOD_NOT_ALLOWED + - NOT_ACCEPTABLE + - REQUEST_TIMEOUT + - CONFLICT + - GONE + - REQUEST_ENTITY_TOO_LARGE + - UNSUPPORTED_MEDIA_TYPE + - UNPROCESSABLE_ENTITY + - RATE_LIMITED + - NOT_IMPLEMENTED + - BAD_GATEWAY + - SERVICE_UNAVAILABLE + - TEMPORARY_ERROR + - GATEWAY_TIMEOUT + docs: |- + Indicates the specific error that occurred during a request to a + Square API. + source: + openapi: openapi/openapi.json + Event: + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + EventData: + properties: + type: + type: optional> + docs: The name of the affected object’s type. + id: + type: optional + docs: The ID of the affected object. + deleted: + type: optional> + docs: >- + This is true if the affected object has been deleted; otherwise, it's + absent. + object: + type: optional>> + docs: >- + An object containing fields and values relevant to the event. It is + absent if the affected object has been deleted. + source: + openapi: openapi/openapi.json + EventMetadata: + docs: Contains metadata about a particular [Event](entity:Event). + properties: + event_id: + type: optional> + docs: A unique ID for the event. + api_version: + type: optional> + docs: >- + The API version of the event. This corresponds to the default API + version of the developer application at the time when the event was + created. + source: + openapi: openapi/openapi.json + EventTypeMetadata: + docs: Contains the metadata of a webhook event type. + properties: + event_type: + type: optional + docs: The event type. + access: read-only + api_version_introduced: + type: optional + docs: The API version at which the event type was introduced. + access: read-only + release_status: + type: optional + docs: The release status of the event type. + access: read-only + source: + openapi: openapi/openapi.json + ExcludeStrategy: + enum: + - LEAST_EXPENSIVE + - MOST_EXPENSIVE + docs: |- + Indicates which products matched by a CatalogPricingRule + will be excluded if the pricing rule uses an exclude set. + source: + openapi: openapi/openapi.json + ExternalPaymentDetails: + docs: >- + Stores details about an external payment. Contains only non-confidential + information. + + For more information, see + + [Take External + Payments](https://developer.squareup.com/docs/payments-api/take-payments/external-payments). + properties: + type: + type: string + docs: >- + The type of external payment the seller received. It can be one of the + following: + + - CHECK - Paid using a physical check. + + - BANK_TRANSFER - Paid using external bank transfer. + + - OTHER\_GIFT\_CARD - Paid using a non-Square gift card. + + - CRYPTO - Paid using a crypto currency. + + - SQUARE_CASH - Paid using Square Cash App. + + - SOCIAL - Paid using peer-to-peer payment applications. + + - EXTERNAL - A third-party application gathered this payment outside + of Square. + + - EMONEY - Paid using an E-money provider. + + - CARD - A credit or debit card that Square does not support. + + - STORED_BALANCE - Use for house accounts, store credit, and so forth. + + - FOOD_VOUCHER - Restaurant voucher provided by employers to employees + to pay for meals + + - OTHER - A type not listed here. + validation: + maxLength: 50 + source: + type: string + docs: |- + A description of the external payment source. For example, + "Food Delivery Service". + validation: + maxLength: 255 + source_id: + type: optional> + docs: An ID to associate the payment to its originating source. + validation: + maxLength: 255 + source_fee_money: + type: optional + docs: |- + The fees paid to the source. The `amount_money` minus this field is + the net amount seller receives. + source: + openapi: openapi/openapi.json + FilterValue: + docs: >- + A filter to select resources based on an exact field value. For any given + + value, the value can only be in one property. Depending on the field, + either + + all properties can be set or only a subset will be available. + + + Refer to the documentation of the field. + properties: + all: + type: optional>> + docs: A list of terms that must be present on the field of the resource. + any: + type: optional>> + docs: |- + A list of terms where at least one of them must be present on the + field of the resource. + none: + type: optional>> + docs: A list of terms that must not be present on the field the resource + source: + openapi: openapi/openapi.json + FloatNumberRange: + docs: Specifies a decimal number range. + properties: + start_at: + type: optional> + docs: A decimal value indicating where the range starts. + end_at: + type: optional> + docs: A decimal value indicating where the range ends. + source: + openapi: openapi/openapi.json + Fulfillment: + docs: >- + Contains details about how to fulfill this order. + + Orders can only be created with at most one fulfillment using the API. + + However, orders returned by the Orders API might contain multiple + fulfillments because sellers can create multiple fulfillments using Square + products such as Square Online. + properties: + uid: + type: optional> + docs: A unique ID that identifies the fulfillment only within this order. + validation: + maxLength: 60 + type: + type: optional + docs: |- + The type of the fulfillment. + See [FulfillmentType](#type-fulfillmenttype) for possible values + state: + type: optional + docs: |- + The state of the fulfillment. + See [FulfillmentState](#type-fulfillmentstate) for possible values + line_item_application: + type: optional + docs: >- + Describes what order line items this fulfillment applies to. + + It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment + entries. + + See + [FulfillmentFulfillmentLineItemApplication](#type-fulfillmentfulfillmentlineitemapplication) + for possible values + entries: + type: optional> + docs: >- + A list of entries pertaining to the fulfillment of an order. Each + entry must reference + + a valid `uid` for an order line item in the `line_item_uid` field, as + well as a `quantity` to + + fulfill. + + + Multiple entries can reference the same line item `uid`, as long as + the total quantity among + + all fulfillment entries referencing a single line item does not exceed + the quantity of the + + order's line item itself. + + + An order cannot be marked as `COMPLETED` before all fulfillments are + `COMPLETED`, + + `CANCELED`, or `FAILED`. Fulfillments can be created and completed + independently + + before order completion. + access: read-only + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this fulfillment. Metadata fields + are intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + pickup_details: + type: optional + docs: >- + Contains details for a pickup fulfillment. These details are required + when the fulfillment + + type is `PICKUP`. + shipment_details: + type: optional + docs: >- + Contains details for a shipment fulfillment. These details are + required when the fulfillment type + + is `SHIPMENT`. + + + A shipment fulfillment's relationship to fulfillment `state`: + + `PROPOSED`: A shipment is requested. + + `RESERVED`: Fulfillment in progress. Shipment processing. + + `PREPARED`: Shipment packaged. Shipping label created. + + `COMPLETED`: Package has been shipped. + + `CANCELED`: Shipment has been canceled. + + `FAILED`: Shipment has failed. + delivery_details: + type: optional + docs: Describes delivery details of an order fulfillment. + source: + openapi: openapi/openapi.json + FulfillmentDeliveryDetails: + docs: Describes delivery details of an order fulfillment. + properties: + recipient: + type: optional + docs: The contact information for the person to receive the fulfillment. + schedule_type: + type: >- + optional + docs: >- + Indicates the fulfillment delivery schedule type. If `SCHEDULED`, then + + `deliver_at` is required. If `ASAP`, then `prep_time_duration` is + required. The default is `SCHEDULED`. + + See + [OrderFulfillmentDeliveryDetailsScheduleType](#type-orderfulfillmentdeliverydetailsscheduletype) + for possible values + placed_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was placed. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + + + Must be in RFC 3339 timestamp format, e.g., + "2016-09-04T23:59:33.123Z". + access: read-only + deliver_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + that represents the start of the delivery period. + + When the fulfillment `schedule_type` is `ASAP`, the field is + automatically + + set to the current time plus the `prep_time_duration`. + + Otherwise, the application can set this field while the fulfillment + `state` is + + `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the + + terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). + + + The timestamp must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + prep_time_duration: + type: optional> + docs: |- + The duration of time it takes to prepare and deliver this fulfillment. + The duration must be in RFC 3339 format (for example, "P1W3D"). + delivery_window_duration: + type: optional> + docs: >- + The time period after `deliver_at` in which to deliver the order. + + Applications can set this field when the fulfillment `state` is + + `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal + state + + such as `COMPLETED`, `CANCELED`, and `FAILED`). + + + The duration must be in RFC 3339 format (for example, "P1W3D"). + note: + type: optional> + docs: >- + Provides additional instructions about the delivery fulfillment. + + It is displayed in the Square Point of Sale application and set by the + API. + validation: + maxLength: 550 + completed_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicates when the seller completed the fulfillment. + + This field is automatically set when fulfillment `state` changes to + `COMPLETED`. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + in_progress_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicates when the seller started processing the fulfillment. + + This field is automatically set when the fulfillment `state` changes + to `RESERVED`. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + access: read-only + rejected_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was rejected. This field is + + automatically set when the fulfillment `state` changes to `FAILED`. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + access: read-only + ready_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the seller marked the fulfillment as ready for + + courier pickup. This field is automatically set when the fulfillment + `state` changes + + to PREPARED. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + access: read-only + delivered_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was delivered to the recipient. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + access: read-only + canceled_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was canceled. This field is + automatically + + set when the fulfillment `state` changes to `CANCELED`. + + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + access: read-only + cancel_reason: + type: optional> + docs: 'The delivery cancellation reason. Max length: 100 characters.' + validation: + maxLength: 100 + courier_pickup_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when an order can be picked up by the courier for delivery. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + courier_pickup_window_duration: + type: optional> + docs: >- + The time period after `courier_pickup_at` in which the courier should + pick up the order. + + The duration must be in RFC 3339 format (for example, "P1W3D"). + is_no_contact_delivery: + type: optional> + docs: Whether the delivery is preferred to be no contact. + dropoff_notes: + type: optional> + docs: >- + A note to provide additional instructions about how to deliver the + order. + validation: + maxLength: 550 + courier_provider_name: + type: optional> + docs: The name of the courier provider. + validation: + maxLength: 255 + courier_support_phone_number: + type: optional> + docs: The support phone number of the courier. + validation: + maxLength: 17 + square_delivery_id: + type: optional> + docs: The identifier for the delivery created by Square. + validation: + maxLength: 50 + external_delivery_id: + type: optional> + docs: >- + The identifier for the delivery created by the third-party courier + service. + validation: + maxLength: 50 + managed_delivery: + type: optional> + docs: >- + The flag to indicate the delivery is managed by a third party (ie + DoorDash), which means + + we may not receive all recipient information for PII purposes. + source: + openapi: openapi/openapi.json + FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType: + enum: + - SCHEDULED + - ASAP + docs: The schedule type of the delivery fulfillment. + source: + openapi: openapi/openapi.json + FulfillmentFulfillmentEntry: + docs: >- + Links an order line item to a fulfillment. Each entry must reference + + a valid `uid` for an order line item in the `line_item_uid` field, as well + as a `quantity` to + + fulfill. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the fulfillment entry only within this + order. + validation: + maxLength: 60 + line_item_uid: + type: string + docs: The `uid` from the order line item. + validation: + minLength: 1 + quantity: + type: string + docs: >- + The quantity of the line item being fulfilled, formatted as a decimal + number. + + For example, `"3"`. + + + Fulfillments for line items with a `quantity_unit` can have + non-integer quantities. + + For example, `"1.70000"`. + validation: + minLength: 1 + maxLength: 12 + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this fulfillment entry. Metadata + fields are intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + source: + openapi: openapi/openapi.json + FulfillmentFulfillmentLineItemApplication: + enum: + - ALL + - ENTRY_LIST + docs: >- + The `line_item_application` describes what order line items this + fulfillment applies + + to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment + entries. + source: + openapi: openapi/openapi.json + FulfillmentPickupDetails: + docs: Contains details necessary to fulfill a pickup order. + properties: + recipient: + type: optional + docs: >- + Information about the person to pick up this fulfillment from a + physical + + location. + expires_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when this fulfillment expires if it is not marked in + progress. The timestamp must be + + in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The + expiration time can only be set + + up to 7 days in the future. If `expires_at` is not set, any new + payments attached to the order + + are automatically completed. + auto_complete_duration: + type: optional> + docs: >- + The duration of time after which an in progress pickup fulfillment is + automatically moved + + to the `COMPLETED` state. The duration must be in RFC 3339 format (for + example, "P1W3D"). + + + If not set, this pickup fulfillment remains in progress until it is + canceled or completed. + schedule_type: + type: optional + docs: >- + The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`. + + See + [FulfillmentPickupDetailsScheduleType](#type-fulfillmentpickupdetailsscheduletype) + for possible values + pickup_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + that represents the start of the pickup window. Must be in RFC 3339 + timestamp format, e.g., + + "2016-09-04T23:59:33.123Z". + + + For fulfillments with the schedule type `ASAP`, this is automatically + set + + to the current time plus the expected duration to prepare the + fulfillment. + pickup_window_duration: + type: optional> + docs: >- + The window of time in which the order should be picked up after the + `pickup_at` timestamp. + + Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an + + informational guideline for merchants. + prep_time_duration: + type: optional> + docs: |- + The duration of time it takes to prepare this fulfillment. + The duration must be in RFC 3339 format (for example, "P1W3D"). + note: + type: optional> + docs: >- + A note to provide additional instructions about the pickup + + fulfillment displayed in the Square Point of Sale application and set + by the API. + validation: + maxLength: 500 + placed_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was placed. The timestamp must be in + RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + accepted_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was marked in progress. The timestamp + must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + rejected_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was rejected. The timestamp must be in + RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + ready_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment is marked as ready for pickup. The + timestamp must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + expired_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment expired. The timestamp must be in RFC + 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + picked_up_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was picked up by the recipient. The + timestamp must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + canceled_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was canceled. The timestamp must be in + RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + cancel_reason: + type: optional> + docs: >- + A description of why the pickup was canceled. The maximum length: 100 + characters. + validation: + maxLength: 100 + is_curbside_pickup: + type: optional> + docs: >- + If set to `true`, indicates that this pickup order is for curbside + pickup, not in-store pickup. + curbside_pickup_details: + type: optional + docs: >- + Specific details for curbside pickup. These details can only be + populated if `is_curbside_pickup` is set to `true`. + source: + openapi: openapi/openapi.json + FulfillmentPickupDetailsCurbsidePickupDetails: + docs: Specific details for curbside pickup. + properties: + curbside_details: + type: optional> + docs: >- + Specific details for curbside pickup, such as parking number and + vehicle model. + validation: + maxLength: 250 + buyer_arrived_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the buyer arrived and is waiting for pickup. The + timestamp must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + source: + openapi: openapi/openapi.json + FulfillmentPickupDetailsScheduleType: + enum: + - SCHEDULED + - ASAP + docs: The schedule type of the pickup fulfillment. + source: + openapi: openapi/openapi.json + FulfillmentRecipient: + docs: Information about the fulfillment recipient. + properties: + customer_id: + type: optional> + docs: >- + The ID of the customer associated with the fulfillment. + + + If `customer_id` is provided, the fulfillment recipient's + `display_name`, + + `email_address`, and `phone_number` are automatically populated from + the + + targeted customer profile. If these fields are set in the request, the + request + + values override the information from the customer profile. If the + + targeted customer profile does not contain the necessary information + and + + these fields are left unset, the request results in an error. + validation: + maxLength: 191 + display_name: + type: optional> + docs: >- + The display name of the fulfillment recipient. This field is required. + + + If provided, the display name overrides the corresponding customer + profile value + + indicated by `customer_id`. + validation: + maxLength: 255 + email_address: + type: optional> + docs: >- + The email address of the fulfillment recipient. + + + If provided, the email address overrides the corresponding customer + profile value + + indicated by `customer_id`. + validation: + maxLength: 255 + phone_number: + type: optional> + docs: >- + The phone number of the fulfillment recipient. This field is required. + + + If provided, the phone number overrides the corresponding customer + profile value + + indicated by `customer_id`. + validation: + maxLength: 17 + address: + type: optional
+ docs: >- + The address of the fulfillment recipient. This field is required. + + + If provided, the address overrides the corresponding customer profile + value + + indicated by `customer_id`. + source: + openapi: openapi/openapi.json + FulfillmentShipmentDetails: + docs: Contains the details necessary to fulfill a shipment order. + properties: + recipient: + type: optional + docs: Information about the person to receive this shipment fulfillment. + carrier: + type: optional> + docs: >- + The shipping carrier being used to ship this fulfillment (such as UPS, + FedEx, or USPS). + validation: + maxLength: 50 + shipping_note: + type: optional> + docs: A note with additional information for the shipping carrier. + validation: + maxLength: 500 + shipping_type: + type: optional> + docs: >- + A description of the type of shipping product purchased from the + carrier + + (such as First Class, Priority, or Express). + validation: + maxLength: 50 + tracking_number: + type: optional> + docs: >- + The reference number provided by the carrier to track the shipment's + progress. + validation: + maxLength: 100 + tracking_url: + type: optional> + docs: A link to the tracking webpage on the carrier's website. + validation: + maxLength: 2000 + placed_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the shipment was requested. The timestamp must be in + RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + in_progress_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when this fulfillment was moved to the `RESERVED` state, + which indicates that preparation + + of this shipment has begun. The timestamp must be in RFC 3339 format + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + packaged_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when this fulfillment was moved to the `PREPARED` state, + which indicates that the + + fulfillment is packaged. The timestamp must be in RFC 3339 format (for + example, "2016-09-04T23:59:33.123Z"). + access: read-only + expected_shipped_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the shipment is expected to be delivered to the + shipping carrier. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + shipped_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when this fulfillment was moved to the `COMPLETED` state, + which indicates that + + the fulfillment has been given to the shipping carrier. The timestamp + must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + canceled_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating the shipment was canceled. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + cancel_reason: + type: optional> + docs: A description of why the shipment was canceled. + validation: + maxLength: 100 + failed_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the shipment failed to be completed. The timestamp + must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + failure_reason: + type: optional> + docs: A description of why the shipment failed to be completed. + validation: + maxLength: 100 + source: + openapi: openapi/openapi.json + FulfillmentState: + enum: + - PROPOSED + - RESERVED + - PREPARED + - COMPLETED + - CANCELED + - FAILED + docs: The current state of this fulfillment. + source: + openapi: openapi/openapi.json + FulfillmentType: + enum: + - PICKUP + - SHIPMENT + - DELIVERY + docs: The type of fulfillment. + source: + openapi: openapi/openapi.json + GetBankAccountByV1IdResponse: + docs: Response object returned by GetBankAccountByV1Id. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + bank_account: + type: optional + docs: The requested `BankAccount` object. + source: + openapi: openapi/openapi.json + GetBankAccountResponse: + docs: Response object returned by `GetBankAccount`. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + bank_account: + type: optional + docs: The requested `BankAccount` object. + source: + openapi: openapi/openapi.json + GetBreakTypeResponse: + docs: >- + The response to a request to get a `BreakType`. The response contains + + the requested `BreakType` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + break_type: + type: optional + docs: The response object. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetDeviceCodeResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + device_code: + type: optional + docs: The queried DeviceCode. + source: + openapi: openapi/openapi.json + GetDeviceResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + device: + type: optional + docs: The requested `Device`. + source: + openapi: openapi/openapi.json + GetEmployeeWageResponse: + docs: >- + A response to a request to get an `EmployeeWage`. The response contains + + the requested `EmployeeWage` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + employee_wage: + type: optional + docs: The requested `EmployeeWage` object. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetInvoiceResponse: + docs: Describes a `GetInvoice` response. + properties: + invoice: + type: optional + docs: The invoice requested. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + GetPaymentRefundResponse: + docs: >- + Defines the response returned by + [GetRefund](api-endpoint:Refunds-GetPaymentRefund). + + + Note: If there are errors processing the request, the refund field might + not be + + present or it might be present in a FAILED state. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refund: + type: optional + docs: The requested `PaymentRefund`. + source: + openapi: openapi/openapi.json + GetPaymentResponse: + docs: >- + Defines the response returned by + [GetPayment](api-endpoint:Payments-GetPayment). + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + payment: + type: optional + docs: The requested `Payment`. + source: + openapi: openapi/openapi.json + GetPayoutResponse: + properties: + payout: + type: optional + docs: The requested payout. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + GetShiftResponse: + docs: |- + A response to a request to get a `Shift`. The response contains + the requested `Shift` object and might contain a set of `Error` objects if + the request resulted in errors. + properties: + shift: + type: optional + docs: The requested `Shift`. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetTeamMemberWageResponse: + docs: >- + A response to a request to get a `TeamMemberWage`. The response contains + + the requested `TeamMemberWage` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + team_member_wage: + type: optional + docs: The requested `TeamMemberWage` object. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetTerminalActionResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + action: + type: optional + docs: The requested `TerminalAction` + source: + openapi: openapi/openapi.json + GetTerminalCheckoutResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + checkout: + type: optional + docs: The requested `TerminalCheckout`. + source: + openapi: openapi/openapi.json + GetTerminalRefundResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refund: + type: optional + docs: The requested `Refund`. + source: + openapi: openapi/openapi.json + GiftCard: + docs: Represents a Square gift card. + properties: + id: + type: optional + docs: The Square-assigned ID of the gift card. + access: read-only + type: + type: GiftCardType + docs: |- + The gift card type. + See [Type](#type-type) for possible values + gan_source: + type: optional + docs: >- + The source that generated the gift card account number (GAN). The + default value is `SQUARE`. + + See [GANSource](#type-gansource) for possible values + state: + type: optional + docs: |- + The current gift card state. + See [Status](#type-status) for possible values + balance_money: + type: optional + docs: >- + The current gift card balance. This balance is always greater than or + equal to zero. + gan: + type: optional> + docs: >- + The gift card account number (GAN). Buyers can use the GAN to make + purchases or check + + the gift card balance. + created_at: + type: optional + docs: >- + The timestamp when the gift card was created, in RFC 3339 format. + + In the case of a digital gift card, it is the time when you create a + card + + (using the Square Point of Sale application, Seller Dashboard, or Gift + Cards API). + + In the case of a plastic gift card, it is the time when Square + associates the card with the + + seller at the time of activation. + access: read-only + customer_ids: + type: optional> + docs: >- + The IDs of the [customer profiles](entity:Customer) to whom this gift + card is linked. + access: read-only + source: + openapi: openapi/openapi.json + GiftCardActivity: + docs: >- + Represents an action performed on a [gift card](entity:GiftCard) that + affects its state or balance. + + A gift card activity contains information about a specific activity type. + For example, a `REDEEM` activity + + includes a `redeem_activity_details` field that contains information about + the redemption. + properties: + id: + type: optional + docs: The Square-assigned ID of the gift card activity. + access: read-only + type: + type: GiftCardActivityType + docs: |- + The type of gift card activity. + See [Type](#type-type) for possible values + location_id: + type: string + docs: >- + The ID of the [business location](entity:Location) where the activity + occurred. + created_at: + type: optional + docs: >- + The timestamp when the gift card activity was created, in RFC 3339 + format. + access: read-only + gift_card_id: + type: optional> + docs: >- + The gift card ID. When creating a gift card activity, `gift_card_id` + is not required if + + `gift_card_gan` is specified. + gift_card_gan: + type: optional> + docs: >- + The gift card account number (GAN). When creating a gift card + activity, `gift_card_gan` + + is not required if `gift_card_id` is specified. + gift_card_balance_money: + type: optional + docs: The final balance on the gift card after the action is completed. + load_activity_details: + type: optional + docs: >- + Additional details about a `LOAD` activity, which is used to reload + money onto a gift card. + activate_activity_details: + type: optional + docs: >- + Additional details about an `ACTIVATE` activity, which is used to + activate a gift card with + + an initial balance. + redeem_activity_details: + type: optional + docs: >- + Additional details about a `REDEEM` activity, which is used to redeem + a gift card for a purchase. + + + For applications that process payments using the Square Payments API, + Square creates a `REDEEM` activity that + + updates the gift card balance after the corresponding + [CreatePayment](api-endpoint:Payments-CreatePayment) + + request is completed. Applications that use a custom payment + processing system must call + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + to create the `REDEEM` activity. + clear_balance_activity_details: + type: optional + docs: >- + Additional details about a `CLEAR_BALANCE` activity, which is used to + set the balance of a gift card to zero. + deactivate_activity_details: + type: optional + docs: >- + Additional details about a `DEACTIVATE` activity, which is used to + deactivate a gift card. + adjust_increment_activity_details: + type: optional + docs: >- + Additional details about an `ADJUST_INCREMENT` activity, which is used + to add money to a gift card + + outside of a typical `ACTIVATE`, `LOAD`, or `REFUND` activity flow. + adjust_decrement_activity_details: + type: optional + docs: >- + Additional details about an `ADJUST_DECREMENT` activity, which is used + to deduct money from a gift + + card outside of a typical `REDEEM` activity flow. + refund_activity_details: + type: optional + docs: >- + Additional details about a `REFUND` activity, which is used to add + money to a gift card when + + refunding a payment. + + + For applications that refund payments to a gift card using the Square + Refunds API, Square automatically + + creates a `REFUND` activity that updates the gift card balance after a + [RefundPayment](api-endpoint:Refunds-RefundPayment) + + request is completed. Applications that use a custom processing system + must call + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + to create the `REFUND` activity. + unlinked_activity_refund_activity_details: + type: optional + docs: >- + Additional details about an `UNLINKED_ACTIVITY_REFUND` activity. This + activity is used to add money + + to a gift card when refunding a payment that was processed using a + custom payment processing system + + and not linked to the gift card. + import_activity_details: + type: optional + docs: >- + Additional details about an `IMPORT` activity, which Square uses to + import a third-party + + gift card with a balance. + block_activity_details: + type: optional + docs: >- + Additional details about a `BLOCK` activity, which Square uses to + temporarily block a gift card. + unblock_activity_details: + type: optional + docs: >- + Additional details about an `UNBLOCK` activity, which Square uses to + unblock a gift card. + import_reversal_activity_details: + type: optional + docs: >- + Additional details about an `IMPORT_REVERSAL` activity, which Square + uses to reverse the + + import of a third-party gift card. + transfer_balance_to_activity_details: + type: optional + docs: >- + Additional details about a `TRANSFER_BALANCE_TO` activity, which + Square uses to add money to + + a gift card as the result of a transfer from another gift card. + transfer_balance_from_activity_details: + type: optional + docs: >- + Additional details about a `TRANSFER_BALANCE_FROM` activity, which + Square uses to deduct money from + + a gift as the result of a transfer to another gift card. + source: + openapi: openapi/openapi.json + GiftCardActivityActivate: + docs: >- + Represents details about an `ACTIVATE` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: optional + docs: >- + The amount added to the gift card. This value is a positive integer. + + + Applications that use a custom order processing system must specify + this amount in the + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + order_id: + type: optional> + docs: >- + The ID of the [order](entity:Order) that contains the `GIFT_CARD` line + item. + + + Applications that use the Square Orders API to process orders must + specify the order ID + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + line_item_uid: + type: optional> + docs: >- + The UID of the `GIFT_CARD` line item in the order that represents the + gift card purchase. + + + Applications that use the Square Orders API to process orders must + specify the line item UID + + in the + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + reference_id: + type: optional> + docs: >- + A client-specified ID that associates the gift card activity with an + entity in another system. + + + Applications that use a custom order processing system can use this + field to track information + + related to an order or payment. + buyer_payment_instrument_ids: + type: optional>> + docs: >- + The payment instrument IDs used to process the gift card purchase, + such as a credit card ID + + or bank account ID. + + + Applications that use a custom order processing system must specify + payment instrument IDs in + + the + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + + Square uses this information to perform compliance checks. + + + For applications that use the Square Orders API to process payments, + Square has the necessary + + instrument IDs to perform compliance checks. + + + Each buyer payment instrument ID can contain a maximum of 255 + characters. + source: + openapi: openapi/openapi.json + GiftCardActivityAdjustDecrement: + docs: >- + Represents details about an `ADJUST_DECREMENT` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: Money + docs: >- + The amount deducted from the gift card balance. This value is a + positive integer. + reason: + type: GiftCardActivityAdjustDecrementReason + docs: |- + The reason the gift card balance was adjusted. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityAdjustDecrementReason: + enum: + - SUSPICIOUS_ACTIVITY + - BALANCE_ACCIDENTALLY_INCREASED + - SUPPORT_ISSUE + - PURCHASE_WAS_REFUNDED + docs: >- + Indicates the reason for deducting money from a [gift + card](entity:GiftCard). + source: + openapi: openapi/openapi.json + GiftCardActivityAdjustIncrement: + docs: >- + Represents details about an `ADJUST_INCREMENT` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: Money + docs: >- + The amount added to the gift card balance. This value is a positive + integer. + reason: + type: GiftCardActivityAdjustIncrementReason + docs: |- + The reason the gift card balance was adjusted. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityAdjustIncrementReason: + enum: + - COMPLIMENTARY + - SUPPORT_ISSUE + - TRANSACTION_VOIDED + docs: Indicates the reason for adding money to a [gift card](entity:GiftCard). + source: + openapi: openapi/openapi.json + GiftCardActivityBlock: + docs: >- + Represents details about a `BLOCK` [gift card activity + type](entity:GiftCardActivityType). + properties: + reason: + type: GiftCardActivityBlockReason + docs: |- + The reason the gift card was blocked. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityBlockReason: + type: literal<"CHARGEBACK_BLOCK"> + docs: Indicates the reason for blocking a [gift card](entity:GiftCard). + GiftCardActivityClearBalance: + docs: >- + Represents details about a `CLEAR_BALANCE` [gift card activity + type](entity:GiftCardActivityType). + properties: + reason: + type: GiftCardActivityClearBalanceReason + docs: |- + The reason the gift card balance was cleared. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityClearBalanceReason: + enum: + - SUSPICIOUS_ACTIVITY + - REUSE_GIFTCARD + - UNKNOWN_REASON + docs: >- + Indicates the reason for clearing the balance of a [gift + card](entity:GiftCard). + source: + openapi: openapi/openapi.json + GiftCardActivityCreatedEvent: + docs: Published when a [gift card activity](entity:GiftCardActivity) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `gift_card.activity.created`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardActivityCreatedEventData: + docs: Represents the data associated with a `gift_card.activity.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card_activity`. + id: + type: optional + docs: The ID of the new gift card activity. + object: + type: optional + docs: An object that contains the new gift card activity. + source: + openapi: openapi/openapi.json + GiftCardActivityCreatedEventObject: + docs: |- + An object that contains the gift card activity associated with a + `gift_card.activity.created` event. + properties: + gift_card_activity: + type: optional + docs: The new gift card activity. + source: + openapi: openapi/openapi.json + GiftCardActivityDeactivate: + docs: >- + Represents details about a `DEACTIVATE` [gift card activity + type](entity:GiftCardActivityType). + properties: + reason: + type: GiftCardActivityDeactivateReason + docs: |- + The reason the gift card was deactivated. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityDeactivateReason: + enum: + - SUSPICIOUS_ACTIVITY + - UNKNOWN_REASON + - CHARGEBACK_DEACTIVATE + docs: Indicates the reason for deactivating a [gift card](entity:GiftCard). + source: + openapi: openapi/openapi.json + GiftCardActivityImport: + docs: >- + Represents details about an `IMPORT` [gift card activity + type](entity:GiftCardActivityType). + + This activity type is used when Square imports a third-party gift card, in + which case the + + `gan_source` of the gift card is set to `OTHER`. + properties: + amount_money: + type: Money + docs: The balance amount on the imported gift card. + source: + openapi: openapi/openapi.json + GiftCardActivityImportReversal: + docs: >- + Represents details about an `IMPORT_REVERSAL` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: Money + docs: |- + The amount of money cleared from the third-party gift card when + the import was reversed. + source: + openapi: openapi/openapi.json + GiftCardActivityLoad: + docs: >- + Represents details about a `LOAD` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: optional + docs: >- + The amount added to the gift card. This value is a positive integer. + + + Applications that use a custom order processing system must specify + this amount in the + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + order_id: + type: optional> + docs: >- + The ID of the [order](entity:Order) that contains the `GIFT_CARD` line + item. + + + Applications that use the Square Orders API to process orders must + specify the order ID in the + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + line_item_uid: + type: optional> + docs: >- + The UID of the `GIFT_CARD` line item in the order that represents the + additional funds for the gift card. + + + Applications that use the Square Orders API to process orders must + specify the line item UID + + in the + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + reference_id: + type: optional> + docs: >- + A client-specified ID that associates the gift card activity with an + entity in another system. + + + Applications that use a custom order processing system can use this + field to track information related to + + an order or payment. + buyer_payment_instrument_ids: + type: optional>> + docs: >- + The payment instrument IDs used to process the order for the + additional funds, such as a credit card ID + + or bank account ID. + + + Applications that use a custom order processing system must specify + payment instrument IDs in + + the + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + + Square uses this information to perform compliance checks. + + + For applications that use the Square Orders API to process payments, + Square has the necessary + + instrument IDs to perform compliance checks. + + + Each buyer payment instrument ID can contain a maximum of 255 + characters. + source: + openapi: openapi/openapi.json + GiftCardActivityRedeem: + docs: >- + Represents details about a `REDEEM` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: Money + docs: >- + The amount deducted from the gift card for the redemption. This value + is a positive integer. + + + Applications that use a custom payment processing system must specify + this amount in the + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + payment_id: + type: optional + docs: >- + The ID of the payment that represents the gift card redemption. Square + populates this field + + if the payment was processed by Square. + access: read-only + reference_id: + type: optional> + docs: >- + A client-specified ID that associates the gift card activity with an + entity in another system. + + + Applications that use a custom payment processing system can use this + field to track information + + related to an order or payment. + status: + type: optional + docs: >- + The status of the gift card redemption. Gift cards redeemed from + Square Point of Sale or the + + Square Seller Dashboard use a two-state process: `PENDING` + + to `COMPLETED` or `PENDING` to `CANCELED`. Gift cards redeemed using + the Gift Card Activities API + + always have a `COMPLETED` status. + + See [Status](#type-status) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityRedeemStatus: + enum: + - PENDING + - COMPLETED + - CANCELED + docs: >- + Indicates the status of a [gift card](entity:GiftCard) redemption. This + status is relevant only for + + redemptions made from Square products (such as Square Point of Sale) + because Square products use a + + two-state process. Gift cards redeemed using the Gift Card Activities API + always have a `COMPLETED` status. + source: + openapi: openapi/openapi.json + GiftCardActivityRefund: + docs: >- + Represents details about a `REFUND` [gift card activity + type](entity:GiftCardActivityType). + properties: + redeem_activity_id: + type: optional> + docs: >- + The ID of the refunded `REDEEM` gift card activity. Square populates + this field if the + + `payment_id` in the corresponding + [RefundPayment](api-endpoint:Refunds-RefundPayment) request + + represents a gift card redemption. + + + For applications that use a custom payment processing system, this + field is required when creating + + a `REFUND` activity. The provided `REDEEM` activity ID must be linked + to the same gift card. + amount_money: + type: optional + docs: >- + The amount added to the gift card for the refund. This value is a + positive integer. + + + This field is required when creating a `REFUND` activity. The amount + can represent a full or partial refund. + reference_id: + type: optional> + docs: >- + A client-specified ID that associates the gift card activity with an + entity in another system. + payment_id: + type: optional + docs: >- + The ID of the refunded payment. Square populates this field if the + refund is for a + + payment processed by Square. This field matches the `payment_id` in + the corresponding + + [RefundPayment](api-endpoint:Refunds-RefundPayment) request. + access: read-only + source: + openapi: openapi/openapi.json + GiftCardActivityTransferBalanceFrom: + docs: >- + Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity + type](entity:GiftCardActivityType). + properties: + transfer_to_gift_card_id: + type: string + docs: The ID of the gift card to which the specified amount was transferred. + amount_money: + type: Money + docs: >- + The amount deducted from the gift card for the transfer. This value is + a positive integer. + source: + openapi: openapi/openapi.json + GiftCardActivityTransferBalanceTo: + docs: >- + Represents details about a `TRANSFER_BALANCE_TO` [gift card activity + type](entity:GiftCardActivityType). + properties: + transfer_from_gift_card_id: + type: string + docs: >- + The ID of the gift card from which the specified amount was + transferred. + amount_money: + type: Money + docs: >- + The amount added to the gift card balance for the transfer. This value + is a positive integer. + source: + openapi: openapi/openapi.json + GiftCardActivityType: + enum: + - ACTIVATE + - LOAD + - REDEEM + - CLEAR_BALANCE + - DEACTIVATE + - ADJUST_INCREMENT + - ADJUST_DECREMENT + - REFUND + - UNLINKED_ACTIVITY_REFUND + - IMPORT + - BLOCK + - UNBLOCK + - IMPORT_REVERSAL + - TRANSFER_BALANCE_FROM + - TRANSFER_BALANCE_TO + docs: Indicates the type of [gift card activity](entity:GiftCardActivity). + source: + openapi: openapi/openapi.json + GiftCardActivityUnblock: + docs: >- + Represents details about an `UNBLOCK` [gift card activity + type](entity:GiftCardActivityType). + properties: + reason: + type: GiftCardActivityUnblockReason + docs: |- + The reason the gift card was unblocked. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityUnblockReason: + type: literal<"CHARGEBACK_UNBLOCK"> + docs: Indicates the reason for unblocking a [gift card](entity:GiftCard). + GiftCardActivityUnlinkedActivityRefund: + docs: >- + Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: Money + docs: >- + The amount added to the gift card for the refund. This value is a + positive integer. + reference_id: + type: optional> + docs: >- + A client-specified ID that associates the gift card activity with an + entity in another system. + payment_id: + type: optional + docs: >- + The ID of the refunded payment. This field is not used starting in + Square version 2022-06-16. + access: read-only + source: + openapi: openapi/openapi.json + GiftCardActivityUpdatedEvent: + docs: >- + Published when a [gift card activity](entity:GiftCardActivity) is + updated. + + Subscribe to this event to be notified about the following changes: + + - An update to the `REDEEM` activity for a gift card redemption made from + a Square product (such as Square Point of Sale). + + These redemptions are initially assigned a `PENDING` state, but then + change to a `COMPLETED` or `CANCELED` state. + + - An update to the `IMPORT` activity for an imported gift card when the + balance is later adjusted by Square. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `gift_card.activity.updated`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardActivityUpdatedEventData: + docs: The data associated with a `gift_card.activity.updated` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card_activity`. + id: + type: optional + docs: The ID of the updated gift card activity. + object: + type: optional + docs: An object that contains the updated gift card activity. + source: + openapi: openapi/openapi.json + GiftCardActivityUpdatedEventObject: + docs: |- + An object that contains the gift card activity associated with a + `gift_card.activity.updated` event. + properties: + gift_card_activity: + type: optional + docs: The updated gift card activity. + source: + openapi: openapi/openapi.json + GiftCardCreatedEvent: + docs: Published when a [gift card](entity:GiftCard) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: The type of event. For this event, the value is `gift_card.created`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardCreatedEventData: + docs: The data associated with a `gift_card.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card`. + id: + type: optional + docs: The ID of the new gift card. + object: + type: optional + docs: An object that contains the new gift card. + source: + openapi: openapi/openapi.json + GiftCardCreatedEventObject: + docs: >- + An object that contains the gift card associated with a + `gift_card.created` event. + properties: + gift_card: + type: optional + docs: The new gift card. + source: + openapi: openapi/openapi.json + GiftCardCustomerLinkedEvent: + docs: >- + Published when a [customer](entity:Customer) is linked to a [gift + card](entity:GiftCard). + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `gift_card.customer_linked`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardCustomerLinkedEventData: + docs: The data associated with a `gift_card.customer_linked` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card`. + id: + type: optional + docs: The ID of the updated gift card. + object: + type: optional + docs: >- + An object that contains the updated gift card and the ID of the linked + customer. + source: + openapi: openapi/openapi.json + GiftCardCustomerLinkedEventObject: + docs: |- + An object that contains the gift card and customer ID associated with a + `gift_card.customer_linked` event. + properties: + gift_card: + type: optional + docs: The gift card with the updated `customer_ids` field. + linked_customer_id: + type: optional> + docs: The ID of the linked [customer](entity:Customer). + source: + openapi: openapi/openapi.json + GiftCardCustomerUnlinkedEvent: + docs: >- + Published when a [customer](entity:Customer) is unlinked from a [gift + card](entity:GiftCard). + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `gift_card.customer_unlinked`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardCustomerUnlinkedEventData: + docs: The data associated with a `gift_card.customer_unlinked` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card`. + id: + type: optional + docs: The ID of the updated gift card. + object: + type: optional + docs: >- + An object that contains the updated gift card and the ID of the + unlinked customer. + source: + openapi: openapi/openapi.json + GiftCardCustomerUnlinkedEventObject: + docs: >- + An object that contains the gift card and the customer ID associated with + a + + `gift_card.customer_linked` event. + properties: + gift_card: + type: optional + docs: |- + The gift card with the updated `customer_ids` field. + The field is removed if the gift card is not linked to any customers. + unlinked_customer_id: + type: optional> + docs: The ID of the unlinked [customer](entity:Customer). + source: + openapi: openapi/openapi.json + GiftCardGanSource: + enum: + - SQUARE + - OTHER + docs: |- + Indicates the source that generated the gift card + account number (GAN). + source: + openapi: openapi/openapi.json + GiftCardStatus: + enum: + - ACTIVE + - DEACTIVATED + - BLOCKED + - PENDING + docs: Indicates the gift card state. + source: + openapi: openapi/openapi.json + GiftCardType: + enum: + - PHYSICAL + - DIGITAL + docs: Indicates the gift card type. + source: + openapi: openapi/openapi.json + GiftCardUpdatedEvent: + docs: |- + Published when a [gift card](entity:GiftCard) is updated. This includes + changes to the state, balance, and customer association. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. For this event, the value is + `gift_card.updated`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardUpdatedEventData: + docs: The data associated with a `gift_card.updated` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card`. + id: + type: optional + docs: The ID of the updated gift card. + object: + type: optional + docs: An object that contains the updated gift card. + source: + openapi: openapi/openapi.json + GiftCardUpdatedEventObject: + docs: >- + An object that contains the gift card associated with a + `gift_card.updated` event. + properties: + gift_card: + type: optional + docs: >- + The gift card with the updated `balance_money`, `state`, or + `customer_ids` field. + + Some events can affect both `balance_money` and `state`. + source: + openapi: openapi/openapi.json + InventoryAdjustment: + docs: |- + Represents a change in state or quantity of product inventory at a + particular time and location. + properties: + id: + type: optional + docs: |- + A unique ID generated by Square for the + `InventoryAdjustment`. + validation: + maxLength: 100 + reference_id: + type: optional> + docs: |- + An optional ID provided by the application to tie the + `InventoryAdjustment` to an external + system. + validation: + maxLength: 255 + from_state: + type: optional + docs: |- + The [inventory state](entity:InventoryState) of the related quantity + of items before the adjustment. + See [InventoryState](#type-inventorystate) for possible values + to_state: + type: optional + docs: |- + The [inventory state](entity:InventoryState) of the related quantity + of items after the adjustment. + See [InventoryState](#type-inventorystate) for possible values + location_id: + type: optional> + docs: >- + The Square-generated ID of the [Location](entity:Location) where the + related + + quantity of items is being tracked. + validation: + maxLength: 100 + catalog_object_id: + type: optional> + docs: |- + The Square-generated ID of the + [CatalogObject](entity:CatalogObject) being tracked. + validation: + maxLength: 100 + catalog_object_type: + type: optional> + docs: >- + The [type](entity:CatalogObjectType) of the + [CatalogObject](entity:CatalogObject) being tracked. + + + The Inventory API supports setting and reading the + `"catalog_object_type": "ITEM_VARIATION"` field value. + + In addition, it can also read the `"catalog_object_type": "ITEM"` + field value that is set by the Square Restaurants app. + validation: + maxLength: 14 + quantity: + type: optional> + docs: |- + The number of items affected by the adjustment as a decimal string. + Can support up to 5 digits after the decimal point. + validation: + maxLength: 26 + total_price_money: + type: optional + docs: |- + The total price paid for goods associated with the + adjustment. Present if and only if `to_state` is `SOLD`. Always + non-negative. + occurred_at: + type: optional> + docs: >- + A client-generated RFC 3339-formatted timestamp that indicates when + + the inventory adjustment took place. For inventory adjustment updates, + the `occurred_at` + + timestamp cannot be older than 24 hours or in the future relative to + the + + time of the request. + validation: + maxLength: 34 + created_at: + type: optional + docs: >- + An RFC 3339-formatted timestamp that indicates when the inventory + adjustment is received. + validation: + maxLength: 34 + access: read-only + source: + type: optional + docs: |- + Information about the application that caused the + inventory adjustment. + employee_id: + type: optional> + docs: >- + The Square-generated ID of the [Employee](entity:Employee) responsible + for the + + inventory adjustment. + validation: + maxLength: 100 + team_member_id: + type: optional> + docs: >- + The Square-generated ID of the [Team Member](entity:TeamMember) + responsible for the + + inventory adjustment. + validation: + maxLength: 100 + transaction_id: + type: optional + docs: |- + The Square-generated ID of the [Transaction](entity:Transaction) that + caused the adjustment. Only relevant for payment-related state + transitions. + validation: + maxLength: 255 + access: read-only + refund_id: + type: optional + docs: |- + The Square-generated ID of the [Refund](entity:Refund) that + caused the adjustment. Only relevant for refund-related state + transitions. + validation: + maxLength: 255 + access: read-only + purchase_order_id: + type: optional + docs: >- + The Square-generated ID of the purchase order that caused the + + adjustment. Only relevant for state transitions from the Square for + Retail + + app. + validation: + maxLength: 100 + access: read-only + goods_receipt_id: + type: optional + docs: >- + The Square-generated ID of the goods receipt that caused the + + adjustment. Only relevant for state transitions from the Square for + Retail + + app. + validation: + maxLength: 100 + access: read-only + adjustment_group: + type: optional + docs: >- + An adjustment group bundling the related adjustments of item + variations through stock conversions in a single inventory event. + source: + openapi: openapi/openapi.json + InventoryAdjustmentGroup: + properties: + id: + type: optional + docs: |- + A unique ID generated by Square for the + `InventoryAdjustmentGroup`. + validation: + maxLength: 100 + access: read-only + root_adjustment_id: + type: optional + docs: The inventory adjustment of the composed variation. + validation: + maxLength: 100 + access: read-only + from_state: + type: optional + docs: >- + Representative `from_state` for adjustments within the group. For + example, for a group adjustment from `IN_STOCK` to `SOLD`, + + there can be two component adjustments in the group: one from + `IN_STOCK`to `COMPOSED` and the other one from `COMPOSED` to `SOLD`. + + Here, the representative `from_state` for the + `InventoryAdjustmentGroup` is `IN_STOCK`. + + See [InventoryState](#type-inventorystate) for possible values + to_state: + type: optional + docs: >- + Representative `to_state` for adjustments within group. For example, + for a group adjustment from `IN_STOCK` to `SOLD`, + + the two component adjustments in the group can be from `IN_STOCK` to + `COMPOSED` and from `COMPOSED` to `SOLD`. + + Here, the representative `to_state` of the `InventoryAdjustmentGroup` + is `SOLD`. + + See [InventoryState](#type-inventorystate) for possible values + source: + openapi: openapi/openapi.json + InventoryAlertType: + enum: + - NONE + - LOW_QUANTITY + docs: >- + Indicates whether Square should alert the merchant when the inventory + quantity of a CatalogItemVariation is low. + source: + openapi: openapi/openapi.json + InventoryChange: + docs: |- + Represents a single physical count, inventory, adjustment, or transfer + that is part of the history of inventory changes for a particular + [CatalogObject](entity:CatalogObject) instance. + properties: + type: + type: optional + docs: >- + Indicates how the inventory change is applied. See + + [InventoryChangeType](entity:InventoryChangeType) for all possible + values. + + See [InventoryChangeType](#type-inventorychangetype) for possible + values + physical_count: + type: optional + docs: |- + Contains details about the physical count when `type` is + `PHYSICAL_COUNT`, and is unset for all other change types. + adjustment: + type: optional + docs: |- + Contains details about the inventory adjustment when `type` is + `ADJUSTMENT`, and is unset for all other change types. + transfer: + type: optional + docs: >- + Contains details about the inventory transfer when `type` is + + `TRANSFER`, and is unset for all other change types. + + + _Note:_ An [InventoryTransfer](entity:InventoryTransfer) object can + only be set in the input to the + + [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) + endpoint when the seller has an active Retail Plus subscription. + measurement_unit: + type: optional + docs: >- + The [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object + representing the catalog measurement unit associated with the + inventory change. + measurement_unit_id: + type: optional + docs: >- + The ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) + object representing the catalog measurement unit associated with the + inventory change. + access: read-only + source: + openapi: openapi/openapi.json + InventoryChangeType: + enum: + - PHYSICAL_COUNT + - ADJUSTMENT + - TRANSFER + docs: >- + Indicates how the inventory change was applied to a tracked product + quantity. + source: + openapi: openapi/openapi.json + InventoryCount: + docs: >- + Represents Square-estimated quantity of items in a particular state at a + + particular seller location based on the known history of physical counts + and + + inventory adjustments. + properties: + catalog_object_id: + type: optional> + docs: |- + The Square-generated ID of the + [CatalogObject](entity:CatalogObject) being tracked. + validation: + maxLength: 100 + catalog_object_type: + type: optional> + docs: >- + The [type](entity:CatalogObjectType) of the + [CatalogObject](entity:CatalogObject) being tracked. + + + The Inventory API supports setting and reading the + `"catalog_object_type": "ITEM_VARIATION"` field value. + + In addition, it can also read the `"catalog_object_type": "ITEM"` + field value that is set by the Square Restaurants app. + validation: + maxLength: 14 + state: + type: optional + docs: |- + The current [inventory state](entity:InventoryState) for the related + quantity of items. + See [InventoryState](#type-inventorystate) for possible values + location_id: + type: optional> + docs: >- + The Square-generated ID of the [Location](entity:Location) where the + related + + quantity of items is being tracked. + validation: + maxLength: 100 + quantity: + type: optional> + docs: >- + The number of items affected by the estimated count as a decimal + string. + + Can support up to 5 digits after the decimal point. + validation: + maxLength: 26 + calculated_at: + type: optional + docs: >- + An RFC 3339-formatted timestamp that indicates when the most recent + physical count or adjustment affecting + + the estimated count is received. + validation: + maxLength: 34 + access: read-only + is_estimated: + type: optional + docs: >- + Whether the inventory count is for composed variation (TRUE) or not + (FALSE). If true, the inventory count will not be present in the + response of + + any of these endpoints: + [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory), + + [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges), + + [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts), + and + + [RetrieveInventoryChanges](api-endpoint:Inventory-RetrieveInventoryChanges). + access: read-only + source: + openapi: openapi/openapi.json + InventoryCountUpdatedEvent: + docs: |- + Published when the quantity is updated for a + [CatalogItemVariation](entity:CatalogItemVariation). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InventoryCountUpdatedEventData: + properties: + type: + type: optional> + docs: >- + Name of the affected object’s type. For this event, the value is + `inventory_counts`. + id: + type: optional + docs: ID of the affected object. + object: + type: optional + docs: >- + An object containing fields and values relevant to the event. Is + absent if affected object was deleted. + source: + openapi: openapi/openapi.json + InventoryCountUpdatedEventObject: + properties: + inventory_counts: + type: optional>> + docs: The inventory counts. + source: + openapi: openapi/openapi.json + InventoryPhysicalCount: + docs: >- + Represents the quantity of an item variation that is physically present + + at a specific location, verified by a seller or a seller's employee. For + example, + + a physical count might come from an employee counting the item variations + on + + hand or from syncing with an external system. + properties: + id: + type: optional + docs: |- + A unique Square-generated ID for the + [InventoryPhysicalCount](entity:InventoryPhysicalCount). + validation: + maxLength: 100 + reference_id: + type: optional> + docs: |- + An optional ID provided by the application to tie the + [InventoryPhysicalCount](entity:InventoryPhysicalCount) to an external + system. + validation: + maxLength: 255 + catalog_object_id: + type: optional> + docs: |- + The Square-generated ID of the + [CatalogObject](entity:CatalogObject) being tracked. + validation: + maxLength: 100 + catalog_object_type: + type: optional> + docs: >- + The [type](entity:CatalogObjectType) of the + [CatalogObject](entity:CatalogObject) being tracked. + + + The Inventory API supports setting and reading the + `"catalog_object_type": "ITEM_VARIATION"` field value. + + In addition, it can also read the `"catalog_object_type": "ITEM"` + field value that is set by the Square Restaurants app. + validation: + maxLength: 14 + state: + type: optional + docs: |- + The current [inventory state](entity:InventoryState) for the related + quantity of items. + See [InventoryState](#type-inventorystate) for possible values + location_id: + type: optional> + docs: >- + The Square-generated ID of the [Location](entity:Location) where the + related + + quantity of items is being tracked. + validation: + maxLength: 100 + quantity: + type: optional> + docs: >- + The number of items affected by the physical count as a decimal + string. + + The number can support up to 5 digits after the decimal point. + validation: + maxLength: 26 + source: + type: optional + docs: |- + Information about the application with which the + physical count is submitted. + employee_id: + type: optional> + docs: >- + The Square-generated ID of the [Employee](entity:Employee) responsible + for the + + physical count. + validation: + maxLength: 100 + team_member_id: + type: optional> + docs: >- + The Square-generated ID of the [Team Member](entity:TeamMember) + responsible for the + + physical count. + validation: + maxLength: 100 + occurred_at: + type: optional> + docs: >- + A client-generated RFC 3339-formatted timestamp that indicates when + + the physical count was examined. For physical count updates, the + `occurred_at` + + timestamp cannot be older than 24 hours or in the future relative to + the + + time of the request. + validation: + maxLength: 34 + created_at: + type: optional + docs: >- + An RFC 3339-formatted timestamp that indicates when the physical count + is received. + validation: + maxLength: 34 + access: read-only + source: + openapi: openapi/openapi.json + InventoryState: + enum: + - CUSTOM + - IN_STOCK + - SOLD + - RETURNED_BY_CUSTOMER + - RESERVED_FOR_SALE + - SOLD_ONLINE + - ORDERED_FROM_VENDOR + - RECEIVED_FROM_VENDOR + - IN_TRANSIT_TO + - NONE + - WASTE + - UNLINKED_RETURN + - COMPOSED + - DECOMPOSED + - SUPPORTED_BY_NEWER_VERSION + - IN_TRANSIT + docs: Indicates the state of a tracked item quantity in the lifecycle of goods. + source: + openapi: openapi/openapi.json + InventoryTransfer: + docs: |- + Represents the transfer of a quantity of product inventory at a + particular time from one location to another. + properties: + id: + type: optional + docs: |- + A unique ID generated by Square for the + `InventoryTransfer`. + validation: + maxLength: 100 + reference_id: + type: optional> + docs: |- + An optional ID provided by the application to tie the + `InventoryTransfer` to an external system. + validation: + maxLength: 255 + state: + type: optional + docs: |- + The [inventory state](entity:InventoryState) for the quantity of + items being transferred. + See [InventoryState](#type-inventorystate) for possible values + from_location_id: + type: optional> + docs: >- + The Square-generated ID of the [Location](entity:Location) where the + related + + quantity of items was tracked before the transfer. + validation: + maxLength: 100 + to_location_id: + type: optional> + docs: >- + The Square-generated ID of the [Location](entity:Location) where the + related + + quantity of items was tracked after the transfer. + validation: + maxLength: 100 + catalog_object_id: + type: optional> + docs: |- + The Square-generated ID of the + [CatalogObject](entity:CatalogObject) being tracked. + validation: + maxLength: 100 + catalog_object_type: + type: optional> + docs: >- + The [type](entity:CatalogObjectType) of the + [CatalogObject](entity:CatalogObject) being tracked. + + + The Inventory API supports setting and reading the + `"catalog_object_type": "ITEM_VARIATION"` field value. + + In addition, it can also read the `"catalog_object_type": "ITEM"` + field value that is set by the Square Restaurants app. + validation: + maxLength: 14 + quantity: + type: optional> + docs: |- + The number of items affected by the transfer as a decimal string. + Can support up to 5 digits after the decimal point. + validation: + maxLength: 26 + occurred_at: + type: optional> + docs: >- + A client-generated RFC 3339-formatted timestamp that indicates when + + the transfer took place. For write actions, the `occurred_at` + timestamp + + cannot be older than 24 hours or in the future relative to the time of + the + + request. + validation: + maxLength: 34 + created_at: + type: optional + docs: |- + An RFC 3339-formatted timestamp that indicates when Square + received the transfer request. + validation: + maxLength: 34 + access: read-only + source: + type: optional + docs: |- + Information about the application that initiated the + inventory transfer. + employee_id: + type: optional> + docs: >- + The Square-generated ID of the [Employee](entity:Employee) responsible + for the + + inventory transfer. + validation: + maxLength: 100 + team_member_id: + type: optional> + docs: >- + The Square-generated ID of the [Team Member](entity:TeamMember) + responsible for the + + inventory transfer. + validation: + maxLength: 100 + source: + openapi: openapi/openapi.json + Invoice: + docs: >- + Stores information about an invoice. You use the Invoices API to create + and manage + + invoices. For more information, see [Invoices API + Overview](https://developer.squareup.com/docs/invoices-api/overview). + properties: + id: + type: optional + docs: The Square-assigned ID of the invoice. + access: read-only + version: + type: optional + docs: >- + The Square-assigned version number, which is incremented each time an + update is committed to the invoice. + location_id: + type: optional> + docs: >- + The ID of the location that this invoice is associated with. + + + If specified in a `CreateInvoice` request, the value must match the + `location_id` of the associated order. + validation: + minLength: 1 + maxLength: 255 + order_id: + type: optional> + docs: >- + The ID of the [order](entity:Order) for which the invoice is created. + + This field is required when creating an invoice, and the order must be + in the `OPEN` state. + + + To view the line items and other information for the associated order, + call the + + [RetrieveOrder](api-endpoint:Orders-RetrieveOrder) endpoint using the + order ID. + validation: + minLength: 1 + maxLength: 255 + primary_recipient: + type: optional + docs: >- + The customer who receives the invoice. This customer data is displayed + on the invoice and used by Square to deliver the invoice. + + + This field is required to publish an invoice, and it must specify the + `customer_id`. + payment_requests: + type: optional>> + docs: >- + The payment schedule for the invoice, represented by one or more + payment requests that + + define payment settings, such as amount due and due date. An invoice + supports the following payment request combinations: + + - One balance + + - One deposit with one balance + + - 2–12 installments + + - One deposit with 2–12 installments + + + This field is required when creating an invoice. It must contain at + least one payment request. + + All payment requests for the invoice must equal the total order + amount. For more information, see + + [Configuring payment + requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). + + + Adding `INSTALLMENT` payment requests to an invoice requires an + + [Invoices Plus + subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). + delivery_method: + type: optional + docs: >- + The delivery method that Square uses to send the invoice, reminders, + and receipts to + + the customer. After the invoice is published, Square processes the + invoice based on the delivery + + method and payment request settings, either immediately or on the + `scheduled_at` date, if specified. + + For example, Square might send the invoice or receipt for an automatic + payment. For invoices with + + automatic payments, this field must be set to `EMAIL`. + + + One of the following is required when creating an invoice: + + - (Recommended) This `delivery_method` field. To configure an + automatic payment, the + + `automatic_payment_source` field of the payment request is also + required. + + - The deprecated `request_method` field of the payment request. Note + that `invoice` + + objects returned in responses do not include `request_method`. + + See [InvoiceDeliveryMethod](#type-invoicedeliverymethod) for possible + values + invoice_number: + type: optional> + docs: >- + A user-friendly invoice number that is displayed on the invoice. The + value is unique within a location. + + If not provided when creating an invoice, Square assigns a value. + + It increments from 1 and is padded with zeros making it 7 characters + long + + (for example, 0000001 and 0000002). + validation: + minLength: 1 + maxLength: 191 + title: + type: optional> + docs: The title of the invoice, which is displayed on the invoice. + validation: + minLength: 1 + maxLength: 255 + description: + type: optional> + docs: The description of the invoice, which is displayed on the invoice. + validation: + minLength: 1 + maxLength: 65536 + scheduled_at: + type: optional> + docs: >- + The timestamp when the invoice is scheduled for processing, in RFC + 3339 format. + + After the invoice is published, Square processes the invoice on the + specified date, + + according to the delivery method and payment request settings. + + + If the field is not set, Square processes the invoice immediately + after it is published. + public_url: + type: optional + docs: >- + A temporary link to the Square-hosted payment page where the customer + can pay the + + invoice. If the link expires, customers can provide the email address + or phone number + + associated with the invoice and request a new link directly from the + expired payment page. + + + This field is added after the invoice is published and reaches the + scheduled date + + (if one is defined). + access: read-only + next_payment_amount_money: + type: optional + docs: >- + The current amount due for the invoice. In addition to the + + amount due on the next payment request, this includes any overdue + payment amounts. + status: + type: optional + docs: |- + The status of the invoice. + See [InvoiceStatus](#type-invoicestatus) for possible values + timezone: + type: optional + docs: >- + The time zone used to interpret calendar dates on the invoice, such as + `due_date`. + + When an invoice is created, this field is set to the `timezone` + specified for the seller + + location. The value cannot be changed. + + + For example, a payment `due_date` of 2021-03-09 with a `timezone` of + America/Los\_Angeles + + becomes overdue at midnight on March 9 in America/Los\_Angeles (which + equals a UTC timestamp + + of 2021-03-10T08:00:00Z). + access: read-only + created_at: + type: optional + docs: The timestamp when the invoice was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the invoice was last updated, in RFC 3339 format. + access: read-only + accepted_payment_methods: + type: optional + docs: >- + The payment methods that customers can use to pay the invoice on the + Square-hosted + + invoice page. This setting is independent of any automatic payment + requests for the invoice. + + + This field is required when creating an invoice and must set at least + one payment method to `true`. + custom_fields: + type: optional>> + docs: >- + Additional seller-defined fields that are displayed on the invoice. + For more information, see + + [Custom + fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields). + + + Adding custom fields to an invoice requires an + + [Invoices Plus + subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). + + + Max: 2 custom fields + subscription_id: + type: optional + docs: >- + The ID of the [subscription](entity:Subscription) associated with the + invoice. + + This field is present only on subscription billing invoices. + access: read-only + sale_or_service_date: + type: optional> + docs: >- + The date of the sale or the date that the service is rendered, in + `YYYY-MM-DD` format. + + This field can be used to specify a past or future date which is + displayed on the invoice. + payment_conditions: + type: optional> + docs: >- + **France only.** The payment terms and conditions that are displayed + on the invoice. For more information, + + see [Payment + conditions](https://developer.squareup.com/docs/invoices-api/overview#payment-conditions). + + + For countries other than France, Square returns an + `INVALID_REQUEST_ERROR` with a `BAD_REQUEST` code and + + "Payment conditions are not supported for this location's country" + detail if this field is included in `CreateInvoice` or `UpdateInvoice` + requests. + validation: + minLength: 1 + maxLength: 2000 + store_payment_method_enabled: + type: optional> + docs: >- + Indicates whether to allow a customer to save a credit or debit card + as a card on file or a bank transfer as a + + bank account on file. If `true`, Square displays a __Save my card on + file__ or __Save my bank on file__ checkbox on the + + invoice payment page. Stored payment information can be used for + future automatic payments. The default value is `false`. + attachments: + type: optional> + docs: >- + Metadata about the attachments on the invoice. Invoice attachments are + managed using the + + [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) + and + [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) + endpoints. + access: read-only + creator_team_member_id: + type: optional + docs: >- + The ID of the [team member](entity:TeamMember) who created the + invoice. + + This field is present only on invoices created in the Square Dashboard + or Square Invoices app by a logged-in team member. + access: read-only + source: + openapi: openapi/openapi.json + InvoiceAcceptedPaymentMethods: + docs: >- + The payment methods that customers can use to pay an + [invoice](entity:Invoice) on the Square-hosted invoice payment page. + properties: + card: + type: optional> + docs: >- + Indicates whether credit card or debit card payments are accepted. The + default value is `false`. + square_gift_card: + type: optional> + docs: >- + Indicates whether Square gift card payments are accepted. The default + value is `false`. + bank_account: + type: optional> + docs: >- + Indicates whether ACH bank transfer payments are accepted. The default + value is `false`. + buy_now_pay_later: + type: optional> + docs: >- + Indicates whether Afterpay (also known as Clearpay) payments are + accepted. The default value is `false`. + + + This option is allowed only for invoices that have a single payment + request of the `BALANCE` type. This payment method is + + supported if the seller account accepts Afterpay payments and the + seller location is in a country where Afterpay + + invoice payments are supported. As a best practice, consider enabling + an additional payment method when allowing + + `buy_now_pay_later` payments. For more information, including detailed + requirements and processing limits, see + + [Buy Now Pay Later payments with + Afterpay](https://developer.squareup.com/docs/invoices-api/overview#buy-now-pay-later). + cash_app_pay: + type: optional> + docs: >- + Indicates whether Cash App payments are accepted. The default value is + `false`. + + + This payment method is supported only for seller + [locations](entity:Location) in the United States. + source: + openapi: openapi/openapi.json + InvoiceAttachment: + docs: Represents a file attached to an [invoice](entity:Invoice). + properties: + id: + type: optional + docs: The Square-assigned ID of the attachment. + access: read-only + filename: + type: optional + docs: The file name of the attachment, which is displayed on the invoice. + access: read-only + description: + type: optional + docs: |- + The description of the attachment, which is displayed on the invoice. + This field maps to the seller-defined **Message** field. + access: read-only + filesize: + type: optional + docs: The file size of the attachment in bytes. + access: read-only + hash: + type: optional + docs: The MD5 hash that was generated from the file contents. + access: read-only + mime_type: + type: optional + docs: >- + The mime type of the attachment. + + The following mime types are supported: + + image/gif, image/jpeg, image/png, image/tiff, image/bmp, + application/pdf. + access: read-only + uploaded_at: + type: optional + docs: The timestamp when the attachment was uploaded, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + InvoiceAutomaticPaymentSource: + enum: + - NONE + - CARD_ON_FILE + - BANK_ON_FILE + docs: >- + Indicates the automatic payment method for an [invoice payment + request](entity:InvoicePaymentRequest). + source: + openapi: openapi/openapi.json + InvoiceCanceledEvent: + docs: Published when an [Invoice](entity:Invoice) is canceled. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.canceled"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceCanceledEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the canceled invoice. + source: + openapi: openapi/openapi.json + InvoiceCanceledEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoiceCreatedEvent: + docs: Published when an [Invoice](entity:Invoice) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the created invoice. + source: + openapi: openapi/openapi.json + InvoiceCreatedEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoiceCustomField: + docs: >- + An additional seller-defined and customer-facing field to include on the + invoice. For more information, + + see [Custom + fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields). + + + Adding custom fields to an invoice requires an + + [Invoices Plus + subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). + properties: + label: + type: optional> + docs: >- + The label or title of the custom field. This field is required for a + custom field. + validation: + maxLength: 30 + value: + type: optional> + docs: The text of the custom field. If omitted, only the label is rendered. + validation: + maxLength: 2000 + placement: + type: optional + docs: >- + The location of the custom field on the invoice. This field is + required for a custom field. + + See [InvoiceCustomFieldPlacement](#type-invoicecustomfieldplacement) + for possible values + source: + openapi: openapi/openapi.json + InvoiceCustomFieldPlacement: + enum: + - ABOVE_LINE_ITEMS + - BELOW_LINE_ITEMS + docs: >- + Indicates where to render a custom field on the Square-hosted invoice page + and in emailed or PDF + + copies of the invoice. + source: + openapi: openapi/openapi.json + InvoiceDeletedEvent: + docs: Published when a draft [Invoice](entity:Invoice) is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceDeletedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + deleted: + type: optional> + docs: Indicates that the invoice was deleted. + source: + openapi: openapi/openapi.json + InvoiceDeliveryMethod: + enum: + - EMAIL + - SHARE_MANUALLY + - SMS + docs: >- + Indicates how Square delivers the [invoice](entity:Invoice) to the + customer. + source: + openapi: openapi/openapi.json + InvoiceFilter: + docs: Describes query filters to apply. + properties: + location_ids: + docs: |- + Limits the search to the specified locations. A location is required. + In the current implementation, only one location can be specified. + type: list + customer_ids: + type: optional>> + docs: >- + Limits the search to the specified customers, within the specified + locations. + + Specifying a customer is optional. In the current implementation, + + a maximum of one customer can be specified. + source: + openapi: openapi/openapi.json + InvoicePaymentMadeEvent: + docs: >- + Published when a payment that is associated with an + [invoice](entity:Invoice) is completed. + + For more information about invoice payments, see [Pay an + invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#pay-invoice). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.payment_made"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoicePaymentMadeEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the invoice that was paid. + source: + openapi: openapi/openapi.json + InvoicePaymentMadeEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoicePaymentReminder: + docs: >- + Describes a payment request reminder (automatic notification) that Square + sends + + to the customer. You configure a reminder relative to the payment request + + `due_date`. + properties: + uid: + type: optional + docs: |- + A Square-assigned ID that uniquely identifies the reminder within the + `InvoicePaymentRequest`. + access: read-only + relative_scheduled_days: + type: optional> + docs: >- + The number of days before (a negative number) or after (a positive + number) + + the payment request `due_date` when the reminder is sent. For example, + -3 indicates that + + the reminder should be sent 3 days before the payment request + `due_date`. + validation: + min: -32767 + max: 32767 + message: + type: optional> + docs: The reminder message. + validation: + minLength: 1 + maxLength: 1000 + status: + type: optional + docs: >- + The status of the reminder. + + See [InvoicePaymentReminderStatus](#type-invoicepaymentreminderstatus) + for possible values + sent_at: + type: optional + docs: If sent, the timestamp when the reminder was sent, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + InvoicePaymentReminderStatus: + enum: + - PENDING + - NOT_APPLICABLE + - SENT + docs: The status of a payment request reminder. + source: + openapi: openapi/openapi.json + InvoicePaymentRequest: + docs: >- + Represents a payment request for an [invoice](entity:Invoice). Invoices + can specify a maximum + + of 13 payment requests, with up to 12 `INSTALLMENT` request types. For + more information, + + see [Configuring payment + requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). + + + Adding `INSTALLMENT` payment requests to an invoice requires an + + [Invoices Plus + subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). + properties: + uid: + type: optional> + docs: >- + The Square-generated ID of the payment request in an + [invoice](entity:Invoice). + validation: + minLength: 1 + maxLength: 255 + request_method: + type: optional + docs: >- + Indicates how Square processes the payment request. DEPRECATED at + version 2021-01-21. Replaced by the + + `Invoice.delivery_method` and + `InvoicePaymentRequest.automatic_payment_source` fields. + + + One of the following is required when creating an invoice: + + - (Recommended) The `delivery_method` field of the invoice. To + configure an automatic payment, the + + `automatic_payment_source` field of the payment request is also + required. + + - This `request_method` field. Note that `invoice` objects returned in + responses do not include `request_method`. + + See [InvoiceRequestMethod](#type-invoicerequestmethod) for possible + values + request_type: + type: optional + docs: >- + Identifies the payment request type. This type defines how the payment + request amount is determined. + + This field is required to create a payment request. + + See [InvoiceRequestType](#type-invoicerequesttype) for possible values + due_date: + type: optional> + docs: >- + The due date (in the invoice's time zone) for the payment request, in + `YYYY-MM-DD` format. This field + + is required to create a payment request. If an + `automatic_payment_source` is defined for the request, Square + + charges the payment source on this date. + + + After this date, the invoice becomes overdue. For example, a payment + `due_date` of 2021-03-09 with a `timezone` + + of America/Los\_Angeles becomes overdue at midnight on March 9 in + America/Los\_Angeles (which equals a UTC + + timestamp of 2021-03-10T08:00:00Z). + fixed_amount_requested_money: + type: optional + docs: >- + If the payment request specifies `DEPOSIT` or `INSTALLMENT` as the + `request_type`, + + this indicates the request amount. + + You cannot specify this when `request_type` is `BALANCE` or when the + + payment request includes the `percentage_requested` field. + percentage_requested: + type: optional> + docs: >- + Specifies the amount for the payment request in percentage: + + + - When the payment `request_type` is `DEPOSIT`, it is the percentage + of the order's total amount. + + - When the payment `request_type` is `INSTALLMENT`, it is the + percentage of the order's total less + + the deposit, if requested. The sum of the `percentage_requested` in + all installment + + payment requests must be equal to 100. + + + You cannot specify this when the payment `request_type` is `BALANCE` + or when the + + payment request specifies the `fixed_amount_requested_money` field. + tipping_enabled: + type: optional> + docs: >- + If set to true, the Square-hosted invoice page (the `public_url` field + of the invoice) + + provides a place for the customer to pay a tip. + + + This field is allowed only on the final payment request + + and the payment `request_type` must be `BALANCE` or `INSTALLMENT`. + automatic_payment_source: + type: optional + docs: >- + The payment method for an automatic payment. + + + The default value is `NONE`. + + See + [InvoiceAutomaticPaymentSource](#type-invoiceautomaticpaymentsource) + for possible values + card_id: + type: optional> + docs: >- + The ID of the credit or debit card on file to charge for the payment + request. To get the cards on file for a customer, + + call [ListCards](api-endpoint:Cards-ListCards) and include the + `customer_id` of the invoice recipient. + validation: + minLength: 1 + maxLength: 255 + reminders: + type: optional>> + docs: A list of one or more reminders to send for the payment request. + computed_amount_money: + type: optional + docs: >- + The amount of the payment request, computed using the order amount and + information from the various payment + + request fields (`request_type`, `fixed_amount_requested_money`, and + `percentage_requested`). + total_completed_amount_money: + type: optional + docs: >- + The amount of money already paid for the specific payment request. + + This amount might include a rounding adjustment if the most recent + invoice payment + + was in cash in a currency that rounds cash payments (such as, `CAD` or + `AUD`). + rounding_adjustment_included_money: + type: optional + docs: >- + If the most recent payment was a cash payment + + in a currency that rounds cash payments (such as, `CAD` or `AUD`) and + the payment + + is rounded from `computed_amount_money` in the payment request, then + this + + field specifies the rounding adjustment applied. This amount + + might be negative. + source: + openapi: openapi/openapi.json + InvoicePublishedEvent: + docs: >- + Published when an [Invoice](entity:Invoice) transitions from a draft to a + non-draft status. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.published"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoicePublishedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the published invoice. + source: + openapi: openapi/openapi.json + InvoicePublishedEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoiceQuery: + docs: Describes query criteria for searching invoices. + properties: + filter: + type: InvoiceFilter + docs: >- + Query filters to apply in searching invoices. + + For more information, see [Search for + invoices](https://developer.squareup.com/docs/invoices-api/retrieve-list-search-invoices#search-invoices). + sort: + type: optional + docs: Describes the sort order for the search result. + source: + openapi: openapi/openapi.json + InvoiceRecipient: + docs: >- + Represents a snapshot of customer data. This object stores customer data + that is displayed on the invoice + + and that Square uses to deliver the invoice. + + + When you provide a customer ID for a draft invoice, Square retrieves the + associated customer profile and populates + + the remaining `InvoiceRecipient` fields. You cannot update these fields + after the invoice is published. + + Square updates the customer ID in response to a merge operation, but does + not update other fields. + properties: + customer_id: + type: optional> + docs: |- + The ID of the customer. This is the customer profile ID that + you provide when creating a draft invoice. + validation: + minLength: 1 + maxLength: 255 + given_name: + type: optional + docs: The recipient's given (that is, first) name. + access: read-only + family_name: + type: optional + docs: The recipient's family (that is, last) name. + access: read-only + email_address: + type: optional + docs: The recipient's email address. + access: read-only + address: + type: optional
+ docs: The recipient's physical address. + phone_number: + type: optional + docs: The recipient's phone number. + access: read-only + company_name: + type: optional + docs: The name of the recipient's company. + access: read-only + tax_ids: + type: optional + docs: >- + The recipient's tax IDs. The country of the seller account determines + whether this field + + is available for the customer. For more information, see [Invoice + recipient tax + IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids). + source: + openapi: openapi/openapi.json + InvoiceRecipientTaxIds: + docs: >- + Represents the tax IDs for an invoice recipient. The country of the seller + account determines + + whether the corresponding `tax_ids` field is available for the customer. + For more information, + + see [Invoice recipient tax + IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids). + properties: + eu_vat: + type: optional + docs: >- + The EU VAT identification number for the invoice recipient. For + example, `IE3426675K`. + access: read-only + source: + openapi: openapi/openapi.json + InvoiceRefundedEvent: + docs: >- + Published when a refund is applied toward a payment of an + [invoice](entity:Invoice). + + For more information about invoice refunds, see [Refund an + invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#refund-invoice). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.refunded"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceRefundedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the refunded invoice. + source: + openapi: openapi/openapi.json + InvoiceRefundedEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoiceRequestMethod: + enum: + - EMAIL + - CHARGE_CARD_ON_FILE + - SHARE_MANUALLY + - CHARGE_BANK_ON_FILE + - SMS + - SMS_CHARGE_CARD_ON_FILE + - SMS_CHARGE_BANK_ON_FILE + docs: >- + Specifies the action for Square to take for processing the invoice. For + example, + + email the invoice, charge a customer's card on file, or do nothing. + DEPRECATED at + + version 2021-01-21. The corresponding `request_method` field is replaced + by the + + `Invoice.delivery_method` and + `InvoicePaymentRequest.automatic_payment_source` fields. + source: + openapi: openapi/openapi.json + InvoiceRequestType: + enum: + - BALANCE + - DEPOSIT + - INSTALLMENT + docs: >- + Indicates the type of the payment request. For more information, see + + [Configuring payment + requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). + source: + openapi: openapi/openapi.json + InvoiceScheduledChargeFailedEvent: + docs: >- + Published when an automatic scheduled payment for an + [Invoice](entity:Invoice) has failed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: >- + The type of event this represents, + `"invoice.scheduled_charge_failed"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceScheduledChargeFailedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: >- + An object containing the invoice that experienced the failed scheduled + charge. + source: + openapi: openapi/openapi.json + InvoiceScheduledChargeFailedEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoiceSort: + docs: Identifies the sort field and sort order. + properties: + field: + type: InvoiceSortField + docs: |- + The field to use for sorting. + See [InvoiceSortField](#type-invoicesortfield) for possible values + order: + type: optional + docs: |- + The order to use for sorting the results. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + InvoiceSortField: + type: literal<"INVOICE_SORT_DATE"> + docs: The field to use for sorting. + InvoiceStatus: + enum: + - DRAFT + - UNPAID + - SCHEDULED + - PARTIALLY_PAID + - PAID + - PARTIALLY_REFUNDED + - REFUNDED + - CANCELED + - FAILED + - PAYMENT_PENDING + docs: Indicates the status of an [invoice](entity:Invoice). + source: + openapi: openapi/openapi.json + InvoiceUpdatedEvent: + docs: Published when an [Invoice](entity:Invoice) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the updated invoice. + source: + openapi: openapi/openapi.json + InvoiceUpdatedEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + ItemVariationLocationOverrides: + docs: >- + Price and inventory alerting overrides for a `CatalogItemVariation` at a + specific `Location`. + properties: + location_id: + type: optional> + docs: >- + The ID of the `Location`. This can include locations that are + deactivated. + price_money: + type: optional + docs: >- + The price of the `CatalogItemVariation` at the given `Location`, or + blank for variable pricing. + pricing_type: + type: optional + docs: >- + The pricing type (fixed or variable) for the `CatalogItemVariation` at + the given `Location`. + + See [CatalogPricingType](#type-catalogpricingtype) for possible values + track_inventory: + type: optional> + docs: >- + If `true`, inventory tracking is active for the `CatalogItemVariation` + at this `Location`. + inventory_alert_type: + type: optional + docs: >- + Indicates whether the `CatalogItemVariation` displays an alert when + its inventory + + quantity is less than or equal to its `inventory_alert_threshold`. + + See [InventoryAlertType](#type-inventoryalerttype) for possible values + inventory_alert_threshold: + type: optional> + docs: >- + If the inventory quantity for the variation is less than or equal to + this value and `inventory_alert_type` + + is `LOW_QUANTITY`, the variation displays an alert in the merchant + dashboard. + + + This value is always an integer. + sold_out: + type: optional + docs: >- + Indicates whether the overridden item variation is sold out at the + specified location. + + + When inventory tracking is enabled on the item variation either + globally or at the specified location, + + the item variation is automatically marked as sold out when its + inventory count reaches zero. The seller + + can manually set the item variation as sold out even when the + inventory count is greater than zero. + + Attempts by an application to set this attribute are ignored. + Regardless how the sold-out status is set, + + applications should treat its inventory count as zero when this + attribute value is `true`. + access: read-only + sold_out_valid_until: + type: optional + docs: >- + The seller-assigned timestamp, of the RFC 3339 format, to indicate + when this sold-out variation + + becomes available again at the specified location. Attempts by an + application to set this attribute are ignored. + + When the current time is later than this attribute value, the affected + item variation is no longer sold out. + access: read-only + source: + openapi: openapi/openapi.json + Job: + docs: >- + Represents a job that can be assigned to [team + members](entity:TeamMember). This object defines the + + job's title and tip eligibility. Compensation is defined in a [job + assignment](entity:JobAssignment) + + in a team member's wage setting. + properties: + id: + type: optional + docs: >- + **Read only** The unique Square-assigned ID of the job. If you need a + job ID for an API request, + + call [ListJobs](api-endpoint:Team-ListJobs) or use the ID returned + when you created the job. + + You can also get job IDs from a team member's wage setting. + title: + type: optional> + docs: The title of the job. + validation: + maxLength: 150 + is_tip_eligible: + type: optional> + docs: Indicates whether team members can earn tips for the job. + created_at: + type: optional + docs: The timestamp when the job was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the job was last updated, in RFC 3339 format. + access: read-only + version: + type: optional + docs: >- + **Read only** The current version of the job. Include this field in + `UpdateJob` requests to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) + + control and avoid overwrites from concurrent requests. Requests fail + if the provided version doesn't + + match the server version at the time of the request. + source: + openapi: openapi/openapi.json + JobAssignment: + docs: >- + Represents a job assigned to a [team member](entity:TeamMember), including + the compensation the team + + member earns for the job. Job assignments are listed in the team member's + [wage setting](entity:WageSetting). + properties: + job_title: + type: optional> + docs: The title of the job. + pay_type: + type: JobAssignmentPayType + docs: >- + The current pay type for the job assignment used to + + calculate the pay amount in a pay period. + + See [JobAssignmentPayType](#type-jobassignmentpaytype) for possible + values + hourly_rate: + type: optional + docs: >- + The hourly pay rate of the job. For `SALARY` pay types, Square + calculates the hourly rate based on + + `annual_rate` and `weekly_hours`. + annual_rate: + type: optional + docs: >- + The total pay amount for a 12-month period on the job. Set if the job + `PayType` is `SALARY`. + weekly_hours: + type: optional> + docs: >- + The planned hours per week for the job. Set if the job `PayType` is + `SALARY`. + job_id: + type: optional> + docs: The ID of the [job](entity:Job). + source: + openapi: openapi/openapi.json + JobAssignmentPayType: + enum: + - NONE + - HOURLY + - SALARY + docs: Enumerates the possible pay types that a job can be assigned. + source: + openapi: openapi/openapi.json + JobCreatedEvent: + docs: Published when a Job is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"job.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + JobCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"job"`. + id: + type: optional + docs: ID of the created job. + object: + type: optional + docs: An object containing the created job. + source: + openapi: openapi/openapi.json + JobCreatedEventObject: + properties: + job: + type: optional + docs: The created job. + source: + openapi: openapi/openapi.json + JobUpdatedEvent: + docs: Published when a Job is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"job.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + JobUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"job"`. + id: + type: optional + docs: ID of the updated job. + object: + type: optional + docs: An object containing the updated job. + source: + openapi: openapi/openapi.json + JobUpdatedEventObject: + properties: + job: + type: optional + docs: The updated job. + source: + openapi: openapi/openapi.json + LaborScheduledShiftCreatedEvent: + docs: Published when a [ScheduledShift](entity:ScheduledShift) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + location_id: + type: optional> + docs: The ID of the location associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.scheduled_shift.created`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborScheduledShiftCreatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `scheduled_shift`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the affected `ScheduledShift`. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the affected `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborScheduledShiftCreatedEventObject: + properties: + ScheduledShift: + type: optional + docs: The new `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborScheduledShiftDeletedEvent: + docs: Published when a [ScheduledShift](entity:ScheduledShift) is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + location_id: + type: optional> + docs: The ID of the location associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.scheduled_shift.deleted`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborScheduledShiftDeletedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `scheduled_shift`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the affected `ScheduledShift`. + validation: + maxLength: 255 + deleted: + type: optional> + docs: Is true if the affected object was deleted. Otherwise absent. + source: + openapi: openapi/openapi.json + LaborScheduledShiftPublishedEvent: + docs: Published when a [ScheduledShift](entity:ScheduledShift) is published. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + location_id: + type: optional> + docs: The ID of the location associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.scheduled_shift.published`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborScheduledShiftPublishedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `scheduled_shift`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the affected `ScheduledShift`. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the affected `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborScheduledShiftPublishedEventObject: + properties: + ScheduledShift: + type: optional + docs: The published `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborScheduledShiftUpdatedEvent: + docs: Published when a [ScheduledShift](entity:ScheduledShift) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + location_id: + type: optional> + docs: The ID of the location associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.scheduled_shift.updated`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborScheduledShiftUpdatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `scheduled_shift`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the affected `ScheduledShift`. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the affected `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborScheduledShiftUpdatedEventObject: + properties: + ScheduledShift: + type: optional + docs: The updated `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborShiftCreatedEvent: + docs: >- + Published when a worker starts a [Shift](entity:Shift). + + + Deprecated at Square API version 2025-05-21. Replaced by + `labor.timecard.created`. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + type: + type: optional> + docs: The type of event. For this event, the value is `labor.shift.created`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborShiftCreatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `shift`. + id: + type: optional + docs: The ID of the affected `Shift`. + object: + type: optional + docs: An object containing the affected `Shift`. + source: + openapi: openapi/openapi.json + LaborShiftCreatedEventObject: + properties: + shift: + type: optional + docs: The new `Shift`. + source: + openapi: openapi/openapi.json + LaborShiftDeletedEvent: + docs: >- + Published when a [Shift](entity:Shift) is deleted. + + + Deprecated at Square API version 2025-05-21. Replaced by + `labor.timecard.deleted`. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + type: + type: optional> + docs: The type of event. For this event, the value is `labor.shift.deleted`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborShiftDeletedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `shift`. + id: + type: optional + docs: The ID of the affected `Shift`. + deleted: + type: optional> + docs: Is true if the affected object was deleted. Otherwise absent. + source: + openapi: openapi/openapi.json + LaborShiftUpdatedEvent: + docs: >- + Published when a [Shift](entity:Shift) is updated. + + + Deprecated at Square API version 2025-05-21. Replaced by + `labor.timecard.updated`. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + type: + type: optional> + docs: The type of event. For this event, the value is `labor.shift.updated`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborShiftUpdatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `shift`. + id: + type: optional + docs: ID of the affected `Shift`. + object: + type: optional + docs: An object containing the affected `Shift`. + source: + openapi: openapi/openapi.json + LaborShiftUpdatedEventObject: + properties: + shift: + type: optional + docs: The updated `Shift`. + source: + openapi: openapi/openapi.json + LaborTimecardCreatedEvent: + docs: Published when a worker starts a [Timecard](entity:Timecard). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.timecard.created`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborTimecardCreatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `timecard`. + id: + type: optional + docs: The ID of the affected `Timecard`. + object: + type: optional + docs: An object containing the affected `Timecard`. + source: + openapi: openapi/openapi.json + LaborTimecardCreatedEventObject: + properties: + timecard: + type: optional + docs: The new `Timecard`. + source: + openapi: openapi/openapi.json + LaborTimecardDeletedEvent: + docs: Published when a [Timecard](entity:Timecard) is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.timecard.deleted`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborTimecardDeletedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `timecard`. + id: + type: optional + docs: The ID of the affected `Timecard`. + deleted: + type: optional> + docs: Is true if the affected object was deleted. Otherwise absent. + source: + openapi: openapi/openapi.json + LaborTimecardUpdatedEvent: + docs: Published when a [Timecard](entity:Timecard) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.timecard.updated`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborTimecardUpdatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `timecard`. + id: + type: optional + docs: The ID of the affected `Timecard`. + object: + type: optional + docs: An object containing the affected `Timecard`. + source: + openapi: openapi/openapi.json + LaborTimecardUpdatedEventObject: + properties: + timecard: + type: optional + docs: The updated `Timecard`. + source: + openapi: openapi/openapi.json + LinkCustomerToGiftCardResponse: + docs: >- + A response that contains the linked `GiftCard` object. If the request + resulted in errors, + + the response contains a set of `Error` objects. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: >- + The gift card with the ID of the linked customer listed in the + `customer_ids` field. + source: + openapi: openapi/openapi.json + ListBankAccountsResponse: + docs: Response object returned by ListBankAccounts. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + bank_accounts: + type: optional> + docs: List of BankAccounts associated with this account. + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can + + use in a subsequent request to fetch next set of bank accounts. + + If empty, this is the final response. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + source: + openapi: openapi/openapi.json + ListBookingCustomAttributeDefinitionsResponse: + docs: >- + Represents a + [ListBookingCustomAttributeDefinitions](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributeDefinitions) + response. + + Either `custom_attribute_definitions`, an empty object, or `errors` is + present in the response. + + If additional results are available, the `cursor` field is also present + along with `custom_attribute_definitions`. + properties: + custom_attribute_definitions: + type: optional> + docs: >- + The retrieved custom attribute definitions. If no custom attribute + definitions are found, + + Square returns an empty object (`{}`). + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of + + results for your original request. This field is present only if the + request succeeded and + + additional results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListBookingCustomAttributesResponse: + docs: >- + Represents a + [ListBookingCustomAttributes](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributes) + response. + + Either `custom_attributes`, an empty object, or `errors` is present in the + response. If additional + + results are available, the `cursor` field is also present along with + `custom_attributes`. + properties: + custom_attributes: + type: optional> + docs: >- + The retrieved custom attributes. If `with_definitions` was set to + `true` in the request, + + the custom attribute definition is returned in the `definition` field + of each custom attribute. + + + If no custom attributes are found, Square returns an empty object + (`{}`). + cursor: + type: optional + docs: >- + The cursor to use in your next call to this endpoint to retrieve the + next page of results + + for your original request. This field is present only if the request + succeeded and additional + + results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListBookingsResponse: + properties: + bookings: + type: optional> + docs: The list of targeted bookings. + cursor: + type: optional + docs: >- + The pagination cursor to be used in the subsequent request to get the + next page of the results. Stop retrieving the next page of the results + when the cursor is not set. + validation: + maxLength: 65536 + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListBreakTypesResponse: + docs: >- + The response to a request for a set of `BreakType` objects. The response + contains + + the requested `BreakType` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + break_types: + type: optional> + docs: ' A page of `BreakType` results.' + cursor: + type: optional + docs: |- + The value supplied in the subsequent request to fetch the next page + of `BreakType` results. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListCardsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [ListCards](api-endpoint:Cards-ListCards) endpoint. + + + Note: if there are errors processing the request, the card field will not + be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + cards: + type: optional> + docs: The requested list of `Card`s. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + source: + openapi: openapi/openapi.json + ListCashDrawerShiftEventsResponse: + properties: + cursor: + type: optional + docs: |- + Opaque cursor for fetching the next page. Cursor is not present in + the last page of results. + errors: + type: optional> + docs: Any errors that occurred during the request. + cash_drawer_shift_events: + type: optional> + docs: |- + All of the events (payments, refunds, etc.) for a cash drawer during + the shift. + source: + openapi: openapi/openapi.json + ListCashDrawerShiftsResponse: + properties: + cursor: + type: optional + docs: |- + Opaque cursor for fetching the next page of results. Cursor is not + present in the last page of results. + errors: + type: optional> + docs: Any errors that occurred during the request. + cash_drawer_shifts: + type: optional> + docs: |- + A collection of CashDrawerShiftSummary objects for shifts that match + the query. + source: + openapi: openapi/openapi.json + ListCatalogResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + this is the final response. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + objects: + type: optional> + docs: The CatalogObjects returned. + source: + openapi: openapi/openapi.json + ListCustomerCustomAttributeDefinitionsResponse: + docs: >- + Represents a + [ListCustomerCustomAttributeDefinitions](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributeDefinitions) + response. + + Either `custom_attribute_definitions`, an empty object, or `errors` is + present in the response. + + If additional results are available, the `cursor` field is also present + along with `custom_attribute_definitions`. + properties: + custom_attribute_definitions: + type: optional> + docs: >- + The retrieved custom attribute definitions. If no custom attribute + definitions are found, + + Square returns an empty object (`{}`). + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of + + results for your original request. This field is present only if the + request succeeded and + + additional results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListCustomerCustomAttributesResponse: + docs: >- + Represents a + [ListCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributes) + response. + + Either `custom_attributes`, an empty object, or `errors` is present in the + response. If additional + + results are available, the `cursor` field is also present along with + `custom_attributes`. + properties: + custom_attributes: + type: optional> + docs: >- + The retrieved custom attributes. If `with_definitions` was set to + `true` in the request, + + the custom attribute definition is returned in the `definition` field + of each custom attribute. + + + If no custom attributes are found, Square returns an empty object + (`{}`). + cursor: + type: optional + docs: >- + The cursor to use in your next call to this endpoint to retrieve the + next page of results + + for your original request. This field is present only if the request + succeeded and additional + + results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListCustomerGroupsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [ListCustomerGroups](api-endpoint:CustomerGroups-ListCustomerGroups) + endpoint. + + + Either `errors` or `groups` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + groups: + type: optional> + docs: A list of customer groups belonging to the current seller. + cursor: + type: optional + docs: >- + A pagination cursor to retrieve the next set of results for your + + original query to the endpoint. This value is present only if the + request + + succeeded and additional results are available. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListCustomerSegmentsResponse: + docs: >- + Defines the fields that are included in the response body for requests to + the `ListCustomerSegments` endpoint. + + + Either `errors` or `segments` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + segments: + type: optional> + docs: >- + The list of customer segments belonging to the associated Square + account. + cursor: + type: optional + docs: >- + A pagination cursor to be used in subsequent calls to + `ListCustomerSegments` + + to retrieve the next set of query results. The cursor is only present + if the request succeeded and + + additional results are available. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListCustomersResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the `ListCustomers` endpoint. + + + Either `errors` or `customers` is present in a given response (never + both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + customers: + type: optional> + docs: >- + The customer profiles associated with the Square account or an empty + object (`{}`) if none are found. + + Only customer profiles with public information (`given_name`, + `family_name`, `company_name`, `email_address`, or + + `phone_number`) are included in the response. + cursor: + type: optional + docs: >- + A pagination cursor to retrieve the next set of results for the + + original query. A cursor is only present if the request succeeded and + additional results + + are available. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + count: + type: optional + docs: >- + The total count of customers associated with the Square account. Only + customer profiles with public information + + (`given_name`, `family_name`, `company_name`, `email_address`, or + `phone_number`) are counted. This field is present + + only if `count` is set to `true` in the request. + source: + openapi: openapi/openapi.json + ListDeviceCodesResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + device_codes: + type: optional> + docs: The queried DeviceCode. + cursor: + type: optional + docs: >- + A pagination cursor to retrieve the next set of results for your + + original query to the endpoint. This value is present only if the + request + + succeeded and additional results are available. + + + See [Paginating + results](https://developer.squareup.com/docs/working-with-apis/pagination) + for more information. + source: + openapi: openapi/openapi.json + ListDevicesResponse: + properties: + errors: + type: optional> + docs: Information about errors that occurred during the request. + devices: + type: optional> + docs: The requested list of `Device` objects. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + source: + openapi: openapi/openapi.json + ListDisputeEvidenceResponse: + docs: Defines the fields in a `ListDisputeEvidence` response. + properties: + evidence: + type: optional> + docs: The list of evidence previously uploaded to the specified dispute. + errors: + type: optional> + docs: Information about errors encountered during the request. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. + + If unset, this is the final response. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListDisputesResponse: + docs: Defines fields in a `ListDisputes` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + disputes: + type: optional> + docs: The list of disputes. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. + + If unset, this is the final response. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListEmployeeWagesResponse: + docs: >- + The response to a request for a set of `EmployeeWage` objects. The + response contains + + a set of `EmployeeWage` objects. + properties: + employee_wages: + type: optional> + docs: A page of `EmployeeWage` results. + cursor: + type: optional + docs: |- + The value supplied in the subsequent request to fetch the next page + of `EmployeeWage` results. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListEmployeesResponse: + properties: + employees: optional> + cursor: + type: optional + docs: The token to be used to retrieve the next page of results. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListEventTypesResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [ListEventTypes](api-endpoint:Events-ListEventTypes) + endpoint. + + + Note: if there are errors processing the request, the event types field + will not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + event_types: + type: optional> + docs: The list of event types. + metadata: + type: optional> + docs: >- + Contains the metadata of an event type. For more information, see + [EventTypeMetadata](entity:EventTypeMetadata). + source: + openapi: openapi/openapi.json + ListGiftCardActivitiesResponse: + docs: >- + A response that contains a list of `GiftCardActivity` objects. If the + request resulted in errors, + + the response contains a set of `Error` objects. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card_activities: + type: optional> + docs: >- + The requested gift card activities or an empty object if none are + found. + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can use in + a + + subsequent request to retrieve the next set of activities. If a cursor + is not present, this is + + the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + source: + openapi: openapi/openapi.json + ListGiftCardsResponse: + docs: >- + A response that contains a list of `GiftCard` objects. If the request + resulted in errors, + + the response contains a set of `Error` objects. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_cards: + type: optional> + docs: The requested gift cards or an empty object if none are found. + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can use in + a + + subsequent request to retrieve the next set of gift cards. If a cursor + is not present, this is + + the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + source: + openapi: openapi/openapi.json + ListInvoicesResponse: + docs: Describes a `ListInvoice` response. + properties: + invoices: + type: optional> + docs: The invoices retrieved. + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can use in + a + + subsequent request to retrieve the next set of invoices. If empty, + this is the final + + response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + ListJobsResponse: + docs: >- + Represents a [ListJobs](api-endpoint:Team-ListJobs) response. Either + `jobs` or `errors` + + is present in the response. If additional results are available, the + `cursor` field is also present. + properties: + jobs: + type: optional> + docs: The retrieved jobs. A single paged response contains up to 100 jobs. + cursor: + type: optional + docs: >- + An opaque cursor used to retrieve the next page of results. This field + is present only + + if the request succeeded and additional results are available. For + more information, see + + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListLocationBookingProfilesResponse: + properties: + location_booking_profiles: + type: optional> + docs: The list of a seller's location booking profiles. + cursor: + type: optional + docs: >- + The pagination cursor to be used in the subsequent request to get the + next page of the results. Stop retrieving the next page of the results + when the cursor is not set. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListLocationCustomAttributeDefinitionsResponse: + docs: >- + Represents a + [ListLocationCustomAttributeDefinitions](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributeDefinitions) + response. + + Either `custom_attribute_definitions`, an empty object, or `errors` is + present in the response. + + If additional results are available, the `cursor` field is also present + along with `custom_attribute_definitions`. + properties: + custom_attribute_definitions: + type: optional> + docs: >- + The retrieved custom attribute definitions. If no custom attribute + definitions are found, + + Square returns an empty object (`{}`). + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of + + results for your original request. This field is present only if the + request succeeded and + + additional results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListLocationCustomAttributesResponse: + docs: >- + Represents a + [ListLocationCustomAttributes](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributes) + response. + + Either `custom_attributes`, an empty object, or `errors` is present in the + response. If additional + + results are available, the `cursor` field is also present along with + `custom_attributes`. + properties: + custom_attributes: + type: optional> + docs: >- + The retrieved custom attributes. If `with_definitions` was set to + `true` in the request, + + the custom attribute definition is returned in the `definition` field + of each custom attribute. + + If no custom attributes are found, Square returns an empty object + (`{}`). + cursor: + type: optional + docs: >- + The cursor to use in your next call to this endpoint to retrieve the + next page of results + + for your original request. This field is present only if the request + succeeded and additional + + results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListLocationsResponse: + docs: >- + Defines the fields that are included in the response body of a request + + to the [ListLocations](api-endpoint:Locations-ListLocations) endpoint. + + + Either `errors` or `locations` is present in a given response (never + both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + locations: + type: optional> + docs: The business locations. + source: + openapi: openapi/openapi.json + ListLoyaltyProgramsResponse: + docs: A response that contains all loyalty programs. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + programs: + type: optional> + docs: A list of `LoyaltyProgram` for the merchant. + source: + openapi: openapi/openapi.json + ListLoyaltyPromotionsResponse: + docs: >- + Represents a + [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) + response. + + One of `loyalty_promotions`, an empty object, or `errors` is present in + the response. + + If additional results are available, the `cursor` field is also present + along with `loyalty_promotions`. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_promotions: + type: optional> + docs: The retrieved loyalty promotions. + cursor: + type: optional + docs: >- + The cursor to use in your next call to this endpoint to retrieve the + next page of results + + for your original request. This field is present only if the request + succeeded and additional + + results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListMerchantCustomAttributeDefinitionsResponse: + docs: >- + Represents a + [ListMerchantCustomAttributeDefinitions](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributeDefinitions) + response. + + Either `custom_attribute_definitions`, an empty object, or `errors` is + present in the response. + + If additional results are available, the `cursor` field is also present + along with `custom_attribute_definitions`. + properties: + custom_attribute_definitions: + type: optional> + docs: >- + The retrieved custom attribute definitions. If no custom attribute + definitions are found, + + Square returns an empty object (`{}`). + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of + + results for your original request. This field is present only if the + request succeeded and + + additional results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListMerchantCustomAttributesResponse: + docs: >- + Represents a + [ListMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributes) + response. + + Either `custom_attributes`, an empty object, or `errors` is present in the + response. If additional + + results are available, the `cursor` field is also present along with + `custom_attributes`. + properties: + custom_attributes: + type: optional> + docs: >- + The retrieved custom attributes. If `with_definitions` was set to + `true` in the request, + + the custom attribute definition is returned in the `definition` field + of each custom attribute. + + If no custom attributes are found, Square returns an empty object + (`{}`). + cursor: + type: optional + docs: >- + The cursor to use in your next call to this endpoint to retrieve the + next page of results + + for your original request. This field is present only if the request + succeeded and additional + + results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListMerchantsResponse: + docs: >- + The response object returned by the + [ListMerchant](api-endpoint:Merchants-ListMerchants) endpoint. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + merchant: + type: optional> + docs: The requested `Merchant` entities. + cursor: + type: optional + docs: >- + If the response is truncated, the cursor to use in next request to + fetch next set of objects. + source: + openapi: openapi/openapi.json + ListOrderCustomAttributeDefinitionsResponse: + docs: Represents a response from listing order custom attribute definitions. + properties: + custom_attribute_definitions: + docs: >- + The retrieved custom attribute definitions. If no custom attribute + definitions are found, Square returns an empty object (`{}`). + type: list + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of results for your original request. + + This field is present only if the request succeeded and additional + results are available. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + validation: + minLength: 1 + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListOrderCustomAttributesResponse: + docs: Represents a response from listing order custom attributes. + properties: + custom_attributes: + type: optional> + docs: >- + The retrieved custom attributes. If no custom attribute are found, + Square returns an empty object (`{}`). + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of results for your original request. + + This field is present only if the request succeeded and additional + results are available. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + validation: + minLength: 1 + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListPaymentLinksResponse: + properties: + errors: + type: optional> + docs: Errors that occurred during the request. + payment_links: + type: optional> + docs: The list of payment links. + cursor: + type: optional + docs: >2- + When a response is truncated, it includes a cursor that you can use in a subsequent request + to retrieve the next set of gift cards. If a cursor is not present, + this is the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListPaymentRefundsRequestSortField: + enum: + - CREATED_AT + - UPDATED_AT + source: + openapi: openapi/openapi.json + ListPaymentRefundsResponse: + docs: >- + Defines the response returned by + [ListPaymentRefunds](api-endpoint:Refunds-ListPaymentRefunds). + + + Either `errors` or `refunds` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refunds: + type: optional> + docs: The list of requested refunds. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListPaymentsRequestSortField: + enum: + - CREATED_AT + - OFFLINE_CREATED_AT + - UPDATED_AT + source: + openapi: openapi/openapi.json + ListPaymentsResponse: + docs: >- + Defines the response returned by + [ListPayments](api-endpoint:Payments-ListPayments). + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + payments: + type: optional> + docs: The requested list of payments. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListPayoutEntriesResponse: + docs: The response to retrieve payout records entries. + properties: + payout_entries: + type: optional> + docs: >- + The requested list of payout entries, ordered with the given or + default sort order. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + this is the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + ListPayoutsResponse: + docs: The response to retrieve payout records entries. + properties: + payouts: + type: optional> + docs: The requested list of payouts. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + this is the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + ListSitesResponse: + docs: >- + Represents a `ListSites` response. The response can include either `sites` + or `errors`. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + sites: + type: optional> + docs: The sites that belong to the seller. + source: + openapi: openapi/openapi.json + ListSubscriptionEventsResponse: + docs: >- + Defines output parameters in a response from the + + [ListSubscriptionEvents](api-endpoint:Subscriptions-ListSubscriptionEvents). + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription_events: + type: optional> + docs: The retrieved subscription events. + cursor: + type: optional + docs: >- + When the total number of resulting subscription events exceeds the + limit of a paged response, + + the response includes a cursor for you to use in a subsequent request + to fetch the next set of events. + + If the cursor is unset, the response contains the last page of the + results. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListTeamMemberBookingProfilesResponse: + properties: + team_member_booking_profiles: + type: optional> + docs: >- + The list of team member booking profiles. The results are returned in + the ascending order of the time + + when the team member booking profiles were last updated. Multiple + booking profiles updated at the same time + + are further sorted in the ascending order of their IDs. + cursor: + type: optional + docs: >- + The pagination cursor to be used in the subsequent request to get the + next page of the results. Stop retrieving the next page of the results + when the cursor is not set. + validation: + maxLength: 65536 + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListTeamMemberWagesResponse: + docs: >- + The response to a request for a set of `TeamMemberWage` objects. The + response contains + + a set of `TeamMemberWage` objects. + properties: + team_member_wages: + type: optional> + docs: A page of `TeamMemberWage` results. + cursor: + type: optional + docs: |- + The value supplied in the subsequent request to fetch the next page + of `TeamMemberWage` results. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListTransactionsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [ListTransactions](api-endpoint:Transactions-ListTransactions) endpoint. + + + One of `errors` or `transactions` is present in a given response (never + both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + transactions: + type: optional> + docs: An array of transactions that match your query. + cursor: + type: optional + docs: >- + A pagination cursor for retrieving the next set of results, + + if any remain. Provide this value as the `cursor` parameter in a + subsequent + + request to this endpoint. + + + See [Paginating + results](https://developer.squareup.com/docs/working-with-apis/pagination) + for more information. + source: + openapi: openapi/openapi.json + ListWebhookEventTypesResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [ListWebhookEventTypes](api-endpoint:WebhookSubscriptions-ListWebhookEventTypes) + endpoint. + + + Note: if there are errors processing the request, the event types field + will not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + event_types: + type: optional> + docs: The list of event types. + metadata: + type: optional> + docs: >- + Contains the metadata of a webhook event type. For more information, + see [EventTypeMetadata](entity:EventTypeMetadata). + source: + openapi: openapi/openapi.json + ListWebhookSubscriptionsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [ListWebhookSubscriptions](api-endpoint:WebhookSubscriptions-ListWebhookSubscriptions) + endpoint. + + + Note: if there are errors processing the request, the subscriptions field + will not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + subscriptions: + type: optional> + docs: The requested list of [Subscription](entity:WebhookSubscription)s. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListWorkweekConfigsResponse: + docs: >- + The response to a request for a set of `WorkweekConfig` objects. The + response contains + + the requested `WorkweekConfig` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + workweek_configs: + type: optional> + docs: A page of `WorkweekConfig` results. + cursor: + type: optional + docs: |- + The value supplied in the subsequent request to fetch the next page of + `WorkweekConfig` results. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + Location: + docs: >- + Represents one of a business' + [locations](https://developer.squareup.com/docs/locations-api). + properties: + id: + type: optional + docs: >- + A short generated string of letters and numbers that uniquely + identifies this location instance. + validation: + maxLength: 32 + access: read-only + name: + type: optional> + docs: |- + The name of the location. + This information appears in the Seller Dashboard as the nickname. + A location name must be unique within a seller account. + validation: + maxLength: 255 + address: + type: optional
+ docs: The physical address of the location. + timezone: + type: optional> + docs: |- + The [IANA time zone](https://www.iana.org/time-zones) identifier for + the time zone of the location. For example, `America/Los_Angeles`. + validation: + maxLength: 30 + capabilities: + type: optional> + docs: >- + The Square features that are enabled for the location. + + See [LocationCapability](entity:LocationCapability) for possible + values. + + See [LocationCapability](#type-locationcapability) for possible values + access: read-only + status: + type: optional + docs: |- + The status of the location. + See [LocationStatus](#type-locationstatus) for possible values + created_at: + type: optional + docs: >- + The time when the location was created, in RFC 3339 format. + + For more information, see [Working with + Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). + validation: + minLength: 20 + maxLength: 25 + access: read-only + merchant_id: + type: optional + docs: The ID of the merchant that owns the location. + validation: + maxLength: 32 + access: read-only + country: + type: optional + docs: >- + The country of the location, in the two-letter format of ISO 3166. For + example, `US` or `JP`. + + + See [Country](entity:Country) for possible values. + + See [Country](#type-country) for possible values + language_code: + type: optional> + docs: >- + The language associated with the location, in + + [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). + + For more information, see [Language + Preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences). + validation: + minLength: 2 + maxLength: 5 + currency: + type: optional + docs: >- + The currency used for all transactions at this location, + + in ISO 4217 format. For example, the currency code for US dollars is + `USD`. + + See [Currency](entity:Currency) for possible values. + + See [Currency](#type-currency) for possible values + phone_number: + type: optional> + docs: The phone number of the location. For example, `+1 855-700-6000`. + validation: + maxLength: 17 + business_name: + type: optional> + docs: >- + The name of the location's overall business. This name is present on + receipts and other customer-facing branding, and can be changed no + more than three times in a twelve-month period. + validation: + maxLength: 255 + type: + type: optional + docs: |- + The type of the location. + See [LocationType](#type-locationtype) for possible values + website_url: + type: optional> + docs: The website URL of the location. For example, `https://squareup.com`. + validation: + maxLength: 255 + business_hours: + type: optional + docs: The hours of operation for the location. + business_email: + type: optional> + docs: >- + The email address of the location. This can be unique to the location + and is not always the email address for the business owner or + administrator. + validation: + maxLength: 255 + description: + type: optional> + docs: The description of the location. For example, `Main Street location`. + validation: + maxLength: 1024 + twitter_username: + type: optional> + docs: >- + The Twitter username of the location without the '@' symbol. For + example, `Square`. + validation: + minLength: 1 + maxLength: 15 + instagram_username: + type: optional> + docs: >- + The Instagram username of the location without the '@' symbol. For + example, `square`. + validation: + minLength: 1 + maxLength: 30 + facebook_url: + type: optional> + docs: >- + The Facebook profile URL of the location. The URL should begin with + 'facebook.com/'. For example, `https://www.facebook.com/square`. + validation: + maxLength: 255 + coordinates: + type: optional + docs: The physical coordinates (latitude and longitude) of the location. + logo_url: + type: optional + docs: >- + The URL of the logo image for the location. When configured in the + Seller + + Dashboard (Receipts section), the logo appears on transactions (such + as receipts and invoices) that Square generates on behalf of the + seller. + + This image should have a roughly square (1:1) aspect ratio and should + be at least 200x200 pixels. + validation: + maxLength: 255 + access: read-only + pos_background_url: + type: optional + docs: The URL of the Point of Sale background image for the location. + validation: + maxLength: 255 + access: read-only + mcc: + type: optional> + docs: >- + A four-digit number that describes the kind of goods or services sold + at the location. + + The [merchant category code + (MCC)](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) + of the location as standardized by ISO 18245. + + For example, `5045`, for a location that sells computer goods and + software. + validation: + minLength: 4 + maxLength: 4 + full_format_logo_url: + type: optional + docs: >- + The URL of a full-format logo image for the location. When configured + in the Seller + + Dashboard (Receipts section), the logo appears on transactions (such + as receipts and invoices) that Square generates on behalf of the + seller. + + This image can be wider than it is tall and should be at least + 1280x648 pixels. + access: read-only + tax_ids: + type: optional + docs: The tax IDs for this location. + source: + openapi: openapi/openapi.json + LocationBookingProfile: + docs: >- + The booking profile of a seller's location, including the location's ID + and whether the location is enabled for online booking. + properties: + location_id: + type: optional> + docs: The ID of the [location](entity:Location). + booking_site_url: + type: optional> + docs: Url for the online booking site for this location. + online_booking_enabled: + type: optional> + docs: Indicates whether the location is enabled for online booking. + source: + openapi: openapi/openapi.json + LocationCapability: + enum: + - CREDIT_CARD_PROCESSING + - AUTOMATIC_TRANSFERS + - UNLINKED_REFUNDS + docs: The capabilities a location might have. + source: + openapi: openapi/openapi.json + LocationCreatedEvent: + docs: Published when a [Location](entity:Location) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the [Location](entity:Location) associated with the event. + type: + type: optional> + docs: The type of event this represents, `"location.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + LocationCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"location"`. + id: + type: optional + docs: ID of the updated [Location](entity:Location). + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionOwnedCreatedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + is created by the subscribing application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.owned.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionOwnedDeletedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is deleted. A custom attribute + definition can only be deleted by + + the application that created it. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionOwnedUpdatedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is updated. A custom attribute + definition can only be updated + + by the application that created it. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionVisibleCreatedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is created. A notification + is sent when your application + + creates a custom attribute definition or another application creates a + custom attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.visible.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionVisibleDeletedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is deleted. A custom + attribute definition can only + + be deleted by the application that created it. A notification is sent when + your application deletes + + a custom attribute definition or when another application deletes a custom + attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionVisibleUpdatedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is updated. A custom + attribute definition can only be updated + + by the application that created it. A notification is sent when your + application updates a custom attribute + + definition or when another application updates a custom attribute + definition whose `visibility` is + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeOwnedDeletedEvent: + docs: >- + Published when a location [custom attribute](entity:CustomAttribute) + + owned by the subscribing application is deleted. Custom attributes are + owned by the + + application that created the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). + + Custom attributes whose `visibility` is `VISIBILITY_READ_WRITE_VALUES` can + be deleted by any application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeOwnedUpdatedEvent: + docs: >- + Published when a location [custom attribute](entity:CustomAttribute) owned + by the + + subscribing application is created or updated. Custom attributes are owned + by the application that created + + the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). Custom attributes whose + + `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated + by any application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeVisibleDeletedEvent: + docs: >- + Published when a location [custom attribute](entity:CustomAttribute) that + is visible to the + + subscribing application is deleted. A notification is sent when: + + - Your application deletes a custom attribute owned by your application, + regardless of the `visibility` setting. + + - Any application deletes a custom attribute whose `visibility` is + `VISIBILITY_READ_ONLY` + + or `VISIBILITY_READ_WRITE_VALUES`. + + + Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by + any application, but those set to + + `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the + owner. Custom attributes are owned + + by the application that created the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeVisibleUpdatedEvent: + docs: >- + Published when a location [custom attribute](entity:CustomAttribute) that + is visible + + to the subscribing application is created or updated. A notification is + sent when: + + - Your application creates or updates a custom attribute owned by your + application, regardless of the `visibility` setting. + + - Any application creates or updates a custom attribute whose `visibility` + is `VISIBILITY_READ_ONLY` + + or `VISIBILITY_READ_WRITE_VALUES`. + + + Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or + updated by any application, but those set to + + `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or + updated by the owner. Custom attributes are owned + + by the application that created the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationSettingsUpdatedEvent: + docs: Published when online checkout location settings are updated + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: >- + The type of event this represents, + `"online_checkout.location_settings.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + LocationSettingsUpdatedEventData: + properties: + type: + type: optional> + docs: >- + Name of the updated object’s type, + `"online_checkout.location_settings"`. + id: + type: optional + docs: ID of the updated location settings. + object: + type: optional + docs: An object containing the updated location settings. + source: + openapi: openapi/openapi.json + LocationSettingsUpdatedEventObject: + properties: + location_settings: + type: optional + docs: The updated location settings. + source: + openapi: openapi/openapi.json + LocationStatus: + enum: + - ACTIVE + - INACTIVE + docs: A location's status. + source: + openapi: openapi/openapi.json + LocationType: + enum: + - PHYSICAL + - MOBILE + docs: A location's type. + source: + openapi: openapi/openapi.json + LocationUpdatedEvent: + docs: Published when a [Location](entity:Location) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the [Location](entity:Location) associated with the event. + type: + type: optional> + docs: The type of event this represents, `"location.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + LocationUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"location"`. + id: + type: optional + docs: ID of the updated [Location](entity:Location). + source: + openapi: openapi/openapi.json + LoyaltyAccount: + docs: >- + Describes a loyalty account in a [loyalty program](entity:LoyaltyProgram). + For more information, see + + [Create and Retrieve Loyalty + Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). + properties: + id: + type: optional + docs: The Square-assigned ID of the loyalty account. + validation: + maxLength: 36 + access: read-only + program_id: + type: string + docs: >- + The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram) + to which the account belongs. + validation: + minLength: 1 + maxLength: 36 + balance: + type: optional + docs: >- + The available point balance in the loyalty account. If points are + scheduled to expire, they are listed in the `expiring_point_deadlines` + field. + + + Your application should be able to handle loyalty accounts that have a + negative point balance (`balance` is less than 0). This might occur if + a seller makes a manual adjustment or as a result of a refund or + exchange. + access: read-only + lifetime_points: + type: optional + docs: The total points accrued during the lifetime of the account. + access: read-only + customer_id: + type: optional> + docs: >- + The Square-assigned ID of the [customer](entity:Customer) that is + associated with the account. + enrolled_at: + type: optional> + docs: >- + The timestamp when the buyer joined the loyalty program, in RFC 3339 + format. This field is used to display the **Enrolled On** or **Member + Since** date in first-party Square products. + + + If this field is not set in a `CreateLoyaltyAccount` request, Square + populates it after the buyer's first action on their account + + (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). + In first-party flows, Square populates the field when the buyer agrees + to the terms of service 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. + created_at: + type: optional + docs: >- + The timestamp when the loyalty account was created, in RFC 3339 + format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp when the loyalty account was last updated, in RFC 3339 + format. + access: read-only + mapping: + type: optional + docs: >- + The mapping that associates the loyalty account with a buyer. + Currently, + + a loyalty account can only be mapped to a buyer by phone number. + + + To create a loyalty account, you must specify the `mapping` field, + with the buyer's phone number + + in the `phone_number` field. + expiring_point_deadlines: + type: optional>> + docs: >- + The schedule for when points expire in the loyalty account balance. + This field is present only if the account has points that are + scheduled to expire. + + + The total number of points in this field equals the number of points + in the `balance` field. + source: + openapi: openapi/openapi.json + LoyaltyAccountCreatedEvent: + docs: Published when a [loyalty account](entity:LoyaltyAccount) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.account.created`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyAccountCreatedEventData: + docs: The data associated with a `loyalty.account.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_account`. + id: + type: optional + docs: The ID of the affected loyalty account. + object: + type: optional + docs: An object that contains the new loyalty account. + source: + openapi: openapi/openapi.json + LoyaltyAccountCreatedEventObject: + properties: + loyalty_account: + type: optional + docs: The loyalty account that was created. + source: + openapi: openapi/openapi.json + LoyaltyAccountDeletedEvent: + docs: Published when a [loyalty account](entity:LoyaltyAccount) is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.account.deleted`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyAccountDeletedEventData: + docs: The data associated with a `loyalty.account.deleted` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_account`. + id: + type: optional + docs: The ID of the affected loyalty account. + object: + type: optional + docs: An object that contains the loyalty account that was deleted. + source: + openapi: openapi/openapi.json + LoyaltyAccountDeletedEventObject: + properties: + loyalty_account: + type: optional + docs: The loyalty account that was deleted. + source: + openapi: openapi/openapi.json + LoyaltyAccountExpiringPointDeadline: + docs: >- + Represents a set of points for a loyalty account that are scheduled to + expire on a specific date. + properties: + points: + type: integer + docs: >- + The number of points scheduled to expire at the `expires_at` + timestamp. + expires_at: + type: string + docs: >- + The timestamp of when the points are scheduled to expire, in RFC 3339 + format. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyAccountMapping: + docs: >- + Represents the mapping that associates a loyalty account with a buyer. + + + Currently, a loyalty account can only be mapped to a buyer by phone + number. For more information, see + + [Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). + properties: + id: + type: optional + docs: The Square-assigned ID of the mapping. + validation: + maxLength: 36 + access: read-only + created_at: + type: optional + docs: The timestamp when the mapping was created, in RFC 3339 format. + access: read-only + phone_number: + type: optional> + docs: >- + The phone number of the buyer, in E.164 format. For example, + "+14155551111". + source: + openapi: openapi/openapi.json + LoyaltyAccountMappingType: + type: literal<"PHONE"> + docs: The type of mapping. + LoyaltyAccountUpdatedEvent: + docs: Published when a [loyalty account](entity:LoyaltyAccount) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.account.updated`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyAccountUpdatedEventData: + docs: The data associated with a `loyalty.account.updated` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_account`. + id: + type: optional + docs: The ID of the affected loyalty account. + object: + type: optional + docs: An object that contains the loyalty account that was updated. + source: + openapi: openapi/openapi.json + LoyaltyAccountUpdatedEventObject: + properties: + loyalty_account: + type: optional + docs: The loyalty account that was updated. + source: + openapi: openapi/openapi.json + LoyaltyEvent: + docs: >- + Provides information about a loyalty event. + + For more information, see [Search for Balance-Changing Loyalty + Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events). + properties: + id: + type: optional + docs: The Square-assigned ID of the loyalty event. + validation: + minLength: 1 + access: read-only + type: + type: LoyaltyEventType + docs: |- + The type of the loyalty event. + See [LoyaltyEventType](#type-loyaltyeventtype) for possible values + created_at: + type: optional + docs: The timestamp when the event was created, in RFC 3339 format. + validation: + minLength: 1 + access: read-only + accumulate_points: + type: optional + docs: Provides metadata when the event `type` is `ACCUMULATE_POINTS`. + create_reward: + type: optional + docs: Provides metadata when the event `type` is `CREATE_REWARD`. + redeem_reward: + type: optional + docs: Provides metadata when the event `type` is `REDEEM_REWARD`. + delete_reward: + type: optional + docs: Provides metadata when the event `type` is `DELETE_REWARD`. + adjust_points: + type: optional + docs: Provides metadata when the event `type` is `ADJUST_POINTS`. + loyalty_account_id: + type: optional + docs: >- + The ID of the [loyalty account](entity:LoyaltyAccount) associated with + the event. + validation: + minLength: 1 + maxLength: 36 + access: read-only + location_id: + type: optional + docs: The ID of the [location](entity:Location) where the event occurred. + access: read-only + source: + type: LoyaltyEventSource + docs: |- + Defines whether the event was generated by the Square Point of Sale. + See [LoyaltyEventSource](#type-loyaltyeventsource) for possible values + expire_points: + type: optional + docs: Provides metadata when the event `type` is `EXPIRE_POINTS`. + other_event: + type: optional + docs: Provides metadata when the event `type` is `OTHER`. + accumulate_promotion_points: + type: optional + docs: >- + Provides metadata when the event `type` is + `ACCUMULATE_PROMOTION_POINTS`. + source: + openapi: openapi/openapi.json + LoyaltyEventAccumulatePoints: + docs: Provides metadata when the event `type` is `ACCUMULATE_POINTS`. + properties: + loyalty_program_id: + type: optional + docs: The ID of the [loyalty program](entity:LoyaltyProgram). + validation: + maxLength: 36 + access: read-only + points: + type: optional> + docs: The number of points accumulated by the event. + validation: + min: 1 + order_id: + type: optional> + docs: >- + The ID of the [order](entity:Order) for which the buyer accumulated + the points. + + This field is returned only if the Orders API is used to process + orders. + source: + openapi: openapi/openapi.json + LoyaltyEventAccumulatePromotionPoints: + docs: Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. + properties: + loyalty_program_id: + type: optional + docs: >- + The Square-assigned ID of the [loyalty + program](entity:LoyaltyProgram). + validation: + maxLength: 36 + access: read-only + loyalty_promotion_id: + type: optional + docs: >- + The Square-assigned ID of the [loyalty + promotion](entity:LoyaltyPromotion). + validation: + minLength: 1 + maxLength: 255 + access: read-only + points: + type: optional + docs: The number of points earned by the event. + access: read-only + order_id: + type: optional + docs: >- + The ID of the [order](entity:Order) for which the buyer earned the + promotion points. + + Only applications that use the Orders API to process orders can + trigger this event. + validation: + minLength: 1 + access: read-only + source: + openapi: openapi/openapi.json + LoyaltyEventAdjustPoints: + docs: Provides metadata when the event `type` is `ADJUST_POINTS`. + properties: + loyalty_program_id: + type: optional + docs: >- + The Square-assigned ID of the [loyalty + program](entity:LoyaltyProgram). + validation: + maxLength: 36 + access: read-only + points: + type: integer + docs: The number of points added or removed. + reason: + type: optional> + docs: The reason for the adjustment of points. + validation: + maxLength: 3500 + source: + openapi: openapi/openapi.json + LoyaltyEventCreateReward: + docs: Provides metadata when the event `type` is `CREATE_REWARD`. + properties: + loyalty_program_id: + type: optional + docs: The ID of the [loyalty program](entity:LoyaltyProgram). + validation: + minLength: 1 + maxLength: 36 + access: read-only + reward_id: + type: optional + docs: >- + The Square-assigned ID of the created [loyalty + reward](entity:LoyaltyReward). + + This field is returned only if the event source is `LOYALTY_API`. + validation: + maxLength: 36 + access: read-only + points: + type: optional + docs: The loyalty points used to create the reward. + access: read-only + source: + openapi: openapi/openapi.json + LoyaltyEventCreatedEvent: + docs: Published when a [loyalty event](entity:LoyaltyEvent) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.event.created`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyEventCreatedEventData: + docs: The data associated with a `loyalty.event.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_event`. + id: + type: optional + docs: ID of the affected loyalty event. + object: + type: optional + docs: An object that contains the new loyalty event. + source: + openapi: openapi/openapi.json + LoyaltyEventCreatedEventObject: + properties: + loyalty_event: + type: optional + docs: The loyalty event that was created. + source: + openapi: openapi/openapi.json + LoyaltyEventDateTimeFilter: + docs: Filter events by date time range. + properties: + created_at: + type: TimeRange + docs: The `created_at` date time range used to filter the result. + source: + openapi: openapi/openapi.json + LoyaltyEventDeleteReward: + docs: Provides metadata when the event `type` is `DELETE_REWARD`. + properties: + loyalty_program_id: + type: optional + docs: The ID of the [loyalty program](entity:LoyaltyProgram). + validation: + minLength: 1 + maxLength: 36 + access: read-only + reward_id: + type: optional + docs: |- + The ID of the deleted [loyalty reward](entity:LoyaltyReward). + This field is returned only if the event source is `LOYALTY_API`. + validation: + maxLength: 36 + access: read-only + points: + type: optional + docs: The number of points returned to the loyalty account. + access: read-only + source: + openapi: openapi/openapi.json + LoyaltyEventExpirePoints: + docs: Provides metadata when the event `type` is `EXPIRE_POINTS`. + properties: + loyalty_program_id: + type: optional + docs: >- + The Square-assigned ID of the [loyalty + program](entity:LoyaltyProgram). + validation: + minLength: 1 + maxLength: 36 + access: read-only + points: + type: integer + docs: The number of points expired. + source: + openapi: openapi/openapi.json + LoyaltyEventFilter: + docs: |- + The filtering criteria. If the request specifies multiple filters, + the endpoint uses a logical AND to evaluate them. + properties: + loyalty_account_filter: + type: optional + docs: Filter events by loyalty account. + type_filter: + type: optional + docs: Filter events by event type. + date_time_filter: + type: optional + docs: |- + Filter events by date time range. + For each range, the start time is inclusive and the end time + is exclusive. + location_filter: + type: optional + docs: Filter events by location. + order_filter: + type: optional + docs: Filter events by the order associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyEventLocationFilter: + docs: Filter events by location. + properties: + location_ids: + docs: |- + The [location](entity:Location) IDs for loyalty events to query. + If multiple values are specified, the endpoint uses + a logical OR to combine them. + type: list + source: + openapi: openapi/openapi.json + LoyaltyEventLoyaltyAccountFilter: + docs: Filter events by loyalty account. + properties: + loyalty_account_id: + type: string + docs: >- + The ID of the [loyalty account](entity:LoyaltyAccount) associated with + loyalty events. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyEventOrderFilter: + docs: Filter events by the order associated with the event. + properties: + order_id: + type: string + docs: The ID of the [order](entity:Order) associated with the event. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyEventOther: + docs: Provides metadata when the event `type` is `OTHER`. + properties: + loyalty_program_id: + type: optional + docs: >- + The Square-assigned ID of the [loyalty + program](entity:LoyaltyProgram). + validation: + minLength: 1 + maxLength: 36 + access: read-only + points: + type: integer + docs: The number of points added or removed. + source: + openapi: openapi/openapi.json + LoyaltyEventQuery: + docs: Represents a query used to search for loyalty events. + properties: + filter: + type: optional + docs: The query filter criteria. + source: + openapi: openapi/openapi.json + LoyaltyEventRedeemReward: + docs: Provides metadata when the event `type` is `REDEEM_REWARD`. + properties: + loyalty_program_id: + type: optional + docs: The ID of the [loyalty program](entity:LoyaltyProgram). + validation: + minLength: 1 + maxLength: 36 + access: read-only + reward_id: + type: optional + docs: |- + The ID of the redeemed [loyalty reward](entity:LoyaltyReward). + This field is returned only if the event source is `LOYALTY_API`. + validation: + maxLength: 36 + access: read-only + order_id: + type: optional + docs: >- + The ID of the [order](entity:Order) that redeemed the reward. + + This field is returned only if the Orders API is used to process + orders. + access: read-only + source: + openapi: openapi/openapi.json + LoyaltyEventSource: + enum: + - SQUARE + - LOYALTY_API + docs: Defines whether the event was generated by the Square Point of Sale. + source: + openapi: openapi/openapi.json + LoyaltyEventType: + enum: + - ACCUMULATE_POINTS + - CREATE_REWARD + - REDEEM_REWARD + - DELETE_REWARD + - ADJUST_POINTS + - EXPIRE_POINTS + - OTHER + - ACCUMULATE_PROMOTION_POINTS + docs: The type of the loyalty event. + source: + openapi: openapi/openapi.json + LoyaltyEventTypeFilter: + docs: Filter events by event type. + properties: + types: + docs: |- + The loyalty event types used to filter the result. + If multiple values are specified, the endpoint uses a + logical OR to combine them. + See [LoyaltyEventType](#type-loyaltyeventtype) for possible values + type: list + source: + openapi: openapi/openapi.json + LoyaltyProgram: + docs: >- + Represents a Square loyalty program. Loyalty programs define how buyers + can earn points and redeem points for rewards. + + Square sellers can have only one loyalty program, which is created and + managed from the Seller Dashboard. + + For more information, see [Loyalty Program + Overview](https://developer.squareup.com/docs/loyalty/overview). + properties: + id: + type: optional + docs: |- + The Square-assigned ID of the loyalty program. Updates to + the loyalty program do not modify the identifier. + validation: + maxLength: 36 + access: read-only + status: + type: optional + docs: >- + Whether the program is currently active. + + See [LoyaltyProgramStatus](#type-loyaltyprogramstatus) for possible + values + reward_tiers: + type: optional>> + docs: The list of rewards for buyers, sorted by ascending points. + expiration_policy: + type: optional + docs: If present, details for how points expire. + terminology: + type: optional + docs: A cosmetic name for the “points” currency. + location_ids: + type: optional>> + docs: The [locations](entity:Location) at which the program is active. + created_at: + type: optional + docs: The timestamp when the program was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the reward was last updated, in RFC 3339 format. + access: read-only + accrual_rules: + type: optional>> + docs: >- + Defines how buyers can earn loyalty points from the base loyalty + program. + + To check for associated [loyalty promotions](entity:LoyaltyPromotion) + that enable + + buyers to earn extra points, call + [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions). + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRule: + docs: >- + Represents an accrual rule, which defines how buyers can earn points from + the base [loyalty program](entity:LoyaltyProgram). + properties: + accrual_type: + type: LoyaltyProgramAccrualRuleType + docs: >- + The type of the accrual rule that defines how buyers can earn points. + + See + [LoyaltyProgramAccrualRuleType](#type-loyaltyprogramaccrualruletype) + for possible values + points: + type: optional> + docs: |- + The number of points that + buyers earn based on the `accrual_type`. + validation: + min: 1 + visit_data: + type: optional + docs: Additional data for rules with the `VISIT` accrual type. + spend_data: + type: optional + docs: Additional data for rules with the `SPEND` accrual type. + item_variation_data: + type: optional + docs: Additional data for rules with the `ITEM_VARIATION` accrual type. + category_data: + type: optional + docs: Additional data for rules with the `CATEGORY` accrual type. + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleCategoryData: + docs: Represents additional data for rules with the `CATEGORY` accrual type. + properties: + category_id: + type: string + docs: >- + The ID of the `CATEGORY` [catalog object](entity:CatalogObject) that + buyers can purchase to earn + + points. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleItemVariationData: + docs: >- + Represents additional data for rules with the `ITEM_VARIATION` accrual + type. + properties: + item_variation_id: + type: string + docs: >- + The ID of the `ITEM_VARIATION` [catalog object](entity:CatalogObject) + that buyers can purchase to earn + + points. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleSpendData: + docs: Represents additional data for rules with the `SPEND` accrual type. + properties: + amount_money: + type: Money + docs: >- + The amount that buyers must spend to earn points. + + For example, given an "Earn 1 point for every $10 spent" accrual rule, + a buyer who spends $105 earns 10 points. + excluded_category_ids: + type: optional>> + docs: >- + The IDs of any `CATEGORY` catalog objects that are excluded from + points accrual. + + + You can use the + [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) + + endpoint to retrieve information about the excluded categories. + excluded_item_variation_ids: + type: optional>> + docs: >- + The IDs of any `ITEM_VARIATION` catalog objects that are excluded from + points accrual. + + + You can use the + [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) + + endpoint to retrieve information about the excluded item variations. + tax_mode: + type: LoyaltyProgramAccrualRuleTaxMode + docs: >- + Indicates how taxes should be treated when calculating the purchase + amount used for points accrual. + + See + [LoyaltyProgramAccrualRuleTaxMode](#type-loyaltyprogramaccrualruletaxmode) + for possible values + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleTaxMode: + enum: + - BEFORE_TAX + - AFTER_TAX + docs: >- + Indicates how taxes should be treated when calculating the purchase amount + used for loyalty points accrual. + + This setting applies only to `SPEND` accrual rules or `VISIT` accrual + rules that have a minimum spend requirement. + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleType: + enum: + - VISIT + - SPEND + - ITEM_VARIATION + - CATEGORY + docs: The type of the accrual rule that defines how buyers can earn points. + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleVisitData: + docs: Represents additional data for rules with the `VISIT` accrual type. + properties: + minimum_amount_money: + type: optional + docs: The minimum purchase required during the visit to quality for points. + tax_mode: + type: LoyaltyProgramAccrualRuleTaxMode + docs: >- + Indicates how taxes should be treated when calculating the purchase + amount to determine whether the visit qualifies for points. + + This setting applies only if `minimum_amount_money` is specified. + + See + [LoyaltyProgramAccrualRuleTaxMode](#type-loyaltyprogramaccrualruletaxmode) + for possible values + source: + openapi: openapi/openapi.json + LoyaltyProgramCreatedEvent: + docs: Published when a [loyalty program](entity:LoyaltyProgram) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.program.created`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyProgramCreatedEventData: + docs: The data associated with a `loyalty.program.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_program`. + id: + type: optional + docs: The ID of the created loyalty program. + object: + type: optional + docs: An object that contains the loyalty program that was created. + source: + openapi: openapi/openapi.json + LoyaltyProgramCreatedEventObject: + docs: >- + An object that contains the loyalty program associated with a + `loyalty.program.created` event. + properties: + loyalty_program: + type: optional + docs: The loyalty program that was created. + source: + openapi: openapi/openapi.json + LoyaltyProgramExpirationPolicy: + docs: Describes when the loyalty program expires. + properties: + expiration_duration: + type: string + docs: >- + The number of months before points expire, in `P[n]M` RFC 3339 + duration format. For example, a value of `P12M` represents a duration + of 12 months. + + Points are valid through the last day of the month in which they are + scheduled to expire. For example, with a `P12M` duration, points + earned on July 6, 2020 expire on August 1, 2021. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyProgramRewardTier: + docs: >- + Represents a reward tier in a loyalty program. A reward tier defines how + buyers can redeem points for a reward, such as the number of points + required and the value and scope of the discount. A loyalty program can + offer multiple reward tiers. + properties: + id: + type: optional + docs: The Square-assigned ID of the reward tier. + validation: + maxLength: 36 + access: read-only + points: + type: integer + docs: The points exchanged for the reward tier. + validation: + min: 1 + name: + type: optional + docs: The name of the reward tier. + access: read-only + created_at: + type: optional + docs: The timestamp when the reward tier was created, in RFC 3339 format. + access: read-only + pricing_rule_reference: + type: CatalogObjectReference + docs: >- + A reference to the specific version of a `PRICING_RULE` catalog object + that contains information about the reward tier discount. + + + Use `object_id` and `catalog_version` with the + [RetrieveCatalogObject](api-endpoint:Catalog-RetrieveCatalogObject) + endpoint + + to get discount details. Make sure to set `include_related_objects` to + true in the request to retrieve all catalog objects + + that define the discount. For more information, see [Getting discount + details for a reward + tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). + source: + openapi: openapi/openapi.json + LoyaltyProgramStatus: + enum: + - INACTIVE + - ACTIVE + docs: Indicates whether the program is currently active. + source: + openapi: openapi/openapi.json + LoyaltyProgramTerminology: + docs: Represents the naming used for loyalty points. + properties: + one: + type: string + docs: A singular unit for a point (for example, 1 point is called 1 star). + validation: + minLength: 1 + other: + type: string + docs: A plural unit for point (for example, 10 points is called 10 stars). + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyProgramUpdatedEvent: + docs: Published when a [loyalty program](entity:LoyaltyProgram) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.program.updated`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyProgramUpdatedEventData: + docs: The data associated with a `loyalty.program.updated` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_program`. + id: + type: optional + docs: The ID of the affected loyalty program. + object: + type: optional + docs: An object that contains the loyalty program that was updated. + source: + openapi: openapi/openapi.json + LoyaltyProgramUpdatedEventObject: + docs: >- + An object that contains the loyalty program associated with a + `loyalty.program.updated` event. + properties: + loyalty_program: + type: optional + docs: The loyalty program that was updated. + source: + openapi: openapi/openapi.json + LoyaltyPromotion: + docs: >- + Represents a promotion for a [loyalty program](entity:LoyaltyProgram). + Loyalty promotions enable buyers + + to earn extra points on top of those earned from the base program. + + + A loyalty program can have a maximum of 10 loyalty promotions with an + `ACTIVE` or `SCHEDULED` status. + properties: + id: + type: optional + docs: The Square-assigned ID of the promotion. + validation: + minLength: 1 + maxLength: 255 + access: read-only + name: + type: string + docs: The name of the promotion. + validation: + minLength: 1 + maxLength: 70 + incentive: + type: LoyaltyPromotionIncentive + docs: >- + The points incentive for the promotion. This field defines whether + promotion points + + are earned by multiplying base program points or by adding a specified + number of points. + available_time: + type: LoyaltyPromotionAvailableTimeData + docs: >- + The scheduling information that defines when purchases can qualify to + earn points from an `ACTIVE` promotion. + trigger_limit: + type: optional + docs: >- + The number of times a buyer can earn promotion points during a + specified interval. + + If not specified, buyers can trigger the promotion an unlimited number + of times. + status: + type: optional + docs: >- + The current status of the promotion. + + See [LoyaltyPromotionStatus](#type-loyaltypromotionstatus) for + possible values + created_at: + type: optional + docs: The timestamp of when the promotion was created, in RFC 3339 format. + access: read-only + canceled_at: + type: optional + docs: The timestamp of when the promotion was canceled, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the promotion was last updated, in RFC 3339 format. + access: read-only + loyalty_program_id: + type: optional + docs: >- + The ID of the [loyalty program](entity:LoyaltyProgram) associated with + the promotion. + access: read-only + minimum_spend_amount_money: + type: optional + docs: >- + The minimum purchase amount required to earn promotion points. If + specified, this amount is positive. + qualifying_item_variation_ids: + type: optional>> + docs: >- + The IDs of any qualifying `ITEM_VARIATION` [catalog + objects](entity:CatalogObject). If specified, + + the purchase must include at least one of these items to qualify for + the promotion. + + + This option is valid only if the base loyalty program uses a `VISIT` + or `SPEND` accrual rule. + + With `SPEND` accrual rules, make sure that qualifying promotional + items are not excluded. + + + You can specify `qualifying_item_variation_ids` or + `qualifying_category_ids` for a given promotion, but not both. + qualifying_category_ids: + type: optional>> + docs: >- + The IDs of any qualifying `CATEGORY` [catalog + objects](entity:CatalogObject). If specified, + + the purchase must include at least one item from one of these + categories to qualify for the promotion. + + + This option is valid only if the base loyalty program uses a `VISIT` + or `SPEND` accrual rule. + + With `SPEND` accrual rules, make sure that qualifying promotional + items are not excluded. + + + You can specify `qualifying_category_ids` or + `qualifying_item_variation_ids` for a promotion, but not both. + source: + openapi: openapi/openapi.json + LoyaltyPromotionAvailableTimeData: + docs: >- + Represents scheduling information that determines when purchases can + qualify to earn points + + from a [loyalty promotion](entity:LoyaltyPromotion). + properties: + start_date: + type: optional + docs: >- + The date that the promotion starts, in `YYYY-MM-DD` format. Square + populates this field + + based on the provided `time_periods`. + access: read-only + end_date: + type: optional + docs: >- + The date that the promotion ends, in `YYYY-MM-DD` format. Square + populates this field + + based on the provided `time_periods`. If an end date is not specified, + an `ACTIVE` promotion + + remains available until it is canceled. + access: read-only + time_periods: + docs: >- + A list of [iCalendar (RFC 5545) + events](https://tools.ietf.org/html/rfc5545#section-3.6.1) + + (`VEVENT`). Each event represents an available time period per day or + days of the week. + + A day can have a maximum of one available time period. + + + Only `DTSTART`, `DURATION`, and `RRULE` are supported. `DTSTART` and + `DURATION` are required and + + timestamps must be in local (unzoned) time format. Include `RRULE` to + specify recurring promotions, + + an end date (using the `UNTIL` keyword), or both. For more + information, see + + [Available + time](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#available-time). + + + Note that `BEGIN:VEVENT` and `END:VEVENT` are optional in a + `CreateLoyaltyPromotion` request + + but are always included in the response. + type: list + source: + openapi: openapi/openapi.json + LoyaltyPromotionCreatedEvent: + docs: Published when a [loyalty promotion](entity:LoyaltyPromotion) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.promotion.created`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyPromotionCreatedEventData: + docs: The data associated with a `loyalty.promotion.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_promotion`. + id: + type: optional + docs: The ID of the affected loyalty promotion. + object: + type: optional + docs: An object that contains the loyalty promotion that was created. + source: + openapi: openapi/openapi.json + LoyaltyPromotionCreatedEventObject: + docs: >- + An object that contains the loyalty promotion associated with a + `loyalty.promotion.created` event. + properties: + loyalty_promotion: + type: optional + docs: The loyalty promotion that was created. + source: + openapi: openapi/openapi.json + LoyaltyPromotionIncentive: + docs: >- + Represents how points for a [loyalty promotion](entity:LoyaltyPromotion) + are calculated, + + either by multiplying the points earned from the base program or by adding + a specified number + + of points to the points earned from the base program. + properties: + type: + type: LoyaltyPromotionIncentiveType + docs: >- + The type of points incentive. + + See + [LoyaltyPromotionIncentiveType](#type-loyaltypromotionincentivetype) + for possible values + points_multiplier_data: + type: optional + docs: Additional data for a `POINTS_MULTIPLIER` incentive type. + points_addition_data: + type: optional + docs: Additional data for a `POINTS_ADDITION` incentive type. + source: + openapi: openapi/openapi.json + LoyaltyPromotionIncentivePointsAdditionData: + docs: >- + Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion + incentive](entity:LoyaltyPromotionIncentive). + properties: + points_addition: + type: integer + docs: >- + The number of additional points to earn each time the promotion is + triggered. For example, + + suppose a purchase qualifies for 5 points from the base loyalty + program. If the purchase also + + qualifies for a `POINTS_ADDITION` promotion incentive with a + `points_addition` of 3, the buyer + + earns a total of 8 points (5 program points + 3 promotion points = 8 + points). + validation: + min: 1 + source: + openapi: openapi/openapi.json + LoyaltyPromotionIncentivePointsMultiplierData: + docs: >- + Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty + promotion incentive](entity:LoyaltyPromotionIncentive). + properties: + points_multiplier: + type: optional> + docs: >- + The multiplier used to calculate the number of points earned each time + the promotion + + is triggered. For example, suppose a purchase qualifies for 5 points + from the base loyalty program. + + If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion + incentive with a `points_multiplier` + + of 3, the buyer earns a total of 15 points (5 program points x 3 + promotion multiplier = 15 points). + + + DEPRECATED at version 2023-08-16. Replaced by the `multiplier` field. + + + One of the following is required when specifying a points multiplier: + + - (Recommended) The `multiplier` field. + + - This deprecated `points_multiplier` field. If provided in the + request, Square also returns `multiplier` + + with the equivalent value. + validation: + min: 2 + max: 10 + multiplier: + type: optional> + docs: >- + The multiplier used to calculate the number of points earned each time + the promotion is triggered, + + specified as a string representation of a decimal. Square supports + multipliers up to 10x, with three + + point precision for decimal multipliers. For example, suppose a + purchase qualifies for 4 points from the + + base loyalty program. If the purchase also qualifies for a + `POINTS_MULTIPLIER` promotion incentive with a + + `multiplier` of "1.5", the buyer earns a total of 6 points (4 program + points x 1.5 promotion multiplier = 6 points). + + Fractional points are dropped. + + + One of the following is required when specifying a points multiplier: + + - (Recommended) This `multiplier` field. + + - The deprecated `points_multiplier` field. If provided in the + request, Square also returns `multiplier` + + with the equivalent value. + validation: + maxLength: 5 + source: + openapi: openapi/openapi.json + LoyaltyPromotionIncentiveType: + enum: + - POINTS_MULTIPLIER + - POINTS_ADDITION + docs: >- + Indicates the type of points incentive for a [loyalty + promotion](entity:LoyaltyPromotion), + + which is used to determine how buyers can earn points from the promotion. + source: + openapi: openapi/openapi.json + LoyaltyPromotionStatus: + enum: + - ACTIVE + - ENDED + - CANCELED + - SCHEDULED + docs: Indicates the status of a [loyalty promotion](entity:LoyaltyPromotion). + source: + openapi: openapi/openapi.json + LoyaltyPromotionTriggerLimit: + docs: >- + Represents the number of times a buyer can earn points during a [loyalty + promotion](entity:LoyaltyPromotion). + + If this field is not set, buyers can trigger the promotion an unlimited + number of times to earn points during + + the time that the promotion is available. + + + A purchase that is disqualified from earning points because of this limit + might qualify for another active promotion. + properties: + times: + type: integer + docs: >- + The maximum number of times a buyer can trigger the promotion during + the specified `interval`. + validation: + min: 1 + max: 30 + interval: + type: optional + docs: >- + The time period the limit applies to. + + See + [LoyaltyPromotionTriggerLimitInterval](#type-loyaltypromotiontriggerlimitinterval) + for possible values + source: + openapi: openapi/openapi.json + LoyaltyPromotionTriggerLimitInterval: + enum: + - ALL_TIME + - DAY + docs: >- + Indicates the time period that the [trigger + limit](entity:LoyaltyPromotionTriggerLimit) applies to, + + which is used to determine the number of times a buyer can earn points for + a [loyalty promotion](entity:LoyaltyPromotion). + source: + openapi: openapi/openapi.json + LoyaltyPromotionUpdatedEvent: + docs: >- + Published when a [loyalty promotion](entity:LoyaltyPromotion) is updated. + This event is + + invoked only when a loyalty promotion is canceled. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.promotion.updated`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyPromotionUpdatedEventData: + docs: The data associated with a `loyalty.promotion.updated` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_promotion`. + id: + type: optional + docs: The ID of the affected loyalty promotion. + object: + type: optional + docs: An object that contains the loyalty promotion that was updated. + source: + openapi: openapi/openapi.json + LoyaltyPromotionUpdatedEventObject: + docs: >- + An object that contains the loyalty promotion associated with a + `loyalty.promotion.updated` event. + properties: + loyalty_promotion: + type: optional + docs: The loyalty promotion that was updated. + source: + openapi: openapi/openapi.json + LoyaltyReward: + docs: >- + Represents a contract to redeem loyalty points for a [reward + tier](entity:LoyaltyProgramRewardTier) discount. Loyalty rewards can be in + an ISSUED, REDEEMED, or DELETED state. + + For more information, see [Manage loyalty + rewards](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards). + properties: + id: + type: optional + docs: The Square-assigned ID of the loyalty reward. + validation: + maxLength: 36 + access: read-only + status: + type: optional + docs: >- + The status of a loyalty reward. + + See [LoyaltyRewardStatus](#type-loyaltyrewardstatus) for possible + values + loyalty_account_id: + type: string + docs: >- + The Square-assigned ID of the [loyalty account](entity:LoyaltyAccount) + to which the reward belongs. + validation: + minLength: 1 + maxLength: 36 + reward_tier_id: + type: string + docs: >- + The Square-assigned ID of the [reward + tier](entity:LoyaltyProgramRewardTier) used to create the reward. + validation: + minLength: 1 + maxLength: 36 + points: + type: optional + docs: The number of loyalty points used for the reward. + validation: + min: 1 + access: read-only + order_id: + type: optional> + docs: >- + The Square-assigned ID of the [order](entity:Order) to which the + reward is attached. + created_at: + type: optional + docs: The timestamp when the reward was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the reward was last updated, in RFC 3339 format. + access: read-only + redeemed_at: + type: optional + docs: The timestamp when the reward was redeemed, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + LoyaltyRewardStatus: + enum: + - ISSUED + - REDEEMED + - DELETED + docs: The status of the loyalty reward. + source: + openapi: openapi/openapi.json + MeasurementUnit: + docs: >- + Represents a unit of measurement to use with a quantity, such as ounces + + or inches. Exactly one of the following fields are required: + `custom_unit`, + + `area_unit`, `length_unit`, `volume_unit`, and `weight_unit`. + properties: + custom_unit: + type: optional + docs: >- + A custom unit of measurement defined by the seller using the Point of + Sale + + app or ad-hoc as an order line item. + area_unit: + type: optional + docs: >- + Represents a standard area unit. + + See [MeasurementUnitArea](#type-measurementunitarea) for possible + values + length_unit: + type: optional + docs: >- + Represents a standard length unit. + + See [MeasurementUnitLength](#type-measurementunitlength) for possible + values + volume_unit: + type: optional + docs: >- + Represents a standard volume unit. + + See [MeasurementUnitVolume](#type-measurementunitvolume) for possible + values + weight_unit: + type: optional + docs: >- + Represents a standard unit of weight or mass. + + See [MeasurementUnitWeight](#type-measurementunitweight) for possible + values + generic_unit: + type: optional + docs: >- + Reserved for API integrations that lack the ability to specify a real + measurement unit + + See [MeasurementUnitGeneric](#type-measurementunitgeneric) for + possible values + time_unit: + type: optional + docs: >- + Represents a standard unit of time. + + See [MeasurementUnitTime](#type-measurementunittime) for possible + values + type: + type: optional + docs: >- + Represents the type of the measurement unit. + + See [MeasurementUnitUnitType](#type-measurementunitunittype) for + possible values + source: + openapi: openapi/openapi.json + MeasurementUnitArea: + enum: + - IMPERIAL_ACRE + - IMPERIAL_SQUARE_INCH + - IMPERIAL_SQUARE_FOOT + - IMPERIAL_SQUARE_YARD + - IMPERIAL_SQUARE_MILE + - METRIC_SQUARE_CENTIMETER + - METRIC_SQUARE_METER + - METRIC_SQUARE_KILOMETER + docs: Unit of area used to measure a quantity. + source: + openapi: openapi/openapi.json + MeasurementUnitCustom: + docs: The information needed to define a custom unit, provided by the seller. + properties: + name: + type: string + docs: The name of the custom unit, for example "bushel". + abbreviation: + type: string + docs: >- + The abbreviation of the custom unit, such as "bsh" (bushel). This + appears + + in the cart for the Point of Sale app, and in reports. + source: + openapi: openapi/openapi.json + MeasurementUnitGeneric: literal<"UNIT"> + MeasurementUnitLength: + enum: + - IMPERIAL_INCH + - IMPERIAL_FOOT + - IMPERIAL_YARD + - IMPERIAL_MILE + - METRIC_MILLIMETER + - METRIC_CENTIMETER + - METRIC_METER + - METRIC_KILOMETER + docs: The unit of length used to measure a quantity. + source: + openapi: openapi/openapi.json + MeasurementUnitTime: + enum: + - GENERIC_MILLISECOND + - GENERIC_SECOND + - GENERIC_MINUTE + - GENERIC_HOUR + - GENERIC_DAY + docs: Unit of time used to measure a quantity (a duration). + source: + openapi: openapi/openapi.json + MeasurementUnitUnitType: + enum: + - TYPE_CUSTOM + - TYPE_AREA + - TYPE_LENGTH + - TYPE_VOLUME + - TYPE_WEIGHT + - TYPE_GENERIC + docs: >- + Describes the type of this unit and indicates which field contains the + unit information. This is an ‘open’ enum. + source: + openapi: openapi/openapi.json + MeasurementUnitVolume: + enum: + - GENERIC_FLUID_OUNCE + - GENERIC_SHOT + - GENERIC_CUP + - GENERIC_PINT + - GENERIC_QUART + - GENERIC_GALLON + - IMPERIAL_CUBIC_INCH + - IMPERIAL_CUBIC_FOOT + - IMPERIAL_CUBIC_YARD + - METRIC_MILLILITER + - METRIC_LITER + docs: The unit of volume used to measure a quantity. + source: + openapi: openapi/openapi.json + MeasurementUnitWeight: + enum: + - IMPERIAL_WEIGHT_OUNCE + - IMPERIAL_POUND + - IMPERIAL_STONE + - METRIC_MILLIGRAM + - METRIC_GRAM + - METRIC_KILOGRAM + docs: Unit of weight used to measure a quantity. + source: + openapi: openapi/openapi.json + Merchant: + docs: Represents a business that sells with Square. + properties: + id: + type: optional + docs: The Square-issued ID of the merchant. + business_name: + type: optional> + docs: The name of the merchant's overall business. + country: + type: Country + docs: >- + The country code associated with the merchant, in the two-letter + format of ISO 3166. For example, `US` or `JP`. + + See [Country](#type-country) for possible values + language_code: + type: optional> + docs: >- + The code indicating the [language + preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences) + of the merchant, in [BCP 47 + format](https://tools.ietf.org/html/bcp47#appendix-A). For example, + `en-US` or `fr-CA`. + currency: + type: optional + docs: >- + The currency associated with the merchant, in ISO 4217 format. For + example, the currency code for US dollars is `USD`. + + See [Currency](#type-currency) for possible values + status: + type: optional + docs: |- + The merchant's status. + See [MerchantStatus](#type-merchantstatus) for possible values + main_location_id: + type: optional> + docs: >- + The ID of the [main + `Location`](https://developer.squareup.com/docs/locations-api#about-the-main-location) + for this merchant. + created_at: + type: optional + docs: |- + The time when the merchant was created, in RFC 3339 format. + For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). + access: read-only + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionOwnedCreatedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + is created by the subscribing application. Subscribe to this event to be + notified + + when your application creates a merchant custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.owned.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionOwnedDeletedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + is deleted by the subscribing application. Subscribe to this event to be + notified + + when your application deletes a merchant custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionOwnedUpdatedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + is updated by the subscribing application. Subscribe to this event to be + notified + + when your application updates a merchant custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionVisibleCreatedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is created. A notification + is sent when your application + + creates a custom attribute definition or another application creates a + custom attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.visible.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionVisibleDeletedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is deleted. A notification + is sent when your application + + deletes a custom attribute definition or another application deletes a + custom attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionVisibleUpdatedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is updated. A notification + is sent when your application + + updates a custom attribute definition or another application updates a + custom attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeOwnedDeletedEvent: + docs: >- + Published when a merchant [custom attribute](entity:CustomAttribute) + + associated with a [custom attribute + definition](entity:CustomAttributeDefinition) that is + + owned by the subscribing application is deleted. Subscribe to this event + to be notified + + when your application deletes a merchant custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeOwnedUpdatedEvent: + docs: >- + Published when a merchant [custom attribute](entity:CustomAttribute) + + associated with a [custom attribute + definition](entity:CustomAttributeDefinition) that is + + owned by the subscribing application is updated. Subscribe to this event + to be notified + + when your application updates a merchant custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeVisibleDeletedEvent: + docs: >- + Published when a merchant [custom attribute](entity:CustomAttribute) with + + the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is deleted. + + An application that subscribes to this event is notified when a merchant + custom attribute is deleted + + by any application for which the subscribing application has read access + to the merchant custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeVisibleUpdatedEvent: + docs: >- + Published when a merchant [custom attribute](entity:CustomAttribute) with + + the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is updated. + + An application that subscribes to this event is notified when a merchant + custom attribute is updated + + by any application for which the subscribing application has read access + to the merchant custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantSettingsUpdatedEvent: + docs: Published when online checkout merchant settings are updated + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: >- + The type of event this represents, + `"online_checkout.merchant_settings.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + MerchantSettingsUpdatedEventData: + properties: + type: + type: optional> + docs: >- + Name of the updated object’s type, + `"online_checkout.merchant_settings"`. + id: + type: optional + docs: ID of the updated merchant settings. + object: + type: optional + docs: An object containing the updated merchant settings. + source: + openapi: openapi/openapi.json + MerchantSettingsUpdatedEventObject: + properties: + merchant_settings: + type: optional + docs: The updated merchant settings. + source: + openapi: openapi/openapi.json + MerchantStatus: + enum: + - ACTIVE + - INACTIVE + source: + openapi: openapi/openapi.json + ModifierLocationOverrides: + docs: >- + Location-specific overrides for specified properties of a + `CatalogModifier` object. + properties: + location_id: + type: optional> + docs: >- + The ID of the `Location` object representing the location. This can + include a deactivated location. + price_money: + type: optional + docs: >- + The overridden price at the specified location. If this is + unspecified, the modifier price is not overridden. + + The modifier becomes free of charge at the specified location, when + this `price_money` field is set to 0. + sold_out: + type: optional + docs: >- + Indicates whether the modifier is sold out at the specified location + or not. As an example, for cheese (modifier) burger (item), when the + modifier is sold out, it is the cheese, but not the burger, that is + sold out. + + The seller can manually set this sold out status. Attempts by an + application to set this attribute are ignored. + access: read-only + source: + openapi: openapi/openapi.json + Money: + docs: >- + Represents an amount of money. `Money` fields can be signed or unsigned. + + Fields that do not explicitly define whether they are signed or unsigned + are + + considered unsigned and can only hold positive amounts. For signed fields, + the + + sign of the value indicates the purpose of the money transfer. See + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) + + for more information. + properties: + amount: + type: optional> + docs: >- + The amount of money, in the smallest denomination of the currency + + indicated by `currency`. For example, when `currency` is `USD`, + `amount` is + + in cents. Monetary amounts can be positive or negative. See the + specific + + field description to determine the meaning of the sign in a particular + case. + currency: + type: optional + docs: >- + The type of currency, in __ISO 4217 format__. For example, the + currency + + code for US dollars is `USD`. + + + See [Currency](entity:Currency) for possible values. + + See [Currency](#type-currency) for possible values + source: + openapi: openapi/openapi.json + OauthAuthorizationRevokedEvent: + docs: >- + Published when a merchant/application revokes all access tokens and + refresh tokens granted to an application. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"oauth.authorization.revoked"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + OauthAuthorizationRevokedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"revocation"`. + id: + type: optional + docs: Not applicable, revocation is not an object + object: + type: optional + docs: An object containing information about revocation event. + source: + openapi: openapi/openapi.json + OauthAuthorizationRevokedEventObject: + properties: + revocation: + type: optional + docs: The revocation event. + source: + openapi: openapi/openapi.json + OauthAuthorizationRevokedEventRevocationObject: + properties: + revoked_at: + type: optional> + docs: Timestamp of when the revocation event occurred, in RFC 3339 format. + revoker_type: + type: optional + docs: >- + Type of client that performed the revocation, either APPLICATION, + MERCHANT, or SQUARE. + + See + [OauthAuthorizationRevokedEventRevokerType](#type-oauthauthorizationrevokedeventrevokertype) + for possible values + source: + openapi: openapi/openapi.json + OauthAuthorizationRevokedEventRevokerType: + enum: + - APPLICATION + - MERCHANT + - SQUARE + docs: Defines the possible types for the revoking client. + source: + openapi: openapi/openapi.json + ObtainTokenResponse: + docs: Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) response. + properties: + access_token: + type: optional + docs: >- + An OAuth access token used to authorize Square API requests on behalf + of the seller. + + Include this token as a bearer token in the `Authorization` header of + your API requests. + + + OAuth access tokens expire in 30 days (except `short_lived` access + tokens). You should call + + `ObtainToken` and provide the returned `refresh_token` to get a new + access token well before + + the current one expires. For more information, see [OAuth API: + Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough). + validation: + minLength: 2 + maxLength: 1024 + token_type: + type: optional + docs: The type of access token. This value is always `bearer`. + validation: + minLength: 2 + maxLength: 10 + expires_at: + type: optional + docs: >- + The timestamp of when the `access_token` expires, in [ISO + 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. + validation: + minLength: 20 + maxLength: 48 + merchant_id: + type: optional + docs: >- + The ID of the authorizing [merchant](entity:Merchant) (seller), which + represents a business. + validation: + minLength: 8 + maxLength: 191 + subscription_id: + type: optional + docs: >- + __LEGACY__ The ID of merchant's subscription. + + The ID is only present if the merchant signed up for a subscription + plan during authorization. + plan_id: + type: optional + docs: >- + __LEGACY__ The ID of the subscription plan the merchant signed + + up for. The ID is only present if the merchant signed up for a + subscription plan during + + authorization. + id_token: + type: optional + docs: >- + The OpenID token that belongs to this person. This token is only + present if the + + `OPENID` scope is included in the authorization request. + + + Deprecated at version 2021-09-15. Square doesn't support OpenID or + other single sign-on (SSO) + + protocols on top of OAuth. + refresh_token: + type: optional + docs: >- + A refresh token that can be used in an `ObtainToken` request to + generate a new access token. + + + With the code flow: + + - For the `authorization_code` grant type, the refresh token is + multi-use and never expires. + + - For the `refresh_token` grant type, the response returns the same + refresh token. + + + With the PKCE flow: + + - For the `authorization_code` grant type, the refresh token is + single-use and expires in 90 days. + + - For the `refresh_token` grant type, the refresh token is a new + single-use refresh token that expires in 90 days. + + + For more information, see [Refresh, Revoke, and Limit the Scope of + OAuth + Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope). + validation: + minLength: 2 + maxLength: 1024 + short_lived: + type: optional + docs: >- + Indicates whether the access_token is short lived. If `true`, the + access token expires + + in 24 hours. If `false`, the access token expires in 30 days. + errors: + type: optional> + docs: Any errors that occurred during the request. + refresh_token_expires_at: + type: optional + docs: >- + The timestamp of when the `refresh_token` expires, in [ISO + 8601](http://www.iso.org/iso/home/standards/iso8601.htm) + + format. + + + This field is only returned for the PKCE flow. + validation: + minLength: 20 + maxLength: 48 + source: + openapi: openapi/openapi.json + OfflinePaymentDetails: + docs: Details specific to offline payments. + properties: + client_created_at: + type: optional + docs: >- + The client-side timestamp of when the offline payment was created, in + RFC 3339 format. + validation: + maxLength: 32 + access: read-only + source: + openapi: openapi/openapi.json + Order: + docs: >- + Contains all information related to a single order to process with Square, + + including line items that specify the products to purchase. `Order` + objects also + + include information about any associated tenders, refunds, and returns. + + + All Connect V2 Transactions have all been converted to Orders including + all associated + + itemization data. + properties: + id: + type: optional + docs: The order's unique ID. + access: read-only + location_id: + type: string + docs: The ID of the seller location that this order is associated with. + validation: + minLength: 1 + reference_id: + type: optional> + docs: |- + A client-specified ID to associate an entity in another system + with this order. + validation: + maxLength: 40 + source: + type: optional + docs: The origination details of the order. + customer_id: + type: optional> + docs: >- + The ID of the [customer](entity:Customer) associated with the order. + + + You should specify a `customer_id` on the order (or the payment) to + ensure that transactions + + are reliably linked to customers. Omitting this field might result in + the creation of new + + [instant + profiles](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). + validation: + maxLength: 191 + line_items: + type: optional>> + docs: The line items included in the order. + taxes: + type: optional>> + docs: >- + The list of all taxes associated with the order. + + + Taxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with + `LINE_ITEM` scope, an + + `OrderLineItemAppliedTax` must be added to each line item that the tax + applies to. For taxes + + with `ORDER` scope, the server generates an `OrderLineItemAppliedTax` + for every line item. + + + On reads, each tax in the list includes the total amount of that tax + applied to the order. + + + __IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, + using the deprecated + + `line_items.taxes` field results in an error. Use + `line_items.applied_taxes` + + instead. + discounts: + type: optional>> + docs: >- + The list of all discounts associated with the order. + + + Discounts can be scoped to either `ORDER` or `LINE_ITEM`. For + discounts scoped to `LINE_ITEM`, + + an `OrderLineItemAppliedDiscount` must be added to each line item that + the discount applies to. + + For discounts with `ORDER` scope, the server generates an + `OrderLineItemAppliedDiscount` + + for every line item. + + + __IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this + field, using the deprecated + + `line_items.discounts` field results in an error. Use + `line_items.applied_discounts` + + instead. + service_charges: + type: optional>> + docs: A list of service charges applied to the order. + fulfillments: + type: optional>> + docs: >- + Details about order fulfillment. + + + Orders can only be created with at most one fulfillment. However, + orders returned + + by the API might contain multiple fulfillments. + returns: + type: optional> + docs: >- + A collection of items from sale orders being returned in this one. + Normally part of an + + itemized return or exchange. There is exactly one `Return` object per + sale `Order` being + + referenced. + access: read-only + return_amounts: + type: optional + docs: The rollup of the returned money amounts. + net_amounts: + type: optional + docs: The net money amounts (sale money - return money). + rounding_adjustment: + type: optional + docs: >- + A positive rounding adjustment to the total of the order. This + adjustment is commonly + + used to apply cash rounding when the minimum unit of account is + smaller than the lowest physical + + denomination of the currency. + tenders: + type: optional> + docs: The tenders that were used to pay for the order. + access: read-only + refunds: + type: optional> + docs: The refunds that are part of this order. + access: read-only + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this order. Metadata fields are + intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + created_at: + type: optional + docs: >- + The timestamp for when the order was created, at server side, in RFC + 3339 format (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + updated_at: + type: optional + docs: >- + The timestamp for when the order was last updated, at server side, in + RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + closed_at: + type: optional + docs: >- + The timestamp for when the order reached a terminal + [state](entity:OrderState), in RFC 3339 format (for example + "2016-09-04T23:59:33.123Z"). + access: read-only + state: + type: optional + docs: |- + The current state of the order. + See [OrderState](#type-orderstate) for possible values + version: + type: optional + docs: >- + The version number, which is incremented each time an update is + committed to the order. + + Orders not created through the API do not include a version number and + + therefore cannot be updated. + + + [Read more about working with + versions](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders). + total_money: + type: optional + docs: The total amount of money to collect for the order. + total_tax_money: + type: optional + docs: The total amount of tax money to collect for the order. + total_discount_money: + type: optional + docs: The total amount of discount money to collect for the order. + total_tip_money: + type: optional + docs: The total amount of tip money to collect for the order. + total_service_charge_money: + type: optional + docs: >- + The total amount of money collected in service charges for the order. + + + Note: `total_service_charge_money` is the sum of `applied_money` + fields for each individual + + service charge. Therefore, `total_service_charge_money` only includes + inclusive tax amounts, + + not additive tax amounts. + ticket_name: + type: optional> + docs: |- + A short-term identifier for the order (such as a customer first name, + table number, or auto-generated order number that resets daily). + validation: + maxLength: 30 + pricing_options: + type: optional + docs: >- + Pricing options for an order. The options affect how the order's price + is calculated. + + They can be used, for example, to apply automatic price adjustments + that are based on + + preconfigured [pricing rules](entity:CatalogPricingRule). + rewards: + type: optional> + docs: A set-like list of Rewards that have been added to the Order. + access: read-only + net_amount_due_money: + type: optional + docs: The net amount of money due on the order. + source: + openapi: openapi/openapi.json + OrderCreated: + properties: + order_id: + type: optional> + docs: The order's unique ID. + version: + type: optional + docs: >- + The version number, which is incremented each time an update is + committed to the order. + + Orders that were not created through the API do not include a version + number and + + therefore cannot be updated. + + + [Read more about working with + versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) + location_id: + type: optional> + docs: The ID of the seller location that this order is associated with. + state: + type: optional + docs: |- + The state of the order. + See [OrderState](#type-orderstate) for possible values + created_at: + type: optional + docs: The timestamp for when the order was created, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + OrderCreatedEvent: + docs: "Published when an [Order](entity:Order) is created. This event is\ntriggered only by the [CreateOrder](api-endpoint:Orders-CreateOrder) endpoint call.\n\nCreating an order in the Point of Sale\_app will **not** publish this event." + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"order.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + OrderCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"order_created"`. + id: + type: optional + docs: ID of the affected order. + object: + type: optional + docs: An object containing information about the created Order. + source: + openapi: openapi/openapi.json + OrderCreatedObject: + properties: + order_created: + type: optional + docs: Information about the created order. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionOwnedCreatedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is owned by the + subscribing app is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.owned.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionOwnedDeletedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is owned by the + subscribing app is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionOwnedUpdatedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is owned by the + subscribing app is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionVisibleCreatedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is visible to the + subscribing app is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.visible.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionVisibleDeletedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is visible to the + subscribing app is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionVisibleUpdatedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is visible to the + subscribing app is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeOwnedDeletedEvent: + docs: >- + Published when an order [custom attribute](entity:CustomAttribute) + associated with a [custom attribute + definition](entity:CustomAttributeDefinition) that is owned by the + subscribing app is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeOwnedUpdatedEvent: + docs: >- + Published when an order [custom attribute](entity:CustomAttribute) + associated with a [custom attribute + definition](entity:CustomAttributeDefinition) that is owned by the + subscribing app is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeVisibleDeletedEvent: + docs: >- + Published when an order [custom attribute](entity:CustomAttribute) that is + visible to the subscribing app is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeVisibleUpdatedEvent: + docs: >- + Published when an order [custom attribute](entity:CustomAttribute) that is + visible to the subscribing app is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderEntry: + docs: >- + A lightweight description of an [order](entity:Order) that is returned + when + + `returned_entries` is `true` on a + [SearchOrdersRequest](api-endpoint:Orders-SearchOrders). + properties: + order_id: + type: optional> + docs: The ID of the order. + version: + type: optional + docs: >- + The version number, which is incremented each time an update is + committed to the order. + + Orders that were not created through the API do not include a version + number and + + therefore cannot be updated. + + + [Read more about working with + versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) + access: read-only + location_id: + type: optional> + docs: The location ID the order belongs to. + source: + openapi: openapi/openapi.json + OrderFulfillmentDeliveryDetailsScheduleType: + enum: + - SCHEDULED + - ASAP + docs: The schedule type of the delivery fulfillment. + source: + openapi: openapi/openapi.json + OrderFulfillmentFulfillmentLineItemApplication: + enum: + - ALL + - ENTRY_LIST + docs: >- + The `line_item_application` describes what order line items this + fulfillment applies + + to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment + entries. + source: + openapi: openapi/openapi.json + OrderFulfillmentPickupDetailsScheduleType: + enum: + - SCHEDULED + - ASAP + docs: The schedule type of the pickup fulfillment. + source: + openapi: openapi/openapi.json + OrderFulfillmentState: + enum: + - PROPOSED + - RESERVED + - PREPARED + - COMPLETED + - CANCELED + - FAILED + docs: The current state of this fulfillment. + source: + openapi: openapi/openapi.json + OrderFulfillmentType: + enum: + - PICKUP + - SHIPMENT + - DELIVERY + docs: The type of fulfillment. + source: + openapi: openapi/openapi.json + OrderFulfillmentUpdated: + properties: + order_id: + type: optional> + docs: The order's unique ID. + version: + type: optional + docs: >- + The version number, which is incremented each time an update is + committed to the order. + + Orders that were not created through the API do not include a version + number and + + therefore cannot be updated. + + + [Read more about working with + versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) + location_id: + type: optional> + docs: The ID of the seller location that this order is associated with. + state: + type: optional + docs: |- + The state of the order. + See [OrderState](#type-orderstate) for possible values + created_at: + type: optional + docs: The timestamp for when the order was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp for when the order was last updated, in RFC 3339 format. + access: read-only + fulfillment_update: + type: optional>> + docs: The fulfillments that were updated with this version change. + source: + openapi: openapi/openapi.json + OrderFulfillmentUpdatedEvent: + docs: |- + Published when an [OrderFulfillment](entity:OrderFulfillment) + is created or updated. This event is triggered only by the + [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint call. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"order.fulfillment.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + OrderFulfillmentUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"order_fulfillment_updated"`. + id: + type: optional + docs: ID of the affected order. + object: + type: optional + docs: An object containing information about the updated Order. + source: + openapi: openapi/openapi.json + OrderFulfillmentUpdatedObject: + properties: + order_fulfillment_updated: + type: optional + docs: Information about the updated order fulfillment. + source: + openapi: openapi/openapi.json + OrderFulfillmentUpdatedUpdate: + docs: Information about fulfillment updates. + properties: + fulfillment_uid: + type: optional> + docs: A unique ID that identifies the fulfillment only within this order. + old_state: + type: optional + docs: >- + The state of the fulfillment before the change. + + The state is not populated if the fulfillment is created with this new + `Order` version. + new_state: + type: optional + docs: >- + The state of the fulfillment after the change. The state might be + equal to `old_state` if a non-state + + field was changed on the fulfillment (such as the tracking number). + source: + openapi: openapi/openapi.json + OrderLineItem: + docs: |- + Represents a line item in an order. Each line item describes a different + product to purchase, with its own quantity and price details. + properties: + uid: + type: optional> + docs: A unique ID that identifies the line item only within this order. + validation: + maxLength: 60 + name: + type: optional> + docs: The name of the line item. + validation: + maxLength: 512 + quantity: + type: string + docs: >- + The count, or measurement, of a line item being purchased: + + + If `quantity` is a whole number, and `quantity_unit` is not specified, + then `quantity` denotes an item count. For example: `3` apples. + + + If `quantity` is a whole or decimal number, and `quantity_unit` is + also specified, then `quantity` denotes a measurement. For example: + `2.25` pounds of broccoli. + + + For more information, see [Specify item quantity and measurement + unit](https://developer.squareup.com/docs/orders-api/create-orders#specify-item-quantity-and-measurement-unit). + + + Line items with a quantity of `0` are automatically removed + + when paying for or otherwise completing the order. + validation: + minLength: 1 + maxLength: 12 + quantity_unit: + type: optional + docs: >- + The measurement unit and decimal precision that this line item's + quantity is measured in. + note: + type: optional> + docs: An optional note associated with the line item. + validation: + maxLength: 2000 + catalog_object_id: + type: optional> + docs: >- + The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to + this line item. + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this line item references. + variation_name: + type: optional> + docs: The name of the variation applied to this line item. + validation: + maxLength: 400 + item_type: + type: optional + docs: >- + The type of line item: an itemized sale, a non-itemized sale (custom + amount), or the + + activation or reloading of a gift card. + + See [OrderLineItemItemType](#type-orderlineitemitemtype) for possible + values + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this line item. Metadata fields + are intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + modifiers: + type: optional>> + docs: >- + The [CatalogModifier](entity:CatalogModifier)s applied to this line + item. + applied_taxes: + type: optional>> + docs: >- + The list of references to taxes applied to this line item. Each + + `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of + a + + top-level `OrderLineItemTax` applied to the line item. On reads, the + + amount applied is populated. + + + An `OrderLineItemAppliedTax` is automatically created on every line + + item for all `ORDER` scoped taxes added to the order. + `OrderLineItemAppliedTax` + + records for `LINE_ITEM` scoped taxes must be added in requests for the + tax + + to apply to any line items. + + + To change the amount of a tax, modify the referenced top-level tax. + applied_discounts: + type: optional>> + docs: >- + The list of references to discounts applied to this line item. Each + + `OrderLineItemAppliedDiscount` has a `discount_uid` that references + the `uid` of a top-level + + `OrderLineItemDiscounts` applied to the line item. On reads, the + amount + + applied is populated. + + + An `OrderLineItemAppliedDiscount` is automatically created on every + line item for all + + `ORDER` scoped discounts that are added to the order. + `OrderLineItemAppliedDiscount` records + + for `LINE_ITEM` scoped discounts must be added in requests for the + discount to apply to any + + line items. + + + To change the amount of a discount, modify the referenced top-level + discount. + applied_service_charges: + type: optional>> + docs: >- + The list of references to service charges applied to this line item. + Each + + `OrderLineItemAppliedServiceCharge` has a `service_charge_id` that + references the `uid` of a + + top-level `OrderServiceCharge` applied to the line item. On reads, the + amount applied is + + populated. + + + To change the amount of a service charge, modify the referenced + top-level service charge. + base_price_money: + type: optional + docs: The base price for a single unit of the line item. + variation_total_price_money: + type: optional + docs: >- + The total price of all item variations sold in this line item. + + The price is calculated as `base_price_money` multiplied by + `quantity`. + + It does not include modifiers. + gross_sales_money: + type: optional + docs: >- + The amount of money made in gross sales for this line item. + + The amount is calculated as the sum of the variation's total price and + each modifier's total price. + + For inclusive tax items in the US, Canada, and Japan, tax is deducted + from `gross_sales_money`. For Europe and + + Australia, inclusive tax remains as part of the gross sale + calculation. + total_tax_money: + type: optional + docs: The total amount of tax money to collect for the line item. + total_discount_money: + type: optional + docs: The total amount of discount money to collect for the line item. + total_money: + type: optional + docs: The total amount of money to collect for this line item. + pricing_blocklists: + type: optional + docs: >- + Describes pricing adjustments that are blocked from automatic + + application to a line item. For more information, see + + [Apply Taxes and + Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts). + total_service_charge_money: + type: optional + docs: >- + The total amount of apportioned service charge money to collect for + the line item. + source: + openapi: openapi/openapi.json + OrderLineItemAppliedDiscount: + docs: >- + Represents an applied portion of a discount to a line item in an order. + + + Order scoped discounts have automatically applied discounts present for + each line item. + + Line-item scoped discounts must have applied discounts added manually for + any applicable line + + items. The corresponding applied money is automatically computed based on + participating + + line items. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the applied discount only within this + order. + validation: + maxLength: 60 + discount_uid: + type: string + docs: >- + The `uid` of the discount that the applied discount represents. It + must + + reference a discount present in the `order.discounts` field. + + + This field is immutable. To change which discounts apply to a line + item, + + you must delete the discount and re-add it as a new + `OrderLineItemAppliedDiscount`. + validation: + minLength: 1 + maxLength: 60 + applied_money: + type: optional + docs: The amount of money applied by the discount to the line item. + source: + openapi: openapi/openapi.json + OrderLineItemAppliedServiceCharge: + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the applied service charge only within + this order. + validation: + maxLength: 60 + service_charge_uid: + type: string + docs: >- + The `uid` of the service charge that the applied service charge + represents. It must + + reference a service charge present in the `order.service_charges` + field. + + + This field is immutable. To change which service charges apply to a + line item, + + delete and add a new `OrderLineItemAppliedServiceCharge`. + validation: + minLength: 1 + maxLength: 60 + applied_money: + type: optional + docs: The amount of money applied by the service charge to the line item. + source: + openapi: openapi/openapi.json + OrderLineItemAppliedTax: + docs: >- + Represents an applied portion of a tax to a line item in an order. + + + Order-scoped taxes automatically include the applied taxes in each line + item. + + Line item taxes must be referenced from any applicable line items. + + The corresponding applied money is automatically computed, based on the + + set of participating line items. + properties: + uid: + type: optional> + docs: A unique ID that identifies the applied tax only within this order. + validation: + maxLength: 60 + tax_uid: + type: string + docs: >- + The `uid` of the tax for which this applied tax represents. It must + reference + + a tax present in the `order.taxes` field. + + + This field is immutable. To change which taxes apply to a line item, + delete and add a new + + `OrderLineItemAppliedTax`. + validation: + minLength: 1 + maxLength: 60 + applied_money: + type: optional + docs: The amount of money applied by the tax to the line item. + source: + openapi: openapi/openapi.json + OrderLineItemDiscount: + docs: >- + Represents a discount that applies to one or more line items in an + + order. + + + Fixed-amount, order-scoped discounts are distributed across all non-zero + line item totals. + + The amount distributed to each line item is relative to the + + amount contributed by the item to the order subtotal. + properties: + uid: + type: optional> + docs: A unique ID that identifies the discount only within this order. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID referencing + [CatalogDiscount](entity:CatalogDiscount). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this discount references. + name: + type: optional> + docs: The discount's name. + validation: + maxLength: 255 + type: + type: optional + docs: >- + The type of the discount. + + + Discounts that do not reference a catalog object ID must have a type + of + + `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. + + See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for + possible values + percentage: + type: optional> + docs: >- + The percentage of the discount, as a string representation of a + decimal number. + + A value of `7.25` corresponds to a percentage of 7.25%. + + + `percentage` is not set for amount-based discounts. + validation: + maxLength: 10 + amount_money: + type: optional + docs: |- + The total declared monetary amount of the discount. + + `amount_money` is not set for percentage-based discounts. + applied_money: + type: optional + docs: >- + The amount of discount actually applied to the line item. + + + The amount represents the amount of money applied as a line-item + scoped discount. + + When an amount-based discount is scoped to the entire order, the value + + of `applied_money` is different than `amount_money` because the total + + amount of the discount is distributed across all line items. + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this discount. Metadata fields + are intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + scope: + type: optional + docs: >- + Indicates the level at which the discount applies. For `ORDER` scoped + discounts, + + Square generates references in `applied_discounts` on all order line + items that do + + not have them. For `LINE_ITEM` scoped discounts, the discount only + applies to line items + + with a discount reference in their `applied_discounts` field. + + + This field is immutable. To change the scope of a discount, you must + delete + + the discount and re-add it as a new discount. + + See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for + possible values + reward_ids: + type: optional> + docs: >- + The reward IDs corresponding to this discount. The application and + + specification of discounts that have `reward_ids` are completely + controlled by the backing + + criteria corresponding to the reward tiers of the rewards that are + added to the order + + through the Loyalty API. To manually unapply discounts that are the + result of added rewards, + + the rewards must be removed from the order through the Loyalty API. + access: read-only + pricing_rule_id: + type: optional + docs: >- + The object ID of a [pricing rule](entity:CatalogPricingRule) to be + applied + + automatically to this discount. The specification and application of + the discounts, to + + which a `pricing_rule_id` is assigned, are completely controlled by + the corresponding + + pricing rule. + access: read-only + source: + openapi: openapi/openapi.json + OrderLineItemDiscountScope: + enum: + - OTHER_DISCOUNT_SCOPE + - LINE_ITEM + - ORDER + docs: Indicates whether this is a line-item or order-level discount. + source: + openapi: openapi/openapi.json + OrderLineItemDiscountType: + enum: + - UNKNOWN_DISCOUNT + - FIXED_PERCENTAGE + - FIXED_AMOUNT + - VARIABLE_PERCENTAGE + - VARIABLE_AMOUNT + docs: >- + Indicates how the discount is applied to the associated line item or + order. + source: + openapi: openapi/openapi.json + OrderLineItemItemType: + enum: + - ITEM + - CUSTOM_AMOUNT + - GIFT_CARD + docs: Represents the line item type. + source: + openapi: openapi/openapi.json + OrderLineItemModifier: + docs: A [CatalogModifier](entity:CatalogModifier). + properties: + uid: + type: optional> + docs: A unique ID that identifies the modifier only within this order. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID referencing + [CatalogModifier](entity:CatalogModifier). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this modifier references. + name: + type: optional> + docs: The name of the item modifier. + validation: + maxLength: 255 + quantity: + type: optional> + docs: >- + The quantity of the line item modifier. The modifier quantity can be 0 + or more. + + For example, suppose a restaurant offers a cheeseburger on the menu. + When a buyer orders + + this item, the restaurant records the purchase by creating an `Order` + object with a line item + + for a burger. The line item includes a line item modifier: the name is + cheese and the quantity + + is 1. The buyer has the option to order extra cheese (or no cheese). + If the buyer chooses + + the extra cheese option, the modifier quantity increases to 2. If the + buyer does not want + + any cheese, the modifier quantity is set to 0. + base_price_money: + type: optional + docs: >- + The base price for the modifier. + + + `base_price_money` is required for ad hoc modifiers. + + If both `catalog_object_id` and `base_price_money` are set, + `base_price_money` will + + override the predefined [CatalogModifier](entity:CatalogModifier) + price. + total_price_money: + type: optional + docs: >- + The total price of the item modifier for its line item. + + This is the modifier's `base_price_money` multiplied by the line + item's quantity. + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this order. Metadata fields are + intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + source: + openapi: openapi/openapi.json + OrderLineItemPricingBlocklists: + docs: >- + Describes pricing adjustments that are blocked from automatic + + application to a line item. For more information, see + + [Apply Taxes and + Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts). + properties: + blocked_discounts: + type: >- + optional>> + docs: >- + A list of discounts blocked from applying to the line item. + + Discounts can be blocked by the `discount_uid` (for ad hoc discounts) + or + + the `discount_catalog_object_id` (for catalog discounts). + blocked_taxes: + type: optional>> + docs: |- + A list of taxes blocked from applying to the line item. + Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or + the `tax_catalog_object_id` (for catalog taxes). + source: + openapi: openapi/openapi.json + OrderLineItemPricingBlocklistsBlockedDiscount: + docs: >- + A discount to block from applying to a line item. The discount must be + + identified by either `discount_uid` or `discount_catalog_object_id`, but + not both. + properties: + uid: + type: optional> + docs: A unique ID of the `BlockedDiscount` within the order. + validation: + maxLength: 60 + discount_uid: + type: optional> + docs: >- + The `uid` of the discount that should be blocked. Use this field to + block + + ad hoc discounts. For catalog discounts, use the + `discount_catalog_object_id` field. + validation: + maxLength: 60 + discount_catalog_object_id: + type: optional> + docs: >- + The `catalog_object_id` of the discount that should be blocked. + + Use this field to block catalog discounts. For ad hoc discounts, use + the + + `discount_uid` field. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + OrderLineItemPricingBlocklistsBlockedTax: + docs: |- + A tax to block from applying to a line item. The tax must be + identified by either `tax_uid` or `tax_catalog_object_id`, but not both. + properties: + uid: + type: optional> + docs: A unique ID of the `BlockedTax` within the order. + validation: + maxLength: 60 + tax_uid: + type: optional> + docs: >- + The `uid` of the tax that should be blocked. Use this field to block + + ad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` + field. + validation: + maxLength: 60 + tax_catalog_object_id: + type: optional> + docs: |- + The `catalog_object_id` of the tax that should be blocked. + Use this field to block catalog taxes. For ad hoc taxes, use the + `tax_uid` field. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + OrderLineItemTax: + docs: >- + Represents a tax that applies to one or more line item in the order. + + + Fixed-amount, order-scoped taxes are distributed across all non-zero line + item totals. + + The amount distributed to each line item is relative to the amount the + item + + contributes to the order subtotal. + properties: + uid: + type: optional> + docs: A unique ID that identifies the tax only within this order. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: The catalog object ID referencing [CatalogTax](entity:CatalogTax). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this tax references. + name: + type: optional> + docs: The tax's name. + validation: + maxLength: 255 + type: + type: optional + docs: >- + Indicates the calculation method used to apply the tax. + + See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible + values + percentage: + type: optional> + docs: >- + The percentage of the tax, as a string representation of a decimal + + number. For example, a value of `"7.25"` corresponds to a percentage + of + + 7.25%. + validation: + maxLength: 10 + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this tax. Metadata fields are + intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + applied_money: + type: optional + docs: |- + The amount of money applied to the order by the tax. + + - For percentage-based taxes, `applied_money` is the money + calculated using the percentage. + scope: + type: optional + docs: >- + Indicates the level at which the tax applies. For `ORDER` scoped + taxes, + + Square generates references in `applied_taxes` on all order line items + that do + + not have them. For `LINE_ITEM` scoped taxes, the tax only applies to + line items + + with references in their `applied_taxes` field. + + + This field is immutable. To change the scope, you must delete the tax + and + + re-add it as a new tax. + + See [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible + values + auto_applied: + type: optional + docs: >- + Determines whether the tax was automatically applied to the order + based on + + the catalog configuration. For an example, see + + [Automatically Apply Taxes to an + Order](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-taxes). + access: read-only + source: + openapi: openapi/openapi.json + OrderLineItemTaxScope: + enum: + - OTHER_TAX_SCOPE + - LINE_ITEM + - ORDER + docs: Indicates whether this is a line-item or order-level tax. + source: + openapi: openapi/openapi.json + OrderLineItemTaxType: + enum: + - UNKNOWN_TAX + - ADDITIVE + - INCLUSIVE + docs: Indicates how the tax is applied to the associated line item or order. + source: + openapi: openapi/openapi.json + OrderMoneyAmounts: + docs: A collection of various money amounts. + properties: + total_money: + type: optional + docs: The total money. + tax_money: + type: optional + docs: The money associated with taxes. + discount_money: + type: optional + docs: The money associated with discounts. + tip_money: + type: optional + docs: The money associated with tips. + service_charge_money: + type: optional + docs: The money associated with service charges. + source: + openapi: openapi/openapi.json + OrderPricingOptions: + docs: >- + Pricing options for an order. The options affect how the order's price is + calculated. + + They can be used, for example, to apply automatic price adjustments that + are based on preconfigured + + [pricing rules](entity:CatalogPricingRule). + properties: + auto_apply_discounts: + type: optional> + docs: |- + The option to determine whether pricing rule-based + discounts are automatically applied to an order. + auto_apply_taxes: + type: optional> + docs: >- + The option to determine whether rule-based taxes are automatically + + applied to an order when the criteria of the corresponding rules are + met. + source: + openapi: openapi/openapi.json + OrderQuantityUnit: + docs: >- + Contains the measurement unit for a quantity and a precision that + + specifies the number of digits after the decimal point for decimal + quantities. + properties: + measurement_unit: + type: optional + docs: |- + A [MeasurementUnit](entity:MeasurementUnit) that represents the + unit of measure for the quantity. + precision: + type: optional> + docs: >- + For non-integer quantities, represents the number of digits after the + decimal point that are + + recorded for this quantity. + + + For example, a precision of 1 allows quantities such as `"1.0"` and + `"1.1"`, but not `"1.01"`. + + + Min: 0. Max: 5. + catalog_object_id: + type: optional> + docs: |- + The catalog object ID referencing the + [CatalogMeasurementUnit](entity:CatalogMeasurementUnit). + + This field is set when this is a catalog-backed measurement unit. + catalog_version: + type: optional> + docs: >- + The version of the catalog object that this measurement unit + references. + + + This field is set when this is a catalog-backed measurement unit. + source: + openapi: openapi/openapi.json + OrderReturn: + docs: >- + The set of line items, service charges, taxes, discounts, tips, and other + items being returned in an order. + properties: + uid: + type: optional> + docs: A unique ID that identifies the return only within this order. + validation: + maxLength: 60 + source_order_id: + type: optional> + docs: >- + An order that contains the original sale of these return line items. + This is unset + + for unlinked returns. + return_line_items: + type: optional>> + docs: A collection of line items that are being returned. + return_service_charges: + type: optional>> + docs: A collection of service charges that are being returned. + return_taxes: + type: optional> + docs: >- + A collection of references to taxes being returned for an order, + including the total + + applied tax amount to be returned. The taxes must reference a + top-level tax ID from the source + + order. + access: read-only + return_discounts: + type: optional> + docs: >- + A collection of references to discounts being returned for an order, + including the total + + applied discount amount to be returned. The discounts must reference a + top-level discount ID + + from the source order. + access: read-only + return_tips: + type: optional>> + docs: A collection of references to tips being returned for an order. + rounding_adjustment: + type: optional + docs: >- + A positive or negative rounding adjustment to the total value being + returned. Adjustments are commonly + + used to apply cash rounding when the minimum unit of the account is + smaller than the lowest + + physical denomination of the currency. + return_amounts: + type: optional + docs: An aggregate monetary value being returned by this return entry. + source: + openapi: openapi/openapi.json + OrderReturnDiscount: + docs: >- + Represents a discount being returned that applies to one or more return + line items in an + + order. + + + Fixed-amount, order-scoped discounts are distributed across all non-zero + return line item totals. + + The amount distributed to each return line item is relative to that item’s + contribution to the + + order subtotal. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the returned discount only within this + order. + validation: + maxLength: 60 + source_discount_uid: + type: optional> + docs: >- + The discount `uid` from the order that contains the original + application of this discount. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID referencing + [CatalogDiscount](entity:CatalogDiscount). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this discount references. + name: + type: optional> + docs: The discount's name. + validation: + maxLength: 255 + type: + type: optional + docs: >- + The type of the discount. If it is created by the API, it is + `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. + + + Discounts that do not reference a catalog object ID must have a type + of + + `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. + + See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for + possible values + percentage: + type: optional> + docs: >- + The percentage of the tax, as a string representation of a decimal + number. + + A value of `"7.25"` corresponds to a percentage of 7.25%. + + + `percentage` is not set for amount-based discounts. + validation: + maxLength: 10 + amount_money: + type: optional + docs: |- + The total declared monetary amount of the discount. + + `amount_money` is not set for percentage-based discounts. + applied_money: + type: optional + docs: >- + The amount of discount actually applied to this line item. When an + amount-based + + discount is at the order level, this value is different from + `amount_money` because the discount + + is distributed across the line items. + scope: + type: optional + docs: >- + Indicates the level at which the `OrderReturnDiscount` applies. For + `ORDER` scoped + + discounts, the server generates references in `applied_discounts` on + all + + `OrderReturnLineItem`s. For `LINE_ITEM` scoped discounts, the discount + is only applied to + + `OrderReturnLineItem`s with references in their `applied_discounts` + field. + + See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for + possible values + source: + openapi: openapi/openapi.json + OrderReturnLineItem: + docs: The line item being returned in an order. + properties: + uid: + type: optional> + docs: A unique ID for this return line-item entry. + validation: + maxLength: 60 + source_line_item_uid: + type: optional> + docs: The `uid` of the line item in the original sale order. + validation: + maxLength: 60 + name: + type: optional> + docs: The name of the line item. + validation: + maxLength: 512 + quantity: + type: string + docs: |- + The quantity returned, formatted as a decimal number. + For example, `"3"`. + + Line items with a `quantity_unit` can have non-integer quantities. + For example, `"1.70000"`. + validation: + minLength: 1 + maxLength: 12 + quantity_unit: + type: optional + docs: >- + The unit and precision that this return line item's quantity is + measured in. + note: + type: optional> + docs: The note of the return line item. + validation: + maxLength: 2000 + catalog_object_id: + type: optional> + docs: >- + The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to + this return line item. + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this line item references. + variation_name: + type: optional> + docs: The name of the variation applied to this return line item. + validation: + maxLength: 400 + item_type: + type: optional + docs: >- + The type of line item: an itemized return, a non-itemized return + (custom amount), + + or the return of an unactivated gift card sale. + + See [OrderLineItemItemType](#type-orderlineitemitemtype) for possible + values + return_modifiers: + type: optional>> + docs: >- + The [CatalogModifier](entity:CatalogModifier)s applied to this line + item. + applied_taxes: + type: optional>> + docs: >- + The list of references to `OrderReturnTax` entities applied to the + return line item. Each + + `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of + a top-level + + `OrderReturnTax` applied to the return line item. On reads, the + applied amount + + is populated. + applied_discounts: + type: optional>> + docs: >- + The list of references to `OrderReturnDiscount` entities applied to + the return line item. Each + + `OrderLineItemAppliedDiscount` has a `discount_uid` that references + the `uid` of a top-level + + `OrderReturnDiscount` applied to the return line item. On reads, the + applied amount + + is populated. + base_price_money: + type: optional + docs: The base price for a single unit of the line item. + variation_total_price_money: + type: optional + docs: >- + The total price of all item variations returned in this line item. + + The price is calculated as `base_price_money` multiplied by `quantity` + and + + does not include modifiers. + gross_return_money: + type: optional + docs: >- + The gross return amount of money calculated as (item base price + + modifiers price) * quantity. + total_tax_money: + type: optional + docs: The total amount of tax money to return for the line item. + total_discount_money: + type: optional + docs: The total amount of discount money to return for the line item. + total_money: + type: optional + docs: The total amount of money to return for this line item. + applied_service_charges: + type: optional>> + docs: >- + The list of references to `OrderReturnServiceCharge` entities applied + to the return + + line item. Each `OrderLineItemAppliedServiceCharge` has a + `service_charge_uid` that + + references the `uid` of a top-level `OrderReturnServiceCharge` applied + to the return line + + item. On reads, the applied amount is populated. + total_service_charge_money: + type: optional + docs: >- + The total amount of apportioned service charge money to return for the + line item. + source: + openapi: openapi/openapi.json + OrderReturnLineItemModifier: + docs: A line item modifier being returned. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the return modifier only within this + order. + validation: + maxLength: 60 + source_modifier_uid: + type: optional> + docs: |- + The modifier `uid` from the order's line item that contains the + original sale of this line item modifier. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID referencing + [CatalogModifier](entity:CatalogModifier). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: >- + The version of the catalog object that this line item modifier + references. + name: + type: optional> + docs: The name of the item modifier. + validation: + maxLength: 255 + base_price_money: + type: optional + docs: >- + The base price for the modifier. + + + `base_price_money` is required for ad hoc modifiers. + + If both `catalog_object_id` and `base_price_money` are set, + `base_price_money` overrides the predefined + [CatalogModifier](entity:CatalogModifier) price. + total_price_money: + type: optional + docs: >- + The total price of the item modifier for its line item. + + This is the modifier's `base_price_money` multiplied by the line + item's quantity. + quantity: + type: optional> + docs: >- + The quantity of the line item modifier. The modifier quantity can be 0 + or more. + + For example, suppose a restaurant offers a cheeseburger on the menu. + When a buyer orders + + this item, the restaurant records the purchase by creating an `Order` + object with a line item + + for a burger. The line item includes a line item modifier: the name is + cheese and the quantity + + is 1. The buyer has the option to order extra cheese (or no cheese). + If the buyer chooses + + the extra cheese option, the modifier quantity increases to 2. If the + buyer does not want + + any cheese, the modifier quantity is set to 0. + source: + openapi: openapi/openapi.json + OrderReturnServiceCharge: + docs: Represents the service charge applied to the original order. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the return service charge only within this + order. + validation: + maxLength: 60 + source_service_charge_uid: + type: optional> + docs: |- + The service charge `uid` from the order containing the original + service charge. `source_service_charge_uid` is `null` for + unlinked returns. + validation: + maxLength: 60 + name: + type: optional> + docs: The name of the service charge. + validation: + maxLength: 255 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID of the associated + [OrderServiceCharge](entity:OrderServiceCharge). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this service charge references. + percentage: + type: optional> + docs: |- + The percentage of the service charge, as a string representation of + a decimal number. For example, a value of `"7.25"` corresponds to a + percentage of 7.25%. + + Either `percentage` or `amount_money` should be set, but not both. + validation: + maxLength: 10 + amount_money: + type: optional + docs: |- + The amount of a non-percentage-based service charge. + + Either `percentage` or `amount_money` should be set, but not both. + applied_money: + type: optional + docs: >- + The amount of money applied to the order by the service charge, + including + + any inclusive tax amounts, as calculated by Square. + + + - For fixed-amount service charges, `applied_money` is equal to + `amount_money`. + + - For percentage-based service charges, `applied_money` is the money + calculated using the percentage. + total_money: + type: optional + docs: >- + The total amount of money to collect for the service charge. + + + __NOTE__: If an inclusive tax is applied to the service charge, + `total_money` + + does not equal `applied_money` plus `total_tax_money` because the + inclusive + + tax amount is already included in both `applied_money` and + `total_tax_money`. + total_tax_money: + type: optional + docs: The total amount of tax money to collect for the service charge. + calculation_phase: + type: optional + docs: >- + The calculation phase after which to apply the service charge. + + See + [OrderServiceChargeCalculationPhase](#type-orderservicechargecalculationphase) + for possible values + taxable: + type: optional> + docs: |- + Indicates whether the surcharge can be taxed. Service charges + calculated in the `TOTAL_PHASE` cannot be marked as taxable. + applied_taxes: + type: optional>> + docs: >- + The list of references to `OrderReturnTax` entities applied to the + + `OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a + `tax_uid` + + that references the `uid` of a top-level `OrderReturnTax` that is + being + + applied to the `OrderReturnServiceCharge`. On reads, the applied + amount is + + populated. + treatment_type: + type: optional + docs: >- + The treatment type of the service charge. + + See + [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) + for possible values + scope: + type: optional + docs: >- + Indicates the level at which the apportioned service charge applies. + For `ORDER` + + scoped service charges, Square generates references in + `applied_service_charges` on + + all order line items that do not have them. For `LINE_ITEM` scoped + service charges, + + the service charge only applies to line items with a service charge + reference in their + + `applied_service_charges` field. + + + This field is immutable. To change the scope of an apportioned service + charge, you must delete + + the apportioned service charge and re-add it as a new apportioned + service charge. + + See [OrderServiceChargeScope](#type-orderservicechargescope) for + possible values + source: + openapi: openapi/openapi.json + OrderReturnTax: + docs: >- + Represents a tax being returned that applies to one or more return line + items in an order. + + + Fixed-amount, order-scoped taxes are distributed across all non-zero + return line item totals. + + The amount distributed to each return line item is relative to that item’s + contribution to the + + order subtotal. + properties: + uid: + type: optional> + docs: A unique ID that identifies the returned tax only within this order. + validation: + maxLength: 60 + source_tax_uid: + type: optional> + docs: The tax `uid` from the order that contains the original tax charge. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: The catalog object ID referencing [CatalogTax](entity:CatalogTax). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this tax references. + name: + type: optional> + docs: The tax's name. + validation: + maxLength: 255 + type: + type: optional + docs: >- + Indicates the calculation method used to apply the tax. + + See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible + values + percentage: + type: optional> + docs: >- + The percentage of the tax, as a string representation of a decimal + number. + + For example, a value of `"7.25"` corresponds to a percentage of 7.25%. + validation: + maxLength: 10 + applied_money: + type: optional + docs: The amount of money applied by the tax in an order. + scope: + type: optional + docs: >- + Indicates the level at which the `OrderReturnTax` applies. For `ORDER` + scoped + + taxes, Square generates references in `applied_taxes` on all + + `OrderReturnLineItem`s. For `LINE_ITEM` scoped taxes, the tax is only + applied to + + `OrderReturnLineItem`s with references in their `applied_discounts` + field. + + See [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible + values + source: + openapi: openapi/openapi.json + OrderReturnTip: + docs: A tip being returned. + properties: + uid: + type: optional> + docs: A unique ID that identifies the tip only within this order. + validation: + maxLength: 60 + applied_money: + type: optional + docs: |- + The amount of tip being returned + -- + source_tender_uid: + type: optional> + docs: >- + The tender `uid` from the order that contains the original application + of this tip. + validation: + maxLength: 192 + source_tender_id: + type: optional> + docs: >- + The tender `id` from the order that contains the original application + of this tip. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + OrderReward: + docs: |- + Represents a reward that can be applied to an order if the necessary + reward tier criteria are met. Rewards are created through the Loyalty API. + properties: + id: + type: string + docs: The identifier of the reward. + validation: + minLength: 1 + reward_tier_id: + type: string + docs: The identifier of the reward tier corresponding to this reward. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + OrderRoundingAdjustment: + docs: >- + A rounding adjustment of the money being returned. Commonly used to apply + cash rounding + + when the minimum unit of the account is smaller than the lowest physical + denomination of the currency. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the rounding adjustment only within this + order. + validation: + maxLength: 60 + name: + type: optional> + docs: The name of the rounding adjustment from the original sale order. + amount_money: + type: optional + docs: The actual rounding adjustment amount. + source: + openapi: openapi/openapi.json + OrderServiceCharge: + docs: Represents a service charge applied to an order. + properties: + uid: + type: optional> + docs: A unique ID that identifies the service charge only within this order. + validation: + maxLength: 60 + name: + type: optional> + docs: The name of the service charge. + validation: + maxLength: 512 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID referencing the service charge + [CatalogObject](entity:CatalogObject). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this service charge references. + percentage: + type: optional> + docs: >- + The service charge percentage as a string representation of a + + decimal number. For example, `"7.25"` indicates a service charge of + 7.25%. + + + Exactly 1 of `percentage` or `amount_money` should be set. + validation: + maxLength: 10 + amount_money: + type: optional + docs: |- + The amount of a non-percentage-based service charge. + + Exactly one of `percentage` or `amount_money` should be set. + applied_money: + type: optional + docs: >- + The amount of money applied to the order by the service charge, + + including any inclusive tax amounts, as calculated by Square. + + + - For fixed-amount service charges, `applied_money` is equal to + `amount_money`. + + - For percentage-based service charges, `applied_money` is the money + + calculated using the percentage. + total_money: + type: optional + docs: |- + The total amount of money to collect for the service charge. + + __Note__: If an inclusive tax is applied to the service charge, + `total_money` does not equal `applied_money` plus `total_tax_money` + because the inclusive tax amount is already included in both + `applied_money` and `total_tax_money`. + total_tax_money: + type: optional + docs: The total amount of tax money to collect for the service charge. + calculation_phase: + type: optional + docs: >- + The calculation phase at which to apply the service charge. + + See + [OrderServiceChargeCalculationPhase](#type-orderservicechargecalculationphase) + for possible values + taxable: + type: optional> + docs: >- + Indicates whether the service charge can be taxed. If set to `true`, + + order-level taxes automatically apply to the service charge. Note that + + service charges calculated in the `TOTAL_PHASE` cannot be marked as + taxable. + applied_taxes: + type: optional>> + docs: >- + The list of references to the taxes applied to this service charge. + Each + + `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of + a top-level + + `OrderLineItemTax` that is being applied to this service charge. On + reads, the amount applied + + is populated. + + + An `OrderLineItemAppliedTax` is automatically created on every taxable + service charge + + for all `ORDER` scoped taxes that are added to the order. + `OrderLineItemAppliedTax` records + + for `LINE_ITEM` scoped taxes must be added in requests for the tax to + apply to any taxable + + service charge. Taxable service charges have the `taxable` field set + to `true` and calculated + + in the `SUBTOTAL_PHASE`. + + + To change the amount of a tax, modify the referenced top-level tax. + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this service charge. Metadata + fields are intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + type: + type: optional + docs: >- + The type of the service charge. + + See [OrderServiceChargeType](#type-orderservicechargetype) for + possible values + treatment_type: + type: optional + docs: >- + The treatment type of the service charge. + + See + [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) + for possible values + scope: + type: optional + docs: >- + Indicates the level at which the apportioned service charge applies. + For `ORDER` + + scoped service charges, Square generates references in + `applied_service_charges` on + + all order line items that do not have them. For `LINE_ITEM` scoped + service charges, + + the service charge only applies to line items with a service charge + reference in their + + `applied_service_charges` field. + + + This field is immutable. To change the scope of an apportioned service + charge, you must delete + + the apportioned service charge and re-add it as a new apportioned + service charge. + + See [OrderServiceChargeScope](#type-orderservicechargescope) for + possible values + source: + openapi: openapi/openapi.json + OrderServiceChargeCalculationPhase: + enum: + - SUBTOTAL_PHASE + - TOTAL_PHASE + - APPORTIONED_PERCENTAGE_PHASE + - APPORTIONED_AMOUNT_PHASE + docs: >- + Represents a phase in the process of calculating order totals. + + Service charges are applied after the indicated phase. + + + [Read more about how order totals are + calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) + source: + openapi: openapi/openapi.json + OrderServiceChargeScope: + enum: + - OTHER_SERVICE_CHARGE_SCOPE + - LINE_ITEM + - ORDER + docs: |- + Indicates whether this is a line-item or order-level apportioned + service charge. + source: + openapi: openapi/openapi.json + OrderServiceChargeTreatmentType: + enum: + - LINE_ITEM_TREATMENT + - APPORTIONED_TREATMENT + docs: >- + Indicates whether the service charge will be treated as a value-holding + line item or + + apportioned toward a line item. + source: + openapi: openapi/openapi.json + OrderServiceChargeType: + enum: + - AUTO_GRATUITY + - CUSTOM + source: + openapi: openapi/openapi.json + OrderSource: + docs: Represents the origination details of an order. + properties: + name: + type: optional> + docs: >- + The name used to identify the place (physical or digital) that an + order originates. + + If unset, the name defaults to the name of the application that + created the order. + source: + openapi: openapi/openapi.json + OrderState: + enum: + - OPEN + - COMPLETED + - CANCELED + - DRAFT + docs: The state of the order. + source: + openapi: openapi/openapi.json + OrderUpdated: + properties: + order_id: + type: optional> + docs: The order's unique ID. + version: + type: optional + docs: >- + The version number, which is incremented each time an update is + committed to the order. + + Orders that were not created through the API do not include a version + number and + + therefore cannot be updated. + + + [Read more about working with + versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) + location_id: + type: optional> + docs: The ID of the seller location that this order is associated with. + state: + type: optional + docs: |- + The state of the order. + See [OrderState](#type-orderstate) for possible values + created_at: + type: optional + docs: The timestamp for when the order was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp for when the order was last updated, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + OrderUpdatedEvent: + docs: |- + Published when an [Order](entity:Order) is updated. This + event is triggered by the [UpdateOrder](api-endpoint:Orders-UpdateOrder) + endpoint call, Order Manager, or the Square Dashboard. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"order.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + OrderUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"order_updated"`. + id: + type: optional + docs: ID of the affected order. + object: + type: optional + docs: An object containing information about the updated Order. + source: + openapi: openapi/openapi.json + OrderUpdatedObject: + properties: + order_updated: + type: optional + docs: Information about the updated order. + source: + openapi: openapi/openapi.json + PauseSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [PauseSubscription](api-endpoint:Subscriptions-PauseSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The subscription to be paused by the scheduled `PAUSE` action. + actions: + type: optional> + docs: >- + The list of a `PAUSE` action and a possible `RESUME` action created by + the request. + source: + openapi: openapi/openapi.json + PayOrderResponse: + docs: >- + Defines the fields that are included in the response body of a request to + the + + [PayOrder](api-endpoint:Orders-PayOrder) endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + order: + type: optional + docs: The paid, updated [order](entity:Order). + source: + openapi: openapi/openapi.json + Payment: + docs: Represents a payment processed by the Square API. + properties: + id: + type: optional + docs: A unique ID for the payment. + validation: + maxLength: 192 + access: read-only + created_at: + type: optional + docs: The timestamp of when the payment was created, in RFC 3339 format. + validation: + maxLength: 32 + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the payment was last updated, in RFC 3339 + format. + validation: + maxLength: 32 + access: read-only + amount_money: + type: optional + docs: >- + The amount processed for this payment, not including `tip_money`. + + + The amount is specified in the smallest denomination of the applicable + currency (for example, + + US dollar amounts are specified in cents). For more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + tip_money: + type: optional + docs: >- + The amount designated as a tip. + + + This amount is specified in the smallest denomination of the + applicable currency (for example, + + US dollar amounts are specified in cents). For more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + total_money: + type: optional + docs: >- + The total amount for the payment, including `amount_money` and + `tip_money`. + + This amount is specified in the smallest denomination of the + applicable currency (for example, + + US dollar amounts are specified in cents). For more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + app_fee_money: + type: optional + docs: >- + The amount the developer is taking as a fee for facilitating the + payment on behalf + + of the seller. This amount is specified in the smallest denomination + of the applicable currency + + (for example, US dollar amounts are specified in cents). For more + information, + + see [Take Payments and Collect + Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + + + The amount cannot be more than 90% of the `total_money` value. + + + To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth + permission is required. + + For more information, see + [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions). + approved_money: + type: optional + docs: >- + The amount of money approved for this payment. This value may change + if Square chooses to + + obtain reauthorization as part of a call to + [UpdatePayment](api-endpoint:Payments-UpdatePayment). + processing_fee: + type: optional> + docs: >- + The processing fees and fee adjustments assessed by Square for this + payment. + access: read-only + refunded_money: + type: optional + docs: >- + The total amount of the payment refunded to date. + + + This amount is specified in the smallest denomination of the + applicable currency (for example, + + US dollar amounts are specified in cents). + status: + type: optional + docs: >- + Indicates whether the payment is APPROVED, PENDING, COMPLETED, + CANCELED, or FAILED. + validation: + maxLength: 50 + access: read-only + delay_duration: + type: optional + docs: >- + The duration of time after the payment's creation when Square + automatically applies the + + `delay_action` to the payment. This automatic `delay_action` applies + only to payments that + + do not reach a terminal state (COMPLETED, CANCELED, or FAILED) before + the `delay_duration` + + time period. + + + This field is specified as a time duration, in RFC 3339 format. + + + Notes: + + This feature is only supported for card payments. + + + Default: + + + - Card-present payments: "PT36H" (36 hours) from the creation time. + + - Card-not-present payments: "P7D" (7 days) from the creation time. + access: read-only + delay_action: + type: optional> + docs: >- + The action to be applied to the payment when the `delay_duration` has + elapsed. + + + Current values include `CANCEL` and `COMPLETE`. + delayed_until: + type: optional + docs: >- + The read-only timestamp of when the `delay_action` is automatically + applied, + + in RFC 3339 format. + + + Note that this field is calculated by summing the payment's + `delay_duration` and `created_at` + + fields. The `created_at` field is generated by Square and might not + exactly match the + + time on your local machine. + access: read-only + source_type: + type: optional + docs: >- + The source type for this payment. + + + Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, + `BUY_NOW_PAY_LATER`, `SQUARE_ACCOUNT`, + + `CASH` and `EXTERNAL`. For information about these payment source + types, + + see [Take + Payments](https://developer.squareup.com/docs/payments-api/take-payments). + validation: + maxLength: 50 + access: read-only + card_details: + type: optional + docs: >- + Details about a card payment. These details are only populated if the + source_type is `CARD`. + cash_details: + type: optional + docs: >- + Details about a cash payment. These details are only populated if the + source_type is `CASH`. + bank_account_details: + type: optional + docs: >- + Details about a bank account payment. These details are only populated + if the source_type is `BANK_ACCOUNT`. + external_details: + type: optional + docs: |- + Details about an external payment. The details are only populated + if the `source_type` is `EXTERNAL`. + wallet_details: + type: optional + docs: |- + Details about an wallet payment. The details are only populated + if the `source_type` is `WALLET`. + buy_now_pay_later_details: + type: optional + docs: >- + Details about a Buy Now Pay Later payment. The details are only + populated + + if the `source_type` is `BUY_NOW_PAY_LATER`. For more information, + see + + [Afterpay + Payments](https://developer.squareup.com/docs/payments-api/take-payments/afterpay-payments). + square_account_details: + type: optional + docs: |- + Details about a Square Account payment. The details are only populated + if the `source_type` is `SQUARE_ACCOUNT`. + location_id: + type: optional + docs: The ID of the location associated with the payment. + validation: + maxLength: 50 + access: read-only + order_id: + type: optional + docs: The ID of the order associated with the payment. + validation: + maxLength: 192 + access: read-only + reference_id: + type: optional + docs: |- + An optional ID that associates the payment with an entity in + another system. + validation: + maxLength: 40 + access: read-only + customer_id: + type: optional + docs: >- + The ID of the customer associated with the payment. If the ID is + + not provided in the `CreatePayment` request that was used to create + the `Payment`, + + Square may use information in the request + + (such as the billing and shipping address, email address, and payment + source) + + to identify a matching customer profile in the Customer Directory. + + If found, the profile ID is used. If a profile is not found, the + + API attempts to create an + + [instant + profile](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). + + If the API cannot create an + + instant profile (either because the seller has disabled it or the + + seller's region prevents creating it), this field remains unset. Note + that + + this process is asynchronous and it may take some time before a + + customer ID is added to the payment. + validation: + maxLength: 191 + access: read-only + employee_id: + type: optional + docs: |- + __Deprecated__: Use `Payment.team_member_id` instead. + + An optional ID of the employee associated with taking the payment. + validation: + maxLength: 192 + access: read-only + team_member_id: + type: optional> + docs: >- + An optional ID of the [TeamMember](entity:TeamMember) associated with + taking the payment. + validation: + maxLength: 192 + refund_ids: + type: optional> + docs: A list of `refund_id`s identifying refunds for the payment. + access: read-only + risk_evaluation: + type: optional + docs: >- + Provides information about the risk associated with the payment, as + determined by Square. + + This field is present for payments to sellers that have opted in to + receive risk + + evaluations. + terminal_checkout_id: + type: optional + docs: >- + An optional ID for a Terminal checkout that is associated with the + payment. + access: read-only + buyer_email_address: + type: optional + docs: The buyer's email address. + validation: + maxLength: 255 + access: read-only + billing_address: + type: optional
+ docs: The buyer's billing address. + shipping_address: + type: optional
+ docs: The buyer's shipping address. + note: + type: optional + docs: An optional note to include when creating a payment. + validation: + maxLength: 500 + access: read-only + statement_description_identifier: + type: optional + docs: >- + Additional payment information that gets added to the customer's card + statement + + as part of the statement description. + + + Note that the `statement_description_identifier` might get truncated + on the statement description + + to fit the required information including the Square identifier (SQ *) + and the name of the + + seller taking the payment. + access: read-only + capabilities: + type: optional> + docs: |- + Actions that can be performed on this payment: + - `EDIT_AMOUNT_UP` - The payment amount can be edited up. + - `EDIT_AMOUNT_DOWN` - The payment amount can be edited down. + - `EDIT_TIP_AMOUNT_UP` - The tip amount can be edited up. + - `EDIT_TIP_AMOUNT_DOWN` - The tip amount can be edited down. + - `EDIT_DELAY_ACTION` - The delay_action can be edited. + access: read-only + receipt_number: + type: optional + docs: |- + The payment's receipt number. + The field is missing if a payment is canceled. + validation: + maxLength: 4 + access: read-only + receipt_url: + type: optional + docs: |- + The URL for the payment's receipt. + The field is only populated for COMPLETED payments. + validation: + maxLength: 255 + access: read-only + device_details: + type: optional + docs: Details about the device that took the payment. + application_details: + type: optional + docs: Details about the application that took the payment. + is_offline_payment: + type: optional + docs: Whether or not this payment was taken offline. + access: read-only + offline_payment_details: + type: optional + docs: Additional information about the payment if it was taken offline. + version_token: + type: optional> + docs: >- + Used for optimistic concurrency. This opaque token identifies a + specific version of the + + `Payment` object. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityAppFeeRefundDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + refund_id: + type: optional> + docs: The ID of the refund associated with this activity. + location_id: + type: optional> + docs: >- + The ID of the location of the merchant associated with the payment + refund activity + source: + openapi: openapi/openapi.json + PaymentBalanceActivityAppFeeRevenueDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + location_id: + type: optional> + docs: >- + The ID of the location of the merchant associated with the payment + activity + source: + openapi: openapi/openapi.json + PaymentBalanceActivityAutomaticSavingsDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + payout_id: + type: optional> + docs: The ID of the payout associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityAutomaticSavingsReversedDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + payout_id: + type: optional> + docs: The ID of the payout associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityChargeDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityDepositFeeDetail: + properties: + payout_id: + type: optional> + docs: The ID of the payout that triggered this deposit fee activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityDepositFeeReversedDetail: + properties: + payout_id: + type: optional> + docs: The ID of the payout that triggered this deposit fee activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityDisputeDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + dispute_id: + type: optional> + docs: The ID of the dispute associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityFeeDetail: + properties: + payment_id: + type: optional> + docs: >- + The ID of the payment associated with this activity + + This will only be populated when a principal LedgerEntryToken is also + populated. + + If the fee is independent (there is no principal LedgerEntryToken) + then this will likely not + + be populated. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityFreeProcessingDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityHoldAdjustmentDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityOpenDisputeDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + dispute_id: + type: optional> + docs: The ID of the dispute associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityOtherAdjustmentDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityOtherDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityRefundDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + refund_id: + type: optional> + docs: The ID of the refund associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityReleaseAdjustmentDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityReserveHoldDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityReserveReleaseDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivitySquareCapitalPaymentDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivitySquareCapitalReversedPaymentDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivitySquarePayrollTransferDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivitySquarePayrollTransferReversedDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityTaxOnFeeDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + tax_rate_description: + type: optional> + docs: >- + The description of the tax rate being applied. For example: "GST", + "HST". + source: + openapi: openapi/openapi.json + PaymentBalanceActivityThirdPartyFeeDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityThirdPartyFeeRefundDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + refund_id: + type: optional> + docs: The public refund id associated with this activity. + source: + openapi: openapi/openapi.json + PaymentCreatedEvent: + docs: Published when a [Payment](entity:Payment) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"payment.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + PaymentCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"payment"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected payment. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the created payment. + source: + openapi: openapi/openapi.json + PaymentCreatedEventObject: + properties: + payment: + type: optional + docs: The created payment. + source: + openapi: openapi/openapi.json + PaymentLink: + properties: + id: + type: optional + docs: The Square-assigned ID of the payment link. + access: read-only + version: + type: integer + docs: >- + The Square-assigned version number, which is incremented each time an + update is committed to the payment link. + validation: + max: 65535 + description: + type: optional> + docs: |- + The optional description of the `payment_link` object. + It is primarily for use by your application and is not used anywhere. + validation: + maxLength: 4096 + order_id: + type: optional + docs: The ID of the order associated with the payment link. + validation: + maxLength: 192 + access: read-only + checkout_options: + type: optional + docs: >- + The checkout options configured for the payment link. + + For more information, see [Optional Checkout + Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). + pre_populated_data: + type: optional + docs: |- + Describes buyer data to prepopulate + on the checkout page. + url: + type: optional + docs: The shortened URL of the payment link. + validation: + maxLength: 255 + access: read-only + long_url: + type: optional + docs: The long URL of the payment link. + validation: + maxLength: 255 + access: read-only + created_at: + type: optional + docs: The timestamp when the payment link was created, in RFC 3339 format. + updated_at: + type: optional + docs: >- + The timestamp when the payment link was last updated, in RFC 3339 + format. + payment_note: + type: optional> + docs: >- + An optional note. After Square processes the payment, this note is + added to the + + resulting `Payment`. + validation: + maxLength: 500 + source: + openapi: openapi/openapi.json + PaymentLinkRelatedResources: + properties: + orders: + type: optional>> + docs: The order associated with the payment link. + subscription_plans: + type: optional>> + docs: The subscription plan associated with the payment link. + source: + openapi: openapi/openapi.json + PaymentOptions: + properties: + autocomplete: + type: optional> + docs: >- + Indicates whether the `Payment` objects created from this + `TerminalCheckout` are + + automatically `COMPLETED` or left in an `APPROVED` state for later + modification. + + + Default: true + delay_duration: + type: optional> + docs: >- + The duration of time after the payment's creation when Square + automatically resolves the + + payment. This automatic resolution applies only to payments that do + not reach a terminal state + + (`COMPLETED` or `CANCELED`) before the `delay_duration` time period. + + + This parameter should be specified as a time duration, in RFC 3339 + format, with a minimum value + + of 1 minute and a maximum value of 36 hours. This feature is only + supported for card payments, + + and all payments will be considered card-present. + + + This parameter can only be set for a delayed capture payment + (`autocomplete=false`). For more + + information, see [Delayed + Capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). + + + Default: "PT36H" (36 hours) from the creation time + accept_partial_authorization: + type: optional> + docs: >- + If set to `true` and charging a Square Gift Card, a payment might be + returned with + + `amount_money` equal to less than what was requested. For example, a + request for $20 when charging + + a Square Gift Card with a balance of $5 results in an APPROVED payment + of $5. You might choose + + to prompt the buyer for an additional payment to cover the remainder + or cancel the Gift Card + + payment. + + + This parameter can only be set for a delayed capture payment + (`autocomplete=false`). + + + For more information, see [Take Partial + Payments](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/partial-payments-with-gift-cards). + + + Default: false + delay_action: + type: optional + docs: >- + The action to be applied to the `Payment` when the delay_duration has + elapsed. + + The action must be CANCEL or COMPLETE. + + + The action cannot be set to COMPLETE if an `order_id` is present on + the TerminalCheckout. + + + This parameter can only be set for a delayed capture payment + (`autocomplete=false`). For more + + information, see [Delayed + Capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). + + + Default: CANCEL + + See [DelayAction](#type-delayaction) for possible values + source: + openapi: openapi/openapi.json + PaymentOptionsDelayAction: + enum: + - CANCEL + - COMPLETE + docs: >- + Describes the action to be applied to a delayed capture payment when the + delay_duration + + has elapsed. + source: + openapi: openapi/openapi.json + PaymentRefund: + docs: >- + Represents a refund of a payment made using Square. Contains information + about + + the original payment and the amount of money refunded. + properties: + id: + type: string + docs: The unique ID for this refund, generated by Square. + validation: + minLength: 1 + maxLength: 255 + status: + type: optional> + docs: |- + The refund's status: + - `PENDING` - Awaiting approval. + - `COMPLETED` - Successfully completed. + - `REJECTED` - The refund was rejected. + - `FAILED` - An error occurred. + validation: + maxLength: 50 + location_id: + type: optional> + docs: >- + The location ID associated with the payment this refund is attached + to. + validation: + maxLength: 50 + unlinked: + type: optional + docs: >- + Flag indicating whether or not the refund is linked to an existing + payment in Square. + access: read-only + destination_type: + type: optional> + docs: >- + The destination type for this refund. + + + Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, + `BUY_NOW_PAY_LATER`, `CASH`, + + `EXTERNAL`, and `SQUARE_ACCOUNT`. + validation: + maxLength: 50 + destination_details: + type: optional + docs: >- + Contains information about the refund destination. This field is + populated only if + + `destination_id` is defined in the `RefundPayment` request. + amount_money: + type: Money + docs: >- + The amount of money refunded. This amount is specified in the smallest + denomination + + of the applicable currency (for example, US dollar amounts are + specified in cents). + app_fee_money: + type: optional + docs: >- + The amount of money the application developer contributed to help + cover the refunded amount. + + This amount is specified in the smallest denomination of the + applicable currency (for example, + + US dollar amounts are specified in cents). For more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + processing_fee: + type: optional>> + docs: >- + Processing fees and fee adjustments assessed by Square for this + refund. + payment_id: + type: optional> + docs: The ID of the payment associated with this refund. + validation: + maxLength: 192 + order_id: + type: optional> + docs: The ID of the order associated with the refund. + validation: + maxLength: 192 + reason: + type: optional> + docs: The reason for the refund. + validation: + maxLength: 192 + created_at: + type: optional + docs: The timestamp of when the refund was created, in RFC 3339 format. + validation: + maxLength: 32 + access: read-only + updated_at: + type: optional + docs: The timestamp of when the refund was last updated, in RFC 3339 format. + validation: + maxLength: 32 + access: read-only + team_member_id: + type: optional + docs: An optional ID of the team member associated with taking the payment. + validation: + maxLength: 192 + access: read-only + terminal_refund_id: + type: optional + docs: An optional ID for a Terminal refund. + access: read-only + source: + openapi: openapi/openapi.json + PaymentUpdatedEvent: + docs: >- + Published when a [Payment](entity:Payment) is updated. + + Typically the `payment.status`, or `card_details.status` fields are + updated + + as a payment is canceled, authorized, or completed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"payment.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + PaymentUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"payment"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected payment. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the updated payment. + source: + openapi: openapi/openapi.json + PaymentUpdatedEventObject: + properties: + payment: + type: optional + docs: The updated payment. + source: + openapi: openapi/openapi.json + Payout: + docs: >- + An accounting of the amount owed the seller and record of the actual + transfer to their + + external bank account or to the Square balance. + properties: + id: + type: string + docs: A unique ID for the payout. + validation: + minLength: 1 + status: + type: optional + docs: |- + Indicates the payout status. + See [PayoutStatus](#type-payoutstatus) for possible values + location_id: + type: string + docs: The ID of the location associated with the payout. + validation: + minLength: 1 + created_at: + type: optional + docs: >- + The timestamp of when the payout was created and submitted for deposit + to the seller's banking destination, in RFC 3339 format. + updated_at: + type: optional + docs: The timestamp of when the payout was last updated, in RFC 3339 format. + amount_money: + type: optional + docs: >- + The amount of money involved in the payout. A positive amount + indicates a deposit, and a negative amount indicates a withdrawal. + This amount is never zero. + destination: + type: optional + docs: >- + Information about the banking destination (such as a bank account, + Square checking account, or debit card) + + against which the payout was made. + version: + type: optional + docs: >- + The version number, which is incremented each time an update is made + to this payout record. + + The version number helps developers receive event notifications or + feeds out of order. + type: + type: optional + docs: |- + Indicates the payout type. + See [PayoutType](#type-payouttype) for possible values + payout_fee: + type: optional>> + docs: >- + A list of transfer fees and any taxes on the fees assessed by Square + for this payout. + arrival_date: + type: optional> + docs: >- + The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is + due to arrive in the seller’s banking destination. + end_to_end_id: + type: optional> + docs: >- + A unique ID for each `Payout` object that might also appear on the + seller’s bank statement. You can use this ID to automate the process + of reconciling each payout with the corresponding line item on the + bank statement. + source: + openapi: openapi/openapi.json + PayoutEntry: + docs: >- + One or more PayoutEntries that make up a Payout. Each one has a date, + amount, and type of activity. + + The total amount of the payout will equal the sum of the payout entries + for a batch payout + properties: + id: + type: string + docs: A unique ID for the payout entry. + validation: + minLength: 1 + payout_id: + type: string + docs: The ID of the payout entries’ associated payout. + validation: + minLength: 1 + effective_at: + type: optional> + docs: >- + The timestamp of when the payout entry affected the balance, in RFC + 3339 format. + type: + type: optional + docs: |- + The type of activity associated with this payout entry. + See [ActivityType](#type-activitytype) for possible values + gross_amount_money: + type: optional + docs: The amount of money involved in this payout entry. + fee_amount_money: + type: optional + docs: The amount of Square fees associated with this payout entry. + net_amount_money: + type: optional + docs: The net proceeds from this transaction after any fees. + type_app_fee_revenue_details: + type: optional + docs: Details of any developer app fee revenue generated on a payment. + type_app_fee_refund_details: + type: optional + docs: Details of a refund for an app fee on a payment. + type_automatic_savings_details: + type: optional + docs: >- + Details of any automatic transfer from the payment processing balance + to the Square Savings account. These are, generally, proportional to + the merchant's sales. + type_automatic_savings_reversed_details: + type: optional + docs: >- + Details of any automatic transfer from the Square Savings account back + to the processing balance. These are, generally, proportional to the + merchant's refunds. + type_charge_details: + type: optional + docs: Details of credit card payment captures. + type_deposit_fee_details: + type: optional + docs: >- + Details of any fees involved with deposits such as for instant + deposits. + type_deposit_fee_reversed_details: + type: optional + docs: >- + Details of any reversal or refund of fees involved with deposits such + as for instant deposits. + type_dispute_details: + type: optional + docs: Details of any balance change due to a dispute event. + type_fee_details: + type: optional + docs: Details of adjustments due to the Square processing fee. + type_free_processing_details: + type: optional + docs: >- + Square offers Free Payments Processing for a variety of business + scenarios including seller referral or when Square wants to apologize + for a bug, customer service, repricing complication, and so on. This + entry represents details of any credit to the merchant for the + purposes of Free Processing. + type_hold_adjustment_details: + type: optional + docs: >- + Details of any adjustment made by Square related to the holding or + releasing of a payment. + type_open_dispute_details: + type: optional + docs: Details of any open disputes. + type_other_details: + type: optional + docs: >- + Details of any other type that does not belong in the rest of the + types. + type_other_adjustment_details: + type: optional + docs: >- + Details of any other type of adjustments that don't fall under + existing types. + type_refund_details: + type: optional + docs: Details of a refund for an existing card payment. + type_release_adjustment_details: + type: optional + docs: Details of fees released for adjustments. + type_reserve_hold_details: + type: optional + docs: Details of fees paid for funding risk reserve. + type_reserve_release_details: + type: optional + docs: Details of fees released from risk reserve. + type_square_capital_payment_details: + type: optional + docs: >- + Details of capital merchant cash advance (MCA) assessments. These are, + generally, proportional to the merchant's sales but may be issued for + other reasons related to the MCA. + type_square_capital_reversed_payment_details: + type: optional + docs: >- + Details of capital merchant cash advance (MCA) assessment refunds. + These are, generally, proportional to the merchant's refunds but may + be issued for other reasons related to the MCA. + type_tax_on_fee_details: + type: optional + docs: Details of tax paid on fee amounts. + type_third_party_fee_details: + type: optional + docs: Details of fees collected by a 3rd party platform. + type_third_party_fee_refund_details: + type: optional + docs: Details of refunded fees from a 3rd party platform. + type_square_payroll_transfer_details: + type: optional + docs: >- + Details of a payroll payment that was transferred to a team member’s + bank account. + type_square_payroll_transfer_reversed_details: + type: optional + docs: >- + Details of a payroll payment to a team member’s bank account that was + deposited back to the seller’s account by Square. + source: + openapi: openapi/openapi.json + PayoutFailedEvent: + docs: Published when a [Payout](entity:Payout) has failed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event that this represents, `payout.failed`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was verified, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + PayoutFailedEventData: + properties: + type: + type: optional> + docs: The name of the affected object's type, `payout`. + id: + type: optional + docs: The ID of the failed payout. + object: + type: optional + docs: An object containing the failed payout. + source: + openapi: openapi/openapi.json + PayoutFailedEventObject: + properties: + payout: + type: optional + docs: The payout that failed. + source: + openapi: openapi/openapi.json + PayoutFee: + docs: Represents a payout fee that can incur as part of a payout. + properties: + amount_money: + type: optional + docs: The money amount of the payout fee. + effective_at: + type: optional> + docs: The timestamp of when the fee takes effect, in RFC 3339 format. + type: + type: optional + docs: |- + The type of fee assessed as part of the payout. + See [PayoutFeeType](#type-payoutfeetype) for possible values + source: + openapi: openapi/openapi.json + PayoutFeeType: + enum: + - TRANSFER_FEE + - TAX_ON_TRANSFER_FEE + docs: Represents the type of payout fee that can incur as part of a payout. + source: + openapi: openapi/openapi.json + PayoutPaidEvent: + docs: Published when a [Payout](entity:Payout) is complete. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"payout.paid"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was verified, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + PayoutPaidEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"payout"`. + id: + type: optional + docs: ID of the completed payout. + object: + type: optional + docs: An object containing the completed payout. + source: + openapi: openapi/openapi.json + PayoutPaidEventObject: + properties: + payout: + type: optional + docs: The payout that has completed. + source: + openapi: openapi/openapi.json + PayoutSentEvent: + docs: Published when a [Payout](entity:Payout) is sent. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"payout.sent"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was verified, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + PayoutSentEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"payout"`. + id: + type: optional + docs: ID of the sent payout. + object: + type: optional + docs: An object containing the sent payout. + source: + openapi: openapi/openapi.json + PayoutSentEventObject: + properties: + payout: + type: optional + docs: The payout that was sent. + source: + openapi: openapi/openapi.json + PayoutStatus: + enum: + - SENT + - FAILED + - PAID + docs: Payout status types + source: + openapi: openapi/openapi.json + PayoutType: + enum: + - BATCH + - SIMPLE + docs: >- + The type of payout: “BATCH” or “SIMPLE”. + + BATCH payouts include a list of payout entries that can be considered + settled. + + SIMPLE payouts do not have any payout entries associated with them + + and will show up as one of the payout entries in a future BATCH payout. + source: + openapi: openapi/openapi.json + Phase: + docs: >- + Represents a phase, which can override subscription phases as defined by + plan_id + properties: + uid: + type: optional> + docs: id of subscription phase + ordinal: + type: optional> + docs: index of phase in total subscription plan + order_template_id: + type: optional> + docs: id of order to be used in billing + plan_phase_uid: + type: optional> + docs: the uid from the plan's phase in catalog + source: + openapi: openapi/openapi.json + PhaseInput: + docs: Represents the arguments used to construct a new phase. + properties: + ordinal: + type: long + docs: index of phase in total subscription plan + order_template_id: + type: optional> + docs: id of order to be used in billing + source: + openapi: openapi/openapi.json + PrePopulatedData: + docs: >- + Describes buyer data to prepopulate in the payment form. + + For more information, + + see [Optional Checkout + Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). + properties: + buyer_email: + type: optional> + docs: The buyer email to prepopulate in the payment form. + validation: + maxLength: 256 + buyer_phone_number: + type: optional> + docs: The buyer phone number to prepopulate in the payment form. + validation: + maxLength: 17 + buyer_address: + type: optional
+ docs: The buyer address to prepopulate in the payment form. + source: + openapi: openapi/openapi.json + ProcessingFee: + docs: Represents the Square processing fee. + properties: + effective_at: + type: optional> + docs: The timestamp of when the fee takes effect, in RFC 3339 format. + type: + type: optional> + docs: >- + The type of fee assessed or adjusted. The fee type can be `INITIAL` or + `ADJUSTMENT`. + amount_money: + type: optional + docs: >- + The fee amount, which might be negative, that is assessed or adjusted + by Square. + + + Positive values represent funds being assessed, while negative values + represent + + funds being returned. + source: + openapi: openapi/openapi.json + Product: + enum: + - SQUARE_POS + - EXTERNAL_API + - BILLING + - APPOINTMENTS + - INVOICES + - ONLINE_STORE + - PAYROLL + - DASHBOARD + - ITEM_LIBRARY_IMPORT + - OTHER + docs: Indicates the Square product used to generate a change. + source: + openapi: openapi/openapi.json + ProductType: literal<"TERMINAL_API"> + PublishInvoiceResponse: + docs: Describes a `PublishInvoice` response. + properties: + invoice: + type: optional + docs: The published invoice. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + PublishScheduledShiftResponse: + docs: >- + Represents a + [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) + response. + + Either `scheduled_shift` or `errors` is present in the response. + properties: + scheduled_shift: + type: optional + docs: The published scheduled shift. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + QrCodeOptions: + docs: Fields to describe the action that displays QR-Codes. + properties: + title: + type: string + docs: The title text to display in the QR code flow on the Terminal. + validation: + minLength: 1 + maxLength: 250 + body: + type: string + docs: The body text to display in the QR code flow on the Terminal. + validation: + minLength: 1 + maxLength: 10000 + barcode_contents: + type: string + docs: |- + The text representation of the data to show in the QR code + as UTF8-encoded data. + validation: + minLength: 1 + maxLength: 1024 + source: + openapi: openapi/openapi.json + QuickPay: + docs: >- + Describes an ad hoc item and price to generate a quick pay checkout link. + + For more information, + + see [Quick Pay + Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout). + properties: + name: + type: string + docs: >- + The ad hoc item name. In the resulting `Order`, this name appears as + the line item name. + validation: + minLength: 1 + maxLength: 255 + price_money: + type: Money + docs: The price of the item. + location_id: + type: string + docs: The ID of the business location the checkout is associated with. + source: + openapi: openapi/openapi.json + Range: + docs: The range of a number value between the specified lower and upper bounds. + properties: + min: + type: optional> + docs: >- + The lower bound of the number range. At least one of `min` or `max` + must be specified. + + If unspecified, the results will have no minimum value. + max: + type: optional> + docs: >- + The upper bound of the number range. At least one of `min` or `max` + must be specified. + + If unspecified, the results will have no maximum value. + source: + openapi: openapi/openapi.json + ReceiptOptions: + docs: Describes receipt action fields. + properties: + payment_id: + type: string + docs: The reference to the Square payment ID for the receipt. + print_only: + type: optional> + docs: >- + Instructs the device to print the receipt without displaying the + receipt selection screen. + + Requires `printer_enabled` set to true. + + Defaults to false. + is_duplicate: + type: optional> + docs: |- + Identify the receipt as a reprint rather than an original receipt. + Defaults to false. + source: + openapi: openapi/openapi.json + RedeemLoyaltyRewardResponse: + docs: >- + A response that includes the `LoyaltyEvent` published for redeeming the + reward. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + event: + type: optional + docs: The `LoyaltyEvent` for redeeming the reward. + source: + openapi: openapi/openapi.json + Refund: + docs: Represents a refund processed for a Square transaction. + properties: + id: + type: string + docs: The refund's unique ID. + validation: + maxLength: 255 + location_id: + type: string + docs: The ID of the refund's associated location. + validation: + maxLength: 50 + transaction_id: + type: optional> + docs: The ID of the transaction that the refunded tender is part of. + validation: + maxLength: 192 + tender_id: + type: optional> + docs: The ID of the refunded tender. + validation: + maxLength: 192 + created_at: + type: optional + docs: The timestamp for when the refund was created, in RFC 3339 format. + validation: + maxLength: 32 + access: read-only + reason: + type: string + docs: The reason for the refund being issued. + validation: + maxLength: 192 + amount_money: + type: Money + docs: The amount of money refunded to the buyer. + status: + type: RefundStatus + docs: |- + The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`, + or `FAILED`). + See [RefundStatus](#type-refundstatus) for possible values + processing_fee_money: + type: optional + docs: The amount of Square processing fee money refunded to the *merchant*. + additional_recipients: + type: optional>> + docs: >- + Additional recipients (other than the merchant) receiving a portion of + this refund. + + For example, fees assessed on a refund of a purchase by a third party + integration. + source: + openapi: openapi/openapi.json + RefundCreatedEvent: + docs: Published when a [Refund](entity:PaymentRefund) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"refund.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + RefundCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"refund"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected refund. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the created refund. + source: + openapi: openapi/openapi.json + RefundCreatedEventObject: + properties: + refund: + type: optional + docs: The created refund. + source: + openapi: openapi/openapi.json + RefundPaymentResponse: + docs: >- + Defines the response returned by + + [RefundPayment](api-endpoint:Refunds-RefundPayment). + + + If there are errors processing the request, the `refund` field might not + be + + present, or it might be present with a status of `FAILED`. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refund: + type: optional + docs: The successfully created `PaymentRefund`. + source: + openapi: openapi/openapi.json + RefundStatus: + enum: + - PENDING + - APPROVED + - REJECTED + - FAILED + docs: Indicates a refund's current status. + source: + openapi: openapi/openapi.json + RefundUpdatedEvent: + docs: |- + Published when a [Refund](entity:PaymentRefund) is updated. + Typically the `refund.status` changes when a refund is completed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"refund.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + RefundUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"refund"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected refund. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the updated refund. + source: + openapi: openapi/openapi.json + RefundUpdatedEventObject: + properties: + refund: + type: optional + docs: The updated refund. + source: + openapi: openapi/openapi.json + RegisterDomainResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [RegisterDomain](api-endpoint:ApplePay-RegisterDomain) + endpoint. + + + Either `errors` or `status` are present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + status: + type: optional + docs: >- + The status of the domain registration. + + + See + [RegisterDomainResponseStatus](entity:RegisterDomainResponseStatus) + for possible values. + + See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) + for possible values + source: + openapi: openapi/openapi.json + RegisterDomainResponseStatus: + enum: + - PENDING + - VERIFIED + docs: The status of the domain registration. + source: + openapi: openapi/openapi.json + RemoveGroupFromCustomerResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [RemoveGroupFromCustomer](api-endpoint:Customers-RemoveGroupFromCustomer) + + endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ResumeSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [ResumeSubscription](api-endpoint:Subscriptions-ResumeSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The resumed subscription. + actions: + type: optional> + docs: >- + A list of `RESUME` actions created by the request and scheduled for + the subscription. + source: + openapi: openapi/openapi.json + RetrieveBookingCustomAttributeDefinitionResponse: + docs: >- + Represents a + [RetrieveBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The retrieved custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveBookingCustomAttributeResponse: + docs: >- + Represents a + [RetrieveBookingCustomAttribute](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: >- + The retrieved custom attribute. If `with_definition` was set to `true` + in the request, + + the custom attribute definition is returned in the `definition` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetBookingResponse: + properties: + booking: + type: optional + docs: The booking that was requested. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetBusinessBookingProfileResponse: + properties: + business_booking_profile: + type: optional + docs: The seller's booking profile. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetCardResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [RetrieveCard](api-endpoint:Cards-RetrieveCard) endpoint. + + + Note: if there are errors processing the request, the card field will not + be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + card: + type: optional + docs: The retrieved card. + source: + openapi: openapi/openapi.json + GetCashDrawerShiftResponse: + properties: + cash_drawer_shift: + type: optional + docs: The cash drawer shift queried for. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetCatalogObjectResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + object: + type: optional + docs: The `CatalogObject`s returned. + related_objects: + type: optional> + docs: >- + A list of `CatalogObject`s referenced by the object in the `object` + field. + source: + openapi: openapi/openapi.json + GetCustomerCustomAttributeDefinitionResponse: + docs: >- + Represents a + [RetrieveCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The retrieved custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetCustomerCustomAttributeResponse: + docs: >- + Represents a + [RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: >- + The retrieved custom attribute. If `with_definition` was set to `true` + in the request, + + the custom attribute definition is returned in the `definition` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetCustomerGroupResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [RetrieveCustomerGroup](api-endpoint:CustomerGroups-RetrieveCustomerGroup) + endpoint. + + + Either `errors` or `group` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + group: + type: optional + docs: The retrieved customer group. + source: + openapi: openapi/openapi.json + GetCustomerResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `RetrieveCustomer` endpoint. + + Either `errors` or `customer` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + customer: + type: optional + docs: The requested customer. + source: + openapi: openapi/openapi.json + GetCustomerSegmentResponse: + docs: >- + Defines the fields that are included in the response body for requests to + the `RetrieveCustomerSegment` endpoint. + + + Either `errors` or `segment` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + segment: + type: optional + docs: The retrieved customer segment. + source: + openapi: openapi/openapi.json + GetDisputeEvidenceResponse: + docs: Defines the fields in a `RetrieveDisputeEvidence` response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + evidence: + type: optional + docs: Metadata about the dispute evidence file. + source: + openapi: openapi/openapi.json + GetDisputeResponse: + docs: Defines fields in a `RetrieveDispute` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + dispute: + type: optional + docs: Details about the requested `Dispute`. + source: + openapi: openapi/openapi.json + GetEmployeeResponse: + properties: + employee: optional + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetGiftCardFromGANResponse: + docs: >- + A response that contains a `GiftCard`. This response might contain a set + of `Error` objects + + if the request resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: >- + A gift card that was fetched, if present. It returns empty if an error + occurred. + source: + openapi: openapi/openapi.json + GetGiftCardFromNonceResponse: + docs: >- + A response that contains a `GiftCard` object. If the request resulted in + errors, + + the response contains a set of `Error` objects. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: The retrieved gift card. + source: + openapi: openapi/openapi.json + GetGiftCardResponse: + docs: >- + A response that contains a `GiftCard`. The response might contain a set of + `Error` objects + + if the request resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: The gift card retrieved. + source: + openapi: openapi/openapi.json + GetInventoryAdjustmentResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + adjustment: + type: optional + docs: The requested [InventoryAdjustment](entity:InventoryAdjustment). + source: + openapi: openapi/openapi.json + GetInventoryChangesResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + changes: + type: optional> + docs: The set of inventory changes for the requested object and locations. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + source: + openapi: openapi/openapi.json + GetInventoryCountResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + counts: + type: optional> + docs: |- + The current calculated inventory counts for the requested object and + locations. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + source: + openapi: openapi/openapi.json + GetInventoryPhysicalCountResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + count: + type: optional + docs: The requested [InventoryPhysicalCount](entity:InventoryPhysicalCount). + source: + openapi: openapi/openapi.json + GetInventoryTransferResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + transfer: + type: optional + docs: The requested [InventoryTransfer](entity:InventoryTransfer). + source: + openapi: openapi/openapi.json + RetrieveJobResponse: + docs: >- + Represents a [RetrieveJob](api-endpoint:Team-RetrieveJob) response. Either + `job` or `errors` + + is present in the response. + properties: + job: + type: optional + docs: The retrieved job. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveLocationBookingProfileResponse: + properties: + location_booking_profile: + type: optional + docs: The requested location booking profile. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveLocationCustomAttributeDefinitionResponse: + docs: >- + Represents a + [RetrieveLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The retrieved custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveLocationCustomAttributeResponse: + docs: >- + Represents a + [RetrieveLocationCustomAttribute](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: >- + The retrieved custom attribute. If `with_definition` was set to `true` + in the request, + + the custom attribute definition is returned in the `definition` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetLocationResponse: + docs: >- + Defines the fields that the + [RetrieveLocation](api-endpoint:Locations-RetrieveLocation) + + endpoint returns in a response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + location: + type: optional + docs: The requested location. + source: + openapi: openapi/openapi.json + RetrieveLocationSettingsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + location_settings: + type: optional + docs: The location settings. + source: + openapi: openapi/openapi.json + GetLoyaltyAccountResponse: + docs: A response that includes the loyalty account. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_account: + type: optional + docs: The loyalty account. + source: + openapi: openapi/openapi.json + GetLoyaltyProgramResponse: + docs: A response that contains the loyalty program. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + program: + type: optional + docs: The loyalty program that was requested. + source: + openapi: openapi/openapi.json + GetLoyaltyPromotionResponse: + docs: >- + Represents a + [RetrieveLoyaltyPromotionPromotions](api-endpoint:Loyalty-RetrieveLoyaltyPromotion) + response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_promotion: + type: optional + docs: The retrieved loyalty promotion. + source: + openapi: openapi/openapi.json + GetLoyaltyRewardResponse: + docs: A response that includes the loyalty reward. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + reward: + type: optional + docs: The loyalty reward retrieved. + source: + openapi: openapi/openapi.json + RetrieveMerchantCustomAttributeDefinitionResponse: + docs: >- + Represents a + [RetrieveMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The retrieved custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveMerchantCustomAttributeResponse: + docs: >- + Represents a + [RetrieveMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: >- + The retrieved custom attribute. If `with_definition` was set to `true` + in the request, + + the custom attribute definition is returned in the `definition` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetMerchantResponse: + docs: >- + The response object returned by the + [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) endpoint. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + merchant: + type: optional + docs: The requested `Merchant` object. + source: + openapi: openapi/openapi.json + RetrieveMerchantSettingsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + merchant_settings: + type: optional + docs: The merchant settings. + source: + openapi: openapi/openapi.json + RetrieveOrderCustomAttributeDefinitionResponse: + docs: Represents a response from getting an order custom attribute definition. + properties: + custom_attribute_definition: + type: optional + docs: The retrieved custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveOrderCustomAttributeResponse: + docs: Represents a response from getting an order custom attribute. + properties: + custom_attribute: + type: optional + docs: >- + The retrieved custom attribute. If `with_definition` was set to `true` + in the request, the custom attribute definition is returned in the + `definition field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetOrderResponse: + properties: + order: + type: optional + docs: The requested order. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetPaymentLinkResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + payment_link: + type: optional + docs: The payment link that is retrieved. + source: + openapi: openapi/openapi.json + RetrieveScheduledShiftResponse: + docs: >- + Represents a + [RetrieveScheduledShift](api-endpoint:Labor-RetrieveScheduledShift) + response. + + Either `scheduled_shift` or `errors` is present in the response. + properties: + scheduled_shift: + type: optional + docs: The requested scheduled shift. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetSnippetResponse: + docs: >- + Represents a `RetrieveSnippet` response. The response can include either + `snippet` or `errors`. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + snippet: + type: optional + docs: The retrieved snippet. + source: + openapi: openapi/openapi.json + GetSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The subscription retrieved. + source: + openapi: openapi/openapi.json + GetTeamMemberBookingProfileResponse: + properties: + team_member_booking_profile: + type: optional + docs: The returned team member booking profile. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetTeamMemberResponse: + docs: >- + Represents a response from a retrieve request containing a `TeamMember` + object or error messages. + properties: + team_member: + type: optional + docs: The successfully retrieved `TeamMember` object. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveTimecardResponse: + docs: >- + A response to a request to get a `Timecard`. The response contains + + the requested `Timecard` object and might contain a set of `Error` objects + if + + the request resulted in errors. + properties: + timecard: + type: optional + docs: The requested `Timecard`. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveTokenStatusResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `RetrieveTokenStatus` endpoint. + properties: + scopes: + type: optional> + docs: The list of scopes associated with an access token. + expires_at: + type: optional + docs: "The date and time when the\_`access_token`\_expires, in RFC 3339 format. Empty if the token never expires." + client_id: + type: optional + docs: >- + The Square-issued application ID associated with the access token. + This is the same application ID used to obtain the token. + validation: + maxLength: 191 + merchant_id: + type: optional + docs: The ID of the authorizing merchant's business. + validation: + minLength: 8 + maxLength: 191 + errors: + type: optional> + docs: ' Any errors that occurred during the request.' + source: + openapi: openapi/openapi.json + GetTransactionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [RetrieveTransaction](api-endpoint:Transactions-RetrieveTransaction) + endpoint. + + + One of `errors` or `transaction` is present in a given response (never + both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + transaction: + type: optional + docs: The requested transaction. + source: + openapi: openapi/openapi.json + GetVendorResponse: + docs: >- + Represents an output from a call to + [RetrieveVendor](api-endpoint:Vendors-RetrieveVendor). + properties: + errors: + type: optional> + docs: Errors encountered when the request fails. + vendor: + type: optional + docs: The successfully retrieved [Vendor](entity:Vendor) object. + source: + openapi: openapi/openapi.json + GetWageSettingResponse: + docs: >- + Represents a response from a retrieve request containing the specified + `WageSetting` object or error messages. + properties: + wage_setting: + type: optional + docs: The successfully retrieved `WageSetting` object. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetWebhookSubscriptionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [RetrieveWebhookSubscription](api-endpoint:WebhookSubscriptions-RetrieveWebhookSubscription) + endpoint. + + + Note: if there are errors processing the request, the + [Subscription](entity:WebhookSubscription) will not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + subscription: + type: optional + docs: The requested [Subscription](entity:WebhookSubscription). + source: + openapi: openapi/openapi.json + RevokeTokenResponse: + properties: + success: + type: optional + docs: If the request is successful, this is `true`. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RiskEvaluation: + docs: >- + Represents fraud risk information for the associated payment. + + + When you take a payment through Square's Payments API (using the + `CreatePayment` + + endpoint), Square evaluates it and assigns a risk level to the payment. + Sellers + + can use this information to determine the course of action (for example, + + provide the goods/services or refund the payment). + properties: + created_at: + type: optional + docs: The timestamp when payment risk was evaluated, in RFC 3339 format. + access: read-only + risk_level: + type: optional + docs: >- + The risk level associated with the payment + + See [RiskEvaluationRiskLevel](#type-riskevaluationrisklevel) for + possible values + source: + openapi: openapi/openapi.json + RiskEvaluationRiskLevel: + enum: + - PENDING + - NORMAL + - MODERATE + - HIGH + source: + openapi: openapi/openapi.json + SaveCardOptions: + docs: Describes save-card action fields. + properties: + customer_id: + type: string + docs: The square-assigned ID of the customer linked to the saved card. + card_id: + type: optional + docs: The id of the created card-on-file. + validation: + maxLength: 64 + access: read-only + reference_id: + type: optional> + docs: >- + An optional user-defined reference ID that can be used to associate + + this `Card` to another entity in an external system. For example, a + customer + + ID generated by a third-party system. + validation: + maxLength: 128 + source: + openapi: openapi/openapi.json + ScheduledShift: + docs: >- + Represents a specific time slot in a work schedule. This object is used to + manage the + + lifecycle of a scheduled shift from the draft to published state. A + scheduled shift contains + + the latest draft shift details and current published shift details. + properties: + id: + type: optional + docs: '**Read only** The Square-issued ID of the scheduled shift.' + validation: + maxLength: 255 + draft_shift_details: + type: optional + docs: >- + The latest draft shift details for the scheduled shift. Draft shift + details are used to + + stage and manage shifts before publishing. This field is always + present. + published_shift_details: + type: optional + docs: >- + The current published (public) shift details for the scheduled shift. + This field is + + present only if the shift was published. + version: + type: optional + docs: >- + **Read only** The current version of the scheduled shift, which is + incremented with each update. + + This field is used for [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control to ensure that requests don't overwrite data from another + request. + created_at: + type: optional + docs: >- + The timestamp of when the scheduled shift was created, in RFC 3339 + format presented as UTC. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the scheduled shift was last updated, in RFC + 3339 format presented as UTC. + access: read-only + source: + openapi: openapi/openapi.json + ScheduledShiftDetails: + docs: >- + Represents shift details for draft and published versions of a [scheduled + shift](entity:ScheduledShift), + + such as job ID, team member assignment, and start and end times. + properties: + team_member_id: + type: optional> + docs: >- + The ID of the [team member](entity:TeamMember) scheduled for the + shift. + validation: + maxLength: 255 + location_id: + type: optional> + docs: The ID of the [location](entity:Location) the shift is scheduled for. + validation: + maxLength: 255 + job_id: + type: optional> + docs: The ID of the [job](entity:Job) the shift is scheduled for. + start_at: + type: optional> + docs: >- + The start time of the shift, in RFC 3339 format in the time zone + + + + offset of the shift location specified in `location_id`. Precision up + to the minute + + is respected; seconds are truncated. + end_at: + type: optional> + docs: >- + The end time for the shift, in RFC 3339 format in the time zone + + + offset of the shift location specified in `location_id`. Precision up + to the minute + + is respected; seconds are truncated. + notes: + type: optional> + docs: Optional notes for the shift. + validation: + maxLength: 1000 + is_deleted: + type: optional> + docs: >- + Indicates whether the draft shift version is deleted. If set to `true` + when the shift + + is published, the entire scheduled shift (including the published + shift) is deleted and + + cannot be accessed using any endpoint. + timezone: + type: optional + docs: >- + The time zone of the shift location, calculated based on the + `location_id`. This field + + is provided for convenience. + access: read-only + source: + openapi: openapi/openapi.json + ScheduledShiftFilter: + docs: >- + Defines filter criteria for a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) + + request. Multiple filters in a query are combined as an `AND` operation. + properties: + location_ids: + type: optional>> + docs: >- + Return shifts for the specified locations. When omitted, shifts for + all + + locations are returned. If needed, call + [ListLocations](api-endpoint:Locations-ListLocations) + + to get location IDs. + start: + type: optional + docs: |- + Return shifts whose `start_at` time is within the specified + time range (inclusive). + end: + type: optional + docs: |- + Return shifts whose `end_at` time is within the specified + time range (inclusive). + workday: + type: optional + docs: Return shifts based on a workday date range. + team_member_ids: + type: optional>> + docs: >- + Return shifts assigned to specified team members. If needed, call + + [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) to get team + member IDs. + + + To return only the shifts assigned to the specified team members, + include the + + `assignment_status` filter in the query. Otherwise, all unassigned + shifts are + + returned along with shifts assigned to the specified team members. + assignment_status: + type: optional + docs: >- + Return shifts based on whether a team member is assigned. A shift is + + assigned if the `team_member_id` field is populated in the + `draft_shift_details` + + or `published_shift details` field of the shift. + + + To return only draft or published shifts, include the + `scheduled_shift_statuses` + + filter in the query. + + See + [ScheduledShiftFilterAssignmentStatus](#type-scheduledshiftfilterassignmentstatus) + for possible values + scheduled_shift_statuses: + type: optional>> + docs: >- + Return shifts based on the draft or published status of the shift. + + A shift is published if the `published_shift_details` field is + present. + + + Note that shifts with `draft_shift_details.is_deleted` set to `true` + are ignored + + with the `DRAFT` filter. + + See + [ScheduledShiftFilterScheduledShiftStatus](#type-scheduledshiftfilterscheduledshiftstatus) + for possible values + source: + openapi: openapi/openapi.json + ScheduledShiftFilterAssignmentStatus: + enum: + - ASSIGNED + - UNASSIGNED + docs: |- + Defines valid values for the `assignment_status` filter in a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. + Assignment status is based on the `draft_shift_details.team_member_id` and + `published_shift_details.team_member_id` fields of the scheduled shift. + source: + openapi: openapi/openapi.json + ScheduledShiftFilterScheduledShiftStatus: + enum: + - DRAFT + - PUBLISHED + docs: |- + Defines valid values for the `scheduled_shift_statuses` filter in a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. + source: + openapi: openapi/openapi.json + ScheduledShiftNotificationAudience: + enum: + - ALL + - AFFECTED + - NONE + docs: >- + Indicates whether Square sends an email notification to team members + + when a scheduled shift is published and which team members receive the + notification. + source: + openapi: openapi/openapi.json + ScheduledShiftQuery: + docs: |- + Represents filter and sort criteria for the `query` field in a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. + properties: + filter: + type: optional + docs: Filtering options for the query. + sort: + type: optional + docs: Sorting options for the query. + source: + openapi: openapi/openapi.json + ScheduledShiftSort: + docs: >- + Defines sort criteria for a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) + + request. + properties: + field: + type: optional + docs: >- + The field to sort on. The default value is `START_AT`. + + See [ScheduledShiftSortField](#type-scheduledshiftsortfield) for + possible values + order: + type: optional + docs: |- + The order in which results are returned. The default value is `ASC`. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + ScheduledShiftSortField: + enum: + - START_AT + - END_AT + - CREATED_AT + - UPDATED_AT + docs: |- + Defines valid values for the `field` sort setting in a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. + source: + openapi: openapi/openapi.json + ScheduledShiftWorkday: + docs: >- + A `ScheduledShift` search query filter parameter that sets a range of days + that + + a `Shift` must start or end in before passing the filter condition. + properties: + date_range: + type: optional + docs: Dates for fetching the scheduled shifts. + match_scheduled_shifts_by: + type: optional + docs: >- + The strategy on which the dates are applied. + + See [ScheduledShiftWorkdayMatcher](#type-scheduledshiftworkdaymatcher) + for possible values + default_timezone: + type: optional> + docs: >- + Location-specific timezones convert workdays to datetime filters. + + Every location included in the query must have a timezone or this + field + + must be provided as a fallback. Format: the IANA timezone database + + identifier for the relevant timezone. + source: + openapi: openapi/openapi.json + ScheduledShiftWorkdayMatcher: + enum: + - START_AT + - END_AT + - INTERSECTION + docs: Defines the logic used to apply a workday filter. + source: + openapi: openapi/openapi.json + SearchAvailabilityFilter: + docs: A query filter to search for buyer-accessible availabilities by. + properties: + start_at_range: + type: TimeRange + docs: >- + The query expression to search for buy-accessible availabilities with + their starting times falling within the specified time range. + + The time range must be at least 24 hours and at most 32 days long. + + For waitlist availabilities, the time range can be 0 or more up to 367 + days long. + location_id: + type: optional> + docs: >- + The query expression to search for buyer-accessible availabilities + with their location IDs matching the specified location ID. + + This query expression cannot be set if `booking_id` is set. + validation: + maxLength: 32 + segment_filters: + type: optional>> + docs: >- + The query expression to search for buyer-accessible availabilities + matching the specified list of segment filters. + + If the size of the `segment_filters` list is `n`, the search returns + availabilities with `n` segments per availability. + + + This query expression cannot be set if `booking_id` is set. + booking_id: + type: optional> + docs: >- + The query expression to search for buyer-accessible availabilities for + an existing booking by matching the specified `booking_id` value. + + This is commonly used to reschedule an appointment. + + If this expression is set, the `location_id` and `segment_filters` + expressions cannot be set. + validation: + maxLength: 36 + source: + openapi: openapi/openapi.json + SearchAvailabilityQuery: + docs: The query used to search for buyer-accessible availabilities of bookings. + properties: + filter: + type: SearchAvailabilityFilter + docs: >- + The query filter to search for buyer-accessible availabilities of + existing bookings. + source: + openapi: openapi/openapi.json + SearchAvailabilityResponse: + properties: + availabilities: + type: optional> + docs: List of appointment slots available for booking. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + SearchCatalogItemsRequestStockLevel: + enum: + - OUT + - LOW + docs: Defines supported stock levels of the item inventory. + source: + openapi: openapi/openapi.json + SearchCatalogItemsResponse: + docs: >- + Defines the response body returned from the + [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + items: + type: optional> + docs: Returned items matching the specified query expressions. + cursor: + type: optional + docs: >- + Pagination token used in the next request to return more of the search + result. + matched_variation_ids: + type: optional> + docs: >- + Ids of returned item variations matching the specified query + expression. + source: + openapi: openapi/openapi.json + SearchCatalogObjectsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + this is the final response. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + objects: + type: optional> + docs: The CatalogObjects returned. + related_objects: + type: optional> + docs: >- + A list of CatalogObjects referenced by the objects in the `objects` + field. + latest_time: + type: optional + docs: >- + When the associated product catalog was last updated. Will + + match the value for `end_time` or `cursor` if either field is included + in the `SearchCatalog` request. + source: + openapi: openapi/openapi.json + SearchCustomersResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the `SearchCustomers` endpoint. + + + Either `errors` or `customers` is present in a given response (never + both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + customers: + type: optional> + docs: >- + The customer profiles that match the search query. If any search + condition is not met, the result is an empty object (`{}`). + + Only customer profiles with public information (`given_name`, + `family_name`, `company_name`, `email_address`, or `phone_number`) + + are included in the response. + cursor: + type: optional + docs: >- + A pagination cursor that can be used during subsequent calls + + to `SearchCustomers` to retrieve the next set of results associated + + with the original query. Pagination cursors are only present when + + a request succeeds and additional results are available. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + count: + type: optional + docs: >- + The total count of customers associated with the Square account that + match the search query. Only customer profiles with + + public information (`given_name`, `family_name`, `company_name`, + `email_address`, or `phone_number`) are counted. This field is + + present only if `count` is set to `true` in the request. + source: + openapi: openapi/openapi.json + SearchEventsFilter: + docs: Criteria to filter events by. + properties: + event_types: + type: optional>> + docs: Filter events by event types. + merchant_ids: + type: optional>> + docs: Filter events by merchant. + location_ids: + type: optional>> + docs: Filter events by location. + created_at: + type: optional + docs: Filter events by when they were created. + source: + openapi: openapi/openapi.json + SearchEventsQuery: + docs: Contains query criteria for the search. + properties: + filter: + type: optional + docs: Criteria to filter events by. + sort: + type: optional + docs: Criteria to sort events by. + source: + openapi: openapi/openapi.json + SearchEventsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [SearchEvents](api-endpoint:Events-SearchEvents) + endpoint. + + + Note: if there are errors processing the request, the events field will + not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + events: + type: optional> + docs: The list of [Event](entity:Event)s returned by the search. + metadata: + type: optional> + docs: >- + Contains the metadata of an event. For more information, see + [Event](entity:Event). + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can use in + a subsequent request to fetch the next set of events. If empty, this + is the final response. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + SearchEventsSort: + docs: Criteria to sort events by. + properties: + field: + type: optional + docs: >- + Sort events by event types. + + See [SearchEventsSortField](#type-searcheventssortfield) for possible + values + order: + type: optional + docs: |- + The order to use for sorting the events. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + SearchEventsSortField: + type: literal<"DEFAULT"> + docs: Specifies the sort key for events returned from a search. + SearchInvoicesResponse: + docs: Describes a `SearchInvoices` response. + properties: + invoices: + type: optional> + docs: The list of invoices returned by the search. + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can use in + a + + subsequent request to fetch the next set of invoices. If empty, this + is the final + + response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + SearchLoyaltyAccountsRequestLoyaltyAccountQuery: + docs: The search criteria for the loyalty accounts. + properties: + mappings: + type: optional>> + docs: |- + The set of mappings to use in the loyalty account search. + + This cannot be combined with `customer_ids`. + + Max: 30 mappings + customer_ids: + type: optional>> + docs: |- + The set of customer IDs to use in the loyalty account search. + + This cannot be combined with `mappings`. + + Max: 30 customer IDs + source: + openapi: openapi/openapi.json + SearchLoyaltyAccountsResponse: + docs: >- + A response that includes loyalty accounts that satisfy the search + criteria. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_accounts: + type: optional> + docs: |- + The loyalty accounts that met the search criteria, + in order of creation date. + cursor: + type: optional + docs: >- + The pagination cursor to use in a subsequent + + request. If empty, this is the final response. + + For more information, + + see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + SearchLoyaltyEventsResponse: + docs: |- + A response that contains loyalty events that satisfy the search + criteria, in order by the `created_at` date. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + events: + type: optional> + docs: The loyalty events that satisfy the search criteria. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent + + request. If empty, this is the final response. + + For more information, + + see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + SearchLoyaltyRewardsRequestLoyaltyRewardQuery: + docs: The set of search requirements. + properties: + loyalty_account_id: + type: string + docs: >- + The ID of the [loyalty account](entity:LoyaltyAccount) to which the + loyalty reward belongs. + validation: + minLength: 1 + status: + type: optional + docs: >- + The status of the loyalty reward. + + See [LoyaltyRewardStatus](#type-loyaltyrewardstatus) for possible + values + source: + openapi: openapi/openapi.json + SearchLoyaltyRewardsResponse: + docs: >- + A response that includes the loyalty rewards satisfying the search + criteria. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + rewards: + type: optional> + docs: |- + The loyalty rewards that satisfy the search criteria. + These are returned in descending order by `updated_at`. + cursor: + type: optional + docs: |- + The pagination cursor to be used in a subsequent + request. If empty, this is the final response. + source: + openapi: openapi/openapi.json + SearchOrdersCustomerFilter: + docs: |- + A filter based on the order `customer_id` and any tender `customer_id` + associated with the order. It does not filter based on the + [FulfillmentRecipient](entity:FulfillmentRecipient) `customer_id`. + properties: + customer_ids: + type: optional>> + docs: |- + A list of customer IDs to filter by. + + Max: 10 customer ids. + source: + openapi: openapi/openapi.json + SearchOrdersDateTimeFilter: + docs: >- + Filter for `Order` objects based on whether their `CREATED_AT`, + + `CLOSED_AT`, or `UPDATED_AT` timestamps fall within a specified time + range. + + You can specify the time range and which timestamp to filter for. You can + filter + + for only one time range at a time. + + + For each time range, the start time and end time are inclusive. If the end + time + + is absent, it defaults to the time of the first request for the cursor. + + + __Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, + + you must set the `sort_field` in [OrdersSort](entity:SearchOrdersSort) + + to the same field you filter for. For example, if you set the `CLOSED_AT` + field + + in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` + to + + `CLOSED_AT`. Otherwise, `SearchOrders` throws an error. + + [Learn more about filtering orders by time + range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range) + properties: + created_at: + type: optional + docs: >- + The time range for filtering on the `created_at` timestamp. If you use + this + + value, you must set the `sort_field` in the `OrdersSearchSort` object + to + + `CREATED_AT`. + updated_at: + type: optional + docs: >- + The time range for filtering on the `updated_at` timestamp. If you use + this + + value, you must set the `sort_field` in the `OrdersSearchSort` object + to + + `UPDATED_AT`. + closed_at: + type: optional + docs: >- + The time range for filtering on the `closed_at` timestamp. If you use + this + + value, you must set the `sort_field` in the `OrdersSearchSort` object + to + + `CLOSED_AT`. + source: + openapi: openapi/openapi.json + SearchOrdersFilter: + docs: |- + Filtering criteria to use for a `SearchOrders` request. Multiple filters + are ANDed together. + properties: + state_filter: + type: optional + docs: Filter by [OrderState](entity:OrderState). + date_time_filter: + type: optional + docs: >- + Filter for results within a time range. + + + __Important:__ If you filter for orders by time range, you must set + `SearchOrdersSort` + + to sort by the same field. + + [Learn more about filtering orders by time + range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range) + fulfillment_filter: + type: optional + docs: Filter by the fulfillment type or state. + source_filter: + type: optional + docs: Filter by the source of the order. + customer_filter: + type: optional + docs: Filter by customers associated with the order. + source: + openapi: openapi/openapi.json + SearchOrdersFulfillmentFilter: + docs: Filter based on [order fulfillment](entity:Fulfillment) information. + properties: + fulfillment_types: + type: optional>> + docs: >- + A list of [fulfillment types](entity:FulfillmentType) to filter + + for. The list returns orders if any of its fulfillments match any of + the fulfillment types + + listed in this field. + + See [FulfillmentType](#type-fulfillmenttype) for possible values + fulfillment_states: + type: optional>> + docs: >- + A list of [fulfillment states](entity:FulfillmentState) to filter + + for. The list returns orders if any of its fulfillments match any of + the + + fulfillment states listed in this field. + + See [FulfillmentState](#type-fulfillmentstate) for possible values + source: + openapi: openapi/openapi.json + SearchOrdersQuery: + docs: Contains query criteria for the search. + properties: + filter: + type: optional + docs: Criteria to filter results by. + sort: + type: optional + docs: Criteria to sort results by. + source: + openapi: openapi/openapi.json + SearchOrdersResponse: + docs: >- + Either the `order_entries` or `orders` field is set, depending on whether + + `return_entries` is set on the + [SearchOrdersRequest](api-endpoint:Orders-SearchOrders). + properties: + order_entries: + type: optional> + docs: >- + A list of [OrderEntries](entity:OrderEntry) that fit the query + + conditions. The list is populated only if `return_entries` is set to + `true` in the request. + orders: + type: optional> + docs: >- + A list of + + [Order](entity:Order) objects that match the query conditions. The + list is populated only if + + `return_entries` is set to `false` in the request. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: '[Errors](entity:Error) encountered during the search.' + source: + openapi: openapi/openapi.json + SearchOrdersSort: + docs: |- + Sorting criteria for a `SearchOrders` request. Results can only be sorted + by a timestamp field. + properties: + sort_field: + type: SearchOrdersSortField + docs: >- + The field to sort by. + + + __Important:__ When using a + [DateTimeFilter](entity:SearchOrdersFilter), + + `sort_field` must match the timestamp field that the `DateTimeFilter` + uses to + + filter. For example, if you set your `sort_field` to `CLOSED_AT` and + you use a + + `DateTimeFilter`, your `DateTimeFilter` must filter for orders by + their `CLOSED_AT` date. + + If this field does not match the timestamp field in `DateTimeFilter`, + + `SearchOrders` returns an error. + + + Default: `CREATED_AT`. + + See [SearchOrdersSortField](#type-searchorderssortfield) for possible + values + sort_order: + type: optional + docs: >- + The chronological order in which results are returned. Defaults to + `DESC`. + + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + SearchOrdersSortField: + enum: + - CREATED_AT + - UPDATED_AT + - CLOSED_AT + docs: Specifies which timestamp to use to sort `SearchOrder` results. + source: + openapi: openapi/openapi.json + SearchOrdersSourceFilter: + docs: A filter based on order `source` information. + properties: + source_names: + type: optional>> + docs: >- + Filters by the [Source](entity:OrderSource) `name`. The filter returns + any orders + + with a `source.name` that matches any of the listed source names. + + + Max: 10 source names. + source: + openapi: openapi/openapi.json + SearchOrdersStateFilter: + docs: Filter by the current order `state`. + properties: + states: + docs: |- + States to filter for. + See [OrderState](#type-orderstate) for possible values + type: list + source: + openapi: openapi/openapi.json + SearchScheduledShiftsResponse: + docs: >- + Represents a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) + response. + + Either `scheduled_shifts` or `errors` is present in the response. + properties: + scheduled_shifts: + type: optional> + docs: A paginated list of scheduled shifts that match the query conditions. + cursor: + type: optional + docs: >- + The pagination cursor used to retrieve the next page of results. This + field is present + + only if additional results are available. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + SearchShiftsResponse: + docs: >- + The response to a request for `Shift` objects. The response contains + + the requested `Shift` objects and might contain a set of `Error` objects + if + + the request resulted in errors. + properties: + shifts: + type: optional> + docs: Shifts. + cursor: + type: optional + docs: An opaque cursor for fetching the next page. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + SearchSubscriptionsFilter: + docs: >- + Represents a set of query expressions (filters) to narrow the scope of + targeted subscriptions returned by + + the [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) + endpoint. + properties: + customer_ids: + type: optional>> + docs: >- + A filter to select subscriptions based on the subscribing customer + IDs. + location_ids: + type: optional>> + docs: A filter to select subscriptions based on the location. + source_names: + type: optional>> + docs: A filter to select subscriptions based on the source application. + source: + openapi: openapi/openapi.json + SearchSubscriptionsQuery: + docs: >- + Represents a query, consisting of specified query expressions, used to + search for subscriptions. + properties: + filter: + type: optional + docs: A list of query expressions. + source: + openapi: openapi/openapi.json + SearchSubscriptionsResponse: + docs: >- + Defines output parameters in a response from the + + [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscriptions: + type: optional> + docs: The subscriptions matching the specified query expressions. + cursor: + type: optional + docs: >- + When the total number of resulting subscription exceeds the limit of a + paged response, + + the response includes a cursor for you to use in a subsequent request + to fetch the next set of results. + + If the cursor is unset, the response contains the last page of the + results. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + SearchTeamMembersFilter: + docs: >- + Represents a filter used in a search for `TeamMember` objects. `AND` logic + is applied + + between the individual fields, and `OR` logic is applied within list-based + fields. + + For example, setting this filter value: + + ``` + + filter = (locations_ids = ["A", "B"], status = ACTIVE) + + ``` + + returns only active team members assigned to either location "A" or "B". + properties: + location_ids: + type: optional>> + docs: >- + When present, filters by team members assigned to the specified + locations. + + When empty, includes team members assigned to any location. + status: + type: optional + docs: |- + When present, filters by team members who match the given status. + When empty, includes team members of all statuses. + See [TeamMemberStatus](#type-teammemberstatus) for possible values + is_owner: + type: optional> + docs: >- + When present and set to true, returns the team member who is the owner + of the Square account. + source: + openapi: openapi/openapi.json + SearchTeamMembersQuery: + docs: Represents the parameters in a search for `TeamMember` objects. + properties: + filter: + type: optional + docs: The options to filter by. + source: + openapi: openapi/openapi.json + SearchTeamMembersResponse: + docs: >- + Represents a response from a search request containing a filtered list of + `TeamMember` objects. + properties: + team_members: + type: optional> + docs: The filtered list of `TeamMember` objects. + cursor: + type: optional + docs: >- + The opaque cursor for fetching the next page. For more information, + see + + [pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + SearchTerminalActionsResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + action: + type: optional> + docs: The requested search result of `TerminalAction`s. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more + + information. + source: + openapi: openapi/openapi.json + SearchTerminalCheckoutsResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + checkouts: + type: optional> + docs: The requested search result of `TerminalCheckout` objects. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + source: + openapi: openapi/openapi.json + SearchTerminalRefundsResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refunds: + type: optional> + docs: The requested search result of `TerminalRefund` objects. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + source: + openapi: openapi/openapi.json + SearchTimecardsResponse: + docs: >- + The response to a request for `Timecard` objects. The response contains + + the requested `Timecard` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + timecards: + type: optional> + docs: Timecards. + cursor: + type: optional + docs: An opaque cursor for fetching the next page. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + SearchVendorsRequestFilter: + docs: Defines supported query expressions to search for vendors by. + properties: + name: + type: optional>> + docs: The names of the [Vendor](entity:Vendor) objects to retrieve. + status: + type: optional>> + docs: |- + The statuses of the [Vendor](entity:Vendor) objects to retrieve. + See [VendorStatus](#type-vendorstatus) for possible values + source: + openapi: openapi/openapi.json + SearchVendorsRequestSort: + docs: >- + Defines a sorter used to sort results from + [SearchVendors](api-endpoint:Vendors-SearchVendors). + properties: + field: + type: optional + docs: |- + Specifies the sort key to sort the returned vendors. + See [Field](#type-field) for possible values + order: + type: optional + docs: |- + Specifies the sort order for the returned vendors. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + SearchVendorsRequestSortField: + enum: + - NAME + - CREATED_AT + docs: The field to sort the returned [Vendor](entity:Vendor) objects by. + source: + openapi: openapi/openapi.json + SearchVendorsResponse: + docs: >- + Represents an output from a call to + [SearchVendors](api-endpoint:Vendors-SearchVendors). + properties: + errors: + type: optional> + docs: Errors encountered when the request fails. + vendors: + type: optional> + docs: >- + The [Vendor](entity:Vendor) objects matching the specified search + filter. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + source: + openapi: openapi/openapi.json + SegmentFilter: + docs: A query filter to search for buyer-accessible appointment segments by. + properties: + service_variation_id: + type: string + docs: >- + The ID of the [CatalogItemVariation](entity:CatalogItemVariation) + object representing the service booked in this segment. + validation: + minLength: 1 + maxLength: 36 + team_member_id_filter: + type: optional + docs: >- + A query filter to search for buyer-accessible appointment segments + with service-providing team members matching the specified list of + team member IDs. Supported query expressions are + + - `ANY`: return the appointment segments with team members whose IDs + match any member in this list. + + - `NONE`: return the appointment segments with team members whose IDs + are not in this list. + + - `ALL`: not supported. + + + When no expression is specified, any service-providing team member is + eligible to fulfill the Booking. + source: + openapi: openapi/openapi.json + SelectOption: + properties: + reference_id: + type: string + docs: The reference id for the option. + validation: + minLength: 1 + maxLength: 40 + title: + type: string + docs: The title text that displays in the select option button. + validation: + minLength: 1 + maxLength: 250 + source: + openapi: openapi/openapi.json + SelectOptions: + properties: + title: + type: string + docs: The title text to display in the select flow on the Terminal. + validation: + minLength: 1 + maxLength: 250 + body: + type: string + docs: The body text to display in the select flow on the Terminal. + validation: + minLength: 1 + maxLength: 10000 + options: + docs: >- + Represents the buttons/options that should be displayed in the select + flow on the Terminal. + type: list + selected_option: + type: optional + docs: The buyer’s selected option. + source: + openapi: openapi/openapi.json + Shift: + docs: >- + A record of the hourly rate, start, and end times for a single work shift + + for an employee. This might include a record of the start and end times + for breaks + + taken during the shift. + + + Deprecated at Square API version 2025-05-21. Replaced by + [Timecard](entity:Timecard). + + See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + id: + type: optional + docs: The UUID for this object. + validation: + maxLength: 255 + employee_id: + type: optional> + docs: >- + The ID of the employee this shift belongs to. DEPRECATED at version + 2020-08-26. Use `team_member_id` instead. + location_id: + type: string + docs: >- + The ID of the location this shift occurred at. The location should be + based on + + where the employee clocked in. + validation: + minLength: 1 + timezone: + type: optional> + docs: >- + The read-only convenience value that is calculated from the location + based + + on the `location_id`. Format: the IANA timezone database identifier + for the + + location timezone. + start_at: + type: string + docs: >- + RFC 3339; shifted to the location timezone + offset. Precision up to + the + + minute is respected; seconds are truncated. + validation: + minLength: 1 + end_at: + type: optional> + docs: >- + RFC 3339; shifted to the timezone + offset. Precision up to the minute + is + + respected; seconds are truncated. + wage: + type: optional + docs: >- + Job and pay related information. If the wage is not set on create, it + defaults to a wage + + of zero. If the title is not set on create, it defaults to the name of + the role the employee + + is assigned to, if any. + breaks: + type: optional>> + docs: >- + A list of all the paid or unpaid breaks that were taken during this + shift. + status: + type: optional + docs: |- + Describes the working state of the current `Shift`. + See [ShiftStatus](#type-shiftstatus) for possible values + version: + type: optional + docs: >- + Used for resolving concurrency issues. The request fails if the + version + + provided does not match the server version at the time of the request. + If not provided, + + Square executes a blind write; potentially overwriting data from + another + + write. + created_at: + type: optional + docs: A read-only timestamp in RFC 3339 format; presented in UTC. + access: read-only + updated_at: + type: optional + docs: A read-only timestamp in RFC 3339 format; presented in UTC. + access: read-only + team_member_id: + type: optional> + docs: >- + The ID of the team member this shift belongs to. Replaced + `employee_id` at version "2020-08-26". + declared_cash_tip_money: + type: optional + docs: The tips declared by the team member for the shift. + source: + openapi: openapi/openapi.json + ShiftFilter: + docs: >- + Defines a filter used in a search for `Shift` records. `AND` logic is + + used by Square's servers to apply each filter property specified. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + location_ids: + type: optional>> + docs: Fetch shifts for the specified location. + employee_ids: + type: optional>> + docs: >- + Fetch shifts for the specified employees. DEPRECATED at version + 2020-08-26. Use `team_member_ids` instead. + status: + type: optional + docs: |- + Fetch a `Shift` instance by `Shift.status`. + See [ShiftFilterStatus](#type-shiftfilterstatus) for possible values + start: + type: optional + docs: Fetch `Shift` instances that start in the time range - Inclusive. + end: + type: optional + docs: Fetch the `Shift` instances that end in the time range - Inclusive. + workday: + type: optional + docs: Fetch the `Shift` instances based on the workday date range. + team_member_ids: + type: optional>> + docs: >- + Fetch shifts for the specified team members. Replaced `employee_ids` + at version "2020-08-26". + source: + openapi: openapi/openapi.json + ShiftFilterStatus: + enum: + - OPEN + - CLOSED + docs: >- + Specifies the `status` of `Shift` records to be returned. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + source: + openapi: openapi/openapi.json + ShiftQuery: + docs: >- + The parameters of a `Shift` search query, which includes filter and sort + options. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + filter: + type: optional + docs: Query filter options. + sort: + type: optional + docs: Sort order details. + source: + openapi: openapi/openapi.json + ShiftSort: + docs: >- + Sets the sort order of search results. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + field: + type: optional + docs: |- + The field to sort on. + See [ShiftSortField](#type-shiftsortfield) for possible values + order: + type: optional + docs: |- + The order in which results are returned. Defaults to DESC. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + ShiftSortField: + enum: + - START_AT + - END_AT + - CREATED_AT + - UPDATED_AT + docs: >- + Enumerates the `Shift` fields to sort on. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + source: + openapi: openapi/openapi.json + ShiftStatus: + enum: + - OPEN + - CLOSED + docs: >- + Enumerates the possible status of a `Shift`. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + source: + openapi: openapi/openapi.json + ShiftWage: + docs: >- + The hourly wage rate used to compensate an employee for this shift. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + title: + type: optional> + docs: The name of the job performed during this shift. + hourly_rate: + type: optional + docs: |- + Can be a custom-set hourly wage or the calculated effective hourly + wage based on the annual wage and hours worked per week. + job_id: + type: optional + docs: |- + The id of the job performed during this shift. Square + labor-reporting UIs might group shifts together by id. + access: read-only + tip_eligible: + type: optional> + docs: Whether team members are eligible for tips when working this job. + source: + openapi: openapi/openapi.json + ShiftWorkday: + docs: >- + A `Shift` search query filter parameter that sets a range of days that + + a `Shift` must start or end in before passing the filter condition. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + date_range: + type: optional + docs: Dates for fetching the shifts. + match_shifts_by: + type: optional + docs: >- + The strategy on which the dates are applied. + + See [ShiftWorkdayMatcher](#type-shiftworkdaymatcher) for possible + values + default_timezone: + type: optional> + docs: >- + Location-specific timezones convert workdays to datetime filters. + + Every location included in the query must have a timezone or this + field + + must be provided as a fallback. Format: the IANA timezone database + + identifier for the relevant timezone. + source: + openapi: openapi/openapi.json + ShiftWorkdayMatcher: + enum: + - START_AT + - END_AT + - INTERSECTION + docs: Defines the logic used to apply a workday filter. + source: + openapi: openapi/openapi.json + ShippingFee: + properties: + name: + type: optional> + docs: The name for the shipping fee. + charge: + type: Money + docs: The amount and currency for the shipping fee. + source: + openapi: openapi/openapi.json + SignatureImage: + properties: + image_type: + type: optional + docs: |- + The mime/type of the image data. + Use `image/png;base64` for png. + access: read-only + data: + type: optional + docs: The base64 representation of the image. + access: read-only + source: + openapi: openapi/openapi.json + SignatureOptions: + properties: + title: + type: string + docs: >- + The title text to display in the signature capture flow on the + Terminal. + validation: + minLength: 1 + maxLength: 250 + body: + type: string + docs: >- + The body text to display in the signature capture flow on the + Terminal. + validation: + minLength: 1 + maxLength: 10000 + signature: + type: optional> + docs: An image representation of the collected signature. + access: read-only + source: + openapi: openapi/openapi.json + Site: + docs: >- + Represents a Square Online site, which is an online store for a Square + seller. + properties: + id: + type: optional + docs: The Square-assigned ID of the site. + validation: + maxLength: 32 + access: read-only + site_title: + type: optional> + docs: The title of the site. + domain: + type: optional> + docs: >- + The domain of the site (without the protocol). For example, + `mysite1.square.site`. + is_published: + type: optional> + docs: Indicates whether the site is published. + created_at: + type: optional + docs: The timestamp of when the site was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp of when the site was last updated, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + Snippet: + docs: >- + Represents the snippet that is added to a Square Online site. The snippet + code is injected into the `head` element of all pages on the site, except + for checkout pages. + properties: + id: + type: optional + docs: The Square-assigned ID for the snippet. + validation: + maxLength: 48 + access: read-only + site_id: + type: optional + docs: The ID of the site that contains the snippet. + access: read-only + content: + type: string + docs: The snippet code, which can contain valid HTML, JavaScript, or both. + validation: + minLength: 1 + maxLength: 65535 + created_at: + type: optional + docs: >- + The timestamp of when the snippet was initially added to the site, in + RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the snippet was last updated on the site, in RFC + 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + SortOrder: + enum: + - DESC + - ASC + docs: >- + The order (e.g., chronological or alphabetical) in which results from a + request are returned. + source: + openapi: openapi/openapi.json + SourceApplication: + docs: Represents information about the application used to generate a change. + properties: + product: + type: optional + docs: |- + __Read only__ The [product](entity:Product) type of the application. + See [Product](#type-product) for possible values + application_id: + type: optional> + docs: >- + __Read only__ The Square-assigned ID of the application. This field is + used only if the + + [product](entity:Product) type is `EXTERNAL_API`. + name: + type: optional> + docs: >- + __Read only__ The display name of the application + + (for example, `"Custom Application"` or `"Square POS 4.74 for + Android"`). + source: + openapi: openapi/openapi.json + SquareAccountDetails: + docs: Additional details about Square Account payments. + properties: + payment_source_token: + type: optional> + docs: Unique identifier for the payment source used for this payment. + validation: + maxLength: 255 + errors: + type: optional>> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + StandardUnitDescription: + docs: Contains the name and abbreviation for standard measurement unit. + properties: + unit: + type: optional + docs: Identifies the measurement unit being described. + name: + type: optional> + docs: UI display name of the measurement unit. For example, 'Pound'. + abbreviation: + type: optional> + docs: UI display abbreviation for the measurement unit. For example, 'lb'. + source: + openapi: openapi/openapi.json + StandardUnitDescriptionGroup: + docs: Group of standard measurement units. + properties: + standard_unit_descriptions: + type: optional>> + docs: >- + List of standard (non-custom) measurement units in this description + group. + language_code: + type: optional> + docs: IETF language tag. + source: + openapi: openapi/openapi.json + SubmitEvidenceResponse: + docs: Defines the fields in a `SubmitEvidence` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + dispute: + type: optional + docs: The `Dispute` for which evidence was submitted. + source: + openapi: openapi/openapi.json + Subscription: + docs: >- + Represents a subscription purchased by a customer. + + + For more information, see + + [Manage + Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). + properties: + id: + type: optional + docs: The Square-assigned ID of the subscription. + validation: + maxLength: 255 + access: read-only + location_id: + type: optional + docs: The ID of the location associated with the subscription. + access: read-only + plan_variation_id: + type: optional + docs: >- + The ID of the subscribed-to [subscription plan + variation](entity:CatalogSubscriptionPlanVariation). + access: read-only + customer_id: + type: optional + docs: The ID of the subscribing [customer](entity:Customer) profile. + access: read-only + start_date: + type: optional + docs: >- + The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the + subscription. + access: read-only + canceled_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to cancel + the subscription, + + when the subscription status changes to `CANCELED` and the + subscription billing stops. + + + If this field is not set, the subscription ends according its + subscription plan. + + + This field cannot be updated, other than being cleared. + charged_through_date: + type: optional + docs: >- + The `YYYY-MM-DD`-formatted date up to when the subscriber is invoiced + for the + + subscription. + + + After the invoice is sent for a given billing period, + + this date will be the last day of the billing period. + + For example, + + suppose for the month of May a subscriber gets an invoice + + (or charged the card) on May 1. For the monthly billing scenario, + + this date is then set to May 31. + access: read-only + status: + type: optional + docs: |- + The current status of the subscription. + See [SubscriptionStatus](#type-subscriptionstatus) for possible values + tax_percentage: + type: optional> + docs: |- + The tax amount applied when billing the subscription. The + percentage is expressed in decimal form, using a `'.'` as the decimal + separator and without a `'%'` sign. For example, a value of `7.5` + corresponds to 7.5%. + invoice_ids: + type: optional> + docs: |- + The IDs of the [invoices](entity:Invoice) created for the + subscription, listed in order when the invoices were created + (newest invoices appear first). + access: read-only + price_override_money: + type: optional + docs: >- + A custom price which overrides the cost of a subscription plan + variation with `STATIC` pricing. + + This field does not affect itemized subscriptions with `RELATIVE` + pricing. Instead, + + you should edit the Subscription's [order + template](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#phases-and-order-templates). + version: + type: optional + docs: >- + The version of the object. When updating an object, the version + + supplied must match the version in the database, otherwise the write + will + + be rejected as conflicting. + created_at: + type: optional + docs: The timestamp when the subscription was created, in RFC 3339 format. + access: read-only + card_id: + type: optional> + docs: |- + The ID of the [subscriber's](entity:Customer) [card](entity:Card) + used to charge for the subscription. + timezone: + type: optional + docs: >- + Timezone that will be used in date calculations for the subscription. + + Defaults to the timezone of the location based on `location_id`. + + Format: the IANA Timezone Database identifier for the location + timezone (for example, `America/Los_Angeles`). + access: read-only + source: + type: optional + docs: The origination details of the subscription. + actions: + type: optional>> + docs: >- + The list of scheduled actions on this subscription. It is set only in + the response from + + [RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) + with the query parameter + + of `include=actions` or from + + [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) + with the input parameter + + of `include:["actions"]`. + monthly_billing_anchor_date: + type: optional + docs: >- + The day of the month on which the subscription will issue invoices and + publish orders. + access: read-only + phases: + type: optional> + docs: array of phases for this subscription + access: read-only + source: + openapi: openapi/openapi.json + SubscriptionAction: + docs: Represents an action as a pending change to a subscription. + properties: + id: + type: optional + docs: The ID of an action scoped to a subscription. + type: + type: optional + docs: >- + The type of the action. + + See [SubscriptionActionType](#type-subscriptionactiontype) for + possible values + effective_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date when the action occurs on the + subscription. + monthly_billing_anchor_date: + type: optional> + docs: >- + The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` + action. + phases: + type: optional>> + docs: A list of Phases, to pass phase-specific information used in the swap. + new_plan_variation_id: + type: optional> + docs: >- + The target subscription plan variation that a subscription switches + to, for a `SWAP_PLAN` action. + source: + openapi: openapi/openapi.json + SubscriptionActionType: + enum: + - CANCEL + - PAUSE + - RESUME + - SWAP_PLAN + - CHANGE_BILLING_ANCHOR_DATE + docs: Supported types of an action as a pending change to a subscription. + source: + openapi: openapi/openapi.json + SubscriptionCadence: + enum: + - DAILY + - WEEKLY + - EVERY_TWO_WEEKS + - THIRTY_DAYS + - SIXTY_DAYS + - NINETY_DAYS + - MONTHLY + - EVERY_TWO_MONTHS + - QUARTERLY + - EVERY_FOUR_MONTHS + - EVERY_SIX_MONTHS + - ANNUAL + - EVERY_TWO_YEARS + docs: Determines the billing cadence of a [Subscription](entity:Subscription) + source: + openapi: openapi/openapi.json + SubscriptionCreatedEvent: + docs: Published when a [Subscription](entity:Subscription) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"subscription.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + SubscriptionCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"subscription"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected subscription. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the created subscription. + source: + openapi: openapi/openapi.json + SubscriptionCreatedEventObject: + properties: + subscription: + type: optional + docs: The created subscription. + source: + openapi: openapi/openapi.json + SubscriptionEvent: + docs: Describes changes to a subscription and the subscription status. + properties: + id: + type: string + docs: The ID of the subscription event. + subscription_event_type: + type: SubscriptionEventSubscriptionEventType + docs: >- + Type of the subscription event. + + See + [SubscriptionEventSubscriptionEventType](#type-subscriptioneventsubscriptioneventtype) + for possible values + effective_date: + type: string + docs: >- + The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the + subscription event occurred. + monthly_billing_anchor_date: + type: optional + docs: >- + The day-of-the-month the billing anchor date was changed to, if + applicable. + access: read-only + info: + type: optional + docs: Additional information about the subscription event. + phases: + type: optional>> + docs: A list of Phases, to pass phase-specific information used in the swap. + plan_variation_id: + type: string + docs: >- + The ID of the subscription plan variation associated with the + subscription. + source: + openapi: openapi/openapi.json + SubscriptionEventInfo: + docs: Provides information about the subscription event. + properties: + detail: + type: optional> + docs: A human-readable explanation for the event. + code: + type: optional + docs: |- + An info code indicating the subscription event that occurred. + See [InfoCode](#type-infocode) for possible values + source: + openapi: openapi/openapi.json + SubscriptionEventInfoCode: + enum: + - LOCATION_NOT_ACTIVE + - LOCATION_CANNOT_ACCEPT_PAYMENT + - CUSTOMER_DELETED + - CUSTOMER_NO_EMAIL + - CUSTOMER_NO_NAME + - USER_PROVIDED + docs: Supported info codes of a subscription event. + source: + openapi: openapi/openapi.json + SubscriptionEventSubscriptionEventType: + enum: + - START_SUBSCRIPTION + - PLAN_CHANGE + - STOP_SUBSCRIPTION + - DEACTIVATE_SUBSCRIPTION + - RESUME_SUBSCRIPTION + - PAUSE_SUBSCRIPTION + - BILLING_ANCHOR_DATE_CHANGED + docs: Supported types of an event occurred to a subscription. + source: + openapi: openapi/openapi.json + SubscriptionPhase: + docs: >- + Describes a phase in a subscription plan variation. For more information, + see [Subscription Plans and + Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). + properties: + uid: + type: optional> + docs: >- + The Square-assigned ID of the subscription phase. This field cannot be + changed after a `SubscriptionPhase` is created. + cadence: + type: SubscriptionCadence + docs: >- + The billing cadence of the phase. For example, weekly or monthly. This + field cannot be changed after a `SubscriptionPhase` is created. + + See [SubscriptionCadence](#type-subscriptioncadence) for possible + values + periods: + type: optional> + docs: >- + The number of `cadence`s the phase lasts. If not set, the phase never + ends. Only the last phase can be indefinite. This field cannot be + changed after a `SubscriptionPhase` is created. + recurring_price_money: + type: optional + docs: >- + The amount to bill for each `cadence`. Failure to specify this field + results in a `MISSING_REQUIRED_PARAMETER` error at runtime. + ordinal: + type: optional> + docs: >- + The position this phase appears in the sequence of phases defined for + the plan, indexed from 0. This field cannot be changed after a + `SubscriptionPhase` is created. + pricing: + type: optional + docs: The subscription pricing. + source: + openapi: openapi/openapi.json + SubscriptionPricing: + docs: Describes the pricing for the subscription. + properties: + type: + type: optional + docs: >- + RELATIVE or STATIC + + See [SubscriptionPricingType](#type-subscriptionpricingtype) for + possible values + discount_ids: + type: optional>> + docs: The ids of the discount catalog objects + price_money: + type: optional + docs: The price of the subscription, if STATIC + source: + openapi: openapi/openapi.json + SubscriptionPricingType: + enum: + - STATIC + - RELATIVE + docs: Determines the pricing of a [Subscription](entity:Subscription) + source: + openapi: openapi/openapi.json + SubscriptionSource: + docs: The origination details of the subscription. + properties: + name: + type: optional> + docs: |- + The name used to identify the place (physical or digital) that + a subscription originates. If unset, the name defaults to the name + of the application that created the subscription. + validation: + maxLength: 255 + source: + openapi: openapi/openapi.json + SubscriptionStatus: + enum: + - PENDING + - ACTIVE + - CANCELED + - DEACTIVATED + - PAUSED + docs: Supported subscription statuses. + source: + openapi: openapi/openapi.json + SubscriptionTestResult: + docs: >- + Represents the details of a webhook subscription, including notification + URL, + + event types, and signature key. + properties: + id: + type: optional + docs: A Square-generated unique ID for the subscription test result. + validation: + maxLength: 64 + access: read-only + status_code: + type: optional> + docs: The status code returned by the subscription notification URL. + payload: + type: optional> + docs: >- + An object containing the payload of the test event. For example, a + `payment.created` event. + created_at: + type: optional + docs: >- + The timestamp of when the subscription was created, in RFC 3339 + format. + + For example, "2016-09-04T23:59:33.123Z". + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the subscription was updated, in RFC 3339 + format. For example, "2016-09-04T23:59:33.123Z". + + Because a subscription test result is unique, this field is the same + as the `created_at` field. + access: read-only + source: + openapi: openapi/openapi.json + SubscriptionUpdatedEvent: + docs: >- + Published when a [Subscription](entity:Subscription) is updated. + + Typically the `subscription.status` is updated as subscriptions become + active + + or cancelled. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"subscription.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + SubscriptionUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"subscription"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected subscription. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the updated subscription. + source: + openapi: openapi/openapi.json + SubscriptionUpdatedEventObject: + properties: + subscription: + type: optional + docs: The updated subscription. + source: + openapi: openapi/openapi.json + SwapPlanResponse: + docs: |- + Defines output parameters in a response of the + [SwapPlan](api-endpoint:Subscriptions-SwapPlan) endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The subscription with the updated subscription plan. + actions: + type: optional> + docs: A list of a `SWAP_PLAN` action created by the request. + source: + openapi: openapi/openapi.json + TaxCalculationPhase: + enum: + - TAX_SUBTOTAL_PHASE + - TAX_TOTAL_PHASE + docs: When to calculate the taxes due on a cart. + source: + openapi: openapi/openapi.json + TaxIds: + docs: Identifiers for the location used by various governments for tax purposes. + properties: + eu_vat: + type: optional + docs: |- + The EU VAT number for this location. For example, `IE3426675K`. + If the EU VAT number is present, it is well-formed and has been + validated with VIES, the VAT Information Exchange System. + access: read-only + fr_siret: + type: optional + docs: >- + The SIRET (Système d'Identification du Répertoire des Entreprises et + de leurs Etablissements) + + number is a 14-digit code issued by the French INSEE. For example, + `39922799000021`. + access: read-only + fr_naf: + type: optional + docs: >- + The French government uses the NAF (Nomenclature des Activités + Françaises) to display and + + track economic statistical data. This is also called the APE (Activite + Principale de l’Entreprise) code. + + For example, `6910Z`. + access: read-only + es_nif: + type: optional + docs: >- + The NIF (Numero de Identificacion Fiscal) number is a nine-character + tax identifier used in Spain. + + If it is present, it has been validated. For example, `73628495A`. + access: read-only + jp_qii: + type: optional + docs: >- + The QII (Qualified Invoice Issuer) number is a 14-character tax + identifier used in Japan. + + For example, `T1234567890123`. + access: read-only + source: + openapi: openapi/openapi.json + TaxInclusionType: + enum: + - ADDITIVE + - INCLUSIVE + docs: >- + Whether to the tax amount should be additional to or included in the + CatalogItem price. + source: + openapi: openapi/openapi.json + TeamMember: + docs: A record representing an individual team member for a business. + properties: + id: + type: optional + docs: The unique ID for the team member. + access: read-only + reference_id: + type: optional> + docs: >- + A second ID used to associate the team member with an entity in + another system. + is_owner: + type: optional + docs: Whether the team member is the owner of the Square account. + access: read-only + status: + type: optional + docs: |- + Describes the status of the team member. + See [TeamMemberStatus](#type-teammemberstatus) for possible values + given_name: + type: optional> + docs: >- + The given name (that is, the first name) associated with the team + member. + family_name: + type: optional> + docs: >- + The family name (that is, the last name) associated with the team + member. + email_address: + type: optional> + docs: >- + The email address associated with the team member. After accepting the + invitation + + from Square, only the team member can change this value. + phone_number: + type: optional> + docs: |- + The team member's phone number, in E.164 format. For example: + +14155552671 - the country code is 1 for US + +551155256325 - the country code is 55 for BR + created_at: + type: optional + docs: The timestamp when the team member was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp when the team member was last updated, in RFC 3339 + format. + access: read-only + assigned_locations: + type: optional + docs: Describes the team member's assigned locations. + wage_setting: + type: optional + docs: >- + Information about the team member's overtime exemption status, job + assignments, and compensation. + source: + openapi: openapi/openapi.json + TeamMemberAssignedLocations: + docs: An object that represents a team member's assignment to locations. + properties: + assignment_type: + type: optional + docs: >- + The current assignment type of the team member. + + See + [TeamMemberAssignedLocationsAssignmentType](#type-teammemberassignedlocationsassignmenttype) + for possible values + location_ids: + type: optional>> + docs: The explicit locations that the team member is assigned to. + source: + openapi: openapi/openapi.json + TeamMemberAssignedLocationsAssignmentType: + enum: + - ALL_CURRENT_AND_FUTURE_LOCATIONS + - EXPLICIT_LOCATIONS + docs: Enumerates the possible assignment types that the team member can have. + source: + openapi: openapi/openapi.json + TeamMemberBookingProfile: + docs: >- + The booking profile of a seller's team member, including the team member's + ID, display name, description and whether the team member can be booked as + a service provider. + properties: + team_member_id: + type: optional + docs: >- + The ID of the [TeamMember](entity:TeamMember) object for the team + member associated with the booking profile. + validation: + maxLength: 32 + access: read-only + description: + type: optional + docs: The description of the team member. + validation: + maxLength: 65536 + access: read-only + display_name: + type: optional + docs: The display name of the team member. + validation: + maxLength: 512 + access: read-only + is_bookable: + type: optional> + docs: >- + Indicates whether the team member can be booked through the Bookings + API or the seller's online booking channel or site (`true`) or not + (`false`). + profile_image_url: + type: optional + docs: The URL of the team member's image for the bookings profile. + validation: + maxLength: 2048 + access: read-only + source: + openapi: openapi/openapi.json + TeamMemberCreatedEvent: + docs: Published when a Team Member is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"team_member.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TeamMemberCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"team_member"`. + id: + type: optional + docs: ID of the created team member. + object: + type: optional + docs: An object containing the created team member. + source: + openapi: openapi/openapi.json + TeamMemberCreatedEventObject: + properties: + team_member: + type: optional + docs: The created team member. + source: + openapi: openapi/openapi.json + TeamMemberInvitationStatus: + enum: + - UNINVITED + - PENDING + - ACCEPTED + docs: >- + Enumerates the possible invitation statuses the team member can have + within a business. + source: + openapi: openapi/openapi.json + TeamMemberStatus: + enum: + - ACTIVE + - INACTIVE + docs: >- + Enumerates the possible statuses the team member can have within a + business. + source: + openapi: openapi/openapi.json + TeamMemberUpdatedEvent: + docs: Published when a Team Member is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"team_member.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TeamMemberUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"team_member"`. + id: + type: optional + docs: ID of the affected team member. + object: + type: optional + docs: An object containing the updated team member. + source: + openapi: openapi/openapi.json + TeamMemberUpdatedEventObject: + properties: + team_member: + type: optional + docs: The updated team member. + source: + openapi: openapi/openapi.json + TeamMemberWage: + docs: |- + Job and wage information for a [team member](entity:TeamMember). + This convenience object provides details needed to specify the `wage` + field for a [timecard](entity:Timecard). + properties: + id: + type: optional + docs: The UUID for this object. + team_member_id: + type: optional> + docs: The `TeamMember` that this wage is assigned to. + title: + type: optional> + docs: The job title that this wage relates to. + hourly_rate: + type: optional + docs: |- + Can be a custom-set hourly wage or the calculated effective hourly + wage based on the annual wage and hours worked per week. + job_id: + type: optional> + docs: An identifier for the [job](entity:Job) that this wage relates to. + tip_eligible: + type: optional> + docs: Whether team members are eligible for tips when working this job. + source: + openapi: openapi/openapi.json + TeamMemberWageSettingUpdatedEvent: + docs: Published when a Wage Setting is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: >- + The type of event this represents, + `"team_member.wage_setting.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TeamMemberWageSettingUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"wage_setting"`. + id: + type: optional + docs: ID of the updated team member wage setting. + object: + type: optional + docs: An object containing the updated team member wage setting. + source: + openapi: openapi/openapi.json + TeamMemberWageSettingUpdatedEventObject: + properties: + wage_setting: + type: optional + docs: The updated team member wage setting. + source: + openapi: openapi/openapi.json + Tender: + docs: >- + Represents a tender (i.e., a method of payment) used in a Square + transaction. + properties: + id: + type: optional + docs: The tender's unique ID. It is the associated payment ID. + validation: + maxLength: 192 + location_id: + type: optional> + docs: The ID of the transaction's associated location. + validation: + maxLength: 50 + transaction_id: + type: optional> + docs: The ID of the tender's associated transaction. + validation: + maxLength: 192 + created_at: + type: optional + docs: The timestamp for when the tender was created, in RFC 3339 format. + validation: + maxLength: 32 + access: read-only + note: + type: optional> + docs: An optional note associated with the tender at the time of payment. + validation: + maxLength: 500 + amount_money: + type: optional + docs: >- + The total amount of the tender, including `tip_money`. If the tender + has a `payment_id`, + + the `total_money` of the corresponding [Payment](entity:Payment) will + be equal to the + + `amount_money` of the tender. + tip_money: + type: optional + docs: The tip's amount of the tender. + processing_fee_money: + type: optional + docs: >- + The amount of any Square processing fees applied to the tender. + + + This field is not immediately populated when a new transaction is + created. + + It is usually available after about ten seconds. + customer_id: + type: optional> + docs: >- + If the tender is associated with a customer or represents a customer's + card on file, + + this is the ID of the associated customer. + validation: + maxLength: 191 + type: + type: TenderType + docs: |- + The type of tender, such as `CARD` or `CASH`. + See [TenderType](#type-tendertype) for possible values + card_details: + type: optional + docs: |- + The details of the card tender. + + This value is present only if the value of `type` is `CARD`. + cash_details: + type: optional + docs: |- + The details of the cash tender. + + This value is present only if the value of `type` is `CASH`. + bank_account_details: + type: optional + docs: |- + The details of the bank account tender. + + This value is present only if the value of `type` is `BANK_ACCOUNT`. + buy_now_pay_later_details: + type: optional + docs: >- + The details of a Buy Now Pay Later tender. + + + This value is present only if the value of `type` is + `BUY_NOW_PAY_LATER`. + square_account_details: + type: optional + docs: |- + The details of a Square Account tender. + + This value is present only if the value of `type` is `SQUARE_ACCOUNT`. + additional_recipients: + type: optional>> + docs: >- + Additional recipients (other than the merchant) receiving a portion of + this tender. + + For example, fees assessed on the purchase by a third party + integration. + payment_id: + type: optional> + docs: >- + The ID of the [Payment](entity:Payment) that corresponds to this + tender. + + This value is only present for payments created with the v2 Payments + API. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + TenderBankAccountDetails: + docs: |- + Represents the details of a tender with `type` `BANK_ACCOUNT`. + + See [BankAccountPaymentDetails](entity:BankAccountPaymentDetails) + for more exposed details of a bank account payment. + properties: + status: + type: optional + docs: >- + The bank account payment's current state. + + + See + [TenderBankAccountPaymentDetailsStatus](entity:TenderBankAccountDetailsStatus) + for possible values. + + See + [TenderBankAccountDetailsStatus](#type-tenderbankaccountdetailsstatus) + for possible values + source: + openapi: openapi/openapi.json + TenderBankAccountDetailsStatus: + enum: + - PENDING + - COMPLETED + - FAILED + docs: Indicates the bank account payment's current status. + source: + openapi: openapi/openapi.json + TenderBuyNowPayLaterDetails: + docs: Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. + properties: + buy_now_pay_later_brand: + type: optional + docs: |- + The Buy Now Pay Later brand. + See [Brand](#type-brand) for possible values + status: + type: optional + docs: >- + The buy now pay later payment's current state (such as `AUTHORIZED` or + + `CAPTURED`). See + [TenderBuyNowPayLaterDetailsStatus](entity:TenderBuyNowPayLaterDetailsStatus) + + for possible values. + + See [Status](#type-status) for possible values + source: + openapi: openapi/openapi.json + TenderBuyNowPayLaterDetailsBrand: + enum: + - OTHER_BRAND + - AFTERPAY + source: + openapi: openapi/openapi.json + TenderBuyNowPayLaterDetailsStatus: + enum: + - AUTHORIZED + - CAPTURED + - VOIDED + - FAILED + source: + openapi: openapi/openapi.json + TenderCardDetails: + docs: >- + Represents additional details of a tender with `type` `CARD` or + `SQUARE_GIFT_CARD` + properties: + status: + type: optional + docs: >- + The credit card payment's current state (such as `AUTHORIZED` or + + `CAPTURED`). See + [TenderCardDetailsStatus](entity:TenderCardDetailsStatus) + + for possible values. + + See [TenderCardDetailsStatus](#type-tendercarddetailsstatus) for + possible values + card: + type: optional + docs: The credit card's non-confidential details. + entry_method: + type: optional + docs: >- + The method used to enter the card's details for the transaction. + + See [TenderCardDetailsEntryMethod](#type-tendercarddetailsentrymethod) + for possible values + source: + openapi: openapi/openapi.json + TenderCardDetailsEntryMethod: + enum: + - SWIPED + - KEYED + - EMV + - ON_FILE + - CONTACTLESS + docs: Indicates the method used to enter the card's details. + source: + openapi: openapi/openapi.json + TenderCardDetailsStatus: + enum: + - AUTHORIZED + - CAPTURED + - VOIDED + - FAILED + docs: Indicates the card transaction's current status. + source: + openapi: openapi/openapi.json + TenderCashDetails: + docs: Represents the details of a tender with `type` `CASH`. + properties: + buyer_tendered_money: + type: optional + docs: >- + The total amount of cash provided by the buyer, before change is + given. + change_back_money: + type: optional + docs: The amount of change returned to the buyer. + source: + openapi: openapi/openapi.json + TenderSquareAccountDetails: + docs: Represents the details of a tender with `type` `SQUARE_ACCOUNT`. + properties: + status: + type: optional + docs: >- + The Square Account payment's current state (such as `AUTHORIZED` or + + `CAPTURED`). See + [TenderSquareAccountDetailsStatus](entity:TenderSquareAccountDetailsStatus) + + for possible values. + + See [Status](#type-status) for possible values + source: + openapi: openapi/openapi.json + TenderSquareAccountDetailsStatus: + enum: + - AUTHORIZED + - CAPTURED + - VOIDED + - FAILED + source: + openapi: openapi/openapi.json + TenderType: + enum: + - CARD + - CASH + - THIRD_PARTY_CARD + - SQUARE_GIFT_CARD + - NO_SALE + - BANK_ACCOUNT + - WALLET + - BUY_NOW_PAY_LATER + - SQUARE_ACCOUNT + - OTHER + docs: Indicates a tender's type. + source: + openapi: openapi/openapi.json + TerminalAction: + docs: Represents an action processed by the Square Terminal. + properties: + id: + type: optional + docs: A unique ID for this `TerminalAction`. + validation: + minLength: 10 + maxLength: 255 + access: read-only + device_id: + type: optional> + docs: |- + The unique Id of the device intended for this `TerminalAction`. + The Id can be retrieved from /v2/devices api. + deadline_duration: + type: optional> + docs: >- + The duration as an RFC 3339 duration, after which the action will be + automatically canceled. + + TerminalActions that are `PENDING` will be automatically `CANCELED` + and have a cancellation reason + + of `TIMED_OUT` + + + Default: 5 minutes from creation + + + Maximum: 5 minutes + status: + type: optional + docs: >- + The status of the `TerminalAction`. + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, + `COMPLETED` + access: read-only + cancel_reason: + type: optional + docs: >- + The reason why `TerminalAction` is canceled. Present if the status is + `CANCELED`. + + See [ActionCancelReason](#type-actioncancelreason) for possible values + created_at: + type: optional + docs: >- + The time when the `TerminalAction` was created as an RFC 3339 + timestamp. + access: read-only + updated_at: + type: optional + docs: >- + The time when the `TerminalAction` was last updated as an RFC 3339 + timestamp. + access: read-only + app_id: + type: optional + docs: The ID of the application that created the action. + access: read-only + location_id: + type: optional + docs: The location id the action is attached to, if a link can be made. + validation: + maxLength: 64 + access: read-only + type: + type: optional + docs: |- + Represents the type of the action. + See [ActionType](#type-actiontype) for possible values + qr_code_options: + type: optional + docs: >- + Describes configuration for the QR code action. Requires `QR_CODE` + type. + save_card_options: + type: optional + docs: >- + Describes configuration for the save-card action. Requires `SAVE_CARD` + type. + signature_options: + type: optional + docs: >- + Describes configuration for the signature capture action. Requires + `SIGNATURE` type. + confirmation_options: + type: optional + docs: >- + Describes configuration for the confirmation action. Requires + `CONFIRMATION` type. + receipt_options: + type: optional + docs: >- + Describes configuration for the receipt action. Requires `RECEIPT` + type. + data_collection_options: + type: optional + docs: >- + Describes configuration for the data collection action. Requires + `DATA_COLLECTION` type. + select_options: + type: optional + docs: Describes configuration for the select action. Requires `SELECT` type. + device_metadata: + type: optional + docs: >- + Details about the Terminal that received the action request (such as + battery level, + + operating system version, and network connection settings). + + + Only available for `PING` action type. + await_next_action: + type: optional> + docs: >- + Indicates the action will be linked to another action and requires a + waiting dialog to be + + displayed instead of returning to the idle screen on completion of the + action. + + + Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT + types. + await_next_action_duration: + type: optional> + docs: >- + The timeout duration of the waiting dialog as an RFC 3339 duration, + after which the + + waiting dialog will no longer be displayed and the Terminal will + return to the idle screen. + + + Default: 5 minutes from when the waiting dialog is displayed + + + Maximum: 5 minutes + source: + openapi: openapi/openapi.json + TerminalActionActionType: + enum: + - QR_CODE + - PING + - SAVE_CARD + - SIGNATURE + - CONFIRMATION + - RECEIPT + - DATA_COLLECTION + - SELECT + docs: >- + Describes the type of this unit and indicates which field contains the + unit information. This is an ‘open’ enum. + source: + openapi: openapi/openapi.json + TerminalActionCreatedEvent: + docs: Published when a TerminalAction is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.action.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalActionCreatedEventData: + properties: + type: + type: optional> + docs: Name of the created object’s type, `"action"`. + id: + type: optional + docs: ID of the created terminal action. + object: + type: optional + docs: An object containing the created terminal action. + source: + openapi: openapi/openapi.json + TerminalActionCreatedEventObject: + properties: + action: + type: optional + docs: The created terminal action. + source: + openapi: openapi/openapi.json + TerminalActionQuery: + properties: + filter: + type: optional + docs: Options for filtering returned `TerminalAction`s + sort: + type: optional + docs: Option for sorting returned `TerminalAction` objects. + source: + openapi: openapi/openapi.json + TerminalActionQueryFilter: + properties: + device_id: + type: optional> + docs: >- + `TerminalAction`s associated with a specific device. If no device is + specified then all + + `TerminalAction`s for the merchant will be displayed. + created_at: + type: optional + docs: |- + Time range for the beginning of the reporting period. Inclusive. + Default value: The current time minus one day. + Note that `TerminalAction`s are available for 30 days after creation. + status: + type: optional> + docs: >- + Filter results with the desired status of the `TerminalAction` + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, + `COMPLETED` + type: + type: optional + docs: >- + Filter results with the requested ActionType. + + See [TerminalActionActionType](#type-terminalactionactiontype) for + possible values + source: + openapi: openapi/openapi.json + TerminalActionQuerySort: + properties: + sort_order: + type: optional + docs: |- + The order in which results are listed. + - `ASC` - Oldest to newest. + - `DESC` - Newest to oldest (default). + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + TerminalActionUpdatedEvent: + docs: Published when a TerminalAction is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.action.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalActionUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the updated object’s type, `"action"`. + id: + type: optional + docs: ID of the updated terminal action. + object: + type: optional + docs: An object containing the updated terminal action. + source: + openapi: openapi/openapi.json + TerminalActionUpdatedEventObject: + properties: + action: + type: optional + docs: The updated terminal action. + source: + openapi: openapi/openapi.json + TerminalCheckout: + docs: Represents a checkout processed by the Square Terminal. + properties: + id: + type: optional + docs: A unique ID for this `TerminalCheckout`. + validation: + minLength: 10 + maxLength: 255 + access: read-only + amount_money: + type: Money + docs: >- + The amount of money (including the tax amount) that the Square + Terminal device should try to collect. + reference_id: + type: optional> + docs: >- + An optional user-defined reference ID that can be used to associate + + this `TerminalCheckout` to another entity in an external system. For + example, an order + + ID generated by a third-party shopping cart. The ID is also associated + with any payments + + used to complete the checkout. + validation: + maxLength: 40 + note: + type: optional> + docs: >- + An optional note to associate with the checkout, as well as with any + payments used to complete the checkout. + + Note: maximum 500 characters + validation: + maxLength: 500 + order_id: + type: optional> + docs: The reference to the Square order ID for the checkout request. + payment_options: + type: optional + docs: Payment-specific options for the checkout request. + device_options: + type: DeviceCheckoutOptions + docs: >- + Options to control the display and behavior of the Square Terminal + device. + deadline_duration: + type: optional> + docs: >- + An RFC 3339 duration, after which the checkout is automatically + canceled. + + A `TerminalCheckout` that is `PENDING` is automatically `CANCELED` and + has a cancellation reason + + of `TIMED_OUT`. + + + Default: 5 minutes from creation + + + Maximum: 5 minutes + status: + type: optional + docs: >- + The status of the `TerminalCheckout`. + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, + `COMPLETED` + access: read-only + cancel_reason: + type: optional + docs: >- + The reason why `TerminalCheckout` is canceled. Present if the status + is `CANCELED`. + + See [ActionCancelReason](#type-actioncancelreason) for possible values + payment_ids: + type: optional> + docs: A list of IDs for payments created by this `TerminalCheckout`. + access: read-only + created_at: + type: optional + docs: >- + The time when the `TerminalCheckout` was created, as an RFC 3339 + timestamp. + access: read-only + updated_at: + type: optional + docs: >- + The time when the `TerminalCheckout` was last updated, as an RFC 3339 + timestamp. + access: read-only + app_id: + type: optional + docs: The ID of the application that created the checkout. + access: read-only + location_id: + type: optional + docs: The location of the device where the `TerminalCheckout` was directed. + validation: + maxLength: 64 + access: read-only + payment_type: + type: optional + docs: >- + The type of payment the terminal should attempt to capture from. + Defaults to `CARD_PRESENT`. + + See [CheckoutOptionsPaymentType](#type-checkoutoptionspaymenttype) for + possible values + team_member_id: + type: optional> + docs: >- + An optional ID of the team member associated with creating the + checkout. + customer_id: + type: optional> + docs: An optional ID of the customer associated with the checkout. + app_fee_money: + type: optional + docs: >- + The amount the developer is taking as a fee for facilitating the + payment on behalf + + of the seller. + + + The amount cannot be more than 90% of the total amount of the payment. + + + The amount must be specified in the smallest denomination of the + applicable currency (for example, US dollar amounts are specified in + cents). For more information, see [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + + + The fee currency code must match the currency associated with the + seller that is accepting the payment. The application must be from a + developer account in the same country and using the same currency code + as the seller. + + + For more information about the application fee scenario, see [Take + Payments and Collect + Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + + + To set this field, PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS OAuth + permission is required. For more information, see + [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions). + statement_description_identifier: + type: optional> + docs: >- + Optional additional payment information to include on the customer's + card statement as + + part of the statement description. This can be, for example, an + invoice number, ticket number, + + or short description that uniquely identifies the purchase. + validation: + maxLength: 20 + tip_money: + type: optional + docs: >- + The amount designated as a tip, in addition to `amount_money`. This + may only be set for a + + checkout that has tipping disabled (`tip_settings.allow_tipping` is + `false`). + source: + openapi: openapi/openapi.json + TerminalCheckoutCreatedEvent: + docs: Published when a [TerminalCheckout](entity:TerminalCheckout) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.checkout.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalCheckoutCreatedEventData: + properties: + type: + type: optional> + docs: Name of the created object’s type, `"checkout"`. + id: + type: optional + docs: ID of the created terminal checkout. + validation: + minLength: 10 + maxLength: 255 + object: + type: optional + docs: An object containing the created terminal checkout + source: + openapi: openapi/openapi.json + TerminalCheckoutCreatedEventObject: + properties: + checkout: + type: optional + docs: The created terminal checkout + source: + openapi: openapi/openapi.json + TerminalCheckoutQuery: + properties: + filter: + type: optional + docs: Options for filtering returned `TerminalCheckout` objects. + sort: + type: optional + docs: Option for sorting returned `TerminalCheckout` objects. + source: + openapi: openapi/openapi.json + TerminalCheckoutQueryFilter: + properties: + device_id: + type: optional> + docs: >- + The `TerminalCheckout` objects associated with a specific device. If + no device is specified, then all + + `TerminalCheckout` objects for the merchant are displayed. + created_at: + type: optional + docs: >- + The time range for the beginning of the reporting period, which is + inclusive. + + Default value: The current time minus one day. + + Note that `TerminalCheckout`s are available for 30 days after + creation. + status: + type: optional> + docs: >- + Filtered results with the desired status of the `TerminalCheckout`. + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, + `COMPLETED` + source: + openapi: openapi/openapi.json + TerminalCheckoutQuerySort: + properties: + sort_order: + type: optional + docs: |- + The order in which results are listed. + Default: `DESC` + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + TerminalCheckoutUpdatedEvent: + docs: Published when a [TerminalCheckout](entity:TerminalCheckout) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.checkout.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalCheckoutUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the updated object’s type, `"checkout"`. + id: + type: optional + docs: ID of the updated terminal checkout. + validation: + minLength: 10 + maxLength: 255 + object: + type: optional + docs: An object containing the updated terminal checkout + source: + openapi: openapi/openapi.json + TerminalCheckoutUpdatedEventObject: + properties: + checkout: + type: optional + docs: The updated terminal checkout + source: + openapi: openapi/openapi.json + TerminalRefund: + docs: >- + Represents a payment refund processed by the Square Terminal. Only + supports Interac (Canadian debit network) payment refunds. + properties: + id: + type: optional + docs: A unique ID for this `TerminalRefund`. + validation: + minLength: 10 + maxLength: 255 + access: read-only + refund_id: + type: optional + docs: >- + The reference to the payment refund created by completing this + `TerminalRefund`. + access: read-only + payment_id: + type: string + docs: The unique ID of the payment being refunded. + validation: + minLength: 1 + order_id: + type: optional + docs: >- + The reference to the Square order ID for the payment identified by the + `payment_id`. + access: read-only + amount_money: + type: Money + docs: >- + The amount of money, inclusive of `tax_money`, that the + `TerminalRefund` should return. + + This value is limited to the amount taken in the original payment + minus any completed or + + pending refunds. + reason: + type: string + docs: A description of the reason for the refund. + validation: + maxLength: 192 + device_id: + type: string + docs: |- + The unique ID of the device intended for this `TerminalRefund`. + The Id can be retrieved from /v2/devices api. + deadline_duration: + type: optional> + docs: >- + The RFC 3339 duration, after which the refund is automatically + canceled. + + A `TerminalRefund` that is `PENDING` is automatically `CANCELED` and + has a cancellation reason + + of `TIMED_OUT`. + + + Default: 5 minutes from creation. + + + Maximum: 5 minutes + status: + type: optional + docs: >- + The status of the `TerminalRefund`. + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or + `COMPLETED`. + access: read-only + cancel_reason: + type: optional + docs: |- + Present if the status is `CANCELED`. + See [ActionCancelReason](#type-actioncancelreason) for possible values + created_at: + type: optional + docs: >- + The time when the `TerminalRefund` was created, as an RFC 3339 + timestamp. + access: read-only + updated_at: + type: optional + docs: >- + The time when the `TerminalRefund` was last updated, as an RFC 3339 + timestamp. + access: read-only + app_id: + type: optional + docs: The ID of the application that created the refund. + access: read-only + location_id: + type: optional + docs: The location of the device where the `TerminalRefund` was directed. + validation: + maxLength: 64 + access: read-only + source: + openapi: openapi/openapi.json + TerminalRefundCreatedEvent: + docs: Published when a Terminal API refund is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.refund.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalRefundCreatedEventData: + properties: + type: + type: optional> + docs: Name of the created object’s type, `"refund"`. + id: + type: optional + docs: ID of the created terminal refund. + object: + type: optional + docs: An object containing the created terminal refund. + source: + openapi: openapi/openapi.json + TerminalRefundCreatedEventObject: + properties: + refund: + type: optional + docs: The created terminal refund. + source: + openapi: openapi/openapi.json + TerminalRefundQuery: + properties: + filter: + type: optional + docs: The filter for the Terminal refund query. + sort: + type: optional + docs: The sort order for the Terminal refund query. + source: + openapi: openapi/openapi.json + TerminalRefundQueryFilter: + properties: + device_id: + type: optional> + docs: >- + `TerminalRefund` objects associated with a specific device. If no + device is specified, then all + + `TerminalRefund` objects for the signed-in account are displayed. + created_at: + type: optional + docs: >- + The timestamp for the beginning of the reporting period, in RFC 3339 + format. Inclusive. + + Default value: The current time minus one day. + + Note that `TerminalRefund`s are available for 30 days after creation. + status: + type: optional> + docs: >- + Filtered results with the desired status of the `TerminalRefund`. + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or + `COMPLETED`. + source: + openapi: openapi/openapi.json + TerminalRefundQuerySort: + properties: + sort_order: + type: optional> + docs: |- + The order in which results are listed. + - `ASC` - Oldest to newest. + - `DESC` - Newest to oldest (default). + source: + openapi: openapi/openapi.json + TerminalRefundUpdatedEvent: + docs: Published when a Terminal API refund is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.refund.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalRefundUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the updated object’s type, `"refund"`. + id: + type: optional + docs: ID of the updated terminal refund. + object: + type: optional + docs: An object containing the updated terminal refund. + source: + openapi: openapi/openapi.json + TerminalRefundUpdatedEventObject: + properties: + refund: + type: optional + docs: The updated terminal refund. + source: + openapi: openapi/openapi.json + TestWebhookSubscriptionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [TestWebhookSubscription](api-endpoint:WebhookSubscriptions-TestWebhookSubscription) + endpoint. + + + Note: If there are errors processing the request, the + [SubscriptionTestResult](entity:SubscriptionTestResult) field is not + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + subscription_test_result: + type: optional + docs: The [SubscriptionTestResult](entity:SubscriptionTestResult). + source: + openapi: openapi/openapi.json + TimeRange: + docs: |- + Represents a generic time range. The start and end values are + represented in RFC 3339 format. Time ranges are customized to be + inclusive or exclusive based on the needs of a particular endpoint. + Refer to the relevant endpoint-specific documentation to determine + how time ranges are handled. + properties: + start_at: + type: optional> + docs: |- + A datetime value in RFC 3339 format indicating when the time range + starts. + end_at: + type: optional> + docs: |- + A datetime value in RFC 3339 format indicating when the time range + ends. + source: + openapi: openapi/openapi.json + Timecard: + docs: >- + A record of the hourly rate, start time, and end time of a single timecard + (shift) + + for a team member. This might include a record of the start and end times + of breaks + + taken during the shift. + properties: + id: + type: optional + docs: '**Read only** The Square-issued UUID for this object.' + validation: + maxLength: 255 + location_id: + type: string + docs: >- + The ID of the [location](entity:Location) for this timecard. The + location should be based on + + where the team member clocked in. + validation: + minLength: 1 + timezone: + type: optional> + docs: >- + **Read only** The time zone calculated from the location based on the + `location_id`, + + provided as a convenience value. Format: the IANA time zone database + identifier for the + + location time zone. + start_at: + type: string + docs: >- + The start time of the timecard, in RFC 3339 format and shifted to the + location + + timezone + offset. Precision up to the minute is respected; seconds + are truncated. + validation: + minLength: 1 + end_at: + type: optional> + docs: >- + The end time of the timecard, in RFC 3339 format and shifted to the + location + + timezone + offset. Precision up to the minute is respected; seconds + are truncated. + wage: + type: optional + docs: >- + Job and pay related information. If the wage is not set on create, it + defaults to a wage + + of zero. If the title is not set on create, it defaults to the name of + the role the team member + + is assigned to, if any. + breaks: + type: optional>> + docs: >- + A list of all the paid or unpaid breaks that were taken during this + timecard. + status: + type: optional + docs: |- + Describes the working state of the timecard. + See [TimecardStatus](#type-timecardstatus) for possible values + version: + type: optional + docs: >- + **Read only** The current version of the timecard, which is + incremented with each update. + + This field is used for [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control to ensure that requests don't overwrite data from another + request. + created_at: + type: optional + docs: >- + The timestamp of when the timecard was created, in RFC 3339 format + presented as UTC. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the timecard was last updated, in RFC 3339 + format presented as UTC. + access: read-only + team_member_id: + type: string + docs: >- + The ID of the [team member](entity:TeamMember) this timecard belongs + to. + validation: + minLength: 1 + declared_cash_tip_money: + type: optional + docs: The cash tips declared by the team member for this timecard. + source: + openapi: openapi/openapi.json + TimecardFilter: + docs: |- + Defines a filter used in a search for `Timecard` records. `AND` logic is + used by Square's servers to apply each filter property specified. + properties: + location_ids: + type: optional>> + docs: Fetch timecards for the specified location. + status: + type: optional + docs: >- + Fetch a `Timecard` instance by `Timecard.status`. + + See [TimecardFilterStatus](#type-timecardfilterstatus) for possible + values + start: + type: optional + docs: Fetch `Timecard` instances that start in the time range - Inclusive. + end: + type: optional + docs: Fetch the `Timecard` instances that end in the time range - Inclusive. + workday: + type: optional + docs: Fetch the `Timecard` instances based on the workday date range. + team_member_ids: + type: optional>> + docs: Fetch timecards for the specified team members. + source: + openapi: openapi/openapi.json + TimecardFilterStatus: + enum: + - OPEN + - CLOSED + docs: Specifies the `status` of `Timecard` records to be returned. + source: + openapi: openapi/openapi.json + TimecardQuery: + docs: >- + The parameters of a `Timecard` search query, which includes filter and + sort options. + properties: + filter: + type: optional + docs: Query filter options. + sort: + type: optional + docs: Sort order details. + source: + openapi: openapi/openapi.json + TimecardSort: + docs: Sets the sort order of search results. + properties: + field: + type: optional + docs: |- + The field to sort on. + See [TimecardSortField](#type-timecardsortfield) for possible values + order: + type: optional + docs: |- + The order in which results are returned. Defaults to DESC. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + TimecardSortField: + enum: + - START_AT + - END_AT + - CREATED_AT + - UPDATED_AT + docs: Enumerates the `Timecard` fields to sort on. + source: + openapi: openapi/openapi.json + TimecardStatus: + enum: + - OPEN + - CLOSED + docs: >- + **Read only** Enumerates the possible status of a + [timecard](entity:Timecard). + source: + openapi: openapi/openapi.json + TimecardWage: + docs: >- + The hourly wage rate used to compensate a team member for a + [timecard](entity:Timecard). + properties: + title: + type: optional> + docs: The name of the job performed during this timecard. + hourly_rate: + type: optional + docs: |- + Can be a custom-set hourly wage or the calculated effective hourly + wage based on the annual wage and hours worked per week. + job_id: + type: optional + docs: |- + The ID of the [job](entity:Job) performed for this timecard. Square + labor-reporting UIs might group timecards together by ID. + access: read-only + tip_eligible: + type: optional> + docs: Whether team members are eligible for tips when working this job. + source: + openapi: openapi/openapi.json + TimecardWorkday: + docs: |- + A `Timecard` search query filter parameter that sets a range of days that + a `Timecard` must start or end in before passing the filter condition. + properties: + date_range: + type: optional + docs: Dates for fetching the timecards. + match_timecards_by: + type: optional + docs: >- + The strategy on which the dates are applied. + + See [TimecardWorkdayMatcher](#type-timecardworkdaymatcher) for + possible values + default_timezone: + type: optional> + docs: >- + Location-specific timezones convert workdays to datetime filters. + + Every location included in the query must have a timezone or this + field + + must be provided as a fallback. Format: the IANA timezone database + + identifier for the relevant timezone. + source: + openapi: openapi/openapi.json + TimecardWorkdayMatcher: + enum: + - START_AT + - END_AT + - INTERSECTION + docs: Defines the logic used to apply a workday filter. + source: + openapi: openapi/openapi.json + TipSettings: + properties: + allow_tipping: + type: optional> + docs: >- + Indicates whether tipping is enabled for this checkout. Defaults to + false. + separate_tip_screen: + type: optional> + docs: >- + Indicates whether tip options should be presented on the screen before + presenting + + the signature screen during card payment. Defaults to false. + custom_tip_field: + type: optional> + docs: >- + Indicates whether custom tip amounts are allowed during the checkout + flow. Defaults to false. + tip_percentages: + type: optional>> + docs: >- + A list of tip percentages that should be presented during the checkout + flow, specified as + + up to 3 non-negative integers from 0 to 100 (inclusive). Defaults to + 15, 20, and 25. + smart_tipping: + type: optional> + docs: >- + Enables the "Smart Tip Amounts" behavior. + + Exact tipping options depend on the region in which the Square seller + is active. + + + For payments under 10.00, in the Australia, Canada, Ireland, United + Kingdom, and United States, tipping options are presented as no tip, + .50, 1.00 or 2.00. + + + For payment amounts of 10.00 or greater, tipping options are presented + as the following percentages: 0%, 5%, 10%, 15%. + + + If set to true, the `tip_percentages` settings is ignored. + + Defaults to false. + + + To learn more about smart tipping, see [Accept Tips with the Square + App](https://squareup.com/help/us/en/article/5069-accept-tips-with-the-square-app). + source: + openapi: openapi/openapi.json + Transaction: + docs: >- + Represents a transaction processed with Square, either with the + + Connect API or with Square Point of Sale. + + + The `tenders` field of this object lists all methods of payment used to + pay in + + the transaction. + properties: + id: + type: optional + docs: The transaction's unique ID, issued by Square payments servers. + validation: + maxLength: 192 + location_id: + type: optional> + docs: The ID of the transaction's associated location. + validation: + maxLength: 50 + created_at: + type: optional + docs: >- + The timestamp for when the transaction was created, in RFC 3339 + format. + validation: + maxLength: 32 + tenders: + type: optional>> + docs: The tenders used to pay in the transaction. + refunds: + type: optional>> + docs: Refunds that have been applied to any tender in the transaction. + reference_id: + type: optional> + docs: >- + If the transaction was created with the + [Charge](api-endpoint:Transactions-Charge) + + endpoint, this value is the same as the value provided for the + `reference_id` + + parameter in the request to that endpoint. Otherwise, it is not set. + validation: + maxLength: 40 + product: + type: optional + docs: |- + The Square product that processed the transaction. + See [TransactionProduct](#type-transactionproduct) for possible values + client_id: + type: optional> + docs: >- + If the transaction was created in the Square Point of Sale app, this + value + + is the ID generated for the transaction by Square Point of Sale. + + + This ID has no relationship to the transaction's canonical `id`, which + is + + generated by Square's backend servers. This value is generated for + bookkeeping + + purposes, in case the transaction cannot immediately be completed (for + example, + + if the transaction is processed in offline mode). + + + It is not currently possible with the Connect API to perform a + transaction + + lookup by this value. + validation: + maxLength: 192 + shipping_address: + type: optional
+ docs: The shipping address provided in the request, if any. + order_id: + type: optional> + docs: >- + The order_id is an identifier for the order associated with this + transaction, if any. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + TransactionProduct: + enum: + - REGISTER + - EXTERNAL_API + - BILLING + - APPOINTMENTS + - INVOICES + - ONLINE_STORE + - PAYROLL + - OTHER + docs: Indicates the Square product used to process a transaction. + source: + openapi: openapi/openapi.json + TransactionType: + enum: + - DEBIT + - CREDIT + docs: The transaction type used in the disputed payment. + source: + openapi: openapi/openapi.json + UnlinkCustomerFromGiftCardResponse: + docs: >- + A response that contains the unlinked `GiftCard` object. If the request + resulted in errors, + + the response contains a set of `Error` objects. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: >- + The gift card with the ID of the unlinked customer removed from the + `customer_ids` field. + + If no other customers are linked, the `customer_ids` field is also + removed. + source: + openapi: openapi/openapi.json + UpdateBookingCustomAttributeDefinitionResponse: + docs: >- + Represents an + [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The updated custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateBookingResponse: + properties: + booking: + type: optional + docs: The booking that was updated. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateBreakTypeResponse: + docs: >- + A response to a request to update a `BreakType`. The response contains + + the requested `BreakType` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + break_type: + type: optional + docs: The response object. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateCatalogImageRequest: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this UpdateCatalogImage request. + + Keys can be any valid string but must be unique for every + UpdateCatalogImage request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 128 + source: + openapi: openapi/openapi.json + UpdateCatalogImageResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + image: + type: optional + docs: |- + The newly updated `CatalogImage` including a Square-generated + URL for the encapsulated image file. + source: + openapi: openapi/openapi.json + UpdateCustomerCustomAttributeDefinitionResponse: + docs: >- + Represents an + [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The updated custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateCustomerGroupResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [UpdateCustomerGroup](api-endpoint:CustomerGroups-UpdateCustomerGroup) + endpoint. + + + Either `errors` or `group` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + group: + type: optional + docs: The successfully updated customer group. + source: + openapi: openapi/openapi.json + UpdateCustomerResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [UpdateCustomer](api-endpoint:Customers-UpdateCustomer) + or + + [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) + endpoint. + + + Either `errors` or `customer` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + customer: + type: optional + docs: The updated customer. + source: + openapi: openapi/openapi.json + UpdateInvoiceResponse: + docs: Describes a `UpdateInvoice` response. + properties: + invoice: + type: optional + docs: The updated invoice. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + UpdateItemModifierListsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + updated_at: + type: optional + docs: >- + The database + [timestamp](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates) + of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. + source: + openapi: openapi/openapi.json + UpdateItemTaxesResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + updated_at: + type: optional + docs: >- + The database + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. + source: + openapi: openapi/openapi.json + UpdateJobResponse: + docs: >- + Represents an [UpdateJob](api-endpoint:Team-UpdateJob) response. Either + `job` or `errors` + + is present in the response. + properties: + job: + type: optional + docs: The updated job. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateLocationCustomAttributeDefinitionResponse: + docs: >- + Represents an + [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The updated custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateLocationResponse: + docs: >- + The response object returned by the + [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + location: + type: optional + docs: The updated `Location` object. + source: + openapi: openapi/openapi.json + UpdateLocationSettingsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred when updating the location settings. + location_settings: + type: optional + docs: The updated location settings. + source: + openapi: openapi/openapi.json + UpdateMerchantCustomAttributeDefinitionResponse: + docs: >- + Represents an + [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The updated custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateMerchantSettingsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred when updating the merchant settings. + merchant_settings: + type: optional + docs: The updated merchant settings. + source: + openapi: openapi/openapi.json + UpdateOrderCustomAttributeDefinitionResponse: + docs: Represents a response from updating an order custom attribute definition. + properties: + custom_attribute_definition: + type: optional + docs: The updated order custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateOrderResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. + properties: + order: + type: optional + docs: The updated order. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdatePaymentLinkResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred when updating the payment link. + payment_link: + type: optional + docs: The updated payment link. + source: + openapi: openapi/openapi.json + UpdatePaymentResponse: + docs: |- + Defines the response returned by + [UpdatePayment](api-endpoint:Payments-UpdatePayment). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + payment: + type: optional + docs: The updated payment. + source: + openapi: openapi/openapi.json + UpdateScheduledShiftResponse: + docs: >- + Represents an + [UpdateScheduledShift](api-endpoint:Labor-UpdateScheduledShift) response. + + Either `scheduled_shift` or `errors` is present in the response. + properties: + scheduled_shift: + type: optional + docs: >- + The updated scheduled shift. To make the changes public, call + + [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) or + + [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateShiftResponse: + docs: |- + The response to a request to update a `Shift`. The response contains + the updated `Shift` object and might contain a set of `Error` objects if + the request resulted in errors. + properties: + shift: + type: optional + docs: The updated `Shift`. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [UpdateSubscription](api-endpoint:Subscriptions-UpdateSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The updated subscription. + source: + openapi: openapi/openapi.json + UpdateTeamMemberRequest: + docs: Represents an update request for a `TeamMember` object. + properties: + team_member: + type: optional + docs: >- + The team member fields to add, change, or clear. Fields can be cleared + using a null value. To update + + `wage_setting.job_assignments`, you must provide the complete list of + job assignments. If needed, call + + [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` + values. + source: + openapi: openapi/openapi.json + UpdateTeamMemberResponse: + docs: >- + Represents a response from an update request containing the updated + `TeamMember` object or error messages. + properties: + team_member: + type: optional + docs: The successfully updated `TeamMember` object. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateTimecardResponse: + docs: >- + The response to a request to update a `Timecard`. The response contains + + the updated `Timecard` object and might contain a set of `Error` objects + if + + the request resulted in errors. + properties: + timecard: + type: optional + docs: The updated `Timecard`. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateVendorRequest: + docs: >- + Represents an input to a call to + [UpdateVendor](api-endpoint:Vendors-UpdateVendor). + properties: + idempotency_key: + type: optional> + docs: >- + A client-supplied, universally unique identifier (UUID) for the + + request. + + + See + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + in the + + [API Development 101](https://developer.squareup.com/docs/buildbasics) + section for more + + information. + validation: + maxLength: 128 + vendor: + type: Vendor + docs: The specified [Vendor](entity:Vendor) to be updated. + source: + openapi: openapi/openapi.json + UpdateVendorResponse: + docs: >- + Represents an output from a call to + [UpdateVendor](api-endpoint:Vendors-UpdateVendor). + properties: + errors: + type: optional> + docs: Errors occurred when the request fails. + vendor: + type: optional + docs: The [Vendor](entity:Vendor) that has been updated. + source: + openapi: openapi/openapi.json + UpdateWageSettingResponse: + docs: >- + Represents a response from an update request containing the updated + `WageSetting` object + + or error messages. + properties: + wage_setting: + type: optional + docs: The successfully updated `WageSetting` object. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateWebhookSubscriptionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [UpdateWebhookSubscription](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscription) + endpoint. + + + Note: If there are errors processing the request, the + [Subscription](entity:WebhookSubscription) is not + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + subscription: + type: optional + docs: The updated [Subscription](entity:WebhookSubscription). + source: + openapi: openapi/openapi.json + UpdateWebhookSubscriptionSignatureKeyResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) + endpoint. + + + Note: If there are errors processing the request, the + [Subscription](entity:WebhookSubscription) is not + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + signature_key: + type: optional + docs: >- + The new Square-generated signature key used to validate the origin of + the webhook event. + access: read-only + source: + openapi: openapi/openapi.json + UpdateWorkweekConfigResponse: + docs: >- + The response to a request to update a `WorkweekConfig` object. The + response contains + + the updated `WorkweekConfig` object and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + workweek_config: + type: optional + docs: The response object. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertBookingCustomAttributeResponse: + docs: >- + Represents an + [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertCatalogObjectResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + catalog_object: + type: optional + docs: The successfully created or updated CatalogObject. + id_mappings: + type: optional> + docs: The mapping between client and server IDs for this upsert. + source: + openapi: openapi/openapi.json + UpsertCustomerCustomAttributeResponse: + docs: >- + Represents an + [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertLocationCustomAttributeResponse: + docs: >- + Represents an + [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertMerchantCustomAttributeResponse: + docs: >- + Represents an + [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertOrderCustomAttributeResponse: + docs: Represents a response from upserting order custom attribute definitions. + properties: + custom_attribute: + type: optional + docs: The order custom attribute that was created or modified. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertSnippetResponse: + docs: >- + Represents an `UpsertSnippet` response. The response can include either + `snippet` or `errors`. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + snippet: + type: optional + docs: The new or updated snippet. + source: + openapi: openapi/openapi.json + V1Money: + properties: + amount: + type: optional> + docs: >- + Amount in the lowest denominated value of this Currency. E.g. in USD + + these are cents, in JPY they are Yen (which do not have a 'cent' + concept). + currency_code: + type: optional + docs: |- + + See [Currency](#type-currency) for possible values + source: + openapi: openapi/openapi.json + V1Order: + docs: V1Order + properties: + errors: + type: optional>> + docs: Any errors that occurred during the request. + id: + type: optional + docs: The order's unique identifier. + buyer_email: + type: optional> + docs: The email address of the order's buyer. + recipient_name: + type: optional> + docs: The name of the order's buyer. + recipient_phone_number: + type: optional> + docs: The phone number to use for the order's delivery. + state: + type: optional + docs: |- + Whether the tax is an ADDITIVE tax or an INCLUSIVE tax. + See [V1OrderState](#type-v1orderstate) for possible values + shipping_address: + type: optional
+ docs: The address to ship the order to. + subtotal_money: + type: optional + docs: >- + The amount of all items purchased in the order, before taxes and + shipping. + total_shipping_money: + type: optional + docs: The shipping cost for the order. + total_tax_money: + type: optional + docs: The total of all taxes applied to the order. + total_price_money: + type: optional + docs: The total cost of the order. + total_discount_money: + type: optional + docs: The total of all discounts applied to the order. + created_at: + type: optional + docs: The time when the order was created, in ISO 8601 format. + updated_at: + type: optional + docs: The time when the order was last modified, in ISO 8601 format. + expires_at: + type: optional> + docs: >- + The time when the order expires if no action is taken, in ISO 8601 + format. + payment_id: + type: optional> + docs: The unique identifier of the payment associated with the order. + buyer_note: + type: optional> + docs: A note provided by the buyer when the order was created, if any. + completed_note: + type: optional> + docs: >- + A note provided by the merchant when the order's state was set to + COMPLETED, if any + refunded_note: + type: optional> + docs: >- + A note provided by the merchant when the order's state was set to + REFUNDED, if any. + canceled_note: + type: optional> + docs: >- + A note provided by the merchant when the order's state was set to + CANCELED, if any. + tender: + type: optional + docs: The tender used to pay for the order. + order_history: + type: optional>> + docs: The history of actions associated with the order. + promo_code: + type: optional> + docs: The promo code provided by the buyer, if any. + btc_receive_address: + type: optional> + docs: For Bitcoin transactions, the address that the buyer sent Bitcoin to. + btc_price_satoshi: + type: optional> + docs: >- + For Bitcoin transactions, the price of the buyer's order in satoshi + (100 million satoshi equals 1 BTC). + source: + openapi: openapi/openapi.json + V1OrderHistoryEntry: + docs: V1OrderHistoryEntry + properties: + action: + type: optional + docs: >- + The type of action performed on the order. + + See [V1OrderHistoryEntryAction](#type-v1orderhistoryentryaction) for + possible values + created_at: + type: optional + docs: The time when the action was performed, in ISO 8601 format. + source: + openapi: openapi/openapi.json + V1OrderHistoryEntryAction: + enum: + - ORDER_PLACED + - DECLINED + - PAYMENT_RECEIVED + - CANCELED + - COMPLETED + - REFUNDED + - EXPIRED + source: + openapi: openapi/openapi.json + V1OrderState: + enum: + - PENDING + - OPEN + - COMPLETED + - CANCELED + - REFUNDED + - REJECTED + source: + openapi: openapi/openapi.json + V1Tender: + docs: >- + A tender represents a discrete monetary exchange. Square represents this + + exchange as a money object with a specific currency and amount, where the + + amount is given in the smallest denomination of the given currency. + + + Square POS can accept more than one form of tender for a single payment + (such + + as by splitting a bill between a credit card and a gift card). The + `tender` + + field of the Payment object lists all forms of tender used for the + payment. + + + Split tender payments behave slightly differently from single tender + payments: + + + The receipt_url for a split tender corresponds only to the first tender + listed + + in the tender field. To get the receipt URLs for the remaining tenders, + use + + the receipt_url fields of the corresponding Tender objects. + + + *A note on gift cards**: when a customer purchases a Square gift card from + a + + merchant, the merchant receives the full amount of the gift card in the + + associated payment. + + + When that gift card is used as a tender, the balance of the gift card is + + reduced and the merchant receives no funds. A `Tender` object with a type + of + + `SQUARE_GIFT_CARD` indicates a gift card was used for some or all of the + + associated payment. + properties: + id: + type: optional + docs: The tender's unique ID. + type: + type: optional + docs: |- + The type of tender. + See [V1TenderType](#type-v1tendertype) for possible values + name: + type: optional> + docs: A human-readable description of the tender. + employee_id: + type: optional> + docs: The ID of the employee that processed the tender. + receipt_url: + type: optional> + docs: The URL of the receipt for the tender. + card_brand: + type: optional + docs: |- + The brand of credit card provided. + See [V1TenderCardBrand](#type-v1tendercardbrand) for possible values + pan_suffix: + type: optional> + docs: The last four digits of the provided credit card's account number. + entry_method: + type: optional + docs: >- + The tender's unique ID. + + See [V1TenderEntryMethod](#type-v1tenderentrymethod) for possible + values + payment_note: + type: optional> + docs: >- + Notes entered by the merchant about the tender at the time of payment, + if any. Typically only present for tender with the type: OTHER. + total_money: + type: optional + docs: The total amount of money provided in this form of tender. + tendered_money: + type: optional + docs: The amount of total_money applied to the payment. + tendered_at: + type: optional> + docs: The time when the tender was created, in ISO 8601 format. + settled_at: + type: optional> + docs: The time when the tender was settled, in ISO 8601 format. + change_back_money: + type: optional + docs: The amount of total_money returned to the buyer as change. + refunded_money: + type: optional + docs: >- + The total of all refunds applied to this tender. This amount is always + negative or zero. + is_exchange: + type: optional> + docs: >- + Indicates whether or not the tender is associated with an exchange. If + is_exchange is true, the tender represents the value of goods returned + in an exchange not the actual money paid. The exchange value reduces + the tender amounts needed to pay for items purchased in the exchange. + source: + openapi: openapi/openapi.json + V1TenderCardBrand: + enum: + - OTHER_BRAND + - VISA + - MASTER_CARD + - AMERICAN_EXPRESS + - DISCOVER + - DISCOVER_DINERS + - JCB + - CHINA_UNIONPAY + - SQUARE_GIFT_CARD + docs: The brand of a credit card. + source: + openapi: openapi/openapi.json + V1TenderEntryMethod: + enum: + - MANUAL + - SCANNED + - SQUARE_CASH + - SQUARE_WALLET + - SWIPED + - WEB_FORM + - OTHER + source: + openapi: openapi/openapi.json + V1TenderType: + enum: + - CREDIT_CARD + - CASH + - THIRD_PARTY_CARD + - NO_SALE + - SQUARE_WALLET + - SQUARE_GIFT_CARD + - UNKNOWN + - OTHER + source: + openapi: openapi/openapi.json + V1UpdateOrderRequestAction: + enum: + - COMPLETE + - CANCEL + - REFUND + source: + openapi: openapi/openapi.json + Vendor: + docs: Represents a supplier to a seller. + properties: + id: + type: optional + docs: >- + A unique Square-generated ID for the [Vendor](entity:Vendor). + + This field is required when attempting to update a + [Vendor](entity:Vendor). + validation: + maxLength: 100 + created_at: + type: optional + docs: |- + An RFC 3339-formatted timestamp that indicates when the + [Vendor](entity:Vendor) was created. + validation: + maxLength: 34 + access: read-only + updated_at: + type: optional + docs: |- + An RFC 3339-formatted timestamp that indicates when the + [Vendor](entity:Vendor) was last updated. + validation: + maxLength: 34 + access: read-only + name: + type: optional> + docs: >- + The name of the [Vendor](entity:Vendor). + + This field is required when attempting to create or update a + [Vendor](entity:Vendor). + validation: + maxLength: 100 + address: + type: optional
+ docs: The address of the [Vendor](entity:Vendor). + contacts: + type: optional>> + docs: The contacts of the [Vendor](entity:Vendor). + account_number: + type: optional> + docs: The account number of the [Vendor](entity:Vendor). + validation: + maxLength: 100 + note: + type: optional> + docs: A note detailing information about the [Vendor](entity:Vendor). + validation: + maxLength: 4096 + version: + type: optional + docs: The version of the [Vendor](entity:Vendor). + status: + type: optional + docs: |- + The status of the [Vendor](entity:Vendor). + See [Status](#type-status) for possible values + source: + openapi: openapi/openapi.json + VendorContact: + docs: Represents a contact of a [Vendor](entity:Vendor). + properties: + id: + type: optional + docs: >- + A unique Square-generated ID for the + [VendorContact](entity:VendorContact). + + This field is required when attempting to update a + [VendorContact](entity:VendorContact). + validation: + maxLength: 100 + name: + type: optional> + docs: >- + The name of the [VendorContact](entity:VendorContact). + + This field is required when attempting to create a + [Vendor](entity:Vendor). + validation: + maxLength: 255 + email_address: + type: optional> + docs: The email address of the [VendorContact](entity:VendorContact). + validation: + maxLength: 255 + phone_number: + type: optional> + docs: The phone number of the [VendorContact](entity:VendorContact). + validation: + maxLength: 255 + removed: + type: optional> + docs: The state of the [VendorContact](entity:VendorContact). + ordinal: + type: integer + docs: The ordinal of the [VendorContact](entity:VendorContact). + source: + openapi: openapi/openapi.json + VendorCreatedEvent: + docs: Published when a [Vendor](entity:Vendor) is created. + properties: + merchant_id: + type: optional> + docs: The ID of a seller associated with this event. + location_id: + type: optional> + docs: >- + The ID of a location associated with the event, if the event is + associated with the location of the seller. + type: + type: optional> + docs: The type of this event. The value is `"vendor.created".` + event_id: + type: optional> + docs: A unique ID for this event. + created_at: + type: optional + docs: >- + The RFC 3339-formatted time when the underlying event data object is + created. + access: read-only + data: + type: optional + docs: The data associated with this event. + source: + openapi: openapi/openapi.json + VendorCreatedEventData: + docs: Defines the `vendor.created` event data structure. + properties: + type: + type: optional> + docs: The type of the event data object. The value is `vendor` + id: + type: optional + docs: The ID of the event data object. + object: + type: optional + docs: An object containing the created vendor. + source: + openapi: openapi/openapi.json + VendorCreatedEventObject: + properties: + operation: + type: optional + docs: >- + The operation on the vendor that caused the event to be published. The + value is `CREATED`. + + See [Operation](#type-operation) for possible values + vendor: + type: optional + docs: The created vendor as the result of the specified operation. + source: + openapi: openapi/openapi.json + VendorCreatedEventObjectOperation: + type: literal<"CREATED"> + docs: >- + The operation that can be performed against a vendor to cause the event to + be published. + VendorStatus: + enum: + - ACTIVE + - INACTIVE + docs: |- + The status of the [Vendor](entity:Vendor), + whether a [Vendor](entity:Vendor) is active or inactive. + source: + openapi: openapi/openapi.json + VendorUpdatedEvent: + docs: Published when a [Vendor](entity:Vendor) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of a seller associated with this event. + location_id: + type: optional> + docs: >- + The ID of a seller location associated with this event, if the event + is associated with the location. + type: + type: optional> + docs: The type of this event. The value is `"vendor.updated".` + event_id: + type: optional> + docs: A unique ID for this webhoook event. + created_at: + type: optional + docs: >- + The RFC 3339-formatted time when the underlying event data object is + created. + access: read-only + data: + type: optional + docs: The data associated with this event. + source: + openapi: openapi/openapi.json + VendorUpdatedEventData: + docs: Defines the `vendor.updated` event data structure. + properties: + type: + type: optional> + docs: The type of the event data object. The value is `vendor`. + id: + type: optional + docs: The ID of the event data object. + object: + type: optional + docs: An object containing updated vendor. + source: + openapi: openapi/openapi.json + VendorUpdatedEventObject: + properties: + operation: + type: optional + docs: >- + The operation on the vendor that caused the event to be published. The + value is `UPDATED`. + + See [Operation](#type-operation) for possible values + vendor: + type: optional + docs: The updated vendor as the result of the specified operation. + source: + openapi: openapi/openapi.json + VendorUpdatedEventObjectOperation: + type: literal<"UPDATED"> + docs: >- + The operation that can be performed against a vendor to cause the event to + be published. + VisibilityFilter: + enum: + - ALL + - READ + - READ_WRITE + docs: >- + Enumeration of visibility-filter values used to set the ability to view + custom attributes or custom attribute definitions. + source: + openapi: openapi/openapi.json + VoidTransactionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + WageSetting: + docs: >- + Represents information about the overtime exemption status, job + assignments, and compensation + + for a [team member](entity:TeamMember). + properties: + team_member_id: + type: optional> + docs: The ID of the team member associated with the wage setting. + job_assignments: + type: optional>> + docs: >- + **Required** The ordered list of jobs that the team member is assigned + to. + + The first job assignment is considered the team member's primary job. + is_overtime_exempt: + type: optional> + docs: >- + Whether the team member is exempt from the overtime rules of the + seller's country. + version: + type: optional + docs: >- + **Read only** Used for resolving concurrency issues. The request fails + if the version + + provided does not match the server version at the time of the request. + If not provided, + + Square executes a blind write, potentially overwriting data from + another write. For more information, + + see [optimistic + concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency). + created_at: + type: optional + docs: The timestamp when the wage setting was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp when the wage setting was last updated, in RFC 3339 + format. + access: read-only + source: + openapi: openapi/openapi.json + WebhookSubscription: + docs: >- + Represents the details of a webhook subscription, including notification + URL, + + event types, and signature key. + properties: + id: + type: optional + docs: A Square-generated unique ID for the subscription. + validation: + maxLength: 64 + access: read-only + name: + type: optional> + docs: The name of this subscription. + validation: + maxLength: 64 + enabled: + type: optional> + docs: >- + Indicates whether the subscription is enabled (`true`) or not + (`false`). + event_types: + type: optional>> + docs: The event types associated with this subscription. + notification_url: + type: optional> + docs: The URL to which webhooks are sent. + api_version: + type: optional> + docs: |- + The API version of the subscription. + This field is optional for `CreateWebhookSubscription`. + The value defaults to the API version used by the application. + signature_key: + type: optional + docs: >- + The Square-generated signature key used to validate the origin of the + webhook event. + access: read-only + created_at: + type: optional + docs: >- + The timestamp of when the subscription was created, in RFC 3339 + format. For example, "2016-09-04T23:59:33.123Z". + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the subscription was last updated, in RFC 3339 + format. + + For example, "2016-09-04T23:59:33.123Z". + access: read-only + source: + openapi: openapi/openapi.json + Weekday: + enum: + - MON + - TUE + - WED + - THU + - FRI + - SAT + - SUN + docs: The days of the week. + source: + openapi: openapi/openapi.json + WorkweekConfig: + docs: |- + Sets the day of the week and hour of the day that a business starts a + workweek. This is used to calculate overtime pay. + properties: + id: + type: optional + docs: The UUID for this object. + start_of_week: + type: Weekday + docs: |- + The day of the week on which a business week starts for + compensation purposes. + See [Weekday](#type-weekday) for possible values + start_of_day_local_time: + type: string + docs: |- + The local time at which a business week starts. Represented as a + string in `HH:MM` format (`HH:MM:SS` is also accepted, but seconds are + truncated). + validation: + minLength: 1 + version: + type: optional + docs: >- + Used for resolving concurrency issues. The request fails if the + version + + provided does not match the server version at the time of the request. + If not provided, + + Square executes a blind write; potentially overwriting data from + another + + write. + created_at: + type: optional + docs: A read-only timestamp in RFC 3339 format; presented in UTC. + access: read-only + updated_at: + type: optional + docs: A read-only timestamp in RFC 3339 format; presented in UTC. + access: read-only + source: + openapi: openapi/openapi.json + CatalogObjectItem: + properties: + item_data: + type: optional + docs: >- + Structured data for a `CatalogItem`, set for CatalogObjects of type + `ITEM`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectImage: + properties: + image_data: + type: optional + docs: >- + Structured data for a `CatalogImage`, set for CatalogObjects of type + `IMAGE`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectItemVariation: + properties: + item_variation_data: + type: optional + docs: >- + Structured data for a `CatalogItemVariation`, set for CatalogObjects + of type `ITEM_VARIATION`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectTax: + properties: + tax_data: + type: optional + docs: >- + Structured data for a `CatalogTax`, set for CatalogObjects of type + `TAX`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectDiscount: + properties: + discount_data: + type: optional + docs: >- + Structured data for a `CatalogDiscount`, set for CatalogObjects of + type `DISCOUNT`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectModifierList: + properties: + modifier_list_data: + type: optional + docs: >- + Structured data for a `CatalogModifierList`, set for CatalogObjects of + type `MODIFIER_LIST`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectModifier: + properties: + modifier_data: + type: optional + docs: >- + Structured data for a `CatalogModifier`, set for CatalogObjects of + type `MODIFIER`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectPricingRule: + properties: + pricing_rule_data: + type: optional + docs: >- + Structured data for a `CatalogPricingRule`, set for CatalogObjects of + type `PRICING_RULE`. + + A `CatalogPricingRule` object often works with a `CatalogProductSet` + object or a `CatalogTimePeriod` object. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectProductSet: + properties: + product_set_data: + type: optional + docs: >- + Structured data for a `CatalogProductSet`, set for CatalogObjects of + type `PRODUCT_SET`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectTimePeriod: + properties: + time_period_data: + type: optional + docs: >- + Structured data for a `CatalogTimePeriod`, set for CatalogObjects of + type `TIME_PERIOD`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectMeasurementUnit: + properties: + measurement_unit_data: + type: optional + docs: >- + Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects + of type `MEASUREMENT_UNIT`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectSubscriptionPlanVariation: + properties: + subscription_plan_variation_data: + type: optional + docs: >- + Structured data for a `CatalogSubscriptionPlanVariation`, set for + CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectItemOption: + properties: + item_option_data: + type: optional + docs: >- + Structured data for a `CatalogItemOption`, set for CatalogObjects of + type `ITEM_OPTION`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectItemOptionValue: + properties: + item_option_value_data: + type: optional + docs: >- + Structured data for a `CatalogItemOptionValue`, set for CatalogObjects + of type `ITEM_OPTION_VAL`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectCustomAttributeDefinition: + properties: + custom_attribute_definition_data: + type: optional + docs: >- + Structured data for a `CatalogCustomAttributeDefinition`, set for + CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectQuickAmountsSettings: + properties: + quick_amounts_settings_data: + type: optional + docs: >- + Structured data for a `CatalogQuickAmountsSettings`, set for + CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectSubscriptionPlan: + properties: + subscription_plan_data: + type: optional + docs: >- + Structured data for a `CatalogSubscriptionPlan`, set for + CatalogObjects of type `SUBSCRIPTION_PLAN`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectAvailabilityPeriod: + properties: + availability_period_data: + type: optional + docs: >- + Structured data for a `CatalogAvailabilityPeriod`, set for + CatalogObjects of type `AVAILABILITY_PERIOD`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + GetLoyaltyAccountRequest: unknown + GetLoyaltyProgramRequest: unknown + GetLoyaltyPromotionRequest: unknown + GetLoyaltyRewardRequest: unknown + GetCardRequest: unknown + GetDisputeEvidenceRequest: unknown + GetDisputeRequest: unknown + V1GetPaymentRequest: unknown + V1GetSettlementRequest: unknown + GetCustomerGroupRequest: unknown + GetCustomerRequest: unknown + GetCustomerSegmentRequest: unknown + GetTransactionRequest: unknown + GetBookingRequest: unknown + GetBusinessBookingProfileRequest: unknown + GetTeamMemberBookingProfileRequest: unknown + GetSnippetRequest: unknown + GetInventoryAdjustmentRequest: unknown + GetInventoryPhysicalCountRequest: unknown + GetInventoryTransferRequest: unknown + GetVendorRequest: unknown + GetPaymentLinkRequest: unknown + GetGiftCardRequest: unknown + GetOrderRequest: unknown + GetEmployeeRequest: unknown + GetLocationRequest: unknown + GetMerchantRequest: unknown + GetTeamMemberRequest: unknown + GetWageSettingRequest: unknown + GetWebhookSubscriptionRequest: unknown diff --git a/.mock/definition/api.yml b/.mock/definition/api.yml new file mode 100644 index 000000000..4f0fe636a --- /dev/null +++ b/.mock/definition/api.yml @@ -0,0 +1,19 @@ +name: api +error-discrimination: + strategy: status-code +display-name: Square +environments: + Production: https://connect.squareup.com + Sandbox: https://connect.squareupsandbox.com +default-environment: Production +headers: + Square-Version: + name: version + env: VERSION + type: literal<"2025-07-16"> +auth-schemes: + Bearer: + scheme: bearer + token: + env: SQUARE_TOKEN +auth: Bearer diff --git a/.mock/definition/applePay.yml b/.mock/definition/applePay.yml new file mode 100644 index 000000000..8470c7028 --- /dev/null +++ b/.mock/definition/applePay.yml @@ -0,0 +1,80 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + RegisterDomain: + path: /v2/apple-pay/domains + method: POST + auth: true + docs: >- + Activates a domain for use with Apple Pay on the Web and Square. A + validation + + is performed on this domain by Apple to ensure that it is properly set + up as + + an Apple Pay enabled domain. + + + This endpoint provides an easy way for platform developers to bulk + activate + + Apple Pay on the Web with Square for merchants using their platform. + + + Note: You will need to host a valid domain verification file on your + domain to support Apple Pay. The + + current version of this file is always available at + https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association, + + and should be hosted at + `.well_known/apple-developer-merchantid-domain-association` on your + + domain. This file is subject to change; we strongly recommend checking + for updates regularly and avoiding + + long-lived caches that might not keep in sync with the correct file + version. + + + To learn more about the Web Payments SDK and how to add Apple Pay, see + [Take an Apple Pay + Payment](https://developer.squareup.com/docs/web-payments/apple-pay). + source: + openapi: openapi/openapi.json + display-name: RegisterDomain + request: + name: RegisterDomainRequest + body: + properties: + domain_name: + type: string + docs: >- + A domain name as described in RFC-1034 that will be registered + with ApplePay. + validation: + minLength: 1 + maxLength: 255 + content-type: application/json + response: + docs: Success + type: root.RegisterDomainResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + domain_name: example.com + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + status: VERIFIED + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bankAccounts.yml b/.mock/definition/bankAccounts.yml new file mode 100644 index 000000000..20bc52f6f --- /dev/null +++ b/.mock/definition/bankAccounts.yml @@ -0,0 +1,212 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/bank-accounts + method: GET + auth: true + docs: >- + Returns a list of [BankAccount](entity:BankAccount) objects linked to a + Square account. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.bank_accounts + source: + openapi: openapi/openapi.json + display-name: ListBankAccounts + request: + name: ListBankAccountsRequest + query-parameters: + cursor: + type: optional> + docs: >- + The pagination cursor returned by a previous call to this + endpoint. + + Use it in the next `ListBankAccounts` request to retrieve the next + set + + of results. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + limit: + type: optional> + docs: >- + Upper limit on the number of bank accounts to return in the + response. + + Currently, 1000 is the largest supported limit. You can specify a + limit + + of up to 1000 bank accounts. This is also the default limit. + location_id: + type: optional> + docs: >- + Location ID. You can specify this optional filter + + to retrieve only the linked bank accounts belonging to a specific + location. + response: + docs: Success + type: root.ListBankAccountsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + bank_accounts: + - id: ao6iaQ9vhDiaQD7n3GB + account_number_suffix: '971' + country: US + currency: USD + account_type: CHECKING + holder_name: Jane Doe + primary_bank_identification_number: '112200303' + secondary_bank_identification_number: secondary_bank_identification_number + debit_mandate_reference_id: debit_mandate_reference_id + reference_id: reference_id + location_id: S8GWD5example + status: VERIFICATION_IN_PROGRESS + creditable: false + debitable: false + fingerprint: fingerprint + version: 5 + bank_name: Bank Name + - id: 4x7WXuaxrkQkVlka3GB + account_number_suffix: '972' + country: US + currency: USD + account_type: CHECKING + holder_name: Jane Doe + primary_bank_identification_number: '112200303' + secondary_bank_identification_number: secondary_bank_identification_number + debit_mandate_reference_id: debit_mandate_reference_id + reference_id: reference_id + location_id: S8GWD5example + status: VERIFICATION_IN_PROGRESS + creditable: false + debitable: false + fingerprint: fingerprint + version: 5 + bank_name: Bank Name + cursor: cursor + GetByV1Id: + path: /v2/bank-accounts/by-v1-id/{v1_bank_account_id} + method: GET + auth: true + docs: >- + Returns details of a [BankAccount](entity:BankAccount) identified by V1 + bank account ID. + source: + openapi: openapi/openapi.json + display-name: GetBankAccountByV1Id + request: + name: GetByV1IdBankAccountsRequest + path-parameters: + v1_bank_account_id: + type: string + docs: >- + Connect V1 ID of the desired `BankAccount`. For more information, + see + + [Retrieve a bank account by using an ID issued by V1 Bank Accounts + API](https://developer.squareup.com/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api). + response: + docs: Success + type: root.GetBankAccountByV1IdResponse + status-code: 200 + examples: + - path-parameters: + v1_bank_account_id: v1_bank_account_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + bank_account: + id: w3yRgCGYQnwmdl0R3GB + account_number_suffix: '971' + country: US + currency: USD + account_type: CHECKING + holder_name: Jane Doe + primary_bank_identification_number: '112200303' + secondary_bank_identification_number: secondary_bank_identification_number + debit_mandate_reference_id: debit_mandate_reference_id + reference_id: reference_id + location_id: S8GWD5example + status: VERIFICATION_IN_PROGRESS + creditable: false + debitable: false + fingerprint: fingerprint + version: 5 + bank_name: Bank Name + get: + path: /v2/bank-accounts/{bank_account_id} + method: GET + auth: true + docs: |- + Returns details of a [BankAccount](entity:BankAccount) + linked to a Square account. + source: + openapi: openapi/openapi.json + display-name: GetBankAccount + request: + name: GetBankAccountsRequest + path-parameters: + bank_account_id: + type: string + docs: Square-issued ID of the desired `BankAccount`. + response: + docs: Success + type: root.GetBankAccountResponse + status-code: 200 + examples: + - path-parameters: + bank_account_id: bank_account_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + bank_account: + id: w3yRgCGYQnwmdl0R3GB + account_number_suffix: '971' + country: US + currency: USD + account_type: CHECKING + holder_name: Jane Doe + primary_bank_identification_number: '112200303' + secondary_bank_identification_number: secondary_bank_identification_number + debit_mandate_reference_id: debit_mandate_reference_id + reference_id: reference_id + location_id: S8GWD5example + status: VERIFICATION_IN_PROGRESS + creditable: false + debitable: false + fingerprint: fingerprint + version: 5 + bank_name: Bank Name + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bookings.yml b/.mock/definition/bookings.yml new file mode 100644 index 000000000..2898d325a --- /dev/null +++ b/.mock/definition/bookings.yml @@ -0,0 +1,881 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/bookings + method: GET + auth: true + docs: >- + Retrieve a collection of bookings. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.bookings + source: + openapi: openapi/openapi.json + display-name: ListBookings + request: + name: ListBookingsRequest + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of results per page to return in a paged + response. + cursor: + type: optional> + docs: >- + The pagination cursor from the preceding response to return the + next page of the results. Do not set this when retrieving the + first page of the results. + customer_id: + type: optional> + docs: >- + The [customer](entity:Customer) for whom to retrieve bookings. If + this is not set, bookings for all customers are retrieved. + team_member_id: + type: optional> + docs: >- + The team member for whom to retrieve bookings. If this is not set, + bookings of all members are retrieved. + location_id: + type: optional> + docs: >- + The location for which to retrieve bookings. If this is not set, + all locations' bookings are retrieved. + start_at_min: + type: optional> + docs: >- + The RFC 3339 timestamp specifying the earliest of the start time. + If this is not set, the current time is used. + start_at_max: + type: optional> + docs: >- + The RFC 3339 timestamp specifying the latest of the start time. If + this is not set, the time of 31 days after `start_at_min` is used. + response: + docs: Success + type: root.ListBookingsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + bookings: + - id: zkras0xv0xwswx + version: 1 + status: ACCEPTED + created_at: '2020-10-28T15:47:41Z' + updated_at: '2020-10-28T15:49:25Z' + start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + customer_id: EX2QSVGTZN4K1E5QE1CBFNVQ8M + customer_note: '' + seller_note: '' + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + transition_time_minutes: 1 + all_day: true + location_type: BUSINESS_LOCATION + source: FIRST_PARTY_MERCHANT + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/bookings + method: POST + auth: true + docs: >- + Creates a booking. + + + The required input must include the following: + + - `Booking.location_id` + + - `Booking.start_at` + + - `Booking.AppointmentSegment.team_member_id` + + - `Booking.AppointmentSegment.service_variation_id` + + - `Booking.AppointmentSegment.service_variation_version` + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: CreateBooking + request: + name: CreateBookingRequest + body: + properties: + idempotency_key: + type: optional + docs: A unique key to make this request an idempotent operation. + validation: + maxLength: 255 + booking: + type: root.Booking + docs: The details of the booking to be created. + content-type: application/json + response: + docs: Success + type: root.CreateBookingResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + booking: {} + response: + body: + booking: + id: zkras0xv0xwswx + version: 0 + status: ACCEPTED + created_at: '2020-10-28T15:47:41Z' + updated_at: '2020-10-28T15:47:41Z' + start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + customer_id: EX2QSVGTZN4K1E5QE1CBFNVQ8M + customer_note: '' + seller_note: '' + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + transition_time_minutes: 1 + all_day: true + location_type: BUSINESS_LOCATION + creator_details: + creator_type: TEAM_MEMBER + team_member_id: team_member_id + customer_id: customer_id + source: FIRST_PARTY_MERCHANT + address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + SearchAvailability: + path: /v2/bookings/availability/search + method: POST + auth: true + docs: >- + Searches for availabilities for booking. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: SearchAvailability + request: + name: SearchAvailabilityRequest + body: + properties: + query: + type: root.SearchAvailabilityQuery + docs: >- + Query conditions used to filter buyer-accessible booking + availabilities. + content-type: application/json + response: + docs: Success + type: root.SearchAvailabilityResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + start_at_range: {} + response: + body: + availabilities: + - start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-26T13:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-26T14:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-26T14:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-26T15:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-26T15:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-26T16:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-27T09:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T09:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-27T10:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T10:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T11:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T11:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-27T12:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-27T12:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-27T13:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T13:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T14:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkRetrieveBookings: + path: /v2/bookings/bulk-retrieve + method: POST + auth: true + docs: >- + Bulk-Retrieves a list of bookings by booking IDs. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: BulkRetrieveBookings + request: + name: BulkRetrieveBookingsRequest + body: + properties: + booking_ids: + docs: >- + A non-empty list of [Booking](entity:Booking) IDs specifying + bookings to retrieve. + type: list + content-type: application/json + response: + docs: Success + type: root.BulkRetrieveBookingsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + booking_ids: + - booking_ids + response: + body: + bookings: + sc3p3m7dvctfr1: + booking: + id: sc3p3m7dvctfr1 + version: 0 + status: ACCEPTED + created_at: '2023-04-26T18:19:21Z' + updated_at: '2023-04-26T18:19:21Z' + start_at: '2023-05-01T14:00:00Z' + location_id: LY6WNBPVM6VGV + customer_id: 4TDWKN9E8165X8Z77MRS0VFMJM + appointment_segments: + - duration_minutes: 60 + service_variation_id: VG4FYBKK3UL6UITOEYQ6MFLS + team_member_id: TMjiqI3PxyLMKr4k + service_variation_version: 1641341724039 + any_team_member: false + all_day: false + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + tdegug1dvctdef: + errors: + - category: INVALID_REQUEST_ERROR + code: NOT_FOUND + detail: Specified booking was not found. + field: booking_id + tdegug1fqni3wh: + booking: + id: tdegug1fqni3wh + version: 0 + status: ACCEPTED + created_at: '2023-04-26T18:19:30Z' + updated_at: '2023-04-26T18:19:30Z' + start_at: '2023-05-02T14:00:00Z' + location_id: LY6WNBPVM6VGV + customer_id: 4TDWKN9E8165X8Z77MRS0VFMJM + appointment_segments: + - duration_minutes: 60 + service_variation_id: VG4FYBKK3UL6UITOEYQ6MFLS + team_member_id: TMjiqI3PxyLMKr4k + service_variation_version: 1641341724039 + any_team_member: false + all_day: false + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + getBusinessProfile: + path: /v2/bookings/business-booking-profile + method: GET + auth: true + docs: Retrieves a seller's booking profile. + source: + openapi: openapi/openapi.json + display-name: RetrieveBusinessBookingProfile + response: + docs: Success + type: root.GetBusinessBookingProfileResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + business_booking_profile: + seller_id: MLJQYZZRM0D3Y + created_at: '2020-09-10T21:40:38Z' + booking_enabled: true + customer_timezone_choice: CUSTOMER_CHOICE + booking_policy: ACCEPT_ALL + allow_user_cancel: true + business_appointment_settings: + location_types: + - BUSINESS_LOCATION + alignment_time: HALF_HOURLY + min_booking_lead_time_seconds: 0 + max_booking_lead_time_seconds: 31536000 + any_team_member_booking_enabled: true + multiple_service_booking_enabled: true + max_appointments_per_day_limit_type: PER_TEAM_MEMBER + max_appointments_per_day_limit: 1 + cancellation_window_seconds: 1 + cancellation_fee_money: + currency: USD + cancellation_policy: CUSTOM_POLICY + cancellation_policy_text: cancellation_policy_text + skip_booking_flow_staff_selection: false + support_seller_level_writes: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + RetrieveLocationBookingProfile: + path: /v2/bookings/location-booking-profiles/{location_id} + method: GET + auth: true + docs: Retrieves a seller's location booking profile. + source: + openapi: openapi/openapi.json + display-name: RetrieveLocationBookingProfile + request: + name: RetrieveLocationBookingProfileRequest + path-parameters: + location_id: + type: string + docs: The ID of the location to retrieve the booking profile. + response: + docs: Success + type: root.RetrieveLocationBookingProfileResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + response: + body: + location_booking_profile: + location_id: L3HETDGYQ4A2C + booking_site_url: https://square.site/book/L3HETDGYQ4A2C/prod-business + online_booking_enabled: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkRetrieveTeamMemberBookingProfiles: + path: /v2/bookings/team-member-booking-profiles/bulk-retrieve + method: POST + auth: true + docs: Retrieves one or more team members' booking profiles. + source: + openapi: openapi/openapi.json + display-name: BulkRetrieveTeamMemberBookingProfiles + request: + name: BulkRetrieveTeamMemberBookingProfilesRequest + body: + properties: + team_member_ids: + docs: >- + A non-empty list of IDs of team members whose booking profiles + you want to retrieve. + type: list + content-type: application/json + response: + docs: Success + type: root.BulkRetrieveTeamMemberBookingProfilesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + team_member_ids: + - team_member_ids + response: + body: + team_member_booking_profiles: + TMXUrsBWWcHTt79t: + errors: + - category: INVALID_REQUEST_ERROR + code: NOT_FOUND + detail: Resource not found. + TMaJcbiRqPIGZuS9: + team_member_booking_profile: + team_member_id: TMaJcbiRqPIGZuS9 + display_name: Sandbox Staff 1 + is_bookable: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + TMtdegug1fqni3wh: + team_member_booking_profile: + team_member_id: TMtdegug1fqni3wh + display_name: Sandbox Staff 2 + is_bookable: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/bookings/{booking_id} + method: GET + auth: true + docs: >- + Retrieves a booking. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: RetrieveBooking + request: + name: GetBookingsRequest + path-parameters: + booking_id: + type: string + docs: >- + The ID of the [Booking](entity:Booking) object representing the + to-be-retrieved booking. + response: + docs: Success + type: root.GetBookingResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + headers: + Square-Version: '2025-07-16' + response: + body: + booking: + id: zkras0xv0xwswx + version: 1 + status: ACCEPTED + created_at: '2020-10-28T15:47:41Z' + updated_at: '2020-10-28T15:49:25Z' + start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + customer_id: EX2QSVGTZN4K1E5QE1CBFNVQ8M + customer_note: '' + seller_note: '' + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + transition_time_minutes: 1 + all_day: true + location_type: BUSINESS_LOCATION + creator_details: + creator_type: TEAM_MEMBER + team_member_id: team_member_id + customer_id: customer_id + source: FIRST_PARTY_MERCHANT + address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/bookings/{booking_id} + method: PUT + auth: true + docs: >- + Updates a booking. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: UpdateBooking + request: + name: UpdateBookingRequest + path-parameters: + booking_id: + type: string + docs: >- + The ID of the [Booking](entity:Booking) object representing the + to-be-updated booking. + body: + properties: + idempotency_key: + type: optional> + docs: A unique key to make this request an idempotent operation. + validation: + maxLength: 255 + booking: + type: root.Booking + docs: >- + The booking to be updated. Individual attributes explicitly + specified here override the corresponding values of the existing + booking. + content-type: application/json + response: + docs: Success + type: root.UpdateBookingResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + headers: + Square-Version: '2025-07-16' + request: + booking: {} + response: + body: + booking: + id: zkras0xv0xwswx + version: 2 + status: ACCEPTED + created_at: '2020-10-28T15:47:41Z' + updated_at: '2020-10-28T15:49:25Z' + start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + customer_id: EX2QSVGTZN4K1E5QE1CBFNVQ8M + customer_note: I would like to sit near the window please + seller_note: '' + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + transition_time_minutes: 1 + all_day: true + location_type: CUSTOMER_LOCATION + creator_details: + creator_type: TEAM_MEMBER + team_member_id: team_member_id + customer_id: customer_id + source: FIRST_PARTY_MERCHANT + address: + address_line_1: 1955 Broadway + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: Oakland + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: CA + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '94612' + country: ZZ + first_name: first_name + last_name: last_name + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cancel: + path: /v2/bookings/{booking_id}/cancel + method: POST + auth: true + docs: >- + Cancels an existing booking. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: CancelBooking + request: + name: CancelBookingRequest + path-parameters: + booking_id: + type: string + docs: >- + The ID of the [Booking](entity:Booking) object representing the + to-be-cancelled booking. + body: + properties: + idempotency_key: + type: optional> + docs: A unique key to make this request an idempotent operation. + validation: + maxLength: 255 + booking_version: + type: optional> + docs: >- + The revision number for the booking used for optimistic + concurrency. + content-type: application/json + response: + docs: Success + type: root.CancelBookingResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + headers: + Square-Version: '2025-07-16' + request: {} + response: + body: + booking: + id: zkras0xv0xwswx + version: 1 + status: CANCELLED_BY_CUSTOMER + created_at: '2020-10-28T15:47:41Z' + updated_at: '2020-10-28T15:49:25Z' + start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + customer_id: EX2QSVGTZN4K1E5QE1CBFNVQ8M + customer_note: '' + seller_note: '' + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + transition_time_minutes: 1 + all_day: true + location_type: BUSINESS_LOCATION + creator_details: + creator_type: TEAM_MEMBER + team_member_id: team_member_id + customer_id: customer_id + source: FIRST_PARTY_MERCHANT + address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bookings/customAttributeDefinitions.yml b/.mock/definition/bookings/customAttributeDefinitions.yml new file mode 100644 index 000000000..89c8024af --- /dev/null +++ b/.mock/definition/bookings/customAttributeDefinitions.yml @@ -0,0 +1,398 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/bookings/custom-attribute-definitions + method: GET + auth: true + docs: >- + Get all bookings custom attribute definitions. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attribute_definitions + source: + openapi: openapi/openapi.json + display-name: ListBookingCustomAttributeDefinitions + request: + name: ListCustomAttributeDefinitionsRequest + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListBookingCustomAttributeDefinitionsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute_definitions: + - key: favoriteShampoo + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite shampoo + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 3 + updated_at: '2022-11-16T15:39:38Z' + created_at: '2022-11-16T15:27:30Z' + - key: partySize + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Party size + description: Number of people in the party for dine-in + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: '2022-11-16T15:49:05Z' + created_at: '2022-11-16T15:49:05Z' + cursor: >- + YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/bookings/custom-attribute-definitions + method: POST + auth: true + docs: >- + Creates a bookings custom attribute definition. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: CreateBookingCustomAttributeDefinition + request: + name: CreateBookingCustomAttributeDefinitionRequest + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition to create, with the following + fields: + + + - `key` + + + - `name`. If provided, `name` must be unique (case-sensitive) + across all visible booking-related custom attribute + + definitions for the seller. + + + - `description` + + + - `visibility`. Note that all custom attributes are visible in + exported booking data, including those set to + + `VISIBILITY_HIDDEN`. + + + - `schema`. With the exception of the `Selection` data type, the + `schema` is specified as a + + simple URL to the JSON schema definition hosted on the Square + CDN. For more information, see + + [Specifying the + schema](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attribute-definitions#specify-schema). + idempotency_key: + type: optional + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateBookingCustomAttributeDefinitionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + custom_attribute_definition: {} + response: + body: + custom_attribute_definition: + key: favoriteShampoo + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Shampoo + description: The favorite shampoo of the customer. + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: '2022-11-16T15:27:30Z' + created_at: '2022-11-16T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/bookings/custom-attribute-definitions/{key} + method: GET + auth: true + docs: >- + Retrieves a bookings custom attribute definition. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: RetrieveBookingCustomAttributeDefinition + request: + name: GetCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: >- + The key of the custom attribute definition to retrieve. If the + requesting application + + is not the definition owner, you must use the qualified key. + query-parameters: + version: + type: optional> + docs: >- + The current version of the custom attribute definition, which is + used for strongly consistent + + reads to guarantee that you receive the most up-to-date data. When + included in the request, + + Square returns the specified version or a higher version if one + exists. If the specified version + + is higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveBookingCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute_definition: + key: favoriteShampoo + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite shampoo + description: The favorite shampoo of the customer. + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-11-16T15:27:30Z' + created_at: '2022-11-16T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/bookings/custom-attribute-definitions/{key} + method: PUT + auth: true + docs: >- + Updates a bookings custom attribute definition. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: UpdateBookingCustomAttributeDefinition + request: + name: UpdateBookingCustomAttributeDefinitionRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to update. + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition that contains the fields to + update. Only the following fields can be updated: + + - `name` + + - `description` + + - `visibility` + + - `schema` for a `Selection` data type. Only changes to the + named options or the maximum number of allowed + + selections are supported. + + + For more information, see + + [Updatable definition + fields](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields). + + + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include the optional `version` field and specify the + current version of the custom attribute definition. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateBookingCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + request: + custom_attribute_definition: {} + response: + body: + custom_attribute_definition: + key: favoriteShampoo + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite shampoo + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 2 + updated_at: '2022-11-16T15:39:38Z' + created_at: '2022-11-16T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/bookings/custom-attribute-definitions/{key} + method: DELETE + auth: true + docs: >- + Deletes a bookings custom attribute definition. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: DeleteBookingCustomAttributeDefinition + request: + name: DeleteCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to delete. + response: + docs: Success + type: root.DeleteBookingCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bookings/customAttributes.yml b/.mock/definition/bookings/customAttributes.yml new file mode 100644 index 000000000..d1ea704f2 --- /dev/null +++ b/.mock/definition/bookings/customAttributes.yml @@ -0,0 +1,546 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + batchDelete: + path: /v2/bookings/custom-attributes/bulk-delete + method: POST + auth: true + docs: >- + Bulk deletes bookings custom attributes. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: BulkDeleteBookingCustomAttributes + request: + name: BulkDeleteBookingCustomAttributesRequest + body: + properties: + values: + type: map + docs: >- + A map containing 1 to 25 individual Delete requests. For each + request, provide an + + arbitrary ID that is unique for this + `BulkDeleteBookingCustomAttributes` request and the + + information needed to delete a custom attribute. + content-type: application/json + response: + docs: Success + type: root.BulkDeleteBookingCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + values: + key: + booking_id: booking_id + key: key + response: + body: + values: + id1: + booking_id: N3NCVYY3WS27HF0HKANA3R9FP8 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + booking_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id3: + booking_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchUpsert: + path: /v2/bookings/custom-attributes/bulk-upsert + method: POST + auth: true + docs: >- + Bulk upserts bookings custom attributes. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: BulkUpsertBookingCustomAttributes + request: + name: BulkUpsertBookingCustomAttributesRequest + body: + properties: + values: + type: map + docs: >- + A map containing 1 to 25 individual upsert requests. For each + request, provide an + + arbitrary ID that is unique for this + `BulkUpsertBookingCustomAttributes` request and the + + information needed to create or update a custom attribute. + content-type: application/json + response: + docs: Success + type: root.BulkUpsertBookingCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + values: + key: + booking_id: booking_id + custom_attribute: {} + response: + body: + values: + id1: + booking_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: favoriteShampoo + value: Spring Fresh + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-16T00:16:23Z' + created_at: '2022-11-16T23:14:47Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + booking_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: hasShoes + value: false + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-16T00:16:23Z' + created_at: '2022-11-16T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id3: + booking_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: favoriteShampoo + value: Hydro-Cool + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-16T00:16:23Z' + created_at: '2022-11-16T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id4: + booking_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: partySize + value: 4 + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-16T00:16:23Z' + created_at: '2022-11-16T23:14:47Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id5: + booking_id: 70548QG1HN43B05G0KCZ4MMC1G + custom_attribute: + key: celebrating + value: birthday + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-16T00:16:23Z' + created_at: '2022-11-16T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + list: + path: /v2/bookings/{booking_id}/custom-attributes + method: GET + auth: true + docs: >- + Lists a booking's custom attributes. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attributes + source: + openapi: openapi/openapi.json + display-name: ListBookingCustomAttributes + request: + name: ListCustomAttributesRequest + path-parameters: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. For more + + information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + with_definitions: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + response: + docs: Success + type: root.ListBookingCustomAttributesResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attributes: + - key: favoriteShampoo + value: Hydro-Cool + version: 1 + visibility: VISIBILITY_READ_ONLY + updated_at: '2022-11-16T15:50:27Z' + created_at: '2022-11-16T15:50:27Z' + - key: hasShoes + value: false + version: 1 + visibility: VISIBILITY_HIDDEN + updated_at: '2022-11-16T15:51:53Z' + created_at: '2022-11-16T15:51:53Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/bookings/{booking_id}/custom-attributes/{key} + method: GET + auth: true + docs: >- + Retrieves a bookings custom attribute. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: RetrieveBookingCustomAttribute + request: + name: GetCustomAttributesRequest + path-parameters: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + key: + type: string + docs: >- + The key of the custom attribute to retrieve. This key must match + the `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + query-parameters: + with_definition: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of + + the custom attribute. Set this parameter to `true` to get the name + and description of the custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + version: + type: optional> + docs: >- + The current version of the custom attribute, which is used for + strongly consistent reads to + + guarantee that you receive the most up-to-date data. When included + in the request, Square + + returns the specified version or a higher version if one exists. + If the specified version is + + higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveBookingCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute: + key: favoriteShampoo + value: Dune + version: 1 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-11-16T15:50:27Z' + created_at: '2022-11-16T15:50:27Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + upsert: + path: /v2/bookings/{booking_id}/custom-attributes/{key} + method: PUT + auth: true + docs: >- + Upserts a bookings custom attribute. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: UpsertBookingCustomAttribute + request: + name: UpsertBookingCustomAttributeRequest + path-parameters: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + key: + type: string + docs: >- + The key of the custom attribute to create or update. This key must + match the `key` of a + + custom attribute definition in the Square seller account. If the + requesting application is not + + the definition owner, you must use the qualified key. + body: + properties: + custom_attribute: + type: root.CustomAttribute + docs: >- + The custom attribute to create or update, with the following + fields: + + + - `value`. This value must conform to the `schema` specified by + the definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for an update operation, include this optional field and + specify the current version + + of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpsertBookingCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + key: key + headers: + Square-Version: '2025-07-16' + request: + custom_attribute: {} + response: + body: + custom_attribute: + key: favoriteShampoo + value: Spring Fresh + version: 1 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-11-16T15:50:27Z' + created_at: '2022-11-16T15:50:27Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/bookings/{booking_id}/custom-attributes/{key} + method: DELETE + auth: true + docs: >- + Deletes a bookings custom attribute. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: DeleteBookingCustomAttribute + request: + name: DeleteCustomAttributesRequest + path-parameters: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match the + `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + response: + docs: Success + type: root.DeleteBookingCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bookings/locationProfiles.yml b/.mock/definition/bookings/locationProfiles.yml new file mode 100644 index 000000000..7455845a5 --- /dev/null +++ b/.mock/definition/bookings/locationProfiles.yml @@ -0,0 +1,54 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/bookings/location-booking-profiles + method: GET + auth: true + docs: Lists location booking profiles of a seller. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.location_booking_profiles + source: + openapi: openapi/openapi.json + display-name: ListLocationBookingProfiles + request: + name: ListLocationProfilesRequest + query-parameters: + limit: + type: optional> + docs: The maximum number of results to return in a paged response. + cursor: + type: optional> + docs: >- + The pagination cursor from the preceding response to return the + next page of the results. Do not set this when retrieving the + first page of the results. + response: + docs: Success + type: root.ListLocationBookingProfilesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + location_booking_profiles: + - location_id: LY6WNBPVM6VGV + booking_site_url: https://squareup.com/book/LY6WNBPVM6VGV/testbusiness + online_booking_enabled: true + - location_id: PYTRNBPVMJUPV + booking_site_url: booking_site_url + online_booking_enabled: false + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bookings/teamMemberProfiles.yml b/.mock/definition/bookings/teamMemberProfiles.yml new file mode 100644 index 000000000..3e00df862 --- /dev/null +++ b/.mock/definition/bookings/teamMemberProfiles.yml @@ -0,0 +1,105 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/bookings/team-member-booking-profiles + method: GET + auth: true + docs: Lists booking profiles for team members. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.team_member_booking_profiles + source: + openapi: openapi/openapi.json + display-name: ListTeamMemberBookingProfiles + request: + name: ListTeamMemberProfilesRequest + query-parameters: + bookable_only: + type: optional> + default: false + docs: >- + Indicates whether to include only bookable team members in the + returned result (`true`) or not (`false`). + limit: + type: optional> + docs: The maximum number of results to return in a paged response. + cursor: + type: optional> + docs: >- + The pagination cursor from the preceding response to return the + next page of the results. Do not set this when retrieving the + first page of the results. + location_id: + type: optional> + docs: >- + Indicates whether to include only team members enabled at the + given location in the returned result. + response: + docs: Success + type: root.ListTeamMemberBookingProfilesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + team_member_booking_profiles: + - team_member_id: TMXUrsBWWcHTt79t + description: description + display_name: Sandbox Seller + is_bookable: true + profile_image_url: profile_image_url + - team_member_id: TMaJcbiRqPIGZuS9 + description: description + display_name: Sandbox Staff + is_bookable: true + profile_image_url: profile_image_url + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/bookings/team-member-booking-profiles/{team_member_id} + method: GET + auth: true + docs: Retrieves a team member's booking profile. + source: + openapi: openapi/openapi.json + display-name: RetrieveTeamMemberBookingProfile + request: + name: GetTeamMemberProfilesRequest + path-parameters: + team_member_id: + type: string + docs: The ID of the team member to retrieve. + response: + docs: Success + type: root.GetTeamMemberBookingProfileResponse + status-code: 200 + examples: + - path-parameters: + team_member_id: team_member_id + headers: + Square-Version: '2025-07-16' + response: + body: + team_member_booking_profile: + team_member_id: TMaJcbiRqPIGZuS9 + description: description + display_name: Sandbox Staff + is_bookable: true + profile_image_url: profile_image_url + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/cards.yml b/.mock/definition/cards.yml new file mode 100644 index 000000000..b8ed07f24 --- /dev/null +++ b/.mock/definition/cards.yml @@ -0,0 +1,355 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/cards + method: GET + auth: true + docs: |- + Retrieves a list of cards owned by the account making the request. + A max of 25 cards will be returned. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.cards + source: + openapi: openapi/openapi.json + display-name: ListCards + request: + name: ListCardsRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for your original + query. + + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + customer_id: + type: optional> + docs: |- + Limit results to cards associated with the customer supplied. + By default, all cards owned by the merchant are returned. + include_disabled: + type: optional> + default: false + docs: |- + Includes disabled cards. + By default, all enabled cards owned by the merchant are returned. + reference_id: + type: optional> + docs: Limit results to cards associated with the reference_id supplied. + sort_order: + type: optional> + docs: >- + Sorts the returned list by when the card was created with the + specified order. + + This field defaults to ASC. + response: + docs: Success + type: root.ListCardsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cards: + - id: ccof:uIbfJXhXETSP197M3GB + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + fingerprint: >- + ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q + customer_id: VDKXEEKPJN48QDG3BGGFAK05P8 + merchant_id: 6SSW7HV8K2ST5 + reference_id: user-id-1 + enabled: true + card_type: CREDIT + prepaid_type: NOT_PREPAID + bin: '411111' + version: 1 + card_co_brand: UNKNOWN + issuer_alert: ISSUER_ALERT_CARD_CLOSED + issuer_alert_at: issuer_alert_at + hsa_fsa: false + cursor: cursor + create: + path: /v2/cards + method: POST + auth: true + docs: Adds a card on file to an existing merchant. + source: + openapi: openapi/openapi.json + display-name: CreateCard + request: + name: CreateCardRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this CreateCard request. Keys + can be + + any valid string and must be unique for every request. + + + Max: 45 characters + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + source_id: + type: string + docs: >- + The ID of the source which represents the card information to be + stored. This can be a card nonce or a payment id. + validation: + minLength: 1 + maxLength: 16384 + verification_token: + type: optional + docs: >- + An identifying token generated by + [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). + + Verification tokens encapsulate customer device information and + 3-D Secure + + challenge results to indicate that Square has verified the buyer + identity. + + + See the [SCA + Overview](https://developer.squareup.com/docs/sca-overview). + card: + type: root.Card + docs: Payment details associated with the card to be stored. + content-type: application/json + response: + docs: Success + type: root.CreateCardResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 4935a656-a929-4792-b97c-8848be85c27c + source_id: cnon:uIbfJXhXETSP197M3GB + card: + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + customer_id: VDKXEEKPJN48QDG3BGGFAK05P8 + reference_id: user-id-1 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + card: + id: ccof:uIbfJXhXETSP197M3GB + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + fingerprint: >- + ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q + customer_id: VDKXEEKPJN48QDG3BGGFAK05P8 + merchant_id: 6SSW7HV8K2ST5 + reference_id: user-id-1 + enabled: true + card_type: CREDIT + prepaid_type: NOT_PREPAID + bin: '411111' + version: 1 + card_co_brand: UNKNOWN + issuer_alert: ISSUER_ALERT_CARD_CLOSED + issuer_alert_at: issuer_alert_at + hsa_fsa: false + get: + path: /v2/cards/{card_id} + method: GET + auth: true + docs: Retrieves details for a specific Card. + source: + openapi: openapi/openapi.json + display-name: RetrieveCard + request: + name: GetCardsRequest + path-parameters: + card_id: + type: string + docs: Unique ID for the desired Card. + response: + docs: Success + type: root.GetCardResponse + status-code: 200 + examples: + - path-parameters: + card_id: card_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + card: + id: ccof:uIbfJXhXETSP197M3GB + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + fingerprint: >- + ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q + customer_id: VDKXEEKPJN48QDG3BGGFAK05P8 + merchant_id: 6SSW7HV8K2ST5 + reference_id: user-id-1 + enabled: true + card_type: CREDIT + prepaid_type: NOT_PREPAID + bin: '411111' + version: 1 + card_co_brand: UNKNOWN + issuer_alert: ISSUER_ALERT_CARD_CLOSED + issuer_alert_at: issuer_alert_at + hsa_fsa: false + disable: + path: /v2/cards/{card_id}/disable + method: POST + auth: true + docs: |- + Disables the card, preventing any further updates or charges. + Disabling an already disabled card is allowed but has no effect. + source: + openapi: openapi/openapi.json + display-name: DisableCard + request: + name: DisableCardsRequest + path-parameters: + card_id: + type: string + docs: Unique ID for the desired Card. + response: + docs: Success + type: root.DisableCardResponse + status-code: 200 + examples: + - path-parameters: + card_id: card_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + card: + id: ccof:uIbfJXhXETSP197M3GB + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + fingerprint: >- + ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q + customer_id: VDKXEEKPJN48QDG3BGGFAK05P8 + merchant_id: 6SSW7HV8K2ST5 + reference_id: user-id-1 + enabled: false + card_type: CREDIT + prepaid_type: NOT_PREPAID + bin: '411111' + version: 2 + card_co_brand: UNKNOWN + issuer_alert: ISSUER_ALERT_CARD_CLOSED + issuer_alert_at: issuer_alert_at + hsa_fsa: false + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/cashDrawers/shifts.yml b/.mock/definition/cashDrawers/shifts.yml new file mode 100644 index 000000000..eb17d5ba9 --- /dev/null +++ b/.mock/definition/cashDrawers/shifts.yml @@ -0,0 +1,264 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/cash-drawers/shifts + method: GET + auth: true + docs: |- + Provides the details for all of the cash drawer shifts for a location + in a date range. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.cash_drawer_shifts + source: + openapi: openapi/openapi.json + display-name: ListCashDrawerShifts + request: + name: ListShiftsRequest + query-parameters: + location_id: + type: string + docs: The ID of the location to query for a list of cash drawer shifts. + sort_order: + type: optional> + docs: |- + The order in which cash drawer shifts are listed in the response, + based on their opened_at field. Default value: ASC + begin_time: + type: optional> + docs: >- + The inclusive start time of the query on opened_at, in ISO 8601 + format. + end_time: + type: optional> + docs: >- + The exclusive end date of the query on opened_at, in ISO 8601 + format. + limit: + type: optional> + docs: |- + Number of cash drawer shift events in a page of results (200 by + default, 1000 max). + cursor: + type: optional> + docs: Opaque cursor for fetching the next page of results. + response: + docs: Success + type: root.ListCashDrawerShiftsResponse + status-code: 200 + examples: + - query-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + response: + body: + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cash_drawer_shifts: + - id: DCC99978-09A6-4926-849F-300BE9C5793A + state: CLOSED + opened_at: '2019-11-22T00:42:54.000Z' + ended_at: '2019-11-22T00:44:49.000Z' + closed_at: '2019-11-22T00:44:49.000Z' + description: Misplaced some change + opened_cash_money: + amount: 10000 + currency: USD + expected_cash_money: + amount: 10000 + currency: USD + closed_cash_money: + amount: 9970 + currency: USD + created_at: created_at + updated_at: updated_at + location_id: location_id + get: + path: /v2/cash-drawers/shifts/{shift_id} + method: GET + auth: true + docs: >- + Provides the summary details for a single cash drawer shift. See + + [ListCashDrawerShiftEvents](api-endpoint:CashDrawers-ListCashDrawerShiftEvents) + for a list of cash drawer shift events. + source: + openapi: openapi/openapi.json + display-name: RetrieveCashDrawerShift + request: + name: GetShiftsRequest + path-parameters: + shift_id: + type: string + docs: The shift ID. + query-parameters: + location_id: + type: string + docs: The ID of the location to retrieve cash drawer shifts from. + response: + docs: Success + type: root.GetCashDrawerShiftResponse + status-code: 200 + examples: + - path-parameters: + shift_id: shift_id + query-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + response: + body: + cash_drawer_shift: + id: DCC99978-09A6-4926-849F-300BE9C5793A + state: CLOSED + opened_at: '2019-11-22T00:42:54.000Z' + ended_at: '2019-11-22T00:44:49.000Z' + closed_at: '2019-11-22T00:44:49.000Z' + description: Misplaced some change + opened_cash_money: + amount: 10000 + currency: USD + cash_payment_money: + amount: 100 + currency: USD + cash_refunds_money: + amount: -100 + currency: USD + cash_paid_in_money: + amount: 10000 + currency: USD + cash_paid_out_money: + amount: -10000 + currency: USD + expected_cash_money: + amount: 10000 + currency: USD + closed_cash_money: + amount: 9970 + currency: USD + device: + id: id + name: My iPad + created_at: created_at + updated_at: updated_at + location_id: location_id + team_member_ids: + - team_member_ids + opening_team_member_id: '' + ending_team_member_id: '' + closing_team_member_id: '' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + listEvents: + path: /v2/cash-drawers/shifts/{shift_id}/events + method: GET + auth: true + docs: Provides a paginated list of events for a single cash drawer shift. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.cash_drawer_shift_events + source: + openapi: openapi/openapi.json + display-name: ListCashDrawerShiftEvents + request: + name: ListEventsShiftsRequest + path-parameters: + shift_id: + type: string + docs: The shift ID. + query-parameters: + location_id: + type: string + docs: The ID of the location to list cash drawer shifts for. + limit: + type: optional> + docs: |- + Number of resources to be returned in a page of results (200 by + default, 1000 max). + cursor: + type: optional> + docs: Opaque cursor for fetching the next page of results. + response: + docs: Success + type: root.ListCashDrawerShiftEventsResponse + status-code: 200 + examples: + - path-parameters: + shift_id: shift_id + query-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + response: + body: + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cash_drawer_shift_events: + - id: 9F07DB01-D85A-4B77-88C3-D5C64CEB5155 + event_type: CASH_TENDER_PAYMENT + event_money: + amount: 100 + currency: USD + created_at: '2019-11-22T00:43:02.000Z' + description: '' + team_member_id: '' + - id: B2854CEA-A781-49B3-8F31-C64558231F48 + event_type: CASH_TENDER_PAYMENT + event_money: + amount: 250 + currency: USD + created_at: '2019-11-22T00:43:12.000Z' + description: '' + team_member_id: '' + - id: B5FB7F72-95CD-44A3-974D-26C41064D042 + event_type: CASH_TENDER_CANCELLED_PAYMENT + event_money: + amount: 250 + currency: USD + created_at: '2019-11-22T00:43:23.000Z' + description: '' + team_member_id: '' + - id: 0B425480-8504-40B4-A867-37B23543931B + event_type: CASH_TENDER_REFUND + event_money: + amount: 100 + currency: USD + created_at: '2019-11-22T00:43:46.000Z' + description: '' + team_member_id: '' + - id: 8C66E60E-FDCF-4EEF-A98D-3B14B7ED5CBE + event_type: PAID_IN + event_money: + amount: 10000 + currency: USD + created_at: '2019-11-22T00:44:18.000Z' + description: Transfer from another drawer + team_member_id: '' + - id: D5ACA7FE-C64D-4ADA-8BC8-82118A2DAE4F + event_type: PAID_OUT + event_money: + amount: 10000 + currency: USD + created_at: '2019-11-22T00:44:29.000Z' + description: Transfer out to another drawer + team_member_id: '' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/catalog.yml b/.mock/definition/catalog.yml new file mode 100644 index 000000000..4fdaedbaa --- /dev/null +++ b/.mock/definition/catalog.yml @@ -0,0 +1,1204 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + batchDelete: + path: /v2/catalog/batch-delete + method: POST + auth: true + docs: >- + Deletes a set of [CatalogItem](entity:CatalogItem)s based on the + + provided list of target IDs and returns a set of successfully deleted + IDs in + + the response. Deletion is a cascading event such that all children of + the + + targeted object are also deleted. For example, deleting a CatalogItem + will + + also delete all of its + [CatalogItemVariation](entity:CatalogItemVariation) + + children. + + + `BatchDeleteCatalogObjects` succeeds even if only a portion of the + targeted + + IDs can be deleted. The response will only include IDs that were + + actually deleted. + + + To ensure consistency, only one delete request is processed at a time + per seller account. + + While one (batch or non-batch) delete request is being processed, other + (batched and non-batched) + + delete requests are rejected with the `429` error code. + source: + openapi: openapi/openapi.json + display-name: BatchDeleteCatalogObjects + request: + name: BatchDeleteCatalogObjectsRequest + body: + properties: + object_ids: + docs: >- + The IDs of the CatalogObjects to be deleted. When an object is + deleted, other objects + + in the graph that depend on that object will be deleted as well + (for example, deleting a + + CatalogItem will delete its CatalogItemVariation. + type: list + content-type: application/json + response: + docs: Success + type: root.BatchDeleteCatalogObjectsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + - AA27W3M2GGTF3H6AVPNB77CK + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + deleted_object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + - AA27W3M2GGTF3H6AVPNB77CK + deleted_at: '2016-11-16T22:25:24.878Z' + batchGet: + path: /v2/catalog/batch-retrieve + method: POST + auth: true + docs: >- + Returns a set of objects based on the provided ID. + + Each [CatalogItem](entity:CatalogItem) returned in the set includes all + of its + + child information including: all of its + + [CatalogItemVariation](entity:CatalogItemVariation) objects, references + to + + its [CatalogModifierList](entity:CatalogModifierList) objects, and the + ids of + + any [CatalogTax](entity:CatalogTax) objects that apply to it. + source: + openapi: openapi/openapi.json + display-name: BatchRetrieveCatalogObjects + request: + name: BatchGetCatalogObjectsRequest + body: + properties: + object_ids: + docs: The IDs of the CatalogObjects to be retrieved. + type: list + include_related_objects: + type: optional> + docs: >- + If `true`, the response will include additional objects that are + related to the + + requested objects. Related objects are defined as any objects + referenced by ID by the results in the `objects` field + + of the response. These objects are put in the `related_objects` + field. Setting this to `true` is + + helpful when the objects are needed for immediate display to a + user. + + This process only goes one level deep. Objects referenced by the + related objects will not be included. For example, + + + if the `objects` field of the response contains a CatalogItem, + its associated + + CatalogCategory objects, CatalogTax objects, CatalogImage + objects and + + CatalogModifierLists will be returned in the `related_objects` + field of the + + response. If the `objects` field of the response contains a + CatalogItemVariation, + + its parent CatalogItem will be returned in the `related_objects` + field of + + the response. + + + Default value: `false` + catalog_version: + type: optional> + docs: >- + The specific version of the catalog objects to be included in + the response. + + This allows you to retrieve historical versions of objects. The + specified version value is matched against + + the [CatalogObject](entity:CatalogObject)s' `version` attribute. + If not included, results will + + be from the current version of the catalog. + include_deleted_objects: + type: optional> + docs: >- + Indicates whether to include (`true`) or not (`false`) in the + response deleted objects, namely, those with the `is_deleted` + attribute set to `true`. + include_category_path_to_root: + type: optional> + docs: >- + Specifies whether or not to include the `path_to_root` list for + each returned category instance. The `path_to_root` list + consists + + of `CategoryPathToRootNode` objects and specifies the path that + starts with the immediate parent category of the returned + category + + and ends with its root category. If the returned category is a + top-level category, the `path_to_root` list is empty and is not + returned + + in the response payload. + content-type: application/json + response: + docs: Success + type: root.BatchGetCatalogObjectsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + - AA27W3M2GGTF3H6AVPNB77CK + include_related_objects: true + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + related_objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + ordinal: 1000000 + type: CATEGORY + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: TAX + batchUpsert: + path: /v2/catalog/batch-upsert + method: POST + auth: true + docs: >- + Creates or updates up to 10,000 target objects based on the provided + + list of objects. The target objects are grouped into batches and each + batch is + + inserted/updated in an all-or-nothing manner. If an object within a + batch is + + malformed in some way, or violates a database constraint, the entire + batch + + containing that item will be disregarded. However, other batches in the + same + + request may still succeed. Each batch may contain up to 1,000 objects, + and + + batches will be processed in order as long as the total object count for + the + + request (items, variations, modifier lists, discounts, and taxes) is no + more + + than 10,000. + + + To ensure consistency, only one update request is processed at a time + per seller account. + + While one (batch or non-batch) update request is being processed, other + (batched and non-batched) + + update requests are rejected with the `429` error code. + source: + openapi: openapi/openapi.json + display-name: BatchUpsertCatalogObjects + request: + name: BatchUpsertCatalogObjectsRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A value you specify that uniquely identifies this + + request among all your requests. A common way to create + + a valid idempotency key is to use a Universally unique + + identifier (UUID). + + + If you're unsure whether a particular request was successful, + + you can reattempt it with the same idempotency key without + + worrying about creating duplicate objects. + + + See + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 128 + batches: + docs: >- + A batch of CatalogObjects to be inserted/updated atomically. + + The objects within a batch will be inserted in an all-or-nothing + fashion, i.e., if an error occurs + + attempting to insert or update an object within a batch, the + entire batch will be rejected. However, an error + + in one batch will not affect other batches within the same + request. + + + For each object, its `updated_at` field is ignored and replaced + with a current + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), + and its + + `is_deleted` field must not be set to `true`. + + + To modify an existing object, supply its ID. To create a new + object, use an ID starting + + with `#`. These IDs may be used to create relationships between + an object and attributes of + + other objects that reference it. For example, you can create a + CatalogItem with + + ID `#ABC` and a CatalogItemVariation with its `item_id` + attribute set to + + `#ABC` in order to associate the CatalogItemVariation with its + parent + + CatalogItem. + + + Any `#`-prefixed IDs are valid only within a single atomic + batch, and will be replaced by server-generated IDs. + + + Each batch may contain up to 1,000 objects. The total number of + objects across all batches for a single request + + may not exceed 10,000. If either of these limits is violated, an + error will be returned and no objects will + + be inserted or updated. + type: list + content-type: application/json + response: + docs: Success + type: root.BatchUpsertCatalogObjectsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 789ff020-f723-43a9-b4b5-43b5dc1fa3dc + batches: + - objects: + - id: id + type: ITEM + - id: id + type: ITEM + - id: id + type: ITEM + - id: id + type: TAX + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + ordinal: 1000000 + type: CATEGORY + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: TAX + updated_at: updated_at + id_mappings: + - client_object_id: '#Tea' + object_id: 67GA7XA2FWMRYY2VCONTYZJR + - client_object_id: '#Coffee' + object_id: MQ4TZKOG3SR2EQI3TWEK4AH7 + - client_object_id: '#Beverages' + object_id: XCS4SCGN4WQYE2VU4U3TKXEH + - client_object_id: '#SalesTax' + object_id: HP5VNYPKZKTNCKZ2Z5NPUH6A + - client_object_id: '#Tea_Mug' + object_id: CAJBHUIQH7ONTSZI2KTVOUP6 + - client_object_id: '#Coffee_Regular' + object_id: GY2GXJTVVPQAPW43GFRR3NG6 + - client_object_id: '#Coffee_Large' + object_id: JE6VHPSRQL6IWSN26C36CJ7W + info: + path: /v2/catalog/info + method: GET + auth: true + docs: |- + Retrieves information about the Square Catalog API, such as batch size + limits that can be used by the `BatchUpsertCatalogObjects` endpoint. + source: + openapi: openapi/openapi.json + display-name: CatalogInfo + response: + docs: Success + type: root.CatalogInfoResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + limits: + batch_upsert_max_objects_per_batch: 1000 + batch_upsert_max_total_objects: 10000 + batch_retrieve_max_object_ids: 1000 + search_max_page_limit: 1000 + batch_delete_max_object_ids: 200 + update_item_taxes_max_item_ids: 1000 + update_item_taxes_max_taxes_to_enable: 1000 + update_item_taxes_max_taxes_to_disable: 1000 + update_item_modifier_lists_max_item_ids: 1000 + update_item_modifier_lists_max_modifier_lists_to_enable: 1000 + update_item_modifier_lists_max_modifier_lists_to_disable: 1000 + standard_unit_description_group: + standard_unit_descriptions: + - {} + language_code: language_code + list: + path: /v2/catalog/list + method: GET + auth: true + docs: >- + Returns a list of all [CatalogObject](entity:CatalogObject)s of the + specified types in the catalog. + + + The `types` parameter is specified as a comma-separated list of the + [CatalogObjectType](entity:CatalogObjectType) values, + + for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, + `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". + + + __Important:__ ListCatalog does not return deleted catalog items. To + retrieve + + deleted catalog items, use + [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) + + and set the `include_deleted_objects` attribute value to `true`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.objects + source: + openapi: openapi/openapi.json + display-name: ListCatalog + request: + name: ListCatalogRequest + query-parameters: + cursor: + type: optional> + docs: >- + The pagination cursor returned in the previous response. Leave + unset for an initial request. + + The page size is currently set to be 100. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + types: + type: optional> + docs: >- + An optional case-insensitive, comma-separated list of object types + to retrieve. + + + The valid values are defined in the + [CatalogObjectType](entity:CatalogObjectType) enum, for example, + + `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, + + `MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc. + + + If this is unspecified, the operation returns objects of all the + top level types at the version + + of the Square API used to make the request. Object types that are + nested onto other object types + + are not included in the defaults. + + + At the current API version the default object types are: + + ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, + + PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, + + SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, + QUICK_AMOUNT_SETTINGS. + catalog_version: + type: optional> + docs: >- + The specific version of the catalog objects to be included in the + response. + + This allows you to retrieve historical versions of objects. The + specified version value is matched against + + the [CatalogObject](entity:CatalogObject)s' `version` attribute. + If not included, results will be from the + + current version of the catalog. + response: + docs: Success + type: root.ListCatalogResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cursor: cursor + objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + ordinal: 1000000 + type: CATEGORY + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: TAX + search: + path: /v2/catalog/search + method: POST + auth: true + docs: >- + Searches for [CatalogObject](entity:CatalogObject) of any type by + matching supported search attribute values, + + excluding custom attribute values on items or item variations, against + one or more of the specified query filters. + + + This (`SearchCatalogObjects`) endpoint differs from the + [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + + endpoint in the following aspects: + + + - `SearchCatalogItems` can only search for items or item variations, + whereas `SearchCatalogObjects` can search for any type of catalog + objects. + + - `SearchCatalogItems` supports the custom attribute query filters to + return items or item variations that contain custom attribute values, + where `SearchCatalogObjects` does not. + + - `SearchCatalogItems` does not support the `include_deleted_objects` + filter to search for deleted items or item variations, whereas + `SearchCatalogObjects` does. + + - The both endpoints have different call conventions, including the + query filter formats. + source: + openapi: openapi/openapi.json + display-name: SearchCatalogObjects + request: + name: SearchCatalogObjectsRequest + body: + properties: + cursor: + type: optional + docs: >- + The pagination cursor returned in the previous response. Leave + unset for an initial request. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + object_types: + type: optional> + docs: >- + The desired set of object types to appear in the search results. + + + If this is unspecified, the operation returns objects of all the + top level types at the version + + of the Square API used to make the request. Object types that + are nested onto other object types + + are not included in the defaults. + + + At the current API version the default object types are: + + ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, + + PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, + + SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, + QUICK_AMOUNT_SETTINGS. + + + Note that if you wish for the query to return objects belonging + to nested types (i.e., COMPONENT, IMAGE, + + ITEM_OPTION_VAL, ITEM_VARIATION, or MODIFIER), you must + explicitly include all the types of interest + + in this field. + include_deleted_objects: + type: optional + docs: >- + If `true`, deleted objects will be included in the results. + Defaults to `false`. Deleted objects will have their + `is_deleted` field set to `true`. If `include_deleted_objects` + is `true`, then the `include_category_path_to_root` request + parameter must be `false`. Both properties cannot be `true` at + the same time. + include_related_objects: + type: optional + docs: >- + If `true`, the response will include additional objects that are + related to the + + requested objects. Related objects are objects that are + referenced by object ID by the objects + + in the response. This is helpful if the objects are being + fetched for immediate display to a user. + + This process only goes one level deep. Objects referenced by the + related objects will not be included. + + For example: + + + If the `objects` field of the response contains a CatalogItem, + its associated + + CatalogCategory objects, CatalogTax objects, CatalogImage + objects and + + CatalogModifierLists will be returned in the `related_objects` + field of the + + response. If the `objects` field of the response contains a + CatalogItemVariation, + + its parent CatalogItem will be returned in the `related_objects` + field of + + the response. + + + Default value: `false` + begin_time: + type: optional + docs: >- + Return objects modified after this + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), + in RFC 3339 + + format, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is + exclusive - objects with a + + timestamp equal to `begin_time` will not be included in the + response. + query: + type: optional + docs: >- + A query to be used to filter or sort the results. If no query is + specified, the entire catalog will be returned. + limit: + type: optional + docs: >- + A limit on the number of results to be returned in a single + page. The limit is advisory - + + the implementation may return more or fewer results. If the + supplied limit is negative, zero, or + + is higher than the maximum limit of 1,000, it will be ignored. + include_category_path_to_root: + type: optional + docs: >- + Specifies whether or not to include the `path_to_root` list for + each returned category instance. The `path_to_root` list + consists of `CategoryPathToRootNode` objects and specifies the + path that starts with the immediate parent category of the + returned category and ends with its root category. If the + returned category is a top-level category, the `path_to_root` + list is empty and is not returned in the response payload. If + `include_category_path_to_root` is `true`, then the + `include_deleted_objects` request parameter must be `false`. + Both properties cannot be `true` at the same time. + content-type: application/json + response: + docs: Success + type: root.SearchCatalogObjectsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + object_types: + - ITEM + query: + prefix_query: + attribute_name: name + attribute_prefix: tea + limit: 100 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cursor: cursor + objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + related_objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + latest_time: latest_time + SearchItems: + path: /v2/catalog/search-catalog-items + method: POST + auth: true + docs: >- + Searches for catalog items or item variations by matching supported + search attribute values, including + + custom attribute values, against one or more of the specified query + filters. + + + This (`SearchCatalogItems`) endpoint differs from the + [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) + + endpoint in the following aspects: + + + - `SearchCatalogItems` can only search for items or item variations, + whereas `SearchCatalogObjects` can search for any type of catalog + objects. + + - `SearchCatalogItems` supports the custom attribute query filters to + return items or item variations that contain custom attribute values, + where `SearchCatalogObjects` does not. + + - `SearchCatalogItems` does not support the `include_deleted_objects` + filter to search for deleted items or item variations, whereas + `SearchCatalogObjects` does. + + - The both endpoints use different call conventions, including the query + filter formats. + source: + openapi: openapi/openapi.json + display-name: SearchCatalogItems + request: + name: SearchCatalogItemsRequest + body: + properties: + text_filter: + type: optional + docs: >- + The text filter expression to return items or item variations + containing specified text in + + the `name`, `description`, or `abbreviation` attribute value of + an item, or in + + the `name`, `sku`, or `upc` attribute value of an item + variation. + category_ids: + type: optional> + docs: >- + The category id query expression to return items containing the + specified category IDs. + stock_levels: + type: optional> + docs: >- + The stock-level query expression to return item variations with + the specified stock levels. + + See + [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) + for possible values + enabled_location_ids: + type: optional> + docs: >- + The enabled-location query expression to return items and item + variations having specified enabled locations. + cursor: + type: optional + docs: >- + The pagination token, returned in the previous response, used to + fetch the next batch of pending results. + limit: + type: optional + docs: >- + The maximum number of results to return per page. The default + value is 100. + validation: + max: 100 + sort_order: + type: optional + docs: >- + The order to sort the results by item names. The default sort + order is ascending (`ASC`). + + See [SortOrder](#type-sortorder) for possible values + product_types: + type: optional> + docs: >- + The product types query expression to return items or item + variations having the specified product types. + custom_attribute_filters: + type: optional> + docs: >- + The customer-attribute filter to return items or item variations + matching the specified + + custom attribute expressions. A maximum number of 10 custom + attribute expressions are supported in + + a single call to the + [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + endpoint. + archived_state: + type: optional + docs: >- + The query filter to return not archived + (`ARCHIVED_STATE_NOT_ARCHIVED`), archived + (`ARCHIVED_STATE_ARCHIVED`), or either type + (`ARCHIVED_STATE_ALL`) of items. + content-type: application/json + response: + docs: Success + type: root.SearchCatalogItemsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + text_filter: red + category_ids: + - WINE_CATEGORY_ID + stock_levels: + - OUT + - LOW + enabled_location_ids: + - ATL_LOCATION_ID + limit: 100 + sort_order: ASC + product_types: + - REGULAR + custom_attribute_filters: + - custom_attribute_definition_id: VEGAN_DEFINITION_ID + bool_filter: true + - custom_attribute_definition_id: BRAND_DEFINITION_ID + string_filter: Dark Horse + - key: VINTAGE + number_filter: + min: min + max: max + - custom_attribute_definition_id: VARIETAL_DEFINITION_ID + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + items: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + cursor: cursor + matched_variation_ids: + - VBJNPHCOKDFECR6VU25WRJUD + UpdateItemModifierLists: + path: /v2/catalog/update-item-modifier-lists + method: POST + auth: true + docs: >- + Updates the [CatalogModifierList](entity:CatalogModifierList) objects + + that apply to the targeted [CatalogItem](entity:CatalogItem) without + having + + to perform an upsert on the entire item. + source: + openapi: openapi/openapi.json + display-name: UpdateItemModifierLists + request: + name: UpdateItemModifierListsRequest + body: + properties: + item_ids: + docs: >- + The IDs of the catalog items associated with the + CatalogModifierList objects being updated. + type: list + modifier_lists_to_enable: + type: optional>> + docs: >- + The IDs of the CatalogModifierList objects to enable for the + CatalogItem. + + At least one of `modifier_lists_to_enable` or + `modifier_lists_to_disable` must be specified. + modifier_lists_to_disable: + type: optional>> + docs: >- + The IDs of the CatalogModifierList objects to disable for the + CatalogItem. + + At least one of `modifier_lists_to_enable` or + `modifier_lists_to_disable` must be specified. + content-type: application/json + response: + docs: Success + type: root.UpdateItemModifierListsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + item_ids: + - H42BRLUJ5KTZTTMPVSLFAACQ + - 2JXOBJIHCWBQ4NZ3RIXQGJA6 + modifier_lists_to_enable: + - H42BRLUJ5KTZTTMPVSLFAACQ + - 2JXOBJIHCWBQ4NZ3RIXQGJA6 + modifier_lists_to_disable: + - 7WRC16CJZDVLSNDQ35PP6YAD + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + updated_at: '2016-11-16T22:25:24.878Z' + UpdateItemTaxes: + path: /v2/catalog/update-item-taxes + method: POST + auth: true + docs: |- + Updates the [CatalogTax](entity:CatalogTax) objects that apply to the + targeted [CatalogItem](entity:CatalogItem) without having to perform an + upsert on the entire item. + source: + openapi: openapi/openapi.json + display-name: UpdateItemTaxes + request: + name: UpdateItemTaxesRequest + body: + properties: + item_ids: + docs: >- + IDs for the CatalogItems associated with the CatalogTax objects + being updated. + + No more than 1,000 IDs may be provided. + type: list + taxes_to_enable: + type: optional>> + docs: >- + IDs of the CatalogTax objects to enable. + + At least one of `taxes_to_enable` or `taxes_to_disable` must be + specified. + taxes_to_disable: + type: optional>> + docs: >- + IDs of the CatalogTax objects to disable. + + At least one of `taxes_to_enable` or `taxes_to_disable` must be + specified. + content-type: application/json + response: + docs: Success + type: root.UpdateItemTaxesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + item_ids: + - H42BRLUJ5KTZTTMPVSLFAACQ + - 2JXOBJIHCWBQ4NZ3RIXQGJA6 + taxes_to_enable: + - 4WRCNHCJZDVLSNDQ35PP6YAD + taxes_to_disable: + - AQCEGCEBBQONINDOHRGZISEX + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + updated_at: '2016-11-16T22:25:24.878Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/catalog/images.yml b/.mock/definition/catalog/images.yml new file mode 100644 index 000000000..e8a5b2254 --- /dev/null +++ b/.mock/definition/catalog/images.yml @@ -0,0 +1,148 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/catalog/images + method: POST + auth: true + docs: >- + Uploads an image file to be represented by a + [CatalogImage](entity:CatalogImage) object that can be linked to an + existing + + [CatalogObject](entity:CatalogObject) instance. The resulting + `CatalogImage` is unattached to any `CatalogObject` if the `object_id` + + is not specified. + + + This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data + requests with a JSON part and an image file part in + + JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. + source: + openapi: openapi/openapi.json + display-name: CreateCatalogImage + request: + name: CreateImagesRequest + body: + properties: + request: + type: optional + content-type: application/json; charset=utf-8 + image_file: + type: optional + content-type: image/jpeg + content-type: multipart/form-data + response: + docs: Success + type: root.CreateCatalogImageResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + image: + id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + image_data: + name: name + url: url + caption: caption + photo_studio_order_id: photo_studio_order_id + type: IMAGE + update: + path: /v2/catalog/images/{image_id} + method: PUT + auth: true + docs: >- + Uploads a new image file to replace the existing one in the specified + [CatalogImage](entity:CatalogImage) object. + + + This `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data + requests with a JSON part and an image file part in + + JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. + source: + openapi: openapi/openapi.json + display-name: UpdateCatalogImage + request: + name: UpdateImagesRequest + path-parameters: + image_id: + type: string + docs: >- + The ID of the `CatalogImage` object to update the encapsulated + image file. + body: + properties: + request: + type: optional + content-type: application/json; charset=utf-8 + image_file: + type: optional + content-type: image/jpeg + content-type: multipart/form-data + response: + docs: Success + type: root.UpdateCatalogImageResponse + status-code: 200 + examples: + - path-parameters: + image_id: image_id + headers: + Square-Version: '2025-07-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + image: + id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + image_data: + name: name + url: url + caption: caption + photo_studio_order_id: photo_studio_order_id + type: IMAGE + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/catalog/object.yml b/.mock/definition/catalog/object.yml new file mode 100644 index 000000000..0d58c9663 --- /dev/null +++ b/.mock/definition/catalog/object.yml @@ -0,0 +1,390 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + upsert: + path: /v2/catalog/object + method: POST + auth: true + docs: >- + Creates a new or updates the specified + [CatalogObject](entity:CatalogObject). + + + To ensure consistency, only one update request is processed at a time + per seller account. + + While one (batch or non-batch) update request is being processed, other + (batched and non-batched) + + update requests are rejected with the `429` error code. + source: + openapi: openapi/openapi.json + display-name: UpsertCatalogObject + request: + name: UpsertCatalogObjectRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A value you specify that uniquely identifies this + + request among all your requests. A common way to create + + a valid idempotency key is to use a Universally unique + + identifier (UUID). + + + If you're unsure whether a particular request was successful, + + you can reattempt it with the same idempotency key without + + worrying about creating duplicate objects. + + + See + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 128 + object: + type: root.CatalogObject + docs: >- + A CatalogObject to be created or updated. + + + - For updates, the object must be active (the `is_deleted` field + is not `true`). + + - For creates, the object ID must start with `#`. The provided + ID is replaced with a server-generated ID. + content-type: application/json + response: + docs: Success + type: root.UpsertCatalogObjectResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: af3d1afc-7212-4300-b463-0bfc5314a5ae + object: + id: id + type: ITEM + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + catalog_object: + id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + item_data: + name: name + description: description + abbreviation: abbreviation + label_color: label_color + is_taxable: true + category_id: category_id + tax_ids: + - tax_ids + modifier_list_info: + - modifier_list_id: modifier_list_id + product_type: REGULAR + skip_modifier_screen: true + item_options: + - {} + ecom_uri: ecom_uri + ecom_image_uris: + - ecom_image_uris + image_ids: + - image_ids + sort_name: sort_name + description_html: description_html + description_plaintext: description_plaintext + channels: + - channels + is_archived: true + is_alcoholic: true + type: ITEM + id_mappings: + - client_object_id: '#Cocoa' + object_id: R2TA2FOBUGCJZNIWJSOSNAI4 + - client_object_id: '#Small' + object_id: QRT53UP4LITLWGOGBZCUWP63 + - client_object_id: '#Large' + object_id: NS77DKEIQ3AEQTCP727DSA7U + get: + path: /v2/catalog/object/{object_id} + method: GET + auth: true + docs: >- + Returns a single [CatalogItem](entity:CatalogItem) as a + + [CatalogObject](entity:CatalogObject) based on the provided ID. The + returned + + object includes all of the relevant [CatalogItem](entity:CatalogItem) + + information including: + [CatalogItemVariation](entity:CatalogItemVariation) + + children, references to its + + [CatalogModifierList](entity:CatalogModifierList) objects, and the ids + of + + any [CatalogTax](entity:CatalogTax) objects that apply to it. + source: + openapi: openapi/openapi.json + display-name: RetrieveCatalogObject + request: + name: GetObjectRequest + path-parameters: + object_id: + type: string + docs: The object ID of any type of catalog objects to be retrieved. + query-parameters: + include_related_objects: + type: optional> + default: false + docs: >- + If `true`, the response will include additional objects that are + related to the + + requested objects. Related objects are defined as any objects + referenced by ID by the results in the `objects` field + + of the response. These objects are put in the `related_objects` + field. Setting this to `true` is + + helpful when the objects are needed for immediate display to a + user. + + This process only goes one level deep. Objects referenced by the + related objects will not be included. For example, + + + if the `objects` field of the response contains a CatalogItem, its + associated + + CatalogCategory objects, CatalogTax objects, CatalogImage objects + and + + CatalogModifierLists will be returned in the `related_objects` + field of the + + response. If the `objects` field of the response contains a + CatalogItemVariation, + + its parent CatalogItem will be returned in the `related_objects` + field of + + the response. + + + Default value: `false` + catalog_version: + type: optional> + docs: >- + Requests objects as of a specific version of the catalog. This + allows you to retrieve historical + + versions of objects. The value to retrieve a specific version of + an object can be found + + in the version field of [CatalogObject](entity:CatalogObject)s. If + not included, results will + + be from the current version of the catalog. + include_category_path_to_root: + type: optional> + default: false + docs: >- + Specifies whether or not to include the `path_to_root` list for + each returned category instance. The `path_to_root` list consists + + of `CategoryPathToRootNode` objects and specifies the path that + starts with the immediate parent category of the returned category + + and ends with its root category. If the returned category is a + top-level category, the `path_to_root` list is empty and is not + returned + + in the response payload. + response: + docs: Success + type: root.GetCatalogObjectResponse + status-code: 200 + examples: + - path-parameters: + object_id: object_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + object: + id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + item_data: + name: name + description: description + abbreviation: abbreviation + label_color: label_color + is_taxable: true + category_id: category_id + tax_ids: + - tax_ids + modifier_list_info: + - modifier_list_id: modifier_list_id + product_type: REGULAR + skip_modifier_screen: true + item_options: + - {} + ecom_uri: ecom_uri + ecom_image_uris: + - ecom_image_uris + image_ids: + - image_ids + sort_name: sort_name + description_html: description_html + description_plaintext: description_plaintext + channels: + - channels + is_archived: true + is_alcoholic: true + type: ITEM + related_objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + ordinal: 1000000 + type: CATEGORY + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: TAX + delete: + path: /v2/catalog/object/{object_id} + method: DELETE + auth: true + docs: >- + Deletes a single [CatalogObject](entity:CatalogObject) based on the + + provided ID and returns the set of successfully deleted IDs in the + response. + + Deletion is a cascading event such that all children of the targeted + object + + are also deleted. For example, deleting a + [CatalogItem](entity:CatalogItem) + + will also delete all of its + + [CatalogItemVariation](entity:CatalogItemVariation) children. + + + To ensure consistency, only one delete request is processed at a time + per seller account. + + While one (batch or non-batch) delete request is being processed, other + (batched and non-batched) + + delete requests are rejected with the `429` error code. + source: + openapi: openapi/openapi.json + display-name: DeleteCatalogObject + request: + name: DeleteObjectRequest + path-parameters: + object_id: + type: string + docs: >- + The ID of the catalog object to be deleted. When an object is + deleted, other + + objects in the graph that depend on that object will be deleted as + well (for example, deleting a + + catalog item will delete its catalog item variations). + response: + docs: Success + type: root.DeleteCatalogObjectResponse + status-code: 200 + examples: + - path-parameters: + object_id: object_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + deleted_object_ids: + - 7SB3ZQYJ5GDMVFL7JK46JCHT + - KQLFFHA6K6J3YQAQAWDQAL57 + deleted_at: '2016-11-16T22:25:24.878Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/checkout.yml b/.mock/definition/checkout.yml new file mode 100644 index 000000000..068007e23 --- /dev/null +++ b/.mock/definition/checkout.yml @@ -0,0 +1,229 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + RetrieveLocationSettings: + path: /v2/online-checkout/location-settings/{location_id} + method: GET + auth: true + docs: Retrieves the location-level settings for a Square-hosted checkout page. + source: + openapi: openapi/openapi.json + display-name: RetrieveLocationSettings + request: + name: RetrieveLocationSettingsRequest + path-parameters: + location_id: + type: string + docs: The ID of the location for which to retrieve settings. + response: + docs: Success + type: root.RetrieveLocationSettingsResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + location_settings: + location_id: LOCATION_ID_1 + customer_notes_enabled: true + policies: + - uid: POLICY_ID_1 + title: Return Policy + description: This is my Return Policy + branding: + header_type: FRAMED_LOGO + button_color: '#ffffff' + button_shape: ROUNDED + tipping: + percentages: + - 10 + - 15 + - 20 + smart_tipping_enabled: true + default_percent: 15 + smart_tips: + - {} + coupons: + enabled: true + updated_at: '2022-06-16T22:25:35Z' + UpdateLocationSettings: + path: /v2/online-checkout/location-settings/{location_id} + method: PUT + auth: true + docs: Updates the location-level settings for a Square-hosted checkout page. + source: + openapi: openapi/openapi.json + display-name: UpdateLocationSettings + request: + name: UpdateLocationSettingsRequest + path-parameters: + location_id: + type: string + docs: The ID of the location for which to retrieve settings. + body: + properties: + location_settings: + type: root.CheckoutLocationSettings + docs: >- + Describe your updates using the `location_settings` object. Make + sure it contains only the fields that have changed. + content-type: application/json + response: + docs: Success + type: root.UpdateLocationSettingsResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + request: + location_settings: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + location_settings: + location_id: LOCATION_ID_1 + customer_notes_enabled: false + policies: + - uid: POLICY_ID_1 + title: Return Policy + description: This is my Return Policy + - uid: POLICY_ID_2 + title: Return Policy + description: Items may be returned within 30 days of purchase. + branding: + header_type: FRAMED_LOGO + button_color: '#00b23b' + button_shape: ROUNDED + tipping: + percentages: + - 15 + - 20 + - 25 + smart_tipping_enabled: true + default_percent: 20 + smart_tips: + - {} + coupons: + enabled: true + updated_at: '2022-06-16T22:25:35Z' + RetrieveMerchantSettings: + path: /v2/online-checkout/merchant-settings + method: GET + auth: true + docs: Retrieves the merchant-level settings for a Square-hosted checkout page. + source: + openapi: openapi/openapi.json + display-name: RetrieveMerchantSettings + response: + docs: Success + type: root.RetrieveMerchantSettingsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + merchant_settings: + payment_methods: + apple_pay: + enabled: true + google_pay: + enabled: true + afterpay_clearpay: + order_eligibility_range: + min: + amount: 100 + currency: USD + max: + amount: 10000 + currency: USD + item_eligibility_range: + min: + amount: 100 + currency: USD + max: + amount: 10000 + currency: USD + enabled: true + updated_at: '2022-06-16T22:25:35Z' + UpdateMerchantSettings: + path: /v2/online-checkout/merchant-settings + method: PUT + auth: true + docs: Updates the merchant-level settings for a Square-hosted checkout page. + source: + openapi: openapi/openapi.json + display-name: UpdateMerchantSettings + request: + name: UpdateMerchantSettingsRequest + body: + properties: + merchant_settings: + type: root.CheckoutMerchantSettings + docs: >- + Describe your updates using the `merchant_settings` object. Make + sure it contains only the fields that have changed. + content-type: application/json + response: + docs: Success + type: root.UpdateMerchantSettingsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + merchant_settings: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + merchant_settings: + payment_methods: + apple_pay: + enabled: false + google_pay: + enabled: true + afterpay_clearpay: + order_eligibility_range: + min: + amount: 100 + currency: USD + max: + amount: 10000 + currency: USD + item_eligibility_range: + min: + amount: 100 + currency: USD + max: + amount: 10000 + currency: USD + enabled: true + updated_at: '2022-06-16T22:25:35Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/checkout/paymentLinks.yml b/.mock/definition/checkout/paymentLinks.yml new file mode 100644 index 000000000..48d3051f7 --- /dev/null +++ b/.mock/definition/checkout/paymentLinks.yml @@ -0,0 +1,448 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/online-checkout/payment-links + method: GET + auth: true + docs: Lists all payment links. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.payment_links + source: + openapi: openapi/openapi.json + display-name: ListPaymentLinks + request: + name: ListPaymentLinksRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + If a cursor is not provided, the endpoint returns the first page + of the results. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + A limit on the number of results to return per page. The limit is + advisory and + + the implementation might return more or less results. If the + supplied limit is negative, zero, or + + greater than the maximum limit of 1000, it is ignored. + + + Default value: `100` + response: + docs: Success + type: root.ListPaymentLinksResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment_links: + - id: TN4BWEDJ9AI5MBIV + version: 2 + description: description + order_id: Qqc6yppGvxVwc46Cch4zHTaJqc4F + checkout_options: + ask_for_shipping_address: true + url: https://square.link/u/EXAMPLE + long_url: long_url + created_at: '2022-04-26T00:15:15Z' + updated_at: '2022-04-26T00:18:24Z' + payment_note: test + - id: RY5UNCUMPJN5XKCT + version: 1 + description: '' + order_id: EmBmGt3zJD15QeO1dxzBTxMxtwfZY + url: https://square.link/u/EXAMPLE + long_url: long_url + created_at: '2022-04-11T23:14:59Z' + updated_at: updated_at + payment_note: payment_note + cursor: MTY1NQ== + create: + path: /v2/online-checkout/payment-links + method: POST + auth: true + docs: >- + Creates a Square-hosted checkout page. Applications can share the + resulting payment link with their buyer to pay for goods and services. + source: + openapi: openapi/openapi.json + display-name: CreatePaymentLink + request: + name: CreatePaymentLinkRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies this `CreatePaymentLinkRequest` + request. + + If you do not provide a unique string (or provide an empty + string as the value), + + the endpoint treats each request as independent. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + maxLength: 192 + description: + type: optional + docs: >- + A description of the payment link. You provide this optional + description that is useful in your + + application context. It is not used anywhere. + validation: + maxLength: 4096 + quick_pay: + type: optional + docs: >- + Describes an ad hoc item and price for which to generate a quick + pay checkout link. + + For more information, + + see [Quick Pay + Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout). + order: + type: optional + docs: >- + Describes the `Order` for which to create a checkout link. + + For more information, + + see [Square Order + Checkout](https://developer.squareup.com/docs/checkout-api/square-order-checkout). + checkout_options: + type: optional + docs: >- + Describes optional fields to add to the resulting checkout page. + + For more information, + + see [Optional Checkout + Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). + pre_populated_data: + type: optional + docs: >- + Describes fields to prepopulate in the resulting checkout page. + + For more information, see [Prepopulate the shipping + address](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#prepopulate-the-shipping-address). + payment_note: + type: optional + docs: >- + A note for the payment. After processing the payment, Square + adds this note to the resulting `Payment`. + validation: + maxLength: 500 + content-type: application/json + response: + docs: Success + type: root.CreatePaymentLinkResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: cd9e25dc-d9f2-4430-aedb-61605070e95f + quick_pay: + name: Auto Detailing + price_money: + amount: 10000 + currency: USD + location_id: A9Y43N9ABXZBP + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment_link: + id: PKVT6XGJZXYUP3NZ + version: 1 + description: description + order_id: o4b7saqp4HzhNttf5AJxC0Srjd4F + checkout_options: + allow_tipping: true + custom_fields: + - title: title + subscription_plan_id: subscription_plan_id + redirect_url: redirect_url + merchant_support_email: merchant_support_email + ask_for_shipping_address: true + shipping_fee: + charge: {} + enable_coupon: true + enable_loyalty: true + pre_populated_data: + buyer_email: buyer_email + buyer_phone_number: buyer_phone_number + url: https://square.link/u/EXAMPLE + long_url: https://checkout.square.site/EXAMPLE + created_at: '2022-04-25T23:58:01Z' + updated_at: updated_at + payment_note: payment_note + related_resources: + orders: + - id: o4b7saqp4HzhNttf5AJxC0Srjd4F + location_id: '{LOCATION_ID}' + source: + name: Test Online Checkout Application + line_items: + - uid: 8YX13D1U3jO7czP8JVrAR + name: Auto Detailing + quantity: '1' + item_type: ITEM + base_price_money: + amount: 12500 + currency: USD + variation_total_price_money: + amount: 12500 + currency: USD + gross_sales_money: + amount: 12500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_money: + amount: 12500 + currency: USD + fulfillments: + - uid: bBpNrxjdQxGQP16sTmdzi + type: PICKUP + state: PROPOSED + net_amounts: + total_money: + amount: 12500 + currency: USD + tax_money: + amount: 0 + currency: USD + discount_money: + amount: 0 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + created_at: '2022-03-03T00:53:15.829Z' + updated_at: '2022-03-03T00:53:15.829Z' + state: DRAFT + version: 1 + total_money: + amount: 12500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_tip_money: + amount: 0 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + subscription_plans: + - id: id + type: ITEM + get: + path: /v2/online-checkout/payment-links/{id} + method: GET + auth: true + docs: Retrieves a payment link. + source: + openapi: openapi/openapi.json + display-name: RetrievePaymentLink + request: + name: GetPaymentLinksRequest + path-parameters: + id: + type: string + docs: The ID of link to retrieve. + response: + docs: Success + type: root.GetPaymentLinkResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment_link: + id: LLO5Q3FRCFICDB4B + version: 1 + description: description + order_id: 4uKASDATqSd1QQ9jV86sPhMdVEbSJc4F + checkout_options: + allow_tipping: true + custom_fields: + - title: title + subscription_plan_id: subscription_plan_id + redirect_url: redirect_url + merchant_support_email: merchant_support_email + ask_for_shipping_address: true + shipping_fee: + charge: {} + enable_coupon: true + enable_loyalty: true + pre_populated_data: + buyer_email: buyer_email + buyer_phone_number: buyer_phone_number + url: https://square.link/u/EXAMPLE + long_url: https://checkout.square.site/EXAMPLE + created_at: '2022-04-26T00:10:29Z' + updated_at: updated_at + payment_note: payment_note + update: + path: /v2/online-checkout/payment-links/{id} + method: PUT + auth: true + docs: >- + Updates a payment link. You can update the `payment_link` fields such as + + `description`, `checkout_options`, and `pre_populated_data`. + + You cannot update other fields such as the `order_id`, `version`, `URL`, + or `timestamp` field. + source: + openapi: openapi/openapi.json + display-name: UpdatePaymentLink + request: + name: UpdatePaymentLinkRequest + path-parameters: + id: + type: string + docs: The ID of the payment link to update. + body: + properties: + payment_link: + type: root.PaymentLink + docs: >- + The `payment_link` object describing the updates to apply. + + For more information, see [Update a payment + link](https://developer.squareup.com/docs/checkout-api/manage-checkout#update-a-payment-link). + content-type: application/json + response: + docs: Success + type: root.UpdatePaymentLinkResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + request: + payment_link: + version: 1 + checkout_options: + ask_for_shipping_address: true + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment_link: + id: TY4BWEDJ6AI5MBIV + version: 2 + description: description + order_id: Qqc8ypQGvxVwc46Cch4zHTaJqc4F + checkout_options: + allow_tipping: true + custom_fields: + - title: title + subscription_plan_id: subscription_plan_id + redirect_url: redirect_url + merchant_support_email: merchant_support_email + ask_for_shipping_address: true + shipping_fee: + charge: {} + enable_coupon: true + enable_loyalty: true + pre_populated_data: + buyer_email: buyer_email + buyer_phone_number: buyer_phone_number + url: https://square.link/u/EXAMPLE + long_url: https://checkout.square.site/EXAMPLE + created_at: '2022-04-26T00:15:15Z' + updated_at: '2022-04-26T00:18:24Z' + payment_note: test + delete: + path: /v2/online-checkout/payment-links/{id} + method: DELETE + auth: true + docs: Deletes a payment link. + source: + openapi: openapi/openapi.json + display-name: DeletePaymentLink + request: + name: DeletePaymentLinksRequest + path-parameters: + id: + type: string + docs: The ID of the payment link to delete. + response: + docs: Success + type: root.DeletePaymentLinkResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + id: MQASNYL6QB6DFCJ3 + cancelled_order_id: asx8LgZ6MRzD0fObfkJ6obBmSh4F + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers.yml b/.mock/definition/customers.yml new file mode 100644 index 000000000..0352c81e0 --- /dev/null +++ b/.mock/definition/customers.yml @@ -0,0 +1,1152 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/customers + method: GET + auth: true + docs: >- + Lists customer profiles associated with a Square account. + + + Under normal operating conditions, newly created or updated customer + profiles become available + + for the listing operation in well under 30 seconds. Occasionally, + propagation of the new or updated + + profiles can take closer to one minute or longer, especially during + network incidents and outages. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.customers + source: + openapi: openapi/openapi.json + display-name: ListCustomers + request: + name: ListCustomersRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for your + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single page. This + limit is advisory. The response might contain more or fewer + results. + + If the specified limit is less than 1 or greater than 100, Square + returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The + default value is 100. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + sort_field: + type: optional> + docs: |- + Indicates how customers should be sorted. + + The default value is `DEFAULT`. + sort_order: + type: optional> + docs: >- + Indicates whether customers should be sorted in ascending (`ASC`) + or + + descending (`DESC`) order. + + + The default value is `ASC`. + count: + type: optional> + default: false + docs: >- + Indicates whether to return the total count of customers in the + `count` field of the response. + + + The default value is `false`. + response: + docs: Success + type: root.ListCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + customers: + - id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2016-03-23T20:21:54.859Z' + updated_at: '2016-03-23T20:21:55Z' + given_name: Amelia + family_name: Earhart + nickname: nickname + company_name: company_name + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-4240 + birthday: birthday + reference_id: YOUR_REFERENCE_ID + note: a customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + group_ids: + - 545AXB44B4XXWMVQ4W8SBT3HHF + segment_ids: + - 1KB9JE5EGJXCW.REACHABLE + version: 1 + cursor: cursor + count: 1000000 + create: + path: /v2/customers + method: POST + auth: true + docs: >- + Creates a new customer for a business. + + + You must provide at least one of the following values in your request to + this + + endpoint: + + + - `given_name` + + - `family_name` + + - `company_name` + + - `email_address` + + - `phone_number` + source: + openapi: openapi/openapi.json + display-name: CreateCustomer + request: + name: CreateCustomerRequest + body: + properties: + idempotency_key: + type: optional + docs: "The idempotency key for the request.\tFor more information, see\n[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)." + given_name: + type: optional + docs: >- + The given name (that is, the first name) associated with the + customer profile. + + + The maximum length for this value is 300 characters. + family_name: + type: optional + docs: >- + The family name (that is, the last name) associated with the + customer profile. + + + The maximum length for this value is 300 characters. + company_name: + type: optional + docs: |- + A business name associated with the customer profile. + + The maximum length for this value is 500 characters. + nickname: + type: optional + docs: |- + A nickname for the customer profile. + + The maximum length for this value is 100 characters. + email_address: + type: optional + docs: |- + The email address associated with the customer profile. + + The maximum length for this value is 254 characters. + address: + type: optional + docs: >- + The physical address associated with the customer profile. For + maximum length constraints, see + + [Customer + addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address). + + The `first_name` and `last_name` fields are ignored if they are + present in the request. + phone_number: + type: optional + docs: >- + The phone number associated with the customer profile. The phone + number must be valid and can contain + + 9–16 digits, with an optional `+` prefix and country code. For + more information, see + + [Customer phone + numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + reference_id: + type: optional + docs: >- + An optional second ID used to associate the customer profile + with an + + entity in another system. + + + The maximum length for this value is 100 characters. + note: + type: optional + docs: A custom note associated with the customer profile. + birthday: + type: optional + docs: >- + The birthday associated with the customer profile, in + `YYYY-MM-DD` or `MM-DD` format. For example, + + specify `1998-09-21` for September 21, 1998, or `09-21` for + September 21. Birthdays are returned in `YYYY-MM-DD` + + format, where `YYYY` is the specified birth year or `0000` if a + birth year is not specified. + tax_ids: + type: optional + docs: >- + The tax ID associated with the customer profile. This field is + available only for customers of sellers + + in EU countries or the United Kingdom. For more information, + + see [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + content-type: application/json + response: + docs: Success + type: root.CreateCustomerResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-4240 + reference_id: YOUR_REFERENCE_ID + note: a customer + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + customer: + id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2016-03-23T20:21:54.859Z' + updated_at: '2016-03-23T20:21:54.859Z' + given_name: Amelia + family_name: Earhart + nickname: nickname + company_name: company_name + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + phone_number: +1-212-555-4240 + birthday: birthday + reference_id: YOUR_REFERENCE_ID + note: a customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + group_ids: + - group_ids + segment_ids: + - segment_ids + version: 0 + tax_ids: + eu_vat: eu_vat + batchCreate: + path: /v2/customers/bulk-create + method: POST + auth: true + docs: >- + Creates multiple [customer profiles](entity:Customer) for a business. + + + This endpoint takes a map of individual create requests and returns a + map of responses. + + + You must provide at least one of the following values in each create + request: + + + - `given_name` + + - `family_name` + + - `company_name` + + - `email_address` + + - `phone_number` + source: + openapi: openapi/openapi.json + display-name: BulkCreateCustomers + request: + name: BulkCreateCustomersRequest + body: + properties: + customers: + type: map + docs: >- + A map of 1 to 100 individual create requests, represented by + `idempotency key: { customer data }` + + key-value pairs. + + + Each key is an [idempotency + key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + + that uniquely identifies the create request. Each value contains + the customer data used to create the + + customer profile. + content-type: application/json + response: + docs: Success + type: root.BulkCreateCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + customers: + 8bb76c4f-e35d-4c5b-90de-1194cd9179f0: + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-4240 + reference_id: YOUR_REFERENCE_ID + note: a customer + d1689f23-b25d-4932-b2f0-aed00f5e2029: + given_name: Marie + family_name: Curie + email_address: Marie.Curie@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 601 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-444-4240 + reference_id: YOUR_REFERENCE_ID + note: another customer + response: + body: + responses: + 8bb76c4f-e35d-4c5b-90de-1194cd9179f4: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: 8DDA5NZVBZFGAX0V3HPF81HHE0 + created_at: '2024-03-23T20:21:54.859Z' + updated_at: '2024-03-23T20:21:54.859Z' + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-4240 + reference_id: YOUR_REFERENCE_ID + note: a customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 0 + d1689f23-b25d-4932-b2f0-aed00f5e2029: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: N18CPRVXR5214XPBBA6BZQWF3C + created_at: '2024-03-23T20:21:54.859Z' + updated_at: '2024-03-23T20:21:54.859Z' + given_name: Marie + family_name: Curie + email_address: Marie.Curie@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 601 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-444-4240 + reference_id: YOUR_REFERENCE_ID + note: another customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 0 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkDeleteCustomers: + path: /v2/customers/bulk-delete + method: POST + auth: true + docs: >- + Deletes multiple customer profiles. + + + The endpoint takes a list of customer IDs and returns a map of + responses. + source: + openapi: openapi/openapi.json + display-name: BulkDeleteCustomers + request: + name: BulkDeleteCustomersRequest + body: + properties: + customer_ids: + docs: The IDs of the [customer profiles](entity:Customer) to delete. + type: list + content-type: application/json + response: + docs: Success + type: root.BulkDeleteCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + customer_ids: + - 8DDA5NZVBZFGAX0V3HPF81HHE0 + - N18CPRVXR5214XPBBA6BZQWF3C + - 2GYD7WNXF7BJZW1PMGNXZ3Y8M8 + response: + body: + responses: + 2GYD7WNXF7BJZW1PMGNXZ3Y8M8: + errors: + - category: INVALID_REQUEST_ERROR + code: NOT_FOUND + detail: Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found. + 8DDA5NZVBZFGAX0V3HPF81HHE0: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + N18CPRVXR5214XPBBA6BZQWF3C: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkRetrieveCustomers: + path: /v2/customers/bulk-retrieve + method: POST + auth: true + docs: >- + Retrieves multiple customer profiles. + + + This endpoint takes a list of customer IDs and returns a map of + responses. + source: + openapi: openapi/openapi.json + display-name: BulkRetrieveCustomers + request: + name: BulkRetrieveCustomersRequest + body: + properties: + customer_ids: + docs: The IDs of the [customer profiles](entity:Customer) to retrieve. + type: list + content-type: application/json + response: + docs: Success + type: root.BulkRetrieveCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + customer_ids: + - 8DDA5NZVBZFGAX0V3HPF81HHE0 + - N18CPRVXR5214XPBBA6BZQWF3C + - 2GYD7WNXF7BJZW1PMGNXZ3Y8M8 + response: + body: + responses: + 2GYD7WNXF7BJZW1PMGNXZ3Y8M8: + errors: + - category: INVALID_REQUEST_ERROR + code: NOT_FOUND + detail: Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found. + 8DDA5NZVBZFGAX0V3HPF81HHE0: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: 8DDA5NZVBZFGAX0V3HPF81HHE0 + created_at: '2024-01-19T00:27:54.59Z' + updated_at: '2024-01-19T00:38:06Z' + given_name: Amelia + family_name: Earhart + email_address: New.Amelia.Earhart@example.com + birthday: '1897-07-24' + note: updated customer note + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 3 + N18CPRVXR5214XPBBA6BZQWF3C: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: N18CPRVXR5214XPBBA6BZQWF3C + created_at: '2024-01-19T00:27:54.59Z' + updated_at: '2024-01-19T00:38:06Z' + given_name: Marie + family_name: Curie + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 1 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkUpdateCustomers: + path: /v2/customers/bulk-update + method: POST + auth: true + docs: >- + Updates multiple customer profiles. + + + This endpoint takes a map of individual update requests and returns a + map of responses. + source: + openapi: openapi/openapi.json + display-name: BulkUpdateCustomers + request: + name: BulkUpdateCustomersRequest + body: + properties: + customers: + type: map + docs: >- + A map of 1 to 100 individual update requests, represented by + `customer ID: { customer data }` + + key-value pairs. + + + Each key is the ID of the [customer profile](entity:Customer) to + update. To update a customer profile + + that was created by merging existing profiles, provide the ID of + the newly created profile. + + + Each value contains the updated customer data. Only new or + changed fields are required. To add or + + update a field, specify the new value. To remove a field, + specify `null`. + content-type: application/json + response: + docs: Success + type: root.BulkUpdateCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + customers: + 8DDA5NZVBZFGAX0V3HPF81HHE0: + email_address: New.Amelia.Earhart@example.com + note: updated customer note + version: 2 + N18CPRVXR5214XPBBA6BZQWF3C: + given_name: Marie + family_name: Curie + version: 0 + response: + body: + responses: + 8DDA5NZVBZFGAX0V3HPF81HHE0: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: 8DDA5NZVBZFGAX0V3HPF81HHE0 + created_at: '2024-01-19T00:27:54.59Z' + updated_at: '2024-01-19T00:38:06Z' + given_name: Amelia + family_name: Earhart + email_address: New.Amelia.Earhart@example.com + birthday: '1897-07-24' + note: updated customer note + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 3 + N18CPRVXR5214XPBBA6BZQWF3C: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: N18CPRVXR5214XPBBA6BZQWF3C + created_at: '2024-01-19T00:27:54.59Z' + updated_at: '2024-01-19T00:38:06Z' + given_name: Marie + family_name: Curie + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 1 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/customers/search + method: POST + auth: true + docs: >- + Searches the customer profiles associated with a Square account using + one or more supported query filters. + + + Calling `SearchCustomers` without any explicit query filter returns all + + customer profiles ordered alphabetically based on `given_name` and + + `family_name`. + + + Under normal operating conditions, newly created or updated customer + profiles become available + + for the search operation in well under 30 seconds. Occasionally, + propagation of the new or updated + + profiles can take closer to one minute or longer, especially during + network incidents and outages. + source: + openapi: openapi/openapi.json + display-name: SearchCustomers + request: + name: SearchCustomersRequest + body: + properties: + cursor: + type: optional + docs: >- + Include the pagination cursor in subsequent calls to this + endpoint to retrieve + + the next set of results associated with the original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional + docs: >- + The maximum number of results to return in a single page. This + limit is advisory. The response might contain more or fewer + results. + + If the specified limit is invalid, Square returns a `400 + VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value + is 100. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + query: + type: optional + docs: >- + The filtering and sorting criteria for the search request. If a + query is not specified, + + Square returns all customer profiles ordered alphabetically by + `given_name` and `family_name`. + count: + type: optional + docs: >- + Indicates whether to return the total count of matching + customers in the `count` field of the response. + + + The default value is `false`. + content-type: application/json + response: + docs: Success + type: root.SearchCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + limit: 2 + query: + filter: + creation_source: + values: + - THIRD_PARTY + rule: INCLUDE + created_at: + start_at: '2018-01-01T00:00:00-00:00' + end_at: '2018-02-01T00:00:00-00:00' + email_address: + fuzzy: example.com + group_ids: + all: + - 545AXB44B4XXWMVQ4W8SBT3HHF + sort: + field: CREATED_AT + order: ASC + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + customers: + - id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2018-01-23T20:21:54.859Z' + updated_at: '2020-04-20T10:02:43.083Z' + given_name: James + family_name: Bond + nickname: nickname + company_name: company_name + email_address: james.bond@example.com + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-4250 + birthday: birthday + reference_id: YOUR_REFERENCE_ID_2 + note: note + preferences: + email_unsubscribed: false + creation_source: DIRECTORY + group_ids: + - 545AXB44B4XXWMVQ4W8SBT3HHF + segment_ids: + - 1KB9JE5EGJXCW.REACHABLE + version: 7 + - id: A9641GZW2H7Z56YYSD41Q12HDW + created_at: '2018-01-30T14:10:54.859Z' + updated_at: '2018-03-08T18:25:21.342Z' + given_name: Amelia + family_name: Earhart + nickname: nickname + company_name: company_name + email_address: amelia.earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-9238 + birthday: birthday + reference_id: YOUR_REFERENCE_ID_1 + note: a customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + group_ids: + - 545AXB44B4XXWMVQ4W8SBT3HHF + segment_ids: + - 1KB9JE5EGJXCW.REACHABLE + version: 1 + cursor: 9dpS093Uy12AzeE + count: 1000000 + get: + path: /v2/customers/{customer_id} + method: GET + auth: true + docs: Returns details for a single customer. + source: + openapi: openapi/openapi.json + display-name: RetrieveCustomer + request: + name: GetCustomersRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer to retrieve. + response: + docs: Success + type: root.GetCustomerResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + customer: + id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2016-03-23T20:21:54.859Z' + updated_at: '2016-03-23T20:21:54.859Z' + given_name: Amelia + family_name: Earhart + nickname: nickname + company_name: company_name + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + phone_number: +1-212-555-4240 + birthday: birthday + reference_id: YOUR_REFERENCE_ID + note: a customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + group_ids: + - 545AXB44B4XXWMVQ4W8SBT3HHF + segment_ids: + - 1KB9JE5EGJXCW.REACHABLE + version: 1 + tax_ids: + eu_vat: eu_vat + update: + path: /v2/customers/{customer_id} + method: PUT + auth: true + docs: >- + Updates a customer profile. This endpoint supports sparse updates, so + only new or changed fields are required in the request. + + To add or update a field, specify the new value. To remove a field, + specify `null`. + + + To update a customer profile that was created by merging existing + profiles, you must use the ID of the newly created profile. + source: + openapi: openapi/openapi.json + display-name: UpdateCustomer + request: + name: UpdateCustomerRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer to update. + body: + properties: + given_name: + type: optional> + docs: >- + The given name (that is, the first name) associated with the + customer profile. + + + The maximum length for this value is 300 characters. + family_name: + type: optional> + docs: >- + The family name (that is, the last name) associated with the + customer profile. + + + The maximum length for this value is 300 characters. + company_name: + type: optional> + docs: |- + A business name associated with the customer profile. + + The maximum length for this value is 500 characters. + nickname: + type: optional> + docs: |- + A nickname for the customer profile. + + The maximum length for this value is 100 characters. + email_address: + type: optional> + docs: |- + The email address associated with the customer profile. + + The maximum length for this value is 254 characters. + address: + type: optional + docs: >- + The physical address associated with the customer profile. Only + new or changed fields are required in the request. + + + For maximum length constraints, see [Customer + addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address). + + The `first_name` and `last_name` fields are ignored if they are + present in the request. + phone_number: + type: optional> + docs: >- + The phone number associated with the customer profile. The phone + number must be valid and can contain + + 9–16 digits, with an optional `+` prefix and country code. For + more information, see + + [Customer phone + numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + reference_id: + type: optional> + docs: >- + An optional second ID used to associate the customer profile + with an + + entity in another system. + + + The maximum length for this value is 100 characters. + note: + type: optional> + docs: A custom note associated with the customer profile. + birthday: + type: optional> + docs: >- + The birthday associated with the customer profile, in + `YYYY-MM-DD` or `MM-DD` format. For example, + + specify `1998-09-21` for September 21, 1998, or `09-21` for + September 21. Birthdays are returned in `YYYY-MM-DD` + + format, where `YYYY` is the specified birth year or `0000` if a + birth year is not specified. + version: + type: optional + docs: >- + The current version of the customer profile. + + + As a best practice, you should include this field to enable + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + control. For more information, see [Update a customer + profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#update-a-customer-profile). + tax_ids: + type: optional + docs: >- + The tax ID associated with the customer profile. This field is + available only for customers of sellers + + in EU countries or the United Kingdom. For more information, + + see [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + content-type: application/json + response: + docs: Success + type: root.UpdateCustomerResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + headers: + Square-Version: '2025-07-16' + request: + email_address: New.Amelia.Earhart@example.com + note: updated customer note + version: 2 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + customer: + id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2016-03-23T20:21:54.859Z' + updated_at: '2016-05-15T20:21:55Z' + given_name: Amelia + family_name: Earhart + nickname: nickname + company_name: company_name + email_address: New.Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + phone_number: phone_number + birthday: birthday + reference_id: YOUR_REFERENCE_ID + note: updated customer note + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + group_ids: + - group_ids + segment_ids: + - segment_ids + version: 3 + tax_ids: + eu_vat: eu_vat + delete: + path: /v2/customers/{customer_id} + method: DELETE + auth: true + docs: >- + Deletes a customer profile from a business. + + + To delete a customer profile that was created by merging existing + profiles, you must use the ID of the newly created profile. + source: + openapi: openapi/openapi.json + display-name: DeleteCustomer + request: + name: DeleteCustomersRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer to delete. + query-parameters: + version: + type: optional> + docs: >- + The current version of the customer profile. + + + As a best practice, you should include this parameter to enable + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + control. For more information, see [Delete a customer + profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile). + response: + docs: Success + type: root.DeleteCustomerResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers/cards.yml b/.mock/definition/customers/cards.yml new file mode 100644 index 000000000..733e3be5f --- /dev/null +++ b/.mock/definition/customers/cards.yml @@ -0,0 +1,177 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/customers/{customer_id}/cards + method: POST + auth: true + docs: >- + Adds a card on file to an existing customer. + + + As with charges, calls to `CreateCustomerCard` are idempotent. Multiple + + calls with the same card nonce return the same card record that was + created + + with the provided nonce during the _first_ call. + source: + openapi: openapi/openapi.json + display-name: CreateCustomerCard + request: + name: CreateCustomerCardRequest + path-parameters: + customer_id: + type: string + docs: The Square ID of the customer profile the card is linked to. + body: + properties: + card_nonce: + type: string + docs: >- + A card nonce representing the credit card to link to the + customer. + + + Card nonces are generated by the Square payment form when + customers enter + + their card information. For more information, see + + [Walkthrough: Integrate Square Payments in a + Website](https://developer.squareup.com/docs/web-payments/take-card-payment). + + + __NOTE:__ Card nonces generated by digital wallets (such as + Apple Pay) + + cannot be used to create a customer card. + billing_address: + type: optional + docs: >- + Address information for the card on file. + + + __NOTE:__ If a billing address is provided in the request, the + + `CreateCustomerCardRequest.billing_address.postal_code` must + match + + the postal code encoded in the card nonce. + cardholder_name: + type: optional + docs: The full name printed on the credit card. + verification_token: + type: optional + docs: >- + An identifying token generated by + [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). + + Verification tokens encapsulate customer device information and + 3-D Secure + + challenge results to indicate that Square has verified the buyer + identity. + content-type: application/json + response: + docs: Success + type: root.CreateCustomerCardResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + customer_id: customer_id + headers: + Square-Version: '2025-07-16' + request: + card_nonce: YOUR_CARD_NONCE + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + cardholder_name: Amelia Earhart + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + card: + id: icard-card_id + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2018 + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + fingerprint: fingerprint + customer_id: customer_id + merchant_id: merchant_id + reference_id: reference_id + enabled: true + card_type: UNKNOWN_CARD_TYPE + prepaid_type: UNKNOWN_PREPAID_TYPE + bin: bin + version: 1000000 + card_co_brand: UNKNOWN + issuer_alert: ISSUER_ALERT_CARD_CLOSED + issuer_alert_at: issuer_alert_at + hsa_fsa: true + delete: + path: /v2/customers/{customer_id}/cards/{card_id} + method: DELETE + auth: true + docs: Removes a card on file from a customer. + source: + openapi: openapi/openapi.json + display-name: DeleteCustomerCard + request: + name: DeleteCardsRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer that the card on file belongs to. + card_id: + type: string + docs: The ID of the card on file to delete. + response: + docs: Success + type: root.DeleteCustomerCardResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + customer_id: customer_id + card_id: card_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers/customAttributeDefinitions.yml b/.mock/definition/customers/customAttributeDefinitions.yml new file mode 100644 index 000000000..efc708409 --- /dev/null +++ b/.mock/definition/customers/customAttributeDefinitions.yml @@ -0,0 +1,588 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/customers/custom-attribute-definitions + method: GET + auth: true + docs: >- + Lists the customer-related [custom attribute + definitions](entity:CustomAttributeDefinition) that belong to a Square + seller account. + + + When all response pages are retrieved, the results include all custom + attribute definitions + + that are visible to the requesting application, including those that are + created by other + + applications and set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. Note that + + seller-defined custom attributes (also known as custom fields) are + always set to `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attribute_definitions + source: + openapi: openapi/openapi.json + display-name: ListCustomerCustomAttributeDefinitions + request: + name: ListCustomAttributeDefinitionsRequest + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListCustomerCustomAttributeDefinitionsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute_definitions: + - key: favoritemovie + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Movie + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 3 + updated_at: '2022-04-26T15:39:38Z' + created_at: '2022-04-26T15:27:30Z' + - key: ownsmovie + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean + name: Owns Movie + description: Customer owns movie. + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: '2022-04-26T15:49:05Z' + created_at: '2022-04-26T15:49:05Z' + cursor: >- + YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/customers/custom-attribute-definitions + method: POST + auth: true + docs: >- + Creates a customer-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + Use this endpoint to define a custom attribute that can be associated + with customer profiles. + + + A custom attribute definition specifies the `key`, `visibility`, + `schema`, and other properties + + for a custom attribute. After the definition is created, you can call + + [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) + or + + [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + + to set the custom attribute for customer profiles in the seller's + Customer Directory. + + + Sellers can view all custom attributes in exported customer data, + including those set to + + `VISIBILITY_HIDDEN`. + source: + openapi: openapi/openapi.json + display-name: CreateCustomerCustomAttributeDefinition + request: + name: CreateCustomerCustomAttributeDefinitionRequest + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition to create. Note the following: + + - With the exception of the `Selection` data type, the `schema` + is specified as a simple URL to the JSON schema + + definition hosted on the Square CDN. For more information, + including supported values and constraints, see + + [Specifying the + schema](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#specify-schema). + + - If provided, `name` must be unique (case-sensitive) across all + visible customer-related custom attribute definitions for the + seller. + + - All custom attributes are visible in exported customer data, + including those set to `VISIBILITY_HIDDEN`. + idempotency_key: + type: optional + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateCustomerCustomAttributeDefinitionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + custom_attribute_definition: + key: favoritemovie + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Movie + description: The favorite movie of the customer. + visibility: VISIBILITY_HIDDEN + response: + body: + custom_attribute_definition: + key: favoritemovie + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Movie + description: The favorite movie of the customer. + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: '2022-04-26T15:27:30Z' + created_at: '2022-04-26T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/customers/custom-attribute-definitions/{key} + method: GET + auth: true + docs: >- + Retrieves a customer-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + + To retrieve a custom attribute definition created by another + application, the `visibility` + + setting must be `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveCustomerCustomAttributeDefinition + request: + name: GetCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: >- + The key of the custom attribute definition to retrieve. If the + requesting application + + is not the definition owner, you must use the qualified key. + query-parameters: + version: + type: optional> + docs: >- + The current version of the custom attribute definition, which is + used for strongly consistent + + reads to guarantee that you receive the most up-to-date data. When + included in the request, + + Square returns the specified version or a higher version if one + exists. If the specified version + + is higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.GetCustomerCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute_definition: + key: favoritemovie + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Movie + description: The favorite movie of the customer. + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-04-26T15:27:30Z' + created_at: '2022-04-26T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/customers/custom-attribute-definitions/{key} + method: PUT + auth: true + docs: >- + Updates a customer-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + + Use this endpoint to update the following fields: `name`, `description`, + `visibility`, or the + + `schema` for a `Selection` data type. + + + Only the definition owner can update a custom attribute definition. Note + that sellers can view + + all custom attributes in exported customer data, including those set to + `VISIBILITY_HIDDEN`. + source: + openapi: openapi/openapi.json + display-name: UpdateCustomerCustomAttributeDefinition + request: + name: UpdateCustomerCustomAttributeDefinitionRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to update. + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition that contains the fields to + update. This endpoint + + supports sparse updates, so only new or changed fields need to + be included in the request. + + Only the following fields can be updated: + + + - `name` + + - `description` + + - `visibility` + + - `schema` for a `Selection` data type. Only changes to the + named options or the maximum number of allowed + + selections are supported. + + + For more information, see + + [Updatable definition + fields](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields). + + + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include the optional `version` field and specify the + current version of the custom attribute definition. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateCustomerCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + request: + custom_attribute_definition: + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + response: + body: + custom_attribute_definition: + key: favoritemovie + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Movie + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 2 + updated_at: '2022-04-26T15:39:38Z' + created_at: '2022-04-26T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/customers/custom-attribute-definitions/{key} + method: DELETE + auth: true + docs: >- + Deletes a customer-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + + Deleting a custom attribute definition also deletes the corresponding + custom attribute from + + all customer profiles in the seller's Customer Directory. + + + Only the definition owner can delete a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: DeleteCustomerCustomAttributeDefinition + request: + name: DeleteCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to delete. + response: + docs: Success + type: root.DeleteCustomerCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchUpsert: + path: /v2/customers/custom-attributes/bulk-upsert + method: POST + auth: true + docs: >- + Creates or updates [custom attributes](entity:CustomAttribute) for + customer profiles as a bulk operation. + + + Use this endpoint to set the value of one or more custom attributes for + one or more customer profiles. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which is + + created using the + [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) + endpoint. + + + This `BulkUpsertCustomerCustomAttributes` endpoint accepts a map of 1 to + 25 individual upsert + + requests and returns a map of individual upsert responses. Each upsert + request has a unique ID + + and provides a customer ID and custom attribute. Each upsert response is + returned with the ID + + of the corresponding request. + + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkUpsertCustomerCustomAttributes + request: + name: BatchUpsertCustomerCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + A map containing 1 to 25 individual upsert requests. For each + request, provide an + + arbitrary ID that is unique for this + `BulkUpsertCustomerCustomAttributes` request and the + + information needed to create or update a custom attribute. + content-type: application/json + response: + docs: Success + type: root.BatchUpsertCustomerCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + values: + id1: + customer_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: favoritemovie + value: Dune + id2: + customer_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: ownsmovie + value: false + id3: + customer_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: favoritemovie + value: Star Wars + id4: + customer_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: square:a0f1505a-2aa1-490d-91a8-8d31ff181808 + value: '10.5' + id5: + customer_id: 70548QG1HN43B05G0KCZ4MMC1G + custom_attribute: + key: sq0ids-0evKIskIGaY45fCyNL66aw:backupemail + value: fake-email@squareup.com + response: + body: + values: + id1: + customer_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: favoritemovie + value: Dune + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2021-12-09T00:16:23Z' + created_at: '2021-12-08T23:14:47Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + customer_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: ownsmovie + value: false + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2021-12-09T00:16:23Z' + created_at: '2021-12-09T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id3: + customer_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: favoritemovie + value: Star Wars + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2021-12-09T00:16:23Z' + created_at: '2021-12-09T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id4: + customer_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: square:a0f1505a-2aa1-490d-91a8-8d31ff181808 + value: '10.5' + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2021-12-09T00:16:23Z' + created_at: '2021-12-08T23:14:47Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id5: + customer_id: 70548QG1HN43B05G0KCZ4MMC1G + custom_attribute: + key: sq0ids-0evKIskIGaY45fCyNL66aw:backupemail + value: fake-email@squareup.com + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2021-12-09T00:16:23Z' + created_at: '2021-12-09T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers/customAttributes.yml b/.mock/definition/customers/customAttributes.yml new file mode 100644 index 000000000..306c5d637 --- /dev/null +++ b/.mock/definition/customers/customAttributes.yml @@ -0,0 +1,384 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/customers/{customer_id}/custom-attributes + method: GET + auth: true + docs: >- + Lists the [custom attributes](entity:CustomAttribute) associated with a + customer profile. + + + You can use the `with_definitions` query parameter to also retrieve + custom attribute definitions + + in the same call. + + + When all response pages are retrieved, the results include all custom + attributes that are + + visible to the requesting application, including those that are owned by + other applications + + and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attributes + source: + openapi: openapi/openapi.json + display-name: ListCustomerCustomAttributes + request: + name: ListCustomAttributesRequest + path-parameters: + customer_id: + type: string + docs: The ID of the target [customer profile](entity:Customer). + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. For more + + information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + with_definitions: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + response: + docs: Success + type: root.ListCustomerCustomAttributesResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attributes: + - key: favoritemovie + value: Dune + version: 1 + visibility: VISIBILITY_READ_ONLY + updated_at: '2022-04-26T15:50:27Z' + created_at: '2022-04-26T15:50:27Z' + - key: ownsmovie + value: false + version: 1 + visibility: VISIBILITY_HIDDEN + updated_at: '2022-04-26T15:51:53Z' + created_at: '2022-04-26T15:51:53Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/customers/{customer_id}/custom-attributes/{key} + method: GET + auth: true + docs: >- + Retrieves a [custom attribute](entity:CustomAttribute) associated with a + customer profile. + + + You can use the `with_definition` query parameter to also retrieve the + custom attribute definition + + in the same call. + + + To retrieve a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that + seller-defined custom attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveCustomerCustomAttribute + request: + name: GetCustomAttributesRequest + path-parameters: + customer_id: + type: string + docs: The ID of the target [customer profile](entity:Customer). + key: + type: string + docs: >- + The key of the custom attribute to retrieve. This key must match + the `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + query-parameters: + with_definition: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of + + the custom attribute. Set this parameter to `true` to get the name + and description of the custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + version: + type: optional> + docs: >- + The current version of the custom attribute, which is used for + strongly consistent reads to + + guarantee that you receive the most up-to-date data. When included + in the request, Square + + returns the specified version or a higher version if one exists. + If the specified version is + + higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.GetCustomerCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute: + key: favoritemovie + value: Dune + version: 1 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-04-26T15:50:27Z' + created_at: '2022-04-26T15:50:27Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + upsert: + path: /v2/customers/{customer_id}/custom-attributes/{key} + method: POST + auth: true + docs: >- + Creates or updates a [custom attribute](entity:CustomAttribute) for a + customer profile. + + + Use this endpoint to set the value of a custom attribute for a specified + customer profile. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which + + is created using the + [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) + endpoint. + + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: UpsertCustomerCustomAttribute + request: + name: UpsertCustomerCustomAttributeRequest + path-parameters: + customer_id: + type: string + docs: The ID of the target [customer profile](entity:Customer). + key: + type: string + docs: >- + The key of the custom attribute to create or update. This key must + match the `key` of a + + custom attribute definition in the Square seller account. If the + requesting application is not + + the definition owner, you must use the qualified key. + body: + properties: + custom_attribute: + type: root.CustomAttribute + docs: >- + The custom attribute to create or update, with the following + fields: + + + - `value`. This value must conform to the `schema` specified by + the definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for an update operation, include this optional field and + specify the current version + + of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpsertCustomerCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + key: key + headers: + Square-Version: '2025-07-16' + request: + custom_attribute: + value: Dune + response: + body: + custom_attribute: + key: favoritemovie + value: Dune + version: 1 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-04-26T15:50:27Z' + created_at: '2022-04-26T15:50:27Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/customers/{customer_id}/custom-attributes/{key} + method: DELETE + auth: true + docs: >- + Deletes a [custom attribute](entity:CustomAttribute) associated with a + customer profile. + + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: DeleteCustomerCustomAttribute + request: + name: DeleteCustomAttributesRequest + path-parameters: + customer_id: + type: string + docs: The ID of the target [customer profile](entity:Customer). + key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match the + `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + response: + docs: Success + type: root.DeleteCustomerCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers/groups.yml b/.mock/definition/customers/groups.yml new file mode 100644 index 000000000..eef6fca74 --- /dev/null +++ b/.mock/definition/customers/groups.yml @@ -0,0 +1,307 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/customers/groups + method: GET + auth: true + docs: Retrieves the list of customer groups of a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.groups + source: + openapi: openapi/openapi.json + display-name: ListCustomerGroups + request: + name: ListGroupsRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for your + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single page. This + limit is advisory. The response might contain more or fewer + results. + + If the limit is less than 1 or greater than 50, Square returns a + `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default + value is 50. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListCustomerGroupsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + groups: + - id: 2TAT3CMH4Q0A9M87XJZED0WMR3 + name: Loyal Customers + created_at: '2020-04-13T21:54:57.863Z' + updated_at: '2020-04-13T21:54:58Z' + - id: 4XMEHESXJBNE9S9JAKZD2FGB14 + name: Super Loyal Customers + created_at: '2020-04-13T21:55:18.795Z' + updated_at: '2020-04-13T21:55:19Z' + cursor: cursor + create: + path: /v2/customers/groups + method: POST + auth: true + docs: |- + Creates a new customer group for a business. + + The request must include the `name` value of the group. + source: + openapi: openapi/openapi.json + display-name: CreateCustomerGroup + request: + name: CreateCustomerGroupRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + The idempotency key for the request. For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + group: + type: root.CustomerGroup + docs: The customer group to create. + content-type: application/json + response: + docs: Success + type: root.CreateCustomerGroupResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + group: + name: Loyal Customers + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + group: + id: 2TAT3CMH4Q0A9M87XJZED0WMR3 + name: Loyal Customers + created_at: '2020-04-13T21:54:57.863Z' + updated_at: '2020-04-13T21:54:58Z' + get: + path: /v2/customers/groups/{group_id} + method: GET + auth: true + docs: >- + Retrieves a specific customer group as identified by the `group_id` + value. + source: + openapi: openapi/openapi.json + display-name: RetrieveCustomerGroup + request: + name: GetGroupsRequest + path-parameters: + group_id: + type: string + docs: The ID of the customer group to retrieve. + response: + docs: Success + type: root.GetCustomerGroupResponse + status-code: 200 + examples: + - path-parameters: + group_id: group_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + group: + id: 2TAT3CMH4Q0A9M87XJZED0WMR3 + name: Loyal Customers + created_at: '2020-04-13T21:54:57.863Z' + updated_at: '2020-04-13T21:54:58Z' + update: + path: /v2/customers/groups/{group_id} + method: PUT + auth: true + docs: Updates a customer group as identified by the `group_id` value. + source: + openapi: openapi/openapi.json + display-name: UpdateCustomerGroup + request: + name: UpdateCustomerGroupRequest + path-parameters: + group_id: + type: string + docs: The ID of the customer group to update. + body: + properties: + group: + type: root.CustomerGroup + docs: >- + The `CustomerGroup` object including all the updates you want to + make. + content-type: application/json + response: + docs: Success + type: root.UpdateCustomerGroupResponse + status-code: 200 + examples: + - path-parameters: + group_id: group_id + headers: + Square-Version: '2025-07-16' + request: + group: + name: Loyal Customers + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + group: + id: 2TAT3CMH4Q0A9M87XJZED0WMR3 + name: Loyal Customers + created_at: '2020-04-13T21:54:57.863Z' + updated_at: '2020-04-13T21:54:58Z' + delete: + path: /v2/customers/groups/{group_id} + method: DELETE + auth: true + docs: Deletes a customer group as identified by the `group_id` value. + source: + openapi: openapi/openapi.json + display-name: DeleteCustomerGroup + request: + name: DeleteGroupsRequest + path-parameters: + group_id: + type: string + docs: The ID of the customer group to delete. + response: + docs: Success + type: root.DeleteCustomerGroupResponse + status-code: 200 + examples: + - path-parameters: + group_id: group_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + add: + path: /v2/customers/{customer_id}/groups/{group_id} + method: PUT + auth: true + docs: |- + Adds a group membership to a customer. + + The customer is identified by the `customer_id` value + and the customer group is identified by the `group_id` value. + source: + openapi: openapi/openapi.json + display-name: AddGroupToCustomer + request: + name: AddGroupsRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer to add to a group. + group_id: + type: string + docs: The ID of the customer group to add the customer to. + response: + docs: Success + type: root.AddGroupToCustomerResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + group_id: group_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + remove: + path: /v2/customers/{customer_id}/groups/{group_id} + method: DELETE + auth: true + docs: |- + Removes a group membership from a customer. + + The customer is identified by the `customer_id` value + and the customer group is identified by the `group_id` value. + source: + openapi: openapi/openapi.json + display-name: RemoveGroupFromCustomer + request: + name: RemoveGroupsRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer to remove from the group. + group_id: + type: string + docs: The ID of the customer group to remove the customer from. + response: + docs: Success + type: root.RemoveGroupFromCustomerResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + group_id: group_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers/segments.yml b/.mock/definition/customers/segments.yml new file mode 100644 index 000000000..d86fea438 --- /dev/null +++ b/.mock/definition/customers/segments.yml @@ -0,0 +1,117 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/customers/segments + method: GET + auth: true + docs: Retrieves the list of customer segments of a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.segments + source: + openapi: openapi/openapi.json + display-name: ListCustomerSegments + request: + name: ListSegmentsRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by previous calls to + `ListCustomerSegments`. + + This cursor is used to retrieve the next set of query results. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single page. This + limit is advisory. The response might contain more or fewer + results. + + If the specified limit is less than 1 or greater than 50, Square + returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The + default value is 50. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListCustomerSegmentsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + segments: + - id: GMNXRZVEXNQDF.CHURN_RISK + name: Lapsed + created_at: '2020-01-09T19:33:24.469Z' + updated_at: '2020-04-13T21:47:04Z' + - id: GMNXRZVEXNQDF.LOYAL + name: Regulars + created_at: '2020-01-09T19:33:24.486Z' + updated_at: '2020-04-13T21:47:04Z' + - id: GMNXRZVEXNQDF.REACHABLE + name: Reachable + created_at: '2020-01-09T19:33:21.813Z' + updated_at: '2020-04-13T21:47:04Z' + - id: gv2:KF92J19VXN5FK30GX2E8HSGQ20 + name: Instant Profile + created_at: '2020-01-09T19:33:25Z' + updated_at: '2020-04-13T23:01:03Z' + cursor: cursor + get: + path: /v2/customers/segments/{segment_id} + method: GET + auth: true + docs: >- + Retrieves a specific customer segment as identified by the `segment_id` + value. + source: + openapi: openapi/openapi.json + display-name: RetrieveCustomerSegment + request: + name: GetSegmentsRequest + path-parameters: + segment_id: + type: string + docs: The Square-issued ID of the customer segment. + response: + docs: Success + type: root.GetCustomerSegmentResponse + status-code: 200 + examples: + - path-parameters: + segment_id: segment_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + segment: + id: GMNXRZVEXNQDF.CHURN_RISK + name: Lapsed + created_at: '2020-01-09T19:33:24.469Z' + updated_at: '2020-04-13T23:01:13Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/devices.yml b/.mock/definition/devices.yml new file mode 100644 index 000000000..bf4f3a03c --- /dev/null +++ b/.mock/definition/devices.yml @@ -0,0 +1,203 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/devices + method: GET + auth: true + docs: |- + List devices associated with the merchant. Currently, only Terminal API + devices are supported. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.devices + source: + openapi: openapi/openapi.json + display-name: ListDevices + request: + name: ListDevicesRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + sort_order: + type: optional> + docs: |- + The order in which results are listed. + - `ASC` - Oldest to newest. + - `DESC` - Newest to oldest (default). + limit: + type: optional> + docs: The number of results to return in a single page. + location_id: + type: optional> + docs: If present, only returns devices at the target location. + response: + docs: Success + type: root.ListDevicesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + devices: + - id: device:995CS397A6475287 + attributes: + type: TERMINAL + manufacturer: Square + model: T2 + name: Square Terminal 995 + manufacturers_id: 995CS397A6475287 + updated_at: '2023-09-29T13:04:56.335762883Z' + version: 5.41.0085 + merchant_token: MLCHNZCBWFDZB + components: + - type: APPLICATION + application_details: + application_type: TERMINAL_API + version: '6.25' + session_location: LMN2K7S3RTOU3 + - type: CARD_READER + card_reader_details: + version: 3.53.70 + - type: BATTERY + battery_details: + visible_percent: 5 + external_power: AVAILABLE_CHARGING + - type: WIFI + wifi_details: + active: true + ssid: Staff Network + ip_address_v4: 10.0.0.7 + secure_connection: WPA/WPA2 PSK + signal_strength: + value: 2 + - type: ETHERNET + ethernet_details: + active: false + status: + category: AVAILABLE + - id: device:995CS234B5493559 + attributes: + type: TERMINAL + manufacturer: Square + model: T2 + name: Square Terminal 995 + manufacturers_id: 995CS234B5493559 + updated_at: '2023-09-29T12:39:56.335742073Z' + version: 5.41.0085 + merchant_token: MLCHXZCBWFGDW + components: + - type: APPLICATION + application_details: + application_type: TERMINAL_API + version: '6.25' + session_location: LMN2K7S3RTOU3 + - type: CARD_READER + card_reader_details: + version: 3.53.70 + - type: BATTERY + battery_details: + visible_percent: 24 + external_power: AVAILABLE_CHARGING + - type: WIFI + wifi_details: + active: true + ssid: Staff Network + ip_address_v4: 10.0.0.7 + secure_connection: WPA/WPA2 PSK + signal_strength: + value: 2 + - type: ETHERNET + ethernet_details: + active: false + status: + category: NEEDS_ATTENTION + cursor: GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM + get: + path: /v2/devices/{device_id} + method: GET + auth: true + docs: Retrieves Device with the associated `device_id`. + source: + openapi: openapi/openapi.json + display-name: GetDevice + request: + name: GetDevicesRequest + path-parameters: + device_id: + type: string + docs: The unique ID for the desired `Device`. + response: + docs: Success + type: root.GetDeviceResponse + status-code: 200 + examples: + - path-parameters: + device_id: device_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + device: + id: device:995CS397A6475287 + attributes: + type: TERMINAL + manufacturer: Square + model: T2 + name: Square Terminal 995 + manufacturers_id: 995CS397A6475287 + updated_at: '2023-09-29T13:12:22.365049321Z' + version: 5.41.0085 + merchant_token: MLCHXZCBWFGDW + components: + - type: APPLICATION + application_details: + application_type: TERMINAL_API + version: '6.25' + session_location: LMN2K7S3RTOU3 + - type: CARD_READER + card_reader_details: + version: 3.53.70 + - type: BATTERY + battery_details: + visible_percent: 5 + external_power: AVAILABLE_CHARGING + - type: WIFI + wifi_details: + active: true + ssid: Staff Network + ip_address_v4: 10.0.0.7 + secure_connection: WPA/WPA2 PSK + signal_strength: + value: 2 + - type: ETHERNET + ethernet_details: + active: false + status: + category: AVAILABLE + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/devices/codes.yml b/.mock/definition/devices/codes.yml new file mode 100644 index 000000000..ea8199163 --- /dev/null +++ b/.mock/definition/devices/codes.yml @@ -0,0 +1,200 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/devices/codes + method: GET + auth: true + docs: Lists all DeviceCodes associated with the merchant. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.device_codes + source: + openapi: openapi/openapi.json + display-name: ListDeviceCodes + request: + name: ListCodesRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for your original + query. + + + See [Paginating + results](https://developer.squareup.com/docs/working-with-apis/pagination) + for more information. + location_id: + type: optional> + docs: |- + If specified, only returns DeviceCodes of the specified location. + Returns DeviceCodes of all locations if empty. + product_type: + type: optional> + docs: >- + If specified, only returns DeviceCodes targeting the specified + product type. + + Returns DeviceCodes of all product types if empty. + status: + type: optional> + docs: |- + If specified, returns DeviceCodes with the specified statuses. + Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. + response: + docs: Success + type: root.ListDeviceCodesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + device_codes: + - id: B3Z6NAMYQSMTM + name: Counter 1 + code: EBCARJ + device_id: 907CS13101300122 + product_type: TERMINAL_API + location_id: B5E4484SHHNYH + status: PAIRED + pair_by: '2020-02-06T18:49:33.000Z' + created_at: '2020-02-06T18:44:33.000Z' + status_changed_at: '2020-02-06T18:47:28.000Z' + paired_at: paired_at + - id: YKGMJMYK8H4PQ + name: Unused device code + code: GVXNYN + device_id: device_id + product_type: TERMINAL_API + location_id: A6SYFRSV4WAFW + status: UNPAIRED + pair_by: '2020-02-07T20:00:04.000Z' + created_at: '2020-02-07T19:55:04.000Z' + status_changed_at: '2020-02-07T19:55:04.000Z' + paired_at: paired_at + cursor: cursor + create: + path: /v2/devices/codes + method: POST + auth: true + docs: >- + Creates a DeviceCode that can be used to login to a Square Terminal + device to enter the connected + + terminal mode. + source: + openapi: openapi/openapi.json + display-name: CreateDeviceCode + request: + name: CreateDeviceCodeRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this CreateDeviceCode request. + Keys can + + be any valid string but must be unique for every + CreateDeviceCode request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 128 + device_code: + type: root.DeviceCode + docs: The device code to create. + content-type: application/json + response: + docs: Success + type: root.CreateDeviceCodeResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 01bb00a6-0c86-4770-94ed-f5fca973cd56 + device_code: + name: Counter 1 + product_type: TERMINAL_API + location_id: B5E4484SHHNYH + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + device_code: + id: B3Z6NAMYQSMTM + name: Counter 1 + code: EBCARJ + device_id: device_id + product_type: TERMINAL_API + location_id: B5E4484SHHNYH + status: UNPAIRED + pair_by: '2020-02-06T18:49:33.000Z' + created_at: '2020-02-06T18:44:33.000Z' + status_changed_at: '2020-02-06T18:44:33.000Z' + paired_at: paired_at + get: + path: /v2/devices/codes/{id} + method: GET + auth: true + docs: Retrieves DeviceCode with the associated ID. + source: + openapi: openapi/openapi.json + display-name: GetDeviceCode + request: + name: GetCodesRequest + path-parameters: + id: + type: string + docs: The unique identifier for the device code. + response: + docs: Success + type: root.GetDeviceCodeResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + device_code: + id: B3Z6NAMYQSMTM + name: Counter 1 + code: EBCARJ + device_id: 907CS13101300122 + product_type: TERMINAL_API + location_id: B5E4484SHHNYH + status: PAIRED + pair_by: '2020-02-06T18:49:33.000Z' + created_at: '2020-02-06T18:44:33.000Z' + status_changed_at: '2020-02-06T18:47:28.000Z' + paired_at: paired_at + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/disputes.yml b/.mock/definition/disputes.yml new file mode 100644 index 000000000..506e05ad8 --- /dev/null +++ b/.mock/definition/disputes.yml @@ -0,0 +1,406 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/disputes + method: GET + auth: true + docs: Returns a list of disputes associated with a particular account. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.disputes + source: + openapi: openapi/openapi.json + display-name: ListDisputes + request: + name: ListDisputesRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + states: + type: optional> + docs: >- + The dispute states used to filter the result. If not specified, + the endpoint returns all disputes. + location_id: + type: optional> + docs: >- + The ID of the location for which to return a list of disputes. + + If not specified, the endpoint returns disputes associated with + all locations. + response: + docs: Success + type: root.ListDisputesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + disputes: + - dispute_id: dispute_id + id: XDgyFu7yo1E2S5lQGGpYn + amount_money: + amount: 2500 + currency: USD + reason: NO_KNOWLEDGE + state: ACCEPTED + due_at: '2022-07-13T00:00:00.000Z' + disputed_payment: + payment_id: zhyh1ch64kRBrrlfVhwjCEjZWzNZY + evidence_ids: + - evidence_ids + card_brand: VISA + created_at: '2022-06-29T18:45:22.265Z' + updated_at: '2022-07-07T19:14:42.650Z' + brand_dispute_id: '100000809947' + reported_date: reported_date + reported_at: '2022-06-29T00:00:00.000Z' + version: 2 + location_id: L1HN3ZMQK64X9 + - dispute_id: dispute_id + id: jLGg7aXC7lvKPr9PISt0T + amount_money: + amount: 2209 + currency: USD + reason: NOT_AS_DESCRIBED + state: EVIDENCE_REQUIRED + due_at: '2022-05-13T00:00:00.000Z' + disputed_payment: + payment_id: zhyh1ch64kRBrrlfVhwjCEjZWzNZY + evidence_ids: + - evidence_ids + card_brand: VISA + created_at: '2022-04-29T18:45:22.265Z' + updated_at: '2022-04-29T18:45:22.265Z' + brand_dispute_id: r5Of6YaGT7AdeRaVoAGCJw + reported_date: reported_date + reported_at: '2022-04-29T00:00:00.000Z' + version: 1 + location_id: 18YC4JDH91E1H + cursor: G1aSTRm48CLjJsg6Sg3hQN1b1OMaoVuG + get: + path: /v2/disputes/{dispute_id} + method: GET + auth: true + docs: Returns details about a specific dispute. + source: + openapi: openapi/openapi.json + display-name: RetrieveDispute + request: + name: GetDisputesRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute you want more details about. + response: + docs: Success + type: root.GetDisputeResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + dispute: + dispute_id: dispute_id + id: XDgyFu7yo1E2S5lQGGpYn + amount_money: + amount: 2500 + currency: USD + reason: NO_KNOWLEDGE + state: ACCEPTED + due_at: '2022-07-13T00:00:00.000Z' + disputed_payment: + payment_id: zhyh1ch64kRBrrlfVhwjCEjZWzNZY + evidence_ids: + - evidence_ids + card_brand: VISA + created_at: '2022-06-29T18:45:22.265Z' + updated_at: '2022-07-07T19:14:42.650Z' + brand_dispute_id: '100000809947' + reported_date: reported_date + reported_at: '2022-06-29T00:00:00.000Z' + version: 2 + location_id: L1HN3ZMQK64X9 + accept: + path: /v2/disputes/{dispute_id}/accept + method: POST + auth: true + docs: >- + Accepts the loss on a dispute. Square returns the disputed amount to the + cardholder and + + updates the dispute state to ACCEPTED. + + + Square debits the disputed amount from the seller’s Square account. If + the Square account + + does not have sufficient funds, Square debits the associated bank + account. + source: + openapi: openapi/openapi.json + display-name: AcceptDispute + request: + name: AcceptDisputesRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute you want to accept. + response: + docs: Success + type: root.AcceptDisputeResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + dispute: + dispute_id: dispute_id + id: XDgyFu7yo1E2S5lQGGpYn + amount_money: + amount: 2500 + currency: USD + reason: NO_KNOWLEDGE + state: ACCEPTED + due_at: '2022-07-13T00:00:00.000Z' + disputed_payment: + payment_id: zhyh1ch64kRBrrlfVhwjCEjZWzNZY + evidence_ids: + - evidence_ids + card_brand: VISA + created_at: '2022-06-29T18:45:22.265Z' + updated_at: '2022-07-07T19:14:42.650Z' + brand_dispute_id: '100000809947' + reported_date: reported_date + reported_at: '2022-06-29T00:00:00.000Z' + version: 2 + location_id: L1HN3ZMQK64X9 + CreateEvidenceFile: + path: /v2/disputes/{dispute_id}/evidence-files + method: POST + auth: true + docs: >- + Uploads a file to use as evidence in a dispute challenge. The endpoint + accepts HTTP + + multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF + formats. + source: + openapi: openapi/openapi.json + display-name: CreateDisputeEvidenceFile + request: + name: CreateEvidenceFileDisputesRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute for which you want to upload evidence. + body: + properties: + request: + type: optional + content-type: application/json; charset=utf-8 + image_file: + type: optional + content-type: image/jpeg + content-type: multipart/form-data + response: + docs: Success + type: root.CreateDisputeEvidenceFileResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-07-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + evidence: + evidence_id: evidence_id + id: TOomLInj6iWmP3N8qfCXrB + dispute_id: bVTprrwk0gygTLZ96VX1oB + evidence_file: + filename: customer-interaction.jpg + filetype: image/jpeg + evidence_text: evidence_text + uploaded_at: '2022-05-18T16:01:10.000Z' + evidence_type: GENERIC_EVIDENCE + CreateEvidenceText: + path: /v2/disputes/{dispute_id}/evidence-text + method: POST + auth: true + docs: Uploads text to use as evidence for a dispute challenge. + source: + openapi: openapi/openapi.json + display-name: CreateDisputeEvidenceText + request: + name: CreateDisputeEvidenceTextRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute for which you want to upload evidence. + body: + properties: + idempotency_key: + type: string + docs: >- + A unique key identifying the request. For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + maxLength: 45 + evidence_type: + type: optional + docs: >- + The type of evidence you are uploading. + + See [DisputeEvidenceType](#type-disputeevidencetype) for + possible values + evidence_text: + type: string + docs: The evidence string. + validation: + minLength: 1 + maxLength: 500 + content-type: application/json + response: + docs: Success + type: root.CreateDisputeEvidenceTextResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-07-16' + request: + idempotency_key: ed3ee3933d946f1514d505d173c82648 + evidence_type: TRACKING_NUMBER + evidence_text: 1Z8888888888888888 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + evidence: + evidence_id: evidence_id + id: TOomLInj6iWmP3N8qfCXrB + dispute_id: bVTprrwk0gygTLZ96VX1oB + evidence_file: + filename: filename + filetype: filetype + evidence_text: >- + The customer purchased the item twice, on April 11 and April + 28. + uploaded_at: '2022-05-18T16:01:10.000Z' + evidence_type: REBUTTAL_EXPLANATION + SubmitEvidence: + path: /v2/disputes/{dispute_id}/submit-evidence + method: POST + auth: true + docs: >- + Submits evidence to the cardholder's bank. + + + The evidence submitted by this endpoint includes evidence uploaded + + using the + [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) + and + + [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText) + endpoints and + + evidence automatically provided by Square, when available. Evidence + cannot be removed from + + a dispute after submission. + source: + openapi: openapi/openapi.json + display-name: SubmitEvidence + request: + name: SubmitEvidenceDisputesRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute for which you want to submit evidence. + response: + docs: Success + type: root.SubmitEvidenceResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + dispute: + dispute_id: dispute_id + id: EAZoK70gX3fyvibecLwIGB + amount_money: + amount: 4350 + currency: USD + reason: CUSTOMER_REQUESTS_CREDIT + state: PROCESSING + due_at: '2022-06-01T00:00:00.000Z' + disputed_payment: + payment_id: 2yeBUWJzllJTpmnSqtMRAL19taB + evidence_ids: + - evidence_ids + card_brand: VISA + created_at: '2022-05-18T16:02:15.313Z' + updated_at: '2022-05-18T16:02:15.313Z' + brand_dispute_id: '100000399240' + reported_date: reported_date + reported_at: '2022-05-18T00:00:00.000Z' + version: 4 + location_id: LSY8XKGSMMX94 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/disputes/evidence.yml b/.mock/definition/disputes/evidence.yml new file mode 100644 index 000000000..70ab41619 --- /dev/null +++ b/.mock/definition/disputes/evidence.yml @@ -0,0 +1,160 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/disputes/{dispute_id}/evidence + method: GET + auth: true + docs: Returns a list of evidence associated with a dispute. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.evidence + source: + openapi: openapi/openapi.json + display-name: ListDisputeEvidence + request: + name: ListEvidenceRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute. + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListDisputeEvidenceResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-07-16' + response: + body: + evidence: + - evidence_id: evidence_id + id: CpfnkwGselCwS8QFvxN6 + dispute_id: bVTprrwk0gygTLZ96VX1oB + evidence_file: + filename: customer-interaction + filetype: JPG + evidence_text: evidence_text + uploaded_at: '2022-05-10T15:57:13.802Z' + evidence_type: CARDHOLDER_COMMUNICATION + - evidence_id: evidence_id + id: TOomLInj6iWmP3N8qfCXrB + dispute_id: bVTprrwk0gygTLZ96VX1oB + evidence_file: + filename: '' + filetype: '' + evidence_text: evidence_text + uploaded_at: '2022-05-18T16:01:10.000Z' + evidence_type: REBUTTAL_EXPLANATION + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cursor: cursor + get: + path: /v2/disputes/{dispute_id}/evidence/{evidence_id} + method: GET + auth: true + docs: >- + Returns the metadata for the evidence specified in the request URL path. + + + You must maintain a copy of any evidence uploaded if you want to + reference it later. Evidence cannot be downloaded after you upload it. + source: + openapi: openapi/openapi.json + display-name: RetrieveDisputeEvidence + request: + name: GetEvidenceRequest + path-parameters: + dispute_id: + type: string + docs: >- + The ID of the dispute from which you want to retrieve evidence + metadata. + evidence_id: + type: string + docs: The ID of the evidence to retrieve. + response: + docs: Success + type: root.GetDisputeEvidenceResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + evidence_id: evidence_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + evidence: + evidence_id: evidence_id + id: TOomLInj6iWmP3N8qfCXrB + dispute_id: bVTprrwk0gygTLZ96VX1oB + evidence_file: + filename: customer-interaction.jpg + filetype: image/jpeg + evidence_text: evidence_text + uploaded_at: '2022-05-18T16:01:10.000Z' + evidence_type: CARDHOLDER_COMMUNICATION + delete: + path: /v2/disputes/{dispute_id}/evidence/{evidence_id} + method: DELETE + auth: true + docs: |- + Removes specified evidence from a dispute. + Square does not send the bank any evidence that is removed. + source: + openapi: openapi/openapi.json + display-name: DeleteDisputeEvidence + request: + name: DeleteEvidenceRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute from which you want to remove evidence. + evidence_id: + type: string + docs: The ID of the evidence you want to remove. + response: + docs: Success + type: root.DeleteDisputeEvidenceResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + evidence_id: evidence_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/employees.yml b/.mock/definition/employees.yml new file mode 100644 index 000000000..7a686473e --- /dev/null +++ b/.mock/definition/employees.yml @@ -0,0 +1,106 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/employees + method: GET + auth: true + docs: '' + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.employees + source: + openapi: openapi/openapi.json + display-name: ListEmployees + request: + name: ListEmployeesRequest + query-parameters: + location_id: + type: optional> + docs: '' + status: + type: optional> + docs: Specifies the EmployeeStatus to filter the employee by. + limit: + type: optional> + docs: The number of employees to be returned on each page. + cursor: + type: optional> + docs: The token required to retrieve the specified page of results. + response: + docs: Success + type: root.ListEmployeesResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + employees: + - id: id + first_name: first_name + last_name: last_name + email: email + phone_number: phone_number + location_ids: + - location_ids + status: ACTIVE + is_owner: true + created_at: created_at + updated_at: updated_at + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/employees/{id} + method: GET + auth: true + docs: '' + source: + openapi: openapi/openapi.json + display-name: RetrieveEmployee + request: + name: GetEmployeesRequest + path-parameters: + id: + type: string + docs: UUID for the employee that was requested. + response: + docs: Success + type: root.GetEmployeeResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + employee: + id: id + first_name: first_name + last_name: last_name + email: email + phone_number: phone_number + location_ids: + - location_ids + status: ACTIVE + is_owner: true + created_at: created_at + updated_at: updated_at + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/events.yml b/.mock/definition/events.yml new file mode 100644 index 000000000..54b157dc8 --- /dev/null +++ b/.mock/definition/events.yml @@ -0,0 +1,192 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + SearchEvents: + path: /v2/events + method: POST + auth: true + docs: Search for Square API events that occur within a 28-day timeframe. + source: + openapi: openapi/openapi.json + display-name: SearchEvents + request: + name: SearchEventsRequest + body: + properties: + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. Provide this cursor to retrieve the next set of events + for your original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + validation: + maxLength: 256 + limit: + type: optional + docs: >- + The maximum number of events to return in a single page. The + response might contain fewer events. The default value is 100, + which is also the maximum allowed value. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + + + Default: 100 + validation: + min: 1 + max: 100 + query: + type: optional + docs: >- + The filtering and sorting criteria for the search request. To + retrieve additional pages using a cursor, you must use the + original query. + content-type: application/json + response: + docs: Success + type: root.SearchEventsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + events: + - merchant_id: 0HPGX5JYE6EE1 + location_id: VJDQQP3CG14EY + type: dispute.state.updated + event_id: 73ecd468-0aba-424f-b862-583d44efe7c8 + created_at: '2022-04-26T10:08:40.454726' + data: + type: dispute + id: ORSEVtZAJxb37RA1EiGw + object: + dispute: + amount_money: + amount: 8801 + currency: USD + brand_dispute_id: r9rKGSBBQbywBNnWWIiGFg + card_brand: VISA + created_at: '2020-02-19T21:24:53.258Z' + disputed_payment: + payment_id: fbmsaEOpoARDKxiSGH1fqPuqoqFZY + due_at: '2020-03-04T00:00:00.000Z' + id: ORSEVtZAJxb37RA1EiGw + location_id: VJDQQP3CG14EY + reason: AMOUNT_DIFFERS + reported_at: '2020-02-19T00:00:00.000Z' + state: WON + updated_at: '2020-02-19T21:34:41.851Z' + version: 6 + metadata: + - event_id: 73ecd468-0aba-424f-b862-583d44efe7c8 + api_version: '2022-12-13' + cursor: 6b571fc9773647f= + DisableEvents: + path: /v2/events/disable + method: PUT + auth: true + docs: >- + Disables events to prevent them from being searchable. + + All events are disabled by default. You must enable events to make them + searchable. + + Disabling events for a specific time period prevents them from being + searchable, even if you re-enable them later. + source: + openapi: openapi/openapi.json + display-name: DisableEvents + response: + docs: Success + type: root.DisableEventsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + EnableEvents: + path: /v2/events/enable + method: PUT + auth: true + docs: >- + Enables events to make them searchable. Only events that occur while in + the enabled state are searchable. + source: + openapi: openapi/openapi.json + display-name: EnableEvents + response: + docs: Success + type: root.EnableEventsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + ListEventTypes: + path: /v2/events/types + method: GET + auth: true + docs: >- + Lists all event types that you can subscribe to as webhooks or query + using the Events API. + source: + openapi: openapi/openapi.json + display-name: ListEventTypes + request: + name: ListEventTypesRequest + query-parameters: + api_version: + type: optional> + docs: >- + The API version for which to list event types. Setting this field + overrides the default version used by the application. + response: + docs: Success + type: root.ListEventTypesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + event_types: + - inventory.count.updated + metadata: + - event_type: inventory.count.updated + api_version_introduced: '2018-07-12' + release_status: PUBLIC + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/giftCards.yml b/.mock/definition/giftCards.yml new file mode 100644 index 000000000..0613ec054 --- /dev/null +++ b/.mock/definition/giftCards.yml @@ -0,0 +1,482 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/gift-cards + method: GET + auth: true + docs: >- + Lists all gift cards. You can specify optional filters to retrieve + + a subset of the gift cards. Results are sorted by `created_at` in + ascending order. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.gift_cards + source: + openapi: openapi/openapi.json + display-name: ListGiftCards + request: + name: ListGiftCardsRequest + query-parameters: + type: + type: optional> + docs: >- + If a [type](entity:GiftCardType) is provided, the endpoint returns + gift cards of the specified type. + + Otherwise, the endpoint returns gift cards of all types. + state: + type: optional> + docs: >- + If a [state](entity:GiftCardStatus) is provided, the endpoint + returns the gift cards in the specified state. + + Otherwise, the endpoint returns the gift cards of all states. + limit: + type: optional> + docs: >- + If a limit is provided, the endpoint returns only the specified + number of results per page. + + The maximum value is 200. The default value is 30. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + If a cursor is not provided, the endpoint returns the first page + of the results. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + customer_id: + type: optional> + docs: >- + If a customer ID is provided, the endpoint returns only the gift + cards linked to the specified customer. + response: + docs: Success + type: root.ListGiftCardsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_cards: + - id: gftc:00113070ba5745f0b2377c1b9570cb03 + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 3900 + currency: USD + gan: '7783320008524605' + created_at: '2021-06-09T22:26:54.000Z' + customer_ids: + - customer_ids + - id: gftc:00128a12725b41e58e0de1d20497a9dd + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 2000 + currency: USD + gan: '7783320002692465' + created_at: '2021-05-20T22:26:54.000Z' + customer_ids: + - customer_ids + cursor: JbFmyvUpaNKsfC1hoLSA4WlqkgkZXTWeKuStajR5BkP7OE0ETAbeWSi6U6u7sH + create: + path: /v2/gift-cards + method: POST + auth: true + docs: >- + Creates a digital gift card or registers a physical (plastic) gift card. + The resulting gift card + + has a `PENDING` state. To activate a gift card so that it can be + redeemed for purchases, call + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + and create an `ACTIVATE` + + activity with the initial balance. Alternatively, you can use + [RefundPayment](api-endpoint:Refunds-RefundPayment) + + to refund a payment to the new gift card. + source: + openapi: openapi/openapi.json + display-name: CreateGiftCard + request: + name: CreateGiftCardRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 128 + location_id: + type: string + docs: >- + The ID of the [location](entity:Location) where the gift card + should be registered for + + reporting purposes. Gift cards can be redeemed at any of the + seller's locations. + validation: + minLength: 1 + gift_card: + type: root.GiftCard + docs: >- + The gift card to create. The `type` field is required for this + request. The `gan_source` + + and `gan` fields are included as follows: + + + To direct Square to generate a 16-digit GAN, omit `gan_source` + and `gan`. + + + To provide a custom GAN, include `gan_source` and `gan`. + + - For `gan_source`, specify `OTHER`. + + - For `gan`, provide a custom GAN containing 8 to 20 + alphanumeric characters. The GAN must be + + unique for the seller and cannot start with the same bank + identification number (BIN) as major + + credit cards. Do not use GANs that are easy to guess (such as + 12345678) because they greatly + + increase the risk of fraud. It is the responsibility of the + developer to ensure the security + + of their custom GANs. For more information, see + + [Custom + GANs](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#custom-gans). + + + To register an unused, physical gift card that the seller + previously ordered from Square, + + include `gan` and provide the GAN that is printed on the gift + card. + content-type: application/json + response: + docs: Success + type: root.CreateGiftCardResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: NC9Tm69EjbjtConu + location_id: 81FN9BNFZTKS4 + gift_card: + type: DIGITAL + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:6cbacbb64cf54e2ca9f573d619038059 + type: DIGITAL + gan_source: SQUARE + state: PENDING + balance_money: + amount: 0 + currency: USD + gan: '7783320006753271' + created_at: '2021-05-20T22:26:54.000Z' + customer_ids: + - customer_ids + getFromGAN: + path: /v2/gift-cards/from-gan + method: POST + auth: true + docs: Retrieves a gift card using the gift card account number (GAN). + source: + openapi: openapi/openapi.json + display-name: RetrieveGiftCardFromGAN + request: + name: GetGiftCardFromGANRequest + body: + properties: + gan: + type: string + docs: >- + The gift card account number (GAN) of the gift card to retrieve. + + The maximum length of a GAN is 255 digits to account for + third-party GANs that have been imported. + + Square-issued gift cards have 16-digit GANs. + validation: + minLength: 1 + maxLength: 255 + content-type: application/json + response: + docs: Success + type: root.GetGiftCardFromGANResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + gan: '7783320001001635' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:6944163553804e439d89adb47caf806a + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 5000 + currency: USD + gan: '7783320001001635' + created_at: '2021-05-20T22:26:54.000Z' + customer_ids: + - customer_ids + getFromNonce: + path: /v2/gift-cards/from-nonce + method: POST + auth: true + docs: >- + Retrieves a gift card using a secure payment token that represents the + gift card. + source: + openapi: openapi/openapi.json + display-name: RetrieveGiftCardFromNonce + request: + name: GetGiftCardFromNonceRequest + body: + properties: + nonce: + type: string + docs: >- + The payment token of the gift card to retrieve. Payment tokens + are generated by the + + Web Payments SDK or In-App Payments SDK. + validation: + minLength: 1 + content-type: application/json + response: + docs: Success + type: root.GetGiftCardFromNonceResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + nonce: cnon:7783322135245171 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:6944163553804e439d89adb47caf806a + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 5000 + currency: USD + gan: '7783320001001635' + created_at: '2021-05-20T22:26:54.000Z' + customer_ids: + - customer_ids + LinkCustomer: + path: /v2/gift-cards/{gift_card_id}/link-customer + method: POST + auth: true + docs: >- + Links a customer to a gift card, which is also referred to as adding a + card on file. + source: + openapi: openapi/openapi.json + display-name: LinkCustomerToGiftCard + request: + name: LinkCustomerToGiftCardRequest + path-parameters: + gift_card_id: + type: string + docs: The ID of the gift card to be linked. + body: + properties: + customer_id: + type: string + docs: The ID of the customer to link to the gift card. + validation: + minLength: 1 + maxLength: 191 + content-type: application/json + response: + docs: Success + type: root.LinkCustomerToGiftCardResponse + status-code: 200 + examples: + - path-parameters: + gift_card_id: gift_card_id + headers: + Square-Version: '2025-07-16' + request: + customer_id: GKY0FZ3V717AH8Q2D821PNT2ZW + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:71ea002277a34f8a945e284b04822edb + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 2500 + currency: USD + gan: '7783320005440920' + created_at: '2021-03-25T05:13:01Z' + customer_ids: + - GKY0FZ3V717AH8Q2D821PNT2ZW + UnlinkCustomer: + path: /v2/gift-cards/{gift_card_id}/unlink-customer + method: POST + auth: true + docs: >- + Unlinks a customer from a gift card, which is also referred to as + removing a card on file. + source: + openapi: openapi/openapi.json + display-name: UnlinkCustomerFromGiftCard + request: + name: UnlinkCustomerFromGiftCardRequest + path-parameters: + gift_card_id: + type: string + docs: The ID of the gift card to be unlinked. + body: + properties: + customer_id: + type: string + docs: The ID of the customer to unlink from the gift card. + validation: + minLength: 1 + maxLength: 191 + content-type: application/json + response: + docs: Success + type: root.UnlinkCustomerFromGiftCardResponse + status-code: 200 + examples: + - path-parameters: + gift_card_id: gift_card_id + headers: + Square-Version: '2025-07-16' + request: + customer_id: GKY0FZ3V717AH8Q2D821PNT2ZW + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:71ea002277a34f8a945e284b04822edb + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 2500 + currency: USD + gan: '7783320005440920' + created_at: '2021-03-25T05:13:01Z' + customer_ids: + - customer_ids + get: + path: /v2/gift-cards/{id} + method: GET + auth: true + docs: Retrieves a gift card using the gift card ID. + source: + openapi: openapi/openapi.json + display-name: RetrieveGiftCard + request: + name: GetGiftCardsRequest + path-parameters: + id: + type: string + docs: The ID of the gift card to retrieve. + response: + docs: Success + type: root.GetGiftCardResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:00113070ba5745f0b2377c1b9570cb03 + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 1000 + currency: USD + gan: '7783320001001635' + created_at: '2021-05-20T22:26:54.000Z' + customer_ids: + - customer_ids + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/giftCards/activities.yml b/.mock/definition/giftCards/activities.yml new file mode 100644 index 000000000..a4457bc6e --- /dev/null +++ b/.mock/definition/giftCards/activities.yml @@ -0,0 +1,324 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/gift-cards/activities + method: GET + auth: true + docs: >- + Lists gift card activities. By default, you get gift card activities for + all + + gift cards in the seller's account. You can optionally specify query + parameters to + + filter the list. For example, you can get a list of gift card activities + for a gift card, + + for all gift cards in a specific region, or for activities within a time + window. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.gift_card_activities + source: + openapi: openapi/openapi.json + display-name: ListGiftCardActivities + request: + name: ListActivitiesRequest + query-parameters: + gift_card_id: + type: optional> + docs: >- + If a gift card ID is provided, the endpoint returns activities + related + + to the specified gift card. Otherwise, the endpoint returns all + gift card activities for + + the seller. + type: + type: optional> + docs: >- + If a [type](entity:GiftCardActivityType) is provided, the endpoint + returns gift card activities of the specified type. + + Otherwise, the endpoint returns all types of gift card activities. + location_id: + type: optional> + docs: >- + If a location ID is provided, the endpoint returns gift card + activities for the specified location. + + Otherwise, the endpoint returns gift card activities for all + locations. + begin_time: + type: optional> + docs: >- + The timestamp for the beginning of the reporting period, in RFC + 3339 format. + + This start time is inclusive. The default value is the current + time minus one year. + end_time: + type: optional> + docs: >- + The timestamp for the end of the reporting period, in RFC 3339 + format. + + This end time is inclusive. The default value is the current time. + limit: + type: optional> + docs: >- + If a limit is provided, the endpoint returns the specified number + + of results (or fewer) per page. The maximum value is 100. The + default value is 50. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + If a cursor is not provided, the endpoint returns the first page + of the results. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + sort_order: + type: optional> + docs: >- + The order in which the endpoint returns the activities, based on + `created_at`. + + - `ASC` - Oldest to newest. + + - `DESC` - Newest to oldest (default). + response: + docs: Success + type: root.ListGiftCardActivitiesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card_activities: + - id: gcact_897698f894b44b3db46c6147e26a0e19 + type: REDEEM + location_id: 81FN9BNFZTKS4 + created_at: '2021-06-02T22:26:38.000Z' + gift_card_id: gftc:6d55a72470d940c6ba09c0ab8ad08d20 + gift_card_gan: '7783320002929081' + gift_card_balance_money: + amount: 700 + currency: USD + redeem_activity_details: + amount_money: + amount: 300 + currency: USD + clear_balance_activity_details: + reason: SUSPICIOUS_ACTIVITY + deactivate_activity_details: + reason: SUSPICIOUS_ACTIVITY + adjust_increment_activity_details: + amount_money: {} + reason: COMPLIMENTARY + adjust_decrement_activity_details: + amount_money: {} + reason: SUSPICIOUS_ACTIVITY + unlinked_activity_refund_activity_details: + amount_money: {} + import_activity_details: + amount_money: {} + block_activity_details: + reason: CHARGEBACK_BLOCK + unblock_activity_details: + reason: CHARGEBACK_UNBLOCK + import_reversal_activity_details: + amount_money: {} + transfer_balance_to_activity_details: + transfer_from_gift_card_id: transfer_from_gift_card_id + amount_money: {} + transfer_balance_from_activity_details: + transfer_to_gift_card_id: transfer_to_gift_card_id + amount_money: {} + - id: gcact_b968ebfc7d46437b945be7b9e09123b4 + type: ACTIVATE + location_id: 81FN9BNFZTKS4 + created_at: '2021-05-20T22:26:54.000Z' + gift_card_id: gftc:6d55a72470d940c6ba09c0ab8ad08d20 + gift_card_gan: '7783320002929081' + gift_card_balance_money: + amount: 1000 + currency: USD + activate_activity_details: + amount_money: + amount: 1000 + currency: USD + order_id: jJNGHm4gLI6XkFbwtiSLqK72KkAZY + line_item_uid: eIWl7X0nMuO9Ewbh0ChIx + redeem_activity_details: + amount_money: {} + clear_balance_activity_details: + reason: SUSPICIOUS_ACTIVITY + deactivate_activity_details: + reason: SUSPICIOUS_ACTIVITY + adjust_increment_activity_details: + amount_money: {} + reason: COMPLIMENTARY + adjust_decrement_activity_details: + amount_money: {} + reason: SUSPICIOUS_ACTIVITY + unlinked_activity_refund_activity_details: + amount_money: {} + import_activity_details: + amount_money: {} + block_activity_details: + reason: CHARGEBACK_BLOCK + unblock_activity_details: + reason: CHARGEBACK_UNBLOCK + import_reversal_activity_details: + amount_money: {} + transfer_balance_to_activity_details: + transfer_from_gift_card_id: transfer_from_gift_card_id + amount_money: {} + transfer_balance_from_activity_details: + transfer_to_gift_card_id: transfer_to_gift_card_id + amount_money: {} + cursor: cursor + create: + path: /v2/gift-cards/activities + method: POST + auth: true + docs: >- + Creates a gift card activity to manage the balance or state of a [gift + card](entity:GiftCard). + + For example, create an `ACTIVATE` activity to activate a gift card with + an initial balance before first use. + source: + openapi: openapi/openapi.json + display-name: CreateGiftCardActivity + request: + name: CreateGiftCardActivityRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies the `CreateGiftCardActivity` + request. + validation: + minLength: 1 + maxLength: 128 + gift_card_activity: + type: root.GiftCardActivity + docs: >- + The activity to create for the gift card. This activity must + specify `gift_card_id` or `gift_card_gan` for the target + + gift card, the `location_id` where the activity occurred, and + the activity `type` along with the corresponding activity + details. + content-type: application/json + response: + docs: Success + type: root.CreateGiftCardActivityResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: U16kfr-kA70er-q4Rsym-7U7NnY + gift_card_activity: + type: ACTIVATE + location_id: 81FN9BNFZTKS4 + gift_card_id: gftc:6d55a72470d940c6ba09c0ab8ad08d20 + activate_activity_details: + order_id: jJNGHm4gLI6XkFbwtiSLqK72KkAZY + line_item_uid: eIWl7X0nMuO9Ewbh0ChIx + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card_activity: + id: gcact_c8f8cbf1f24b448d8ecf39ed03f97864 + type: ACTIVATE + location_id: 81FN9BNFZTKS4 + created_at: '2021-05-20T22:26:54.000Z' + gift_card_id: gftc:6d55a72470d940c6ba09c0ab8ad08d20 + gift_card_gan: '7783320002929081' + gift_card_balance_money: + amount: 1000 + currency: USD + load_activity_details: + order_id: order_id + line_item_uid: line_item_uid + reference_id: reference_id + buyer_payment_instrument_ids: + - buyer_payment_instrument_ids + activate_activity_details: + amount_money: + amount: 1000 + currency: USD + order_id: jJNGHm4gLI6XkFbwtiSLqK72KkAZY + line_item_uid: eIWl7X0nMuO9Ewbh0ChIx + reference_id: reference_id + buyer_payment_instrument_ids: + - buyer_payment_instrument_ids + redeem_activity_details: + amount_money: {} + payment_id: payment_id + reference_id: reference_id + status: PENDING + clear_balance_activity_details: + reason: SUSPICIOUS_ACTIVITY + deactivate_activity_details: + reason: SUSPICIOUS_ACTIVITY + adjust_increment_activity_details: + amount_money: {} + reason: COMPLIMENTARY + adjust_decrement_activity_details: + amount_money: {} + reason: SUSPICIOUS_ACTIVITY + refund_activity_details: + redeem_activity_id: redeem_activity_id + reference_id: reference_id + payment_id: payment_id + unlinked_activity_refund_activity_details: + amount_money: {} + reference_id: reference_id + payment_id: payment_id + import_activity_details: + amount_money: {} + block_activity_details: + reason: CHARGEBACK_BLOCK + unblock_activity_details: + reason: CHARGEBACK_UNBLOCK + import_reversal_activity_details: + amount_money: {} + transfer_balance_to_activity_details: + transfer_from_gift_card_id: transfer_from_gift_card_id + amount_money: {} + transfer_balance_from_activity_details: + transfer_to_gift_card_id: transfer_to_gift_card_id + amount_money: {} + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/inventory.yml b/.mock/definition/inventory.yml new file mode 100644 index 000000000..7aa982a39 --- /dev/null +++ b/.mock/definition/inventory.yml @@ -0,0 +1,815 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + DeprecatedGetAdjustment: + path: /v2/inventory/adjustment/{adjustment_id} + method: GET + auth: true + docs: >- + Deprecated version of + [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) + after the endpoint URL + + is updated to conform to the standard convention. + source: + openapi: openapi/openapi.json + display-name: DeprecatedRetrieveInventoryAdjustment + request: + name: DeprecatedGetAdjustmentInventoryRequest + path-parameters: + adjustment_id: + type: string + docs: >- + ID of the [InventoryAdjustment](entity:InventoryAdjustment) to + retrieve. + response: + docs: Success + type: root.GetInventoryAdjustmentResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + adjustment_id: adjustment_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + adjustment: + id: UDMOEO78BG6GYWA2XDRYX3KB + reference_id: 4a366069-4096-47a2-99a5-0084ac879509 + from_state: IN_STOCK + to_state: SOLD + location_id: C6W5YS5QM06F5 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + quantity: '7' + total_price_money: + amount: 4550 + currency: USD + occurred_at: '2016-11-16T25:44:22.837Z' + created_at: '2016-11-17T13:02:15.142Z' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + employee_id: employee_id + team_member_id: LRK57NSQ5X7PUD05 + transaction_id: transaction_id + refund_id: refund_id + purchase_order_id: purchase_order_id + goods_receipt_id: goods_receipt_id + adjustment_group: + id: id + root_adjustment_id: root_adjustment_id + from_state: CUSTOM + to_state: CUSTOM + getAdjustment: + path: /v2/inventory/adjustments/{adjustment_id} + method: GET + auth: true + docs: |- + Returns the [InventoryAdjustment](entity:InventoryAdjustment) object + with the provided `adjustment_id`. + source: + openapi: openapi/openapi.json + display-name: RetrieveInventoryAdjustment + request: + name: GetAdjustmentInventoryRequest + path-parameters: + adjustment_id: + type: string + docs: >- + ID of the [InventoryAdjustment](entity:InventoryAdjustment) to + retrieve. + response: + docs: Success + type: root.GetInventoryAdjustmentResponse + status-code: 200 + examples: + - path-parameters: + adjustment_id: adjustment_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + adjustment: + id: UDMOEO78BG6GYWA2XDRYX3KB + reference_id: 4a366069-4096-47a2-99a5-0084ac879509 + from_state: IN_STOCK + to_state: SOLD + location_id: C6W5YS5QM06F5 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + quantity: '7' + total_price_money: + amount: 4550 + currency: USD + occurred_at: '2016-11-16T25:44:22.837Z' + created_at: '2016-11-17T13:02:15.142Z' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + employee_id: employee_id + team_member_id: LRK57NSQ5X7PUD05 + transaction_id: transaction_id + refund_id: refund_id + purchase_order_id: purchase_order_id + goods_receipt_id: goods_receipt_id + adjustment_group: + id: id + root_adjustment_id: root_adjustment_id + from_state: CUSTOM + to_state: CUSTOM + DeprecatedBatchChange: + path: /v2/inventory/batch-change + method: POST + auth: true + docs: >- + Deprecated version of + [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) + after the endpoint URL + + is updated to conform to the standard convention. + source: + openapi: openapi/openapi.json + display-name: DeprecatedBatchChangeInventory + request: + body: root.BatchChangeInventoryRequest + content-type: application/json + response: + docs: Success + type: root.BatchChangeInventoryResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe + changes: + - type: PHYSICAL_COUNT + physical_count: + reference_id: 1536bfbf-efed-48bf-b17d-a197141b2a92 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '53' + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:25:24.878Z' + ignore_unchanged_counts: true + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + counts: + - catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '53' + calculated_at: '2016-11-16T22:28:01.223Z' + is_estimated: true + changes: + - type: PHYSICAL_COUNT + measurement_unit_id: measurement_unit_id + DeprecatedBatchGetChanges: + path: /v2/inventory/batch-retrieve-changes + method: POST + auth: true + docs: >- + Deprecated version of + [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) + after the endpoint URL + + is updated to conform to the standard convention. + source: + openapi: openapi/openapi.json + display-name: DeprecatedBatchRetrieveInventoryChanges + request: + body: root.BatchRetrieveInventoryChangesRequest + content-type: application/json + response: + docs: Success + type: root.BatchGetInventoryChangesResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-07-16' + request: + catalog_object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + location_ids: + - C6W5YS5QM06F5 + types: + - PHYSICAL_COUNT + states: + - IN_STOCK + updated_after: '2016-11-01T00:00:00.000Z' + updated_before: '2016-12-01T00:00:00.000Z' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + changes: + - type: PHYSICAL_COUNT + physical_count: + id: 46YDTW253DWGGK9HMAE6XCAO + reference_id: 22c07cf4-5626-4224-89f9-691112019399 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '86' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:24:49.028Z' + created_at: '2016-11-16T22:25:24.878Z' + measurement_unit_id: measurement_unit_id + cursor: cursor + DeprecatedBatchGetCounts: + path: /v2/inventory/batch-retrieve-counts + method: POST + auth: true + docs: >- + Deprecated version of + [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) + after the endpoint URL + + is updated to conform to the standard convention. + source: + openapi: openapi/openapi.json + display-name: DeprecatedBatchRetrieveInventoryCounts + request: + body: root.BatchGetInventoryCountsRequest + content-type: application/json + response: + docs: Success + type: root.BatchGetInventoryCountsResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-07-16' + request: + catalog_object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + location_ids: + - 59TNP9SA8VGDA + updated_after: '2016-11-16T00:00:00.000Z' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + counts: + - catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: 59TNP9SA8VGDA + quantity: '79' + calculated_at: '2016-11-16T22:28:01.223Z' + is_estimated: true + cursor: cursor + BatchCreateChanges: + path: /v2/inventory/changes/batch-create + method: POST + auth: true + docs: |- + Applies adjustments and counts to the provided item quantities. + + On success: returns the current calculated counts for all objects + referenced in the request. + On failure: returns a list of related errors. + source: + openapi: openapi/openapi.json + display-name: BatchChangeInventory + request: + body: root.BatchChangeInventoryRequest + content-type: application/json + response: + docs: Success + type: root.BatchChangeInventoryResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe + changes: + - type: PHYSICAL_COUNT + physical_count: + reference_id: 1536bfbf-efed-48bf-b17d-a197141b2a92 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '53' + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:25:24.878Z' + ignore_unchanged_counts: true + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + counts: + - catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '53' + calculated_at: '2016-11-16T22:28:01.223Z' + is_estimated: true + changes: + - type: PHYSICAL_COUNT + measurement_unit_id: measurement_unit_id + BatchGetChanges: + path: /v2/inventory/changes/batch-retrieve + method: POST + auth: true + docs: |- + Returns historical physical counts and adjustments based on the + provided filter criteria. + + Results are paginated and sorted in ascending order according their + `occurred_at` timestamp (oldest first). + + BatchRetrieveInventoryChanges is a catch-all query endpoint for queries + that cannot be handled by other, simpler endpoints. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.changes + source: + openapi: openapi/openapi.json + display-name: BatchRetrieveInventoryChanges + request: + body: root.BatchRetrieveInventoryChangesRequest + content-type: application/json + response: + docs: Success + type: root.BatchGetInventoryChangesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + catalog_object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + location_ids: + - C6W5YS5QM06F5 + types: + - PHYSICAL_COUNT + states: + - IN_STOCK + updated_after: '2016-11-01T00:00:00.000Z' + updated_before: '2016-12-01T00:00:00.000Z' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + changes: + - type: PHYSICAL_COUNT + physical_count: + id: 46YDTW253DWGGK9HMAE6XCAO + reference_id: 22c07cf4-5626-4224-89f9-691112019399 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '86' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:24:49.028Z' + created_at: '2016-11-16T22:25:24.878Z' + measurement_unit_id: measurement_unit_id + cursor: cursor + BatchGetCounts: + path: /v2/inventory/counts/batch-retrieve + method: POST + auth: true + docs: >- + Returns current counts for the provided + + [CatalogObject](entity:CatalogObject)s at the requested + + [Location](entity:Location)s. + + + Results are paginated and sorted in descending order according to their + + `calculated_at` timestamp (newest first). + + + When `updated_after` is specified, only counts that have changed since + that + + time (based on the server timestamp for the most recent change) are + + returned. This allows clients to perform a "sync" operation, for example + + in response to receiving a Webhook notification. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.counts + source: + openapi: openapi/openapi.json + display-name: BatchRetrieveInventoryCounts + request: + body: root.BatchGetInventoryCountsRequest + content-type: application/json + response: + docs: Success + type: root.BatchGetInventoryCountsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + catalog_object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + location_ids: + - 59TNP9SA8VGDA + updated_after: '2016-11-16T00:00:00.000Z' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + counts: + - catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: 59TNP9SA8VGDA + quantity: '79' + calculated_at: '2016-11-16T22:28:01.223Z' + is_estimated: true + cursor: cursor + deprecatedGetPhysicalCount: + path: /v2/inventory/physical-count/{physical_count_id} + method: GET + auth: true + docs: >- + Deprecated version of + [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) + after the endpoint URL + + is updated to conform to the standard convention. + source: + openapi: openapi/openapi.json + display-name: DeprecatedRetrieveInventoryPhysicalCount + request: + name: DeprecatedGetPhysicalCountInventoryRequest + path-parameters: + physical_count_id: + type: string + docs: >- + ID of the + + [InventoryPhysicalCount](entity:InventoryPhysicalCount) to + retrieve. + response: + docs: Success + type: root.GetInventoryPhysicalCountResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + physical_count_id: physical_count_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + count: + id: ANZADNPLKADOJKJIUANKLMLQ + reference_id: f857ec37-f9a0-4458-8e23-5b5e0bea4e53 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '15' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + employee_id: employee_id + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:25:24.878Z' + created_at: '2016-11-16T22:25:24.878Z' + getPhysicalCount: + path: /v2/inventory/physical-counts/{physical_count_id} + method: GET + auth: true + docs: |- + Returns the [InventoryPhysicalCount](entity:InventoryPhysicalCount) + object with the provided `physical_count_id`. + source: + openapi: openapi/openapi.json + display-name: RetrieveInventoryPhysicalCount + request: + name: GetPhysicalCountInventoryRequest + path-parameters: + physical_count_id: + type: string + docs: >- + ID of the + + [InventoryPhysicalCount](entity:InventoryPhysicalCount) to + retrieve. + response: + docs: Success + type: root.GetInventoryPhysicalCountResponse + status-code: 200 + examples: + - path-parameters: + physical_count_id: physical_count_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + count: + id: ANZADNPLKADOJKJIUANKLMLQ + reference_id: f857ec37-f9a0-4458-8e23-5b5e0bea4e53 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '15' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + employee_id: employee_id + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:25:24.878Z' + created_at: '2016-11-16T22:25:24.878Z' + getTransfer: + path: /v2/inventory/transfers/{transfer_id} + method: GET + auth: true + docs: |- + Returns the [InventoryTransfer](entity:InventoryTransfer) object + with the provided `transfer_id`. + source: + openapi: openapi/openapi.json + display-name: RetrieveInventoryTransfer + request: + name: GetTransferInventoryRequest + path-parameters: + transfer_id: + type: string + docs: >- + ID of the [InventoryTransfer](entity:InventoryTransfer) to + retrieve. + response: + docs: Success + type: root.GetInventoryTransferResponse + status-code: 200 + examples: + - path-parameters: + transfer_id: transfer_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + transfer: + id: UDMOEO78BG6GYWA2XDRYX3KB + reference_id: 4a366069-4096-47a2-99a5-0084ac879509 + state: IN_STOCK + from_location_id: C6W5YS5QM06F5 + to_location_id: 59TNP9SA8VGDA + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + quantity: '7' + occurred_at: '2016-11-16T25:44:22.837Z' + created_at: '2016-11-17T13:02:15.142Z' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + employee_id: employee_id + team_member_id: LRK57NSQ5X7PUD05 + get: + path: /v2/inventory/{catalog_object_id} + method: GET + auth: true + docs: |- + Retrieves the current calculated stock count for a given + [CatalogObject](entity:CatalogObject) at a given set of + [Location](entity:Location)s. Responses are paginated and unsorted. + For more sophisticated queries, use a batch endpoint. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.counts + source: + openapi: openapi/openapi.json + display-name: RetrieveInventoryCount + request: + name: GetInventoryRequest + path-parameters: + catalog_object_id: + type: string + docs: ID of the [CatalogObject](entity:CatalogObject) to retrieve. + query-parameters: + location_ids: + type: optional> + docs: >- + The [Location](entity:Location) IDs to look up as a + comma-separated + + list. An empty list queries all locations. + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for the original + query. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + response: + docs: Success + type: root.GetInventoryCountResponse + status-code: 200 + examples: + - path-parameters: + catalog_object_id: catalog_object_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + counts: + - catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '22' + calculated_at: '2016-11-16T22:28:01.223Z' + is_estimated: true + cursor: cursor + changes: + path: /v2/inventory/{catalog_object_id}/changes + method: GET + auth: true + docs: >- + Returns a set of physical counts and inventory adjustments for the + + provided [CatalogObject](entity:CatalogObject) at the requested + + [Location](entity:Location)s. + + + You can achieve the same result by calling + [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) + + and having the `catalog_object_ids` list contain a single element of the + `CatalogObject` ID. + + + Results are paginated and sorted in descending order according to their + + `occurred_at` timestamp (newest first). + + + There are no limits on how far back the caller can page. This endpoint + can be + + used to display recent changes for a specific item. For more + + sophisticated queries, use a batch endpoint. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.changes + source: + openapi: openapi/openapi.json + display-name: RetrieveInventoryChanges + request: + name: ChangesInventoryRequest + path-parameters: + catalog_object_id: + type: string + docs: ID of the [CatalogObject](entity:CatalogObject) to retrieve. + query-parameters: + location_ids: + type: optional> + docs: >- + The [Location](entity:Location) IDs to look up as a + comma-separated + + list. An empty list queries all locations. + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for the original + query. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + response: + docs: Success + type: root.GetInventoryChangesResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + catalog_object_id: catalog_object_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + changes: + - type: ADJUSTMENT + adjustment: + id: OJKJIUANKLMLQANZADNPLKAD + reference_id: d8207693-168f-4b44-a2fd-a7ff533ddd26 + from_state: IN_STOCK + to_state: SOLD + location_id: C6W5YS5QM06F5 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + quantity: '3' + total_price_money: + amount: 5000 + currency: USD + occurred_at: '2016-11-16T22:25:24.878Z' + created_at: '2016-11-16T22:25:24.878Z' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + team_member_id: AV7YRCGI2H1J5NQ8E1XIZCNA + transaction_id: 5APV6JYK1SNCZD11AND2RX1Z + measurement_unit_id: measurement_unit_id + cursor: cursor + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/invoices.yml b/.mock/definition/invoices.yml new file mode 100644 index 000000000..c3a319666 --- /dev/null +++ b/.mock/definition/invoices.yml @@ -0,0 +1,1207 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/invoices + method: GET + auth: true + docs: >- + Returns a list of invoices for a given location. The response + + is paginated. If truncated, the response includes a `cursor` that + you + + use in a subsequent request to retrieve the next set of invoices. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.invoices + source: + openapi: openapi/openapi.json + display-name: ListInvoices + request: + name: ListInvoicesRequest + query-parameters: + location_id: + type: string + docs: The ID of the location for which to list invoices. + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for your + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + The maximum number of invoices to return (200 is the maximum + `limit`). + + If not provided, the server uses a default limit of 100 invoices. + response: + docs: Success + type: root.ListInvoicesResponse + status-code: 200 + examples: + - query-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + response: + body: + invoices: + - id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 1 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + status: DRAFT + timezone: America/Los_Angeles + created_at: '2030-01-13T17:45:13Z' + updated_at: '2030-01-13T21:24:10Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - id: inva:0-3bB9ZuDHiziThQhuC4fwWt + filename: file.jpg + description: Service contract + filesize: 102705 + hash: 273ee02cb6f5f8a3a8ca23604930dd53 + mime_type: image/jpeg + uploaded_at: '2030-01-13T21:24:10Z' + creator_team_member_id: creator_team_member_id + - id: inv:0-ChC366qAfskpGrBI_1bozs9mEA3 + version: 3 + location_id: ES0RJRZYEC39A + order_id: a65jnS8NXbfprvGJzY9F4fQTuaB + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + payment_requests: + - uid: 66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176 + request_type: DEPOSIT + due_date: '2021-01-23' + percentage_requested: '25' + tipping_enabled: false + automatic_payment_source: CARD_ON_FILE + card_id: ccof:IkWfpLj4tNHMyFii3GB + computed_amount_money: + amount: 1000 + currency: USD + total_completed_amount_money: + amount: 1000 + currency: USD + - uid: 120c5e18-4f80-4f6b-b159-774cb9bf8f99 + request_type: BALANCE + due_date: '2021-06-15' + tipping_enabled: false + automatic_payment_source: CARD_ON_FILE + card_id: ccof:IkWfpLj4tNHMyFii3GB + computed_amount_money: + amount: 3000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-455 + title: title + description: description + scheduled_at: scheduled_at + public_url: >- + https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9 + next_payment_amount_money: + amount: 3000 + currency: USD + status: PARTIALLY_PAID + timezone: America/Los_Angeles + created_at: '2021-01-23T15:29:12Z' + updated_at: '2021-01-23T15:29:56Z' + accepted_payment_methods: + card: true + square_gift_card: true + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - {} + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + cursor: ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/invoices + method: POST + auth: true + docs: >- + Creates a draft [invoice](entity:Invoice) + + for an order created using the Orders API. + + + A draft invoice remains in your account and no action is taken. + + You must publish the invoice before Square can process it (send it to + the customer's email address or charge the customer’s card on file). + source: + openapi: openapi/openapi.json + display-name: CreateInvoice + request: + name: CreateInvoiceRequest + body: + properties: + invoice: + type: root.Invoice + docs: The invoice to create. + idempotency_key: + type: optional + docs: >- + A unique string that identifies the `CreateInvoice` request. If + you do not + + provide `idempotency_key` (or provide an empty string as the + value), the endpoint + + treats each request as independent. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 128 + content-type: application/json + response: + docs: Success + type: root.CreateInvoiceResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + invoice: + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + payment_requests: + - request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - relative_scheduled_days: -1 + message: Your invoice is due tomorrow + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + sale_or_service_date: '2030-01-24' + store_payment_method_enabled: false + idempotency_key: ce3748f9-5fc1-4762-aa12-aae5e843f1f4 + response: + body: + invoice: + id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 0 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + company_name: company_name + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + next_payment_amount_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: DRAFT + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T17:45:13Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/invoices/search + method: POST + auth: true + docs: >- + Searches for invoices from a location specified in + + the filter. You can optionally specify customers in the filter for whom + to + + retrieve invoices. In the current implementation, you can only specify + one location and + + optionally one customer. + + + The response is paginated. If truncated, the response includes a + `cursor` + + that you use in a subsequent request to retrieve the next set of + invoices. + source: + openapi: openapi/openapi.json + display-name: SearchInvoices + request: + name: SearchInvoicesRequest + body: + properties: + query: + type: root.InvoiceQuery + docs: Describes the query criteria for searching invoices. + limit: + type: optional + docs: >- + The maximum number of invoices to return (200 is the maximum + `limit`). + + If not provided, the server uses a default limit of 100 + invoices. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this cursor to retrieve the next set of results for your + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchInvoicesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + location_ids: + - ES0RJRZYEC39A + customer_ids: + - JDKYHBWT1D4F8MFH63DBMEN8Y4 + sort: + field: INVOICE_SORT_DATE + order: DESC + limit: 100 + response: + body: + invoices: + - id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 0 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + status: DRAFT + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T17:45:13Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + - id: inv:0-ChC366qAfskpGrBI_1bozs9mEA3 + version: 3 + location_id: ES0RJRZYEC39A + order_id: a65jnS8NXbfprvGJzY9F4fQTuaB + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + payment_requests: + - uid: 66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176 + request_type: DEPOSIT + due_date: '2021-01-23' + percentage_requested: '25' + tipping_enabled: false + automatic_payment_source: CARD_ON_FILE + card_id: ccof:IkWfpLj4tNHMyFii3GB + computed_amount_money: + amount: 1000 + currency: USD + total_completed_amount_money: + amount: 1000 + currency: USD + - uid: 120c5e18-4f80-4f6b-b159-774cb9bf8f99 + request_type: BALANCE + due_date: '2021-06-15' + tipping_enabled: false + automatic_payment_source: CARD_ON_FILE + card_id: ccof:IkWfpLj4tNHMyFii3GB + computed_amount_money: + amount: 3000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-455 + title: title + description: description + scheduled_at: scheduled_at + public_url: >- + https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9 + next_payment_amount_money: + amount: 3000 + currency: USD + status: PARTIALLY_PAID + timezone: America/Los_Angeles + created_at: '2021-01-23T15:29:12Z' + updated_at: '2021-01-23T15:29:56Z' + accepted_payment_methods: + card: true + square_gift_card: true + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - {} + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + cursor: ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/invoices/{invoice_id} + method: GET + auth: true + docs: Retrieves an invoice by invoice ID. + source: + openapi: openapi/openapi.json + display-name: GetInvoice + request: + name: GetInvoicesRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the invoice to retrieve. + response: + docs: Success + type: root.GetInvoiceResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-07-16' + response: + body: + invoice: + id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 0 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + company_name: company_name + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + next_payment_amount_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: DRAFT + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T17:45:13Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/invoices/{invoice_id} + method: PUT + auth: true + docs: >- + Updates an invoice. This endpoint supports sparse updates, so you only + need + + to specify the fields you want to change along with the required + `version` field. + + Some restrictions apply to updating invoices. For example, you cannot + change the + + `order_id` or `location_id` field. + source: + openapi: openapi/openapi.json + display-name: UpdateInvoice + request: + name: UpdateInvoiceRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the invoice to update. + body: + properties: + invoice: + type: root.Invoice + docs: >- + The invoice fields to add, change, or clear. Fields can be + cleared using + + null values or the `remove` field (for individual payment + requests or reminders). + + The current invoice `version` is also required. For more + information, including requirements, + + limitations, and more examples, see [Update an + Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). + idempotency_key: + type: optional> + docs: >- + A unique string that identifies the `UpdateInvoice` request. If + you do not + + provide `idempotency_key` (or provide an empty string as the + value), the endpoint + + treats each request as independent. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 128 + fields_to_clear: + type: optional>> + docs: >- + The list of fields to clear. Although this field is currently + supported, we + + recommend using null values or the `remove` field when possible. + For examples, see + + [Update an + Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). + content-type: application/json + response: + docs: Success + type: root.UpdateInvoiceResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-07-16' + request: + invoice: + version: 1 + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + tipping_enabled: false + idempotency_key: 4ee82288-0910-499e-ab4c-5d0071dad1be + response: + body: + invoice: + id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 2 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + company_name: company_name + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: false + automatic_payment_source: NONE + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + next_payment_amount_money: + amount: 10000 + currency: USD + status: UNPAID + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T18:23:11Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/invoices/{invoice_id} + method: DELETE + auth: true + docs: >- + Deletes the specified invoice. When an invoice is deleted, the + + associated order status changes to CANCELED. You can only delete a + draft + + invoice (you cannot delete a published invoice, including one that is + scheduled for processing). + source: + openapi: openapi/openapi.json + display-name: DeleteInvoice + request: + name: DeleteInvoicesRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the invoice to delete. + query-parameters: + version: + type: optional> + docs: >- + The version of the [invoice](entity:Invoice) to delete. + + If you do not know the version, you can call + [GetInvoice](api-endpoint:Invoices-GetInvoice) or + + [ListInvoices](api-endpoint:Invoices-ListInvoices). + response: + docs: Success + type: root.DeleteInvoiceResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + CreateInvoiceAttachment: + path: /v2/invoices/{invoice_id}/attachments + method: POST + auth: true + docs: >- + Uploads a file and attaches it to an invoice. This endpoint accepts HTTP + multipart/form-data file uploads + + with a JSON `request` part and a `file` part. The `file` part must be a + `readable stream` that contains a file + + in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF. + + + Invoices can have up to 10 attachments with a total file size of 25 MB. + Attachments can be added only to invoices + + in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. + + + __NOTE:__ When testing in the Sandbox environment, the total file size + is limited to 1 KB. + source: + openapi: openapi/openapi.json + display-name: CreateInvoiceAttachment + request: + name: CreateInvoiceAttachmentRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the [invoice](entity:Invoice) to attach the file to. + body: + properties: + request: + type: optional + content-type: application/json; charset=utf-8 + image_file: + type: optional + content-type: image/jpeg + content-type: multipart/form-data + response: + docs: Success + type: root.CreateInvoiceAttachmentResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-07-16' + request: {} + response: + body: + attachment: + id: inva:0-3bB9ZuDHiziThQhuC4fwWt + filename: file.jpg + description: Service contract + filesize: 102705 + hash: 273ee02cb6f5f8a3a8ca23604930dd53 + mime_type: image/jpeg + uploaded_at: '2023-02-03T20:28:14Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + DeleteInvoiceAttachment: + path: /v2/invoices/{invoice_id}/attachments/{attachment_id} + method: DELETE + auth: true + docs: >- + Removes an attachment from an invoice and permanently deletes the file. + Attachments can be removed only + + from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` + state. + source: + openapi: openapi/openapi.json + display-name: DeleteInvoiceAttachment + request: + name: DeleteInvoiceAttachmentRequest + path-parameters: + invoice_id: + type: string + docs: >- + The ID of the [invoice](entity:Invoice) to delete the attachment + from. + attachment_id: + type: string + docs: The ID of the [attachment](entity:InvoiceAttachment) to delete. + response: + docs: Success + type: root.DeleteInvoiceAttachmentResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + attachment_id: attachment_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cancel: + path: /v2/invoices/{invoice_id}/cancel + method: POST + auth: true + docs: >- + Cancels an invoice. The seller cannot collect payments for + + the canceled invoice. + + + You cannot cancel an invoice in the `DRAFT` state or in a terminal + state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`. + source: + openapi: openapi/openapi.json + display-name: CancelInvoice + request: + name: CancelInvoiceRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the [invoice](entity:Invoice) to cancel. + body: + properties: + version: + type: integer + docs: >- + The version of the [invoice](entity:Invoice) to cancel. + + If you do not know the version, you can call + + [GetInvoice](api-endpoint:Invoices-GetInvoice) or + [ListInvoices](api-endpoint:Invoices-ListInvoices). + content-type: application/json + response: + docs: Success + type: root.CancelInvoiceResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-07-16' + request: + version: 0 + response: + body: + invoice: + id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 1 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + company_name: company_name + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + next_payment_amount_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: CANCELED + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T18:23:11Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + publish: + path: /v2/invoices/{invoice_id}/publish + method: POST + auth: true + docs: >- + Publishes the specified draft invoice. + + + After an invoice is published, Square + + follows up based on the invoice configuration. For example, Square + + sends the invoice to the customer's email address, charges the + customer's card on file, or does + + nothing. Square also makes the invoice available on a Square-hosted + invoice page. + + + The invoice `status` also changes from `DRAFT` to a status + + based on the invoice configuration. For example, the status changes to + `UNPAID` if + + Square emails the invoice or `PARTIALLY_PAID` if Square charges a card + on file for a portion of the + + invoice amount. + + + In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` + permissions, `CUSTOMERS_READ` + + and `PAYMENTS_WRITE` are required when publishing invoices configured + for card-on-file payments. + source: + openapi: openapi/openapi.json + display-name: PublishInvoice + request: + name: PublishInvoiceRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the invoice to publish. + body: + properties: + version: + type: integer + docs: >- + The version of the [invoice](entity:Invoice) to publish. + + This must match the current version of the invoice; otherwise, + the request is rejected. + idempotency_key: + type: optional> + docs: >- + A unique string that identifies the `PublishInvoice` request. If + you do not + + provide `idempotency_key` (or provide an empty string as the + value), the endpoint + + treats each request as independent. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 128 + content-type: application/json + response: + docs: Success + type: root.PublishInvoiceResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-07-16' + request: + version: 1 + idempotency_key: 32da42d0-1997-41b0-826b-f09464fc2c2e + response: + body: + invoice: + id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 1 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + company_name: company_name + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: >- + https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9 + next_payment_amount_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: SCHEDULED + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T18:23:11Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor.yml b/.mock/definition/labor.yml new file mode 100644 index 000000000..e259a438e --- /dev/null +++ b/.mock/definition/labor.yml @@ -0,0 +1,1023 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + CreateScheduledShift: + path: /v2/labor/scheduled-shifts + method: POST + auth: true + docs: >- + Creates a scheduled shift by providing draft shift details such as job + ID, + + team member assignment, and start and end times. + + + The following `draft_shift_details` fields are required: + + - `location_id` + + - `job_id` + + - `start_at` + + - `end_at` + source: + openapi: openapi/openapi.json + display-name: CreateScheduledShift + request: + name: CreateScheduledShiftRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique identifier for the `CreateScheduledShift` request, used + to ensure the + + [idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + + of the operation. + validation: + maxLength: 128 + scheduled_shift: + type: root.ScheduledShift + docs: >- + The scheduled shift with `draft_shift_details`. + + If needed, call + [ListLocations](api-endpoint:Locations-ListLocations) to get + location IDs, + + [ListJobs](api-endpoint:Team-ListJobs) to get job IDs, and + [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) + + to get team member IDs and current job assignments. + + + The `start_at` and `end_at` timestamps must be provided in the + time zone + offset of the + + shift location specified in `location_id`. Example for Pacific + Standard Time: 2024-10-31T12:30:00-08:00 + content-type: application/json + response: + docs: Success + type: root.CreateScheduledShiftResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: HIDSNG5KS478L + scheduled_shift: + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + response: + body: + scheduled_shift: + id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + timezone: America/New_York + published_shift_details: + team_member_id: team_member_id + location_id: location_id + job_id: job_id + start_at: start_at + end_at: end_at + notes: notes + is_deleted: true + timezone: timezone + version: 1 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:00-05:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkPublishScheduledShifts: + path: /v2/labor/scheduled-shifts/bulk-publish + method: POST + auth: true + docs: >- + Publishes 1 - 100 scheduled shifts. This endpoint takes a map of + individual publish + + requests and returns a map of responses. When a scheduled shift is + published, Square keeps + + the `draft_shift_details` field as is and copies it to the + `published_shift_details` field. + + + The minimum `start_at` and maximum `end_at` timestamps of all shifts in + a + + `BulkPublishScheduledShifts` request must fall within a two-week period. + source: + openapi: openapi/openapi.json + display-name: BulkPublishScheduledShifts + request: + name: BulkPublishScheduledShiftsRequest + body: + properties: + scheduled_shifts: + type: map + docs: >- + A map of 1 to 100 key-value pairs that represent individual + publish requests. + + + - Each key is the ID of a scheduled shift you want to publish. + + - Each value is a `BulkPublishScheduledShiftsData` object that + contains the + + `version` field or is an empty object. + scheduled_shift_notification_audience: + type: optional + docs: >- + Indicates whether Square should send email notifications to team + members and + + which team members should receive the notifications. This + setting applies to all shifts + + specified in the bulk operation. The default value is + `AFFECTED`. + + See + [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudience) + for possible values + content-type: application/json + response: + docs: Success + type: root.BulkPublishScheduledShiftsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + scheduled_shifts: + key: {} + scheduled_shift_notification_audience: AFFECTED + response: + body: + responses: + idp_key_1: + scheduled_shift: + id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-03-25T03:11:00-05:00' + end_at: '2019-03-25T13:18:00-05:00' + notes: Don't forget to prep the vegetables + is_deleted: false + timezone: America/New_York + published_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-03-25T03:11:00-05:00' + end_at: '2019-03-25T13:18:00-05:00' + notes: Don't forget to prep the vegetables + is_deleted: false + timezone: America/New_York + version: 3 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:15-05:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + idp_key_2: + errors: + - category: INVALID_REQUEST_ERROR + code: INVALID_VALUE + detail: Scheduled shift with id 'scheduled-shift-2' not found + field: scheduled-shifts.scheduled-shift-2 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + SearchScheduledShifts: + path: /v2/labor/scheduled-shifts/search + method: POST + auth: true + docs: >- + Returns a paginated list of scheduled shifts, with optional filter and + sort settings. + + By default, results are sorted by `start_at` in ascending order. + source: + openapi: openapi/openapi.json + display-name: SearchScheduledShifts + request: + name: SearchScheduledShiftsRequest + body: + properties: + query: + type: optional + docs: Query conditions used to filter and sort the results. + limit: + type: optional + docs: >- + The maximum number of results to return in a single response + page. The default value is 50. + validation: + min: 1 + max: 50 + cursor: + type: optional + docs: >- + The pagination cursor returned by the previous call to this + endpoint. Provide + + this cursor to retrieve the next page of results for your + original request. For more + + information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchScheduledShiftsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + assignment_status: ASSIGNED + sort: + field: CREATED_AT + order: ASC + limit: 2 + cursor: xoxp-1234-5678-90123 + response: + body: + scheduled_shifts: + - id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + timezone: America/New_York + version: 1 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:00-05:00' + cursor: xoxp-123-2123-123232 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + RetrieveScheduledShift: + path: /v2/labor/scheduled-shifts/{id} + method: GET + auth: true + docs: Retrieves a scheduled shift by ID. + source: + openapi: openapi/openapi.json + display-name: RetrieveScheduledShift + request: + name: RetrieveScheduledShiftRequest + path-parameters: + id: + type: string + docs: The ID of the scheduled shift to retrieve. + response: + docs: Success + type: root.RetrieveScheduledShiftResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + scheduled_shift: + id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-03-25T03:11:00-05:00' + end_at: '2019-03-25T13:18:00-05:00' + notes: Don't forget to prep the vegetables + is_deleted: false + timezone: America/New_York + published_shift_details: + team_member_id: team_member_id + location_id: location_id + job_id: job_id + start_at: start_at + end_at: end_at + notes: notes + is_deleted: true + timezone: timezone + version: 2 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:15-05:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + UpdateScheduledShift: + path: /v2/labor/scheduled-shifts/{id} + method: PUT + auth: true + docs: >- + Updates the draft shift details for a scheduled shift. This endpoint + supports + + sparse updates, so only new, changed, or removed fields are required in + the request. + + You must publish the shift to make updates public. + + + You can make the following updates to `draft_shift_details`: + + - Change the `location_id`, `job_id`, `start_at`, and `end_at` fields. + + - Add, change, or clear the `team_member_id` and `notes` fields. To + clear these fields, + + set the value to null. + + - Change the `is_deleted` field. To delete a scheduled shift, set + `is_deleted` to true + + and then publish the shift. + source: + openapi: openapi/openapi.json + display-name: UpdateScheduledShift + request: + name: UpdateScheduledShiftRequest + path-parameters: + id: + type: string + docs: The ID of the scheduled shift to update. + body: + properties: + scheduled_shift: + type: root.ScheduledShift + docs: >- + The scheduled shift with any updates in the + `draft_shift_details` field. + + If needed, call + [ListLocations](api-endpoint:Locations-ListLocations) to get + location IDs, + + [ListJobs](api-endpoint:Team-ListJobs) to get job IDs, and + [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) + + to get team member IDs and current job assignments. Updates made + to `published_shift_details` + + are ignored. + + + If provided, the `start_at` and `end_at` timestamps must be in + the time zone + offset of the + + shift location specified in `location_id`. Example for Pacific + Standard Time: 2024-10-31T12:30:00-08:00 + + + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for the request, provide the current version of the + shift in the `version` field. + + If the provided version doesn't match the server version, the + request fails. If `version` is + + omitted, Square executes a blind write, potentially overwriting + data from another publish request. + content-type: application/json + response: + docs: Success + type: root.UpdateScheduledShiftResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + request: + scheduled_shift: + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-03-25T03:11:00-05:00' + end_at: '2019-03-25T13:18:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + version: 1 + response: + body: + scheduled_shift: + id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-03-25T03:11:00-05:00' + end_at: '2019-03-25T13:18:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + timezone: America/New_York + published_shift_details: + team_member_id: team_member_id + location_id: location_id + job_id: job_id + start_at: start_at + end_at: end_at + notes: notes + is_deleted: true + timezone: timezone + version: 2 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:15-05:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + PublishScheduledShift: + path: /v2/labor/scheduled-shifts/{id}/publish + method: POST + auth: true + docs: >- + Publishes a scheduled shift. When a scheduled shift is published, Square + keeps the + + `draft_shift_details` field as is and copies it to the + `published_shift_details` field. + source: + openapi: openapi/openapi.json + display-name: PublishScheduledShift + request: + name: PublishScheduledShiftRequest + path-parameters: + id: + type: string + docs: The ID of the scheduled shift to publish. + body: + properties: + idempotency_key: + type: string + docs: >- + A unique identifier for the `PublishScheduledShift` request, + used to ensure the + + [idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + + of the operation. + validation: + minLength: 1 + maxLength: 128 + version: + type: optional + docs: >- + The current version of the scheduled shift, used to enable + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control. If the provided version doesn't match the server + version, the request fails. + + If omitted, Square executes a blind write, potentially + overwriting data from another publish request. + scheduled_shift_notification_audience: + type: optional + docs: >- + Indicates whether Square should send an email notification to + team members and + + which team members should receive the notification. The default + value is `AFFECTED`. + + See + [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudience) + for possible values + content-type: application/json + response: + docs: Success + type: root.PublishScheduledShiftResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + request: + idempotency_key: HIDSNG5KS478L + version: 2 + scheduled_shift_notification_audience: ALL + response: + body: + scheduled_shift: + id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + timezone: America/New_York + published_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + timezone: America/New_York + version: 2 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:00-05:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + CreateTimecard: + path: /v2/labor/timecards + method: POST + auth: true + docs: >- + Creates a new `Timecard`. + + + A `Timecard` represents a complete workday for a single team member. + + You must provide the following values in your request to this + + endpoint: + + + - `location_id` + + - `team_member_id` + + - `start_at` + + + An attempt to create a new `Timecard` can result in a `BAD_REQUEST` + error when: + + - The `status` of the new `Timecard` is `OPEN` and the team member has + another + + timecard with an `OPEN` status. + + - The `start_at` date is in the future. + + - The `start_at` or `end_at` date overlaps another timecard for the same + team member. + + - The `Break` instances are set in the request and a break `start_at` + + is before the `Timecard.start_at`, a break `end_at` is after + + the `Timecard.end_at`, or both. + source: + openapi: openapi/openapi.json + display-name: CreateTimecard + request: + name: CreateTimecardRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string value to ensure the idempotency of the + operation. + validation: + maxLength: 128 + timecard: + type: root.Timecard + docs: The `Timecard` to be created. + content-type: application/json + response: + docs: Success + type: root.CreateTimecardResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: HIDSNG5KS478L + timecard: + location_id: PAA1RJZZKXBFG + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + tip_eligible: true + breaks: + - start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + response: + body: + timecard: + id: K0YH4CV5462JB + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + status: CLOSED + version: 1 + created_at: '2019-02-28T00:39:02Z' + updated_at: '2019-02-28T00:39:02Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + SearchTimecards: + path: /v2/labor/timecards/search + method: POST + auth: true + docs: |- + Returns a paginated list of `Timecard` records for a business. + The list to be returned can be filtered by: + - Location IDs + - Team member IDs + - Timecard status (`OPEN` or `CLOSED`) + - Timecard start + - Timecard end + - Workday details + + The list can be sorted by: + - `START_AT` + - `END_AT` + - `CREATED_AT` + - `UPDATED_AT` + source: + openapi: openapi/openapi.json + display-name: SearchTimecards + request: + name: SearchTimecardsRequest + body: + properties: + query: + type: optional + docs: Query filters. + limit: + type: optional + docs: The number of resources in a page (200 by default). + validation: + min: 1 + max: 200 + cursor: + type: optional + docs: An opaque cursor for fetching the next page. + content-type: application/json + response: + docs: Success + type: root.SearchTimecardsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + workday: + date_range: + start_date: '2019-01-20' + end_date: '2019-02-03' + match_timecards_by: START_AT + default_timezone: America/Los_Angeles + limit: 100 + response: + body: + timecards: + - id: X714F3HA6D1PT + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-21T03:11:00-05:00' + end_at: '2019-01-21T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + tip_eligible: true + breaks: + - id: SJW7X6AKEJQ65 + start_at: '2019-01-21T06:11:00-05:00' + end_at: '2019-01-21T06:11:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT10M + is_paid: true + status: CLOSED + version: 6 + created_at: '2019-01-24T01:12:03Z' + updated_at: '2019-02-07T22:21:08Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + - id: GDHYBZYWK0P2V + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-22T12:02:00-05:00' + end_at: '2019-01-22T13:02:00-05:00' + wage: + title: Cook + hourly_rate: + amount: 1600 + currency: USD + job_id: gcbz15vKGnMKmaWJJ152kjim + tip_eligible: true + breaks: + - id: BKS6VR7WR748A + start_at: '2019-01-22T14:30:00-05:00' + end_at: '2019-01-22T14:40:00-05:00' + break_type_id: WQX00VR99F53J + name: Tea Break + expected_duration: PT10M + is_paid: true + - id: BQFEZSHFZSC51 + start_at: '2019-01-22T12:30:00-05:00' + end_at: '2019-01-22T12:44:00-05:00' + break_type_id: P6Q468ZFRN1AC + name: Coffee Break + expected_duration: PT15M + is_paid: false + status: CLOSED + version: 16 + created_at: '2019-01-23T23:32:45Z' + updated_at: '2019-01-24T00:56:25Z' + team_member_id: 33fJchumvVdJwxV0H6L9 + declared_cash_tip_money: + amount: 0 + currency: USD + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + RetrieveTimecard: + path: /v2/labor/timecards/{id} + method: GET + auth: true + docs: Returns a single `Timecard` specified by `id`. + source: + openapi: openapi/openapi.json + display-name: RetrieveTimecard + request: + name: RetrieveTimecardRequest + path-parameters: + id: + type: string + docs: The UUID for the `Timecard` being retrieved. + response: + docs: Success + type: root.RetrieveTimecardResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + timecard: + id: T35HMQSN89SV4 + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-02-23T18:00:00-05:00' + end_at: '2019-02-23T21:00:00-05:00' + wage: + title: Cashier + hourly_rate: + amount: 1457 + currency: USD + job_id: N4YKVLzFj3oGtNocqoYHYpW3 + tip_eligible: true + breaks: + - id: M9BBKEPQAQD2T + start_at: '2019-02-23T19:00:00-05:00' + end_at: '2019-02-23T20:00:00-05:00' + break_type_id: 92EPDRQKJ5088 + name: Lunch Break + expected_duration: PT1H + is_paid: true + status: CLOSED + version: 1 + created_at: '2019-02-27T00:12:12Z' + updated_at: '2019-02-27T00:12:12Z' + team_member_id: D71KRMQof6cXGUW0aAv7 + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + UpdateTimecard: + path: /v2/labor/timecards/{id} + method: PUT + auth: true + docs: >- + Updates an existing `Timecard`. + + + When adding a `Break` to a `Timecard`, any earlier `Break` instances in + the `Timecard` have + + the `end_at` property set to a valid RFC-3339 datetime string. + + + When closing a `Timecard`, all `Break` instances in the `Timecard` must + be complete with `end_at` + + set on each `Break`. + source: + openapi: openapi/openapi.json + display-name: UpdateTimecard + request: + name: UpdateTimecardRequest + path-parameters: + id: + type: string + docs: The ID of the object being updated. + body: + properties: + timecard: + type: root.Timecard + docs: The updated `Timecard` object. + content-type: application/json + response: + docs: Success + type: root.UpdateTimecardResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + request: + timecard: + location_id: PAA1RJZZKXBFG + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Bartender + hourly_rate: + amount: 1500 + currency: USD + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + status: CLOSED + version: 1 + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + response: + body: + timecard: + id: K0YH4CV5462JB + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Bartender + hourly_rate: + amount: 1500 + currency: USD + job_id: dZtrPh5GSDGugyXGByesVp51 + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + status: CLOSED + version: 2 + created_at: '2019-02-28T00:39:02Z' + updated_at: '2019-02-28T00:42:41Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + DeleteTimecard: + path: /v2/labor/timecards/{id} + method: DELETE + auth: true + docs: Deletes a `Timecard`. + source: + openapi: openapi/openapi.json + display-name: DeleteTimecard + request: + name: DeleteTimecardRequest + path-parameters: + id: + type: string + docs: The UUID for the `Timecard` being deleted. + response: + docs: Success + type: root.DeleteTimecardResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor/breakTypes.yml b/.mock/definition/labor/breakTypes.yml new file mode 100644 index 000000000..9caa5ef15 --- /dev/null +++ b/.mock/definition/labor/breakTypes.yml @@ -0,0 +1,275 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/labor/break-types + method: GET + auth: true + docs: Returns a paginated list of `BreakType` instances for a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.break_types + source: + openapi: openapi/openapi.json + display-name: ListBreakTypes + request: + name: ListBreakTypesRequest + query-parameters: + location_id: + type: optional> + docs: >- + Filter the returned `BreakType` results to only those that are + associated with the + + specified location. + limit: + type: optional> + docs: >- + The maximum number of `BreakType` results to return per page. The + number can range between 1 + + and 200. The default is 200. + cursor: + type: optional> + docs: A pointer to the next page of `BreakType` results to fetch. + response: + docs: Success + type: root.ListBreakTypesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + break_types: + - id: REGS1EQR1TPZ5 + location_id: PAA1RJZZKXBFG + break_name: Coffee Break + expected_duration: PT5M + is_paid: false + version: 1 + created_at: '2019-01-22T20:47:37Z' + updated_at: '2019-01-22T20:47:37Z' + - id: 92EPDRQKJ5088 + location_id: PAA1RJZZKXBFG + break_name: Lunch Break + expected_duration: PT1H + is_paid: true + version: 3 + created_at: '2019-01-25T19:26:30Z' + updated_at: '2019-01-25T19:26:30Z' + cursor: 2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/labor/break-types + method: POST + auth: true + docs: >- + Creates a new `BreakType`. + + + A `BreakType` is a template for creating `Break` objects. + + You must provide the following values in your request to this + + endpoint: + + + - `location_id` + + - `break_name` + + - `expected_duration` + + - `is_paid` + + + You can only have three `BreakType` instances per location. If you + attempt to add a fourth + + `BreakType` for a location, an `INVALID_REQUEST_ERROR` "Exceeded limit + of 3 breaks per location." + + is returned. + source: + openapi: openapi/openapi.json + display-name: CreateBreakType + request: + name: CreateBreakTypeRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string value to ensure the idempotency of the + operation. + validation: + maxLength: 128 + break_type: + type: root.BreakType + docs: The `BreakType` to be created. + content-type: application/json + response: + docs: Success + type: root.CreateBreakTypeResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: PAD3NG5KSN2GL + break_type: + location_id: CGJN03P1D08GF + break_name: Lunch Break + expected_duration: PT30M + is_paid: true + response: + body: + break_type: + id: 49SSVDJG76WF3 + location_id: CGJN03P1D08GF + break_name: Lunch Break + expected_duration: PT30M + is_paid: true + version: 1 + created_at: '2019-02-26T22:42:54Z' + updated_at: '2019-02-26T22:42:54Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/labor/break-types/{id} + method: GET + auth: true + docs: Returns a single `BreakType` specified by `id`. + source: + openapi: openapi/openapi.json + display-name: GetBreakType + request: + name: GetBreakTypesRequest + path-parameters: + id: + type: string + docs: The UUID for the `BreakType` being retrieved. + response: + docs: Success + type: root.GetBreakTypeResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + break_type: + id: lA0mj_RSOprNPwMUXdYp + location_id: 059SB0E0WCNWS + break_name: Lunch Break + expected_duration: PT30M + is_paid: true + version: 1 + created_at: '2019-02-21T17:50:00Z' + updated_at: '2019-02-21T17:50:00Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/labor/break-types/{id} + method: PUT + auth: true + docs: Updates an existing `BreakType`. + source: + openapi: openapi/openapi.json + display-name: UpdateBreakType + request: + name: UpdateBreakTypeRequest + path-parameters: + id: + type: string + docs: ' The UUID for the `BreakType` being updated.' + body: + properties: + break_type: + type: root.BreakType + docs: The updated `BreakType`. + content-type: application/json + response: + docs: Success + type: root.UpdateBreakTypeResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + request: + break_type: + location_id: 26M7H24AZ9N6R + break_name: Lunch + expected_duration: PT50M + is_paid: true + version: 1 + response: + body: + break_type: + id: Q6JSJS6D4DBCH + location_id: 26M7H24AZ9N6R + break_name: Lunch + expected_duration: PT50M + is_paid: true + version: 2 + created_at: '2018-06-12T20:19:12Z' + updated_at: '2019-02-26T23:12:59Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/labor/break-types/{id} + method: DELETE + auth: true + docs: |- + Deletes an existing `BreakType`. + + A `BreakType` can be deleted even if it is referenced from a `Shift`. + source: + openapi: openapi/openapi.json + display-name: DeleteBreakType + request: + name: DeleteBreakTypesRequest + path-parameters: + id: + type: string + docs: The UUID for the `BreakType` being deleted. + response: + docs: Success + type: root.DeleteBreakTypeResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor/employeeWages.yml b/.mock/definition/labor/employeeWages.yml new file mode 100644 index 000000000..3fdb171ff --- /dev/null +++ b/.mock/definition/labor/employeeWages.yml @@ -0,0 +1,117 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/labor/employee-wages + method: GET + auth: true + docs: Returns a paginated list of `EmployeeWage` instances for a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.employee_wages + source: + openapi: openapi/openapi.json + display-name: ListEmployeeWages + request: + name: ListEmployeeWagesRequest + query-parameters: + employee_id: + type: optional> + docs: >- + Filter the returned wages to only those that are associated with + the specified employee. + limit: + type: optional> + docs: >- + The maximum number of `EmployeeWage` results to return per page. + The number can range between + + 1 and 200. The default is 200. + cursor: + type: optional> + docs: A pointer to the next page of `EmployeeWage` results to fetch. + response: + docs: Success + type: root.ListEmployeeWagesResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + employee_wages: + - id: pXS3qCv7BERPnEGedM4S8mhm + employee_id: 33fJchumvVdJwxV0H6L9 + title: Manager + hourly_rate: + amount: 3250 + currency: USD + - id: rZduCkzYDUVL3ovh1sQgbue6 + employee_id: 33fJchumvVdJwxV0H6L9 + title: Cook + hourly_rate: + amount: 2600 + currency: USD + - id: FxLbs5KpPUHa8wyt5ctjubDX + employee_id: 33fJchumvVdJwxV0H6L9 + title: Barista + hourly_rate: + amount: 1600 + currency: USD + - id: vD1wCgijMDR3cX5TPnu7VXto + employee_id: 33fJchumvVdJwxV0H6L9 + title: Cashier + hourly_rate: + amount: 1700 + currency: USD + cursor: 2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/labor/employee-wages/{id} + method: GET + auth: true + docs: Returns a single `EmployeeWage` specified by `id`. + source: + openapi: openapi/openapi.json + display-name: GetEmployeeWage + request: + name: GetEmployeeWagesRequest + path-parameters: + id: + type: string + docs: The UUID for the `EmployeeWage` being retrieved. + response: + docs: Success + type: root.GetEmployeeWageResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + employee_wage: + id: pXS3qCv7BERPnEGedM4S8mhm + employee_id: 33fJchumvVdJwxV0H6L9 + title: Manager + hourly_rate: + amount: 2000 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor/shifts.yml b/.mock/definition/labor/shifts.yml new file mode 100644 index 000000000..38b3737c1 --- /dev/null +++ b/.mock/definition/labor/shifts.yml @@ -0,0 +1,461 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/labor/shifts + method: POST + auth: true + docs: >- + Creates a new `Shift`. + + + A `Shift` represents a complete workday for a single team member. + + You must provide the following values in your request to this + + endpoint: + + + - `location_id` + + - `team_member_id` + + - `start_at` + + + An attempt to create a new `Shift` can result in a `BAD_REQUEST` error + when: + + - The `status` of the new `Shift` is `OPEN` and the team member has + another + + shift with an `OPEN` status. + + - The `start_at` date is in the future. + + - The `start_at` or `end_at` date overlaps another shift for the same + team member. + + - The `Break` instances are set in the request and a break `start_at` + + is before the `Shift.start_at`, a break `end_at` is after + + the `Shift.end_at`, or both. + source: + openapi: openapi/openapi.json + display-name: CreateShift + request: + name: CreateShiftRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string value to ensure the idempotency of the + operation. + validation: + maxLength: 128 + shift: + type: root.Shift + docs: The `Shift` to be created. + content-type: application/json + response: + docs: Success + type: root.CreateShiftResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: HIDSNG5KS478L + shift: + location_id: PAA1RJZZKXBFG + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + tip_eligible: true + breaks: + - start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + response: + body: + shift: + id: K0YH4CV5462JB + employee_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + status: CLOSED + version: 1 + created_at: '2019-02-28T00:39:02Z' + updated_at: '2019-02-28T00:39:02Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/labor/shifts/search + method: POST + auth: true + docs: |- + Returns a paginated list of `Shift` records for a business. + The list to be returned can be filtered by: + - Location IDs + - Team member IDs + - Shift status (`OPEN` or `CLOSED`) + - Shift start + - Shift end + - Workday details + + The list can be sorted by: + - `START_AT` + - `END_AT` + - `CREATED_AT` + - `UPDATED_AT` + source: + openapi: openapi/openapi.json + display-name: SearchShifts + request: + name: SearchShiftsRequest + body: + properties: + query: + type: optional + docs: Query filters. + limit: + type: optional + docs: The number of resources in a page (200 by default). + validation: + min: 1 + max: 200 + cursor: + type: optional + docs: An opaque cursor for fetching the next page. + content-type: application/json + response: + docs: Success + type: root.SearchShiftsResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + workday: + date_range: + start_date: '2019-01-20' + end_date: '2019-02-03' + match_shifts_by: START_AT + default_timezone: America/Los_Angeles + limit: 100 + response: + body: + shifts: + - id: X714F3HA6D1PT + employee_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-21T03:11:00-05:00' + end_at: '2019-01-21T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + tip_eligible: true + breaks: + - id: SJW7X6AKEJQ65 + start_at: '2019-01-21T06:11:00-05:00' + end_at: '2019-01-21T06:11:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT10M + is_paid: true + status: CLOSED + version: 6 + created_at: '2019-01-24T01:12:03Z' + updated_at: '2019-02-07T22:21:08Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + - id: GDHYBZYWK0P2V + employee_id: 33fJchumvVdJwxV0H6L9 + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-22T12:02:00-05:00' + end_at: '2019-01-22T13:02:00-05:00' + wage: + title: Cook + hourly_rate: + amount: 1600 + currency: USD + job_id: gcbz15vKGnMKmaWJJ152kjim + tip_eligible: true + breaks: + - id: BKS6VR7WR748A + start_at: '2019-01-23T14:30:00-05:00' + end_at: '2019-01-23T14:40:00-05:00' + break_type_id: WQX00VR99F53J + name: Tea Break + expected_duration: PT10M + is_paid: true + - id: BQFEZSHFZSC51 + start_at: '2019-01-22T12:30:00-05:00' + end_at: '2019-01-22T12:44:00-05:00' + break_type_id: P6Q468ZFRN1AC + name: Coffee Break + expected_duration: PT15M + is_paid: false + status: CLOSED + version: 16 + created_at: '2019-01-23T23:32:45Z' + updated_at: '2019-01-24T00:56:25Z' + team_member_id: 33fJchumvVdJwxV0H6L9 + declared_cash_tip_money: + amount: 0 + currency: USD + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/labor/shifts/{id} + method: GET + auth: true + docs: Returns a single `Shift` specified by `id`. + source: + openapi: openapi/openapi.json + display-name: GetShift + request: + name: GetShiftsRequest + path-parameters: + id: + type: string + docs: The UUID for the `Shift` being retrieved. + response: + docs: Success + type: root.GetShiftResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + shift: + id: T35HMQSN89SV4 + employee_id: D71KRMQof6cXGUW0aAv7 + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-02-23T18:00:00-05:00' + end_at: '2019-02-23T21:00:00-05:00' + wage: + title: Cashier + hourly_rate: + amount: 1457 + currency: USD + job_id: N4YKVLzFj3oGtNocqoYHYpW3 + tip_eligible: true + breaks: + - id: M9BBKEPQAQD2T + start_at: '2019-02-23T19:00:00-05:00' + end_at: '2019-02-23T20:00:00-05:00' + break_type_id: 92EPDRQKJ5088 + name: Lunch Break + expected_duration: PT1H + is_paid: true + status: CLOSED + version: 1 + created_at: '2019-02-27T00:12:12Z' + updated_at: '2019-02-27T00:12:12Z' + team_member_id: D71KRMQof6cXGUW0aAv7 + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/labor/shifts/{id} + method: PUT + auth: true + docs: >- + Updates an existing `Shift`. + + + When adding a `Break` to a `Shift`, any earlier `Break` instances in the + `Shift` have + + the `end_at` property set to a valid RFC-3339 datetime string. + + + When closing a `Shift`, all `Break` instances in the `Shift` must be + complete with `end_at` + + set on each `Break`. + source: + openapi: openapi/openapi.json + display-name: UpdateShift + request: + name: UpdateShiftRequest + path-parameters: + id: + type: string + docs: The ID of the object being updated. + body: + properties: + shift: + type: root.Shift + docs: The updated `Shift` object. + content-type: application/json + response: + docs: Success + type: root.UpdateShiftResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + request: + shift: + location_id: PAA1RJZZKXBFG + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Bartender + hourly_rate: + amount: 1500 + currency: USD + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + version: 1 + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + response: + body: + shift: + id: K0YH4CV5462JB + employee_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Bartender + hourly_rate: + amount: 1500 + currency: USD + job_id: dZtrPh5GSDGugyXGByesVp51 + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + status: CLOSED + version: 2 + created_at: '2019-02-28T00:39:02Z' + updated_at: '2019-02-28T00:42:41Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/labor/shifts/{id} + method: DELETE + auth: true + docs: Deletes a `Shift`. + source: + openapi: openapi/openapi.json + display-name: DeleteShift + request: + name: DeleteShiftsRequest + path-parameters: + id: + type: string + docs: The UUID for the `Shift` being deleted. + response: + docs: Success + type: root.DeleteShiftResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor/teamMemberWages.yml b/.mock/definition/labor/teamMemberWages.yml new file mode 100644 index 000000000..97dcbc13f --- /dev/null +++ b/.mock/definition/labor/teamMemberWages.yml @@ -0,0 +1,127 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/labor/team-member-wages + method: GET + auth: true + docs: Returns a paginated list of `TeamMemberWage` instances for a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.team_member_wages + source: + openapi: openapi/openapi.json + display-name: ListTeamMemberWages + request: + name: ListTeamMemberWagesRequest + query-parameters: + team_member_id: + type: optional> + docs: >- + Filter the returned wages to only those that are associated with + the + + specified team member. + limit: + type: optional> + docs: >- + The maximum number of `TeamMemberWage` results to return per page. + The number can range between + + 1 and 200. The default is 200. + cursor: + type: optional> + docs: A pointer to the next page of `EmployeeWage` results to fetch. + response: + docs: Success + type: root.ListTeamMemberWagesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + team_member_wages: + - id: pXS3qCv7BERPnEGedM4S8mhm + team_member_id: 33fJchumvVdJwxV0H6L9 + title: Manager + hourly_rate: + amount: 3250 + currency: USD + job_id: jxJNN6eCJsLrhg5UFJrDWDGE + tip_eligible: false + - id: rZduCkzYDUVL3ovh1sQgbue6 + team_member_id: 33fJchumvVdJwxV0H6L9 + title: Cook + hourly_rate: + amount: 2600 + currency: USD + job_id: gcbz15vKGnMKmaWJJ152kjim + tip_eligible: true + - id: FxLbs5KpPUHa8wyt5ctjubDX + team_member_id: 33fJchumvVdJwxV0H6L9 + title: Barista + hourly_rate: + amount: 1600 + currency: USD + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + tip_eligible: true + - id: vD1wCgijMDR3cX5TPnu7VXto + team_member_id: 33fJchumvVdJwxV0H6L9 + title: Cashier + hourly_rate: + amount: 1700 + currency: USD + job_id: N4YKVLzFj3oGtNocqoYHYpW3 + tip_eligible: true + cursor: 2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/labor/team-member-wages/{id} + method: GET + auth: true + docs: Returns a single `TeamMemberWage` specified by `id`. + source: + openapi: openapi/openapi.json + display-name: GetTeamMemberWage + request: + name: GetTeamMemberWagesRequest + path-parameters: + id: + type: string + docs: The UUID for the `TeamMemberWage` being retrieved. + response: + docs: Success + type: root.GetTeamMemberWageResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + response: + body: + team_member_wage: + id: pXS3qCv7BERPnEGedM4S8mhm + team_member_id: 33fJchumvVdJwxV0H6L9 + title: Manager + hourly_rate: + amount: 2000 + currency: USD + job_id: jxJNN6eCJsLrhg5UFJrDWDGE + tip_eligible: false + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor/workweekConfigs.yml b/.mock/definition/labor/workweekConfigs.yml new file mode 100644 index 000000000..a41b195eb --- /dev/null +++ b/.mock/definition/labor/workweekConfigs.yml @@ -0,0 +1,101 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/labor/workweek-configs + method: GET + auth: true + docs: Returns a list of `WorkweekConfig` instances for a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.workweek_configs + source: + openapi: openapi/openapi.json + display-name: ListWorkweekConfigs + request: + name: ListWorkweekConfigsRequest + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of `WorkweekConfigs` results to return per + page. + cursor: + type: optional> + docs: A pointer to the next page of `WorkweekConfig` results to fetch. + response: + docs: Success + type: root.ListWorkweekConfigsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + workweek_configs: + - id: FY4VCAQN700GM + start_of_week: MON + start_of_day_local_time: '10:00' + version: 11 + created_at: '2016-02-04T00:58:24Z' + updated_at: '2019-02-28T01:04:35Z' + cursor: 2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/labor/workweek-configs/{id} + method: PUT + auth: true + docs: Updates a `WorkweekConfig`. + source: + openapi: openapi/openapi.json + display-name: UpdateWorkweekConfig + request: + name: UpdateWorkweekConfigRequest + path-parameters: + id: + type: string + docs: The UUID for the `WorkweekConfig` object being updated. + body: + properties: + workweek_config: + type: root.WorkweekConfig + docs: The updated `WorkweekConfig` object. + content-type: application/json + response: + docs: Success + type: root.UpdateWorkweekConfigResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-07-16' + request: + workweek_config: + start_of_week: MON + start_of_day_local_time: '10:00' + version: 10 + response: + body: + workweek_config: + id: FY4VCAQN700GM + start_of_week: MON + start_of_day_local_time: '10:00' + version: 11 + created_at: '2016-02-04T00:58:24Z' + updated_at: '2019-02-28T01:04:35Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/locations.yml b/.mock/definition/locations.yml new file mode 100644 index 000000000..77c4ebf30 --- /dev/null +++ b/.mock/definition/locations.yml @@ -0,0 +1,796 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/locations + method: GET + auth: true + docs: >- + Provides details about all of the seller's + [locations](https://developer.squareup.com/docs/locations-api), + + including those with an inactive status. Locations are listed + alphabetically by `name`. + source: + openapi: openapi/openapi.json + display-name: ListLocations + response: + docs: Success + type: root.ListLocationsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + locations: + - id: 18YC4JDH91E1H + name: Grant Park + address: + address_line_1: 123 Main St + locality: San Francisco + administrative_district_level_1: CA + postal_code: '94114' + country: US + timezone: America/Los_Angeles + capabilities: + - CREDIT_CARD_PROCESSING + status: ACTIVE + created_at: '2016-09-19T17:33:12Z' + merchant_id: 3MYCJG5GVYQ8Q + country: US + language_code: en-US + currency: USD + phone_number: +1 650-354-7217 + business_name: Jet Fuel Coffee + type: PHYSICAL + website_url: website_url + business_email: business_email + description: description + twitter_username: twitter_username + instagram_username: instagram_username + facebook_url: facebook_url + logo_url: logo_url + pos_background_url: pos_background_url + mcc: mcc + full_format_logo_url: full_format_logo_url + - id: 3Z4V4WHQK64X9 + name: Midtown + address: + address_line_1: 1234 Peachtree St. NE + locality: Atlanta + administrative_district_level_1: GA + postal_code: '30309' + timezone: America/New_York + capabilities: + - CREDIT_CARD_PROCESSING + status: ACTIVE + created_at: '2022-02-19T17:58:25Z' + merchant_id: 3MYCJG5GVYQ8Q + country: US + language_code: en-US + currency: USD + phone_number: phone_number + business_name: Jet Fuel Coffee + type: PHYSICAL + website_url: website_url + business_email: business_email + description: Midtown Atlanta store + twitter_username: twitter_username + instagram_username: instagram_username + facebook_url: facebook_url + coordinates: + latitude: 33.7889 + longitude: -84.3841 + logo_url: logo_url + pos_background_url: pos_background_url + mcc: '7299' + full_format_logo_url: full_format_logo_url + create: + path: /v2/locations + method: POST + auth: true + docs: >- + Creates a [location](https://developer.squareup.com/docs/locations-api). + + Creating new locations allows for separate configuration of receipt + layouts, item prices, + + and sales reports. Developers can use locations to separate sales + activity through applications + + that integrate with Square from sales activity elsewhere in a seller's + account. + + Locations created programmatically with the Locations API last forever + and + + are visible to the seller for their own management. Therefore, ensure + that + + each location has a sensible and unique name. + source: + openapi: openapi/openapi.json + display-name: CreateLocation + request: + name: CreateLocationRequest + body: + properties: + location: + type: optional + docs: >- + The initial values of the location being created. The `name` + field is required and must be unique within a seller account. + + All other fields are optional, but any information you care + about for the location should be included. + + The remaining fields are automatically added based on the data + from the [main + location](https://developer.squareup.com/docs/locations-api#about-the-main-location). + content-type: application/json + response: + docs: Success + type: root.CreateLocationResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + location: + name: Midtown + address: + address_line_1: 1234 Peachtree St. NE + locality: Atlanta + administrative_district_level_1: GA + postal_code: '30309' + description: Midtown Atlanta store + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + location: + id: 3Z4V4WHQK64X9 + name: Midtown + address: + address_line_1: 1234 Peachtree St. NE + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: Atlanta + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: GA + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '30309' + country: ZZ + first_name: first_name + last_name: last_name + timezone: America/New_York + capabilities: + - CREDIT_CARD_PROCESSING + status: ACTIVE + created_at: '2022-02-19T17:58:25Z' + merchant_id: 3MYCJG5GVYQ8Q + country: US + language_code: en-US + currency: USD + phone_number: phone_number + business_name: Jet Fuel Coffee + type: PHYSICAL + website_url: website_url + business_hours: + periods: + - {} + business_email: business_email + description: Midtown Atlanta store + twitter_username: twitter_username + instagram_username: instagram_username + facebook_url: facebook_url + coordinates: + latitude: 33.7889 + longitude: -84.3841 + logo_url: logo_url + pos_background_url: pos_background_url + mcc: '7299' + full_format_logo_url: full_format_logo_url + tax_ids: + eu_vat: eu_vat + fr_siret: fr_siret + fr_naf: fr_naf + es_nif: es_nif + jp_qii: jp_qii + get: + path: /v2/locations/{location_id} + method: GET + auth: true + docs: >- + Retrieves details of a single location. Specify "main" + + as the location ID to retrieve details of the [main + location](https://developer.squareup.com/docs/locations-api#about-the-main-location). + source: + openapi: openapi/openapi.json + display-name: RetrieveLocation + request: + name: GetLocationsRequest + path-parameters: + location_id: + type: string + docs: |- + The ID of the location to retrieve. Specify the string + "main" to return the main location. + response: + docs: Success + type: root.GetLocationResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + location: + id: 18YC4JDH91E1H + name: Grant Park + address: + address_line_1: 123 Main St + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: San Francisco + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: CA + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '94114' + country: US + first_name: first_name + last_name: last_name + timezone: America/Los_Angeles + capabilities: + - CREDIT_CARD_PROCESSING + status: ACTIVE + created_at: '2016-09-19T17:33:12Z' + merchant_id: 3MYCJG5GVYQ8Q + country: US + language_code: en-US + currency: USD + phone_number: +1 650-354-7217 + business_name: Jet Fuel Coffee + type: PHYSICAL + website_url: website_url + business_hours: + periods: + - {} + business_email: business_email + description: description + twitter_username: twitter_username + instagram_username: instagram_username + facebook_url: facebook_url + coordinates: + latitude: 1.1 + longitude: 1.1 + logo_url: logo_url + pos_background_url: pos_background_url + mcc: mcc + full_format_logo_url: full_format_logo_url + tax_ids: + eu_vat: eu_vat + fr_siret: fr_siret + fr_naf: fr_naf + es_nif: es_nif + jp_qii: jp_qii + update: + path: /v2/locations/{location_id} + method: PUT + auth: true + docs: Updates a [location](https://developer.squareup.com/docs/locations-api). + source: + openapi: openapi/openapi.json + display-name: UpdateLocation + request: + name: UpdateLocationRequest + path-parameters: + location_id: + type: string + docs: The ID of the location to update. + body: + properties: + location: + type: optional + docs: The `Location` object with only the fields to update. + content-type: application/json + response: + docs: Success + type: root.UpdateLocationResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + request: + location: + business_hours: + periods: + - day_of_week: FRI + start_local_time: '07:00' + end_local_time: '18:00' + - day_of_week: SAT + start_local_time: '07:00' + end_local_time: '18:00' + - day_of_week: SUN + start_local_time: '09:00' + end_local_time: '15:00' + description: Midtown Atlanta store - Open weekends + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + location: + id: 3Z4V4WHQK64X9 + name: Midtown + address: + address_line_1: 1234 Peachtree St. NE + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: Atlanta + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: GA + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '30309' + country: ZZ + first_name: first_name + last_name: last_name + timezone: America/New_York + capabilities: + - CREDIT_CARD_PROCESSING + status: ACTIVE + created_at: '2022-02-19T17:58:25Z' + merchant_id: 3MYCJG5GVYQ8Q + country: US + language_code: en-US + currency: USD + phone_number: phone_number + business_name: Jet Fuel Coffee + type: PHYSICAL + website_url: website_url + business_hours: + periods: + - day_of_week: FRI + start_local_time: '07:00' + end_local_time: '18:00' + - day_of_week: SAT + start_local_time: '07:00' + end_local_time: '18:00' + - day_of_week: SUN + start_local_time: '09:00' + end_local_time: '15:00' + business_email: business_email + description: Midtown Atlanta store - Open weekends + twitter_username: twitter_username + instagram_username: instagram_username + facebook_url: facebook_url + coordinates: + latitude: 33.7889 + longitude: -84.3841 + logo_url: logo_url + pos_background_url: pos_background_url + mcc: '7299' + full_format_logo_url: full_format_logo_url + tax_ids: + eu_vat: eu_vat + fr_siret: fr_siret + fr_naf: fr_naf + es_nif: es_nif + jp_qii: jp_qii + checkouts: + path: /v2/locations/{location_id}/checkouts + method: POST + auth: true + docs: >- + Links a `checkoutId` to a `checkout_page_url` that customers are + + directed to in order to provide their payment information using a + + payment processing workflow hosted on connect.squareup.com. + + + + NOTE: The Checkout API has been updated with new features. + + For more information, see [Checkout API + highlights](https://developer.squareup.com/docs/checkout-api#checkout-api-highlights). + source: + openapi: openapi/openapi.json + display-name: CreateCheckout + request: + name: CreateCheckoutRequest + path-parameters: + location_id: + type: string + docs: The ID of the business location to associate the checkout with. + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this checkout among others you + have created. It can be + + any valid string but must be unique for every order sent to + Square Checkout for a given location ID. + + + The idempotency key is used to avoid processing the same order + more than once. If you are + + unsure whether a particular checkout was created successfully, + you can attempt it again with + + the same idempotency key and all the same other parameters + without worrying about creating duplicates. + + + You should use a random number/string generator native to the + language + + you are working in to generate strings for your idempotency + keys. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + maxLength: 192 + order: + type: root.CreateOrderRequest + docs: The order including line items to be checked out. + ask_for_shipping_address: + type: optional + docs: >- + If `true`, Square Checkout collects shipping information on your + behalf and stores + + that information with the transaction information in the Square + Seller Dashboard. + + + Default: `false`. + merchant_support_email: + type: optional + docs: >- + The email address to display on the Square Checkout confirmation + page + + and confirmation email that the buyer can use to contact the + seller. + + + If this value is not set, the confirmation page and email + display the + + primary email address associated with the seller's Square + account. + + + Default: none; only exists if explicitly set. + validation: + maxLength: 254 + pre_populate_buyer_email: + type: optional + docs: >- + If provided, the buyer's email is prepopulated on the checkout + page + + as an editable text field. + + + Default: none; only exists if explicitly set. + validation: + maxLength: 254 + pre_populate_shipping_address: + type: optional + docs: >- + If provided, the buyer's shipping information is prepopulated on + the + + checkout page as editable text fields. + + + Default: none; only exists if explicitly set. + redirect_url: + type: optional + docs: >- + The URL to redirect to after the checkout is completed with + `checkoutId`, + + `transactionId`, and `referenceId` appended as URL parameters. + For example, + + if the provided redirect URL is + `http://www.example.com/order-complete`, a + + successful transaction redirects the customer to: + + + `http://www.example.com/order-complete?checkoutId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx` + + + If you do not provide a redirect URL, Square Checkout displays + an order + + confirmation page on your behalf; however, it is strongly + recommended that + + you provide a redirect URL so you can verify the transaction + results and + + finalize the order through your existing/normal confirmation + workflow. + + + Default: none; only exists if explicitly set. + validation: + maxLength: 800 + additional_recipients: + type: optional> + docs: >- + The basic primitive of a multi-party transaction. The value is + optional. + + The transaction facilitated by you can be split from here. + + + If you provide this value, the `amount_money` value in your + `additional_recipients` field + + cannot be more than 90% of the `total_money` calculated by + Square for your order. + + The `location_id` must be a valid seller location where the + checkout is occurring. + + + This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth + permission. + + + This field is currently not supported in the Square Sandbox. + note: + type: optional + docs: |- + An optional note to associate with the `checkout` object. + + This value cannot exceed 60 characters. + validation: + maxLength: 60 + content-type: application/json + response: + docs: Success + type: root.CreateCheckoutResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 86ae1696-b1e3-4328-af6d-f1e04d947ad6 + order: + order: + location_id: location_id + reference_id: reference_id + customer_id: customer_id + line_items: + - name: Printed T Shirt + quantity: '2' + applied_taxes: + - tax_uid: 38ze1696-z1e3-5628-af6d-f1e04d947fg3 + applied_discounts: + - discount_uid: 56ae1696-z1e3-9328-af6d-f1e04d947gd4 + base_price_money: + amount: 1500 + currency: USD + - name: Slim Jeans + quantity: '1' + base_price_money: + amount: 2500 + currency: USD + - name: Woven Sweater + quantity: '3' + base_price_money: + amount: 3500 + currency: USD + taxes: + - uid: 38ze1696-z1e3-5628-af6d-f1e04d947fg3 + type: INCLUSIVE + percentage: '7.75' + scope: LINE_ITEM + discounts: + - uid: 56ae1696-z1e3-9328-af6d-f1e04d947gd4 + type: FIXED_AMOUNT + amount_money: + amount: 100 + currency: USD + scope: LINE_ITEM + idempotency_key: 12ae1696-z1e3-4328-af6d-f1e04d947gd4 + ask_for_shipping_address: true + merchant_support_email: merchant+support@website.com + pre_populate_buyer_email: example@email.com + pre_populate_shipping_address: + address_line_1: 1455 Market St. + address_line_2: Suite 600 + locality: San Francisco + administrative_district_level_1: CA + postal_code: '94103' + country: US + first_name: Jane + last_name: Doe + redirect_url: https://merchant.website.com/order-confirm + additional_recipients: + - location_id: 057P5VYJ4A5X1 + description: Application fees + amount_money: + amount: 60 + currency: USD + response: + body: + checkout: + id: CAISEHGimXh-C3RIT4og1a6u1qw + checkout_page_url: >- + https://connect.squareup.com/v2/checkout?c=CAISEHGimXh-C3RIT4og1a6u1qw&l=CYTKRM7R7JMV8 + ask_for_shipping_address: true + merchant_support_email: merchant+support@website.com + pre_populate_buyer_email: example@email.com + pre_populate_shipping_address: + address_line_1: 1455 Market St. + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: San Francisco + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: CA + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '94103' + country: US + first_name: Jane + last_name: Doe + redirect_url: https://merchant.website.com/order-confirm + order: + id: id + location_id: location_id + reference_id: reference_id + customer_id: customer_id + line_items: + - name: Printed T Shirt + quantity: '2' + applied_taxes: + - tax_uid: 38ze1696-z1e3-5628-af6d-f1e04d947fg3 + applied_money: + amount: 103 + currency: USD + applied_discounts: + - discount_uid: 56ae1696-z1e3-9328-af6d-f1e04d947gd4 + applied_money: + amount: 100 + currency: USD + base_price_money: + amount: 1500 + currency: USD + total_tax_money: + amount: 103 + currency: USD + total_discount_money: + amount: 100 + currency: USD + total_money: + amount: 1503 + currency: USD + - name: Slim Jeans + quantity: '1' + base_price_money: + amount: 2500 + currency: USD + total_money: + amount: 2500 + currency: USD + - name: Woven Sweater + quantity: '3' + base_price_money: + amount: 3500 + currency: USD + total_money: + amount: 10500 + currency: USD + taxes: + - uid: 38ze1696-z1e3-5628-af6d-f1e04d947fg3 + type: INCLUSIVE + percentage: '7.75' + scope: LINE_ITEM + discounts: + - uid: 56ae1696-z1e3-9328-af6d-f1e04d947gd4 + type: FIXED_AMOUNT + amount_money: + amount: 100 + currency: USD + applied_money: + amount: 100 + currency: USD + scope: LINE_ITEM + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + created_at: created_at + updated_at: updated_at + closed_at: closed_at + state: OPEN + version: 1 + total_money: + amount: 14503 + currency: USD + total_tax_money: + amount: 103 + currency: USD + total_discount_money: + amount: 100 + currency: USD + ticket_name: ticket_name + rewards: + - id: id + reward_tier_id: reward_tier_id + created_at: '2017-06-16T22:25:35Z' + additional_recipients: + - location_id: 057P5VYJ4A5X1 + description: Application fees + amount_money: + amount: 60 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/locations/customAttributeDefinitions.yml b/.mock/definition/locations/customAttributeDefinitions.yml new file mode 100644 index 000000000..a8562303b --- /dev/null +++ b/.mock/definition/locations/customAttributeDefinitions.yml @@ -0,0 +1,403 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/locations/custom-attribute-definitions + method: GET + auth: true + docs: >- + Lists the location-related [custom attribute + definitions](entity:CustomAttributeDefinition) that belong to a Square + seller account. + + When all response pages are retrieved, the results include all custom + attribute definitions + + that are visible to the requesting application, including those that are + created by other + + applications and set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attribute_definitions + source: + openapi: openapi/openapi.json + display-name: ListLocationCustomAttributeDefinitions + request: + name: ListCustomAttributeDefinitionsRequest + query-parameters: + visibility_filter: + type: optional> + docs: >- + Filters the `CustomAttributeDefinition` results by their + `visibility` values. + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListLocationCustomAttributeDefinitionsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute_definitions: + - key: phone-number + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.PhoneNumber + name: phone number + description: Location's phone number + visibility: VISIBILITY_READ_ONLY + version: 1 + updated_at: '2022-12-02T19:50:21.832Z' + created_at: '2022-12-02T19:50:21.832Z' + - key: bestseller + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Bestseller + description: Bestselling item at location + visibility: VISIBILITY_READ_WRITE_VALUES + version: 4 + updated_at: '2022-12-03T10:17:52.341Z' + created_at: '2022-12-02T19:06:36.559Z' + cursor: >- + ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/locations/custom-attribute-definitions + method: POST + auth: true + docs: >- + Creates a location-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + Use this endpoint to define a custom attribute that can be associated + with locations. + + A custom attribute definition specifies the `key`, `visibility`, + `schema`, and other properties + + for a custom attribute. After the definition is created, you can call + + [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) + or + + [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + + to set the custom attribute for locations. + source: + openapi: openapi/openapi.json + display-name: CreateLocationCustomAttributeDefinition + request: + name: CreateLocationCustomAttributeDefinitionRequest + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition to create. Note the following: + + - With the exception of the `Selection` data type, the `schema` + is specified as a simple URL to the JSON schema + + definition hosted on the Square CDN. For more information, + including supported values and constraints, see + + [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). + + - `name` is required unless `visibility` is set to + `VISIBILITY_HIDDEN`. + idempotency_key: + type: optional + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateLocationCustomAttributeDefinitionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + custom_attribute_definition: + key: bestseller + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Bestseller + description: Bestselling item at location + visibility: VISIBILITY_READ_WRITE_VALUES + response: + body: + custom_attribute_definition: + key: bestseller + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Bestseller + description: Bestselling item at location + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-12-02T19:06:36.559Z' + created_at: '2022-12-02T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/locations/custom-attribute-definitions/{key} + method: GET + auth: true + docs: >- + Retrieves a location-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + To retrieve a custom attribute definition created by another + application, the `visibility` + + setting must be `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveLocationCustomAttributeDefinition + request: + name: GetCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: >- + The key of the custom attribute definition to retrieve. If the + requesting application + + is not the definition owner, you must use the qualified key. + query-parameters: + version: + type: optional> + docs: >- + The current version of the custom attribute definition, which is + used for strongly consistent + + reads to guarantee that you receive the most up-to-date data. When + included in the request, + + Square returns the specified version or a higher version if one + exists. If the specified version + + is higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveLocationCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute_definition: + key: bestseller + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Bestseller + description: Bestselling item at location + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-12-02T19:06:36.559Z' + created_at: '2022-12-02T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/locations/custom-attribute-definitions/{key} + method: PUT + auth: true + docs: >- + Updates a location-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + Use this endpoint to update the following fields: `name`, `description`, + `visibility`, or the + + `schema` for a `Selection` data type. + + Only the definition owner can update a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: UpdateLocationCustomAttributeDefinition + request: + name: UpdateLocationCustomAttributeDefinitionRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to update. + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition that contains the fields to + update. This endpoint + + supports sparse updates, so only new or changed fields need to + be included in the request. + + Only the following fields can be updated: + + - `name` + + - `description` + + - `visibility` + + - `schema` for a `Selection` data type. Only changes to the + named options or the maximum number of allowed + + selections are supported. + + + For more information, see + + [Update a location custom attribute + definition](https://developer.squareup.com/docs/location-custom-attributes-api/custom-attribute-definitions#update-custom-attribute-definition). + + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, specify the current version of the custom attribute + definition. + + If this is not important for your application, `version` can be + set to -1. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateLocationCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + request: + custom_attribute_definition: + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + response: + body: + custom_attribute_definition: + key: bestseller + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Bestseller + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 2 + updated_at: '2022-12-02T19:34:10.181Z' + created_at: '2022-12-02T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/locations/custom-attribute-definitions/{key} + method: DELETE + auth: true + docs: >- + Deletes a location-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + Deleting a custom attribute definition also deletes the corresponding + custom attribute from + + all locations. + + Only the definition owner can delete a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: DeleteLocationCustomAttributeDefinition + request: + name: DeleteCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to delete. + response: + docs: Success + type: root.DeleteLocationCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/locations/customAttributes.yml b/.mock/definition/locations/customAttributes.yml new file mode 100644 index 000000000..2436421e8 --- /dev/null +++ b/.mock/definition/locations/customAttributes.yml @@ -0,0 +1,557 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + batchDelete: + path: /v2/locations/custom-attributes/bulk-delete + method: POST + auth: true + docs: >- + Deletes [custom attributes](entity:CustomAttribute) for locations as a + bulk operation. + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkDeleteLocationCustomAttributes + request: + name: BulkDeleteLocationCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + The data used to update the `CustomAttribute` objects. + + The keys must be unique and are used to map to the corresponding + response. + content-type: application/json + response: + docs: Success + type: root.BulkDeleteLocationCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + values: + id1: + key: bestseller + id2: + key: bestseller + id3: + key: phone-number + response: + body: + values: + id1: + location_id: L0TBCBTB7P8RQ + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + location_id: L9XMD04V3STJX + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id3: + location_id: L0TBCBTB7P8RQ + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchUpsert: + path: /v2/locations/custom-attributes/bulk-upsert + method: POST + auth: true + docs: >- + Creates or updates [custom attributes](entity:CustomAttribute) for + locations as a bulk operation. + + Use this endpoint to set the value of one or more custom attributes for + one or more locations. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which is + + created using the + [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) + endpoint. + + This `BulkUpsertLocationCustomAttributes` endpoint accepts a map of 1 to + 25 individual upsert + + requests and returns a map of individual upsert responses. Each upsert + request has a unique ID + + and provides a location ID and custom attribute. Each upsert response is + returned with the ID + + of the corresponding request. + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkUpsertLocationCustomAttributes + request: + name: BulkUpsertLocationCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + A map containing 1 to 25 individual upsert requests. For each + request, provide an + + arbitrary ID that is unique for this + `BulkUpsertLocationCustomAttributes` request and the + + information needed to create or update a custom attribute. + content-type: application/json + response: + docs: Success + type: root.BulkUpsertLocationCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + values: + id1: + location_id: L0TBCBTB7P8RQ + custom_attribute: + key: bestseller + value: hot cocoa + id2: + location_id: L9XMD04V3STJX + custom_attribute: + key: bestseller + value: berry smoothie + id3: + location_id: L0TBCBTB7P8RQ + custom_attribute: + key: phone-number + value: '+12223334444' + response: + body: + values: + id1: + location_id: L0TBCBTB7P8RQ + custom_attribute: + key: bestseller + value: hot cocoa + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2023-01-09T19:21:04.551Z' + created_at: '2023-01-09T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + location_id: L9XMD04V3STJX + custom_attribute: + key: bestseller + value: berry smoothie + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2023-01-09T19:21:04.551Z' + created_at: '2023-01-09T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id3: + location_id: L0TBCBTB7P8RQ + custom_attribute: + key: phone-number + value: '+12239903892' + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2023-01-09T19:21:04.563Z' + created_at: '2023-01-09T19:04:57.985Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + list: + path: /v2/locations/{location_id}/custom-attributes + method: GET + auth: true + docs: >- + Lists the [custom attributes](entity:CustomAttribute) associated with a + location. + + You can use the `with_definitions` query parameter to also retrieve + custom attribute definitions + + in the same call. + + When all response pages are retrieved, the results include all custom + attributes that are + + visible to the requesting application, including those that are owned by + other applications + + and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attributes + source: + openapi: openapi/openapi.json + display-name: ListLocationCustomAttributes + request: + name: ListCustomAttributesRequest + path-parameters: + location_id: + type: string + docs: The ID of the target [location](entity:Location). + query-parameters: + visibility_filter: + type: optional> + docs: >- + Filters the `CustomAttributeDefinition` results by their + `visibility` values. + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. For more + + information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + with_definitions: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + response: + docs: Success + type: root.ListLocationCustomAttributesResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attributes: + - key: phone-number + value: '+12223334444' + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-12-12T18:13:03.745Z' + created_at: '2022-12-12T18:13:03.745Z' + - key: bestseller + value: hot cocoa + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-12-12T19:27:57.975Z' + created_at: '2022-12-12T19:27:57.975Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/locations/{location_id}/custom-attributes/{key} + method: GET + auth: true + docs: >- + Retrieves a [custom attribute](entity:CustomAttribute) associated with a + location. + + You can use the `with_definition` query parameter to also retrieve the + custom attribute definition + + in the same call. + + To retrieve a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveLocationCustomAttribute + request: + name: GetCustomAttributesRequest + path-parameters: + location_id: + type: string + docs: The ID of the target [location](entity:Location). + key: + type: string + docs: >- + The key of the custom attribute to retrieve. This key must match + the `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + query-parameters: + with_definition: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of + + the custom attribute. Set this parameter to `true` to get the name + and description of the custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + version: + type: optional> + docs: >- + The current version of the custom attribute, which is used for + strongly consistent reads to + + guarantee that you receive the most up-to-date data. When included + in the request, Square + + returns the specified version or a higher version if one exists. + If the specified version is + + higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveLocationCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute: + key: bestseller + value: hot cocoa + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2023-01-09T19:21:04.551Z' + created_at: '2023-01-09T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + upsert: + path: /v2/locations/{location_id}/custom-attributes/{key} + method: POST + auth: true + docs: >- + Creates or updates a [custom attribute](entity:CustomAttribute) for a + location. + + Use this endpoint to set the value of a custom attribute for a specified + location. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which + + is created using the + [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) + endpoint. + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: UpsertLocationCustomAttribute + request: + name: UpsertLocationCustomAttributeRequest + path-parameters: + location_id: + type: string + docs: The ID of the target [location](entity:Location). + key: + type: string + docs: >- + The key of the custom attribute to create or update. This key must + match the `key` of a + + custom attribute definition in the Square seller account. If the + requesting application is not + + the definition owner, you must use the qualified key. + body: + properties: + custom_attribute: + type: root.CustomAttribute + docs: >- + The custom attribute to create or update, with the following + fields: + + - `value`. This value must conform to the `schema` specified by + the definition. + + For more information, see [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for an update operation, include the current version of + the custom attribute. + + If this is not important for your application, version can be + set to -1. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpsertLocationCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + key: key + headers: + Square-Version: '2025-07-16' + request: + custom_attribute: + value: hot cocoa + response: + body: + custom_attribute: + key: bestseller + value: hot cocoa + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2023-01-09T19:21:04.551Z' + created_at: '2023-01-09T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/locations/{location_id}/custom-attributes/{key} + method: DELETE + auth: true + docs: >- + Deletes a [custom attribute](entity:CustomAttribute) associated with a + location. + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: DeleteLocationCustomAttribute + request: + name: DeleteCustomAttributesRequest + path-parameters: + location_id: + type: string + docs: The ID of the target [location](entity:Location). + key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match the + `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + response: + docs: Success + type: root.DeleteLocationCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/locations/transactions.yml b/.mock/definition/locations/transactions.yml new file mode 100644 index 000000000..35d612baf --- /dev/null +++ b/.mock/definition/locations/transactions.yml @@ -0,0 +1,331 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/locations/{location_id}/transactions + method: GET + auth: true + docs: >- + Lists transactions for a particular location. + + + Transactions include payment information from sales and exchanges and + refund + + information from returns and exchanges. + + + Max results per + [page](https://developer.squareup.com/docs/working-with-apis/pagination): + 50 + source: + openapi: openapi/openapi.json + display-name: ListTransactions + request: + name: ListTransactionsRequest + path-parameters: + location_id: + type: string + docs: The ID of the location to list transactions for. + query-parameters: + begin_time: + type: optional> + docs: >- + The beginning of the requested reporting period, in RFC 3339 + format. + + + See [Date + ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) + for details on date inclusivity/exclusivity. + + + Default value: The current time minus one year. + end_time: + type: optional> + docs: >- + The end of the requested reporting period, in RFC 3339 format. + + + See [Date + ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) + for details on date inclusivity/exclusivity. + + + Default value: The current time. + sort_order: + type: optional> + docs: |- + The order in which results are listed in the response (`ASC` for + oldest first, `DESC` for newest first). + + Default value: `DESC` + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for your original + query. + + + See [Paginating + results](https://developer.squareup.com/docs/working-with-apis/pagination) + for more information. + response: + docs: Success + type: root.ListTransactionsResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + transactions: + - id: KnL67ZIwXCPtzOrqj0HrkxMF + location_id: 18YC4JDH91E1H + created_at: '2016-01-20T22:57:56Z' + tenders: + - id: MtZRYYdDrYNQbOvV7nbuBvMF + location_id: 18YC4JDH91E1H + transaction_id: KnL67ZIwXCPtzOrqj0HrkxMF + created_at: '2016-01-20T22:57:56Z' + note: some optional note + amount_money: + amount: 5000 + currency: USD + processing_fee_money: + amount: 138 + currency: USD + type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + entry_method: KEYED + additional_recipients: + - location_id: 057P5VYJ4A5X1 + description: Application fees + amount_money: + amount: 20 + currency: USD + refunds: + - id: 7a5RcVI0CxbOcJ2wMOkE + location_id: 18YC4JDH91E1H + transaction_id: KnL67ZIwXCPtzOrqj0HrkxMF + tender_id: MtZRYYdDrYNQbOvV7nbuBvMF + created_at: '2016-01-20T22:59:20Z' + reason: some reason why + amount_money: + amount: 5000 + currency: USD + status: APPROVED + processing_fee_money: + amount: 138 + currency: USD + additional_recipients: + - location_id: 057P5VYJ4A5X1 + description: Application fees + amount_money: + amount: 100 + currency: USD + reference_id: some optional reference id + product: EXTERNAL_API + client_id: client_id + order_id: order_id + cursor: cursor + get: + path: /v2/locations/{location_id}/transactions/{transaction_id} + method: GET + auth: true + docs: Retrieves details for a single transaction. + source: + openapi: openapi/openapi.json + display-name: RetrieveTransaction + request: + name: GetTransactionsRequest + path-parameters: + location_id: + type: string + docs: The ID of the transaction's associated location. + transaction_id: + type: string + docs: The ID of the transaction to retrieve. + response: + docs: Success + type: root.GetTransactionResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + transaction_id: transaction_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + transaction: + id: KnL67ZIwXCPtzOrqj0HrkxMF + location_id: 18YC4JDH91E1H + created_at: '2016-03-10T22:57:56Z' + tenders: + - id: MtZRYYdDrYNQbOvV7nbuBvMF + location_id: 18YC4JDH91E1H + transaction_id: KnL67ZIwXCPtzOrqj0HrkxMF + created_at: '2016-03-10T22:57:56Z' + note: some optional note + amount_money: + amount: 5000 + currency: USD + processing_fee_money: + amount: 138 + currency: USD + type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + entry_method: KEYED + additional_recipients: + - location_id: 057P5VYJ4A5X1 + description: Application fees + amount_money: + amount: 20 + currency: USD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + reference_id: some optional reference id + product: EXTERNAL_API + client_id: client_id + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + order_id: order_id + capture: + path: /v2/locations/{location_id}/transactions/{transaction_id}/capture + method: POST + auth: true + docs: >- + Captures a transaction that was created with the + [Charge](api-endpoint:Transactions-Charge) + + endpoint with a `delay_capture` value of `true`. + + + + See [Delayed capture + transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) + + for more information. + source: + openapi: openapi/openapi.json + display-name: CaptureTransaction + request: + name: CaptureTransactionsRequest + path-parameters: + location_id: + type: string + docs: '' + transaction_id: + type: string + docs: '' + response: + docs: Success + type: root.CaptureTransactionResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + transaction_id: transaction_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + void: + path: /v2/locations/{location_id}/transactions/{transaction_id}/void + method: POST + auth: true + docs: >- + Cancels a transaction that was created with the + [Charge](api-endpoint:Transactions-Charge) + + endpoint with a `delay_capture` value of `true`. + + + + See [Delayed capture + transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) + + for more information. + source: + openapi: openapi/openapi.json + display-name: VoidTransaction + request: + name: VoidTransactionsRequest + path-parameters: + location_id: + type: string + docs: '' + transaction_id: + type: string + docs: '' + response: + docs: Success + type: root.VoidTransactionResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + transaction_id: transaction_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/loyalty.yml b/.mock/definition/loyalty.yml new file mode 100644 index 000000000..1e81d71c6 --- /dev/null +++ b/.mock/definition/loyalty.yml @@ -0,0 +1,137 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + searchEvents: + path: /v2/loyalty/events/search + method: POST + auth: true + docs: >- + Searches for loyalty events. + + + A Square loyalty program maintains a ledger of events that occur during + the lifetime of a + + buyer's loyalty account. Each change in the point balance + + (for example, points earned, points redeemed, and points expired) is + + recorded in the ledger. Using this endpoint, you can search the ledger + for events. + + + Search results are sorted by `created_at` in descending order. + source: + openapi: openapi/openapi.json + display-name: SearchLoyaltyEvents + request: + name: SearchLoyaltyEventsRequest + body: + properties: + query: + type: optional + docs: >- + A set of one or more predefined query filters to apply when + + searching for loyalty events. The endpoint performs a logical + AND to + + evaluate multiple filters and performs a logical OR on arrays + + that specifies multiple field values. + limit: + type: optional + docs: |- + The maximum number of results to include in the response. + The last page might contain fewer events. + The default is 30 events. + validation: + min: 1 + max: 30 + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this to retrieve the next set of results for your + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchLoyaltyEventsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + order_filter: + order_id: PyATxhYLfsMqpVkcKJITPydgEYfZY + limit: 30 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + events: + - id: c27c8465-806e-36f2-b4b3-71f5887b5ba8 + type: ACCUMULATE_POINTS + created_at: '2020-05-08T22:01:30Z' + accumulate_points: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + points: 5 + order_id: PyATxhYLfsMqpVkcKJITPydgEYfZY + adjust_points: + points: 1 + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: P034NEENMD09F + source: LOYALTY_API + expire_points: + points: 1 + other_event: + points: 1 + - id: e4a5cbc3-a4d0-3779-98e9-e578885d9430 + type: REDEEM_REWARD + created_at: '2020-05-08T22:01:15Z' + redeem_reward: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + reward_id: d03f79f4-815f-3500-b851-cc1e68a457f9 + order_id: PyATxhYLfsMqpVkcKJITPydgEYfZY + adjust_points: + points: 1 + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: P034NEENMD09F + source: LOYALTY_API + expire_points: + points: 1 + other_event: + points: 1 + - id: 5e127479-0b03-3671-ab1e-15faea8b7188 + type: CREATE_REWARD + created_at: '2020-05-08T22:00:44Z' + create_reward: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + reward_id: d03f79f4-815f-3500-b851-cc1e68a457f9 + points: -10 + adjust_points: + points: 1 + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: location_id + source: LOYALTY_API + expire_points: + points: 1 + other_event: + points: 1 + cursor: cursor + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/loyalty/accounts.yml b/.mock/definition/loyalty/accounts.yml new file mode 100644 index 000000000..c52772f08 --- /dev/null +++ b/.mock/definition/loyalty/accounts.yml @@ -0,0 +1,472 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/loyalty/accounts + method: POST + auth: true + docs: >- + Creates a loyalty account. To create a loyalty account, you must provide + the `program_id` and a `mapping` with the `phone_number` of the buyer. + source: + openapi: openapi/openapi.json + display-name: CreateLoyaltyAccount + request: + name: CreateLoyaltyAccountRequest + body: + properties: + loyalty_account: + type: root.LoyaltyAccount + docs: The loyalty account to create. + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreateLoyaltyAccount` + request. + + Keys can be any valid string, but must be unique for every + request. + validation: + minLength: 1 + maxLength: 128 + content-type: application/json + response: + docs: Success + type: root.CreateLoyaltyAccountResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + loyalty_account: + program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + mapping: + phone_number: '+14155551234' + idempotency_key: ec78c477-b1c3-4899-a209-a4e71337c996 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_account: + id: 79b807d2-d786-46a9-933b-918028d7a8c5 + program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + balance: 0 + lifetime_points: 0 + customer_id: QPTXM8PQNX3Q726ZYHPMNP46XC + enrolled_at: enrolled_at + created_at: '2020-05-08T21:44:32Z' + updated_at: '2020-05-08T21:44:32Z' + mapping: + id: 66aaab3f-da99-49ed-8b19-b87f851c844f + created_at: '2020-05-08T21:44:32Z' + phone_number: '+14155551234' + expiring_point_deadlines: + - points: 1 + expires_at: expires_at + search: + path: /v2/loyalty/accounts/search + method: POST + auth: true + docs: >- + Searches for loyalty accounts in a loyalty program. + + + You can search for a loyalty account using the phone number or customer + ID associated with the account. To return all loyalty accounts, specify + an empty `query` object or omit it entirely. + + + Search results are sorted by `created_at` in ascending order. + source: + openapi: openapi/openapi.json + display-name: SearchLoyaltyAccounts + request: + name: SearchLoyaltyAccountsRequest + body: + properties: + query: + type: optional + docs: The search criteria for the request. + limit: + type: optional + docs: >- + The maximum number of results to include in the response. The + default value is 30. + validation: + min: 1 + max: 200 + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to + + this endpoint. Provide this to retrieve the next set of + + results for the original query. + + + For more information, + + see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchLoyaltyAccountsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + mappings: + - phone_number: '+14155551234' + limit: 10 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_accounts: + - id: 79b807d2-d786-46a9-933b-918028d7a8c5 + program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + balance: 10 + lifetime_points: 20 + customer_id: Q8002FAM9V1EZ0ADB2T5609X6NET1H0 + enrolled_at: enrolled_at + created_at: '2020-05-08T21:44:32Z' + updated_at: '2020-05-08T21:44:32Z' + mapping: + id: 66aaab3f-da99-49ed-8b19-b87f851c844f + created_at: '2020-05-08T21:44:32Z' + phone_number: '+14155551234' + expiring_point_deadlines: + - points: 1 + expires_at: expires_at + cursor: cursor + get: + path: /v2/loyalty/accounts/{account_id} + method: GET + auth: true + docs: Retrieves a loyalty account. + source: + openapi: openapi/openapi.json + display-name: RetrieveLoyaltyAccount + request: + name: GetAccountsRequest + path-parameters: + account_id: + type: string + docs: >- + The ID of the [loyalty account](entity:LoyaltyAccount) to + retrieve. + response: + docs: Success + type: root.GetLoyaltyAccountResponse + status-code: 200 + examples: + - path-parameters: + account_id: account_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_account: + id: 79b807d2-d786-46a9-933b-918028d7a8c5 + program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + balance: 10 + lifetime_points: 20 + customer_id: Q8002FAM9V1EZ0ADB2T5609X6NET1H0 + enrolled_at: enrolled_at + created_at: '2020-05-08T21:44:32Z' + updated_at: '2020-05-08T21:44:32Z' + mapping: + id: 66aaab3f-da99-49ed-8b19-b87f851c844f + created_at: '2020-05-08T21:44:32Z' + phone_number: '+14155551234' + expiring_point_deadlines: + - points: 1 + expires_at: expires_at + accumulatePoints: + path: /v2/loyalty/accounts/{account_id}/accumulate + method: POST + auth: true + docs: >- + Adds points earned from a purchase to a [loyalty + account](entity:LoyaltyAccount). + + + - If you are using the Orders API to manage orders, provide the + `order_id`. Square reads the order + + to compute the points earned from both the base loyalty program and an + associated + + [loyalty promotion](entity:LoyaltyPromotion). For purchases that qualify + for multiple accrual + + rules, Square computes points based on the accrual rule that grants the + most points. + + For purchases that qualify for multiple promotions, Square computes + points based on the most + + recently created promotion. A purchase must first qualify for program + points to be eligible for promotion points. + + + - If you are not using the Orders API to manage orders, provide `points` + with the number of points to add. + + You must first perform a client-side computation of the points earned + from the loyalty program and + + loyalty promotion. For spend-based and visit-based programs, you can + call + [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) + + to compute the points earned from the base loyalty program. For + information about computing points earned from a loyalty promotion, see + + [Calculating promotion + points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). + source: + openapi: openapi/openapi.json + display-name: AccumulateLoyaltyPoints + request: + name: AccumulateLoyaltyPointsRequest + path-parameters: + account_id: + type: string + docs: The ID of the target [loyalty account](entity:LoyaltyAccount). + body: + properties: + accumulate_points: + type: root.LoyaltyEventAccumulatePoints + docs: >- + The points to add to the account. + + If you are using the Orders API to manage orders, specify the + order ID. + + Otherwise, specify the points to add. + idempotency_key: + type: string + docs: >- + A unique string that identifies the `AccumulateLoyaltyPoints` + request. + + Keys can be any valid string but must be unique for every + request. + validation: + minLength: 1 + maxLength: 128 + location_id: + type: string + docs: The [location](entity:Location) where the purchase was made. + content-type: application/json + response: + docs: Success + type: root.AccumulateLoyaltyPointsResponse + status-code: 200 + examples: + - path-parameters: + account_id: account_id + headers: + Square-Version: '2025-07-16' + request: + accumulate_points: + order_id: RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY + idempotency_key: 58b90739-c3e8-4b11-85f7-e636d48d72cb + location_id: P034NEENMD09F + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + event: + id: id + type: ACCUMULATE_POINTS + created_at: created_at + accumulate_points: + loyalty_program_id: loyalty_program_id + points: 1 + order_id: order_id + create_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + redeem_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + order_id: order_id + delete_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + adjust_points: + loyalty_program_id: loyalty_program_id + points: 1 + reason: reason + loyalty_account_id: loyalty_account_id + location_id: location_id + source: SQUARE + expire_points: + loyalty_program_id: loyalty_program_id + points: 1 + other_event: + loyalty_program_id: loyalty_program_id + points: 1 + accumulate_promotion_points: + loyalty_program_id: loyalty_program_id + loyalty_promotion_id: loyalty_promotion_id + points: 1 + order_id: order_id + events: + - id: ee46aafd-1af6-3695-a385-276e2ef0be26 + type: ACCUMULATE_POINTS + created_at: '2020-05-08T21:41:12Z' + accumulate_points: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + points: 6 + order_id: RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY + adjust_points: + points: 1 + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: P034NEENMD09F + source: LOYALTY_API + expire_points: + points: 1 + other_event: + points: 1 + adjust: + path: /v2/loyalty/accounts/{account_id}/adjust + method: POST + auth: true + docs: >- + Adds points to or subtracts points from a buyer's account. + + + Use this endpoint only when you need to manually adjust points. + Otherwise, in your application flow, you call + + [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) + + to add points when a buyer pays for the purchase. + source: + openapi: openapi/openapi.json + display-name: AdjustLoyaltyPoints + request: + name: AdjustLoyaltyPointsRequest + path-parameters: + account_id: + type: string + docs: The ID of the target [loyalty account](entity:LoyaltyAccount). + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this `AdjustLoyaltyPoints` + request. + + Keys can be any valid string, but must be unique for every + request. + validation: + minLength: 1 + maxLength: 128 + adjust_points: + type: root.LoyaltyEventAdjustPoints + docs: >- + The points to add or subtract and the reason for the adjustment. + To add points, specify a positive integer. + + To subtract points, specify a negative integer. + allow_negative_balance: + type: optional> + docs: >- + Indicates whether to allow a negative adjustment to result in a + negative balance. If `true`, a negative + + balance is allowed when subtracting points. If `false`, Square + returns a `BAD_REQUEST` error when subtracting + + the specified number of points would result in a negative + balance. The default value is `false`. + content-type: application/json + response: + docs: Success + type: root.AdjustLoyaltyPointsResponse + status-code: 200 + examples: + - path-parameters: + account_id: account_id + headers: + Square-Version: '2025-07-16' + request: + idempotency_key: bc29a517-3dc9-450e-aa76-fae39ee849d1 + adjust_points: + points: 10 + reason: Complimentary points + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + event: + id: 613a6fca-8d67-39d0-bad2-3b4bc45c8637 + type: ADJUST_POINTS + created_at: '2020-05-08T21:42:32Z' + accumulate_points: + loyalty_program_id: loyalty_program_id + points: 1 + order_id: order_id + create_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + redeem_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + order_id: order_id + delete_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + adjust_points: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + points: 10 + reason: Complimentary points + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: location_id + source: LOYALTY_API + expire_points: + loyalty_program_id: loyalty_program_id + points: 1 + other_event: + loyalty_program_id: loyalty_program_id + points: 1 + accumulate_promotion_points: + loyalty_program_id: loyalty_program_id + loyalty_promotion_id: loyalty_promotion_id + points: 1 + order_id: order_id + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/loyalty/programs.yml b/.mock/definition/loyalty/programs.yml new file mode 100644 index 000000000..741a44a56 --- /dev/null +++ b/.mock/definition/loyalty/programs.yml @@ -0,0 +1,274 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/loyalty/programs + method: GET + auth: true + docs: >- + Returns a list of loyalty programs in the seller's account. + + Loyalty programs define how buyers can earn points and redeem points for + rewards. Square sellers can have only one loyalty program, which is + created and managed from the Seller Dashboard. For more information, see + [Loyalty Program + Overview](https://developer.squareup.com/docs/loyalty/overview). + + + + Replaced with + [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) + when used with the keyword `main`. + source: + openapi: openapi/openapi.json + display-name: ListLoyaltyPrograms + response: + docs: Success + type: root.ListLoyaltyProgramsResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + programs: + - id: d619f755-2d17-41f3-990d-c04ecedd64dd + status: ACTIVE + reward_tiers: + - id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + name: 10% off entire sale + created_at: '2020-04-20T16:55:11Z' + pricing_rule_reference: + object_id: 74C4JSHESNLTB2A7ITO5HO6F + catalog_version: 1000000 + expiration_policy: + expiration_duration: expiration_duration + terminology: + one: Point + other: Points + location_ids: + - P034NEENMD09F + created_at: '2020-04-20T16:55:11Z' + updated_at: '2020-05-01T02:00:02Z' + accrual_rules: + - accrual_type: SPEND + points: 1 + spend_data: + amount_money: + amount: 100 + currency: USD + excluded_category_ids: + - 7ZERJKO5PVYXCVUHV2JCZ2UG + - FQKAOJE5C4FIMF5A2URMLW6V + excluded_item_variation_ids: + - CBZXBUVVTYUBZGQO44RHMR6B + - EDILT24Z2NISEXDKGY6HP7XV + tax_mode: BEFORE_TAX + get: + path: /v2/loyalty/programs/{program_id} + method: GET + auth: true + docs: >- + Retrieves the loyalty program in a seller's account, specified by the + program ID or the keyword `main`. + + + Loyalty programs define how buyers can earn points and redeem points for + rewards. Square sellers can have only one loyalty program, which is + created and managed from the Seller Dashboard. For more information, see + [Loyalty Program + Overview](https://developer.squareup.com/docs/loyalty/overview). + source: + openapi: openapi/openapi.json + display-name: RetrieveLoyaltyProgram + request: + name: GetProgramsRequest + path-parameters: + program_id: + type: string + docs: >- + The ID of the loyalty program or the keyword `main`. Either value + can be used to retrieve the single loyalty program that belongs to + the seller. + response: + docs: Success + type: root.GetLoyaltyProgramResponse + status-code: 200 + examples: + - path-parameters: + program_id: program_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + program: + id: d619f755-2d17-41f3-990d-c04ecedd64dd + status: ACTIVE + reward_tiers: + - id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + name: 10% off entire sale + created_at: '2020-04-20T16:55:11Z' + pricing_rule_reference: + object_id: 74C4JSHESNLTB2A7ITO5HO6F + catalog_version: 1000000 + expiration_policy: + expiration_duration: expiration_duration + terminology: + one: Point + other: Points + location_ids: + - P034NEENMD09F + created_at: '2020-04-20T16:55:11Z' + updated_at: '2020-05-01T02:00:02Z' + accrual_rules: + - accrual_type: SPEND + points: 1 + spend_data: + amount_money: + amount: 100 + currency: USD + excluded_category_ids: + - 7ZERJKO5PVYXCVUHV2JCZ2UG + - FQKAOJE5C4FIMF5A2URMLW6V + excluded_item_variation_ids: + - CBZXBUVVTYUBZGQO44RHMR6B + - EDILT24Z2NISEXDKGY6HP7XV + tax_mode: BEFORE_TAX + calculate: + path: /v2/loyalty/programs/{program_id}/calculate + method: POST + auth: true + docs: >- + Calculates the number of points a buyer can earn from a purchase. + Applications might call this endpoint + + to display the points to the buyer. + + + - If you are using the Orders API to manage orders, provide the + `order_id` and (optional) `loyalty_account_id`. + + Square reads the order to compute the points earned from the base + loyalty program and an associated + + [loyalty promotion](entity:LoyaltyPromotion). + + + - If you are not using the Orders API to manage orders, provide + `transaction_amount_money` with the + + purchase amount. Square uses this amount to calculate the points earned + from the base loyalty program, + + but not points earned from a loyalty promotion. For spend-based and + visit-based programs, the `tax_mode` + + setting of the accrual rule indicates how taxes should be treated for + loyalty points accrual. + + If the purchase qualifies for program points, call + + [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) and + perform a client-side computation + + to calculate whether the purchase also qualifies for promotion points. + For more information, see + + [Calculating promotion + points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). + source: + openapi: openapi/openapi.json + display-name: CalculateLoyaltyPoints + request: + name: CalculateLoyaltyPointsRequest + path-parameters: + program_id: + type: string + docs: >- + The ID of the [loyalty program](entity:LoyaltyProgram), which + defines the rules for accruing points. + body: + properties: + order_id: + type: optional> + docs: >- + The [order](entity:Order) ID for which to calculate the points. + + Specify this field if your application uses the Orders API to + process orders. + + Otherwise, specify the `transaction_amount_money`. + transaction_amount_money: + type: optional + docs: >- + The purchase amount for which to calculate the points. + + Specify this field if your application does not use the Orders + API to process orders. + + Otherwise, specify the `order_id`. + loyalty_account_id: + type: optional> + docs: >- + The ID of the target [loyalty account](entity:LoyaltyAccount). + Optionally specify this field + + if your application uses the Orders API to process orders. + + + If specified, the `promotion_points` field in the response shows + the number of points the buyer would + + earn from the purchase. In this case, Square uses the account ID + to determine whether the promotion's + + `trigger_limit` (the maximum number of times that a buyer can + trigger the promotion) has been reached. + + If not specified, the `promotion_points` field shows the number + of points the purchase qualifies + + for regardless of the trigger limit. + validation: + minLength: 1 + maxLength: 36 + content-type: application/json + response: + docs: Success + type: root.CalculateLoyaltyPointsResponse + status-code: 200 + examples: + - path-parameters: + program_id: program_id + headers: + Square-Version: '2025-07-16' + request: + order_id: RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY + loyalty_account_id: 79b807d2-d786-46a9-933b-918028d7a8c5 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + points: 6 + promotion_points: 12 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/loyalty/programs/promotions.yml b/.mock/definition/loyalty/programs/promotions.yml new file mode 100644 index 000000000..9e478716a --- /dev/null +++ b/.mock/definition/loyalty/programs/promotions.yml @@ -0,0 +1,464 @@ +imports: + root: ../../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/loyalty/programs/{program_id}/promotions + method: GET + auth: true + docs: >- + Lists the loyalty promotions associated with a [loyalty + program](entity:LoyaltyProgram). + + Results are sorted by the `created_at` date in descending order (newest + to oldest). + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.loyalty_promotions + source: + openapi: openapi/openapi.json + display-name: ListLoyaltyPromotions + request: + name: ListPromotionsRequest + path-parameters: + program_id: + type: string + docs: >- + The ID of the base [loyalty program](entity:LoyaltyProgram). To + get the program ID, + + call + [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) + using the `main` keyword. + query-parameters: + status: + type: optional> + docs: >- + The status to filter the results by. If a status is provided, only + loyalty promotions + + with the specified status are returned. Otherwise, all loyalty + promotions associated with + + the loyalty program are returned. + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. + + The minimum value is 1 and the maximum value is 30. The default + value is 30. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListLoyaltyPromotionsResponse + status-code: 200 + examples: + - path-parameters: + program_id: program_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_promotions: + - id: loypromo_f0f9b849-725e-378d-b810-511237e07b67 + name: Tuesday Happy Hour Promo + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + points_multiplier: 3 + multiplier: '3.000' + available_time: + start_date: '2022-08-16' + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220816T160000 + DURATION:PT2H + RRULE:FREQ=WEEKLY;BYDAY=TU + END:VEVENT + trigger_limit: + times: 1 + interval: DAY + status: ACTIVE + created_at: '2022-08-16T08:38:54Z' + canceled_at: canceled_at + updated_at: '2022-08-16T08:38:54Z' + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + qualifying_item_variation_ids: + - CJ3RYL56ITAKMD4VRCM7XERS + - AT3RYLR3TUA9C34VRCB7X5RR + qualifying_category_ids: + - qualifying_category_ids + - id: loypromo_e696f057-2286-35ff-8108-132241328106 + name: July Special + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + points_multiplier: 2 + multiplier: '2.000' + available_time: + start_date: '2022-07-01' + end_date: '2022-08-01' + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220704T090000 + DURATION:PT8H + RRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=MO + END:VEVENT + - |- + BEGIN:VEVENT + DTSTART:20220705T090000 + DURATION:PT8H + RRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TU + END:VEVENT + - |- + BEGIN:VEVENT + DTSTART:20220706T090000 + DURATION:PT8H + RRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=WE + END:VEVENT + - |- + BEGIN:VEVENT + DTSTART:20220707T090000 + DURATION:PT8H + RRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TH + END:VEVENT + - |- + BEGIN:VEVENT + DTSTART:20220701T090000 + DURATION:PT8H + RRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=FR + END:VEVENT + trigger_limit: + times: 5 + interval: ALL_TIME + status: ENDED + created_at: '2022-06-27T15:37:38Z' + canceled_at: canceled_at + updated_at: '2022-06-27T15:37:38Z' + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + minimum_spend_amount_money: + amount: 2000 + currency: USD + qualifying_item_variation_ids: + - qualifying_item_variation_ids + qualifying_category_ids: + - XTQPYLR3IIU9C44VRCB3XD12 + cursor: cursor + create: + path: /v2/loyalty/programs/{program_id}/promotions + method: POST + auth: true + docs: >- + Creates a loyalty promotion for a [loyalty + program](entity:LoyaltyProgram). A loyalty promotion + + enables buyers to earn points in addition to those earned from the base + loyalty program. + + + This endpoint sets the loyalty promotion to the `ACTIVE` or `SCHEDULED` + status, depending on the + + `available_time` setting. A loyalty program can have a maximum of 10 + loyalty promotions with an + + `ACTIVE` or `SCHEDULED` status. + source: + openapi: openapi/openapi.json + display-name: CreateLoyaltyPromotion + request: + name: CreateLoyaltyPromotionRequest + path-parameters: + program_id: + type: string + docs: >- + The ID of the [loyalty program](entity:LoyaltyProgram) to + associate with the promotion. + + To get the program ID, call + [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) + + using the `main` keyword. + body: + properties: + loyalty_promotion: + type: root.LoyaltyPromotion + docs: The loyalty promotion to create. + idempotency_key: + type: string + docs: >- + A unique identifier for this request, which is used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 128 + content-type: application/json + response: + docs: Success + type: root.CreateLoyaltyPromotionResponse + status-code: 200 + examples: + - path-parameters: + program_id: program_id + headers: + Square-Version: '2025-07-16' + request: + loyalty_promotion: + name: Tuesday Happy Hour Promo + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + multiplier: '3.0' + available_time: + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220816T160000 + DURATION:PT2H + RRULE:FREQ=WEEKLY;BYDAY=TU + END:VEVENT + trigger_limit: + times: 1 + interval: DAY + minimum_spend_amount_money: + amount: 2000 + currency: USD + qualifying_category_ids: + - XTQPYLR3IIU9C44VRCB3XD12 + idempotency_key: ec78c477-b1c3-4899-a209-a4e71337c996 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_promotion: + id: loypromo_f0f9b849-725e-378d-b810-511237e07b67 + name: Tuesday Happy Hour Promo + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + points_multiplier: 3 + multiplier: '3.000' + points_addition_data: + points_addition: 1 + available_time: + start_date: '2022-08-16' + end_date: end_date + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220816T160000 + DURATION:PT2H + RRULE:FREQ=WEEKLY;BYDAY=TU + END:VEVENT + trigger_limit: + times: 1 + interval: DAY + status: ACTIVE + created_at: '2022-08-16T08:38:54Z' + canceled_at: canceled_at + updated_at: '2022-08-16T08:38:54Z' + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + minimum_spend_amount_money: + amount: 2000 + currency: USD + qualifying_item_variation_ids: + - qualifying_item_variation_ids + qualifying_category_ids: + - XTQPYLR3IIU9C44VRCB3XD12 + get: + path: /v2/loyalty/programs/{program_id}/promotions/{promotion_id} + method: GET + auth: true + docs: Retrieves a loyalty promotion. + source: + openapi: openapi/openapi.json + display-name: RetrieveLoyaltyPromotion + request: + name: GetPromotionsRequest + path-parameters: + promotion_id: + type: string + docs: >- + The ID of the [loyalty promotion](entity:LoyaltyPromotion) to + retrieve. + program_id: + type: string + docs: >- + The ID of the base [loyalty program](entity:LoyaltyProgram). To + get the program ID, + + call + [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) + using the `main` keyword. + response: + docs: Success + type: root.GetLoyaltyPromotionResponse + status-code: 200 + examples: + - path-parameters: + promotion_id: promotion_id + program_id: program_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_promotion: + id: loypromo_f0f9b849-725e-378d-b810-511237e07b67 + name: Tuesday Happy Hour Promo + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + points_multiplier: 3 + multiplier: '3.000' + points_addition_data: + points_addition: 1 + available_time: + start_date: '2022-08-16' + end_date: end_date + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220816T160000 + DURATION:PT2H + RRULE:FREQ=WEEKLY;BYDAY=TU + END:VEVENT + trigger_limit: + times: 1 + interval: DAY + status: ACTIVE + created_at: '2022-08-16T08:38:54Z' + canceled_at: canceled_at + updated_at: '2022-08-16T08:38:54Z' + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + minimum_spend_amount_money: + amount: 2000 + currency: USD + qualifying_item_variation_ids: + - CJ3RYL56ITAKMD4VRCM7XERS + - AT3RYLR3TUA9C34VRCB7X5RR + qualifying_category_ids: + - qualifying_category_ids + cancel: + path: /v2/loyalty/programs/{program_id}/promotions/{promotion_id}/cancel + method: POST + auth: true + docs: >- + Cancels a loyalty promotion. Use this endpoint to cancel an `ACTIVE` + promotion earlier than the + + end date, cancel an `ACTIVE` promotion when an end date is not + specified, or cancel a `SCHEDULED` promotion. + + Because updating a promotion is not supported, you can also use this + endpoint to cancel a promotion before + + you create a new one. + + + This endpoint sets the loyalty promotion to the `CANCELED` state + source: + openapi: openapi/openapi.json + display-name: CancelLoyaltyPromotion + request: + name: CancelPromotionsRequest + path-parameters: + promotion_id: + type: string + docs: >- + The ID of the [loyalty promotion](entity:LoyaltyPromotion) to + cancel. You can cancel a + + promotion that has an `ACTIVE` or `SCHEDULED` status. + program_id: + type: string + docs: The ID of the base [loyalty program](entity:LoyaltyProgram). + response: + docs: Success + type: root.CancelLoyaltyPromotionResponse + status-code: 200 + examples: + - path-parameters: + promotion_id: promotion_id + program_id: program_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_promotion: + id: loypromo_f0f9b849-725e-378d-b810-511237e07b67 + name: Tuesday Happy Hour Promo + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + points_multiplier: 3 + multiplier: '3.000' + points_addition_data: + points_addition: 1 + available_time: + start_date: '2022-08-16' + end_date: end_date + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220816T160000 + DURATION:PT2H + RRULE:FREQ=WEEKLY;BYDAY=TU + END:VEVENT + trigger_limit: + times: 1 + interval: DAY + status: CANCELED + created_at: '2022-08-16T08:38:54Z' + canceled_at: '2022-08-17T12:42:49Z' + updated_at: '2022-08-17T12:42:49Z' + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + minimum_spend_amount_money: + amount: 2000 + currency: USD + qualifying_item_variation_ids: + - qualifying_item_variation_ids + qualifying_category_ids: + - XTQPYLR3IIU9C44VRCB3XD12 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/loyalty/rewards.yml b/.mock/definition/loyalty/rewards.yml new file mode 100644 index 000000000..93b92c448 --- /dev/null +++ b/.mock/definition/loyalty/rewards.yml @@ -0,0 +1,380 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/loyalty/rewards + method: POST + auth: true + docs: >- + Creates a loyalty reward. In the process, the endpoint does following: + + + - Uses the `reward_tier_id` in the request to determine the number of + points + + to lock for this reward. + + - If the request includes `order_id`, it adds the reward and related + discount to the order. + + + After a reward is created, the points are locked and + + not available for the buyer to redeem another reward. + source: + openapi: openapi/openapi.json + display-name: CreateLoyaltyReward + request: + name: CreateLoyaltyRewardRequest + body: + properties: + reward: + type: root.LoyaltyReward + docs: The reward to create. + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreateLoyaltyReward` + request. + + Keys can be any valid string, but must be unique for every + request. + validation: + minLength: 1 + maxLength: 128 + content-type: application/json + response: + docs: Success + type: root.CreateLoyaltyRewardResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + reward: + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + order_id: RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY + idempotency_key: 18c2e5ea-a620-4b1f-ad60-7b167285e451 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + reward: + id: a8f43ebe-2ad6-3001-bdd5-7d7c2da08943 + status: ISSUED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY + created_at: '2020-05-01T21:49:54Z' + updated_at: '2020-05-01T21:49:54Z' + redeemed_at: redeemed_at + search: + path: /v2/loyalty/rewards/search + method: POST + auth: true + docs: >- + Searches for loyalty rewards. This endpoint accepts a request with no + query filters and returns results for all loyalty accounts. + + If you include a `query` object, `loyalty_account_id` is required and + `status` is optional. + + + If you know a reward ID, use the + + [RetrieveLoyaltyReward](api-endpoint:Loyalty-RetrieveLoyaltyReward) + endpoint. + + + Search results are sorted by `updated_at` in descending order. + source: + openapi: openapi/openapi.json + display-name: SearchLoyaltyRewards + request: + name: SearchLoyaltyRewardsRequest + body: + properties: + query: + type: optional + docs: >- + The search criteria for the request. + + If empty, the endpoint retrieves all loyalty rewards in the + loyalty program. + limit: + type: optional + docs: >- + The maximum number of results to return in the response. The + default value is 30. + validation: + min: 1 + max: 30 + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to + + this endpoint. Provide this to retrieve the next set of + + results for the original query. + + For more information, + + see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchLoyaltyRewardsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + limit: 10 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + rewards: + - id: d03f79f4-815f-3500-b851-cc1e68a457f9 + status: REDEEMED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: PyATxhYLfsMqpVkcKJITPydgEYfZY + created_at: '2020-05-08T22:00:44Z' + updated_at: '2020-05-08T22:01:17Z' + redeemed_at: '2020-05-08T22:01:17Z' + - id: 9f18ac21-233a-31c3-be77-b45840f5a810 + status: REDEEMED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: order_id + created_at: '2020-05-08T21:55:42Z' + updated_at: '2020-05-08T21:56:00Z' + redeemed_at: '2020-05-08T21:56:00Z' + - id: a8f43ebe-2ad6-3001-bdd5-7d7c2da08943 + status: DELETED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: 5NB69ZNh3FbsOs1ox43bh1xrli6YY + created_at: '2020-05-01T21:49:54Z' + updated_at: '2020-05-08T21:55:10Z' + redeemed_at: redeemed_at + - id: a051254c-f840-3b45-8cf1-50bcd38ff92a + status: ISSUED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: LQQ16znvi2VIUKPVhUfJefzr1eEZY + created_at: '2020-05-01T20:20:37Z' + updated_at: '2020-05-01T20:20:40Z' + redeemed_at: redeemed_at + cursor: cursor + get: + path: /v2/loyalty/rewards/{reward_id} + method: GET + auth: true + docs: Retrieves a loyalty reward. + source: + openapi: openapi/openapi.json + display-name: RetrieveLoyaltyReward + request: + name: GetRewardsRequest + path-parameters: + reward_id: + type: string + docs: The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve. + response: + docs: Success + type: root.GetLoyaltyRewardResponse + status-code: 200 + examples: + - path-parameters: + reward_id: reward_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + reward: + id: 9f18ac21-233a-31c3-be77-b45840f5a810 + status: REDEEMED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: order_id + created_at: '2020-05-08T21:55:42Z' + updated_at: '2020-05-08T21:56:00Z' + redeemed_at: '2020-05-08T21:56:00Z' + delete: + path: /v2/loyalty/rewards/{reward_id} + method: DELETE + auth: true + docs: >- + Deletes a loyalty reward by doing the following: + + + - Returns the loyalty points back to the loyalty account. + + - If an order ID was specified when the reward was created + + (see [CreateLoyaltyReward](api-endpoint:Loyalty-CreateLoyaltyReward)), + + it updates the order by removing the reward and related + + discounts. + + + You cannot delete a reward that has reached the terminal state + (REDEEMED). + source: + openapi: openapi/openapi.json + display-name: DeleteLoyaltyReward + request: + name: DeleteRewardsRequest + path-parameters: + reward_id: + type: string + docs: The ID of the [loyalty reward](entity:LoyaltyReward) to delete. + response: + docs: Success + type: root.DeleteLoyaltyRewardResponse + status-code: 200 + examples: + - path-parameters: + reward_id: reward_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + redeem: + path: /v2/loyalty/rewards/{reward_id}/redeem + method: POST + auth: true + docs: |- + Redeems a loyalty reward. + + The endpoint sets the reward to the `REDEEMED` terminal state. + + If you are using your own order processing system (not using the + Orders API), you call this endpoint after the buyer paid for the + purchase. + + After the reward reaches the terminal state, it cannot be deleted. + In other words, points used for the reward cannot be returned + to the account. + source: + openapi: openapi/openapi.json + display-name: RedeemLoyaltyReward + request: + name: RedeemLoyaltyRewardRequest + path-parameters: + reward_id: + type: string + docs: The ID of the [loyalty reward](entity:LoyaltyReward) to redeem. + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this `RedeemLoyaltyReward` + request. + + Keys can be any valid string, but must be unique for every + request. + validation: + minLength: 1 + maxLength: 128 + location_id: + type: string + docs: >- + The ID of the [location](entity:Location) where the reward is + redeemed. + validation: + minLength: 1 + content-type: application/json + response: + docs: Success + type: root.RedeemLoyaltyRewardResponse + status-code: 200 + examples: + - path-parameters: + reward_id: reward_id + headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 98adc7f7-6963-473b-b29c-f3c9cdd7d994 + location_id: P034NEENMD09F + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + event: + id: 67377a6e-dbdc-369d-aa16-2e7ed422e71f + type: REDEEM_REWARD + created_at: '2020-05-08T21:56:00Z' + accumulate_points: + loyalty_program_id: loyalty_program_id + points: 1 + order_id: order_id + create_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + redeem_reward: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + reward_id: 9f18ac21-233a-31c3-be77-b45840f5a810 + order_id: order_id + delete_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + adjust_points: + loyalty_program_id: loyalty_program_id + points: 1 + reason: reason + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: P034NEENMD09F + source: LOYALTY_API + expire_points: + loyalty_program_id: loyalty_program_id + points: 1 + other_event: + loyalty_program_id: loyalty_program_id + points: 1 + accumulate_promotion_points: + loyalty_program_id: loyalty_program_id + loyalty_promotion_id: loyalty_promotion_id + points: 1 + order_id: order_id + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/merchants.yml b/.mock/definition/merchants.yml new file mode 100644 index 000000000..f44b15100 --- /dev/null +++ b/.mock/definition/merchants.yml @@ -0,0 +1,116 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/merchants + method: GET + auth: true + docs: >- + Provides details about the merchant associated with a given access + token. + + + The access token used to connect your application to a Square seller is + associated + + with a single merchant. That means that `ListMerchants` returns a list + + with a single `Merchant` object. You can specify your personal access + token + + to get your own merchant information or specify an OAuth token to get + the + + information for the merchant that granted your application access. + + + If you know the merchant ID, you can also use the + [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) + + endpoint to retrieve the merchant information. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.merchant + source: + openapi: openapi/openapi.json + display-name: ListMerchants + request: + name: ListMerchantsRequest + query-parameters: + cursor: + type: optional> + docs: The cursor generated by the previous response. + response: + docs: Success + type: root.ListMerchantsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + merchant: + - id: DM7VKY8Q63GNP + business_name: Apple A Day + country: US + language_code: en-US + currency: USD + status: ACTIVE + main_location_id: 9A65CGC72ZQG1 + created_at: '2021-12-10T19:25:52.484Z' + cursor: 1 + get: + path: /v2/merchants/{merchant_id} + method: GET + auth: true + docs: Retrieves the `Merchant` object for the given `merchant_id`. + source: + openapi: openapi/openapi.json + display-name: RetrieveMerchant + request: + name: GetMerchantsRequest + path-parameters: + merchant_id: + type: string + docs: >- + The ID of the merchant to retrieve. If the string "me" is supplied + as the ID, + + then retrieve the merchant that is currently accessible to this + call. + response: + docs: Success + type: root.GetMerchantResponse + status-code: 200 + examples: + - path-parameters: + merchant_id: merchant_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + merchant: + id: DM7VKY8Q63GNP + business_name: Apple A Day + country: US + language_code: en-US + currency: USD + status: ACTIVE + main_location_id: 9A65CGC72ZQG1 + created_at: '2021-12-10T19:25:52.484Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/merchants/customAttributeDefinitions.yml b/.mock/definition/merchants/customAttributeDefinitions.yml new file mode 100644 index 000000000..e452d3ba1 --- /dev/null +++ b/.mock/definition/merchants/customAttributeDefinitions.yml @@ -0,0 +1,405 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/merchants/custom-attribute-definitions + method: GET + auth: true + docs: >- + Lists the merchant-related [custom attribute + definitions](entity:CustomAttributeDefinition) that belong to a Square + seller account. + + When all response pages are retrieved, the results include all custom + attribute definitions + + that are visible to the requesting application, including those that are + created by other + + applications and set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attribute_definitions + source: + openapi: openapi/openapi.json + display-name: ListMerchantCustomAttributeDefinitions + request: + name: ListCustomAttributeDefinitionsRequest + query-parameters: + visibility_filter: + type: optional> + docs: >- + Filters the `CustomAttributeDefinition` results by their + `visibility` values. + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListMerchantCustomAttributeDefinitionsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute_definitions: + - key: has_seen_tutorial + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean + name: NAME + description: >- + Whether the merchant has seen the tutorial screen for using + the app. + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2023-05-05T16:50:21.832Z' + created_at: '2023-05-05T16:50:21.832Z' + - key: alternative_seller_name + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Alternative Merchant Name + description: This is the other name this merchant goes by. + visibility: VISIBILITY_READ_ONLY + version: 4 + updated_at: '2023-05-05T10:17:52.341Z' + created_at: '2023-05-05T19:06:36.559Z' + cursor: >- + ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/merchants/custom-attribute-definitions + method: POST + auth: true + docs: >- + Creates a merchant-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + Use this endpoint to define a custom attribute that can be associated + with a merchant connecting to your application. + + A custom attribute definition specifies the `key`, `visibility`, + `schema`, and other properties + + for a custom attribute. After the definition is created, you can call + + [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) + or + + [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + + to set the custom attribute for a merchant. + source: + openapi: openapi/openapi.json + display-name: CreateMerchantCustomAttributeDefinition + request: + name: CreateMerchantCustomAttributeDefinitionRequest + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition to create. Note the following: + + - With the exception of the `Selection` data type, the `schema` + is specified as a simple URL to the JSON schema + + definition hosted on the Square CDN. For more information, + including supported values and constraints, see + + [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). + + - `name` is required unless `visibility` is set to + `VISIBILITY_HIDDEN`. + idempotency_key: + type: optional + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateMerchantCustomAttributeDefinitionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + custom_attribute_definition: + key: alternative_seller_name + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Alternative Merchant Name + description: This is the other name this merchant goes by. + visibility: VISIBILITY_READ_ONLY + response: + body: + custom_attribute_definition: + key: alternative_seller_name + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Alternative Merchant Name + description: This is the other name this merchant goes by. + visibility: VISIBILITY_READ_ONLY + version: 1 + updated_at: '2023-05-05T19:06:36.559Z' + created_at: '2023-05-05T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/merchants/custom-attribute-definitions/{key} + method: GET + auth: true + docs: >- + Retrieves a merchant-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + To retrieve a custom attribute definition created by another + application, the `visibility` + + setting must be `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveMerchantCustomAttributeDefinition + request: + name: GetCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: >- + The key of the custom attribute definition to retrieve. If the + requesting application + + is not the definition owner, you must use the qualified key. + query-parameters: + version: + type: optional> + docs: >- + The current version of the custom attribute definition, which is + used for strongly consistent + + reads to guarantee that you receive the most up-to-date data. When + included in the request, + + Square returns the specified version or a higher version if one + exists. If the specified version + + is higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveMerchantCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute_definition: + key: alternative_seller_name + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Alternative Merchant Name + description: This is the other name this merchant goes by. + visibility: VISIBILITY_READ_ONLY + version: 1 + updated_at: '2023-05-05T19:06:36.559Z' + created_at: '2023-05-05T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/merchants/custom-attribute-definitions/{key} + method: PUT + auth: true + docs: >- + Updates a merchant-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + Use this endpoint to update the following fields: `name`, `description`, + `visibility`, or the + + `schema` for a `Selection` data type. + + Only the definition owner can update a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: UpdateMerchantCustomAttributeDefinition + request: + name: UpdateMerchantCustomAttributeDefinitionRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to update. + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition that contains the fields to + update. This endpoint + + supports sparse updates, so only new or changed fields need to + be included in the request. + + Only the following fields can be updated: + + - `name` + + - `description` + + - `visibility` + + - `schema` for a `Selection` data type. Only changes to the + named options or the maximum number of allowed + + selections are supported. + + For more information, see + + [Update a merchant custom attribute + definition](https://developer.squareup.com/docs/merchant-custom-attributes-api/custom-attribute-definitions#update-custom-attribute-definition). + + The version field must match the current version of the custom + attribute definition to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + If this is not important for your application, version can be + set to -1. For any other values, the request fails with a + BAD_REQUEST error. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateMerchantCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + request: + custom_attribute_definition: + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + response: + body: + custom_attribute_definition: + key: alternative_seller_name + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Alternative Merchant Name + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 2 + updated_at: '2023-05-05T19:34:10.181Z' + created_at: '2023-05-05T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/merchants/custom-attribute-definitions/{key} + method: DELETE + auth: true + docs: >- + Deletes a merchant-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + Deleting a custom attribute definition also deletes the corresponding + custom attribute from + + the merchant. + + Only the definition owner can delete a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: DeleteMerchantCustomAttributeDefinition + request: + name: DeleteCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to delete. + response: + docs: Success + type: root.DeleteMerchantCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/merchants/customAttributes.yml b/.mock/definition/merchants/customAttributes.yml new file mode 100644 index 000000000..72c2fce77 --- /dev/null +++ b/.mock/definition/merchants/customAttributes.yml @@ -0,0 +1,532 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + batchDelete: + path: /v2/merchants/custom-attributes/bulk-delete + method: POST + auth: true + docs: >- + Deletes [custom attributes](entity:CustomAttribute) for a merchant as a + bulk operation. + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkDeleteMerchantCustomAttributes + request: + name: BulkDeleteMerchantCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + The data used to update the `CustomAttribute` objects. + + The keys must be unique and are used to map to the corresponding + response. + content-type: application/json + response: + docs: Success + type: root.BulkDeleteMerchantCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + values: + id1: + key: alternative_seller_name + id2: + key: has_seen_tutorial + response: + body: + values: + id1: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchUpsert: + path: /v2/merchants/custom-attributes/bulk-upsert + method: POST + auth: true + docs: >- + Creates or updates [custom attributes](entity:CustomAttribute) for a + merchant as a bulk operation. + + Use this endpoint to set the value of one or more custom attributes for + a merchant. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which is + + created using the + [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) + endpoint. + + This `BulkUpsertMerchantCustomAttributes` endpoint accepts a map of 1 to + 25 individual upsert + + requests and returns a map of individual upsert responses. Each upsert + request has a unique ID + + and provides a merchant ID and custom attribute. Each upsert response is + returned with the ID + + of the corresponding request. + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkUpsertMerchantCustomAttributes + request: + name: BulkUpsertMerchantCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + A map containing 1 to 25 individual upsert requests. For each + request, provide an + + arbitrary ID that is unique for this + `BulkUpsertMerchantCustomAttributes` request and the + + information needed to create or update a custom attribute. + content-type: application/json + response: + docs: Success + type: root.BulkUpsertMerchantCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + values: + id1: + merchant_id: DM7VKY8Q63GNP + custom_attribute: + key: alternative_seller_name + value: Ultimate Sneaker Store + id2: + merchant_id: DM7VKY8Q63GNP + custom_attribute: + key: has_seen_tutorial + value: true + response: + body: + values: + id1: + merchant_id: DM7VKY8Q63GNP + custom_attribute: + key: alternative_seller_name + value: Ultimate Sneaker Store + version: 2 + visibility: VISIBILITY_READ_ONLY + updated_at: '2023-05-06T19:21:04.551Z' + created_at: '2023-05-06T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + merchant_id: DM7VKY8Q63GNP + custom_attribute: + key: has_seen_tutorial + value: true + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2023-05-06T19:21:04.551Z' + created_at: '2023-05-06T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + list: + path: /v2/merchants/{merchant_id}/custom-attributes + method: GET + auth: true + docs: >- + Lists the [custom attributes](entity:CustomAttribute) associated with a + merchant. + + You can use the `with_definitions` query parameter to also retrieve + custom attribute definitions + + in the same call. + + When all response pages are retrieved, the results include all custom + attributes that are + + visible to the requesting application, including those that are owned by + other applications + + and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attributes + source: + openapi: openapi/openapi.json + display-name: ListMerchantCustomAttributes + request: + name: ListCustomAttributesRequest + path-parameters: + merchant_id: + type: string + docs: The ID of the target [merchant](entity:Merchant). + query-parameters: + visibility_filter: + type: optional> + docs: >- + Filters the `CustomAttributeDefinition` results by their + `visibility` values. + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. For more + + information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + with_definitions: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + response: + docs: Success + type: root.ListMerchantCustomAttributesResponse + status-code: 200 + examples: + - path-parameters: + merchant_id: merchant_id + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attributes: + - key: has_seen_tutorial + value: true + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2023-05-05T18:13:03.745Z' + created_at: '2023-05-05T18:13:03.745Z' + - key: alternative_seller_name + value: Ultimate Sneaker Store + version: 1 + visibility: VISIBILITY_READ_ONLY + updated_at: '2023-05-05T19:27:57.975Z' + created_at: '2023-05-05T19:27:57.975Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/merchants/{merchant_id}/custom-attributes/{key} + method: GET + auth: true + docs: >- + Retrieves a [custom attribute](entity:CustomAttribute) associated with a + merchant. + + You can use the `with_definition` query parameter to also retrieve the + custom attribute definition + + in the same call. + + To retrieve a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveMerchantCustomAttribute + request: + name: GetCustomAttributesRequest + path-parameters: + merchant_id: + type: string + docs: The ID of the target [merchant](entity:Merchant). + key: + type: string + docs: >- + The key of the custom attribute to retrieve. This key must match + the `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + query-parameters: + with_definition: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of + + the custom attribute. Set this parameter to `true` to get the name + and description of the custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + version: + type: optional> + docs: >- + The current version of the custom attribute, which is used for + strongly consistent reads to + + guarantee that you receive the most up-to-date data. When included + in the request, Square + + returns the specified version or a higher version if one exists. + If the specified version is + + higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveMerchantCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + merchant_id: merchant_id + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute: + key: alternative_seller_name + value: Ultimate Sneaker Store + version: 2 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2023-05-06T19:21:04.551Z' + created_at: '2023-05-06T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + upsert: + path: /v2/merchants/{merchant_id}/custom-attributes/{key} + method: POST + auth: true + docs: >- + Creates or updates a [custom attribute](entity:CustomAttribute) for a + merchant. + + Use this endpoint to set the value of a custom attribute for a specified + merchant. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which + + is created using the + [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) + endpoint. + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: UpsertMerchantCustomAttribute + request: + name: UpsertMerchantCustomAttributeRequest + path-parameters: + merchant_id: + type: string + docs: The ID of the target [merchant](entity:Merchant). + key: + type: string + docs: >- + The key of the custom attribute to create or update. This key must + match the `key` of a + + custom attribute definition in the Square seller account. If the + requesting application is not + + the definition owner, you must use the qualified key. + body: + properties: + custom_attribute: + type: root.CustomAttribute + docs: >- + The custom attribute to create or update, with the following + fields: + + - `value`. This value must conform to the `schema` specified by + the definition. + + For more information, see [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). + + - The version field must match the current version of the custom + attribute definition to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + If this is not important for your application, version can be + set to -1. For any other values, the request fails with a + BAD_REQUEST error. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpsertMerchantCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + merchant_id: merchant_id + key: key + headers: + Square-Version: '2025-07-16' + request: + custom_attribute: + value: Ultimate Sneaker Store + response: + body: + custom_attribute: + key: alternative_seller_name + value: Ultimate Sneaker Store + version: 2 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2023-05-06T19:21:04.551Z' + created_at: '2023-05-06T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/merchants/{merchant_id}/custom-attributes/{key} + method: DELETE + auth: true + docs: >- + Deletes a [custom attribute](entity:CustomAttribute) associated with a + merchant. + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: DeleteMerchantCustomAttribute + request: + name: DeleteCustomAttributesRequest + path-parameters: + merchant_id: + type: string + docs: The ID of the target [merchant](entity:Merchant). + key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match the + `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + response: + docs: Success + type: root.DeleteMerchantCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + merchant_id: merchant_id + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/mobile.yml b/.mock/definition/mobile.yml new file mode 100644 index 000000000..18a595bf4 --- /dev/null +++ b/.mock/definition/mobile.yml @@ -0,0 +1,78 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + authorizationCode: + path: /mobile/authorization-code + method: POST + auth: true + docs: >- + __Note:__ This endpoint is used by the deprecated Reader SDK. + + Developers should update their integration to use the [Mobile Payments + SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which + includes its own authorization methods. + + + Generates code to authorize a mobile application to connect to a Square + card reader. + + + Authorization codes are one-time-use codes and expire 60 minutes after + being issued. + + + The `Authorization` header you provide to this endpoint must have the + following format: + + + ``` + + Authorization: Bearer ACCESS_TOKEN + + ``` + + + Replace `ACCESS_TOKEN` with a + + [valid production authorization + credential](https://developer.squareup.com/docs/build-basics/access-tokens). + source: + openapi: openapi/openapi.json + display-name: CreateMobileAuthorizationCode + request: + name: CreateMobileAuthorizationCodeRequest + body: + properties: + location_id: + type: optional + docs: >- + The Square location ID that the authorization code should be + tied to. + validation: + minLength: 1 + maxLength: 191 + content-type: application/json + response: + docs: Success + type: root.CreateMobileAuthorizationCodeResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-07-16' + request: + location_id: YOUR_LOCATION_ID + response: + body: + authorization_code: YOUR_MOBILE_AUTHORIZATION_CODE + expires_at: '2019-01-10T19:42:08Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/oAuth.yml b/.mock/definition/oAuth.yml new file mode 100644 index 000000000..b7c6391fc --- /dev/null +++ b/.mock/definition/oAuth.yml @@ -0,0 +1,376 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + revokeToken: + path: /oauth2/revoke + method: POST + auth: true + docs: >- + Revokes an access token generated with the OAuth flow. + + + If an account has more than one OAuth access token for your application, + this + + endpoint revokes all of them, regardless of which token you specify. + + + __Important:__ The `Authorization` header for this endpoint must have + the + + following format: + + + ``` + + Authorization: Client APPLICATION_SECRET + + ``` + + + Replace `APPLICATION_SECRET` with the application secret on the + **OAuth** + + page for your application in the Developer Dashboard. + source: + openapi: openapi/openapi.json + display-name: RevokeToken + request: + name: RevokeTokenRequest + body: + properties: + client_id: + type: optional> + docs: >- + The Square-issued ID for your application, which is available on + the **OAuth** page in the + + [Developer Dashboard](https://developer.squareup.com/apps). + validation: + maxLength: 191 + access_token: + type: optional> + docs: >- + The access token of the merchant whose token you want to revoke. + + Do not provide a value for `merchant_id` if you provide this + parameter. + validation: + minLength: 2 + maxLength: 1024 + merchant_id: + type: optional> + docs: >- + The ID of the merchant whose token you want to revoke. + + Do not provide a value for `access_token` if you provide this + parameter. + revoke_only_access_token: + type: optional> + docs: |- + If `true`, terminate the given single access token, but do not + terminate the entire authorization. + Default: `false` + content-type: application/json + response: + docs: Success + type: root.RevokeTokenResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + client_id: CLIENT_ID + access_token: ACCESS_TOKEN + response: + body: + success: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + obtainToken: + path: /oauth2/token + method: POST + auth: false + docs: >- + Returns an OAuth access token and refresh token using the + `authorization_code` + + or `refresh_token` grant type. + + + When `grant_type` is `authorization_code`: + + - With the [code + flow](https://developer.squareup.com/docs/oauth-api/overview#code-flow), + + provide `code`, `client_id`, and `client_secret`. + + - With the [PKCE + flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow), + + provide `code`, `client_id`, and `code_verifier`. + + + When `grant_type` is `refresh_token`: + + - With the code flow, provide `refresh_token`, `client_id`, and + `client_secret`. + + The response returns the same refresh token provided in the request. + + - With the PKCE flow, provide `refresh_token` and `client_id`. The + response returns + + a new refresh token. + + + You can use the `scopes` parameter to limit the set of permissions + authorized by the + + access token. You can use the `short_lived` parameter to create an + access token that + + expires in 24 hours. + + + __Important:__ OAuth tokens should be encrypted and stored on a secure + server. + + Application clients should never interact directly with OAuth tokens. + source: + openapi: openapi/openapi.json + display-name: ObtainToken + request: + name: ObtainTokenRequest + body: + properties: + client_id: + type: string + docs: >- + The Square-issued ID of your application, which is available as + the **Application ID** + + on the **OAuth** page in the [Developer + Console](https://developer.squareup.com/apps). + + + Required for the code flow and PKCE flow for any grant type. + validation: + maxLength: 191 + client_secret: + type: optional> + docs: >- + The secret key for your application, which is available as the + **Application secret** + + on the **OAuth** page in the [Developer + Console](https://developer.squareup.com/apps). + + + Required for the code flow for any grant type. Don't confuse + your client secret with your + + personal access token. + validation: + minLength: 2 + maxLength: 1024 + code: + type: optional> + docs: >- + The authorization code to exchange for an OAuth access token. + This is the `code` + + value that Square sent to your redirect URL in the authorization + response. + + + Required for the code flow and PKCE flow if `grant_type` is + `authorization_code`. + validation: + maxLength: 191 + redirect_uri: + type: optional> + docs: >- + The redirect URL for your application, which you registered as + the **Redirect URL** + + on the **OAuth** page in the [Developer + Console](https://developer.squareup.com/apps). + + + Required for the code flow and PKCE flow if `grant_type` is + `authorization_code` and + + you provided the `redirect_uri` parameter in your authorization + URL. + validation: + maxLength: 2048 + grant_type: + type: string + docs: >- + The method used to obtain an OAuth access token. The request + must include the + + credential that corresponds to the specified grant type. Valid + values are: + + - `authorization_code` - Requires the `code` field. + + - `refresh_token` - Requires the `refresh_token` field. + + - `migration_token` - LEGACY for access tokens obtained using a + Square API version prior + + to 2019-03-13. Requires the `migration_token` field. + validation: + minLength: 10 + maxLength: 20 + refresh_token: + type: optional> + docs: >- + A valid refresh token used to generate a new OAuth access token. + This is a + + refresh token that was returned in a previous `ObtainToken` + response. + + + Required for the code flow and PKCE flow if `grant_type` is + `refresh_token`. + validation: + minLength: 2 + maxLength: 1024 + migration_token: + type: optional> + docs: >- + __LEGACY__ A valid access token (obtained using a Square API + version prior to 2019-03-13) + + used to generate a new OAuth access token. + + + Required if `grant_type` is `migration_token`. For more + information, see + + [Migrate to Using Refresh + Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens). + validation: + minLength: 2 + maxLength: 1024 + scopes: + type: optional>> + docs: >- + The list of permissions that are explicitly requested for the + access token. + + For example, + ["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]. + + + The returned access token is limited to the permissions that are + the intersection + + of these requested permissions and those authorized by the + provided `refresh_token`. + + + Optional for the code flow and PKCE flow if `grant_type` is + `refresh_token`. + short_lived: + type: optional> + docs: >- + Indicates whether the returned access token should expire in 24 + hours. + + + Optional for the code flow and PKCE flow for any grant type. The + default value is `false`. + code_verifier: + type: optional> + docs: >- + The secret your application generated for the authorization + request used to + + obtain the authorization code. This is the source of the + `code_challenge` hash you + + provided in your authorization URL. + + + Required for the PKCE flow if `grant_type` is + `authorization_code`. + content-type: application/json + response: + docs: Success + type: root.ObtainTokenResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + client_id: sq0idp-uaPHILoPzWZk3tlJqlML0g + client_secret: sq0csp-30a-4C_tVOnTh14Piza2BfTPBXyLafLPWSzY1qAjeBfM + code: sq0cgb-l0SBqxs4uwxErTVyYOdemg + grant_type: authorization_code + response: + body: + access_token: EAAl3ikZIe18J-2-cHlV2bL4-EaZHGoJUhtEBT7QA6-7AgwIHw8Xe1IoUvGsNxA + token_type: bearer + expires_at: '2025-04-03T18:31:06Z' + merchant_id: MLQW2MYBY81PZ + subscription_id: subscription_id + plan_id: plan_id + id_token: id_token + refresh_token: EQAAl0OcByu3IYJYScGGg-8E5YNf0r0b6jCTCMy5nOcRZ4ok0wbWAL8vY3tZWNcc + short_lived: false + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refresh_token_expires_at: refresh_token_expires_at + RetrieveTokenStatus: + path: /oauth2/token/status + method: POST + auth: true + docs: "Returns information about an [OAuth access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-an-oauth-access-token)\_or an application’s [personal access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-a-personal-access-token).\n\nAdd the access token to the Authorization header of the request.\n\n__Important:__ The `Authorization` header you provide to this endpoint must have the following format:\n\n```\nAuthorization: Bearer ACCESS_TOKEN\n```\n\nwhere `ACCESS_TOKEN` is a\n[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens).\n\nIf the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error." + source: + openapi: openapi/openapi.json + display-name: RetrieveTokenStatus + response: + docs: Success + type: root.RetrieveTokenStatusResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + scopes: + - PAYMENTS_READ + - PAYMENTS_WRITE + expires_at: '2022-10-14T14:44:00Z' + client_id: CLIENT_ID + merchant_id: MERCHANT_ID + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + authorize: + path: /oauth2/authorize + method: GET + auth: false + source: + openapi: openapi/openapi.json + examples: + - headers: + Square-Version: '2025-07-16' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/orders.yml b/.mock/definition/orders.yml new file mode 100644 index 000000000..4dc1424f9 --- /dev/null +++ b/.mock/definition/orders.yml @@ -0,0 +1,1718 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/orders + method: POST + auth: true + docs: >- + Creates a new [order](entity:Order) that can include information about + products for + + purchase and settings to apply to the purchase. + + + To pay for a created order, see + + [Pay for + Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). + + + You can modify open orders using the + [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. + source: + openapi: openapi/openapi.json + display-name: CreateOrder + request: + body: root.CreateOrderRequest + content-type: application/json + response: + docs: Success + type: root.CreateOrderResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + order: + location_id: 057P5VYJ4A5X1 + reference_id: my-order-001 + line_items: + - name: New York Strip Steak + quantity: '1' + base_price_money: + amount: 1599 + currency: USD + - quantity: '2' + catalog_object_id: BEMYCSMIJL46OCDV4KYIKXIB + modifiers: + - catalog_object_id: CHQX7Y4KY6N5KINJKZCFURPZ + applied_discounts: + - discount_uid: one-dollar-off + taxes: + - uid: state-sales-tax + name: State Sales Tax + percentage: '9' + scope: ORDER + discounts: + - uid: labor-day-sale + name: Labor Day Sale + percentage: '5' + scope: ORDER + - uid: membership-discount + catalog_object_id: DB7L55ZH2BGWI4H23ULIWOQ7 + scope: ORDER + - uid: one-dollar-off + name: Sale - $1.00 off + amount_money: + amount: 100 + currency: USD + scope: LINE_ITEM + idempotency_key: 8193148c-9586-11e6-99f9-28cfe92138cf + response: + body: + order: + id: CAISENgvlJ6jLWAzERDzjyHVybY + location_id: 057P5VYJ4A5X1 + reference_id: my-order-001 + source: + name: My App + customer_id: customer_id + line_items: + - uid: 8uSwfzvUImn3IRrvciqlXC + name: New York Strip Steak + quantity: '1' + applied_taxes: + - uid: aKG87ArnDpvMLSZJHxWUl + tax_uid: state-sales-tax + applied_money: + amount: 136 + currency: USD + applied_discounts: + - uid: jWdgP1TpHPFBuVrz81mXVC + discount_uid: membership-discount + applied_money: + amount: 8 + currency: USD + - uid: jnZOjjVY57eRcQAVgEwFuC + discount_uid: labor-day-sale + applied_money: + amount: 79 + currency: USD + base_price_money: + amount: 1599 + currency: USD + variation_total_price_money: + amount: 1599 + currency: USD + gross_sales_money: + amount: 1599 + currency: USD + total_tax_money: + amount: 136 + currency: USD + total_discount_money: + amount: 87 + currency: USD + total_money: + amount: 1648 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: v8ZuEXpOJpb0bazLuvrLDB + name: New York Steak + quantity: '2' + catalog_object_id: BEMYCSMIJL46OCDV4KYIKXIB + variation_name: Larger + modifiers: + - uid: Lo3qMMckDluu9Qsb58d4CC + catalog_object_id: CHQX7Y4KY6N5KINJKZCFURPZ + name: Well + base_price_money: + amount: 50 + currency: USD + total_price_money: + amount: 100 + currency: USD + applied_taxes: + - uid: v1dAgrfUVUPTnVTf9sRPz + tax_uid: state-sales-tax + applied_money: + amount: 374 + currency: USD + applied_discounts: + - uid: nUXvdsIItfKko0dbYtY58C + discount_uid: membership-discount + applied_money: + amount: 22 + currency: USD + - uid: qSdkOOOernlVQqsJ94SPjB + discount_uid: labor-day-sale + applied_money: + amount: 224 + currency: USD + - uid: y7bVl4njrWAnfDwmz19izB + discount_uid: one-dollar-off + applied_money: + amount: 100 + currency: USD + base_price_money: + amount: 2200 + currency: USD + variation_total_price_money: + amount: 4400 + currency: USD + gross_sales_money: + amount: 4500 + currency: USD + total_tax_money: + amount: 374 + currency: USD + total_discount_money: + amount: 346 + currency: USD + total_money: + amount: 4528 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - uid: state-sales-tax + name: State Sales Tax + type: ADDITIVE + percentage: '9' + applied_money: + amount: 510 + currency: USD + scope: ORDER + discounts: + - uid: membership-discount + catalog_object_id: DB7L55ZH2BGWI4H23ULIWOQ7 + name: Membership Discount + type: FIXED_PERCENTAGE + percentage: '0.5' + applied_money: + amount: 30 + currency: USD + scope: ORDER + - uid: labor-day-sale + name: Labor Day Sale + type: FIXED_PERCENTAGE + percentage: '5' + applied_money: + amount: 303 + currency: USD + scope: ORDER + - uid: one-dollar-off + name: Sale - $1.00 off + type: FIXED_AMOUNT + amount_money: + amount: 100 + currency: USD + applied_money: + amount: 100 + currency: USD + scope: LINE_ITEM + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 6176 + currency: USD + tax_money: + amount: 510 + currency: USD + discount_money: + amount: 433 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2020-01-17T20:47:53.293Z' + updated_at: '2020-01-17T20:47:53.293Z' + closed_at: closed_at + state: OPEN + version: 1 + total_money: + amount: 6176 + currency: USD + total_tax_money: + amount: 510 + currency: USD + total_discount_money: + amount: 433 + currency: USD + total_tip_money: + amount: 0 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchGet: + path: /v2/orders/batch-retrieve + method: POST + auth: true + docs: >- + Retrieves a set of [orders](entity:Order) by their IDs. + + + If a given order ID does not exist, the ID is ignored instead of + generating an error. + source: + openapi: openapi/openapi.json + display-name: BatchRetrieveOrders + request: + name: BatchGetOrdersRequest + body: + properties: + location_id: + type: optional> + docs: >- + The ID of the location for these orders. This field is optional: + omit it to retrieve + + orders within the scope of the current authorization's merchant + ID. + order_ids: + docs: >- + The IDs of the orders to retrieve. A maximum of 100 orders can + be retrieved per request. + type: list + content-type: application/json + response: + docs: Success + type: root.BatchGetOrdersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + location_id: 057P5VYJ4A5X1 + order_ids: + - CAISEM82RcpmcFBM0TfOyiHV3es + - CAISENgvlJ6jLWAzERDzjyHVybY + response: + body: + orders: + - id: CAISEM82RcpmcFBM0TfOyiHV3es + location_id: 057P5VYJ4A5X1 + reference_id: my-order-001 + customer_id: customer_id + line_items: + - uid: 945986d1-9586-11e6-ad5a-28cfe92138cf + name: Awesome product + quantity: '1' + base_price_money: + amount: 1599 + currency: USD + total_money: + amount: 1599 + currency: USD + - uid: a8f4168c-9586-11e6-bdf0-28cfe92138cf + name: Another awesome product + quantity: '3' + base_price_money: + amount: 2000 + currency: USD + total_money: + amount: 6000 + currency: USD + taxes: + - {} + discounts: + - {} + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + created_at: created_at + updated_at: updated_at + closed_at: closed_at + state: OPEN + version: 1 + total_money: + amount: 7599 + currency: USD + ticket_name: ticket_name + rewards: + - id: id + reward_tier_id: reward_tier_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + calculate: + path: /v2/orders/calculate + method: POST + auth: true + docs: Enables applications to preview order pricing without creating an order. + source: + openapi: openapi/openapi.json + display-name: CalculateOrder + request: + name: CalculateOrderRequest + body: + properties: + order: + type: root.Order + docs: >- + The order to be calculated. Expects the entire order, not a + sparse update. + proposed_rewards: + type: optional>> + docs: >- + Identifies one or more loyalty reward tiers to apply during the + order calculation. + + The discounts defined by the reward tiers are added to the order + only to preview the + + effect of applying the specified rewards. The rewards do not + correspond to actual + + redemptions; that is, no `reward`s are created. Therefore, the + reward `id`s are + + random strings used only to reference the reward tier. + content-type: application/json + response: + docs: Success + type: root.CalculateOrderResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + order: + location_id: D7AVYMEAPJ3A3 + line_items: + - name: Item 1 + quantity: '1' + base_price_money: + amount: 500 + currency: USD + - name: Item 2 + quantity: '2' + base_price_money: + amount: 300 + currency: USD + discounts: + - name: 50% Off + percentage: '50' + scope: ORDER + response: + body: + order: + id: id + location_id: D7AVYMEAPJ3A3 + reference_id: reference_id + source: + name: name + customer_id: customer_id + line_items: + - uid: ULkg0tQTRK2bkU9fNv3IJD + name: Item 1 + quantity: '1' + applied_discounts: + - uid: 9zr9S4dxvPAixvn0lpa1VC + discount_uid: zGsRZP69aqSSR9lq9euSPB + applied_money: + amount: 250 + currency: USD + base_price_money: + amount: 500 + currency: USD + variation_total_price_money: + amount: 500 + currency: USD + gross_sales_money: + amount: 500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 250 + currency: USD + total_money: + amount: 250 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: mumY8Nun4BC5aKe2yyx5a + name: Item 2 + quantity: '2' + applied_discounts: + - uid: qa8LwwZK82FgSEkQc2HYVC + discount_uid: zGsRZP69aqSSR9lq9euSPB + applied_money: + amount: 300 + currency: USD + base_price_money: + amount: 300 + currency: USD + variation_total_price_money: + amount: 600 + currency: USD + gross_sales_money: + amount: 600 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 300 + currency: USD + total_money: + amount: 300 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - {} + discounts: + - uid: zGsRZP69aqSSR9lq9euSPB + name: 50% Off + type: FIXED_PERCENTAGE + percentage: '50' + applied_money: + amount: 550 + currency: USD + scope: ORDER + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 550 + currency: USD + tax_money: + amount: 0 + currency: USD + discount_money: + amount: 550 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2020-05-18T16:30:49.614Z' + updated_at: '2020-05-18T16:30:49.614Z' + closed_at: closed_at + state: OPEN + version: 1 + total_money: + amount: 550 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 550 + currency: USD + total_tip_money: + amount: 0 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + clone: + path: /v2/orders/clone + method: POST + auth: true + docs: >- + Creates a new order, in the `DRAFT` state, by duplicating an existing + order. The newly created order has + + only the core fields (such as line items, taxes, and discounts) copied + from the original order. + source: + openapi: openapi/openapi.json + display-name: CloneOrder + request: + name: CloneOrderRequest + body: + properties: + order_id: + type: string + docs: The ID of the order to clone. + version: + type: optional + docs: >- + An optional order version for concurrency protection. + + + If a version is provided, it must match the latest stored + version of the order to clone. + + If a version is not provided, the API clones the latest version. + idempotency_key: + type: optional> + docs: >- + A value you specify that uniquely identifies this clone request. + + + If you are unsure whether a particular order was cloned + successfully, + + you can reattempt the call with the same idempotency key without + + worrying about creating duplicate cloned orders. + + The originally cloned order is returned. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + content-type: application/json + response: + docs: Success + type: root.CloneOrderResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + order_id: ZAISEM52YcpmcWAzERDOyiWS123 + version: 3 + idempotency_key: UNIQUE_STRING + response: + body: + order: + id: CAISENgvlJ6jLWAzERDzjyHVybY + location_id: 057P5VYJ4A5X1 + reference_id: my-order-001 + source: + name: My App + customer_id: customer_id + line_items: + - uid: 8uSwfzvUImn3IRrvciqlXC + name: New York Strip Steak + quantity: '1' + applied_taxes: + - uid: aKG87ArnDpvMLSZJHxWUl + tax_uid: state-sales-tax + applied_money: + amount: 136 + currency: USD + applied_discounts: + - uid: jWdgP1TpHPFBuVrz81mXVC + discount_uid: membership-discount + applied_money: + amount: 8 + currency: USD + - uid: jnZOjjVY57eRcQAVgEwFuC + discount_uid: labor-day-sale + applied_money: + amount: 79 + currency: USD + base_price_money: + amount: 1599 + currency: USD + variation_total_price_money: + amount: 1599 + currency: USD + gross_sales_money: + amount: 1599 + currency: USD + total_tax_money: + amount: 136 + currency: USD + total_discount_money: + amount: 87 + currency: USD + total_money: + amount: 1648 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: v8ZuEXpOJpb0bazLuvrLDB + name: New York Steak + quantity: '2' + catalog_object_id: BEMYCSMIJL46OCDV4KYIKXIB + variation_name: Larger + modifiers: + - uid: Lo3qMMckDluu9Qsb58d4CC + catalog_object_id: CHQX7Y4KY6N5KINJKZCFURPZ + name: Well + base_price_money: + amount: 50 + currency: USD + total_price_money: + amount: 100 + currency: USD + applied_taxes: + - uid: v1dAgrfUVUPTnVTf9sRPz + tax_uid: state-sales-tax + applied_money: + amount: 374 + currency: USD + applied_discounts: + - uid: nUXvdsIItfKko0dbYtY58C + discount_uid: membership-discount + applied_money: + amount: 22 + currency: USD + - uid: qSdkOOOernlVQqsJ94SPjB + discount_uid: labor-day-sale + applied_money: + amount: 224 + currency: USD + - uid: y7bVl4njrWAnfDwmz19izB + discount_uid: one-dollar-off + applied_money: + amount: 100 + currency: USD + base_price_money: + amount: 2200 + currency: USD + variation_total_price_money: + amount: 4400 + currency: USD + gross_sales_money: + amount: 4500 + currency: USD + total_tax_money: + amount: 374 + currency: USD + total_discount_money: + amount: 346 + currency: USD + total_money: + amount: 4528 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - uid: state-sales-tax + name: State Sales Tax + type: ADDITIVE + percentage: '9' + applied_money: + amount: 510 + currency: USD + scope: ORDER + discounts: + - uid: membership-discount + catalog_object_id: DB7L55ZH2BGWI4H23ULIWOQ7 + name: Membership Discount + type: FIXED_PERCENTAGE + percentage: '0.5' + applied_money: + amount: 30 + currency: USD + scope: ORDER + - uid: labor-day-sale + name: Labor Day Sale + type: FIXED_PERCENTAGE + percentage: '5' + applied_money: + amount: 303 + currency: USD + scope: ORDER + - uid: one-dollar-off + name: Sale - $1.00 off + type: FIXED_AMOUNT + amount_money: + amount: 100 + currency: USD + applied_money: + amount: 100 + currency: USD + scope: LINE_ITEM + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 6176 + currency: USD + tax_money: + amount: 510 + currency: USD + discount_money: + amount: 433 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2020-01-17T20:47:53.293Z' + updated_at: '2020-01-17T20:47:53.293Z' + closed_at: closed_at + state: DRAFT + version: 1 + total_money: + amount: 6176 + currency: USD + total_tax_money: + amount: 510 + currency: USD + total_discount_money: + amount: 433 + currency: USD + total_tip_money: + amount: 0 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/orders/search + method: POST + auth: true + docs: >- + Search all orders for one or more locations. Orders include all sales, + + returns, and exchanges regardless of how or when they entered the Square + + ecosystem (such as Point of Sale, Invoices, and Connect APIs). + + + `SearchOrders` requests need to specify which locations to search and + define a + + [SearchOrdersQuery](entity:SearchOrdersQuery) object that controls + + how to sort or filter the results. Your `SearchOrdersQuery` can: + + Set filter criteria. + Set the sort order. + Determine whether to return results as complete `Order` objects or as + [OrderEntry](entity:OrderEntry) objects. + + + Note that details for orders processed with Square Point of Sale while + in + + offline mode might not be transmitted to Square for up to 72 hours. + Offline + + orders have a `created_at` value that reflects the time the order was + created, + + not the time it was subsequently transmitted to Square. + source: + openapi: openapi/openapi.json + display-name: SearchOrders + request: + name: SearchOrdersRequest + body: + properties: + location_ids: + type: optional> + docs: >- + The location IDs for the orders to query. All locations must + belong to + + the same merchant. + + + Max: 10 location IDs. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this cursor to retrieve the next set of results for your + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + query: + type: optional + docs: >- + Query conditions used to filter or sort the results. Note that + when + + retrieving additional pages using a cursor, you must use the + original query. + limit: + type: optional + docs: |- + The maximum number of results to be returned in a single page. + + Default: `500` + Max: `1000` + return_entries: + type: optional + docs: >- + A Boolean that controls the format of the search results. If + `true`, + + `SearchOrders` returns [OrderEntry](entity:OrderEntry) objects. + If `false`, `SearchOrders` + + returns complete order objects. + + + Default: `false`. + content-type: application/json + response: + docs: Success + type: root.SearchOrdersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + location_ids: + - 057P5VYJ4A5X1 + - 18YC4JDH91E1H + query: + filter: + state_filter: + states: + - COMPLETED + date_time_filter: + closed_at: + start_at: '2018-03-03T20:00:00+00:00' + end_at: '2019-03-04T21:54:45+00:00' + sort: + sort_field: CLOSED_AT + sort_order: DESC + limit: 3 + return_entries: true + response: + body: + order_entries: + - order_id: CAISEM82RcpmcFBM0TfOyiHV3es + version: 1 + location_id: 057P5VYJ4A5X1 + - order_id: CAISENgvlJ6jLWAzERDzjyHVybY + version: 1 + location_id: 18YC4JDH91E1H + - order_id: CAISEM52YcpmcWAzERDOyiWS3ty + version: 1 + location_id: 057P5VYJ4A5X1 + orders: + - id: id + location_id: location_id + reference_id: reference_id + customer_id: customer_id + line_items: + - quantity: quantity + taxes: + - {} + discounts: + - {} + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + created_at: created_at + updated_at: updated_at + closed_at: closed_at + state: OPEN + version: 1 + ticket_name: ticket_name + rewards: + - id: id + reward_tier_id: reward_tier_id + cursor: '123' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/orders/{order_id} + method: GET + auth: true + docs: Retrieves an [Order](entity:Order) by ID. + source: + openapi: openapi/openapi.json + display-name: RetrieveOrder + request: + name: GetOrdersRequest + path-parameters: + order_id: + type: string + docs: The ID of the order to retrieve. + response: + docs: Success + type: root.GetOrderResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + headers: + Square-Version: '2025-07-16' + response: + body: + order: + id: CAISENgvlJ6jLWAzERDzjyHVybY + location_id: D7AVYMEAPJ3A3 + reference_id: reference_id + source: + name: name + customer_id: customer_id + line_items: + - uid: ULkg0tQTRK2bkU9fNv3IJD + name: Item 1 + quantity: '1' + applied_discounts: + - uid: 9zr9S4dxvPAixvn0lpa1VC + discount_uid: zGsRZP69aqSSR9lq9euSPB + applied_money: + amount: 250 + currency: USD + base_price_money: + amount: 500 + currency: USD + variation_total_price_money: + amount: 500 + currency: USD + gross_sales_money: + amount: 500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 250 + currency: USD + total_money: + amount: 250 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: mumY8Nun4BC5aKe2yyx5a + name: Item 2 + quantity: '2' + applied_discounts: + - uid: qa8LwwZK82FgSEkQc2HYVC + discount_uid: zGsRZP69aqSSR9lq9euSPB + applied_money: + amount: 300 + currency: USD + base_price_money: + amount: 300 + currency: USD + variation_total_price_money: + amount: 600 + currency: USD + gross_sales_money: + amount: 600 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 300 + currency: USD + total_money: + amount: 300 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - {} + discounts: + - uid: zGsRZP69aqSSR9lq9euSPB + name: 50% Off + type: FIXED_PERCENTAGE + percentage: '50' + applied_money: + amount: 550 + currency: USD + scope: ORDER + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 550 + currency: USD + tax_money: + amount: 0 + currency: USD + discount_money: + amount: 550 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2020-05-18T16:30:49.614Z' + updated_at: '2020-05-18T16:30:49.614Z' + closed_at: closed_at + state: OPEN + version: 1 + total_money: + amount: 550 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 550 + currency: USD + total_tip_money: + amount: 0 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/orders/{order_id} + method: PUT + auth: true + docs: >- + Updates an open [order](entity:Order) by adding, replacing, or deleting + + fields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated. + + + An `UpdateOrder` request requires the following: + + + - The `order_id` in the endpoint path, identifying the order to update. + + - The latest `version` of the order to update. + + - The [sparse + order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) + + containing only the fields to update and the version to which the update + is + + being applied. + + - If deleting fields, the [dot notation + paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete) + + identifying the fields to clear. + + + To pay for an order, see + + [Pay for + Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). + source: + openapi: openapi/openapi.json + display-name: UpdateOrder + request: + name: UpdateOrderRequest + path-parameters: + order_id: + type: string + docs: The ID of the order to update. + body: + properties: + order: + type: optional + docs: >- + The [sparse + order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) + + containing only the fields to update and the version to which + the update is + + being applied. + fields_to_clear: + type: optional>> + docs: >- + The [dot notation + paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete) + + fields to clear. For example, `line_items[uid].note`. + + For more information, see [Deleting + fields](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#deleting-fields). + idempotency_key: + type: optional> + docs: >- + A value you specify that uniquely identifies this update + request. + + + If you are unsure whether a particular update was applied to an + order successfully, + + you can reattempt it with the same idempotency key without + + worrying about creating duplicate updates to the order. + + The latest order version is returned. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 192 + content-type: application/json + response: + docs: Success + type: root.UpdateOrderResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + headers: + Square-Version: '2025-07-16' + request: + order: + location_id: location_id + line_items: + - uid: cookie_uid + name: COOKIE + quantity: '2' + base_price_money: + amount: 200 + currency: USD + version: 1 + fields_to_clear: + - discounts + idempotency_key: UNIQUE_STRING + response: + body: + order: + id: DREk7wJcyXNHqULq8JJ2iPAsluJZY + location_id: MXVQSVNDGN3C8 + reference_id: reference_id + source: + name: Cookies + customer_id: customer_id + line_items: + - uid: EuYkakhmu3ksHIds5Hiot + name: Small Coffee + quantity: '1' + base_price_money: + amount: 500 + currency: USD + variation_total_price_money: + amount: 500 + currency: USD + gross_sales_money: + amount: 500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_money: + amount: 500 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: cookie_uid + name: COOKIE + quantity: '2' + base_price_money: + amount: 200 + currency: USD + variation_total_price_money: + amount: 400 + currency: USD + gross_sales_money: + amount: 400 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_money: + amount: 400 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - {} + discounts: + - {} + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 900 + currency: USD + tax_money: + amount: 0 + currency: USD + discount_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2019-08-23T18:26:18.243Z' + updated_at: '2019-08-23T18:33:47.523Z' + closed_at: closed_at + state: OPEN + version: 2 + total_money: + amount: 900 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + pay: + path: /v2/orders/{order_id}/pay + method: POST + auth: true + docs: >- + Pay for an [order](entity:Order) using one or more approved + [payments](entity:Payment) + + or settle an order with a total of `0`. + + + The total of the `payment_ids` listed in the request must be equal to + the order + + total. Orders with a total amount of `0` can be marked as paid by + specifying an empty + + array of `payment_ids` in the request. + + + To be used with `PayOrder`, a payment must: + + + - Reference the order by specifying the `order_id` when [creating the + payment](api-endpoint:Payments-CreatePayment). + + Any approved payments that reference the same `order_id` not specified + in the + + `payment_ids` is canceled. + + - Be approved with [delayed + capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture). + + Using a delayed capture payment with `PayOrder` completes the approved + payment. + source: + openapi: openapi/openapi.json + display-name: PayOrder + request: + name: PayOrderRequest + path-parameters: + order_id: + type: string + docs: The ID of the order being paid. + body: + properties: + idempotency_key: + type: string + docs: >- + A value you specify that uniquely identifies this request among + requests you have sent. If + + you are unsure whether a particular payment request was + completed successfully, you can reattempt + + it with the same idempotency key without worrying about + duplicate payments. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + maxLength: 192 + order_version: + type: optional> + docs: >- + The version of the order being paid. If not supplied, the latest + version will be paid. + payment_ids: + type: optional>> + docs: |- + The IDs of the [payments](entity:Payment) to collect. + The payment total must match the order total. + content-type: application/json + response: + docs: Success + type: root.PayOrderResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + headers: + Square-Version: '2025-07-16' + request: + idempotency_key: c043a359-7ad9-4136-82a9-c3f1d66dcbff + payment_ids: + - EnZdNAlWCmfh6Mt5FMNST1o7taB + - 0LRiVlbXVwe8ozu4KbZxd12mvaB + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + order: + id: lgwOlEityYPJtcuvKTVKT1pA986YY + location_id: P3CCK6HSNDAS7 + reference_id: reference_id + source: + name: Source Name + customer_id: customer_id + line_items: + - uid: QW6kofLHJK7JEKMjlSVP5C + name: Item 1 + quantity: '1' + base_price_money: + amount: 500 + currency: USD + gross_sales_money: + amount: 500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_money: + amount: 500 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: zhw8MNfRGdFQMI2WE1UBJD + name: Item 2 + quantity: '2' + base_price_money: + amount: 750 + currency: USD + gross_sales_money: + amount: 1500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_money: + amount: 1500 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - {} + discounts: + - {} + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 2000 + currency: USD + tax_money: + amount: 0 + currency: USD + discount_money: + amount: 0 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - id: EnZdNAlWCmfh6Mt5FMNST1o7taB + location_id: P3CCK6HSNDAS7 + transaction_id: lgwOlEityYPJtcuvKTVKT1pA986YY + created_at: '2019-08-06T02:47:36.293Z' + amount_money: + amount: 1000 + currency: USD + type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 2 + exp_year: 2022 + fingerprint: >- + sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ + entry_method: KEYED + payment_id: EnZdNAlWCmfh6Mt5FMNST1o7taB + - id: 0LRiVlbXVwe8ozu4KbZxd12mvaB + location_id: P3CCK6HSNDAS7 + transaction_id: lgwOlEityYPJtcuvKTVKT1pA986YY + created_at: '2019-08-06T02:47:36.809Z' + amount_money: + amount: 1000 + currency: USD + type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 2 + exp_year: 2022 + fingerprint: >- + sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ + entry_method: KEYED + payment_id: 0LRiVlbXVwe8ozu4KbZxd12mvaB + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2019-08-06T02:47:35.693Z' + updated_at: '2019-08-06T02:47:37.140Z' + closed_at: '2019-08-06T02:47:37.140Z' + state: COMPLETED + version: 4 + total_money: + amount: 2000 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/orders/customAttributeDefinitions.yml b/.mock/definition/orders/customAttributeDefinitions.yml new file mode 100644 index 000000000..db1cec64d --- /dev/null +++ b/.mock/definition/orders/customAttributeDefinitions.yml @@ -0,0 +1,388 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/orders/custom-attribute-definitions + method: GET + auth: true + docs: >- + Lists the order-related [custom attribute + definitions](entity:CustomAttributeDefinition) that belong to a Square + seller account. + + + When all response pages are retrieved, the results include all custom + attribute definitions + + that are visible to the requesting application, including those that are + created by other + + applications and set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. Note that + + seller-defined custom attributes (also known as custom fields) are + always set to `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attribute_definitions + source: + openapi: openapi/openapi.json + display-name: ListOrderCustomAttributeDefinitions + request: + name: ListCustomAttributeDefinitionsRequest + query-parameters: + visibility_filter: + type: optional> + docs: >- + Requests that all of the custom attributes be returned, or only + those that are read-only or read-write. + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + response: + docs: Success + type: root.ListOrderCustomAttributeDefinitionsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute_definitions: + - key: cover-count + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Cover count + description: The number of people seated at a table + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-11-16T18:03:44.051Z' + created_at: '2022-11-16T18:03:44.051Z' + - key: seat-number + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Seat number + description: The identifier for a particular seat + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-11-16T18:04:32.059Z' + created_at: '2022-11-16T18:04:32.059Z' + - key: table-number + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Table number + description: The identifier for a particular table + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-11-16T18:04:21.912Z' + created_at: '2022-11-16T18:04:21.912Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/orders/custom-attribute-definitions + method: POST + auth: true + docs: >- + Creates an order-related custom attribute definition. Use this endpoint + to + + define a custom attribute that can be associated with orders. + + + After creating a custom attribute definition, you can set the custom + attribute for orders + + in the Square seller account. + source: + openapi: openapi/openapi.json + display-name: CreateOrderCustomAttributeDefinition + request: + name: CreateOrderCustomAttributeDefinitionRequest + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition to create. Note the following: + + - With the exception of the `Selection` data type, the `schema` + is specified as a simple URL to the JSON schema + + definition hosted on the Square CDN. For more information, + including supported values and constraints, see + + [Specifying the + schema](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#specify-schema). + + - If provided, `name` must be unique (case-sensitive) across all + visible customer-related custom attribute definitions for the + seller. + + - All custom attributes are visible in exported customer data, + including those set to `VISIBILITY_HIDDEN`. + idempotency_key: + type: optional + docs: >- + A unique identifier for this request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateOrderCustomAttributeDefinitionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + custom_attribute_definition: + key: cover-count + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Cover count + description: The number of people seated at a table + visibility: VISIBILITY_READ_WRITE_VALUES + idempotency_key: IDEMPOTENCY_KEY + response: + body: + custom_attribute_definition: + key: cover-count + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Cover count + description: The number of people seated at a table + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-10-06T16:53:23.141Z' + created_at: '2022-10-06T16:53:23.141Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/orders/custom-attribute-definitions/{key} + method: GET + auth: true + docs: >- + Retrieves an order-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + + To retrieve a custom attribute definition created by another + application, the `visibility` + + setting must be `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveOrderCustomAttributeDefinition + request: + name: GetCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to retrieve. + query-parameters: + version: + type: optional> + docs: >- + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include this optional field and specify the current + version of the custom attribute. + response: + docs: Success + type: root.RetrieveOrderCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute_definition: + key: cover-count + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Cover count + description: The number of people seated at a table + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-10-06T16:53:23.141Z' + created_at: '2022-10-06T16:53:23.141Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/orders/custom-attribute-definitions/{key} + method: PUT + auth: true + docs: >- + Updates an order-related custom attribute definition for a Square seller + account. + + + Only the definition owner can update a custom attribute definition. Note + that sellers can view all custom attributes in exported customer data, + including those set to `VISIBILITY_HIDDEN`. + source: + openapi: openapi/openapi.json + display-name: UpdateOrderCustomAttributeDefinition + request: + name: UpdateOrderCustomAttributeDefinitionRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to update. + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition that contains the fields to + update. This endpoint supports sparse updates, + + so only new or changed fields need to be included in the + request. For more information, see + + [Updatable definition + fields](https://developer.squareup.com/docs/orders-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields). + + + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + control, include the optional `version` field and specify the + current version of the custom attribute definition. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateOrderCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + request: + custom_attribute_definition: + key: cover-count + visibility: VISIBILITY_READ_ONLY + version: 1 + idempotency_key: IDEMPOTENCY_KEY + response: + body: + custom_attribute_definition: + key: cover-count + schema: + ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Cover count + description: The number of people seated at a table + visibility: VISIBILITY_READ_ONLY + version: 2 + updated_at: '2022-11-16T17:44:11.436Z' + created_at: '2022-11-16T16:53:23.141Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/orders/custom-attribute-definitions/{key} + method: DELETE + auth: true + docs: >- + Deletes an order-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + + Only the definition owner can delete a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: DeleteOrderCustomAttributeDefinition + request: + name: DeleteCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to delete. + response: + docs: Success + type: root.DeleteOrderCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/orders/customAttributes.yml b/.mock/definition/orders/customAttributes.yml new file mode 100644 index 000000000..a626c6221 --- /dev/null +++ b/.mock/definition/orders/customAttributes.yml @@ -0,0 +1,561 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + batchDelete: + path: /v2/orders/custom-attributes/bulk-delete + method: POST + auth: true + docs: >- + Deletes order [custom attributes](entity:CustomAttribute) as a bulk + operation. + + + Use this endpoint to delete one or more custom attributes from one or + more orders. + + A custom attribute is based on a custom attribute definition in a Square + seller account. (To create a + + custom attribute definition, use the + [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) + endpoint.) + + + This `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 + individual delete + + requests and returns a map of individual delete responses. Each delete + request has a unique ID + + and provides an order ID and custom attribute. Each delete response is + returned with the ID + + of the corresponding request. + + + To delete a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkDeleteOrderCustomAttributes + request: + name: BulkDeleteOrderCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + A map of requests that correspond to individual delete + operations for custom attributes. + content-type: application/json + response: + docs: Success + type: root.BulkDeleteOrderCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + values: + cover-count: + key: cover-count + order_id: 7BbXGEIWNldxAzrtGf9GPVZTwZ4F + table-number: + key: table-number + order_id: 7BbXGEIWNldxAzrtGf9GPVZTwZ4F + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + values: + cover-count: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + table-number: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + batchUpsert: + path: /v2/orders/custom-attributes/bulk-upsert + method: POST + auth: true + docs: >- + Creates or updates order [custom attributes](entity:CustomAttribute) as + a bulk operation. + + + Use this endpoint to delete one or more custom attributes from one or + more orders. + + A custom attribute is based on a custom attribute definition in a Square + seller account. (To create a + + custom attribute definition, use the + [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) + endpoint.) + + + This `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 + individual upsert + + requests and returns a map of individual upsert responses. Each upsert + request has a unique ID + + and provides an order ID and custom attribute. Each upsert response is + returned with the ID + + of the corresponding request. + + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkUpsertOrderCustomAttributes + request: + name: BulkUpsertOrderCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + A map of requests that correspond to individual upsert + operations for custom attributes. + content-type: application/json + response: + docs: Success + type: root.BulkUpsertOrderCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + values: + cover-count: + custom_attribute: + key: cover-count + value: '6' + version: 2 + order_id: 7BbXGEIWNldxAzrtGf9GPVZTwZ4F + table-number: + custom_attribute: + key: table-number + value: '11' + version: 4 + order_id: 7BbXGEIWNldxAzrtGf9GPVZTwZ4F + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + values: + cover-count: + custom_attribute: + key: cover-count + value: '6' + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-22T21:28:35.721Z' + created_at: '2022-11-22T21:27:33.429Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + table-number: + custom_attribute: + key: table-number + value: '11' + visibility: VISIBILITY_HIDDEN + updated_at: '2022-11-22T21:28:35.726Z' + created_at: '2022-11-22T21:24:57.823Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + list: + path: /v2/orders/{order_id}/custom-attributes + method: GET + auth: true + docs: >- + Lists the [custom attributes](entity:CustomAttribute) associated with an + order. + + + You can use the `with_definitions` query parameter to also retrieve + custom attribute definitions + + in the same call. + + + When all response pages are retrieved, the results include all custom + attributes that are + + visible to the requesting application, including those that are owned by + other applications + + and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attributes + source: + openapi: openapi/openapi.json + display-name: ListOrderCustomAttributes + request: + name: ListCustomAttributesRequest + path-parameters: + order_id: + type: string + docs: The ID of the target [order](entity:Order). + query-parameters: + visibility_filter: + type: optional> + docs: >- + Requests that all of the custom attributes be returned, or only + those that are read-only or read-write. + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + with_definitions: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom attribute, + + information about the data type, or other definition details. The + default value is `false`. + response: + docs: Success + type: root.ListOrderCustomAttributesResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attributes: + - key: wayne-test-15 + value: TEST + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-10T17:31:36.111Z' + created_at: '2022-11-10T17:31:36.111Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/orders/{order_id}/custom-attributes/{custom_attribute_key} + method: GET + auth: true + docs: >- + Retrieves a [custom attribute](entity:CustomAttribute) associated with + an order. + + + You can use the `with_definition` query parameter to also retrieve the + custom attribute definition + + in the same call. + + + To retrieve a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that + seller-defined custom attributes + + also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveOrderCustomAttribute + request: + name: GetCustomAttributesRequest + path-parameters: + order_id: + type: string + docs: The ID of the target [order](entity:Order). + custom_attribute_key: + type: string + docs: >- + The key of the custom attribute to retrieve. This key must match + the key of an + + existing custom attribute definition. + query-parameters: + version: + type: optional> + docs: >- + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include this optional field and specify the current + version of the custom attribute. + with_definition: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom attribute, + + information about the data type, or other definition details. The + default value is `false`. + response: + docs: Success + type: root.RetrieveOrderCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + custom_attribute_key: custom_attribute_key + headers: + Square-Version: '2025-07-16' + response: + body: + custom_attribute: + key: cover-count + value: '6' + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-11-22T21:28:35.721Z' + created_at: '2022-11-22T21:27:33.429Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + upsert: + path: /v2/orders/{order_id}/custom-attributes/{custom_attribute_key} + method: POST + auth: true + docs: >- + Creates or updates a [custom attribute](entity:CustomAttribute) for an + order. + + + Use this endpoint to set the value of a custom attribute for a specific + order. + + A custom attribute is based on a custom attribute definition in a Square + seller account. (To create a + + custom attribute definition, use the + [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) + endpoint.) + + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: UpsertOrderCustomAttribute + request: + name: UpsertOrderCustomAttributeRequest + path-parameters: + order_id: + type: string + docs: The ID of the target [order](entity:Order). + custom_attribute_key: + type: string + docs: >- + The key of the custom attribute to create or update. This key + must match the key + + of an existing custom attribute definition. + body: + properties: + custom_attribute: + type: root.CustomAttribute + docs: >- + The custom attribute to create or update, with the following + fields: + + + - `value`. This value must conform to the `schema` specified by + the definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include this optional field and specify the current + version of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpsertOrderCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + custom_attribute_key: custom_attribute_key + headers: + Square-Version: '2025-07-16' + request: + custom_attribute: + key: table-number + value: '42' + version: 1 + response: + body: + custom_attribute: + key: table-number + value: '42' + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-10-06T20:41:22.673Z' + created_at: '2022-10-06T20:41:22.673Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/orders/{order_id}/custom-attributes/{custom_attribute_key} + method: DELETE + auth: true + docs: >- + Deletes a [custom attribute](entity:CustomAttribute) associated with a + customer profile. + + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: DeleteOrderCustomAttribute + request: + name: DeleteCustomAttributesRequest + path-parameters: + order_id: + type: string + docs: The ID of the target [order](entity:Order). + custom_attribute_key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match + the key of an + + existing custom attribute definition. + response: + docs: Success + type: root.DeleteOrderCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + custom_attribute_key: custom_attribute_key + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/payments.yml b/.mock/definition/payments.yml new file mode 100644 index 000000000..b2d02f6c2 --- /dev/null +++ b/.mock/definition/payments.yml @@ -0,0 +1,1618 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/payments + method: GET + auth: true + docs: >- + Retrieves a list of payments taken by the account making the request. + + + Results are eventually consistent, and new payments or changes to + payments might take several + + seconds to appear. + + + The maximum results per page is 100. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.payments + source: + openapi: openapi/openapi.json + display-name: ListPayments + request: + name: ListPaymentsRequest + query-parameters: + begin_time: + type: optional> + docs: >- + Indicates the start of the time range to retrieve payments for, in + RFC 3339 format. + + The range is determined using the `created_at` field for each + Payment. + + Inclusive. Default: The current time minus one year. + end_time: + type: optional> + docs: >- + Indicates the end of the time range to retrieve payments for, in + RFC 3339 format. The + + range is determined using the `created_at` field for each Payment. + + + Default: The current time. + sort_order: + type: optional> + docs: >- + The order in which results are listed by + `ListPaymentsRequest.sort_field`: + + - `ASC` - Oldest to newest. + + - `DESC` - Newest to oldest (default). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + location_id: + type: optional> + docs: >- + Limit results to the location supplied. By default, results are + returned + + for the default (main) location associated with the seller. + total: + type: optional> + docs: The exact amount in the `total_money` for a payment. + last_4: + type: optional> + docs: The last four digits of a payment card. + card_brand: + type: optional> + docs: The brand of the payment card (for example, VISA). + limit: + type: optional> + docs: >- + The maximum number of results to be returned in a single page. + + It is possible to receive fewer results than the specified limit + on a given page. + + + The default value of 100 is also the maximum allowed value. If the + provided value is + + greater than 100, it is ignored and the default value is used + instead. + + + Default: `100` + is_offline_payment: + type: optional> + default: false + docs: Whether the payment was taken offline or not. + offline_begin_time: + type: optional> + docs: >- + Indicates the start of the time range for which to retrieve + offline payments, in RFC 3339 + + format for timestamps. The range is determined using the + + `offline_payment_details.client_created_at` field for each + Payment. If set, payments without a + + value set in `offline_payment_details.client_created_at` will not + be returned. + + + Default: The current time. + offline_end_time: + type: optional> + docs: >- + Indicates the end of the time range for which to retrieve offline + payments, in RFC 3339 + + format for timestamps. The range is determined using the + + `offline_payment_details.client_created_at` field for each + Payment. If set, payments without a + + value set in `offline_payment_details.client_created_at` will not + be returned. + + + Default: The current time. + updated_at_begin_time: + type: optional> + docs: >- + Indicates the start of the time range to retrieve payments for, in + RFC 3339 format. The + + range is determined using the `updated_at` field for each Payment. + updated_at_end_time: + type: optional> + docs: >- + Indicates the end of the time range to retrieve payments for, in + RFC 3339 format. The + + range is determined using the `updated_at` field for each Payment. + sort_field: + type: optional> + docs: The field used to sort results by. The default is `CREATED_AT`. + response: + docs: Success + type: root.ListPaymentsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payments: + - id: bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + created_at: '2021-10-13T19:34:33.524Z' + updated_at: '2021-10-13T19:34:37.261Z' + amount_money: + amount: 555 + currency: USD + total_money: + amount: 555 + currency: USD + approved_money: + amount: 555 + currency: USD + processing_fee: + - effective_at: '2021-10-13T21:34:35.000Z' + type: INITIAL + amount_money: + amount: 34 + currency: USD + status: COMPLETED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T19:34:33.524Z' + source_type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: KEYED + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: 2Nkw7q + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T19:34:33.680Z' + captured_at: '2021-10-13T19:34:34.340Z' + cash_details: + buyer_supplied_money: {} + external_details: + type: type + source: source + location_id: L88917AVBK2S5 + order_id: d7eKah653Z579f3gVtjlxpSlmUcZY + reference_id: reference_id + customer_id: customer_id + employee_id: TMoK_ogh6rH1o4dV + team_member_id: TMoK_ogh6rH1o4dV + refund_ids: + - refund_ids + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + note: Test Note + statement_description_identifier: statement_description_identifier + capabilities: + - capabilities + receipt_number: bP9m + receipt_url: >- + https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + application_details: + square_product: VIRTUAL_TERMINAL + application_id: sq0ids-Pw67AZAlLVB7hsRmwlJPuA + is_offline_payment: true + version_token: vguW2km0KpVCdAXZcNTZ438qg5LlVPTP4HO5OpiHNfa6o + cursor: cursor + create: + path: /v2/payments + method: POST + auth: true + docs: >- + Creates a payment using the provided source. You can use this endpoint + + to charge a card (credit/debit card or + + Square gift card) or record a payment that the seller received outside + of Square + + (cash payment from a buyer or a payment that an external entity + + processed on behalf of the seller). + + + The endpoint creates a + + `Payment` object and returns it in the response. + source: + openapi: openapi/openapi.json + display-name: CreatePayment + request: + name: CreatePaymentRequest + body: + properties: + source_id: + type: string + docs: >- + The ID for the source of funds for this payment. + + This could be a payment token generated by the Web Payments SDK + for any of its + + [supported + methods](https://developer.squareup.com/docs/web-payments/overview#explore-payment-methods), + + including cards, bank transfers, Afterpay or Cash App Pay. If + recording a payment + + that the seller received outside of Square, specify either + "CASH" or "EXTERNAL". + + For more information, see + + [Take + Payments](https://developer.squareup.com/docs/payments-api/take-payments). + validation: + minLength: 1 + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreatePayment` request. + Keys can be any valid string + + but must be unique for every `CreatePayment` request. + + + Note: The number of allowed characters might be less than the + stated maximum, if multi-byte + + characters are used. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + maxLength: 45 + amount_money: + type: optional + docs: >- + The amount of money to accept for this payment, not including + `tip_money`. + + + The amount must be specified in the smallest denomination of the + applicable currency + + (for example, US dollar amounts are specified in cents). For + more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + + + The currency code must match the currency associated with the + business + + that is accepting the payment. + tip_money: + type: optional + docs: >- + The amount designated as a tip, in addition to `amount_money`. + + + The amount must be specified in the smallest denomination of the + applicable currency + + (for example, US dollar amounts are specified in cents). For + more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + + + The currency code must match the currency associated with the + business + + that is accepting the payment. + app_fee_money: + type: optional + docs: >- + The amount of money that the developer is taking as a fee + + for facilitating the payment on behalf of the seller. + + + The amount cannot be more than 90% of the total amount of the + payment. + + + The amount must be specified in the smallest denomination of the + applicable currency + + (for example, US dollar amounts are specified in cents). For + more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + + + The fee currency code must match the currency associated with + the seller + + that is accepting the payment. The application must be from a + developer + + account in the same country and using the same currency code as + the seller. + + + For more information about the application fee scenario, see + + [Take Payments and Collect + Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + + + To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth + permission is required. + + For more information, see + [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions). + delay_duration: + type: optional + docs: >- + The duration of time after the payment's creation when Square + automatically + + either completes or cancels the payment depending on the + `delay_action` field value. + + For more information, see + + [Time + threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). + + + This parameter should be specified as a time duration, in RFC + 3339 format. + + + Note: This feature is only supported for card payments. This + parameter can only be set for a delayed + + capture payment (`autocomplete=false`). + + + Default: + + + - Card-present payments: "PT36H" (36 hours) from the creation + time. + + - Card-not-present payments: "P7D" (7 days) from the creation + time. + delay_action: + type: optional + docs: >- + The action to be applied to the payment when the + `delay_duration` has elapsed. The action must be + + CANCEL or COMPLETE. For more information, see + + [Time + Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). + + + Default: CANCEL + autocomplete: + type: optional + docs: >- + If set to `true`, this payment will be completed when possible. + If + + set to `false`, this payment is held in an approved state until + either + + explicitly completed (captured) or canceled (voided). For more + information, see + + [Delayed + capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment). + + + Default: true + order_id: + type: optional + docs: Associates a previously created order with this payment. + customer_id: + type: optional + docs: >- + The [Customer](entity:Customer) ID of the customer associated + with the payment. + + + This is required if the `source_id` refers to a card on file + created using the Cards API. + location_id: + type: optional + docs: >- + The location ID to associate with the payment. If not specified, + the [main + location](https://developer.squareup.com/docs/locations-api#about-the-main-location) + is + + used. + team_member_id: + type: optional + docs: >- + An optional [TeamMember](entity:TeamMember) ID to associate + with + + this payment. + reference_id: + type: optional + docs: >- + A user-defined ID to associate with the payment. + + + You can use this field to associate the payment to an entity in + an external system + + (for example, you might specify an order ID that is generated by + a third-party shopping cart). + validation: + maxLength: 40 + verification_token: + type: optional + docs: >- + An identifying token generated by + [payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). + + Verification tokens encapsulate customer device information and + 3-D Secure + + challenge results to indicate that Square has verified the buyer + identity. + + + For more information, see [SCA + Overview](https://developer.squareup.com/docs/sca-overview). + accept_partial_authorization: + type: optional + docs: >- + If set to `true` and charging a Square Gift Card, a payment + might be returned with + + `amount_money` equal to less than what was requested. For + example, a request for $20 when charging + + a Square Gift Card with a balance of $5 results in an APPROVED + payment of $5. You might choose + + to prompt the buyer for an additional payment to cover the + remainder or cancel the Gift Card + + payment. This field cannot be `true` when `autocomplete = true`. + + + For more information, see + + [Partial amount with Square Gift + Cards](https://developer.squareup.com/docs/payments-api/take-payments#partial-payment-gift-card). + + + Default: false + buyer_email_address: + type: optional + docs: The buyer's email address. + validation: + maxLength: 255 + buyer_phone_number: + type: optional + docs: >- + The buyer's phone number. + + Must follow the following format: + + 1. A leading + symbol (followed by a country code) + + 2. The phone number can contain spaces and the special + characters `(` , `)` , `-` , and `.`. + + Alphabetical characters aren't allowed. + + 3. The phone number must contain between 9 and 16 digits. + billing_address: + type: optional + docs: The buyer's billing address. + shipping_address: + type: optional + docs: The buyer's shipping address. + note: + type: optional + docs: >- + An optional note to be entered by the developer when creating a + payment. + validation: + maxLength: 500 + statement_description_identifier: + type: optional + docs: >- + Optional additional payment information to include on the + customer's card statement + + as part of the statement description. This can be, for example, + an invoice number, ticket number, + + or short description that uniquely identifies the purchase. + + + Note that the `statement_description_identifier` might get + truncated on the statement description + + to fit the required information including the Square identifier + (SQ *) and name of the + + seller taking the payment. + validation: + maxLength: 20 + cash_details: + type: optional + docs: >- + Additional details required when recording a cash payment + (`source_id` is CASH). + external_details: + type: optional + docs: >- + Additional details required when recording an external payment + (`source_id` is EXTERNAL). + customer_details: + type: optional + docs: Details about the customer making the payment. + offline_payment_details: + type: optional + docs: >- + An optional field for specifying the offline payment details. + This is intended for + + internal 1st-party callers only. + content-type: application/json + response: + docs: Success + type: root.CreatePaymentResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + source_id: ccof:GaJGNaZa8x4OgDJn4GB + idempotency_key: 7b0f3ec5-086a-4871-8f13-3c81b3875218 + amount_money: + amount: 1000 + currency: USD + app_fee_money: + amount: 10 + currency: USD + autocomplete: true + customer_id: W92WH6P11H4Z77CTET0RNTGFW8 + location_id: L88917AVBK2S5 + reference_id: '123456' + note: Brief description + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment: + id: R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY + created_at: '2021-10-13T21:14:29.577Z' + updated_at: '2021-10-13T21:14:30.504Z' + amount_money: + amount: 1000 + currency: USD + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + total_money: + amount: 1000 + currency: USD + app_fee_money: + amount: 10 + currency: USD + approved_money: + amount: 1000 + currency: USD + processing_fee: + - {} + refunded_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: COMPLETED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T21:14:29.577Z' + source_type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: ON_FILE + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: vNEn2f + application_identifier: application_identifier + application_name: application_name + application_cryptogram: application_cryptogram + verification_method: verification_method + verification_results: verification_results + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T21:14:29.732Z' + captured_at: '2021-10-13T21:14:30.504Z' + refund_requires_card_presence: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + cash_details: + buyer_supplied_money: {} + bank_account_details: + bank_name: bank_name + transfer_type: transfer_type + account_ownership_type: account_ownership_type + fingerprint: fingerprint + country: country + statement_description: statement_description + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + external_details: + type: type + source: source + source_id: source_id + wallet_details: + status: status + brand: brand + buy_now_pay_later_details: + brand: brand + square_account_details: + payment_source_token: payment_source_token + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + location_id: L88917AVBK2S5 + order_id: pRsjRTgFWATl7so6DxdKBJa7ssbZY + reference_id: '123456' + customer_id: W92WH6P11H4Z77CTET0RNTGFW8 + employee_id: employee_id + team_member_id: team_member_id + refund_ids: + - refund_ids + risk_evaluation: + created_at: '2021-10-13T21:14:30.423Z' + risk_level: NORMAL + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + billing_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + note: Brief Description + statement_description_identifier: statement_description_identifier + capabilities: + - capabilities + receipt_number: R2B3 + receipt_url: https://squareup.com/receipt/preview/EXAMPLE_RECEIPT_ID + device_details: + device_id: device_id + device_installation_id: device_installation_id + device_name: device_name + application_details: + square_product: ECOMMERCE_API + application_id: sq0ids-TcgftTEtKxJTRF1lCFJ9TA + is_offline_payment: true + offline_payment_details: + client_created_at: client_created_at + version_token: TPtNEOBOa6Qq6E3C3IjckSVOM6b3hMbfhjvTxHBQUsB6o + cancelByIdempotencyKey: + path: /v2/payments/cancel + method: POST + auth: true + docs: >- + Cancels (voids) a payment identified by the idempotency key that is + specified in the + + request. + + + Use this method when the status of a `CreatePayment` request is unknown + (for example, after you send a + + `CreatePayment` request, a network error occurs and you do not get a + response). In this case, you can + + direct Square to cancel the payment using this endpoint. In the request, + you provide the same + + idempotency key that you provided in your `CreatePayment` request that + you want to cancel. After + + canceling the payment, you can submit your `CreatePayment` request + again. + + + Note that if no payment with the specified idempotency key is found, no + action is taken and the endpoint + + returns successfully. + source: + openapi: openapi/openapi.json + display-name: CancelPaymentByIdempotencyKey + request: + name: CancelPaymentByIdempotencyKeyRequest + body: + properties: + idempotency_key: + type: string + docs: The `idempotency_key` identifying the payment to be canceled. + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CancelPaymentByIdempotencyKeyResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: a7e36d40-d24b-11e8-b568-0800200c9a66 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/payments/{payment_id} + method: GET + auth: true + docs: Retrieves details for a specific payment. + source: + openapi: openapi/openapi.json + display-name: GetPayment + request: + name: GetPaymentsRequest + path-parameters: + payment_id: + type: string + docs: A unique ID for the desired payment. + response: + docs: Success + type: root.GetPaymentResponse + status-code: 200 + examples: + - path-parameters: + payment_id: payment_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment: + id: bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + created_at: '2021-10-13T19:34:33.524Z' + updated_at: '2021-10-13T19:34:34.339Z' + amount_money: + amount: 555 + currency: USD + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + total_money: + amount: 555 + currency: USD + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + approved_money: + amount: 555 + currency: USD + processing_fee: + - effective_at: '2021-10-13T21:34:35.000Z' + type: INITIAL + amount_money: + amount: 34 + currency: USD + refunded_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: COMPLETED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T19:34:33.524Z' + source_type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: KEYED + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: 2Nkw7q + application_identifier: application_identifier + application_name: application_name + application_cryptogram: application_cryptogram + verification_method: verification_method + verification_results: verification_results + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T19:34:33.680Z' + captured_at: '2021-10-13T19:34:34.340Z' + refund_requires_card_presence: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + cash_details: + buyer_supplied_money: {} + bank_account_details: + bank_name: bank_name + transfer_type: transfer_type + account_ownership_type: account_ownership_type + fingerprint: fingerprint + country: country + statement_description: statement_description + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + external_details: + type: type + source: source + source_id: source_id + wallet_details: + status: status + brand: brand + buy_now_pay_later_details: + brand: brand + square_account_details: + payment_source_token: payment_source_token + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + location_id: L88917AVBK2S5 + order_id: d7eKah653Z579f3gVtjlxpSlmUcZY + reference_id: reference_id + customer_id: customer_id + employee_id: TMoK_ogh6rH1o4dV + team_member_id: TMoK_ogh6rH1o4dV + refund_ids: + - refund_ids + risk_evaluation: + created_at: created_at + risk_level: PENDING + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + billing_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + note: Test Note + statement_description_identifier: statement_description_identifier + capabilities: + - capabilities + receipt_number: bP9m + receipt_url: >- + https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + device_details: + device_id: device_id + device_installation_id: device_installation_id + device_name: device_name + application_details: + square_product: VIRTUAL_TERMINAL + application_id: sq0ids-Pw67AZAlLVB7hsRmwlJPuA + is_offline_payment: true + offline_payment_details: + client_created_at: client_created_at + version_token: 56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o + update: + path: /v2/payments/{payment_id} + method: PUT + auth: true + docs: |- + Updates a payment with the APPROVED status. + You can update the `amount_money` and `tip_money` using this endpoint. + source: + openapi: openapi/openapi.json + display-name: UpdatePayment + request: + name: UpdatePaymentRequest + path-parameters: + payment_id: + type: string + docs: The ID of the payment to update. + body: + properties: + payment: + type: optional + docs: The updated `Payment` object. + idempotency_key: + type: string + docs: >- + A unique string that identifies this `UpdatePayment` request. + Keys can be any valid string + + but must be unique for every `UpdatePayment` request. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdatePaymentResponse + status-code: 200 + examples: + - path-parameters: + payment_id: payment_id + headers: + Square-Version: '2025-07-16' + request: + payment: + amount_money: + amount: 1000 + currency: USD + tip_money: + amount: 100 + currency: USD + version_token: ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o + idempotency_key: 956f8b13-e4ec-45d6-85e8-d1d95ef0c5de + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment: + id: 1QjqpBVyrI9S4H9sTGDWU9JeiWdZY + created_at: '2021-10-13T20:26:44.191Z' + updated_at: '2021-10-13T20:26:44.364Z' + amount_money: + amount: 1000 + currency: USD + tip_money: + amount: 100 + currency: USD + total_money: + amount: 1100 + currency: USD + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + approved_money: + amount: 1000 + currency: USD + processing_fee: + - {} + refunded_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: APPROVED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T20:26:44.191Z' + source_type: CARD + card_details: + status: AUTHORIZED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: ON_FILE + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: 68aLBM + application_identifier: application_identifier + application_name: application_name + application_cryptogram: application_cryptogram + verification_method: verification_method + verification_results: verification_results + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T20:26:44.364Z' + refund_requires_card_presence: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + cash_details: + buyer_supplied_money: {} + bank_account_details: + bank_name: bank_name + transfer_type: transfer_type + account_ownership_type: account_ownership_type + fingerprint: fingerprint + country: country + statement_description: statement_description + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + external_details: + type: type + source: source + source_id: source_id + wallet_details: + status: status + brand: brand + buy_now_pay_later_details: + brand: brand + square_account_details: + payment_source_token: payment_source_token + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + location_id: L88917AVBK2S5 + order_id: nUSN9TdxpiK3SrQg3wzmf6r8LP9YY + reference_id: reference_id + customer_id: W92WH6P11H4Z77CTET0RNTGFW8 + employee_id: employee_id + team_member_id: team_member_id + refund_ids: + - refund_ids + risk_evaluation: + created_at: '2021-10-13T20:26:45.271Z' + risk_level: NORMAL + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + billing_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + note: Example Note + statement_description_identifier: statement_description_identifier + capabilities: + - EDIT_AMOUNT_UP + - EDIT_AMOUNT_DOWN + - EDIT_TIP_AMOUNT_UP + - EDIT_TIP_AMOUNT_DOWN + receipt_number: 1Qjq + receipt_url: receipt_url + device_details: + device_id: device_id + device_installation_id: device_installation_id + device_name: device_name + application_details: + square_product: ECOMMERCE_API + application_id: sq0ids-TcgftTEtKxJTRF1lCFJ9TA + is_offline_payment: true + offline_payment_details: + client_created_at: client_created_at + version_token: rDrXnqiS7fJgexccgdpzmwqTiXui1aIKCp9EchZ7trE6o + cancel: + path: /v2/payments/{payment_id}/cancel + method: POST + auth: true + docs: >- + Cancels (voids) a payment. You can use this endpoint to cancel a payment + with + + the APPROVED `status`. + source: + openapi: openapi/openapi.json + display-name: CancelPayment + request: + name: CancelPaymentsRequest + path-parameters: + payment_id: + type: string + docs: The ID of the payment to cancel. + response: + docs: Success + type: root.CancelPaymentResponse + status-code: 200 + examples: + - path-parameters: + payment_id: payment_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment: + id: 1QjqpBVyrI9S4H9sTGDWU9JeiWdZY + created_at: '2021-10-13T20:26:44.191Z' + updated_at: '2021-10-13T20:31:21.597Z' + amount_money: + amount: 1000 + currency: USD + tip_money: + amount: 100 + currency: USD + total_money: + amount: 1100 + currency: USD + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + approved_money: + amount: 1000 + currency: USD + processing_fee: + - {} + refunded_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: CANCELED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T20:26:44.191Z' + source_type: CARD + card_details: + status: VOIDED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: ON_FILE + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: 68aLBM + application_identifier: application_identifier + application_name: application_name + application_cryptogram: application_cryptogram + verification_method: verification_method + verification_results: verification_results + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T20:26:44.364Z' + voided_at: '2021-10-13T20:31:21.597Z' + refund_requires_card_presence: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + cash_details: + buyer_supplied_money: {} + bank_account_details: + bank_name: bank_name + transfer_type: transfer_type + account_ownership_type: account_ownership_type + fingerprint: fingerprint + country: country + statement_description: statement_description + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + external_details: + type: type + source: source + source_id: source_id + wallet_details: + status: status + brand: brand + buy_now_pay_later_details: + brand: brand + square_account_details: + payment_source_token: payment_source_token + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + location_id: L88917AVBK2S5 + order_id: nUSN9TdxpiK3SrQg3wzmf6r8LP9YY + reference_id: reference_id + customer_id: W92WH6P11H4Z77CTET0RNTGFW8 + employee_id: employee_id + team_member_id: team_member_id + refund_ids: + - refund_ids + risk_evaluation: + created_at: '2021-10-13T20:26:45.271Z' + risk_level: NORMAL + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + billing_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + note: Example Note + statement_description_identifier: statement_description_identifier + capabilities: + - capabilities + receipt_number: receipt_number + receipt_url: receipt_url + device_details: + device_id: device_id + device_installation_id: device_installation_id + device_name: device_name + application_details: + square_product: ECOMMERCE_API + application_id: sq0ids-TcgftTEtKxJTRF1lCFJ9TA + is_offline_payment: true + offline_payment_details: + client_created_at: client_created_at + version_token: N8AGYgEjCiY9Q57Jw7aVHEpBq8bzGCDCQMRX8Vs56N06o + complete: + path: /v2/payments/{payment_id}/complete + method: POST + auth: true + docs: >- + Completes (captures) a payment. + + By default, payments are set to complete immediately after they are + created. + + + You can use this endpoint to complete a payment with the APPROVED + `status`. + source: + openapi: openapi/openapi.json + display-name: CompletePayment + request: + name: CompletePaymentRequest + path-parameters: + payment_id: + type: string + docs: The unique ID identifying the payment to be completed. + body: + properties: + version_token: + type: optional> + docs: >- + Used for optimistic concurrency. This opaque token identifies + the current `Payment` + + version that the caller expects. If the server has a different + version of the Payment, + + the update fails and a response with a VERSION_MISMATCH error is + returned. + content-type: application/json + response: + docs: Success + type: root.CompletePaymentResponse + status-code: 200 + examples: + - path-parameters: + payment_id: payment_id + headers: + Square-Version: '2025-07-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment: + id: bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + created_at: '2021-10-13T19:34:33.524Z' + updated_at: '2021-10-13T19:34:34.339Z' + amount_money: + amount: 555 + currency: USD + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + total_money: + amount: 555 + currency: USD + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + approved_money: + amount: 555 + currency: USD + processing_fee: + - effective_at: '2021-10-13T21:34:35.000Z' + type: INITIAL + amount_money: + amount: 34 + currency: USD + refunded_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: COMPLETED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T19:34:33.524Z' + source_type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: KEYED + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: 2Nkw7q + application_identifier: application_identifier + application_name: application_name + application_cryptogram: application_cryptogram + verification_method: verification_method + verification_results: verification_results + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T19:34:33.680Z' + captured_at: '2021-10-13T19:34:34.340Z' + refund_requires_card_presence: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + cash_details: + buyer_supplied_money: {} + bank_account_details: + bank_name: bank_name + transfer_type: transfer_type + account_ownership_type: account_ownership_type + fingerprint: fingerprint + country: country + statement_description: statement_description + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + external_details: + type: type + source: source + source_id: source_id + wallet_details: + status: status + brand: brand + buy_now_pay_later_details: + brand: brand + square_account_details: + payment_source_token: payment_source_token + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + location_id: L88917AVBK2S5 + order_id: d7eKah653Z579f3gVtjlxpSlmUcZY + reference_id: reference_id + customer_id: customer_id + employee_id: TMoK_ogh6rH1o4dV + team_member_id: TMoK_ogh6rH1o4dV + refund_ids: + - refund_ids + risk_evaluation: + created_at: created_at + risk_level: PENDING + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + billing_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + note: Test Note + statement_description_identifier: statement_description_identifier + capabilities: + - capabilities + receipt_number: bP9m + receipt_url: >- + https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + device_details: + device_id: device_id + device_installation_id: device_installation_id + device_name: device_name + application_details: + square_product: VIRTUAL_TERMINAL + application_id: sq0ids-Pw67AZAlLVB7hsRmwlJPuA + is_offline_payment: true + offline_payment_details: + client_created_at: client_created_at + version_token: 56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/payouts.yml b/.mock/definition/payouts.yml new file mode 100644 index 000000000..c404acb3b --- /dev/null +++ b/.mock/definition/payouts.yml @@ -0,0 +1,282 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/payouts + method: GET + auth: true + docs: >- + Retrieves a list of all payouts for the default location. + + You can filter payouts by location ID, status, time range, and order + them in ascending or descending order. + + To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.payouts + source: + openapi: openapi/openapi.json + display-name: ListPayouts + request: + name: ListPayoutsRequest + query-parameters: + location_id: + type: optional> + docs: >- + The ID of the location for which to list the payouts. + + By default, payouts are returned for the default (main) location + associated with the seller. + status: + type: optional> + docs: If provided, only payouts with the given status are returned. + begin_time: + type: optional> + docs: >- + The timestamp for the beginning of the payout creation time, in + RFC 3339 format. + + Inclusive. Default: The current time minus one year. + end_time: + type: optional> + docs: >- + The timestamp for the end of the payout creation time, in RFC 3339 + format. + + Default: The current time. + sort_order: + type: optional> + docs: The order in which payouts are listed. + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + + If request parameters change between requests, subsequent results + may contain duplicates or missing records. + limit: + type: optional> + docs: >- + The maximum number of results to be returned in a single page. + + It is possible to receive fewer results than the specified limit + on a given page. + + The default value of 100 is also the maximum allowed value. If the + provided value is + + greater than 100, it is ignored and the default value is used + instead. + + Default: `100` + response: + docs: Success + type: root.ListPayoutsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + payouts: + - id: po_b345d2c7-90b3-4f0b-a2aa-df1def7f8afc + status: PAID + location_id: L88917AVBK2S5 + created_at: '2022-03-29T16:12:31Z' + updated_at: '2022-03-30T01:07:22.875Z' + amount_money: + amount: 6259 + destination: + type: CARD + id: ccof:ZPp3oedR3AeEUNd3z7 + version: 2 + type: BATCH + payout_fee: + - amount_money: + amount: 95 + effective_at: '2022-03-29T16:12:31Z' + type: TRANSFER_FEE + arrival_date: '2022-03-29' + end_to_end_id: L2100000005 + - id: po_f3c0fb38-a5ce-427d-b858-52b925b72e45 + status: PAID + location_id: L88917AVBK2S5 + created_at: '2022-03-24T03:07:09Z' + updated_at: '2022-03-24T03:07:09Z' + amount_money: + amount: -103 + destination: + type: BANK_ACCOUNT + id: bact:ZPp3oedR3AeEUNd3z7 + version: 1 + type: BATCH + payout_fee: + - {} + arrival_date: '2022-03-24' + end_to_end_id: L2100000006 + cursor: >- + EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/payouts/{payout_id} + method: GET + auth: true + docs: |- + Retrieves details of a specific payout identified by a payout ID. + To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: GetPayout + request: + name: GetPayoutsRequest + path-parameters: + payout_id: + type: string + docs: The ID of the payout to retrieve the information for. + response: + docs: Success + type: root.GetPayoutResponse + status-code: 200 + examples: + - path-parameters: + payout_id: payout_id + headers: + Square-Version: '2025-07-16' + response: + body: + payout: + id: po_f3c0fb38-a5ce-427d-b858-52b925b72e45 + status: PAID + location_id: L88917AVBK2S5 + created_at: '2022-03-24T03:07:09Z' + updated_at: '2022-03-24T03:07:09Z' + amount_money: + amount: -103 + currency: UNKNOWN_CURRENCY + destination: + type: BANK_ACCOUNT + id: bact:ZPp3oedR3AeEUNd3z7 + version: 1 + type: BATCH + payout_fee: + - {} + arrival_date: '2022-03-24' + end_to_end_id: end_to_end_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + ListEntries: + path: /v2/payouts/{payout_id}/payout-entries + method: GET + auth: true + docs: |- + Retrieves a list of all payout entries for a specific payout. + To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.payout_entries + source: + openapi: openapi/openapi.json + display-name: ListPayoutEntries + request: + name: ListEntriesPayoutsRequest + path-parameters: + payout_id: + type: string + docs: The ID of the payout to retrieve the information for. + query-parameters: + sort_order: + type: optional> + docs: The order in which payout entries are listed. + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + + If request parameters change between requests, subsequent results + may contain duplicates or missing records. + limit: + type: optional> + docs: >- + The maximum number of results to be returned in a single page. + + It is possible to receive fewer results than the specified limit + on a given page. + + The default value of 100 is also the maximum allowed value. If the + provided value is + + greater than 100, it is ignored and the default value is used + instead. + + Default: `100` + response: + docs: Success + type: root.ListPayoutEntriesResponse + status-code: 200 + examples: + - path-parameters: + payout_id: payout_id + headers: + Square-Version: '2025-07-16' + response: + body: + payout_entries: + - id: poe_ZQWcw41d0SGJS6IWd4cSi8mKHk + payout_id: po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6 + effective_at: '2021-12-14T23:31:49Z' + type: REFUND + gross_amount_money: + amount: -50 + fee_amount_money: + amount: -2 + net_amount_money: + amount: -48 + type_refund_details: + payment_id: HVdG62HeMlti8YYf94oxrN + refund_id: HVdG62HeMlti8YYf94oxrN_dR8Nztxg7umf94oxrN12Ji5r2KW14FAY + - id: poe_EibbY9Ob1d0SGJS6IWd4cSiSi6wkaPk + payout_id: po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6 + effective_at: '2021-12-14T23:31:49Z' + type: CHARGE + gross_amount_money: + amount: 100 + fee_amount_money: + amount: 19 + net_amount_money: + amount: 81 + type_charge_details: + payment_id: HVdG62H5K3291d0SGJS6IWd4cSi8YY + cursor: >- + TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/refunds.yml b/.mock/definition/refunds.yml new file mode 100644 index 000000000..c267c5920 --- /dev/null +++ b/.mock/definition/refunds.yml @@ -0,0 +1,489 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/refunds + method: GET + auth: true + docs: >- + Retrieves a list of refunds for the account making the request. + + + Results are eventually consistent, and new refunds or changes to refunds + might take several + + seconds to appear. + + + The maximum results per page is 100. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.refunds + source: + openapi: openapi/openapi.json + display-name: ListPaymentRefunds + request: + name: ListRefundsRequest + query-parameters: + begin_time: + type: optional> + docs: >- + Indicates the start of the time range to retrieve each + `PaymentRefund` for, in RFC 3339 + + format. The range is determined using the `created_at` field for + each `PaymentRefund`. + + + Default: The current time minus one year. + end_time: + type: optional> + docs: >- + Indicates the end of the time range to retrieve each + `PaymentRefund` for, in RFC 3339 + + format. The range is determined using the `created_at` field for + each `PaymentRefund`. + + + Default: The current time. + sort_order: + type: optional> + docs: >- + The order in which results are listed by + `PaymentRefund.created_at`: + + - `ASC` - Oldest to newest. + + - `DESC` - Newest to oldest (default). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + location_id: + type: optional> + docs: >- + Limit results to the location supplied. By default, results are + returned + + for all locations associated with the seller. + status: + type: optional> + docs: >- + If provided, only refunds with the given status are returned. + + For a list of refund status values, see + [PaymentRefund](entity:PaymentRefund). + + + Default: If omitted, refunds are returned regardless of their + status. + source_type: + type: optional> + docs: >- + If provided, only returns refunds whose payments have the + indicated source type. + + Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, + and `EXTERNAL`. + + For information about these payment source types, see + + [Take + Payments](https://developer.squareup.com/docs/payments-api/take-payments). + + + Default: If omitted, refunds are returned regardless of the source + type. + limit: + type: optional> + docs: >- + The maximum number of results to be returned in a single page. + + + It is possible to receive fewer results than the specified limit + on a given page. + + + If the supplied value is greater than 100, no more than 100 + results are returned. + + + Default: 100 + updated_at_begin_time: + type: optional> + docs: >- + Indicates the start of the time range to retrieve each + `PaymentRefund` for, in RFC 3339 + + format. The range is determined using the `updated_at` field for + each `PaymentRefund`. + + + Default: If omitted, the time range starts at `begin_time`. + updated_at_end_time: + type: optional> + docs: >- + Indicates the end of the time range to retrieve each + `PaymentRefund` for, in RFC 3339 + + format. The range is determined using the `updated_at` field for + each `PaymentRefund`. + + + Default: The current time. + sort_field: + type: optional> + docs: The field used to sort results by. The default is `CREATED_AT`. + response: + docs: Success + type: root.ListPaymentRefundsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refunds: + - id: >- + bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd + status: COMPLETED + location_id: L88917AVBK2S5 + unlinked: true + destination_type: destination_type + amount_money: + amount: 555 + currency: USD + processing_fee: + - effective_at: '2021-10-13T21:34:35.000Z' + type: INITIAL + amount_money: + amount: -34 + currency: USD + payment_id: bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + order_id: 9ltv0bx5PuvGXUYHYHxYSKEqC3IZY + reason: Example Refund + created_at: '2021-10-13T19:59:05.342Z' + updated_at: '2021-10-13T20:00:03.497Z' + team_member_id: team_member_id + terminal_refund_id: terminal_refund_id + cursor: >- + 5evquW1YswHoT4EoyUhzMmTsCnsSXBU9U0WJ4FU4623nrMQcocH0RGU6Up1YkwfiMcF59ood58EBTEGgzMTGHQJpocic7ExOL0NtrTXCeWcv0UJIJNk8eXb + RefundPayment: + path: /v2/refunds + method: POST + auth: true + docs: >- + Refunds a payment. You can refund the entire payment amount or a + + portion of it. You can use this endpoint to refund a card payment or + record a + + refund of a cash or external payment. For more information, see + + [Refund + Payment](https://developer.squareup.com/docs/payments-api/refund-payments). + source: + openapi: openapi/openapi.json + display-name: RefundPayment + request: + name: RefundPaymentRequest + body: + properties: + idempotency_key: + type: string + docs: >2- + A unique string that identifies this `RefundPayment` request. The key can be any valid string + but must be unique for every `RefundPayment` request. + + + Keys are limited to a max of 45 characters - however, the number + of allowed characters might be + + less than 45, if multi-byte characters are used. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + amount_money: + type: root.Money + docs: >- + The amount of money to refund. + + + This amount cannot be more than the `total_money` value of the + payment minus the total + + amount of all previously completed refunds for this payment. + + + This amount must be specified in the smallest denomination of + the applicable currency + + (for example, US dollar amounts are specified in cents). For + more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + + + The currency code must match the currency associated with the + business + + that is charging the card. + app_fee_money: + type: optional + docs: >- + The amount of money the developer contributes to help cover the + refunded amount. + + This amount is specified in the smallest denomination of the + applicable currency (for example, + + US dollar amounts are specified in cents). + + + The value cannot be more than the `amount_money`. + + + You can specify this parameter in a refund request only if the + same parameter was also included + + when taking the payment. This is part of the application fee + scenario the API supports. For more + + information, see [Take Payments and Collect + Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + + + To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth + permission is required. + + For more information, see + [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions). + payment_id: + type: optional> + docs: |- + The unique ID of the payment being refunded. + Required when unlinked=false, otherwise must not be set. + destination_id: + type: optional> + docs: >- + The ID indicating where funds will be refunded to. Required for + unlinked refunds. For more + + information, see [Process an Unlinked + Refund](https://developer.squareup.com/docs/refunds-api/unlinked-refunds). + + + For refunds linked to Square payments, `destination_id` is + usually omitted; in this case, funds + + will be returned to the original payment source. The field may + be specified in order to request + + a cross-method refund to a gift card. For more information, + + see [Cross-method refunds to gift + cards](https://developer.squareup.com/docs/payments-api/refund-payments#cross-method-refunds-to-gift-cards). + unlinked: + type: optional> + docs: >- + Indicates that the refund is not linked to a Square payment. + + If set to true, `destination_id` and `location_id` must be + supplied while `payment_id` must not + + be provided. + location_id: + type: optional> + docs: >- + The location ID associated with the unlinked refund. + + Required for requests specifying `unlinked=true`. + + Otherwise, if included when `unlinked=false`, will throw an + error. + validation: + maxLength: 50 + customer_id: + type: optional> + docs: >- + The [Customer](entity:Customer) ID of the customer associated + with the refund. + + This is required if the `destination_id` refers to a card on + file created using the Cards + + API. Only allowed when `unlinked=true`. + reason: + type: optional> + docs: A description of the reason for the refund. + validation: + maxLength: 192 + payment_version_token: + type: optional> + docs: >2- + Used for optimistic concurrency. This opaque token identifies the current `Payment` + version that the caller expects. If the server has a different + version of the Payment, + + the update fails and a response with a VERSION_MISMATCH error is + returned. + + If the versions match, or the field is not provided, the refund + proceeds as normal. + team_member_id: + type: optional> + docs: >- + An optional [TeamMember](entity:TeamMember) ID to associate with + this refund. + validation: + maxLength: 192 + cash_details: + type: optional + docs: >- + Additional details required when recording an unlinked cash + refund (`destination_id` is CASH). + external_details: + type: optional + docs: >- + Additional details required when recording an unlinked external + refund + + (`destination_id` is EXTERNAL). + content-type: application/json + response: + docs: Success + type: root.RefundPaymentResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 9b7f2dcf-49da-4411-b23e-a2d6af21333a + amount_money: + amount: 1000 + currency: USD + app_fee_money: + amount: 10 + currency: USD + payment_id: R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY + reason: Example + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: >- + R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY_KlWP8IC1557ddwc9QWTKrCVU6m0JXDz15R2Qym5eQfR + status: PENDING + location_id: L88917AVBK2S5 + unlinked: true + destination_type: destination_type + destination_details: + cash_details: + seller_supplied_money: {} + external_details: + type: type + source: source + amount_money: + amount: 1000 + currency: USD + app_fee_money: + amount: 10 + currency: USD + processing_fee: + - {} + payment_id: R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY + order_id: 1JLEUZeEooAIX8HMqm9kvWd69aQZY + reason: Example + created_at: '2021-10-13T21:23:19.116Z' + updated_at: '2021-10-13T21:23:19.508Z' + team_member_id: team_member_id + terminal_refund_id: terminal_refund_id + get: + path: /v2/refunds/{refund_id} + method: GET + auth: true + docs: Retrieves a specific refund using the `refund_id`. + source: + openapi: openapi/openapi.json + display-name: GetPaymentRefund + request: + name: GetRefundsRequest + path-parameters: + refund_id: + type: string + docs: The unique ID for the desired `PaymentRefund`. + response: + docs: Success + type: root.GetPaymentRefundResponse + status-code: 200 + examples: + - path-parameters: + refund_id: refund_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: >- + bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd + status: COMPLETED + location_id: L88917AVBK2S5 + unlinked: true + destination_type: destination_type + destination_details: + cash_details: + seller_supplied_money: {} + external_details: + type: type + source: source + amount_money: + amount: 555 + currency: USD + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + processing_fee: + - effective_at: '2021-10-13T21:34:35.000Z' + type: INITIAL + amount_money: + amount: -34 + currency: USD + payment_id: bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + order_id: 9ltv0bx5PuvGXUYHYHxYSKEqC3IZY + reason: Example Refund + created_at: '2021-10-13T19:59:05.073Z' + updated_at: '2021-10-13T20:00:02.442Z' + team_member_id: team_member_id + terminal_refund_id: terminal_refund_id + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/sites.yml b/.mock/definition/sites.yml new file mode 100644 index 000000000..91dc19f5e --- /dev/null +++ b/.mock/definition/sites.yml @@ -0,0 +1,52 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/sites + method: GET + auth: true + docs: >- + Lists the Square Online sites that belong to a seller. Sites are listed + in descending order by the `created_at` date. + + + + __Note:__ Square Online APIs are publicly available as part of an early + access program. For more information, see [Early access program for + Square Online + APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + source: + openapi: openapi/openapi.json + display-name: ListSites + response: + docs: Success + type: root.ListSitesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + sites: + - id: site_278075276488921835 + site_title: My Second Site + domain: mysite2.square.site + is_published: false + created_at: '2020-10-28T13:22:51.000000Z' + updated_at: '2020-10-28T13:22:51.000000Z' + - id: site_102725345836253849 + site_title: My First Site + domain: mysite1.square.site + is_published: true + created_at: '2020-06-18T17:45:13.000000Z' + updated_at: '2020-11-23T02:19:10.000000Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/snippets.yml b/.mock/definition/snippets.yml new file mode 100644 index 000000000..95732fccd --- /dev/null +++ b/.mock/definition/snippets.yml @@ -0,0 +1,162 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + get: + path: /v2/sites/{site_id}/snippet + method: GET + auth: true + docs: >- + Retrieves your snippet from a Square Online site. A site can contain + snippets from multiple snippet applications, but you can retrieve only + the snippet that was added by your application. + + + You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of + the sites that belong to a seller. + + + + __Note:__ Square Online APIs are publicly available as part of an early + access program. For more information, see [Early access program for + Square Online + APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + source: + openapi: openapi/openapi.json + display-name: RetrieveSnippet + request: + name: GetSnippetsRequest + path-parameters: + site_id: + type: string + docs: The ID of the site that contains the snippet. + response: + docs: Success + type: root.GetSnippetResponse + status-code: 200 + examples: + - path-parameters: + site_id: site_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + snippet: + id: snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7 + site_id: site_278075276488921835 + content: + created_at: '2021-03-11T25:40:09.000000Z' + updated_at: '2021-03-11T25:40:09.000000Z' + upsert: + path: /v2/sites/{site_id}/snippet + method: POST + auth: true + docs: >- + Adds a snippet to a Square Online site or updates the existing snippet + on the site. + + The snippet code is appended to the end of the `head` element on every + page of the site, except checkout pages. A snippet application can add + one snippet to a given site. + + + You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of + the sites that belong to a seller. + + + + __Note:__ Square Online APIs are publicly available as part of an early + access program. For more information, see [Early access program for + Square Online + APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + source: + openapi: openapi/openapi.json + display-name: UpsertSnippet + request: + name: UpsertSnippetRequest + path-parameters: + site_id: + type: string + docs: The ID of the site where you want to add or update the snippet. + body: + properties: + snippet: + type: root.Snippet + docs: The snippet for the site. + content-type: application/json + response: + docs: Success + type: root.UpsertSnippetResponse + status-code: 200 + examples: + - path-parameters: + site_id: site_id + headers: + Square-Version: '2025-07-16' + request: + snippet: + content: + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + snippet: + id: snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7 + site_id: site_278075276488921835 + content: + created_at: '2021-03-11T25:40:09.000000Z' + updated_at: '2021-03-11T25:40:09.000000Z' + delete: + path: /v2/sites/{site_id}/snippet + method: DELETE + auth: true + docs: >- + Removes your snippet from a Square Online site. + + + You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of + the sites that belong to a seller. + + + + __Note:__ Square Online APIs are publicly available as part of an early + access program. For more information, see [Early access program for + Square Online + APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + source: + openapi: openapi/openapi.json + display-name: DeleteSnippet + request: + name: DeleteSnippetsRequest + path-parameters: + site_id: + type: string + docs: The ID of the site that contains the snippet. + response: + docs: Success + type: root.DeleteSnippetResponse + status-code: 200 + examples: + - path-parameters: + site_id: site_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/subscriptions.yml b/.mock/definition/subscriptions.yml new file mode 100644 index 000000000..e66a6e8a4 --- /dev/null +++ b/.mock/definition/subscriptions.yml @@ -0,0 +1,1239 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/subscriptions + method: POST + auth: true + docs: >- + Enrolls a customer in a subscription. + + + If you provide a card on file in the request, Square charges the card + for + + the subscription. Otherwise, Square sends an invoice to the customer's + email + + address. The subscription starts immediately, unless the request + includes + + the optional `start_date`. Each individual subscription is associated + with a particular location. + + + For more information, see [Create a + subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription). + source: + openapi: openapi/openapi.json + display-name: CreateSubscription + request: + name: CreateSubscriptionRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies this `CreateSubscription` + request. + + If you do not provide a unique string (or provide an empty + string as the value), + + the endpoint treats each request as independent. + + + For more information, see [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + location_id: + type: string + docs: The ID of the location the subscription is associated with. + validation: + minLength: 1 + plan_variation_id: + type: optional + docs: >- + The ID of the [subscription plan + variation](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations#plan-variations) + created using the Catalog API. + customer_id: + type: string + docs: >- + The ID of the [customer](entity:Customer) subscribing to the + subscription plan variation. + validation: + minLength: 1 + start_date: + type: optional + docs: |- + The `YYYY-MM-DD`-formatted date to start the subscription. + If it is unspecified, the subscription starts immediately. + canceled_date: + type: optional + docs: >- + The `YYYY-MM-DD`-formatted date when the newly created + subscription is scheduled for cancellation. + + + This date overrides the cancellation date set in the plan + variation configuration. + + If the cancellation date is earlier than the end date of a + subscription cycle, the subscription stops + + at the canceled date and the subscriber is sent a prorated + invoice at the beginning of the canceled cycle. + + + When the subscription plan of the newly created subscription has + a fixed number of cycles and the `canceled_date` + + occurs before the subscription plan expires, the specified + `canceled_date` sets the date when the subscription + + stops through the end of the last cycle. + tax_percentage: + type: optional + docs: >- + The tax to add when billing the subscription. + + The percentage is expressed in decimal form, using a `'.'` as + the decimal + + separator and without a `'%'` sign. For example, a value of 7.5 + + corresponds to 7.5%. + validation: + maxLength: 10 + price_override_money: + type: optional + docs: >- + A custom price which overrides the cost of a subscription plan + variation with `STATIC` pricing. + + This field does not affect itemized subscriptions with + `RELATIVE` pricing. Instead, + + you should edit the Subscription's [order + template](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#phases-and-order-templates). + card_id: + type: optional + docs: >- + The ID of the [subscriber's](entity:Customer) + [card](entity:Card) to charge. + + If it is not specified, the subscriber receives an invoice via + email with a link to pay for their subscription. + timezone: + type: optional + docs: >- + The timezone that is used in date calculations for the + subscription. If unset, defaults to + + the location timezone. If a timezone is not configured for the + location, defaults to "America/New_York". + + Format: the IANA Timezone Database identifier for the location + timezone. For + + a list of time zones, see [List of tz database time + zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + source: + type: optional + docs: The origination details of the subscription. + monthly_billing_anchor_date: + type: optional + docs: The day-of-the-month to change the billing date to. + validation: + min: 1 + max: 31 + phases: + type: optional> + docs: array of phases for this subscription + content-type: application/json + response: + docs: Success + type: root.CreateSubscriptionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 8193148c-9586-11e6-99f9-28cfe92138cf + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2023-06-20' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + phases: + - ordinal: 0 + order_template_id: U2NaowWxzXwpsZU697x7ZHOAnCNZY + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 56214fb2-cc85-47a1-93bc-44f3766bb56f + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2023-06-20' + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + price_override_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + version: 1 + created_at: '2023-06-20T21:53:10Z' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - uid: 873451e0-745b-4e87-ab0b-c574933fe616 + ordinal: 0 + order_template_id: U2NaowWxzXwpsZU697x7ZHOAnCNZY + plan_phase_uid: X2Q2AONPB3RB64Y27S25QCZP + BulkSwapPlan: + path: /v2/subscriptions/bulk-swap-plan + method: POST + auth: true + docs: >- + Schedules a plan variation change for all active subscriptions under a + given plan + + variation. For more information, see [Swap Subscription Plan + Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). + source: + openapi: openapi/openapi.json + display-name: BulkSwapPlan + request: + name: BulkSwapPlanRequest + body: + properties: + new_plan_variation_id: + type: string + docs: |- + The ID of the new subscription plan variation. + + This field is required. + validation: + minLength: 1 + old_plan_variation_id: + type: string + docs: >- + The ID of the plan variation whose subscriptions should be + swapped. Active subscriptions + + using this plan variation will be subscribed to the new plan + variation on their next billing + + day. + validation: + minLength: 1 + location_id: + type: string + docs: >- + The ID of the location to associate with the swapped + subscriptions. + validation: + minLength: 1 + content-type: application/json + response: + docs: Success + type: root.BulkSwapPlanResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + new_plan_variation_id: FQ7CDXXWSLUJRPM3GFJSJGZ7 + old_plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + location_id: S8GWD5R9QB376 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + affected_subscriptions: 12 + search: + path: /v2/subscriptions/search + method: POST + auth: true + docs: >- + Searches for subscriptions. + + + Results are ordered chronologically by subscription creation date. If + + the request specifies more than one location ID, + + the endpoint orders the result + + by location ID, and then by creation date within each location. If no + locations are given + + in the query, all locations are searched. + + + You can also optionally specify `customer_ids` to search by customer. + + If left unset, all customers + + associated with the specified locations are returned. + + If the request specifies customer IDs, the endpoint orders results + + first by location, within location by customer ID, and within + + customer by subscription creation date. + source: + openapi: openapi/openapi.json + display-name: SearchSubscriptions + request: + name: SearchSubscriptionsRequest + body: + properties: + cursor: + type: optional + docs: >- + When the total number of resulting subscriptions exceeds the + limit of a paged response, + + specify the cursor returned from a preceding response here to + fetch the next set of results. + + If the cursor is unset, the response contains the last page of + the results. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional + docs: |- + The upper limit on the number of subscriptions to return + in a paged response. + validation: + min: 1 + query: + type: optional + docs: >- + A subscription query consisting of specified filtering + conditions. + + + If this `query` field is unspecified, the `SearchSubscriptions` + call will return all subscriptions. + include: + type: optional> + docs: >- + An option to include related information in the response. + + + The supported values are: + + + - `actions`: to include scheduled actions on the targeted + subscriptions. + content-type: application/json + response: + docs: Success + type: root.SearchSubscriptionsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + customer_ids: + - CHFGVKYY8RSV93M5KCYTG4PN0G + location_ids: + - S8GWD5R9QB376 + source_names: + - My App + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscriptions: + - id: de86fc96-8664-474b-af1a-abbe59cacf0e + location_id: S8GWD5R9QB376 + plan_variation_id: L3TJVDHVBEQEGQDEZL2JJM7R + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2021-10-20' + canceled_date: '2021-10-30' + charged_through_date: '2021-11-20' + status: CANCELED + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + version: 1000000 + created_at: '2021-10-20T21:53:10Z' + card_id: ccof:mueUsvgajChmjEbp4GB + timezone: UTC + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + - id: 56214fb2-cc85-47a1-93bc-44f3766bb56f + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2022-01-19' + canceled_date: canceled_date + charged_through_date: '2022-08-19' + status: PAUSED + tax_percentage: '5' + invoice_ids: + - grebK0Q_l8H4fqoMMVvt-Q + - rcX_i3sNmHTGKhI4W2mceA + price_override_money: + amount: 1000 + currency: USD + version: 2 + created_at: '2022-01-19T21:53:10Z' + card_id: card_id + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + - id: 56214fb2-cc85-47a1-93bc-44f3766bb56f + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2023-06-20' + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + version: 1 + created_at: '2023-06-20T21:53:10Z' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - uid: 873451e0-745b-4e87-ab0b-c574933fe616 + ordinal: 0 + order_template_id: U2NaowWxzXwpsZU697x7ZHOAnCNZY + plan_phase_uid: X2Q2AONPB3RB64Y27S25QCZP + cursor: cursor + get: + path: /v2/subscriptions/{subscription_id} + method: GET + auth: true + docs: Retrieves a specific subscription. + source: + openapi: openapi/openapi.json + display-name: RetrieveSubscription + request: + name: GetSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to retrieve. + query-parameters: + include: + type: optional> + docs: >- + A query parameter to specify related information to be included in + the response. + + + The supported query parameter values are: + + + - `actions`: to include scheduled actions on the targeted + subscription. + response: + docs: Success + type: root.GetSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 8151fc89-da15-4eb9-a685-1a70883cebfc + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + start_date: '2022-07-27' + canceled_date: canceled_date + charged_through_date: '2023-11-20' + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + - inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA + price_override_money: + amount: 25000 + currency: USD + version: 1000000 + created_at: '2022-07-27T21:53:10Z' + card_id: ccof:IkWfpLj4tNHMyFii3GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + update: + path: /v2/subscriptions/{subscription_id} + method: PUT + auth: true + docs: >- + Updates a subscription by modifying or clearing `subscription` field + values. + + To clear a field, set its value to `null`. + source: + openapi: openapi/openapi.json + display-name: UpdateSubscription + request: + name: UpdateSubscriptionRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to update. + body: + properties: + subscription: + type: optional + docs: >- + The subscription object containing the current version, and + fields to update. + + Unset fields will be left at their current server values, and + JSON `null` values will + + be treated as a request to clear the relevant data. + content-type: application/json + response: + docs: Success + type: root.UpdateSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + request: + subscription: + card_id: '{NEW CARD ID}' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 7217d8ca-1fee-4446-a9e5-8540b5d8c9bb + location_id: LPJKHYR7WFDKN + plan_variation_id: XOUNEKCE6NSXQW5NTSQ73MMX + customer_id: AM69AB81FT4479YH9HGWS1HZY8 + start_date: '2023-01-30' + canceled_date: canceled_date + charged_through_date: '2023-03-13' + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - inv:0-ChAPSfVYvNewckgf3x4iigN_ENMM + - inv:0-ChBQaCCLfjcm9WEUBGxvuydJENMM + price_override_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + version: 3 + created_at: '2023-01-30T19:27:32Z' + card_id: '{NEW CARD ID}' + timezone: UTC + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + DeleteAction: + path: /v2/subscriptions/{subscription_id}/actions/{action_id} + method: DELETE + auth: true + docs: Deletes a scheduled action for a subscription. + source: + openapi: openapi/openapi.json + display-name: DeleteSubscriptionAction + request: + name: DeleteActionSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription the targeted action is to act upon. + action_id: + type: string + docs: The ID of the targeted action to be deleted. + response: + docs: Success + type: root.DeleteSubscriptionActionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + action_id: action_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 8151fc89-da15-4eb9-a685-1a70883cebfc + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + start_date: '2022-07-27' + canceled_date: canceled_date + charged_through_date: '2023-11-20' + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + - inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA + price_override_money: + amount: 25000 + currency: USD + version: 1000000 + created_at: '2022-07-27T21:53:10Z' + card_id: ccof:IkWfpLj4tNHMyFii3GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + ChangeBillingAnchorDate: + path: /v2/subscriptions/{subscription_id}/billing-anchor + method: POST + auth: true + docs: >- + Changes the [billing anchor + date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates) + + for a subscription. + source: + openapi: openapi/openapi.json + display-name: ChangeBillingAnchorDate + request: + name: ChangeBillingAnchorDateRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to update the billing anchor date. + body: + properties: + monthly_billing_anchor_date: + type: optional> + docs: The anchor day for the billing cycle. + validation: + min: 1 + max: 31 + effective_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date when the scheduled + `BILLING_ANCHOR_CHANGE` action takes + + place on the subscription. + + + When this date is unspecified or falls within the current + billing cycle, the billing anchor date + + is changed immediately. + content-type: application/json + response: + docs: Success + type: root.ChangeBillingAnchorDateResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + request: + monthly_billing_anchor_date: 1 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 9ba40961-995a-4a3d-8c53-048c40cafc13 + location_id: S8GWD5R9QB376 + plan_variation_id: FQ7CDXXWSLUJRPM3GFJSJGZ7 + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: start_date + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + price_override_money: + amount: 2000 + currency: USD + version: 3 + created_at: '2023-06-20T21:53:10Z' + card_id: card_id + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 20 + phases: + - uid: 98d6f53b-40e1-4714-8827-032fd923be25 + ordinal: 0 + order_template_id: E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY + plan_phase_uid: C66BKH3ASTDYGJJCEZXQQSS7 + actions: + - id: f0a1dfdc-675b-3a14-a640-99f7ac1cee83 + type: CHANGE_BILLING_ANCHOR_DATE + effective_date: '2023-11-01' + monthly_billing_anchor_date: 1 + phases: + - {} + new_plan_variation_id: new_plan_variation_id + cancel: + path: /v2/subscriptions/{subscription_id}/cancel + method: POST + auth: true + docs: >- + Schedules a `CANCEL` action to cancel an active subscription. This + + sets the `canceled_date` field to the end of the active billing period. + After this date, + + the subscription status changes from ACTIVE to CANCELED. + source: + openapi: openapi/openapi.json + display-name: CancelSubscription + request: + name: CancelSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to cancel. + response: + docs: Success + type: root.CancelSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 910afd30-464a-4e00-a8d8-2296e + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2022-01-19' + canceled_date: '2023-06-05' + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + - inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA + price_override_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + version: 3 + created_at: '2022-01-19T21:53:10Z' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + actions: + - id: id + type: CANCEL + effective_date: effective_date + monthly_billing_anchor_date: 1 + phases: + - {} + new_plan_variation_id: new_plan_variation_id + listEvents: + path: /v2/subscriptions/{subscription_id}/events + method: GET + auth: true + docs: >- + Lists all + [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) + for a specific subscription. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.subscription_events + source: + openapi: openapi/openapi.json + display-name: ListSubscriptionEvents + request: + name: ListEventsSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to retrieve the events for. + query-parameters: + cursor: + type: optional> + docs: >- + When the total number of resulting subscription events exceeds the + limit of a paged response, + + specify the cursor returned from a preceding response here to + fetch the next set of results. + + If the cursor is unset, the response contains the last page of the + results. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: |- + The upper limit on the number of subscription events to return + in a paged response. + response: + docs: Success + type: root.ListSubscriptionEventsResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription_events: + - id: 06809161-3867-4598-8269-8aea5be4f9de + subscription_event_type: START_SUBSCRIPTION + effective_date: '2020-04-24' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + - id: f2736603-cd2e-47ec-8675-f815fff54f88 + subscription_event_type: DEACTIVATE_SUBSCRIPTION + effective_date: '2020-05-01' + monthly_billing_anchor_date: 1 + info: + detail: >- + The customer with ID `V74BMG0GPS2KNCWJE1BTYJ37Y0` does not + have a name on record. + code: CUSTOMER_NO_NAME + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + - id: b426fc85-6859-450b-b0d0-fe3a5d1b565f + subscription_event_type: RESUME_SUBSCRIPTION + effective_date: '2022-05-01' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + - id: 09f14de1-2f53-4dae-9091-49aa53f83d01 + subscription_event_type: PAUSE_SUBSCRIPTION + effective_date: '2022-09-01' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + - id: f28a73ac-1a1b-4b0f-8eeb-709a72945776 + subscription_event_type: RESUME_SUBSCRIPTION + effective_date: '2022-12-01' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + - id: 1eee8790-472d-4efe-8c69-8ad84e9cefe0 + subscription_event_type: PLAN_CHANGE + effective_date: '2023-04-01' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 02CD53CFA4d1498AFAD42 + - id: a0c08083-5db0-4800-85c7-d398de4fbb6e + subscription_event_type: STOP_SUBSCRIPTION + effective_date: '2023-06-21' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + cursor: cursor + pause: + path: /v2/subscriptions/{subscription_id}/pause + method: POST + auth: true + docs: Schedules a `PAUSE` action to pause an active subscription. + source: + openapi: openapi/openapi.json + display-name: PauseSubscription + request: + name: PauseSubscriptionRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to pause. + body: + properties: + pause_effective_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date when the scheduled `PAUSE` + action takes place on the subscription. + + + When this date is unspecified or falls within the current + billing cycle, the subscription is paused + + on the starting date of the next billing cycle. + pause_cycle_duration: + type: optional> + docs: >- + The number of billing cycles the subscription will be paused + before it is reactivated. + + + When this is set, a `RESUME` action is also scheduled to take + place on the subscription at + + the end of the specified pause cycle duration. In this case, + neither `resume_effective_date` + + nor `resume_change_timing` may be specified. + resume_effective_date: + type: optional> + docs: >- + The date when the subscription is reactivated by a scheduled + `RESUME` action. + + This date must be at least one billing cycle ahead of + `pause_effective_date`. + resume_change_timing: + type: optional + docs: >- + The timing whether the subscription is reactivated immediately + or at the end of the billing cycle, relative to + + `resume_effective_date`. + + See [ChangeTiming](#type-changetiming) for possible values + pause_reason: + type: optional> + docs: The user-provided reason to pause the subscription. + validation: + maxLength: 255 + content-type: application/json + response: + docs: Success + type: root.PauseSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 56214fb2-cc85-47a1-93bc-44f3766bb56f + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2023-06-20' + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + price_override_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + version: 1 + created_at: '2023-06-20T21:53:10Z' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - uid: 873451e0-745b-4e87-ab0b-c574933fe616 + ordinal: 0 + order_template_id: U2NaowWxzXwpsZU697x7ZHOAnCNZY + plan_phase_uid: X2Q2AONPB3RB64Y27S25QCZP + actions: + - id: 99b2439e-63f7-3ad5-95f7-ab2447a80673 + type: PAUSE + effective_date: '2023-11-17' + monthly_billing_anchor_date: 1 + phases: + - {} + new_plan_variation_id: new_plan_variation_id + resume: + path: /v2/subscriptions/{subscription_id}/resume + method: POST + auth: true + docs: >- + Schedules a `RESUME` action to resume a paused or a deactivated + subscription. + source: + openapi: openapi/openapi.json + display-name: ResumeSubscription + request: + name: ResumeSubscriptionRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to resume. + body: + properties: + resume_effective_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date when the subscription + reactivated. + resume_change_timing: + type: optional + docs: |- + The timing to resume a subscription, relative to the specified + `resume_effective_date` attribute value. + See [ChangeTiming](#type-changetiming) for possible values + content-type: application/json + response: + docs: Success + type: root.ResumeSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 56214fb2-cc85-47a1-93bc-44f3766bb56f + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2023-06-20' + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + price_override_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + version: 1 + created_at: '2023-06-20T21:53:10Z' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - uid: 873451e0-745b-4e87-ab0b-c574933fe616 + ordinal: 0 + order_template_id: U2NaowWxzXwpsZU697x7ZHOAnCNZY + plan_phase_uid: X2Q2AONPB3RB64Y27S25QCZP + actions: + - id: 18ff74f4-3da4-30c5-929f-7d6fca84f115 + type: RESUME + effective_date: '2023-09-01' + monthly_billing_anchor_date: 1 + phases: + - {} + new_plan_variation_id: new_plan_variation_id + SwapPlan: + path: /v2/subscriptions/{subscription_id}/swap-plan + method: POST + auth: true + docs: >- + Schedules a `SWAP_PLAN` action to swap a subscription plan variation in + an existing subscription. + + For more information, see [Swap Subscription Plan + Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). + source: + openapi: openapi/openapi.json + display-name: SwapPlan + request: + name: SwapPlanRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to swap the subscription plan for. + body: + properties: + new_plan_variation_id: + type: optional> + docs: |- + The ID of the new subscription plan variation. + + This field is required. + phases: + type: optional>> + docs: >- + A list of PhaseInputs, to pass phase-specific information used + in the swap. + content-type: application/json + response: + docs: Success + type: root.SwapPlanResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + request: + new_plan_variation_id: FQ7CDXXWSLUJRPM3GFJSJGZ7 + phases: + - ordinal: 0 + order_template_id: uhhnjH9osVv3shUADwaC0b3hNxQZY + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 9ba40961-995a-4a3d-8c53-048c40cafc13 + location_id: S8GWD5R9QB376 + plan_variation_id: FQ7CDXXWSLUJRPM3GFJSJGZ7 + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: start_date + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + price_override_money: + amount: 2000 + currency: USD + version: 3 + created_at: '2023-06-20T21:53:10Z' + card_id: card_id + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - uid: 98d6f53b-40e1-4714-8827-032fd923be25 + ordinal: 0 + order_template_id: E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY + plan_phase_uid: C66BKH3ASTDYGJJCEZXQQSS7 + actions: + - id: f0a1dfdc-675b-3a14-a640-99f7ac1cee83 + type: SWAP_PLAN + effective_date: '2023-11-17' + monthly_billing_anchor_date: 1 + phases: + - ordinal: 0 + order_template_id: uhhnjH9osVv3shUADwaC0b3hNxQZY + new_plan_variation_id: FQ7CDXXWSLUJRPM3GFJSJGZ7 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/team.yml b/.mock/definition/team.yml new file mode 100644 index 000000000..9b12d8525 --- /dev/null +++ b/.mock/definition/team.yml @@ -0,0 +1,218 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + ListJobs: + path: /v2/team-members/jobs + method: GET + auth: true + docs: >- + Lists jobs in a seller account. Results are sorted by title in ascending + order. + source: + openapi: openapi/openapi.json + display-name: ListJobs + request: + name: ListJobsRequest + query-parameters: + cursor: + type: optional> + docs: >- + The pagination cursor returned by the previous call to this + endpoint. Provide this + + cursor to retrieve the next page of results for your original + request. For more information, + + see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListJobsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + jobs: + - id: VDNpRv8da51NU8qZFC5zDWpF + title: Cashier + is_tip_eligible: true + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + version: 2 + - id: FjS8x95cqHiMenw4f1NAUH4P + title: Chef + is_tip_eligible: false + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + version: 1 + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + CreateJob: + path: /v2/team-members/jobs + method: POST + auth: true + docs: >- + Creates a job in a seller account. A job defines a title and tip + eligibility. Note that + + compensation is defined in a [job assignment](entity:JobAssignment) in a + team member's wage setting. + source: + openapi: openapi/openapi.json + display-name: CreateJob + request: + name: CreateJobRequest + body: + properties: + job: + type: root.Job + docs: >- + The job to create. The `title` field is required and + `is_tip_eligible` defaults to true. + idempotency_key: + type: string + docs: >- + A unique identifier for the `CreateJob` request. Keys can be any + valid string, + + but must be unique for each request. For more information, see + + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateJobResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + job: + title: Cashier + is_tip_eligible: true + idempotency_key: idempotency-key-0 + response: + body: + job: + id: 1yJlHapkseYnNPETIU1B + title: Cashier + is_tip_eligible: true + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + version: 1 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + RetrieveJob: + path: /v2/team-members/jobs/{job_id} + method: GET + auth: true + docs: Retrieves a specified job. + source: + openapi: openapi/openapi.json + display-name: RetrieveJob + request: + name: RetrieveJobRequest + path-parameters: + job_id: + type: string + docs: The ID of the job to retrieve. + response: + docs: Success + type: root.RetrieveJobResponse + status-code: 200 + examples: + - path-parameters: + job_id: job_id + headers: + Square-Version: '2025-07-16' + response: + body: + job: + id: 1yJlHapkseYnNPETIU1B + title: Cashier 1 + is_tip_eligible: true + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + version: 2 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + UpdateJob: + path: /v2/team-members/jobs/{job_id} + method: PUT + auth: true + docs: >- + Updates the title or tip eligibility of a job. Changes to the title + propagate to all + + `JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference + the job ID. Changes to + + tip eligibility propagate to all `TeamMemberWage` objects that reference + the job ID. + source: + openapi: openapi/openapi.json + display-name: UpdateJob + request: + name: UpdateJobRequest + path-parameters: + job_id: + type: string + docs: The ID of the job to update. + body: + properties: + job: + type: root.Job + docs: >- + The job with the updated fields, either `title`, + `is_tip_eligible`, or both. Only changed fields need + + to be included in the request. Optionally include `version` to + enable optimistic concurrency control. + content-type: application/json + response: + docs: Success + type: root.UpdateJobResponse + status-code: 200 + examples: + - path-parameters: + job_id: job_id + headers: + Square-Version: '2025-07-16' + request: + job: + title: Cashier 1 + is_tip_eligible: true + response: + body: + job: + id: 1yJlHapkseYnNPETIU1B + title: Cashier 1 + is_tip_eligible: true + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-13T12:55:45Z' + version: 2 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/teamMembers.yml b/.mock/definition/teamMembers.yml new file mode 100644 index 000000000..cfef0122f --- /dev/null +++ b/.mock/definition/teamMembers.yml @@ -0,0 +1,777 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/team-members + method: POST + auth: true + docs: >- + Creates a single `TeamMember` object. The `TeamMember` object is + returned on successful creates. + + You must provide the following values in your request to this endpoint: + + - `given_name` + + - `family_name` + + + Learn about [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#createteammember). + source: + openapi: openapi/openapi.json + display-name: CreateTeamMember + request: + body: root.CreateTeamMemberRequest + content-type: application/json + response: + docs: Success + type: root.CreateTeamMemberResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: idempotency-key-0 + team_member: + reference_id: reference_id_1 + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@gmail.com + phone_number: '+14159283333' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - YSGH2WBKG94QZ + - GA2Y9HSJ8KRYT + wage_setting: + job_assignments: + - pay_type: SALARY + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + response: + body: + team_member: + id: 1yJlHapkseYnNPETIU1B + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@example.com + phone_number: '+14159283333' + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - GA2Y9HSJ8KRYT + - YSGH2WBKG94QZ + wage_setting: + team_member_id: 1yJlHapkseYnNPETIU1B + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 1443 + currency: USD + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchCreate: + path: /v2/team-members/bulk-create + method: POST + auth: true + docs: >- + Creates multiple `TeamMember` objects. The created `TeamMember` objects + are returned on successful creates. + + This process is non-transactional and processes as much of the request + as possible. If one of the creates in + + the request cannot be successfully processed, the request is not marked + as failed, but the body of the response + + contains explicit error information for the failed create. + + + Learn about [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members). + source: + openapi: openapi/openapi.json + display-name: BulkCreateTeamMembers + request: + name: BatchCreateTeamMembersRequest + body: + properties: + team_members: + type: map + docs: >- + The data used to create the `TeamMember` objects. Each key is + the `idempotency_key` that maps to the + `CreateTeamMemberRequest`. + + The maximum number of create objects is 25. + + + If you include a team member's `wage_setting`, you must provide + `job_id` for each job assignment. To get job IDs, + + call [ListJobs](api-endpoint:Team-ListJobs). + content-type: application/json + response: + docs: Success + type: root.BatchCreateTeamMembersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + team_members: + idempotency-key-1: + team_member: + reference_id: reference_id_1 + given_name: Joe + family_name: Doe + email_address: joe_doe@gmail.com + phone_number: '+14159283333' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - YSGH2WBKG94QZ + - GA2Y9HSJ8KRYT + idempotency-key-2: + team_member: + reference_id: reference_id_2 + given_name: Jane + family_name: Smith + email_address: jane_smith@gmail.com + phone_number: '+14159223334' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + response: + body: + team_members: + idempotency-key-1: + team_member: + id: ywhG1qfIOoqsHfVRubFV + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@gmail.com + phone_number: '+14159283333' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - GA2Y9HSJ8KRYT + - YSGH2WBKG94QZ + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + idempotency-key-2: + team_member: + id: IF_Ncrg7fHhCqxVI9T6R + reference_id: reference_id_2 + is_owner: false + status: ACTIVE + given_name: Jane + family_name: Smith + email_address: jane_smith@gmail.com + phone_number: '+14159223334' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchUpdate: + path: /v2/team-members/bulk-update + method: POST + auth: true + docs: >- + Updates multiple `TeamMember` objects. The updated `TeamMember` objects + are returned on successful updates. + + This process is non-transactional and processes as much of the request + as possible. If one of the updates in + + the request cannot be successfully processed, the request is not marked + as failed, but the body of the response + + contains explicit error information for the failed update. + + Learn about [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members). + source: + openapi: openapi/openapi.json + display-name: BulkUpdateTeamMembers + request: + name: BatchUpdateTeamMembersRequest + body: + properties: + team_members: + type: map + docs: >- + The data used to update the `TeamMember` objects. Each key is + the `team_member_id` that maps to the `UpdateTeamMemberRequest`. + + The maximum number of update objects is 25. + + + For each team member, include the fields to add, change, or + clear. Fields can be cleared using a null value. + + To update `wage_setting.job_assignments`, you must provide the + complete list of job assignments. If needed, + + call [ListJobs](api-endpoint:Team-ListJobs) to get the required + `job_id` values. + content-type: application/json + response: + docs: Success + type: root.BatchUpdateTeamMembersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + team_members: + AFMwA08kR-MIF-3Vs0OE: + team_member: + reference_id: reference_id_2 + is_owner: false + status: ACTIVE + given_name: Jane + family_name: Smith + email_address: jane_smith@gmail.com + phone_number: '+14159223334' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + fpgteZNMaf0qOK-a4t6P: + team_member: + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@gmail.com + phone_number: '+14159283333' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - YSGH2WBKG94QZ + - GA2Y9HSJ8KRYT + response: + body: + team_members: + AFMwA08kR-MIF-3Vs0OE: + team_member: + id: AFMwA08kR-MIF-3Vs0OE + reference_id: reference_id_2 + is_owner: false + status: ACTIVE + given_name: Jane + family_name: Smith + email_address: jane_smith@example.com + phone_number: '+14159223334' + created_at: '2020-03-24T18:14:00Z' + updated_at: '2020-03-24T18:18:00Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + fpgteZNMaf0qOK-a4t6P: + team_member: + id: fpgteZNMaf0qOK-a4t6P + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@example.com + phone_number: '+14159283333' + created_at: '2020-03-24T18:14:00Z' + updated_at: '2020-03-24T18:18:00Z' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - GA2Y9HSJ8KRYT + - YSGH2WBKG94QZ + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/team-members/search + method: POST + auth: true + docs: >- + Returns a paginated list of `TeamMember` objects for a business. + + The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, + or whether + + the team member is the Square account owner. + source: + openapi: openapi/openapi.json + display-name: SearchTeamMembers + request: + name: SearchTeamMembersRequest + body: + properties: + query: + type: optional + docs: The query parameters. + limit: + type: optional + docs: >- + The maximum number of `TeamMember` objects in a page (100 by + default). + validation: + min: 1 + max: 200 + cursor: + type: optional + docs: >- + The opaque cursor for fetching the next page. For more + information, see + + [pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchTeamMembersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + location_ids: + - 0G5P3VGACMMQZ + status: ACTIVE + limit: 10 + response: + body: + team_members: + - id: '-3oZQKPKVk6gUXU_V5Qa' + reference_id: '12345678' + is_owner: false + status: ACTIVE + given_name: Johnny + family_name: Cash + email_address: johnny_cash@squareup.com + phone_number: phone_number + created_at: '2019-07-10T17:26:48Z' + updated_at: '2020-04-28T21:49:28Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + wage_setting: + team_member_id: '-3oZQKPKVk6gUXU_V5Qa' + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 1443 + currency: USD + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + - id: 1AVJj0DjkzbmbJw5r4KK + reference_id: abcded + is_owner: false + status: ACTIVE + given_name: Lombard + family_name: Smith + email_address: email_address + phone_number: '+14155552671' + created_at: '2020-03-24T18:14:01Z' + updated_at: '2020-06-09T17:38:05Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + wage_setting: + team_member_id: 1AVJj0DjkzbmbJw5r4KK + job_assignments: + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2400 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 2 + created_at: '2020-03-24T18:14:01Z' + updated_at: '2020-06-09T17:38:05Z' + - id: 2JCmiJol_KKFs9z2Evim + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Monica + family_name: Sway + email_address: email_address + phone_number: phone_number + created_at: '2020-03-24T01:09:25Z' + updated_at: '2020-03-24T01:11:25Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + wage_setting: + team_member_id: 2JCmiJol_KKFs9z2Evim + job_assignments: + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2400 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2020-03-24T01:09:25Z' + updated_at: '2020-03-24T01:09:25Z' + - id: 4uXcJQSLtbk3F0UQHFNQ + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Elton + family_name: Ipsum + email_address: email_address + phone_number: phone_number + created_at: '2020-03-24T01:09:23Z' + updated_at: '2020-03-24T01:15:23Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + - id: 5CoUpyrw1YwGWcRd-eDL + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Steven + family_name: Lo + email_address: email_address + phone_number: phone_number + created_at: '2020-03-24T01:09:23Z' + updated_at: '2020-03-24T01:19:23Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + - id: 5MRPTTp8MMBLVSmzrGha + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Patrick + family_name: Steward + email_address: email_address + phone_number: '+14155552671' + created_at: '2020-03-24T18:14:03Z' + updated_at: '2020-03-24T18:18:03Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + wage_setting: + team_member_id: 5MRPTTp8MMBLVSmzrGha + job_assignments: + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2020-03-24T18:14:03Z' + updated_at: '2020-03-24T18:14:03Z' + - id: 7F5ZxsfRnkexhu1PTbfh + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Ivy + family_name: Manny + email_address: email_address + phone_number: phone_number + created_at: '2020-03-24T01:09:25Z' + updated_at: '2020-03-24T01:09:25Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + - id: 808X9HR72yKvVaigQXf4 + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: John + family_name: Smith + email_address: john_smith@example.com + phone_number: '+14155552671' + created_at: '2020-03-24T18:14:02Z' + updated_at: '2020-03-24T18:14:02Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + - id: 9MVDVoY4hazkWKGo_OuZ + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Robert + family_name: Wen + email_address: r_wen@example.com + phone_number: '+14155552671' + created_at: '2020-03-24T18:14:00Z' + updated_at: '2020-03-24T18:14:00Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + - id: 9UglUjOXQ13-hMFypCft + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Ashley + family_name: Simpson + email_address: asimpson@example.com + phone_number: '+14155552671' + created_at: '2020-03-24T18:14:00Z' + updated_at: '2020-03-24T18:18:00Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + wage_setting: + team_member_id: 9UglUjOXQ13-hMFypCft + job_assignments: + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2020-03-24T18:14:00Z' + updated_at: '2020-03-24T18:14:03Z' + cursor: N:9UglUjOXQ13-hMFypCft + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/team-members/{team_member_id} + method: GET + auth: true + docs: >- + Retrieves a `TeamMember` object for the given `TeamMember.id`. + + Learn about [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member). + source: + openapi: openapi/openapi.json + display-name: RetrieveTeamMember + request: + name: GetTeamMembersRequest + path-parameters: + team_member_id: + type: string + docs: The ID of the team member to retrieve. + response: + docs: Success + type: root.GetTeamMemberResponse + status-code: 200 + examples: + - path-parameters: + team_member_id: team_member_id + headers: + Square-Version: '2025-07-16' + response: + body: + team_member: + id: 1yJlHapkseYnNPETIU1B + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@example.com + phone_number: '+14159283333' + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-15T17:38:05Z' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - GA2Y9HSJ8KRYT + - YSGH2WBKG94QZ + wage_setting: + team_member_id: 1yJlHapkseYnNPETIU1B + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 1443 + currency: USD + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/team-members/{team_member_id} + method: PUT + auth: true + docs: >- + Updates a single `TeamMember` object. The `TeamMember` object is + returned on successful updates. + + Learn about [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member). + source: + openapi: openapi/openapi.json + display-name: UpdateTeamMember + request: + body: root.UpdateTeamMemberRequest + path-parameters: + team_member_id: + type: string + docs: The ID of the team member to update. + name: UpdateTeamMembersRequest + content-type: application/json + response: + docs: Success + type: root.UpdateTeamMemberResponse + status-code: 200 + examples: + - path-parameters: + team_member_id: team_member_id + headers: + Square-Version: '2025-07-16' + request: + team_member: + reference_id: reference_id_1 + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@gmail.com + phone_number: '+14159283333' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - YSGH2WBKG94QZ + - GA2Y9HSJ8KRYT + wage_setting: + job_assignments: + - pay_type: SALARY + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - pay_type: HOURLY + hourly_rate: + amount: 1200 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + response: + body: + team_member: + id: 1yJlHapkseYnNPETIU1B + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@example.com + phone_number: '+14159283333' + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-15T17:38:05Z' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - GA2Y9HSJ8KRYT + - YSGH2WBKG94QZ + wage_setting: + team_member_id: 1yJlHapkseYnNPETIU1B + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 1443 + currency: USD + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 1200 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/teamMembers/wageSetting.yml b/.mock/definition/teamMembers/wageSetting.yml new file mode 100644 index 000000000..7bded52e7 --- /dev/null +++ b/.mock/definition/teamMembers/wageSetting.yml @@ -0,0 +1,174 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + get: + path: /v2/team-members/{team_member_id}/wage-setting + method: GET + auth: true + docs: >- + Retrieves a `WageSetting` object for a team member specified + + by `TeamMember.id`. For more information, see + + [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting). + + + Square recommends using + [RetrieveTeamMember](api-endpoint:Team-RetrieveTeamMember) or + [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) + + to get this information directly from the `TeamMember.wage_setting` + field. + source: + openapi: openapi/openapi.json + display-name: RetrieveWageSetting + request: + name: GetWageSettingRequest + path-parameters: + team_member_id: + type: string + docs: The ID of the team member for which to retrieve the wage setting. + response: + docs: Success + type: root.GetWageSettingResponse + status-code: 200 + examples: + - path-parameters: + team_member_id: team_member_id + headers: + Square-Version: '2025-07-16' + response: + body: + wage_setting: + team_member_id: 1yJlHapkseYnNPETIU1B + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 2164 + currency: USD + annual_rate: + amount: 4500000 + currency: USD + weekly_hours: 40 + is_overtime_exempt: false + version: 1 + created_at: '2020-06-11T23:01:21+00:00' + updated_at: '2020-06-11T23:01:21+00:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/team-members/{team_member_id}/wage-setting + method: PUT + auth: true + docs: >- + Creates or updates a `WageSetting` object. The object is created if a + + `WageSetting` with the specified `team_member_id` doesn't exist. + Otherwise, + + it fully replaces the `WageSetting` object for the team member. + + The `WageSetting` is returned on a successful update. For more + information, see + + [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting). + + + Square recommends using + [CreateTeamMember](api-endpoint:Team-CreateTeamMember) or + [UpdateTeamMember](api-endpoint:Team-UpdateTeamMember) + + to manage the `TeamMember.wage_setting` field directly. + source: + openapi: openapi/openapi.json + display-name: UpdateWageSetting + request: + name: UpdateWageSettingRequest + path-parameters: + team_member_id: + type: string + docs: >- + The ID of the team member for which to update the `WageSetting` + object. + body: + properties: + wage_setting: + type: root.WageSetting + docs: >- + The complete `WageSetting` object. For all job assignments, + specify one of the following: + + - `job_id` (recommended) - If needed, call + [ListJobs](api-endpoint:Team-ListJobs) to get a list of all + jobs. + + Requires Square API version 2024-12-18 or later. + + - `job_title` - Use the exact, case-sensitive spelling of an + existing title unless you want to create a new job. + + This value is ignored if `job_id` is also provided. + content-type: application/json + response: + docs: Success + type: root.UpdateWageSettingResponse + status-code: 200 + examples: + - path-parameters: + team_member_id: team_member_id + headers: + Square-Version: '2025-07-16' + request: + wage_setting: + job_assignments: + - job_title: Manager + pay_type: SALARY + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + is_overtime_exempt: true + response: + body: + wage_setting: + team_member_id: '-3oZQKPKVk6gUXU_V5Qa' + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 1443 + currency: USD + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + is_overtime_exempt: true + version: 1 + created_at: '2019-07-10T17:26:48+00:00' + updated_at: '2020-06-11T23:12:04+00:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/terminal.yml b/.mock/definition/terminal.yml new file mode 100644 index 000000000..263becab0 --- /dev/null +++ b/.mock/definition/terminal.yml @@ -0,0 +1,238 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + DismissTerminalAction: + path: /v2/terminals/actions/{action_id}/dismiss + method: POST + auth: true + docs: >- + Dismisses a Terminal action request if the status and type of the + request permits it. + + + See [Link and Dismiss + Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) + for more details. + source: + openapi: openapi/openapi.json + display-name: DismissTerminalAction + request: + name: DismissTerminalActionRequest + path-parameters: + action_id: + type: string + docs: >- + Unique ID for the `TerminalAction` associated with the action to + be dismissed. + response: + docs: Success + type: root.DismissTerminalActionResponse + status-code: 200 + examples: + - path-parameters: + action_id: action_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + action: + id: termapia:abcdefg1234567 + device_id: DEVICE_ID + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + created_at: '2021-07-28T23:22:07.476Z' + updated_at: '2021-07-28T23:22:29.511Z' + app_id: APP_ID + location_id: location_id + type: CONFIRMATION + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: customer_id + card_id: card_id + reference_id: reference_id + signature_options: + title: title + body: body + signature: + - {} + confirmation_options: + title: Marketing communications + body: >- + I agree to receive promotional emails about future events + and activities. + agree_button_text: Agree + disagree_button_text: Decline + decision: + has_agreed: true + receipt_options: + payment_id: payment_id + print_only: true + is_duplicate: true + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + selected_option: + reference_id: reference_id + title: title + device_metadata: + battery_percentage: battery_percentage + charging_state: charging_state + location_id: location_id + merchant_id: merchant_id + network_connection_type: network_connection_type + payment_region: payment_region + serial_number: serial_number + os_version: os_version + app_version: app_version + wifi_network_name: wifi_network_name + wifi_network_strength: wifi_network_strength + ip_address: ip_address + await_next_action: true + await_next_action_duration: PT5M + DismissTerminalCheckout: + path: /v2/terminals/checkouts/{checkout_id}/dismiss + method: POST + auth: true + docs: >- + Dismisses a Terminal checkout request if the status and type of the + request permits it. + source: + openapi: openapi/openapi.json + display-name: DismissTerminalCheckout + request: + name: DismissTerminalCheckoutRequest + path-parameters: + checkout_id: + type: string + docs: >- + Unique ID for the `TerminalCheckout` associated with the checkout + to be dismissed. + response: + docs: Success + type: root.DismissTerminalCheckoutResponse + status-code: 200 + examples: + - path-parameters: + checkout_id: checkout_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + checkout: + id: LmZEKbo3SBfqO + amount_money: + amount: 2610 + currency: USD + reference_id: reference_id + note: note + order_id: order_id + payment_options: + autocomplete: true + delay_duration: delay_duration + accept_partial_authorization: true + delay_action: CANCEL + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: false + collect_signature: true + tip_settings: + allow_tipping: true + separate_tip_screen: true + custom_tip_field: false + show_itemized_cart: true + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + payment_ids: + - D7vLJqMkvSoAlX4yyFzUitOy4EPZY + created_at: '2023-11-29T14:59:50.682Z' + updated_at: '2023-11-29T15:00:18.936Z' + app_id: APP_ID + location_id: LOCATION_ID + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + statement_description_identifier: statement_description_identifier + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + DismissTerminalRefund: + path: /v2/terminals/refunds/{terminal_refund_id}/dismiss + method: POST + auth: true + docs: >- + Dismisses a Terminal refund request if the status and type of the + request permits it. + source: + openapi: openapi/openapi.json + display-name: DismissTerminalRefund + request: + name: DismissTerminalRefundRequest + path-parameters: + terminal_refund_id: + type: string + docs: >- + Unique ID for the `TerminalRefund` associated with the refund to + be dismissed. + response: + docs: Success + type: root.DismissTerminalRefundResponse + status-code: 200 + examples: + - path-parameters: + terminal_refund_id: terminal_refund_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: vjkNb2HD-xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY + refund_id: refund_id + payment_id: xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY + order_id: s8OMhQcpEp1b61YywlccSHWqUaQZY + amount_money: + amount: 111 + currency: CAD + reason: Returning item + device_id: 47776348fd8b32b9 + deadline_duration: PT5M + status: IN_PROGRESS + cancel_reason: BUYER_CANCELED + created_at: '2023-11-30T16:16:39.299Z' + updated_at: '2023-11-30T16:16:57.863Z' + app_id: APP_ID + location_id: location_id + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/terminal/actions.yml b/.mock/definition/terminal/actions.yml new file mode 100644 index 000000000..e777c121d --- /dev/null +++ b/.mock/definition/terminal/actions.yml @@ -0,0 +1,456 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/terminals/actions + method: POST + auth: true + docs: Creates a Terminal action request and sends it to the specified device. + source: + openapi: openapi/openapi.json + display-name: CreateTerminalAction + request: + name: CreateTerminalActionRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreateAction` request. + Keys can be any valid string + + but must be unique for every `CreateAction` request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more + + information. + validation: + minLength: 1 + maxLength: 64 + action: + type: root.TerminalAction + docs: The Action to create. + content-type: application/json + response: + docs: Success + type: root.CreateTerminalActionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e + action: + device_id: '{{DEVICE_ID}}' + deadline_duration: PT5M + type: SAVE_CARD + save_card_options: + customer_id: '{{CUSTOMER_ID}}' + reference_id: user-id-1 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + action: + id: termapia:jveJIAkkAjILHkdCE + device_id: DEVICE_ID + deadline_duration: PT5M + status: PENDING + cancel_reason: BUYER_CANCELED + created_at: '2021-07-28T23:22:07.476Z' + updated_at: '2021-07-28T23:22:07.476Z' + app_id: APP_ID + location_id: LOCATION_ID + type: SAVE_CARD + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: CUSTOMER_ID + card_id: card_id + reference_id: user-id-1 + signature_options: + title: title + body: body + signature: + - {} + confirmation_options: + title: title + body: body + agree_button_text: agree_button_text + disagree_button_text: disagree_button_text + receipt_options: + payment_id: payment_id + print_only: true + is_duplicate: true + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + selected_option: + reference_id: reference_id + title: title + device_metadata: + battery_percentage: battery_percentage + charging_state: charging_state + location_id: location_id + merchant_id: merchant_id + network_connection_type: network_connection_type + payment_region: payment_region + serial_number: serial_number + os_version: os_version + app_version: app_version + wifi_network_name: wifi_network_name + wifi_network_strength: wifi_network_strength + ip_address: ip_address + await_next_action: true + await_next_action_duration: await_next_action_duration + search: + path: /v2/terminals/actions/search + method: POST + auth: true + docs: >- + Retrieves a filtered list of Terminal action requests created by the + account making the request. Terminal action requests are available for + 30 days. + source: + openapi: openapi/openapi.json + display-name: SearchTerminalActions + request: + name: SearchTerminalActionsRequest + body: + properties: + query: + type: optional + docs: >- + Queries terminal actions based on given conditions and sort + order. + + Leaving this unset will return all actions with the default sort + order. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this to retrieve the next set of results for the + original query. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more + + information. + limit: + type: optional + docs: Limit the number of results returned for a single request. + validation: + min: 1 + max: 100 + content-type: application/json + response: + docs: Success + type: root.SearchTerminalActionsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + created_at: + start_at: '2022-04-01T00:00:00.000Z' + sort: + sort_order: DESC + limit: 2 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + action: + - id: termapia:oBGWlAats8xWCiCE + device_id: DEVICE_ID + deadline_duration: PT5M + status: IN_PROGRESS + cancel_reason: BUYER_CANCELED + created_at: '2022-04-08T15:14:04.895Z' + updated_at: '2022-04-08T15:14:05.446Z' + app_id: APP_ID + location_id: LOCATION_ID + type: SAVE_CARD + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: CUSTOMER_ID + reference_id: user-id-1 + signature_options: + title: title + body: body + confirmation_options: + title: title + body: body + agree_button_text: agree_button_text + receipt_options: + payment_id: payment_id + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + await_next_action: true + await_next_action_duration: await_next_action_duration + - id: termapia:K2NY2YSSml3lTiCE + device_id: DEVICE_ID + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + created_at: '2022-04-08T15:14:01.210Z' + updated_at: '2022-04-08T15:14:09.861Z' + app_id: APP_ID + location_id: LOCATION_ID + type: SAVE_CARD + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: CUSTOMER_ID + card_id: ccof:CARD_ID + reference_id: user-id-1 + signature_options: + title: title + body: body + confirmation_options: + title: title + body: body + agree_button_text: agree_button_text + receipt_options: + payment_id: payment_id + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + await_next_action: true + await_next_action_duration: await_next_action_duration + cursor: CURSOR + get: + path: /v2/terminals/actions/{action_id} + method: GET + auth: true + docs: >- + Retrieves a Terminal action request by `action_id`. Terminal action + requests are available for 30 days. + source: + openapi: openapi/openapi.json + display-name: GetTerminalAction + request: + name: GetActionsRequest + path-parameters: + action_id: + type: string + docs: Unique ID for the desired `TerminalAction`. + response: + docs: Success + type: root.GetTerminalActionResponse + status-code: 200 + examples: + - path-parameters: + action_id: action_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + action: + id: termapia:jveJIAkkAjILHkdCE + device_id: DEVICE_ID + deadline_duration: PT5M + status: IN_PROGRESS + cancel_reason: BUYER_CANCELED + created_at: '2021-07-28T23:22:07.476Z' + updated_at: '2021-07-28T23:22:08.301Z' + app_id: APP_ID + location_id: LOCATION_ID + type: SAVE_CARD + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: CUSTOMER_ID + card_id: card_id + reference_id: user-id-1 + signature_options: + title: title + body: body + signature: + - {} + confirmation_options: + title: title + body: body + agree_button_text: agree_button_text + disagree_button_text: disagree_button_text + receipt_options: + payment_id: payment_id + print_only: true + is_duplicate: true + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + selected_option: + reference_id: reference_id + title: title + device_metadata: + battery_percentage: battery_percentage + charging_state: charging_state + location_id: location_id + merchant_id: merchant_id + network_connection_type: network_connection_type + payment_region: payment_region + serial_number: serial_number + os_version: os_version + app_version: app_version + wifi_network_name: wifi_network_name + wifi_network_strength: wifi_network_strength + ip_address: ip_address + await_next_action: true + await_next_action_duration: await_next_action_duration + cancel: + path: /v2/terminals/actions/{action_id}/cancel + method: POST + auth: true + docs: >- + Cancels a Terminal action request if the status of the request permits + it. + source: + openapi: openapi/openapi.json + display-name: CancelTerminalAction + request: + name: CancelActionsRequest + path-parameters: + action_id: + type: string + docs: Unique ID for the desired `TerminalAction`. + response: + docs: Success + type: root.CancelTerminalActionResponse + status-code: 200 + examples: + - path-parameters: + action_id: action_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + action: + id: termapia:jveJIAkkAjILHkdCE + device_id: DEVICE_ID + deadline_duration: PT5M + status: CANCELED + cancel_reason: SELLER_CANCELED + created_at: '2021-07-28T23:22:07.476Z' + updated_at: '2021-07-28T23:22:29.511Z' + app_id: APP_ID + location_id: LOCATION_ID + type: SAVE_CARD + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: CUSTOMER_ID + card_id: card_id + reference_id: user-id-1 + signature_options: + title: title + body: body + signature: + - {} + confirmation_options: + title: title + body: body + agree_button_text: agree_button_text + disagree_button_text: disagree_button_text + receipt_options: + payment_id: payment_id + print_only: true + is_duplicate: true + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + selected_option: + reference_id: reference_id + title: title + device_metadata: + battery_percentage: battery_percentage + charging_state: charging_state + location_id: location_id + merchant_id: merchant_id + network_connection_type: network_connection_type + payment_region: payment_region + serial_number: serial_number + os_version: os_version + app_version: app_version + wifi_network_name: wifi_network_name + wifi_network_strength: wifi_network_strength + ip_address: ip_address + await_next_action: true + await_next_action_duration: await_next_action_duration + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/terminal/checkouts.yml b/.mock/definition/terminal/checkouts.yml new file mode 100644 index 000000000..f9840a9d6 --- /dev/null +++ b/.mock/definition/terminal/checkouts.yml @@ -0,0 +1,362 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/terminals/checkouts + method: POST + auth: true + docs: >- + Creates a Terminal checkout request and sends it to the specified device + to take a payment + + for the requested amount. + source: + openapi: openapi/openapi.json + display-name: CreateTerminalCheckout + request: + name: CreateTerminalCheckoutRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreateCheckout` request. + Keys can be any valid string but + + must be unique for every `CreateCheckout` request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 64 + checkout: + type: root.TerminalCheckout + docs: The checkout to create. + content-type: application/json + response: + docs: Success + type: root.CreateTerminalCheckoutResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 28a0c3bc-7839-11ea-bc55-0242ac130003 + checkout: + amount_money: + amount: 2610 + currency: USD + reference_id: id11572 + note: A brief note + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + checkout: + id: 08YceKh7B3ZqO + amount_money: + amount: 2610 + currency: USD + reference_id: id11572 + note: A brief note + order_id: order_id + payment_options: + autocomplete: true + delay_duration: delay_duration + accept_partial_authorization: true + delay_action: CANCEL + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: false + collect_signature: true + tip_settings: + allow_tipping: false + show_itemized_cart: true + deadline_duration: PT5M + status: PENDING + cancel_reason: BUYER_CANCELED + payment_ids: + - payment_ids + created_at: '2020-04-06T16:39:32.545Z' + updated_at: '2020-04-06T16:39:32.545Z' + app_id: APP_ID + location_id: LOCATION_ID + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + statement_description_identifier: statement_description_identifier + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + search: + path: /v2/terminals/checkouts/search + method: POST + auth: true + docs: >- + Returns a filtered list of Terminal checkout requests created by the + application making the request. Only Terminal checkout requests created + for the merchant scoped to the OAuth token are returned. Terminal + checkout requests are available for 30 days. + source: + openapi: openapi/openapi.json + display-name: SearchTerminalCheckouts + request: + name: SearchTerminalCheckoutsRequest + body: + properties: + query: + type: optional + docs: >- + Queries Terminal checkouts based on given conditions and the + sort order. + + Leaving these unset returns all checkouts with the default sort + order. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + limit: + type: optional + docs: Limits the number of results returned for a single request. + validation: + min: 1 + max: 100 + content-type: application/json + response: + docs: Success + type: root.SearchTerminalCheckoutsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + status: COMPLETED + limit: 2 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + checkouts: + - id: tsQPvzwBpMqqO + amount_money: + amount: 2610 + currency: USD + reference_id: id14467 + note: A brief note + order_id: order_id + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: false + tip_settings: + allow_tipping: false + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + payment_ids: + - rXnhZzywrEk4vR6pw76fPZfgvaB + created_at: '2020-03-31T18:13:15.921Z' + updated_at: '2020-03-31T18:13:52.725Z' + app_id: APP_ID + location_id: location_id + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + statement_description_identifier: statement_description_identifier + - id: XlOPTgcEhrbqO + amount_money: + amount: 2610 + currency: USD + reference_id: id41623 + note: A brief note + order_id: order_id + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: true + tip_settings: + allow_tipping: false + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + payment_ids: + - VYBF861PaoKPP7Pih0TlbZiNvaB + created_at: '2020-03-31T18:08:31.882Z' + updated_at: '2020-03-31T18:08:41.635Z' + app_id: APP_ID + location_id: location_id + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + statement_description_identifier: statement_description_identifier + cursor: RiTJqBoTuXlbLmmrPvEkX9iG7XnQ4W4RjGnH + get: + path: /v2/terminals/checkouts/{checkout_id} + method: GET + auth: true + docs: >- + Retrieves a Terminal checkout request by `checkout_id`. Terminal + checkout requests are available for 30 days. + source: + openapi: openapi/openapi.json + display-name: GetTerminalCheckout + request: + name: GetCheckoutsRequest + path-parameters: + checkout_id: + type: string + docs: The unique ID for the desired `TerminalCheckout`. + response: + docs: Success + type: root.GetTerminalCheckoutResponse + status-code: 200 + examples: + - path-parameters: + checkout_id: checkout_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + checkout: + id: 08YceKh7B3ZqO + amount_money: + amount: 2610 + currency: USD + reference_id: id11572 + note: A brief note + order_id: order_id + payment_options: + autocomplete: true + delay_duration: delay_duration + accept_partial_authorization: true + delay_action: CANCEL + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: false + collect_signature: true + tip_settings: + allow_tipping: false + show_itemized_cart: true + deadline_duration: PT5M + status: IN_PROGRESS + cancel_reason: BUYER_CANCELED + payment_ids: + - payment_ids + created_at: '2020-04-06T16:39:32.545Z' + updated_at: 2020-04-06T16:39:323.001Z + app_id: APP_ID + location_id: LOCATION_ID + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + statement_description_identifier: statement_description_identifier + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + cancel: + path: /v2/terminals/checkouts/{checkout_id}/cancel + method: POST + auth: true + docs: >- + Cancels a Terminal checkout request if the status of the request permits + it. + source: + openapi: openapi/openapi.json + display-name: CancelTerminalCheckout + request: + name: CancelCheckoutsRequest + path-parameters: + checkout_id: + type: string + docs: The unique ID for the desired `TerminalCheckout`. + response: + docs: Success + type: root.CancelTerminalCheckoutResponse + status-code: 200 + examples: + - path-parameters: + checkout_id: checkout_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + checkout: + id: S1yDlPQx7slqO + amount_money: + amount: 123 + currency: USD + reference_id: id36815 + note: note + order_id: order_id + payment_options: + autocomplete: true + delay_duration: delay_duration + accept_partial_authorization: true + delay_action: CANCEL + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: true + collect_signature: true + tip_settings: + allow_tipping: true + show_itemized_cart: true + deadline_duration: PT5M + status: CANCELED + cancel_reason: SELLER_CANCELED + payment_ids: + - payment_ids + created_at: '2020-03-16T15:31:19.934Z' + updated_at: '2020-03-16T15:31:45.787Z' + app_id: APP_ID + location_id: LOCATION_ID + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + statement_description_identifier: statement_description_identifier + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/terminal/refunds.yml b/.mock/definition/terminal/refunds.yml new file mode 100644 index 000000000..9ab41737e --- /dev/null +++ b/.mock/definition/terminal/refunds.yml @@ -0,0 +1,261 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/terminals/refunds + method: POST + auth: true + docs: >- + Creates a request to refund an Interac payment completed on a Square + Terminal. Refunds for Interac payments on a Square Terminal are + supported only for Interac debit cards in Canada. Other refunds for + Terminal payments should use the Refunds API. For more information, see + [Refunds API](api:Refunds). + source: + openapi: openapi/openapi.json + display-name: CreateTerminalRefund + request: + name: CreateTerminalRefundRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreateRefund` request. + Keys can be any valid string but + + must be unique for every `CreateRefund` request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 64 + refund: + type: optional + docs: The refund to create. + content-type: application/json + response: + docs: Success + type: root.CreateTerminalRefundResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 402a640b-b26f-401f-b406-46f839590c04 + refund: + payment_id: 5O5OvgkcNUhl7JBuINflcjKqUzXZY + amount_money: + amount: 111 + currency: CAD + reason: Returning items + device_id: f72dfb8e-4d65-4e56-aade-ec3fb8d33291 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: 009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY + refund_id: refund_id + payment_id: 5O5OvgkcNUhl7JBuINflcjKqUzXZY + order_id: kcuKDKreRaI4gF4TjmEgZjHk8Z7YY + amount_money: + amount: 111 + currency: CAD + reason: Returning items + device_id: f72dfb8e-4d65-4e56-aade-ec3fb8d33291 + deadline_duration: PT5M + status: PENDING + cancel_reason: BUYER_CANCELED + created_at: '2020-09-29T15:21:46.771Z' + updated_at: '2020-09-29T15:21:46.771Z' + app_id: sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ + location_id: 76C9W6K8CNNQ5 + search: + path: /v2/terminals/refunds/search + method: POST + auth: true + docs: >- + Retrieves a filtered list of Interac Terminal refund requests created by + the seller making the request. Terminal refund requests are available + for 30 days. + source: + openapi: openapi/openapi.json + display-name: SearchTerminalRefunds + request: + name: SearchTerminalRefundsRequest + body: + properties: + query: + type: optional + docs: >- + Queries the Terminal refunds based on given conditions and the + sort order. Calling + + `SearchTerminalRefunds` without an explicit query parameter + returns all available + + refunds with the default sort order. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + limit: + type: optional + docs: Limits the number of results returned for a single request. + validation: + min: 1 + max: 100 + content-type: application/json + response: + docs: Success + type: root.SearchTerminalRefundsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + query: + filter: + status: COMPLETED + limit: 1 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refunds: + - id: 009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY + refund_id: >- + 5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb + payment_id: 5O5OvgkcNUhl7JBuINflcjKqUzXZY + order_id: kcuKDKreRaI4gF4TjmEgZjHk8Z7YY + amount_money: + amount: 111 + currency: CAD + reason: Returning item + device_id: f72dfb8e-4d65-4e56-aade-ec3fb8d33291 + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + created_at: '2020-09-29T15:21:46.771Z' + updated_at: '2020-09-29T15:21:48.675Z' + app_id: sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ + location_id: 76C9W6K8CNNQ5 + cursor: cursor + get: + path: /v2/terminals/refunds/{terminal_refund_id} + method: GET + auth: true + docs: >- + Retrieves an Interac Terminal refund object by ID. Terminal refund + objects are available for 30 days. + source: + openapi: openapi/openapi.json + display-name: GetTerminalRefund + request: + name: GetRefundsRequest + path-parameters: + terminal_refund_id: + type: string + docs: The unique ID for the desired `TerminalRefund`. + response: + docs: Success + type: root.GetTerminalRefundResponse + status-code: 200 + examples: + - path-parameters: + terminal_refund_id: terminal_refund_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: 009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY + refund_id: >- + 5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb + payment_id: 5O5OvgkcNUhl7JBuINflcjKqUzXZY + order_id: kcuKDKreRaI4gF4TjmEgZjHk8Z7YY + amount_money: + amount: 111 + currency: CAD + reason: Returning item + device_id: f72dfb8e-4d65-4e56-aade-ec3fb8d33291 + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + created_at: '2020-09-29T15:21:46.771Z' + updated_at: '2020-09-29T15:21:48.675Z' + app_id: sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ + location_id: 76C9W6K8CNNQ5 + cancel: + path: /v2/terminals/refunds/{terminal_refund_id}/cancel + method: POST + auth: true + docs: >- + Cancels an Interac Terminal refund request by refund request ID if the + status of the request permits it. + source: + openapi: openapi/openapi.json + display-name: CancelTerminalRefund + request: + name: CancelRefundsRequest + path-parameters: + terminal_refund_id: + type: string + docs: The unique ID for the desired `TerminalRefund`. + response: + docs: Success + type: root.CancelTerminalRefundResponse + status-code: 200 + examples: + - path-parameters: + terminal_refund_id: terminal_refund_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: g6ycb6HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY + refund_id: refund_id + payment_id: 5O5OvgkcNUhl7JBuINflcjKqUzXZY + order_id: kcuKDKreRaI4gF4TjmEgZjHk8Z7YY + amount_money: + amount: 100 + currency: CAD + reason: reason + device_id: 42690809-faa2-4701-a24b-19d3d34c9aaa + deadline_duration: PT5M + status: CANCELED + cancel_reason: SELLER_CANCELED + created_at: '2020-10-21T22:47:23.241Z' + updated_at: '2020-10-21T22:47:30.096Z' + app_id: sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ + location_id: 76C9W6K8CNNQ5 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/v1Transactions.yml b/.mock/definition/v1Transactions.yml new file mode 100644 index 000000000..b4d2cb620 --- /dev/null +++ b/.mock/definition/v1Transactions.yml @@ -0,0 +1,372 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + V1ListOrders: + path: /v1/{location_id}/orders + method: GET + auth: true + docs: Provides summary information for a merchant's online store orders. + source: + openapi: openapi/openapi.json + display-name: V1ListOrders + request: + name: V1ListOrdersRequest + path-parameters: + location_id: + type: string + docs: The ID of the location to list online store orders for. + query-parameters: + order: + type: optional> + docs: The order in which payments are listed in the response. + limit: + type: optional> + docs: >- + The maximum number of payments to return in a single response. + This value cannot exceed 200. + batch_token: + type: optional> + docs: |- + A pagination cursor to retrieve the next set of results for your + original query to the endpoint. + response: + docs: Success + type: list + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-07-16' + response: + body: + - errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id: id + buyer_email: buyer_email + recipient_name: recipient_name + recipient_phone_number: recipient_phone_number + state: PENDING + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + subtotal_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_shipping_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_tax_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_price_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_discount_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + created_at: created_at + updated_at: updated_at + expires_at: expires_at + payment_id: payment_id + buyer_note: buyer_note + completed_note: completed_note + refunded_note: refunded_note + canceled_note: canceled_note + tender: + id: id + type: CREDIT_CARD + name: name + employee_id: employee_id + receipt_url: receipt_url + card_brand: OTHER_BRAND + pan_suffix: pan_suffix + entry_method: MANUAL + payment_note: payment_note + tendered_at: tendered_at + settled_at: settled_at + is_exchange: true + order_history: + - {} + promo_code: promo_code + btc_receive_address: btc_receive_address + btc_price_satoshi: 1.1 + V1RetrieveOrder: + path: /v1/{location_id}/orders/{order_id} + method: GET + auth: true + docs: >- + Provides comprehensive information for a single online store order, + including the order's history. + source: + openapi: openapi/openapi.json + display-name: V1RetrieveOrder + request: + name: V1RetrieveOrderRequest + path-parameters: + location_id: + type: string + docs: The ID of the order's associated location. + order_id: + type: string + docs: >- + The order's Square-issued ID. You obtain this value from Order + objects returned by the List Orders endpoint + response: + docs: Success + type: root.V1Order + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + order_id: order_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + id: id + buyer_email: buyer_email + recipient_name: recipient_name + recipient_phone_number: recipient_phone_number + state: PENDING + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + subtotal_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_shipping_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_tax_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_price_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_discount_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + created_at: created_at + updated_at: updated_at + expires_at: expires_at + payment_id: payment_id + buyer_note: buyer_note + completed_note: completed_note + refunded_note: refunded_note + canceled_note: canceled_note + tender: + id: id + type: CREDIT_CARD + name: name + employee_id: employee_id + receipt_url: receipt_url + card_brand: OTHER_BRAND + pan_suffix: pan_suffix + entry_method: MANUAL + payment_note: payment_note + total_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + tendered_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + tendered_at: tendered_at + settled_at: settled_at + change_back_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + refunded_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + is_exchange: true + order_history: + - action: ORDER_PLACED + created_at: created_at + promo_code: promo_code + btc_receive_address: btc_receive_address + btc_price_satoshi: 1.1 + V1UpdateOrder: + path: /v1/{location_id}/orders/{order_id} + method: PUT + auth: true + docs: >- + Updates the details of an online store order. Every update you perform + on an order corresponds to one of three actions: + source: + openapi: openapi/openapi.json + display-name: V1UpdateOrder + request: + name: V1UpdateOrderRequest + path-parameters: + location_id: + type: string + docs: The ID of the order's associated location. + order_id: + type: string + docs: >- + The order's Square-issued ID. You obtain this value from Order + objects returned by the List Orders endpoint + body: + properties: + action: + type: root.V1UpdateOrderRequestAction + docs: >- + The action to perform on the order (COMPLETE, CANCEL, or + REFUND). + + See + [V1UpdateOrderRequestAction](#type-v1updateorderrequestaction) + for possible values + shipped_tracking_number: + type: optional> + docs: >- + The tracking number of the shipment associated with the order. + Only valid if action is COMPLETE. + completed_note: + type: optional> + docs: >- + A merchant-specified note about the completion of the order. + Only valid if action is COMPLETE. + refunded_note: + type: optional> + docs: >- + A merchant-specified note about the refunding of the order. Only + valid if action is REFUND. + canceled_note: + type: optional> + docs: >- + A merchant-specified note about the canceling of the order. Only + valid if action is CANCEL. + content-type: application/json + response: + docs: Success + type: root.V1Order + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + order_id: order_id + headers: + Square-Version: '2025-07-16' + request: + action: COMPLETE + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + id: id + buyer_email: buyer_email + recipient_name: recipient_name + recipient_phone_number: recipient_phone_number + state: PENDING + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + subtotal_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_shipping_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_tax_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_price_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_discount_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + created_at: created_at + updated_at: updated_at + expires_at: expires_at + payment_id: payment_id + buyer_note: buyer_note + completed_note: completed_note + refunded_note: refunded_note + canceled_note: canceled_note + tender: + id: id + type: CREDIT_CARD + name: name + employee_id: employee_id + receipt_url: receipt_url + card_brand: OTHER_BRAND + pan_suffix: pan_suffix + entry_method: MANUAL + payment_note: payment_note + total_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + tendered_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + tendered_at: tendered_at + settled_at: settled_at + change_back_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + refunded_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + is_exchange: true + order_history: + - action: ORDER_PLACED + created_at: created_at + promo_code: promo_code + btc_receive_address: btc_receive_address + btc_price_satoshi: 1.1 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/vendors.yml b/.mock/definition/vendors.yml new file mode 100644 index 000000000..b05ad2dff --- /dev/null +++ b/.mock/definition/vendors.yml @@ -0,0 +1,544 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + batchCreate: + path: /v2/vendors/bulk-create + method: POST + auth: true + docs: >- + Creates one or more [Vendor](entity:Vendor) objects to represent + suppliers to a seller. + source: + openapi: openapi/openapi.json + display-name: BulkCreateVendors + request: + name: BatchCreateVendorsRequest + body: + properties: + vendors: + type: map + docs: >- + Specifies a set of new [Vendor](entity:Vendor) objects as + represented by a collection of idempotency-key/`Vendor`-object + pairs. + content-type: application/json + response: + docs: Success + type: root.BatchCreateVendorsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + vendors: + 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe: + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + responses: + 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T10:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + version: 0 + status: ACTIVE + batchGet: + path: /v2/vendors/bulk-retrieve + method: POST + auth: true + docs: Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs. + source: + openapi: openapi/openapi.json + display-name: BulkRetrieveVendors + request: + name: BatchGetVendorsRequest + body: + properties: + vendor_ids: + type: optional>> + docs: IDs of the [Vendor](entity:Vendor) objects to retrieve. + content-type: application/json + response: + docs: Success + type: root.BatchGetVendorsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + vendor_ids: + - INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + responses: + INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T10:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + version: 1 + status: ACTIVE + batchUpdate: + path: /v2/vendors/bulk-update + method: PUT + auth: true + docs: >- + Updates one or more of existing [Vendor](entity:Vendor) objects as + suppliers to a seller. + source: + openapi: openapi/openapi.json + display-name: BulkUpdateVendors + request: + name: BatchUpdateVendorsRequest + body: + properties: + vendors: + type: map + docs: >- + A set of [UpdateVendorRequest](entity:UpdateVendorRequest) + objects encapsulating to-be-updated [Vendor](entity:Vendor) + + objects. The set is represented by a collection of + `Vendor`-ID/`UpdateVendorRequest`-object pairs. + content-type: application/json + response: + docs: Success + type: root.BatchUpdateVendorsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + vendors: + FMCYHBWT1TPL8MFH52PBMEN92A: + vendor: {} + INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4: + vendor: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + responses: + INV_V_FMCYHBWT1TPL8MFH52PBMEN92A: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + vendor: + id: INV_V_FMCYHBWT1TPL8MFH52PBMEN92A + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T20:21:54.859Z' + name: Annie’s Hot Sauce + address: + address_line_1: 202 Mill St + locality: Moorestown + administrative_district_level_1: NJ + postal_code: '08057' + country: US + contacts: + - id: INV_VC_ABYYHBWT1TPL8MFH52PBMENPJ4 + name: Annie Thomas + email_address: annie@annieshotsauce.com + phone_number: 1-212-555-4250 + ordinal: 0 + version: 11 + status: ACTIVE + INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:10:54.859Z' + updated_at: '2022-03-16T20:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 0 + account_number: '4025391' + note: favorite vendor + version: 31 + status: ACTIVE + create: + path: /v2/vendors/create + method: POST + auth: true + docs: >- + Creates a single [Vendor](entity:Vendor) object to represent a supplier + to a seller. + source: + openapi: openapi/openapi.json + display-name: CreateVendor + request: + name: CreateVendorRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A client-supplied, universally unique identifier (UUID) to make + this [CreateVendor](api-endpoint:Vendors-CreateVendor) call + idempotent. + + + See + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + in the + + [API Development + 101](https://developer.squareup.com/docs/buildbasics) section + for more + + information. + validation: + minLength: 1 + maxLength: 128 + vendor: + type: optional + docs: The requested [Vendor](entity:Vendor) to be created. + content-type: application/json + response: + docs: Success + type: root.CreateVendorResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe + vendor: + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T10:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + version: 1 + status: ACTIVE + search: + path: /v2/vendors/search + method: POST + auth: true + docs: >- + Searches for vendors using a filter against supported + [Vendor](entity:Vendor) properties and a supported sorter. + source: + openapi: openapi/openapi.json + display-name: SearchVendors + request: + name: SearchVendorsRequest + body: + properties: + filter: + type: optional + docs: Specifies a filter used to search for vendors. + sort: + type: optional + docs: Specifies a sorter used to sort the returned vendors. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this to retrieve the next set of results for the + original query. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + content-type: application/json + response: + docs: Success + type: root.SearchVendorsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + vendors: + - id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T10:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + version: 1 + status: ACTIVE + cursor: cursor + get: + path: /v2/vendors/{vendor_id} + method: GET + auth: true + docs: Retrieves the vendor of a specified [Vendor](entity:Vendor) ID. + source: + openapi: openapi/openapi.json + display-name: RetrieveVendor + request: + name: GetVendorsRequest + path-parameters: + vendor_id: + type: string + docs: ID of the [Vendor](entity:Vendor) to retrieve. + response: + docs: Success + type: root.GetVendorResponse + status-code: 200 + examples: + - path-parameters: + vendor_id: vendor_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T10:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + version: 1 + status: ACTIVE + update: + path: /v2/vendors/{vendor_id} + method: PUT + auth: true + docs: >- + Updates an existing [Vendor](entity:Vendor) object as a supplier to a + seller. + source: + openapi: openapi/openapi.json + display-name: UpdateVendor + request: + body: root.UpdateVendorRequest + path-parameters: + vendor_id: + type: string + docs: ID of the [Vendor](entity:Vendor) to retrieve. + name: UpdateVendorsRequest + content-type: application/json + response: + docs: Success + type: root.UpdateVendorResponse + status-code: 200 + examples: + - path-parameters: + vendor_id: vendor_id + headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + name: Jack's Chicken Shack + version: 1 + status: ACTIVE + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T20:21:54.859Z' + name: Jack's Chicken Shack + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 0 + account_number: '4025391' + note: note + version: 2 + status: ACTIVE + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/webhooks/eventTypes.yml b/.mock/definition/webhooks/eventTypes.yml new file mode 100644 index 000000000..620f2033d --- /dev/null +++ b/.mock/definition/webhooks/eventTypes.yml @@ -0,0 +1,44 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/webhooks/event-types + method: GET + auth: true + docs: Lists all webhook event types that can be subscribed to. + source: + openapi: openapi/openapi.json + display-name: ListWebhookEventTypes + request: + name: ListEventTypesRequest + query-parameters: + api_version: + type: optional> + docs: >- + The API version for which to list event types. Setting this field + overrides the default version used by the application. + response: + docs: Success + type: root.ListWebhookEventTypesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + event_types: + - inventory.count.updated + metadata: + - event_type: inventory.count.updated + api_version_introduced: '2018-07-12' + release_status: PUBLIC + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/webhooks/subscriptions.yml b/.mock/definition/webhooks/subscriptions.yml new file mode 100644 index 000000000..8282c610a --- /dev/null +++ b/.mock/definition/webhooks/subscriptions.yml @@ -0,0 +1,383 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/webhooks/subscriptions + method: GET + auth: true + docs: Lists all webhook subscriptions owned by your application. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.subscriptions + source: + openapi: openapi/openapi.json + display-name: ListWebhookSubscriptions + request: + name: ListSubscriptionsRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for your original + query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + include_disabled: + type: optional> + default: false + docs: >- + Includes disabled [Subscription](entity:WebhookSubscription)s. + + By default, all enabled + [Subscription](entity:WebhookSubscription)s are returned. + sort_order: + type: optional> + docs: >- + Sorts the returned list by when the + [Subscription](entity:WebhookSubscription) was created with the + specified order. + + This field defaults to ASC. + limit: + type: optional> + docs: >- + The maximum number of results to be returned in a single page. + + It is possible to receive fewer results than the specified limit + on a given page. + + The default value of 100 is also the maximum allowed value. + + + Default: 100 + response: + docs: Success + type: root.ListWebhookSubscriptionsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscriptions: + - id: wbhk_b35f6b3145074cf9ad513610786c19d5 + name: Example Webhook Subscription + enabled: true + event_types: + - payment.created + - payment.updated + notification_url: https://example-webhook-url.com + api_version: '2021-12-15' + signature_key: signature_key + created_at: 2022-01-10 23:29:48 +0000 UTC + updated_at: 2022-01-10 23:29:48 +0000 UTC + cursor: cursor + create: + path: /v2/webhooks/subscriptions + method: POST + auth: true + docs: Creates a webhook subscription. + source: + openapi: openapi/openapi.json + display-name: CreateWebhookSubscription + request: + name: CreateWebhookSubscriptionRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies the + [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) + request. + validation: + maxLength: 45 + subscription: + type: root.WebhookSubscription + docs: The [Subscription](entity:WebhookSubscription) to create. + content-type: application/json + response: + docs: Success + type: root.CreateWebhookSubscriptionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-07-16' + request: + idempotency_key: 63f84c6c-2200-4c99-846c-2670a1311fbf + subscription: + name: Example Webhook Subscription + event_types: + - payment.created + - payment.updated + notification_url: https://example-webhook-url.com + api_version: '2021-12-15' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: wbhk_b35f6b3145074cf9ad513610786c19d5 + name: Example Webhook Subscription + enabled: true + event_types: + - payment.created + - payment.updated + notification_url: https://example-webhook-url.com + api_version: '2021-12-15' + signature_key: 1k9bIJKCeTmSQwyagtNRLg + created_at: 2022-01-10 23:29:48 +0000 UTC + updated_at: 2022-01-10 23:29:48 +0000 UTC + get: + path: /v2/webhooks/subscriptions/{subscription_id} + method: GET + auth: true + docs: Retrieves a webhook subscription identified by its ID. + source: + openapi: openapi/openapi.json + display-name: RetrieveWebhookSubscription + request: + name: GetSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: >- + [REQUIRED] The ID of the + [Subscription](entity:WebhookSubscription) to retrieve. + response: + docs: Success + type: root.GetWebhookSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: wbhk_b35f6b3145074cf9ad513610786c19d5 + name: Example Webhook Subscription + enabled: true + event_types: + - payment.created + - payment.updated + notification_url: https://example-webhook-url.com + api_version: '2021-12-15' + signature_key: 1k9bIJKCeTmSQwyagtNRLg + created_at: 2022-01-10 23:29:48 +0000 UTC + updated_at: 2022-01-10 23:29:48 +0000 UTC + update: + path: /v2/webhooks/subscriptions/{subscription_id} + method: PUT + auth: true + docs: Updates a webhook subscription. + source: + openapi: openapi/openapi.json + display-name: UpdateWebhookSubscription + request: + name: UpdateWebhookSubscriptionRequest + path-parameters: + subscription_id: + type: string + docs: >- + [REQUIRED] The ID of the + [Subscription](entity:WebhookSubscription) to update. + body: + properties: + subscription: + type: optional + docs: The [Subscription](entity:WebhookSubscription) to update. + content-type: application/json + response: + docs: Success + type: root.UpdateWebhookSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + request: + subscription: + name: Updated Example Webhook Subscription + enabled: false + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: wbhk_b35f6b3145074cf9ad513610786c19d5 + name: Updated Example Webhook Subscription + enabled: false + event_types: + - payment.created + - payment.updated + notification_url: https://example-webhook-url.com + api_version: '2021-12-15' + signature_key: signature_key + created_at: 2022-01-10 23:29:48 +0000 UTC + updated_at: 2022-01-10 23:45:51 +0000 UTC + delete: + path: /v2/webhooks/subscriptions/{subscription_id} + method: DELETE + auth: true + docs: Deletes a webhook subscription. + source: + openapi: openapi/openapi.json + display-name: DeleteWebhookSubscription + request: + name: DeleteSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: >- + [REQUIRED] The ID of the + [Subscription](entity:WebhookSubscription) to delete. + response: + docs: Success + type: root.DeleteWebhookSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + updateSignatureKey: + path: /v2/webhooks/subscriptions/{subscription_id}/signature-key + method: POST + auth: true + docs: >- + Updates a webhook subscription by replacing the existing signature key + with a new one. + source: + openapi: openapi/openapi.json + display-name: UpdateWebhookSubscriptionSignatureKey + request: + name: UpdateWebhookSubscriptionSignatureKeyRequest + path-parameters: + subscription_id: + type: string + docs: >- + [REQUIRED] The ID of the + [Subscription](entity:WebhookSubscription) to update. + body: + properties: + idempotency_key: + type: optional> + docs: >- + A unique string that identifies the + [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) + request. + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateWebhookSubscriptionSignatureKeyResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + request: + idempotency_key: ed80ae6b-0654-473b-bbab-a39aee89a60d + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + signature_key: 1k9bIJKCeTmSQwyagtNRLg + test: + path: /v2/webhooks/subscriptions/{subscription_id}/test + method: POST + auth: true + docs: >- + Tests a webhook subscription by sending a test event to the notification + URL. + source: + openapi: openapi/openapi.json + display-name: TestWebhookSubscription + request: + name: TestWebhookSubscriptionRequest + path-parameters: + subscription_id: + type: string + docs: >- + [REQUIRED] The ID of the + [Subscription](entity:WebhookSubscription) to test. + body: + properties: + event_type: + type: optional> + docs: >- + The event type that will be used to test the + [Subscription](entity:WebhookSubscription). The event type must + be + + contained in the list of event types in the + [Subscription](entity:WebhookSubscription). + content-type: application/json + response: + docs: Success + type: root.TestWebhookSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-07-16' + request: + event_type: payment.created + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription_test_result: + id: 23eed5a9-2b12-403e-b212-7e2889aea0f6 + status_code: 404 + payload: >- + {"merchant_id":"1ZYMKZY1YFGBW","type":"payment.created","event_id":"23eed5a9-2b12-403e-b212-7e2889aea0f6","created_at":"2022-01-11T00:06:48.322945116Z","data":{"type":"payment","id":"KkAkhdMsgzn59SM8A89WgKwekxLZY","object":{"payment":{"amount_money":{"amount":100,"currency":"USD"},"approved_money":{"amount":100,"currency":"USD"},"capabilities":["EDIT_TIP_AMOUNT","EDIT_TIP_AMOUNT_UP","EDIT_TIP_AMOUNT_DOWN"],"card_details":{"avs_status":"AVS_ACCEPTED","card":{"bin":"540988","card_brand":"MASTERCARD","card_type":"CREDIT","exp_month":11,"exp_year":2022,"fingerprint":"sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg","last_4":"9029","prepaid_type":"NOT_PREPAID"},"card_payment_timeline":{"authorized_at":"2020-11-22T21:16:51.198Z"},"cvv_status":"CVV_ACCEPTED","entry_method":"KEYED","statement_description":"SQ + *DEFAULT TEST + ACCOUNT","status":"AUTHORIZED"},"created_at":"2020-11-22T21:16:51.086Z","delay_action":"CANCEL","delay_duration":"PT168H","delayed_until":"2020-11-29T21:16:51.086Z","id":"hYy9pRFVxpDsO1FB05SunFWUe9JZY","location_id":"S8GWD5R9QB376","order_id":"03O3USaPaAaFnI6kkwB1JxGgBsUZY","receipt_number":"hYy9","risk_evaluation":{"created_at":"2020-11-22T21:16:51.198Z","risk_level":"NORMAL"},"source_type":"CARD","status":"APPROVED","total_money":{"amount":100,"currency":"USD"},"updated_at":"2020-11-22T21:16:51.198Z","version_token":"FfQhQJf9r3VSQIgyWBk1oqhIwiznLwVwJbVVA0bdyEv6o"}}}} + created_at: 2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746 + updated_at: 2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746 + source: + openapi: openapi/openapi.json diff --git a/.mock/fern.config.json b/.mock/fern.config.json new file mode 100644 index 000000000..47de4c7d3 --- /dev/null +++ b/.mock/fern.config.json @@ -0,0 +1,4 @@ +{ + "organization" : "square", + "version" : "0.64.23" +} \ No newline at end of file diff --git a/.mock/openapi/openapi.json b/.mock/openapi/openapi.json new file mode 100644 index 000000000..33c6c40f0 --- /dev/null +++ b/.mock/openapi/openapi.json @@ -0,0 +1,76800 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "2.0", + "title": "Square", + "description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.", + "termsOfService": "https://connect.squareup.com/tos", + "contact": { + "name": "Square Developer Platform", + "email": "developers@squareup.com", + "url": "https://squareup.com/developers" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Read the official documentation here:", + "url": "https://docs.connect.squareup.com/" + }, + "x-server-configuration": { + "default-environment": "production", + "default-server": "default", + "environments": [ + { + "name": "production", + "servers": [ + { + "name": "default", + "url": "https://connect.squareup.com" + } + ] + }, + { + "name": "sandbox", + "servers": [ + { + "name": "default", + "url": "https://connect.squareupsandbox.com" + } + ] + }, + { + "name": "custom", + "servers": [ + { + "name": "default", + "url": "{custom_url}" + } + ] + } + ], + "parameters": [ + { + "name": "custom_url", + "description": "Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`", + "type": "string", + "example": "https://connect.squareup.com" + } + ] + }, + "x-square-generic-error-codes": [ + "ACCESS_TOKEN_EXPIRED", + "ACCESS_TOKEN_REVOKED", + "API_VERSION_INCOMPATIBLE", + "APPLICATION_DISABLED", + "ARRAY_EMPTY", + "ARRAY_LENGTH_TOO_LONG", + "ARRAY_LENGTH_TOO_SHORT", + "BAD_CERTIFICATE", + "BAD_GATEWAY", + "BAD_REQUEST", + "CONFLICT", + "CONFLICTING_PARAMETERS", + "CURRENCY_MISMATCH", + "EXPECTED_ARRAY", + "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", + "EXPECTED_BOOLEAN", + "EXPECTED_FLOAT", + "EXPECTED_INTEGER", + "EXPECTED_JSON_BODY", + "EXPECTED_MAP", + "EXPECTED_OBJECT", + "EXPECTED_STRING", + "FORBIDDEN", + "GATEWAY_TIMEOUT", + "GONE", + "IDEMPOTENCY_KEY_REUSED", + "INCORRECT_TYPE", + "INSUFFICIENT_SCOPES", + "INTERNAL_SERVER_ERROR", + "INVALID_ARRAY_VALUE", + "INVALID_CONTENT_TYPE", + "INVALID_CURSOR", + "INVALID_ENUM_VALUE", + "INVALID_FORM_VALUE", + "INVALID_SORT_ORDER", + "INVALID_SQUARE_VERSION_FORMAT", + "INVALID_TIME", + "INVALID_TIME_RANGE", + "INVALID_VALUE", + "LOCATION_MISMATCH", + "MAP_KEY_LENGTH_TOO_LONG", + "MAP_KEY_LENGTH_TOO_SHORT", + "MERCHANT_SUBSCRIPTION_NOT_FOUND", + "METHOD_NOT_ALLOWED", + "MISSING_REQUIRED_PARAMETER", + "NOT_ACCEPTABLE", + "NOT_FOUND", + "NOT_IMPLEMENTED", + "NO_FIELDS_SET", + "RATE_LIMITED", + "REQUEST_ENTITY_TOO_LARGE", + "REQUEST_TIMEOUT", + "SANDBOX_NOT_SUPPORTED", + "SERVICE_UNAVAILABLE", + "TOO_MANY_MAP_ENTRIES", + "UNAUTHORIZED", + "UNEXPECTED_VALUE", + "UNKNOWN_BODY_PARAMETER", + "UNKNOWN_QUERY_PARAMETER", + "UNPROCESSABLE_ENTITY", + "UNSUPPORTED_MEDIA_TYPE", + "V1_ACCESS_TOKEN", + "V1_APPLICATION", + "VALUE_EMPTY", + "VALUE_REGEX_MISMATCH", + "VALUE_TOO_HIGH", + "VALUE_TOO_LONG", + "VALUE_TOO_LOW", + "VALUE_TOO_SHORT" + ] + }, + "servers": [ + { + "url": "https://connect.squareup.com", + "variables": {} + } + ], + "components": { + "securitySchemes": { + "oauth2": { + "type": "oauth2", + "x-additional-headers": [ + { + "name": "Square-Version", + "description": "Square Connect API versions", + "schema": { + "default": "2025-07-16" + } + } + ], + "flows": { + "authorizationCode": { + "authorizationUrl": "https://connect.squareup.com/oauth2/authorize", + "tokenUrl": "https://connect.squareup.com/oauth2/token", + "scopes": { + "ADDON_CONFIGURATIONS_READ": "__HTTP Method__: `GET`\n\nGrants write access for third-party Add-ons to read configurations of their Add-ons, for example, when calling `RetrieveConfiguration` endpoint.", + "ADDON_CONFIGURATIONS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access for third-party Add-ons to store configurations of their Add-ons, for example, when calling `CreateConfiguration` endpoint.", + "APPOINTMENTS_ALL_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to all of a seller's booking information, calendar, and business details.\nThis permission must be accompanied by the `APPOINTMENTS_READ` permission.", + "APPOINTMENTS_ALL_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to all booking details, including double-booking a seller.\nThis permission must be accompanied by the `APPOINTMENTS_WRITE` permission.", + "APPOINTMENTS_BUSINESS_SETTINGS_READ": "__HTTP Method__: `GET`\n\nGrants read access to booking business settings. For example, to call the\nListTeamMemberBookingProfiles endpoint.", + "APPOINTMENTS_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to booking information. For example, to call the\nRetrieveBooking endpoint.", + "APPOINTMENTS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to booking information. For example, to call the CreateBooking endpoint.", + "BANK_ACCOUNTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to bank account information associated with the targeted\nSquare account. For example, to call the Connect v1 ListBankAccounts endpoint.", + "CASH_DRAWER_READ": "__HTTP Method__: `GET`\n\nGrants read access to cash drawer shift information. For example, to call the\nListCashDrawerShifts endpoint.", + "CHANNELS_CREATE": "__HTTP Method__: `POST`\n\nGrants write access to create channels, for example, when calling the\n`CreateChannel` endpoint.", + "CHANNELS_READ": "__HTTP Method__: `GET`\n\nGrants read access to view channels, for example, when calling the\n`RetrieveChannel` endpoint.", + "CHANNELS_UPDATE": "__HTTP Method__: `PUT`\n\nGrants write access to update channels, for example, when calling the\n`UpdateChannel` endpoint.", + "CUSTOMERS_READ": "__HTTP Method__: `GET`\n\nGrants read access to customer information. For example, to call the\nListCustomers endpoint.", + "CUSTOMERS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to customer information. For example, to create and update\ncustomer profiles.", + "DEVICES_READ": "__HTTP Method__: `GET`\n\nGrants read access to device information. For example, to\ncall the `GetDevice` and `ListDevices` endpoints.", + "DEVICE_CREDENTIAL_MANAGEMENT": "__HTTP Method__: `POST`, `GET`\n\nGrants read/write access to device credentials information. For example, to\ncall the CreateDeviceCode endpoint.", + "DISCOUNT_CODES_READ": "__HTTP Method__: `GET`\n\nGrants read access to Discount Codes API. For example, to call the `RetrieveDiscountCode` and `RetrieveRedemption` endpoints.", + "DISCOUNT_CODES_WRITE": "__HTTP Method__: `POST`\n\nGrants write access to Discount Codes API.", + "DISPUTES_READ": "__HTTP Method__: `GET`\n\nGrants read access to dispute information. For example, to call the RetrieveDispute\nendpoint.", + "DISPUTES_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to dispute information. For example, to call the SubmitEvidence\nendpoint.", + "EMPLOYEES_READ": "__HTTP Method__: `GET`\n\nGrants read access to employee profile information. For example, to call the\nConnect v1 Employees API.", + "EMPLOYEES_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to employee profile information. For example, to create\nand modify employee profiles.", + "GIFTCARDS_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to gift card information. For example, to call the RetrieveGiftCard\nendpoint.", + "GIFTCARDS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to gift card information. For example, to call the CreateGiftCard\nendpoint.", + "INVENTORY_READ": "__HTTP Method__: `GET`\n\nGrants read access to inventory information. For example, to call the\nRetrieveInventoryCount endpoint.", + "INVENTORY_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to inventory information. For example, to call the\nBatchChangeInventory endpoint.", + "INVOICES_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to invoice information. For example, to call the ListInvoices endpoint.", + "INVOICES_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to invoice information. For example, to call the CreateInvoice endpoint.", + "ITEMS_READ": "__HTTP Method__: `GET`\n\nGrants read access to product catalog information. For example, to obtain objects in a product catalog.", + "ITEMS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to product catalog information. For example, to modify or\nadd to a product catalog.", + "LOYALTY_READ": "__HTTP Method__: `GET`\n\nGrants read access to loyalty information. For example, to call the\nListLoyaltyPrograms endpoint.", + "LOYALTY_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to loyalty information. For example, to call the\nCreateLoyaltyAccount endpoint.", + "MERCHANT_PROFILE_READ": "__HTTP Method__: `GET`\n\nGrants read access to business and location information. For example, to\nobtain a location ID for subsequent activity.", + "MERCHANT_PROFILE_WRITE": "__HTTP Method__: `POST`, `PUT`\n\nGrants write access to business and location information. For example, to create a new location or\nupdate the business hours at an existing location.", + "ONLINE_STORE_SITE_READ": "__HTTP Method__: `GET`, `POST`\n\nRead access to ECOM online store site details.", + "ONLINE_STORE_SNIPPETS_READ": "__HTTP Method__: `GET`, `POST`\n\nRead access to ECOM online store snippets on published websites.", + "ONLINE_STORE_SNIPPETS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nWrite access to ECOM online store snippets on published websites.", + "ORDERS_READ": "__HTTP Method__: `GET`\n\nGrants read access to order information. For example, to call the\nBatchRetrieveOrders endpoint.", + "ORDERS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to order information. For example, to call the\nCreateCheckout endpoint.", + "PAYMENTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to transaction and refund information. For example, to call\nthe RetrieveTransaction endpoint.", + "PAYMENTS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to transaction and refunds information. For example, to\nprocess payments with the Payments or Checkout API.", + "PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nAllow third party applications to deduct a portion of each transaction amount.\n__Required__ to use multiparty transaction functionality with the Payments\nAPI.", + "PAYMENTS_WRITE_IN_PERSON": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to payments and refunds information. For example, to\nprocess in-person payments.", + "PAYMENTS_WRITE_SHARED_ONFILE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nAllows the developer to process payments on behalf of a seller using a shared on file payment method.", + "PAYOUTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to payouts and payout entries information. For example,\nto call the Connect v2 `ListPayouts` endpoint.", + "PERMISSION_SETS_READ": "__HTTP Method__: `GET`\n\nGrants read access to Permission Sets. For example, to\ncall the `ListPermissionSets` and `RetrievePermissionSet` endpoints.", + "PERMISSION_SETS_WRITE": "__HTTP Method__: `PUT`\n\nGrants write access to Permission Sets.", + "RESERVATIONS_READ": "__HTTP Method__: `GET`\n\nGrants read access to reservation information, for example, when calling the\n`RetrieveReservation` endpoint.", + "RESERVATIONS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to reservation information, for example, when calling the\n`CreateReservation` endpoint.", + "RESTAURANT_CHECKS_READ": "__HTTP Method__: `GET`\n\nGrants read access to check information, for example, when calling the\n`RetrieveCheck` endpoint.", + "SETTLEMENTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to settlement (deposit) information. For example, to call\nthe Connect v1 ListSettlements endpoint.", + "SUBSCRIPTIONS_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to subscription information. For example, to call the RetrieveSubscription\nendpoint.", + "SUBSCRIPTIONS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to subscription information. For example, to call the CreateSubscription\nendpoint.", + "TIMECARDS_READ": "__HTTP Method__: `GET`\n\nGrants read access to employee timecard information. For example, to call the\nConnect v2 SearchShifts endpoint.", + "TIMECARDS_SETTINGS_READ": "__HTTP Method__: `GET`\n\nGrants read access to employee timecard settings information. For example, to\ncall the GetBreakType endpoint.", + "TIMECARDS_SETTINGS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to employee timecard settings information. For example, to\ncall the UpdateBreakType endpoint.", + "TIMECARDS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to employee shift information. For example, to create\nand modify employee shifts.", + "VENDOR_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to vendor information, for example, when calling the\n`RetrieveVendor` endpoint.", + "VENDOR_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to vendor information, for example, when calling the\n`BulkUpdateVendors` endpoint." + } + } + } + }, + "oauth2ClientSecret": { + "type": "apiKey", + "in": "header", + "name": "Authorization" + } + }, + "schemas": { + "ACHDetails": { + "type": "object", + "description": "ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`.", + "x-release-status": "PUBLIC", + "properties": { + "routing_number": { + "type": "string", + "description": "The routing number for the bank account.", + "maxLength": 50, + "nullable": true + }, + "account_number_suffix": { + "type": "string", + "description": "The last few digits of the bank account number.", + "minLength": 1, + "maxLength": 4, + "nullable": true + }, + "account_type": { + "type": "string", + "description": "The type of the bank account performing the transfer. The account type can be `CHECKING`,\n`SAVINGS`, or `UNKNOWN`.", + "maxLength": 50, + "nullable": true + } + } + }, + "AcceptDisputeResponse": { + "type": "object", + "description": "Defines the fields in an `AcceptDispute` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "dispute": { + "$ref": "#/components/schemas/Dispute", + "description": "Details about the accepted dispute." + } + }, + "example": { + "dispute": { + "amount_money": { + "amount": 2500, + "currency": "USD" + }, + "brand_dispute_id": "100000809947", + "card_brand": "VISA", + "created_at": "2022-06-29T18:45:22.265Z", + "disputed_payment": { + "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" + }, + "due_at": "2022-07-13T00:00:00.000Z", + "id": "XDgyFu7yo1E2S5lQGGpYn", + "location_id": "L1HN3ZMQK64X9", + "reason": "NO_KNOWLEDGE", + "reported_at": "2022-06-29T00:00:00.000Z", + "state": "ACCEPTED", + "updated_at": "2022-07-07T19:14:42.650Z", + "version": 2 + } + } + }, + "AcceptedPaymentMethods": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "apple_pay": { + "type": "boolean", + "description": "Whether Apple Pay is accepted at checkout.", + "nullable": true + }, + "google_pay": { + "type": "boolean", + "description": "Whether Google Pay is accepted at checkout.", + "nullable": true + }, + "cash_app_pay": { + "type": "boolean", + "description": "Whether Cash App Pay is accepted at checkout.", + "nullable": true + }, + "afterpay_clearpay": { + "type": "boolean", + "description": "Whether Afterpay/Clearpay is accepted at checkout.", + "nullable": true + } + } + }, + "AccumulateLoyaltyPointsRequest": { + "type": "object", + "description": "Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "required": [ + "accumulate_points", + "idempotency_key", + "location_id" + ], + "properties": { + "accumulate_points": { + "$ref": "#/components/schemas/LoyaltyEventAccumulatePoints", + "description": "The points to add to the account. \nIf you are using the Orders API to manage orders, specify the order ID.\nOtherwise, specify the points to add." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `AccumulateLoyaltyPoints` request. \nKeys can be any valid string but must be unique for every request.", + "minLength": 1, + "maxLength": 128 + }, + "location_id": { + "type": "string", + "description": "The [location](entity:Location) where the purchase was made." + } + }, + "example": { + "accumulate_points": { + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + }, + "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", + "location_id": "P034NEENMD09F" + } + }, + "AccumulateLoyaltyPointsResponse": { + "type": "object", + "description": "Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "event": { + "$ref": "#/components/schemas/LoyaltyEvent", + "description": "The resulting loyalty event. Starting in Square version 2022-08-17, this field is no longer returned.", + "x-release-status": "DEPRECATED" + }, + "events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyEvent" + }, + "description": "The resulting loyalty events. If the purchase qualifies for points, the `ACCUMULATE_POINTS` event\nis always included. When using the Orders API, the `ACCUMULATE_PROMOTION_POINTS` event is included\nif the purchase also qualifies for a loyalty promotion." + } + }, + "example": { + "events": [ + { + "accumulate_points": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", + "points": 6 + }, + "created_at": "2020-05-08T21:41:12Z", + "id": "ee46aafd-1af6-3695-a385-276e2ef0be26", + "location_id": "P034NEENMD09F", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "source": "LOYALTY_API", + "type": "ACCUMULATE_POINTS" + } + ] + } + }, + "ActionCancelReason": { + "type": "string", + "enum": [ + "BUYER_CANCELED", + "SELLER_CANCELED", + "TIMED_OUT" + ], + "x-enum-elements": [ + { + "name": "BUYER_CANCELED", + "description": "A person canceled the `TerminalCheckout` from a Square device." + }, + { + "name": "SELLER_CANCELED", + "description": "A client canceled the `TerminalCheckout` using the API." + }, + { + "name": "TIMED_OUT", + "description": "The `TerminalCheckout` timed out (see `deadline_duration` on the `TerminalCheckout`)." + } + ], + "x-release-status": "PUBLIC" + }, + "ActivityType": { + "type": "string", + "enum": [ + "ADJUSTMENT", + "APP_FEE_REFUND", + "APP_FEE_REVENUE", + "AUTOMATIC_SAVINGS", + "AUTOMATIC_SAVINGS_REVERSED", + "CHARGE", + "DEPOSIT_FEE", + "DEPOSIT_FEE_REVERSED", + "DISPUTE", + "ESCHEATMENT", + "FEE", + "FREE_PROCESSING", + "HOLD_ADJUSTMENT", + "INITIAL_BALANCE_CHANGE", + "MONEY_TRANSFER", + "MONEY_TRANSFER_REVERSAL", + "OPEN_DISPUTE", + "OTHER", + "OTHER_ADJUSTMENT", + "PAID_SERVICE_FEE", + "PAID_SERVICE_FEE_REFUND", + "REDEMPTION_CODE", + "REFUND", + "RELEASE_ADJUSTMENT", + "RESERVE_HOLD", + "RESERVE_RELEASE", + "RETURNED_PAYOUT", + "SQUARE_CAPITAL_PAYMENT", + "SQUARE_CAPITAL_REVERSED_PAYMENT", + "SUBSCRIPTION_FEE", + "SUBSCRIPTION_FEE_PAID_REFUND", + "SUBSCRIPTION_FEE_REFUND", + "TAX_ON_FEE", + "THIRD_PARTY_FEE", + "THIRD_PARTY_FEE_REFUND", + "PAYOUT", + "AUTOMATIC_BITCOIN_CONVERSIONS", + "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED", + "CREDIT_CARD_REPAYMENT", + "CREDIT_CARD_REPAYMENT_REVERSED", + "LOCAL_OFFERS_CASHBACK", + "LOCAL_OFFERS_FEE", + "PERCENTAGE_PROCESSING_ENROLLMENT", + "PERCENTAGE_PROCESSING_DEACTIVATION", + "PERCENTAGE_PROCESSING_REPAYMENT", + "PERCENTAGE_PROCESSING_REPAYMENT_REVERSED", + "PROCESSING_FEE", + "PROCESSING_FEE_REFUND", + "UNDO_PROCESSING_FEE_REFUND", + "GIFT_CARD_LOAD_FEE", + "GIFT_CARD_LOAD_FEE_REFUND", + "UNDO_GIFT_CARD_LOAD_FEE_REFUND", + "BALANCE_FOLDERS_TRANSFER", + "BALANCE_FOLDERS_TRANSFER_REVERSED", + "GIFT_CARD_POOL_TRANSFER", + "GIFT_CARD_POOL_TRANSFER_REVERSED", + "SQUARE_PAYROLL_TRANSFER", + "SQUARE_PAYROLL_TRANSFER_REVERSED" + ], + "x-enum-elements": [ + { + "name": "ADJUSTMENT", + "description": "A manual adjustment applied to the seller's account by Square." + }, + { + "name": "APP_FEE_REFUND", + "description": "A refund for an application fee on a payment." + }, + { + "name": "APP_FEE_REVENUE", + "description": "Revenue generated from an application fee on a payment." + }, + { + "name": "AUTOMATIC_SAVINGS", + "description": "An automatic transfer from the payment processing balance to the Square Savings account. These are generally proportional to the seller's sales." + }, + { + "name": "AUTOMATIC_SAVINGS_REVERSED", + "description": "An automatic transfer from the Square Savings account back to the processing balance. These are generally proportional to the seller's refunds." + }, + { + "name": "CHARGE", + "description": "A credit card payment capture." + }, + { + "name": "DEPOSIT_FEE", + "description": "A fee assessed because of a deposit, such as an instant deposit." + }, + { + "name": "DEPOSIT_FEE_REVERSED", + "description": "Indicates that Square returned a fee that was previously assessed because of a deposit, such as an instant deposit, back to the seller's account." + }, + { + "name": "DISPUTE", + "description": "The balance change due to a dispute event." + }, + { + "name": "ESCHEATMENT", + "description": "An escheatment entry for remittance." + }, + { + "name": "FEE", + "description": "The cost plus adjustment fee." + }, + { + "name": "FREE_PROCESSING", + "description": "Square offers free payments processing for a variety of business scenarios, including seller\nreferrals or when Square wants to apologize (for example, for a bug, customer service, or repricing complication).\nThis entry represents a credit to the seller for the purposes of free processing." + }, + { + "name": "HOLD_ADJUSTMENT", + "description": "An adjustment made by Square related to holding a payment." + }, + { + "name": "INITIAL_BALANCE_CHANGE", + "description": "An external change to a seller's balance (initial, in the sense that it causes the creation of the other activity types, such as a hold and refund)." + }, + { + "name": "MONEY_TRANSFER", + "description": "The balance change from a money transfer." + }, + { + "name": "MONEY_TRANSFER_REVERSAL", + "description": "The reversal of a money transfer." + }, + { + "name": "OPEN_DISPUTE", + "description": "The balance change for a chargeback that's been filed." + }, + { + "name": "OTHER", + "description": "Any other type that doesn't belong in the rest of the types." + }, + { + "name": "OTHER_ADJUSTMENT", + "description": "Any other type of adjustment that doesn't fall under existing types." + }, + { + "name": "PAID_SERVICE_FEE", + "description": "A fee paid to a third-party seller." + }, + { + "name": "PAID_SERVICE_FEE_REFUND", + "description": "A fee refunded to a third-party seller." + }, + { + "name": "REDEMPTION_CODE", + "description": "Repayment for a redemption code." + }, + { + "name": "REFUND", + "description": "A refund for an existing card payment." + }, + { + "name": "RELEASE_ADJUSTMENT", + "description": "An adjustment made by Square related to releasing a payment." + }, + { + "name": "RESERVE_HOLD", + "description": "Fees paid for a funding risk reserve." + }, + { + "name": "RESERVE_RELEASE", + "description": "Fees released from a risk reserve." + }, + { + "name": "RETURNED_PAYOUT", + "description": "An entry created when Square receives a response for the ACH file that Square sent indicating that the\nsettlement of the original entry failed." + }, + { + "name": "SQUARE_CAPITAL_PAYMENT", + "description": "A capital merchant cash advance (MCA) assessment. These are generally proportional to the merchant's sales but can be issued for other reasons related to the MCA." + }, + { + "name": "SQUARE_CAPITAL_REVERSED_PAYMENT", + "description": "A capital merchant cash advance (MCA) assessment refund. These are generally proportional to the merchant's refunds but can be issued for other reasons related to the MCA." + }, + { + "name": "SUBSCRIPTION_FEE", + "description": "A fee charged for subscription to a Square product." + }, + { + "name": "SUBSCRIPTION_FEE_PAID_REFUND", + "description": "A Square subscription fee that's been refunded." + }, + { + "name": "SUBSCRIPTION_FEE_REFUND", + "description": "The refund of a previously charged Square product subscription fee." + }, + { + "name": "TAX_ON_FEE", + "description": "The tax paid on fee amounts." + }, + { + "name": "THIRD_PARTY_FEE", + "description": "Fees collected by a third-party platform." + }, + { + "name": "THIRD_PARTY_FEE_REFUND", + "description": "Refunded fees from a third-party platform." + }, + { + "name": "PAYOUT", + "description": "The balance change due to a money transfer. Note that this type is never returned by the Payouts API." + }, + { + "name": "AUTOMATIC_BITCOIN_CONVERSIONS", + "description": "Indicates that the portion of each payment withheld by Square was automatically converted into bitcoin using Cash App. The seller manages their bitcoin in their Cash App account." + }, + { + "name": "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED", + "description": "Indicates that a withheld payment, which was scheduled to be converted into bitcoin using Cash App, was deposited back to the Square payments balance." + }, + { + "name": "CREDIT_CARD_REPAYMENT", + "description": "Indicates that a repayment toward the outstanding balance on the seller's Square credit card was made." + }, + { + "name": "CREDIT_CARD_REPAYMENT_REVERSED", + "description": "Indicates that a repayment toward the outstanding balance on the seller's Square credit card was reversed." + }, + { + "name": "LOCAL_OFFERS_CASHBACK", + "description": "Cashback amount given by a Square Local Offers seller to their customer for a purchase." + }, + { + "name": "LOCAL_OFFERS_FEE", + "description": "A commission fee paid by a Square Local Offers seller to Square for a purchase discovered through Square Local Offers." + }, + { + "name": "PERCENTAGE_PROCESSING_ENROLLMENT", + "description": "When activating Percentage Processing, a credit is applied to the seller’s account to offset any negative balance caused by a dispute." + }, + { + "name": "PERCENTAGE_PROCESSING_DEACTIVATION", + "description": "Deducting the outstanding Percentage Processing balance from the seller’s account. It's the final installment in repaying the dispute-induced negative balance through percentage processing." + }, + { + "name": "PERCENTAGE_PROCESSING_REPAYMENT", + "description": "Withheld funds from a payment to cover a negative balance. It's an installment to repay the amount from a dispute that had been offset during Percentage Processing enrollment." + }, + { + "name": "PERCENTAGE_PROCESSING_REPAYMENT_REVERSED", + "description": "The reversal of a percentage processing repayment that happens for example when a refund is issued for a payment." + }, + { + "name": "PROCESSING_FEE", + "description": "The processing fee for a payment. If sellers opt for Gross Settlement, i.e., direct bank withdrawal instead of deducting fees from daily sales, the processing fee is recorded separately as a new payout entry, not part of the CHARGE payout entry." + }, + { + "name": "PROCESSING_FEE_REFUND", + "description": "The processing fee for a payment refund issued by sellers enrolled in Gross Settlement. The refunded processing fee is recorded separately as a new payout entry, not part of the REFUND payout entry." + }, + { + "name": "UNDO_PROCESSING_FEE_REFUND", + "description": "When undoing a processing fee refund in a Gross Settlement payment, this payout entry type is used." + }, + { + "name": "GIFT_CARD_LOAD_FEE", + "description": "Fee collected during the sale or reload of a gift card. This fee, which is a portion of the amount loaded on the gift card, is deducted from the merchant's payment balance." + }, + { + "name": "GIFT_CARD_LOAD_FEE_REFUND", + "description": "Refund for fee charged during the sale or reload of a gift card." + }, + { + "name": "UNDO_GIFT_CARD_LOAD_FEE_REFUND", + "description": "The undo of a refund for a fee charged during the sale or reload of a gift card." + }, + { + "name": "BALANCE_FOLDERS_TRANSFER", + "description": "A transfer of funds to a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.'" + }, + { + "name": "BALANCE_FOLDERS_TRANSFER_REVERSED", + "description": "A reversal of transfer of funds from a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.'" + }, + { + "name": "GIFT_CARD_POOL_TRANSFER", + "description": "A transfer of gift card funds to a central gift card pool account. In franchises, when gift cards are loaded or reloaded at any location, the money transfers to the franchisor's account." + }, + { + "name": "GIFT_CARD_POOL_TRANSFER_REVERSED", + "description": "A reversal of transfer of gift card funds from a central gift card pool account. In franchises, when gift cards are loaded or reloaded at any location, the money transfers to the franchisor's account." + }, + { + "name": "SQUARE_PAYROLL_TRANSFER", + "description": "A payroll payment that was transferred to a team member’s bank account." + }, + { + "name": "SQUARE_PAYROLL_TRANSFER_REVERSED", + "description": "A payroll payment to a team member’s bank account that was deposited back to the seller’s account by Square." + } + ], + "x-release-status": "PUBLIC" + }, + "AddGroupToCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [AddGroupToCustomer](api-endpoint:Customers-AddGroupToCustomer) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "AdditionalRecipient": { + "type": "object", + "description": "Represents an additional recipient (other than the merchant) receiving a portion of this tender.", + "x-release-status": "DEPRECATED", + "required": [ + "location_id", + "amount_money" + ], + "properties": { + "location_id": { + "type": "string", + "description": "The location ID for a recipient (other than the merchant) receiving a portion of this tender.", + "minLength": 1, + "maxLength": 50 + }, + "description": { + "type": "string", + "description": "The description of the additional recipient.", + "maxLength": 100, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money distributed to the recipient." + }, + "receivable_id": { + "type": "string", + "description": "The unique ID for the RETIRED `AdditionalRecipientReceivable` object. This field should be empty for any `AdditionalRecipient` objects created after the retirement.", + "maxLength": 192, + "nullable": true + } + } + }, + "Address": { + "type": "object", + "description": "Represents a postal address in a country. \nFor more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).", + "x-release-status": "PUBLIC", + "properties": { + "address_line_1": { + "type": "string", + "description": "The first line of the address.\n\nFields that start with `address_line` provide the address's most specific\ndetails, like street number, street name, and building name. They do *not*\nprovide less specific details like city, state/province, or country (these\ndetails are provided in other fields).", + "nullable": true + }, + "address_line_2": { + "type": "string", + "description": "The second line of the address, if any.", + "nullable": true + }, + "address_line_3": { + "type": "string", + "description": "The third line of the address, if any.", + "nullable": true + }, + "locality": { + "type": "string", + "description": "The city or town of the address. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).", + "nullable": true + }, + "sublocality": { + "type": "string", + "description": "A civil region within the address's `locality`, if any.", + "nullable": true + }, + "sublocality_2": { + "type": "string", + "description": "A civil region within the address's `sublocality`, if any.", + "nullable": true + }, + "sublocality_3": { + "type": "string", + "description": "A civil region within the address's `sublocality_2`, if any.", + "nullable": true + }, + "administrative_district_level_1": { + "type": "string", + "description": "A civil entity within the address's country. In the US, this\nis the state. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).", + "nullable": true + }, + "administrative_district_level_2": { + "type": "string", + "description": "A civil entity within the address's `administrative_district_level_1`.\nIn the US, this is the county.", + "nullable": true + }, + "administrative_district_level_3": { + "type": "string", + "description": "A civil entity within the address's `administrative_district_level_2`,\nif any.", + "nullable": true + }, + "postal_code": { + "type": "string", + "description": "The address's postal code. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).", + "nullable": true + }, + "country": { + "$ref": "#/components/schemas/Country", + "description": "The address's country, in the two-letter format of ISO 3166. For example, `US` or `FR`.\nSee [Country](#type-country) for possible values", + "nullable": true + }, + "first_name": { + "type": "string", + "description": "Optional first name when it's representing recipient.", + "nullable": true + }, + "last_name": { + "type": "string", + "description": "Optional last name when it's representing recipient.", + "nullable": true + } + } + }, + "AdjustLoyaltyPointsRequest": { + "type": "object", + "description": "Represents an [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "required": [ + "idempotency_key", + "adjust_points" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `AdjustLoyaltyPoints` request. \nKeys can be any valid string, but must be unique for every request.", + "minLength": 1, + "maxLength": 128 + }, + "adjust_points": { + "$ref": "#/components/schemas/LoyaltyEventAdjustPoints", + "description": "The points to add or subtract and the reason for the adjustment. To add points, specify a positive integer.\nTo subtract points, specify a negative integer." + }, + "allow_negative_balance": { + "type": "boolean", + "description": "Indicates whether to allow a negative adjustment to result in a negative balance. If `true`, a negative\nbalance is allowed when subtracting points. If `false`, Square returns a `BAD_REQUEST` error when subtracting\nthe specified number of points would result in a negative balance. The default value is `false`.", + "nullable": true + } + }, + "example": { + "adjust_points": { + "points": 10, + "reason": "Complimentary points" + }, + "idempotency_key": "bc29a517-3dc9-450e-aa76-fae39ee849d1" + } + }, + "AdjustLoyaltyPointsResponse": { + "type": "object", + "description": "Represents an [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "event": { + "$ref": "#/components/schemas/LoyaltyEvent", + "description": "The resulting event data for the adjustment." + } + }, + "example": { + "event": { + "adjust_points": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "points": 10, + "reason": "Complimentary points" + }, + "created_at": "2020-05-08T21:42:32Z", + "id": "613a6fca-8d67-39d0-bad2-3b4bc45c8637", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "source": "LOYALTY_API", + "type": "ADJUST_POINTS" + } + } + }, + "AfterpayDetails": { + "type": "object", + "description": "Additional details about Afterpay payments.", + "x-release-status": "PUBLIC", + "properties": { + "email_address": { + "type": "string", + "description": "Email address on the buyer's Afterpay account.", + "maxLength": 255, + "nullable": true + } + } + }, + "ApplicationDetails": { + "type": "object", + "description": "Details about the application that took the payment.", + "x-release-status": "PUBLIC", + "properties": { + "square_product": { + "$ref": "#/components/schemas/ApplicationDetailsExternalSquareProduct", + "description": "The Square product, such as Square Point of Sale (POS), \nSquare Invoices, or Square Virtual Terminal.\nSee [ExternalSquareProduct](#type-externalsquareproduct) for possible values", + "nullable": true + }, + "application_id": { + "type": "string", + "description": "The Square ID assigned to the application used to take the payment. \nApplication developers can use this information to identify payments that \ntheir application processed. \nFor example, if a developer uses a custom application to process payments, \nthis field contains the application ID from the Developer Dashboard. \nIf a seller uses a [Square App Marketplace](https://developer.squareup.com/docs/app-marketplace) \napplication to process payments, the field contains the corresponding application ID.", + "nullable": true + } + } + }, + "ApplicationDetailsExternalSquareProduct": { + "type": "string", + "enum": [ + "APPOINTMENTS", + "ECOMMERCE_API", + "INVOICES", + "ONLINE_STORE", + "OTHER", + "RESTAURANTS", + "RETAIL", + "SQUARE_POS", + "TERMINAL_API", + "VIRTUAL_TERMINAL" + ], + "x-enum-elements": [ + { + "name": "APPOINTMENTS", + "description": "" + }, + { + "name": "ECOMMERCE_API", + "description": "" + }, + { + "name": "INVOICES", + "description": "" + }, + { + "name": "ONLINE_STORE", + "description": "" + }, + { + "name": "OTHER", + "description": "" + }, + { + "name": "RESTAURANTS", + "description": "" + }, + { + "name": "RETAIL", + "description": "" + }, + { + "name": "SQUARE_POS", + "description": "" + }, + { + "name": "TERMINAL_API", + "description": "" + }, + { + "name": "VIRTUAL_TERMINAL", + "description": "" + } + ], + "description": "A list of products to return to external callers.", + "x-release-status": "PUBLIC" + }, + "ApplicationType": { + "type": "string", + "enum": [ + "TERMINAL_API" + ], + "x-enum-elements": [ + { + "name": "TERMINAL_API", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "AppointmentSegment": { + "type": "object", + "description": "Defines an appointment segment of a booking.", + "x-release-status": "PUBLIC", + "required": [ + "team_member_id" + ], + "properties": { + "duration_minutes": { + "type": "integer", + "description": "The time span in minutes of an appointment segment.", + "maximum": 1500, + "nullable": true + }, + "service_variation_id": { + "type": "string", + "description": "The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.", + "maxLength": 36, + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "The ID of the [TeamMember](entity:TeamMember) object representing the team member booked in this segment.", + "minLength": 1, + "maxLength": 32 + }, + "service_variation_version": { + "type": "integer", + "description": "The current version of the item variation representing the service booked in this segment.", + "format": "int64", + "nullable": true + }, + "intermission_minutes": { + "type": "integer", + "description": "Time between the end of this segment and the beginning of the subsequent segment.", + "readOnly": true + }, + "any_team_member": { + "type": "boolean", + "description": "Whether the customer accepts any team member, instead of a specific one, to serve this segment.", + "readOnly": true + }, + "resource_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the seller-accessible resources used for this appointment segment.", + "readOnly": true + } + } + }, + "ArchivedState": { + "type": "string", + "enum": [ + "ARCHIVED_STATE_NOT_ARCHIVED", + "ARCHIVED_STATE_ARCHIVED", + "ARCHIVED_STATE_ALL" + ], + "x-enum-elements": [ + { + "name": "ARCHIVED_STATE_NOT_ARCHIVED", + "description": "Requested items are not archived with the `is_archived` attribute set to `false`." + }, + { + "name": "ARCHIVED_STATE_ARCHIVED", + "description": "Requested items are archived with the `is_archived` attribute set to `true`." + }, + { + "name": "ARCHIVED_STATE_ALL", + "description": "Requested items can be archived or not archived." + } + ], + "description": "Defines the values for the `archived_state` query expression \nused in [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) \nto return the archived, not archived or either type of catalog items.", + "x-release-status": "PUBLIC" + }, + "Availability": { + "type": "object", + "description": "Defines an appointment slot that encapsulates the appointment segments, location and starting time available for booking.", + "x-release-status": "PUBLIC", + "properties": { + "start_at": { + "type": "string", + "description": "The RFC 3339 timestamp specifying the beginning time of the slot available for booking.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location available for booking.", + "maxLength": 32, + "readOnly": true + }, + "appointment_segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AppointmentSegment" + }, + "description": "The list of appointment segments available for booking", + "nullable": true + } + } + }, + "BankAccount": { + "type": "object", + "description": "Represents a bank account. For more information about \nlinking a bank account to a Square account, see \n[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api).", + "x-release-status": "PUBLIC", + "required": [ + "id", + "account_number_suffix", + "country", + "currency", + "account_type", + "holder_name", + "primary_bank_identification_number", + "status", + "creditable", + "debitable" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique, Square-issued identifier for the bank account.", + "minLength": 1, + "maxLength": 30 + }, + "account_number_suffix": { + "type": "string", + "description": "The last few digits of the account number.", + "minLength": 1 + }, + "country": { + "$ref": "#/components/schemas/Country", + "description": "The ISO 3166 Alpha-2 country code where the bank account is based.\nSee [Country](#type-country) for possible values" + }, + "currency": { + "$ref": "#/components/schemas/Currency", + "description": "The 3-character ISO 4217 currency code indicating the operating\ncurrency of the bank account. For example, the currency code for US dollars\nis `USD`.\nSee [Currency](#type-currency) for possible values" + }, + "account_type": { + "$ref": "#/components/schemas/BankAccountType", + "description": "The financial purpose of the associated bank account.\nSee [BankAccountType](#type-bankaccounttype) for possible values" + }, + "holder_name": { + "type": "string", + "description": "Name of the account holder. This name must match the name \non the targeted bank account record.", + "minLength": 1 + }, + "primary_bank_identification_number": { + "type": "string", + "description": "Primary identifier for the bank. For more information, see \n[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api).", + "maxLength": 40 + }, + "secondary_bank_identification_number": { + "type": "string", + "description": "Secondary identifier for the bank. For more information, see \n[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api).", + "maxLength": 40, + "nullable": true + }, + "debit_mandate_reference_id": { + "type": "string", + "description": "Reference identifier that will be displayed to UK bank account owners\nwhen collecting direct debit authorization. Only required for UK bank accounts.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "Client-provided identifier for linking the banking account to an entity\nin a third-party system (for example, a bank account number or a user identifier).", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The location to which the bank account belongs.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BankAccountStatus", + "description": "Read-only. The current verification status of this BankAccount object.\nSee [BankAccountStatus](#type-bankaccountstatus) for possible values" + }, + "creditable": { + "type": "boolean", + "description": "Indicates whether it is possible for Square to send money to this bank account." + }, + "debitable": { + "type": "boolean", + "description": "Indicates whether it is possible for Square to take money from this \nbank account." + }, + "fingerprint": { + "type": "string", + "description": "A Square-assigned, unique identifier for the bank account based on the\naccount information. The account fingerprint can be used to compare account\nentries and determine if the they represent the same real-world bank account.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The current version of the `BankAccount`." + }, + "bank_name": { + "type": "string", + "description": "Read only. Name of actual financial institution. \nFor example \"Bank of America\".", + "maxLength": 100, + "nullable": true + } + } + }, + "BankAccountCreatedEvent": { + "type": "object", + "description": "Published when you link an external bank account to a Square\naccount in the Seller Dashboard. Square sets the initial status to\n`VERIFICATION_IN_PROGRESS` and publishes the event.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"bank_account.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/BankAccountCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "bact:cgvL1yv43VFjexample", + "object": { + "bank_account": { + "account_number_suffix": "526", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": true, + "currency": "USD", + "debitable": true, + "holder_name": "John Doe", + "id": "bact:cgvL1yv43VFjexample", + "location_id": "S8GWD5DBJ3HF3", + "primary_bank_identification_number": "101211111", + "status": "VERIFICATION_IN_PROGRESS", + "version": 1 + } + }, + "type": "bank_account" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "location_id": "S8GWD5DBJ3HF3", + "merchant_id": "6SSW7HV8K2ST5", + "type": "bank_account.created" + }, + "x-webhook": { + "event": "bank_account.created", + "scopes": [ + "BANK_ACCOUNTS_READ" + ] + }, + "x-api": "#/components/x-apis/BankAccounts", + "x-since": "2020-02-26" + }, + "BankAccountCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"bank_account\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected bank account." + }, + "object": { + "$ref": "#/components/schemas/BankAccountCreatedEventObject", + "description": "An object containing the created bank account.", + "nullable": true + } + } + }, + "BankAccountCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "bank_account": { + "$ref": "#/components/schemas/BankAccount", + "description": "The created bank account.", + "nullable": true + } + } + }, + "BankAccountDisabledEvent": { + "type": "object", + "description": "Published when Square sets the status of a\n[BankAccount](entity:BankAccount) to `DISABLED`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"bank_account.disabled\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was disabled, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/BankAccountDisabledEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "bact:cgvL1yv43VFjexample", + "object": { + "bank_account": { + "account_number_suffix": "526", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": true, + "currency": "USD", + "debitable": true, + "holder_name": "John Doe", + "id": "bact:cgvL1yv43VFjexample", + "location_id": "S8GWD5DBJ3HF3", + "primary_bank_identification_number": "101211111", + "status": "DISABLED", + "version": 5 + } + }, + "type": "bank_account" + }, + "event_id": "43e8b5c7-706f-49bf-8e2a-90fbe96af93e", + "location_id": "S8GWD5DBJ3HF3", + "merchant_id": "6SSW7HV8K2ST5", + "type": "bank_account.disabled" + }, + "x-webhook": { + "event": "bank_account.disabled", + "scopes": [ + "BANK_ACCOUNTS_READ" + ] + }, + "x-api": "#/components/x-apis/BankAccounts", + "x-since": "2020-02-26" + }, + "BankAccountDisabledEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"bank_account\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected bank account." + }, + "object": { + "$ref": "#/components/schemas/BankAccountDisabledEventObject", + "description": "An object containing the disabled bank account.", + "nullable": true + } + } + }, + "BankAccountDisabledEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "bank_account": { + "$ref": "#/components/schemas/BankAccount", + "description": "The disabled bank account.", + "nullable": true + } + } + }, + "BankAccountPaymentDetails": { + "type": "object", + "description": "Additional details about BANK_ACCOUNT type payments.", + "x-release-status": "PUBLIC", + "properties": { + "bank_name": { + "type": "string", + "description": "The name of the bank associated with the bank account.", + "maxLength": 100, + "nullable": true + }, + "transfer_type": { + "type": "string", + "description": "The type of the bank transfer. The type can be `ACH` or `UNKNOWN`.", + "maxLength": 50, + "nullable": true + }, + "account_ownership_type": { + "type": "string", + "description": "The ownership type of the bank account performing the transfer.\nThe type can be `INDIVIDUAL`, `COMPANY`, or `ACCOUNT_TYPE_UNKNOWN`.", + "maxLength": 50, + "nullable": true + }, + "fingerprint": { + "type": "string", + "description": "Uniquely identifies the bank account for this seller and can be used\nto determine if payments are from the same bank account.", + "maxLength": 255, + "nullable": true + }, + "country": { + "type": "string", + "description": "The two-letter ISO code representing the country the bank account is located in.", + "minLength": 2, + "maxLength": 2, + "nullable": true + }, + "statement_description": { + "type": "string", + "description": "The statement description as sent to the bank.", + "maxLength": 1000, + "nullable": true + }, + "ach_details": { + "$ref": "#/components/schemas/ACHDetails", + "description": "ACH-specific information about the transfer. The information is only populated\nif the `transfer_type` is `ACH`.", + "nullable": true + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request.", + "nullable": true + } + } + }, + "BankAccountStatus": { + "type": "string", + "enum": [ + "VERIFICATION_IN_PROGRESS", + "VERIFIED", + "DISABLED" + ], + "x-enum-elements": [ + { + "name": "VERIFICATION_IN_PROGRESS", + "description": "Indicates that the verification process has started. Some features\n(for example, creditable or debitable) may be provisionally enabled on the bank\naccount." + }, + { + "name": "VERIFIED", + "description": "Indicates that the bank account was successfully verified." + }, + { + "name": "DISABLED", + "description": "Indicates that the bank account is disabled and is permanently unusable\nfor funds transfer. A bank account can be disabled because of a failed verification\nattempt or a failed deposit attempt." + } + ], + "description": "Indicates the current verification status of a `BankAccount` object.", + "x-release-status": "PUBLIC" + }, + "BankAccountType": { + "type": "string", + "enum": [ + "CHECKING", + "SAVINGS", + "INVESTMENT", + "OTHER", + "BUSINESS_CHECKING" + ], + "x-enum-elements": [ + { + "name": "CHECKING", + "description": "An account at a financial institution against which checks can be\ndrawn by the account depositor." + }, + { + "name": "SAVINGS", + "description": "An account at a financial institution that pays interest but cannot be\nused directly as money in the narrow sense of a medium of exchange." + }, + { + "name": "INVESTMENT", + "description": "An account at a financial institution that contains a deposit of funds\nand/or securities." + }, + { + "name": "OTHER", + "description": "An account at a financial institution which cannot be described by the\nother types." + }, + { + "name": "BUSINESS_CHECKING", + "description": "An account at a financial institution against which checks can be\ndrawn specifically for business purposes (non-personal use)." + } + ], + "description": "Indicates the financial purpose of the bank account.", + "x-release-status": "PUBLIC" + }, + "BankAccountVerifiedEvent": { + "type": "object", + "description": "Published when Square sets the status of a\n[BankAccount](entity:BankAccount) to `VERIFIED`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"bank_account.verified\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was verified, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/BankAccountVerifiedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "bact:cgvL1yv43VFjexample", + "object": { + "bank_account": { + "account_number_suffix": "526", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": true, + "currency": "USD", + "debitable": true, + "holder_name": "John Doe", + "id": "bact:cgvL1yv43VFjexample", + "location_id": "S8GWD5DBJ3HF3", + "primary_bank_identification_number": "101211111", + "status": "VERIFIED", + "version": 4 + } + }, + "type": "bank_account" + }, + "event_id": "4166853c-0e4c-4202-8fd8-7e65a8f42389", + "location_id": "S8GWD5DBJ3HF3", + "merchant_id": "6SSW7HV8K2ST5", + "type": "bank_account.verified" + }, + "x-webhook": { + "event": "bank_account.verified", + "scopes": [ + "BANK_ACCOUNTS_READ" + ] + }, + "x-api": "#/components/x-apis/BankAccounts", + "x-since": "2020-02-26" + }, + "BankAccountVerifiedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"bank_account\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected bank account." + }, + "object": { + "$ref": "#/components/schemas/BankAccountVerifiedEventObject", + "description": "An object containing the verified bank account.", + "nullable": true + } + } + }, + "BankAccountVerifiedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "bank_account": { + "$ref": "#/components/schemas/BankAccount", + "description": "The verified bank account.", + "nullable": true + } + } + }, + "BatchChangeInventoryRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A client-supplied, universally unique identifier (UUID) for the\nrequest.\n\nSee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the\n[API Development 101](https://developer.squareup.com/docs/buildbasics) section for more\ninformation.", + "minLength": 1, + "maxLength": 128 + }, + "changes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryChange" + }, + "description": "The set of physical counts and inventory adjustments to be made.\nChanges are applied based on the client-supplied timestamp and may be sent\nout of order.", + "nullable": true + }, + "ignore_unchanged_counts": { + "type": "boolean", + "description": "Indicates whether the current physical count should be ignored if\nthe quantity is unchanged since the last physical count. Default: `true`.", + "nullable": true + } + }, + "example": { + "changes": [ + { + "physical_count": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "location_id": "C6W5YS5QM06F5", + "occurred_at": "2016-11-16T22:25:24.878Z", + "quantity": "53", + "reference_id": "1536bfbf-efed-48bf-b17d-a197141b2a92", + "state": "IN_STOCK", + "team_member_id": "LRK57NSQ5X7PUD05" + }, + "type": "PHYSICAL_COUNT" + } + ], + "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", + "ignore_unchanged_counts": true + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.csharp", + "java": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.java", + "javascript": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.javascript", + "php": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.php", + "python": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.python", + "ruby": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.ruby" + } + }, + "BatchChangeInventoryResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "counts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryCount" + }, + "description": "The current counts for all objects referenced in the request." + }, + "changes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryChange" + }, + "description": "Changes created for the request.", + "x-release-status": "BETA" + } + }, + "example": { + "counts": [ + { + "calculated_at": "2016-11-16T22:28:01.223Z", + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "location_id": "C6W5YS5QM06F5", + "quantity": "53", + "state": "IN_STOCK" + } + ], + "errors": [] + } + }, + "BatchDeleteCatalogObjectsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "object_ids" + ], + "properties": { + "object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the CatalogObjects to be deleted. When an object is deleted, other objects\nin the graph that depend on that object will be deleted as well (for example, deleting a\nCatalogItem will delete its CatalogItemVariation." + } + }, + "example": { + "object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI", + "AA27W3M2GGTF3H6AVPNB77CK" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.csharp", + "java": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.java", + "javascript": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.javascript", + "php": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.php", + "python": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.python", + "ruby": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.ruby" + } + }, + "BatchDeleteCatalogObjectsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "deleted_object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of all CatalogObjects deleted by this request." + }, + "deleted_at": { + "type": "string", + "description": "The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this deletion in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"." + } + }, + "example": { + "deleted_at": "2016-11-16T22:25:24.878Z", + "deleted_object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI", + "AA27W3M2GGTF3H6AVPNB77CK" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.csharp", + "java": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.java", + "javascript": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.javascript", + "php": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.php", + "python": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.python", + "ruby": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.ruby" + } + }, + "BatchRetrieveCatalogObjectsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "object_ids" + ], + "properties": { + "object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the CatalogObjects to be retrieved." + }, + "include_related_objects": { + "type": "boolean", + "description": "If `true`, the response will include additional objects that are related to the\nrequested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field\nof the response. These objects are put in the `related_objects` field. Setting this to `true` is\nhelpful when the objects are needed for immediate display to a user.\nThis process only goes one level deep. Objects referenced by the related objects will not be included. For example,\n\nif the `objects` field of the response contains a CatalogItem, its associated\nCatalogCategory objects, CatalogTax objects, CatalogImage objects and\nCatalogModifierLists will be returned in the `related_objects` field of the\nresponse. If the `objects` field of the response contains a CatalogItemVariation,\nits parent CatalogItem will be returned in the `related_objects` field of\nthe response.\n\nDefault value: `false`", + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The specific version of the catalog objects to be included in the response. \nThis allows you to retrieve historical versions of objects. The specified version value is matched against\nthe [CatalogObject](entity:CatalogObject)s' `version` attribute. If not included, results will\nbe from the current version of the catalog.", + "format": "int64", + "x-release-status": "BETA", + "nullable": true + }, + "include_deleted_objects": { + "type": "boolean", + "description": "Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`.", + "nullable": true + }, + "include_category_path_to_root": { + "type": "boolean", + "description": "Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists\nof `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category\nand ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned\nin the response payload.", + "nullable": true + } + }, + "example": { + "include_related_objects": true, + "object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI", + "AA27W3M2GGTF3H6AVPNB77CK" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.csharp", + "java": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.java", + "javascript": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.javascript", + "php": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.php", + "python": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.python", + "ruby": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.ruby" + } + }, + "BatchRetrieveCatalogObjectsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of [CatalogObject](entity:CatalogObject)s returned." + }, + "related_objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of [CatalogObject](entity:CatalogObject)s referenced by the object in the `objects` field." + } + }, + "example": { + "objects": [ + { + "id": "W62UWFY35CWMYGVWK6TWJDNI", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "ordinal": 0 + } + ], + "description": "Hot Leaf Juice", + "name": "Tea", + "tax_ids": [ + "HURXQOOAIC4IZSI2BEXQRYFY" + ], + "variations": [ + { + "id": "2TZFAOHWGG7PAK2QEXWYPZSP", + "is_deleted": false, + "item_variation_data": { + "item_id": "W62UWFY35CWMYGVWK6TWJDNI", + "name": "Mug", + "ordinal": 0, + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + }, + { + "id": "AA27W3M2GGTF3H6AVPNB77CK", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "ordinal": 0 + } + ], + "description": "Hot Bean Juice", + "name": "Coffee", + "tax_ids": [ + "HURXQOOAIC4IZSI2BEXQRYFY" + ], + "variations": [ + { + "id": "LBTYIHNHU52WOIHWT7SNRIYH", + "is_deleted": false, + "item_variation_data": { + "item_id": "AA27W3M2GGTF3H6AVPNB77CK", + "name": "Regular", + "ordinal": 0, + "price_money": { + "amount": 250, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + }, + { + "id": "PKYIC7HGGKW5CYVSCVDEIMHY", + "is_deleted": false, + "item_variation_data": { + "item_id": "AA27W3M2GGTF3H6AVPNB77CK", + "name": "Large", + "ordinal": 1, + "price_money": { + "amount": 350, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ], + "related_objects": [ + { + "category_data": { + "name": "Beverages" + }, + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "is_deleted": false, + "present_at_all_locations": true, + "type": "CATEGORY", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + }, + { + "id": "HURXQOOAIC4IZSI2BEXQRYFY", + "is_deleted": false, + "present_at_all_locations": true, + "tax_data": { + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.csharp", + "java": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.java", + "javascript": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.javascript", + "php": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.php", + "python": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.python", + "ruby": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.ruby" + } + }, + "BatchRetrieveInventoryChangesRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "catalog_object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The filter to return results by `CatalogObject` ID.\nThe filter is only applicable when set. The default value is null.", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The filter to return results by `Location` ID.\nThe filter is only applicable when set. The default value is null.", + "nullable": true + }, + "types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryChangeType" + }, + "description": "The filter to return results by `InventoryChangeType` values other than `TRANSFER`.\nThe default value is `[PHYSICAL_COUNT, ADJUSTMENT]`.", + "nullable": true + }, + "states": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryState" + }, + "description": "The filter to return `ADJUSTMENT` query results by\n`InventoryState`. This filter is only applied when set.\nThe default value is null.", + "nullable": true + }, + "updated_after": { + "type": "string", + "description": "The filter to return results with their `calculated_at` value\nafter the given time as specified in an RFC 3339 timestamp.\nThe default value is the UNIX epoch of (`1970-01-01T00:00:00Z`).", + "nullable": true + }, + "updated_before": { + "type": "string", + "description": "The filter to return results with their `created_at` or `calculated_at` value\nstrictly before the given time as specified in an RFC 3339 timestamp.\nThe default value is the UNIX epoch of (`1970-01-01T00:00:00Z`).", + "nullable": true + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.", + "nullable": true + }, + "limit": { + "type": "integer", + "description": "The number of [records](entity:InventoryChange) to return.", + "minimum": 1, + "maximum": 1000, + "nullable": true + } + }, + "example": { + "catalog_object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI" + ], + "location_ids": [ + "C6W5YS5QM06F5" + ], + "states": [ + "IN_STOCK" + ], + "types": [ + "PHYSICAL_COUNT" + ], + "updated_after": "2016-11-01T00:00:00.000Z", + "updated_before": "2016-12-01T00:00:00.000Z" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.csharp", + "java": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.java", + "javascript": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.javascript", + "php": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.php", + "python": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.python", + "ruby": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.ruby" + } + }, + "BatchRetrieveInventoryChangesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "changes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryChange" + }, + "description": "The current calculated inventory changes for the requested objects\nand locations." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "changes": [ + { + "physical_count": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-16T22:25:24.878Z", + "id": "46YDTW253DWGGK9HMAE6XCAO", + "location_id": "C6W5YS5QM06F5", + "occurred_at": "2016-11-16T22:24:49.028Z", + "quantity": "86", + "reference_id": "22c07cf4-5626-4224-89f9-691112019399", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "state": "IN_STOCK", + "team_member_id": "LRK57NSQ5X7PUD05" + }, + "type": "PHYSICAL_COUNT" + } + ], + "errors": [] + } + }, + "BatchRetrieveInventoryCountsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "catalog_object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The filter to return results by `CatalogObject` ID.\nThe filter is applicable only when set. The default is null.", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The filter to return results by `Location` ID.\nThis filter is applicable only when set. The default is null.", + "nullable": true + }, + "updated_after": { + "type": "string", + "description": "The filter to return results with their `calculated_at` value\nafter the given time as specified in an RFC 3339 timestamp.\nThe default value is the UNIX epoch of (`1970-01-01T00:00:00Z`).", + "nullable": true + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.", + "nullable": true + }, + "states": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryState" + }, + "description": "The filter to return results by `InventoryState`. The filter is only applicable when set.\nIgnored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`.\nThe default is null.", + "nullable": true + }, + "limit": { + "type": "integer", + "description": "The number of [records](entity:InventoryCount) to return.", + "minimum": 1, + "maximum": 1000, + "nullable": true + } + }, + "example": { + "catalog_object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI" + ], + "location_ids": [ + "59TNP9SA8VGDA" + ], + "updated_after": "2016-11-16T00:00:00.000Z" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.csharp", + "java": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.java", + "javascript": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.javascript", + "php": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.php", + "python": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.python", + "ruby": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.ruby" + } + }, + "BatchRetrieveInventoryCountsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "counts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryCount" + }, + "description": "The current calculated inventory counts for the requested objects\nand locations." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "counts": [ + { + "calculated_at": "2016-11-16T22:28:01.223Z", + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "location_id": "59TNP9SA8VGDA", + "quantity": "79", + "state": "IN_STOCK" + } + ], + "errors": [] + } + }, + "BatchRetrieveOrdersRequest": { + "type": "object", + "description": "Defines the fields that are included in requests to the\n`BatchRetrieveOrders` endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "order_ids" + ], + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the location for these orders. This field is optional: omit it to retrieve\norders within the scope of the current authorization's merchant ID.", + "nullable": true + }, + "order_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the orders to retrieve. A maximum of 100 orders can be retrieved per request." + } + }, + "example": { + "location_id": "057P5VYJ4A5X1", + "order_ids": [ + "CAISEM82RcpmcFBM0TfOyiHV3es", + "CAISENgvlJ6jLWAzERDzjyHVybY" + ] + } + }, + "BatchRetrieveOrdersResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `BatchRetrieveOrders` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + }, + "description": "The requested orders. This will omit any requested orders that do not exist." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "orders": [ + { + "id": "CAISEM82RcpmcFBM0TfOyiHV3es", + "line_items": [ + { + "base_price_money": { + "amount": 1599, + "currency": "USD" + }, + "name": "Awesome product", + "quantity": "1", + "total_money": { + "amount": 1599, + "currency": "USD" + }, + "uid": "945986d1-9586-11e6-ad5a-28cfe92138cf" + }, + { + "base_price_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Another awesome product", + "quantity": "3", + "total_money": { + "amount": 6000, + "currency": "USD" + }, + "uid": "a8f4168c-9586-11e6-bdf0-28cfe92138cf" + } + ], + "location_id": "057P5VYJ4A5X1", + "reference_id": "my-order-001", + "total_money": { + "amount": 7599, + "currency": "USD" + } + } + ] + } + }, + "BatchUpsertCatalogObjectsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "batches" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this\nrequest among all your requests. A common way to create\na valid idempotency key is to use a Universally unique\nidentifier (UUID).\n\nIf you're unsure whether a particular request was successful,\nyou can reattempt it with the same idempotency key without\nworrying about creating duplicate objects.\n\nSee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 128 + }, + "batches": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObjectBatch" + }, + "description": "A batch of CatalogObjects to be inserted/updated atomically.\nThe objects within a batch will be inserted in an all-or-nothing fashion, i.e., if an error occurs\nattempting to insert or update an object within a batch, the entire batch will be rejected. However, an error\nin one batch will not affect other batches within the same request.\n\nFor each object, its `updated_at` field is ignored and replaced with a current [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), and its\n`is_deleted` field must not be set to `true`.\n\nTo modify an existing object, supply its ID. To create a new object, use an ID starting\nwith `#`. These IDs may be used to create relationships between an object and attributes of\nother objects that reference it. For example, you can create a CatalogItem with\nID `#ABC` and a CatalogItemVariation with its `item_id` attribute set to\n`#ABC` in order to associate the CatalogItemVariation with its parent\nCatalogItem.\n\nAny `#`-prefixed IDs are valid only within a single atomic batch, and will be replaced by server-generated IDs.\n\nEach batch may contain up to 1,000 objects. The total number of objects across all batches for a single request\nmay not exceed 10,000. If either of these limits is violated, an error will be returned and no objects will\nbe inserted or updated." + } + }, + "example": { + "batches": [ + { + "objects": [ + { + "id": "#Tea", + "item_data": { + "categories": [ + { + "id": "#Beverages" + } + ], + "description_html": "\u003cp\u003e\u003cstrong\u003eHot\u003c/strong\u003e Leaf Juice\u003c/p\u003e", + "name": "Tea", + "tax_ids": [ + "#SalesTax" + ], + "variations": [ + { + "id": "#Tea_Mug", + "item_variation_data": { + "item_id": "#Tea", + "name": "Mug", + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION" + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM" + }, + { + "id": "#Coffee", + "item_data": { + "categories": [ + { + "id": "#Beverages" + } + ], + "description_html": "\u003cp\u003eHot \u003cem\u003eBean Juice\u003c/em\u003e\u003c/p\u003e", + "name": "Coffee", + "tax_ids": [ + "#SalesTax" + ], + "variations": [ + { + "id": "#Coffee_Regular", + "item_variation_data": { + "item_id": "#Coffee", + "name": "Regular", + "price_money": { + "amount": 250, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION" + }, + { + "id": "#Coffee_Large", + "item_variation_data": { + "item_id": "#Coffee", + "name": "Large", + "price_money": { + "amount": 350, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION" + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM" + }, + { + "category_data": { + "name": "Beverages" + }, + "id": "#Beverages", + "present_at_all_locations": true, + "type": "CATEGORY" + }, + { + "id": "#SalesTax", + "present_at_all_locations": true, + "tax_data": { + "applies_to_custom_amounts": true, + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX" + } + ] + } + ], + "idempotency_key": "789ff020-f723-43a9-b4b5-43b5dc1fa3dc" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.csharp", + "java": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.java", + "javascript": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.javascript", + "php": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.php", + "python": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.python", + "ruby": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.ruby" + } + }, + "BatchUpsertCatalogObjectsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "The created successfully created CatalogObjects." + }, + "updated_at": { + "type": "string", + "description": "The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"." + }, + "id_mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogIdMapping" + }, + "description": "The mapping between client and server IDs for this upsert." + } + }, + "example": { + "id_mappings": [ + { + "client_object_id": "#Tea", + "object_id": "67GA7XA2FWMRYY2VCONTYZJR" + }, + { + "client_object_id": "#Coffee", + "object_id": "MQ4TZKOG3SR2EQI3TWEK4AH7" + }, + { + "client_object_id": "#Beverages", + "object_id": "XCS4SCGN4WQYE2VU4U3TKXEH" + }, + { + "client_object_id": "#SalesTax", + "object_id": "HP5VNYPKZKTNCKZ2Z5NPUH6A" + }, + { + "client_object_id": "#Tea_Mug", + "object_id": "CAJBHUIQH7ONTSZI2KTVOUP6" + }, + { + "client_object_id": "#Coffee_Regular", + "object_id": "GY2GXJTVVPQAPW43GFRR3NG6" + }, + { + "client_object_id": "#Coffee_Large", + "object_id": "JE6VHPSRQL6IWSN26C36CJ7W" + } + ], + "objects": [ + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "67GA7XA2FWMRYY2VCONTYZJR", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "XCS4SCGN4WQYE2VU4U3TKXEH", + "ordinal": -2251731094208512 + } + ], + "description": "Hot Leaf Juice", + "description_html": "\u003cp\u003e\u003cstrong\u003eHot\u003c/strong\u003e Leaf Juice\u003c/p\u003e", + "description_plaintext": "Hot Leaf Juice", + "is_archived": false, + "is_taxable": true, + "name": "Tea", + "product_type": "REGULAR", + "tax_ids": [ + "HP5VNYPKZKTNCKZ2Z5NPUH6A" + ], + "variations": [ + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "CAJBHUIQH7ONTSZI2KTVOUP6", + "is_deleted": false, + "item_variation_data": { + "item_id": "67GA7XA2FWMRYY2VCONTYZJR", + "name": "Mug", + "ordinal": 0, + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING", + "sellable": true, + "stockable": true + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + }, + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "MQ4TZKOG3SR2EQI3TWEK4AH7", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "XCS4SCGN4WQYE2VU4U3TKXEH", + "ordinal": -2251662374731776 + } + ], + "description": "Hot Bean Juice", + "description_html": "\u003cp\u003eHot \u003cem\u003eBean Juice\u003c/em\u003e\u003c/p\u003e", + "description_plaintext": "Hot Bean Juice", + "is_archived": false, + "is_taxable": true, + "name": "Coffee", + "product_type": "REGULAR", + "tax_ids": [ + "HP5VNYPKZKTNCKZ2Z5NPUH6A" + ], + "variations": [ + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "GY2GXJTVVPQAPW43GFRR3NG6", + "is_deleted": false, + "item_variation_data": { + "item_id": "MQ4TZKOG3SR2EQI3TWEK4AH7", + "name": "Regular", + "ordinal": 0, + "price_money": { + "amount": 250, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING", + "sellable": true, + "stockable": true + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + }, + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "JE6VHPSRQL6IWSN26C36CJ7W", + "is_deleted": false, + "item_variation_data": { + "item_id": "MQ4TZKOG3SR2EQI3TWEK4AH7", + "name": "Large", + "ordinal": 1, + "price_money": { + "amount": 350, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING", + "sellable": true, + "stockable": true + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + }, + { + "category_data": { + "category_type": "REGULAR_CATEGORY", + "is_top_level": true, + "name": "Beverages", + "online_visibility": true, + "parent_category": { + "ordinal": -2250837741010944 + } + }, + "created_at": "2023-11-30T19:24:35.4Z", + "id": "XCS4SCGN4WQYE2VU4U3TKXEH", + "is_deleted": false, + "present_at_all_locations": true, + "type": "CATEGORY", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + }, + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "HP5VNYPKZKTNCKZ2Z5NPUH6A", + "is_deleted": false, + "present_at_all_locations": true, + "tax_data": { + "applies_to_custom_amounts": true, + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.csharp", + "java": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.java", + "javascript": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.javascript", + "php": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.php", + "python": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.python", + "ruby": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.ruby" + } + }, + "Booking": { + "type": "object", + "description": "Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service\nat a given location to a requesting customer in one or more appointment segments.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique ID of this object representing a booking.", + "maxLength": 36, + "readOnly": true + }, + "version": { + "type": "integer", + "description": "The revision number for the booking used for optimistic concurrency." + }, + "status": { + "$ref": "#/components/schemas/BookingStatus", + "description": "The status of the booking, describing where the booking stands with respect to the booking state machine.\nSee [BookingStatus](#type-bookingstatus) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The RFC 3339 timestamp specifying the creation time of this booking.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The RFC 3339 timestamp specifying the most recent update time of this booking.", + "readOnly": true + }, + "start_at": { + "type": "string", + "description": "The RFC 3339 timestamp specifying the starting time of this booking.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the [Location](entity:Location) object representing the location where the booked service is provided. Once set when the booking is created, its value cannot be changed.", + "maxLength": 32, + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "The ID of the [Customer](entity:Customer) object representing the customer receiving the booked service.", + "maxLength": 192, + "nullable": true + }, + "customer_note": { + "type": "string", + "description": "The free-text field for the customer to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](entity:CatalogObject) instance.", + "maxLength": 4096, + "nullable": true + }, + "seller_note": { + "type": "string", + "description": "The free-text field for the seller to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a specific [CatalogObject](entity:CatalogObject) instance.\nThis field should not be visible to customers.", + "maxLength": 4096, + "nullable": true + }, + "appointment_segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AppointmentSegment" + }, + "description": "A list of appointment segments for this booking.", + "nullable": true + }, + "transition_time_minutes": { + "type": "integer", + "description": "Additional time at the end of a booking.\nApplications should not make this field visible to customers of a seller.", + "readOnly": true + }, + "all_day": { + "type": "boolean", + "description": "Whether the booking is of a full business day.", + "readOnly": true + }, + "location_type": { + "$ref": "#/components/schemas/BusinessAppointmentSettingsBookingLocationType", + "description": "The type of location where the booking is held.\nSee [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) for possible values", + "nullable": true + }, + "creator_details": { + "$ref": "#/components/schemas/BookingCreatorDetails", + "description": "Information about the booking creator.", + "readOnly": true + }, + "source": { + "$ref": "#/components/schemas/BookingBookingSource", + "description": "The source of the booking.\nAccess to this field requires seller-level permissions.\nSee [BookingBookingSource](#type-bookingbookingsource) for possible values", + "readOnly": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "Stores a customer address if the location type is `CUSTOMER_LOCATION`.", + "nullable": true + } + } + }, + "BookingBookingSource": { + "type": "string", + "enum": [ + "FIRST_PARTY_MERCHANT", + "FIRST_PARTY_BUYER", + "THIRD_PARTY_BUYER", + "API" + ], + "x-enum-elements": [ + { + "name": "FIRST_PARTY_MERCHANT", + "description": "The booking was created by a seller from a Square Appointments application, such as the Square Appointments Dashboard or a Square Appointments mobile app." + }, + { + "name": "FIRST_PARTY_BUYER", + "description": "The booking was created by a buyer from a Square Appointments application, such as Square Online Booking Site." + }, + { + "name": "THIRD_PARTY_BUYER", + "description": "The booking was created by a buyer created from a third-party application." + }, + { + "name": "API", + "description": "The booking was created by a seller or a buyer from the Square Bookings API." + } + ], + "description": "Supported sources a booking was created from.", + "x-release-status": "PUBLIC" + }, + "BookingCreatedEvent": { + "type": "object", + "description": "Published when a booking is created.\n\nTo receive this event with buyer-level permissions, you must have `APPOINTMENTS_READ` set for the OAuth scope. \nTo receive this event with seller-level permissions, you must have `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/BookingCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-08T19:56:53Z", + "data": { + "id": "i2id2g3enyspi7:0", + "object": { + "booking": { + "appointment_segments": [ + { + "duration_minutes": 30, + "service_variation_id": "T3WUWYFJOVW2EU6XGRU5YG4A", + "service_variation_version": 1605808735978, + "team_member_id": "_4GsfYnqGHyurOwzWdKj" + } + ], + "created_at": "2020-12-08T19:56:53Z", + "customer_id": "SSKBT02ECWZXK6W3VWYC78E52R", + "customer_note": "", + "id": "i2id2g3enyspi7", + "location_id": "L9R0X9X5SGDBJ", + "seller_note": "", + "start_at": "2020-12-17T16:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-12-08T19:56:53Z", + "version": 0 + } + }, + "type": "booking" + }, + "event_id": "76193e8a-db85-53c6-b538-1837519cbc12", + "location_id": "L9R0X9X5SGDBJ", + "merchant_id": "GQQWA3J6A3AEZ", + "type": "booking.created" + }, + "x-webhook": { + "event": "booking.created", + "scopes": [ + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Bookings", + "x-since": "2020-12-16" + }, + "BookingCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"booking\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/BookingCreatedEventObject", + "description": "An object containing the created booking.", + "nullable": true + } + } + }, + "BookingCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The created booking.", + "nullable": true + } + } + }, + "BookingCreatorDetails": { + "type": "object", + "description": "Information about a booking creator.", + "x-release-status": "PUBLIC", + "properties": { + "creator_type": { + "$ref": "#/components/schemas/BookingCreatorDetailsCreatorType", + "description": "The seller-accessible type of the creator of the booking.\nSee [BookingCreatorDetailsCreatorType](#type-bookingcreatordetailscreatortype) for possible values", + "readOnly": true + }, + "team_member_id": { + "type": "string", + "description": "The ID of the team member who created the booking, when the booking creator is of the `TEAM_MEMBER` type.\nAccess to this field requires seller-level permissions.", + "maxLength": 32, + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "The ID of the customer who created the booking, when the booking creator is of the `CUSTOMER` type.\nAccess to this field requires seller-level permissions.", + "maxLength": 192, + "readOnly": true + } + } + }, + "BookingCreatorDetailsCreatorType": { + "type": "string", + "enum": [ + "TEAM_MEMBER", + "CUSTOMER" + ], + "x-enum-elements": [ + { + "name": "TEAM_MEMBER", + "description": "The creator is of the seller type." + }, + { + "name": "CUSTOMER", + "description": "The creator is of the buyer type." + } + ], + "description": "Supported types of a booking creator.", + "x-release-status": "PUBLIC" + }, + "BookingCustomAttributeDefinitionOwnedCreatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nis created by the subscribing application. Subscribe to this event to be notified \nwhen your application creates a booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.owned.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite shampoo", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "name": "Favorite Shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "347ab320-c0ba-48f5-959a-4e147b9aefcf", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.owned.created" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.owned.created", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDefinitionOwnedDeletedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nis deleted by the subscribing application. Subscribe to this event to be notified \nwhen your application deletes a booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite shampoo", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "name": "Favorite Shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "49363646-7ae7-49b5-aaa0-296610883c61", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.owned.deleted" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.owned.deleted", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDefinitionOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nis updated by the subscribing application. Subscribe to this event to be notified \nwhen your application updates a booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "The customer's favorite shampoo", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "name": "Favorite Shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "d914e6ef-9e37-4bca-a663-ecc55f5d98d3", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.owned.updated" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.owned.updated", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDefinitionVisibleCreatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nwith the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is created.\nAn application that subscribes to this event is notified when a booking custom attribute definition is created \nby any application for which the subscribing application has read access to the booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.visible.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "Number of party members", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "name": "Party Size", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "f679dc4f-3619-4764-a4de-94a54735cd32", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.visible.created" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.visible.created", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDefinitionVisibleDeletedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nwith the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted.\nAn application that subscribes to this event is notified when a booking custom attribute definition is deleted \nby any application for which the subscribing application has read access to the booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "Number of party members", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "name": "Party Size", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "81c10a07-c329-4943-af20-7d70a300c7e6", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.visible.deleted" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.visible.deleted", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDefinitionVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nwith the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated.\nAn application that subscribes to this event is notified when a booking custom attribute definition is updated \nby any application for which the subscribing application has read access to the booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "Number of party members", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "name": "Party Size", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "ae376c21-d360-4694-96c7-1b27830f07d7", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.visible.updated" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.visible.updated", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDeleteRequest": { + "type": "object", + "description": "Represents an individual delete request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes)\nrequest. An individual request contains a booking ID, the custom attribute to delete, and an optional idempotency key.", + "x-release-status": "PUBLIC", + "required": [ + "booking_id", + "key" + ], + "properties": { + "booking_id": { + "type": "string", + "description": "The ID of the target [booking](entity:Booking).", + "minLength": 1, + "maxLength": 36 + }, + "key": { + "type": "string", + "description": "The key of the custom attribute to delete. This key must match the `key` of a\ncustom attribute definition in the Square seller account. If the requesting application is not\nthe definition owner, you must use the qualified key.", + "minLength": 1 + } + } + }, + "BookingCustomAttributeDeleteResponse": { + "type": "object", + "description": "Represents a response for an individual upsert request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) operation.", + "x-release-status": "PUBLIC", + "properties": { + "booking_id": { + "type": "string", + "description": "The ID of the [booking](entity:Booking) associated with the custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred while processing the individual request." + } + }, + "example": { + "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", + "errors": [] + } + }, + "BookingCustomAttributeOwnedDeletedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute](entity:CustomAttribute) \nassociated with a [custom attribute definition](entity:CustomAttributeDefinition) that is\nowned by the subscribing application is deleted.\nSubscribe to this event to be notified \nwhen your application deletes a booking custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo:BOOKING:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "updated_at": "2022-04-27T11:31:29Z", + "value": "Generic shampoo", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "f57b27d4-a4d6-43de-9e58-bc6ff90525f1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute.owned.deleted" + }, + "x-webhook": { + "event": "booking.custom_attribute.owned.deleted", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute](entity:CustomAttribute) \nis updated by the subscribing application. Subscribe to this event to be notified \nwhen your application updates a booking custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:54Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo:BOOKING:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "updated_at": "2022-04-21T21:40:54Z", + "value": "Volume up", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "e26ca6f2-97f8-426a-b4bf-873044617e94", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute.owned.updated" + }, + "x-webhook": { + "event": "booking.custom_attribute.owned.updated", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeUpsertRequest": { + "type": "object", + "description": "Represents an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes)\nrequest. An individual request contains a booking ID, the custom attribute to create or update,\nand an optional idempotency key.", + "x-release-status": "PUBLIC", + "required": [ + "booking_id", + "custom_attribute" + ], + "properties": { + "booking_id": { + "type": "string", + "description": "The ID of the target [booking](entity:Booking).", + "minLength": 1, + "maxLength": 36 + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with following fields:\n\n- `key`. This key must match the `key` of a custom attribute definition in the Square seller\naccount. If the requesting application is not the definition owner, you must provide the qualified key.\n\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Value data types](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for update operations, include this optional field in the request and set the\nvalue to the current version of the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this individual upsert request, used to ensure idempotency.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "BookingCustomAttributeUpsertResponse": { + "type": "object", + "description": "Represents a response for an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) operation.", + "x-release-status": "PUBLIC", + "properties": { + "booking_id": { + "type": "string", + "description": "The ID of the [booking](entity:Booking) associated with the custom attribute." + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred while processing the individual request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-11-16T00:14:47Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T00:16:23Z", + "value": "Spring Fresh", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + } + }, + "BookingCustomAttributeVisibleDeletedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute](entity:CustomAttribute) with\nthe `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted.\nAn application that subscribes to this event is notified when a booking custom attribute is deleted \nby any application for which the subscribing application has read access to the booking custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size:BOOKING:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "updated_at": "2022-04-27T11:31:29Z", + "value": "10", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "18ef5adc-2efc-4ad9-9b1a-b274a607da3e", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute.visible.deleted" + }, + "x-webhook": { + "event": "booking.custom_attribute.visible.deleted", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute](entity:CustomAttribute) \nwith the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated.\nAn application that subscribes to this event is notified when a booking custom attribute is updated \nby any application for which the subscribing application has read access to the booking custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size:BOOKING:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "updated_at": "2022-04-26T01:22:29Z", + "value": "5", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "1cc2925c-f6e2-4fb6-a597-07c198de59e1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute.visible.updated" + }, + "x-webhook": { + "event": "booking.custom_attribute.visible.updated", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingStatus": { + "type": "string", + "enum": [ + "PENDING", + "CANCELLED_BY_CUSTOMER", + "CANCELLED_BY_SELLER", + "DECLINED", + "ACCEPTED", + "NO_SHOW" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "An unaccepted booking. It is visible to both sellers and customers." + }, + { + "name": "CANCELLED_BY_CUSTOMER", + "description": "A customer-cancelled booking. It is visible to both the seller and the customer." + }, + { + "name": "CANCELLED_BY_SELLER", + "description": "A seller-cancelled booking. It is visible to both the seller and the customer." + }, + { + "name": "DECLINED", + "description": "A declined booking. It had once been pending, but was then declined by the seller." + }, + { + "name": "ACCEPTED", + "description": "An accepted booking agreed to or accepted by the seller." + }, + { + "name": "NO_SHOW", + "description": "A no-show booking. The booking was accepted at one time, but have now been marked as a no-show by\nthe seller because the client either missed the booking or cancelled it without enough notice." + } + ], + "description": "Supported booking statuses.", + "x-release-status": "PUBLIC" + }, + "BookingUpdatedEvent": { + "type": "object", + "description": "Published when a booking is updated or cancelled.\n\nTo receive this event with buyer-level permissions, you must have `APPOINTMENTS_READ` set for the OAuth scope. \nTo receive this event with seller-level permissions, you must have `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/BookingUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-08T20:05:00Z", + "data": { + "id": "i2id2g3enyspi7:1", + "object": { + "booking": { + "appointment_segments": [ + { + "duration_minutes": 30, + "service_variation_id": "T3WUWYFJOVW2EU6XGRU5YG4A", + "service_variation_version": 1605808735978, + "team_member_id": "_4GsfYnqGHyurOwzWdKj" + } + ], + "created_at": "2020-12-08T19:56:53Z", + "customer_id": "SSKBT02ECWZXK6W3VWYC78E52R", + "customer_note": "I would like to sit near the window please", + "id": "i2id2g3enyspi7", + "location_id": "L9R0X9X5SGDBJ", + "seller_note": "", + "start_at": "2020-12-17T16:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-12-08T20:05:00Z", + "version": 1 + } + }, + "type": "booking" + }, + "event_id": "d954ea4e-a393-52d4-bda6-bfd10cbd571f", + "location_id": "L9R0X9X5SGDBJ", + "merchant_id": "GQQWA3J6A3AEZ", + "type": "booking.updated" + }, + "x-webhook": { + "event": "booking.updated", + "scopes": [ + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Bookings", + "x-since": "2020-12-16" + }, + "BookingUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"booking\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/BookingUpdatedEventObject", + "description": "An object containing the updated booking.", + "nullable": true + } + } + }, + "BookingUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The updated booking.", + "nullable": true + } + } + }, + "Break": { + "type": "object", + "description": "A record of a team member's break on a [timecard](entity:Timecard).", + "x-release-status": "PUBLIC", + "required": [ + "start_at", + "break_type_id", + "name", + "expected_duration", + "is_paid" + ], + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object." + }, + "start_at": { + "type": "string", + "description": "RFC 3339; follows the same timezone information as the [timecard](entity:Timecard). Precision up to\nthe minute is respected; seconds are truncated.", + "minLength": 1 + }, + "end_at": { + "type": "string", + "description": "RFC 3339; follows the same timezone information as the [timecard](entity:Timecard). Precision up to\nthe minute is respected; seconds are truncated.", + "nullable": true + }, + "break_type_id": { + "type": "string", + "description": "The [BreakType](entity:BreakType) that this break was templated on.", + "minLength": 1 + }, + "name": { + "type": "string", + "description": "A human-readable name.", + "minLength": 1 + }, + "expected_duration": { + "type": "string", + "description": "Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of\nthe break.\n\nExample for break expected duration of 15 minutes: PT15M", + "minLength": 1 + }, + "is_paid": { + "type": "boolean", + "description": "Whether this break counts towards time worked for compensation\npurposes." + } + } + }, + "BreakType": { + "type": "object", + "description": "A template for a type of [break](entity:Break) that can be added to a\n[timecard](entity:Timecard), including the expected duration and paid status.", + "x-release-status": "PUBLIC", + "required": [ + "location_id", + "break_name", + "expected_duration", + "is_paid" + ], + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object.", + "maxLength": 255 + }, + "location_id": { + "type": "string", + "description": "The ID of the business location this type of break applies to.", + "minLength": 1 + }, + "break_name": { + "type": "string", + "description": "A human-readable name for this type of break. The name is displayed to\nteam members in Square products.", + "minLength": 1 + }, + "expected_duration": { + "type": "string", + "description": "Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of\nthis break. Precision less than minutes is truncated.\n\nExample for break expected duration of 15 minutes: PT15M", + "minLength": 1 + }, + "is_paid": { + "type": "boolean", + "description": "Whether this break counts towards time worked for compensation\npurposes." + }, + "version": { + "type": "integer", + "description": "Used for resolving concurrency issues. The request fails if the version\nprovided does not match the server version at the time of the request. If a value is not\nprovided, Square's servers execute a \"blind\" write; potentially\noverwriting another writer's data." + }, + "created_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format.", + "readOnly": true + } + } + }, + "BulkCreateCustomerData": { + "type": "object", + "description": "Defines the customer data provided in individual create requests for a\n[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) operation.", + "x-release-status": "PUBLIC", + "properties": { + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the customer profile.", + "maxLength": 300, + "nullable": true + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the customer profile.", + "maxLength": 300, + "nullable": true + }, + "company_name": { + "type": "string", + "description": "A business name associated with the customer profile.", + "maxLength": 500, + "nullable": true + }, + "nickname": { + "type": "string", + "description": "A nickname for the customer profile.", + "maxLength": 100, + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address associated with the customer profile.", + "maxLength": 254, + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address associated with the customer profile. For maximum length constraints,\nsee [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).\nThe `first_name` and `last_name` fields are ignored if they are present in the request.", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number associated with the customer profile. The phone number must be valid\nand can contain 9–16 digits, with an optional `+` prefix and country code. For more information,\nsee [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "An optional second ID used to associate the customer profile with an\nentity in another system.", + "maxLength": 100, + "nullable": true + }, + "note": { + "type": "string", + "description": "A custom note associated with the customer profile.", + "nullable": true + }, + "birthday": { + "type": "string", + "description": "The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.\nFor example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.\nBirthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or\n`0000` if a birth year is not specified.", + "nullable": true + }, + "tax_ids": { + "$ref": "#/components/schemas/CustomerTaxIds", + "description": "The tax ID associated with the customer profile. This field is available only for\ncustomers of sellers in EU countries or the United Kingdom. For more information, see\n[Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).", + "nullable": true + } + } + }, + "BulkCreateCustomersRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in requests to the\n[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "customers" + ], + "properties": { + "customers": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkCreateCustomerData" + }, + "description": "A map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }`\nkey-value pairs.\n\nEach key is an [idempotency key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)\nthat uniquely identifies the create request. Each value contains the customer data used to create the\ncustomer profile." + } + }, + "example": { + "customers": { + "8bb76c4f-e35d-4c5b-90de-1194cd9179f0": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "reference_id": "YOUR_REFERENCE_ID" + }, + "d1689f23-b25d-4932-b2f0-aed00f5e2029": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 601", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "email_address": "Marie.Curie@example.com", + "family_name": "Curie", + "given_name": "Marie", + "note": "another customer", + "phone_number": "+1-212-444-4240", + "reference_id": "YOUR_REFERENCE_ID" + } + } + } + }, + "BulkCreateCustomersResponse": { + "type": "object", + "description": "Defines the fields included in the response body from the\n[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/CreateCustomerResponse" + }, + "description": "A map of responses that correspond to individual create requests, represented by\nkey-value pairs.\n\nEach key is the idempotency key that was provided for a create request and each value\nis the corresponding response.\nIf the request succeeds, the value is the new customer profile.\nIf the request fails, the value contains any errors that occurred during the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any top-level errors that prevented the bulk operation from running." + } + }, + "example": { + "responses": { + "8bb76c4f-e35d-4c5b-90de-1194cd9179f4": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2024-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "updated_at": "2024-03-23T20:21:54.859Z", + "version": 0 + } + }, + "d1689f23-b25d-4932-b2f0-aed00f5e2029": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 601", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2024-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Marie.Curie@example.com", + "family_name": "Curie", + "given_name": "Marie", + "id": "N18CPRVXR5214XPBBA6BZQWF3C", + "note": "another customer", + "phone_number": "+1-212-444-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "updated_at": "2024-03-23T20:21:54.859Z", + "version": 0 + } + } + } + } + }, + "BulkCreateTeamMembersRequest": { + "type": "object", + "description": "Represents a bulk create request for `TeamMember` objects.", + "x-release-status": "PUBLIC", + "required": [ + "team_members" + ], + "properties": { + "team_members": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/CreateTeamMemberRequest" + }, + "description": "The data used to create the `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`.\nThe maximum number of create objects is 25.\n\nIf you include a team member's `wage_setting`, you must provide `job_id` for each job assignment. To get job IDs,\ncall [ListJobs](api-endpoint:Team-ListJobs)." + } + }, + "example": { + "team_members": { + "idempotency-key-1": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "YSGH2WBKG94QZ", + "GA2Y9HSJ8KRYT" + ] + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "phone_number": "+14159283333", + "reference_id": "reference_id_1" + } + }, + "idempotency-key-2": { + "team_member": { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "email_address": "jane_smith@gmail.com", + "family_name": "Smith", + "given_name": "Jane", + "phone_number": "+14159223334", + "reference_id": "reference_id_2" + } + } + } + } + }, + "BulkCreateTeamMembersResponse": { + "type": "object", + "description": "Represents a response from a bulk create request containing the created `TeamMember` objects or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "team_members": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/CreateTeamMemberResponse" + }, + "description": "The successfully created `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "team_members": { + "idempotency-key-1": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "GA2Y9HSJ8KRYT", + "YSGH2WBKG94QZ" + ] + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "id": "ywhG1qfIOoqsHfVRubFV", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE" + } + }, + "idempotency-key-2": { + "team_member": { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "email_address": "jane_smith@gmail.com", + "family_name": "Smith", + "given_name": "Jane", + "id": "IF_Ncrg7fHhCqxVI9T6R", + "is_owner": false, + "phone_number": "+14159223334", + "reference_id": "reference_id_2", + "status": "ACTIVE" + } + } + } + } + }, + "BulkCreateVendorsRequest": { + "type": "object", + "description": "Represents an input to a call to [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors).", + "x-release-status": "BETA", + "required": [ + "vendors" + ], + "properties": { + "vendors": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Vendor" + }, + "description": "Specifies a set of new [Vendor](entity:Vendor) objects as represented by a collection of idempotency-key/`Vendor`-object pairs." + } + }, + "example": { + "47bb76a8-c9fb-4f33-9df8-25ce02ca4505": { + "contacts": [ + { + "email_address": "annie@annieshotsauce.com", + "name": "Annie Thomas", + "phone_number": "1-212-555-4250" + } + ], + "name": "Annie’s Hot Sauce" + }, + "vendors": { + "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "name": "Joe's Fresh Seafood", + "note": "a vendor" + } + } + } + }, + "BulkCreateVendorsResponse": { + "type": "object", + "description": "Represents an output from a call to [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/CreateVendorResponse" + }, + "description": "A set of [CreateVendorResponse](entity:CreateVendorResponse) objects encapsulating successfully created [Vendor](entity:Vendor)\nobjects or error responses for failed attempts. The set is represented by \na collection of idempotency-key/`Vendor`-object or idempotency-key/error-object pairs. The idempotency keys correspond to those specified\nin the input." + } + }, + "example": { + "47bb76a8-c9fb-4f33-9df8-25ce02ca4505": { + "vendor": { + "contacts": [ + { + "email_address": "annie@annieshotsauce.com", + "id": "INV_VC_ABYYHBWT1TPL8MFH52PBMENPJ4", + "name": "Annie Thomas", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Annie’s Hot Sauce", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 1 + } + }, + "responses": { + "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "a vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 0 + } + } + } + } + }, + "BulkDeleteBookingCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) request.", + "x-release-status": "PUBLIC", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BookingCustomAttributeDeleteRequest" + }, + "description": "A map containing 1 to 25 individual Delete requests. For each request, provide an\narbitrary ID that is unique for this `BulkDeleteBookingCustomAttributes` request and the\ninformation needed to delete a custom attribute." + } + } + }, + "BulkDeleteBookingCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual delete request.", + "x-release-status": "PUBLIC", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BookingCustomAttributeDeleteResponse" + }, + "description": "A map of responses that correspond to individual delete requests. Each response has the\nsame ID as the corresponding request and contains `booking_id` and `errors` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "errors": [], + "values": { + "id1": { + "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", + "errors": [] + }, + "id2": { + "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", + "errors": [] + }, + "id3": { + "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", + "errors": [] + } + } + } + }, + "BulkDeleteCustomersRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in requests to the\n[BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "customer_ids" + ], + "properties": { + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the [customer profiles](entity:Customer) to delete." + } + }, + "example": { + "customer_ids": [ + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" + ] + } + }, + "BulkDeleteCustomersResponse": { + "type": "object", + "description": "Defines the fields included in the response body from the\n[BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/DeleteCustomerResponse" + }, + "description": "A map of responses that correspond to individual delete requests, represented by\nkey-value pairs.\n\nEach key is the customer ID that was specified for a delete request and each value\nis the corresponding response.\nIf the request succeeds, the value is an empty object (`{ }`).\nIf the request fails, the value contains any errors that occurred during the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any top-level errors that prevented the bulk operation from running." + } + }, + "example": { + "responses": { + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found." + } + ] + }, + "8DDA5NZVBZFGAX0V3HPF81HHE0": {}, + "N18CPRVXR5214XPBBA6BZQWF3C": {} + } + } + }, + "BulkDeleteLocationCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest" + }, + "description": "The data used to update the `CustomAttribute` objects.\nThe keys must be unique and are used to map to the corresponding response." + } + }, + "example": { + "values": { + "id1": { + "key": "bestseller", + "location_id": "L0TBCBTB7P8RQ" + }, + "id2": { + "key": "bestseller", + "location_id": "L9XMD04V3STJX" + }, + "id3": { + "key": "phone-number", + "location_id": "L0TBCBTB7P8RQ" + } + } + } + }, + "BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest": { + "type": "object", + "description": "Represents an individual delete request in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes)\nrequest. An individual request contains an optional ID of the associated custom attribute definition\nand optional key of the associated custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "key": { + "type": "string", + "description": "The key of the associated custom attribute definition.\nRepresented as a qualified key if the requesting app is not the definition owner.", + "pattern": "^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$", + "readOnly": true + } + } + }, + "BulkDeleteLocationCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual delete request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse" + }, + "description": "A map of responses that correspond to individual delete requests. Each response has the\nsame key as the corresponding request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "values": { + "id1": { + "errors": [], + "location_id": "L0TBCBTB7P8RQ" + }, + "id2": { + "errors": [], + "location_id": "L9XMD04V3STJX" + }, + "id3": { + "errors": [], + "location_id": "L0TBCBTB7P8RQ" + } + } + } + }, + "BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse": { + "type": "object", + "description": "Represents an individual delete response in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes)\nrequest.", + "x-release-status": "BETA", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the location associated with the custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred while processing the individual LocationCustomAttributeDeleteRequest request" + } + }, + "example": { + "errors": [], + "location_id": "L0TBCBTB7P8RQ" + } + }, + "BulkDeleteMerchantCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest" + }, + "description": "The data used to update the `CustomAttribute` objects.\nThe keys must be unique and are used to map to the corresponding response." + } + }, + "example": { + "values": { + "id1": { + "key": "alternative_seller_name", + "merchant_id": "DM7VKY8Q63GNP" + }, + "id2": { + "key": "has_seen_tutorial", + "merchant_id": "DM7VKY8Q63GNP" + } + } + } + }, + "BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest": { + "type": "object", + "description": "Represents an individual delete request in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes)\nrequest. An individual request contains an optional ID of the associated custom attribute definition\nand optional key of the associated custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "key": { + "type": "string", + "description": "The key of the associated custom attribute definition.\nRepresented as a qualified key if the requesting app is not the definition owner.", + "pattern": "^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$", + "readOnly": true + } + } + }, + "BulkDeleteMerchantCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual delete request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse" + }, + "description": "A map of responses that correspond to individual delete requests. Each response has the\nsame key as the corresponding request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "values": { + "id1": { + "errors": [], + "merchant_id": "DM7VKY8Q63GNP" + }, + "id2": { + "errors": [], + "merchant_id": "DM7VKY8Q63GNP" + } + } + } + }, + "BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse": { + "type": "object", + "description": "Represents an individual delete response in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes)\nrequest.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred while processing the individual MerchantCustomAttributeDeleteRequest request" + } + }, + "example": { + "errors": [], + "merchant_id": "DM7VKY8Q63GNP" + } + }, + "BulkDeleteOrderCustomAttributesRequest": { + "type": "object", + "description": "Represents a bulk delete request for one or more order custom attributes.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute" + }, + "description": "A map of requests that correspond to individual delete operations for custom attributes." + } + }, + "example": { + "values": { + "cover-count": { + "key": "cover-count", + "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + }, + "table-number": { + "key": "table-number", + "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + } + } + } + }, + "BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute": { + "type": "object", + "description": "Represents one delete within the bulk operation.", + "x-release-status": "BETA", + "required": [ + "order_id" + ], + "properties": { + "key": { + "type": "string", + "description": "The key of the custom attribute to delete. This key must match the key \nof an existing custom attribute definition.", + "minLength": 1, + "pattern": "^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$", + "readOnly": true + }, + "order_id": { + "type": "string", + "description": "The ID of the target [order](entity:Order).", + "minLength": 1, + "maxLength": 255 + } + } + }, + "BulkDeleteOrderCustomAttributesResponse": { + "type": "object", + "description": "Represents a response from deleting one or more order custom attributes.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/DeleteOrderCustomAttributeResponse" + }, + "description": " A map of responses that correspond to individual delete requests. Each response has the same ID \nas the corresponding request and contains either a `custom_attribute` or an `errors` field." + } + }, + "example": { + "values": { + "cover-count": {}, + "table-number": {} + } + } + }, + "BulkPublishScheduledShiftsData": { + "type": "object", + "description": "Represents options for an individual publish request in a\n[BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts)\noperation, provided as the value in a key-value pair.", + "x-release-status": "BETA", + "properties": { + "version": { + "type": "integer", + "description": "The current version of the scheduled shift, used to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol. If the provided version doesn't match the server version, the request fails.\nIf omitted, Square executes a blind write, potentially overwriting data from another publish request." + } + } + }, + "BulkPublishScheduledShiftsRequest": { + "type": "object", + "description": "Represents a [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) request.", + "x-release-status": "BETA", + "required": [ + "scheduled_shifts" + ], + "properties": { + "scheduled_shifts": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkPublishScheduledShiftsData" + }, + "description": "A map of 1 to 100 key-value pairs that represent individual publish requests.\n\n- Each key is the ID of a scheduled shift you want to publish.\n- Each value is a `BulkPublishScheduledShiftsData` object that contains the\n`version` field or is an empty object." + }, + "scheduled_shift_notification_audience": { + "$ref": "#/components/schemas/ScheduledShiftNotificationAudience", + "description": "Indicates whether Square should send email notifications to team members and\nwhich team members should receive the notifications. This setting applies to all shifts\nspecified in the bulk operation. The default value is `AFFECTED`.\nSee [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudience) for possible values", + "nullable": true + } + }, + "example": { + "scheduled-shifts": { + "K0YH4CV5462JB": { + "version": 3 + }, + "scheduled-shift-2": { + "version": 2 + } + }, + "scheduled_shift_notification_audience": "AFFECTED" + } + }, + "BulkPublishScheduledShiftsResponse": { + "type": "object", + "description": "Represents a [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) response.\nEither `scheduled_shifts` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/PublishScheduledShiftResponse" + }, + "description": "A map of key-value pairs that represent responses for individual publish requests.\nThe order of responses might differ from the order in which the requests were provided.\n\n- Each key is the scheduled shift ID that was specified for a publish request.\n- Each value is the corresponding response. If the request succeeds, the value is the\npublished scheduled shift. If the request fails, the value is an `errors` array containing\nany errors that occurred while processing the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any top-level errors that prevented the bulk operation from succeeding." + } + }, + "example": { + "responses": { + "idp_key_1": { + "scheduled_shift": { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-03-25T13:18:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Don't forget to prep the vegetables", + "start_at": "2019-03-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "published_shift_details": { + "end_at": "2019-03-25T13:18:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Don't forget to prep the vegetables", + "start_at": "2019-03-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "updated_at": "2019-02-25T03:11:15-05:00", + "version": 3 + } + }, + "idp_key_2": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "INVALID_VALUE", + "detail": "Scheduled shift with id 'scheduled-shift-2' not found", + "field": "scheduled-shifts.scheduled-shift-2" + } + ] + } + } + } + }, + "BulkRetrieveBookingsRequest": { + "type": "object", + "description": "Request payload for bulk retrieval of bookings.", + "x-release-status": "PUBLIC", + "required": [ + "booking_ids" + ], + "properties": { + "booking_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A non-empty list of [Booking](entity:Booking) IDs specifying bookings to retrieve." + } + } + }, + "BulkRetrieveBookingsResponse": { + "type": "object", + "description": "Response payload for bulk retrieval of bookings.", + "x-release-status": "PUBLIC", + "properties": { + "bookings": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RetrieveBookingResponse" + }, + "description": "Requested bookings returned as a map containing `booking_id` as the key and `RetrieveBookingResponse` as the value." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "bookings": { + "sc3p3m7dvctfr1": { + "booking": { + "all_day": false, + "appointment_segments": [ + { + "any_team_member": false, + "duration_minutes": 60, + "service_variation_id": "VG4FYBKK3UL6UITOEYQ6MFLS", + "service_variation_version": 1641341724039, + "team_member_id": "TMjiqI3PxyLMKr4k" + } + ], + "created_at": "2023-04-26T18:19:21Z", + "customer_id": "4TDWKN9E8165X8Z77MRS0VFMJM", + "id": "sc3p3m7dvctfr1", + "location_id": "LY6WNBPVM6VGV", + "start_at": "2023-05-01T14:00:00Z", + "status": "ACCEPTED", + "updated_at": "2023-04-26T18:19:21Z", + "version": 0 + }, + "errors": [] + }, + "tdegug1dvctdef": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Specified booking was not found.", + "field": "booking_id" + } + ] + }, + "tdegug1fqni3wh": { + "booking": { + "all_day": false, + "appointment_segments": [ + { + "any_team_member": false, + "duration_minutes": 60, + "service_variation_id": "VG4FYBKK3UL6UITOEYQ6MFLS", + "service_variation_version": 1641341724039, + "team_member_id": "TMjiqI3PxyLMKr4k" + } + ], + "created_at": "2023-04-26T18:19:30Z", + "customer_id": "4TDWKN9E8165X8Z77MRS0VFMJM", + "id": "tdegug1fqni3wh", + "location_id": "LY6WNBPVM6VGV", + "start_at": "2023-05-02T14:00:00Z", + "status": "ACCEPTED", + "updated_at": "2023-04-26T18:19:30Z", + "version": 0 + }, + "errors": [] + } + }, + "errors": [] + } + }, + "BulkRetrieveCustomersRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in requests to the\n[BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "customer_ids" + ], + "properties": { + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the [customer profiles](entity:Customer) to retrieve." + } + }, + "example": { + "customer_ids": [ + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" + ] + } + }, + "BulkRetrieveCustomersResponse": { + "type": "object", + "description": "Defines the fields included in the response body from the\n[BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RetrieveCustomerResponse" + }, + "description": "A map of responses that correspond to individual retrieve requests, represented by\nkey-value pairs.\n\nEach key is the customer ID that was specified for a retrieve request and each value\nis the corresponding response.\nIf the request succeeds, the value is the requested customer profile.\nIf the request fails, the value contains any errors that occurred during the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any top-level errors that prevented the bulk operation from running." + } + }, + "example": { + "responses": { + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found." + } + ] + }, + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "customer": { + "birthday": "1897-07-24", + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "email_address": "New.Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", + "note": "updated customer note", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 3 + } + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "customer": { + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "family_name": "Curie", + "given_name": "Marie", + "id": "N18CPRVXR5214XPBBA6BZQWF3C", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 1 + } + } + } + } + }, + "BulkRetrieveTeamMemberBookingProfilesRequest": { + "type": "object", + "description": "Request payload for the [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "team_member_ids" + ], + "properties": { + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A non-empty list of IDs of team members whose booking profiles you want to retrieve." + } + } + }, + "BulkRetrieveTeamMemberBookingProfilesResponse": { + "type": "object", + "description": "Response payload for the [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "team_member_booking_profiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RetrieveTeamMemberBookingProfileResponse" + }, + "description": "The returned team members' booking profiles, as a map with `team_member_id` as the key and [TeamMemberBookingProfile](entity:TeamMemberBookingProfile) the value." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "errors": [], + "team_member_booking_profiles": { + "TMXUrsBWWcHTt79t": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Resource not found." + } + ] + }, + "TMaJcbiRqPIGZuS9": { + "errors": [], + "team_member_booking_profile": { + "display_name": "Sandbox Staff 1", + "is_bookable": true, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + }, + "TMtdegug1fqni3wh": { + "errors": [], + "team_member_booking_profile": { + "display_name": "Sandbox Staff 2", + "is_bookable": true, + "team_member_id": "TMtdegug1fqni3wh" + } + } + } + } + }, + "BulkRetrieveVendorsRequest": { + "type": "object", + "description": "Represents an input to a call to [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors).", + "x-release-status": "BETA", + "properties": { + "vendor_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IDs of the [Vendor](entity:Vendor) objects to retrieve.", + "nullable": true + } + }, + "example": { + "vendor_ids": [ + "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4" + ] + } + }, + "BulkRetrieveVendorsResponse": { + "type": "object", + "description": "Represents an output from a call to [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RetrieveVendorResponse" + }, + "description": "The set of [RetrieveVendorResponse](entity:RetrieveVendorResponse) objects encapsulating successfully retrieved [Vendor](entity:Vendor)\nobjects or error responses for failed attempts. The set is represented by \na collection of `Vendor`-ID/`Vendor`-object or `Vendor`-ID/error-object pairs." + } + }, + "example": { + "responses": { + "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "a vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 1 + } + } + } + } + }, + "BulkSwapPlanRequest": { + "type": "object", + "description": "Defines input parameters in a call to the\n[BulkSwapPlan](api-endpoint:Subscriptions-BulkSwapPlan) endpoint.", + "x-release-status": "BETA", + "required": [ + "new_plan_variation_id", + "old_plan_variation_id", + "location_id" + ], + "properties": { + "new_plan_variation_id": { + "type": "string", + "description": "The ID of the new subscription plan variation.\n\nThis field is required.", + "minLength": 1 + }, + "old_plan_variation_id": { + "type": "string", + "description": "The ID of the plan variation whose subscriptions should be swapped. Active subscriptions\nusing this plan variation will be subscribed to the new plan variation on their next billing\nday.", + "minLength": 1 + }, + "location_id": { + "type": "string", + "description": "The ID of the location to associate with the swapped subscriptions.", + "minLength": 1 + } + }, + "example": { + "location_id": "S8GWD5R9QB376", + "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "old_plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H" + } + }, + "BulkSwapPlanResponse": { + "type": "object", + "description": "Defines output parameters in a response of the\n[BulkSwapPlan](api-endpoint:Subscriptions-BulkSwapPlan) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "affected_subscriptions": { + "type": "integer", + "description": "The number of affected subscriptions." + } + }, + "example": { + "affected_subscriptions": 12 + } + }, + "BulkUpdateCustomerData": { + "type": "object", + "description": "Defines the customer data provided in individual update requests for a\n[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) operation.", + "x-release-status": "PUBLIC", + "properties": { + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the customer profile.", + "maxLength": 300, + "nullable": true + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the customer profile.", + "maxLength": 300, + "nullable": true + }, + "company_name": { + "type": "string", + "description": "A business name associated with the customer profile.", + "maxLength": 500, + "nullable": true + }, + "nickname": { + "type": "string", + "description": "A nickname for the customer profile.", + "maxLength": 100, + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address associated with the customer profile.", + "maxLength": 254, + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address associated with the customer profile. For maximum length constraints,\nsee [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).\nThe `first_name` and `last_name` fields are ignored if they are present in the request.", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number associated with the customer profile. The phone number must be valid\nand can contain 9–16 digits, with an optional `+` prefix and country code. For more information,\nsee [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "An optional second ID used to associate the customer profile with an\nentity in another system.", + "maxLength": 100, + "nullable": true + }, + "note": { + "type": "string", + "description": "An custom note associates with the customer profile.", + "nullable": true + }, + "birthday": { + "type": "string", + "description": "The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.\nFor example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.\nBirthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or\n`0000` if a birth year is not specified.", + "nullable": true + }, + "tax_ids": { + "$ref": "#/components/schemas/CustomerTaxIds", + "description": "The tax ID associated with the customer profile. This field is available only for\ncustomers of sellers in EU countries or the United Kingdom. For more information, see\n[Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The current version of the customer profile.\n\nAs a best practice, you should include this field to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol.", + "format": "int64" + } + } + }, + "BulkUpdateCustomersRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in requests to the\n[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "customers" + ], + "properties": { + "customers": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpdateCustomerData" + }, + "description": "A map of 1 to 100 individual update requests, represented by `customer ID: { customer data }`\nkey-value pairs.\n\nEach key is the ID of the [customer profile](entity:Customer) to update. To update a customer profile\nthat was created by merging existing profiles, provide the ID of the newly created profile.\n\nEach value contains the updated customer data. Only new or changed fields are required. To add or\nupdate a field, specify the new value. To remove a field, specify `null`." + } + }, + "example": { + "customers": { + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "email_address": "New.Amelia.Earhart@example.com", + "note": "updated customer note", + "phone_number": null, + "version": 2 + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "family_name": "Curie", + "given_name": "Marie", + "version": 0 + } + } + } + }, + "BulkUpdateCustomersResponse": { + "type": "object", + "description": "Defines the fields included in the response body from the\n[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateCustomerResponse" + }, + "description": "A map of responses that correspond to individual update requests, represented by\nkey-value pairs.\n\nEach key is the customer ID that was specified for an update request and each value\nis the corresponding response.\nIf the request succeeds, the value is the updated customer profile.\nIf the request fails, the value contains any errors that occurred during the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any top-level errors that prevented the bulk operation from running." + } + }, + "example": { + "responses": { + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "customer": { + "birthday": "1897-07-24", + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "email_address": "New.Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", + "note": "updated customer note", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 3 + } + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "customer": { + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "family_name": "Curie", + "given_name": "Marie", + "id": "N18CPRVXR5214XPBBA6BZQWF3C", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 1 + } + } + } + } + }, + "BulkUpdateTeamMembersRequest": { + "type": "object", + "description": "Represents a bulk update request for `TeamMember` objects.", + "x-release-status": "PUBLIC", + "required": [ + "team_members" + ], + "properties": { + "team_members": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateTeamMemberRequest" + }, + "description": "The data used to update the `TeamMember` objects. Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`.\nThe maximum number of update objects is 25.\n\nFor each team member, include the fields to add, change, or clear. Fields can be cleared using a null value.\nTo update `wage_setting.job_assignments`, you must provide the complete list of job assignments. If needed,\ncall [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values." + } + }, + "example": { + "team_members": { + "AFMwA08kR-MIF-3Vs0OE": { + "team_member": { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "email_address": "jane_smith@gmail.com", + "family_name": "Smith", + "given_name": "Jane", + "is_owner": false, + "phone_number": "+14159223334", + "reference_id": "reference_id_2", + "status": "ACTIVE" + } + }, + "fpgteZNMaf0qOK-a4t6P": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "YSGH2WBKG94QZ", + "GA2Y9HSJ8KRYT" + ] + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE" + } + } + } + } + }, + "BulkUpdateTeamMembersResponse": { + "type": "object", + "description": "Represents a response from a bulk update request containing the updated `TeamMember` objects or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "team_members": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateTeamMemberResponse" + }, + "description": "The successfully updated `TeamMember` objects. Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "team_members": { + "AFMwA08kR-MIF-3Vs0OE": { + "team_member": { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:00Z", + "email_address": "jane_smith@example.com", + "family_name": "Smith", + "given_name": "Jane", + "id": "AFMwA08kR-MIF-3Vs0OE", + "is_owner": false, + "phone_number": "+14159223334", + "reference_id": "reference_id_2", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:18:00Z" + } + }, + "fpgteZNMaf0qOK-a4t6P": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "GA2Y9HSJ8KRYT", + "YSGH2WBKG94QZ" + ] + }, + "created_at": "2020-03-24T18:14:00Z", + "email_address": "joe_doe@example.com", + "family_name": "Doe", + "given_name": "Joe", + "id": "fpgteZNMaf0qOK-a4t6P", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:18:00Z" + } + } + } + } + }, + "BulkUpdateVendorsRequest": { + "type": "object", + "description": "Represents an input to a call to [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors).", + "x-release-status": "BETA", + "required": [ + "vendors" + ], + "properties": { + "vendors": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateVendorRequest" + }, + "description": "A set of [UpdateVendorRequest](entity:UpdateVendorRequest) objects encapsulating to-be-updated [Vendor](entity:Vendor)\nobjects. The set is represented by a collection of `Vendor`-ID/`UpdateVendorRequest`-object pairs." + } + }, + "example": { + "vendors": { + "FMCYHBWT1TPL8MFH52PBMEN92A": { + "address": { + "address_line_1": "202 Mill St", + "administrative_district_level_1": "NJ", + "country": "US", + "locality": "Moorestown", + "postal_code": "08057" + }, + "status": "ACTIVE", + "version": 10 + }, + "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4": { + "note": "favorite vendor", + "status": "ACTIVE", + "version": 30 + } + } + } + }, + "BulkUpdateVendorsResponse": { + "type": "object", + "description": "Represents an output from a call to [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered when the request fails." + }, + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateVendorResponse" + }, + "description": "A set of [UpdateVendorResponse](entity:UpdateVendorResponse) objects encapsulating successfully created [Vendor](entity:Vendor)\nobjects or error responses for failed attempts. The set is represented by a collection of `Vendor`-ID/`UpdateVendorResponse`-object or \n`Vendor`-ID/error-object pairs." + } + }, + "example": { + "responses": { + "INV_V_FMCYHBWT1TPL8MFH52PBMEN92A": { + "vendor": { + "address": { + "address_line_1": "202 Mill St", + "administrative_district_level_1": "NJ", + "country": "US", + "locality": "Moorestown", + "postal_code": "08057" + }, + "contacts": [ + { + "email_address": "annie@annieshotsauce.com", + "id": "INV_VC_ABYYHBWT1TPL8MFH52PBMENPJ4", + "name": "Annie Thomas", + "ordinal": 0, + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Annie’s Hot Sauce", + "status": "ACTIVE", + "updated_at": "2022-03-16T20:21:54.859Z", + "version": 11 + } + }, + "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "ordinal": 0, + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:10:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "favorite vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T20:21:54.859Z", + "version": 31 + } + } + } + } + }, + "BulkUpsertBookingCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) request.", + "x-release-status": "PUBLIC", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BookingCustomAttributeUpsertRequest" + }, + "description": "A map containing 1 to 25 individual upsert requests. For each request, provide an\narbitrary ID that is unique for this `BulkUpsertBookingCustomAttributes` request and the\ninformation needed to create or update a custom attribute." + } + } + }, + "BulkUpsertBookingCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual upsert request.", + "x-release-status": "PUBLIC", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BookingCustomAttributeUpsertResponse" + }, + "description": "A map of responses that correspond to individual upsert requests. Each response has the\nsame ID as the corresponding request and contains either a `booking_id` and `custom_attribute` or an `errors` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "errors": [], + "values": { + "id1": { + "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", + "custom_attribute": { + "created_at": "2022-11-16T23:14:47Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T00:16:23Z", + "value": "Spring Fresh", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + }, + "id2": { + "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", + "custom_attribute": { + "created_at": "2022-11-16T00:16:20Z", + "key": "hasShoes", + "updated_at": "2022-11-16T00:16:23Z", + "value": false, + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + }, + "id3": { + "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", + "custom_attribute": { + "created_at": "2022-11-16T00:16:20Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T00:16:23Z", + "value": "Hydro-Cool", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + }, + "id4": { + "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", + "custom_attribute": { + "created_at": "2022-11-16T23:14:47Z", + "key": "partySize", + "updated_at": "2022-11-16T00:16:23Z", + "value": 4, + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + }, + "id5": { + "booking_id": "70548QG1HN43B05G0KCZ4MMC1G", + "custom_attribute": { + "created_at": "2022-11-16T00:16:20Z", + "key": "celebrating", + "updated_at": "2022-11-16T00:16:23Z", + "value": "birthday", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + } + } + } + }, + "BulkUpsertCustomerCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) request.", + "x-release-status": "PUBLIC", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest" + }, + "description": "A map containing 1 to 25 individual upsert requests. For each request, provide an\narbitrary ID that is unique for this `BulkUpsertCustomerCustomAttributes` request and the\ninformation needed to create or update a custom attribute." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "key": "favoritemovie", + "value": "Dune" + }, + "customer_id": "N3NCVYY3WS27HF0HKANA3R9FP8" + }, + "id2": { + "custom_attribute": { + "key": "ownsmovie", + "value": false + }, + "customer_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM" + }, + "id3": { + "custom_attribute": { + "key": "favoritemovie", + "value": "Star Wars" + }, + "customer_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM" + }, + "id4": { + "custom_attribute": { + "key": "square:a0f1505a-2aa1-490d-91a8-8d31ff181808", + "value": "10.5" + }, + "customer_id": "N3NCVYY3WS27HF0HKANA3R9FP8" + }, + "id5": { + "custom_attribute": { + "key": "sq0ids-0evKIskIGaY45fCyNL66aw:backupemail", + "value": "fake-email@squareup.com" + }, + "customer_id": "70548QG1HN43B05G0KCZ4MMC1G" + } + } + } + }, + "BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest": { + "type": "object", + "description": "Represents an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes)\nrequest. An individual request contains a customer ID, the custom attribute to create or update,\nand an optional idempotency key.", + "x-release-status": "PUBLIC", + "required": [ + "customer_id", + "custom_attribute" + ], + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the target [customer profile](entity:Customer).", + "minLength": 1 + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with following fields:\n\n- `key`. This key must match the `key` of a custom attribute definition in the Square seller \naccount. If the requesting application is not the definition owner, you must provide the qualified key.\n\n- `value`. This value must conform to the `schema` specified by the definition. \nFor more information, see [Value data types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for update operations, include this optional field in the request and set the\nvalue to the current version of the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this individual upsert request, used to ensure idempotency.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "BulkUpsertCustomerCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual upsert request.", + "x-release-status": "PUBLIC", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse" + }, + "description": "A map of responses that correspond to individual upsert requests. Each response has the\nsame ID as the corresponding request and contains either a `customer_id` and `custom_attribute` or an `errors` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "created_at": "2021-12-08T23:14:47Z", + "key": "favoritemovie", + "updated_at": "2021-12-09T00:16:23Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "N3NCVYY3WS27HF0HKANA3R9FP8" + }, + "id2": { + "custom_attribute": { + "created_at": "2021-12-09T00:16:20Z", + "key": "ownsmovie", + "updated_at": "2021-12-09T00:16:23Z", + "value": false, + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM" + }, + "id3": { + "custom_attribute": { + "created_at": "2021-12-09T00:16:20Z", + "key": "favoritemovie", + "updated_at": "2021-12-09T00:16:23Z", + "value": "Star Wars", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM" + }, + "id4": { + "custom_attribute": { + "created_at": "2021-12-08T23:14:47Z", + "key": "square:a0f1505a-2aa1-490d-91a8-8d31ff181808", + "updated_at": "2021-12-09T00:16:23Z", + "value": "10.5", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "N3NCVYY3WS27HF0HKANA3R9FP8" + }, + "id5": { + "custom_attribute": { + "created_at": "2021-12-09T00:16:20Z", + "key": "sq0ids-0evKIskIGaY45fCyNL66aw:backupemail", + "updated_at": "2021-12-09T00:16:23Z", + "value": "fake-email@squareup.com", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "70548QG1HN43B05G0KCZ4MMC1G" + } + } + } + }, + "BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse": { + "type": "object", + "description": "Represents a response for an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) operation.", + "x-release-status": "PUBLIC", + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the customer profile associated with the custom attribute." + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred while processing the individual request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2021-12-08T23:14:47Z", + "key": "favoritemovie", + "updated_at": "2021-12-09T00:16:23Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "N3NCVYY3WS27HF0HKANA3R9FP8" + } + }, + "BulkUpsertLocationCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest" + }, + "description": "A map containing 1 to 25 individual upsert requests. For each request, provide an\narbitrary ID that is unique for this `BulkUpsertLocationCustomAttributes` request and the\ninformation needed to create or update a custom attribute." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "key": "bestseller", + "value": "hot cocoa" + }, + "location_id": "L0TBCBTB7P8RQ" + }, + "id2": { + "custom_attribute": { + "key": "bestseller", + "value": "berry smoothie" + }, + "location_id": "L9XMD04V3STJX" + }, + "id3": { + "custom_attribute": { + "key": "phone-number", + "value": "+12223334444" + }, + "location_id": "L0TBCBTB7P8RQ" + } + } + } + }, + "BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest": { + "type": "object", + "description": "Represents an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes)\nrequest. An individual request contains a location ID, the custom attribute to create or update,\nand an optional idempotency key.", + "x-release-status": "BETA", + "required": [ + "location_id", + "custom_attribute" + ], + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the target [location](entity:Location).", + "minLength": 1 + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with following fields:\n- `key`. This key must match the `key` of a custom attribute definition in the Square seller\naccount. If the requesting application is not the definition owner, you must provide the qualified key.\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types)..\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, specify the current version of the custom attribute. \nIf this is not important for your application, `version` can be set to -1." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this individual upsert request, used to ensure idempotency.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "BulkUpsertLocationCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual upsert request.", + "x-release-status": "BETA", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse" + }, + "description": "A map of responses that correspond to individual upsert requests. Each response has the\nsame ID as the corresponding request and contains either a `location_id` and `custom_attribute` or an `errors` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "created_at": "2023-01-09T19:02:58.647Z", + "key": "bestseller", + "updated_at": "2023-01-09T19:21:04.551Z", + "value": "hot cocoa", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "location_id": "L0TBCBTB7P8RQ" + }, + "id2": { + "custom_attribute": { + "created_at": "2023-01-09T19:02:58.647Z", + "key": "bestseller", + "updated_at": "2023-01-09T19:21:04.551Z", + "value": "berry smoothie", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "location_id": "L9XMD04V3STJX" + }, + "id3": { + "custom_attribute": { + "created_at": "2023-01-09T19:04:57.985Z", + "key": "phone-number", + "updated_at": "2023-01-09T19:21:04.563Z", + "value": "+12239903892", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "location_id": "L0TBCBTB7P8RQ" + } + } + } + }, + "BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse": { + "type": "object", + "description": "Represents a response for an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) operation.", + "x-release-status": "BETA", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the location associated with the custom attribute." + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred while processing the individual request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-01-09T19:02:58.647Z", + "key": "bestseller", + "updated_at": "2023-01-09T19:21:04.551Z", + "value": "hot cocoa", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "location_id": "L0TBCBTB7P8RQ" + } + }, + "BulkUpsertMerchantCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest" + }, + "description": "A map containing 1 to 25 individual upsert requests. For each request, provide an\narbitrary ID that is unique for this `BulkUpsertMerchantCustomAttributes` request and the\ninformation needed to create or update a custom attribute." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "key": "alternative_seller_name", + "value": "Ultimate Sneaker Store" + }, + "merchant_id": "DM7VKY8Q63GNP" + }, + "id2": { + "custom_attribute": { + "key": "has_seen_tutorial", + "value": true + }, + "merchant_id": "DM7VKY8Q63GNP" + } + } + } + }, + "BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest": { + "type": "object", + "description": "Represents an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes)\nrequest. An individual request contains a merchant ID, the custom attribute to create or update,\nand an optional idempotency key.", + "x-release-status": "BETA", + "required": [ + "merchant_id", + "custom_attribute" + ], + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target [merchant](entity:Merchant).", + "minLength": 1 + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with following fields:\n- `key`. This key must match the `key` of a custom attribute definition in the Square seller\naccount. If the requesting application is not the definition owner, you must provide the qualified key.\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).\n- The version field must match the current version of the custom attribute definition to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\nIf this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this individual upsert request, used to ensure idempotency.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "BulkUpsertMerchantCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual upsert request.", + "x-release-status": "BETA", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse" + }, + "description": "A map of responses that correspond to individual upsert requests. Each response has the\nsame ID as the corresponding request and contains either a `merchant_id` and `custom_attribute` or an `errors` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "created_at": "2023-05-06T19:02:58.647Z", + "key": "alternative_seller_name", + "updated_at": "2023-05-06T19:21:04.551Z", + "value": "Ultimate Sneaker Store", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "merchant_id": "DM7VKY8Q63GNP" + }, + "id2": { + "custom_attribute": { + "created_at": "2023-05-06T19:02:58.647Z", + "key": "has_seen_tutorial", + "updated_at": "2023-05-06T19:21:04.551Z", + "value": true, + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "merchant_id": "DM7VKY8Q63GNP" + } + } + } + }, + "BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse": { + "type": "object", + "description": "Represents a response for an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) operation.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the custom attribute." + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred while processing the individual request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-05-06T19:02:58.647Z", + "key": "alternative_seller_name", + "updated_at": "2023-05-06T19:21:04.551Z", + "value": "Ultimate Sneaker Store", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "merchant_id": "DM7VKY8Q63GNP" + } + }, + "BulkUpsertOrderCustomAttributesRequest": { + "type": "object", + "description": "Represents a bulk upsert request for one or more order custom attributes.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute" + }, + "description": "A map of requests that correspond to individual upsert operations for custom attributes." + } + }, + "example": { + "values": { + "cover-count": { + "custom_attribute": { + "key": "cover-count", + "value": "6", + "version": 2 + }, + "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + }, + "table-number": { + "custom_attribute": { + "key": "table-number", + "value": "11", + "version": 4 + }, + "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + } + } + } + }, + "BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute": { + "type": "object", + "description": "Represents one upsert within the bulk operation.", + "x-release-status": "BETA", + "required": [ + "custom_attribute", + "order_id" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n\n- `value`. This value must conform to the `schema` specified by the definition. \nFor more information, see [Value data types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, include this optional field and specify the current version of the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. \nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the target [order](entity:Order).", + "minLength": 1, + "maxLength": 255 + } + } + }, + "BulkUpsertOrderCustomAttributesResponse": { + "type": "object", + "description": "Represents a response from a bulk upsert of order custom attributes.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpsertOrderCustomAttributeResponse" + }, + "description": " A map of responses that correspond to individual upsert operations for custom attributes." + } + }, + "example": { + "values": { + "cover-count": { + "custom_attribute": { + "created_at": "2022-11-22T21:27:33.429Z", + "key": "cover-count", + "updated_at": "2022-11-22T21:28:35.721Z", + "value": "6", + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + }, + "table-number": { + "custom_attribute": { + "created_at": "2022-11-22T21:24:57.823Z", + "key": "table-number", + "updated_at": "2022-11-22T21:28:35.726Z", + "value": "11", + "visibility": "VISIBILITY_HIDDEN" + } + } + } + } + }, + "BusinessAppointmentSettings": { + "type": "object", + "description": "The service appointment settings, including where and how the service is provided.", + "x-release-status": "PUBLIC", + "properties": { + "location_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BusinessAppointmentSettingsBookingLocationType" + }, + "description": "Types of the location allowed for bookings.\nSee [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) for possible values", + "nullable": true + }, + "alignment_time": { + "$ref": "#/components/schemas/BusinessAppointmentSettingsAlignmentTime", + "description": "The time unit of the service duration for bookings.\nSee [BusinessAppointmentSettingsAlignmentTime](#type-businessappointmentsettingsalignmenttime) for possible values", + "nullable": true + }, + "min_booking_lead_time_seconds": { + "type": "integer", + "description": "The minimum lead time in seconds before a service can be booked. A booking must be created at least this amount of time before its starting time.", + "nullable": true + }, + "max_booking_lead_time_seconds": { + "type": "integer", + "description": "The maximum lead time in seconds before a service can be booked. A booking must be created at most this amount of time before its starting time.", + "nullable": true + }, + "any_team_member_booking_enabled": { + "type": "boolean", + "description": "Indicates whether a customer can choose from all available time slots and have a staff member assigned\nautomatically (`true`) or not (`false`).", + "nullable": true + }, + "multiple_service_booking_enabled": { + "type": "boolean", + "description": "Indicates whether a customer can book multiple services in a single online booking.", + "nullable": true + }, + "max_appointments_per_day_limit_type": { + "$ref": "#/components/schemas/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType", + "description": "Indicates whether the daily appointment limit applies to team members or to\nbusiness locations.\nSee [BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType](#type-businessappointmentsettingsmaxappointmentsperdaylimittype) for possible values", + "nullable": true + }, + "max_appointments_per_day_limit": { + "type": "integer", + "description": "The maximum number of daily appointments per team member or per location.", + "nullable": true + }, + "cancellation_window_seconds": { + "type": "integer", + "description": "The cut-off time in seconds for allowing clients to cancel or reschedule an appointment.", + "nullable": true + }, + "cancellation_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The flat-fee amount charged for a no-show booking.", + "nullable": true + }, + "cancellation_policy": { + "$ref": "#/components/schemas/BusinessAppointmentSettingsCancellationPolicy", + "description": "The cancellation policy adopted by the seller.\nSee [BusinessAppointmentSettingsCancellationPolicy](#type-businessappointmentsettingscancellationpolicy) for possible values", + "nullable": true + }, + "cancellation_policy_text": { + "type": "string", + "description": "The free-form text of the seller's cancellation policy.", + "maxLength": 65536, + "nullable": true + }, + "skip_booking_flow_staff_selection": { + "type": "boolean", + "description": "Indicates whether customers has an assigned staff member (`true`) or can select s staff member of their choice (`false`).", + "nullable": true + } + } + }, + "BusinessAppointmentSettingsAlignmentTime": { + "type": "string", + "enum": [ + "SERVICE_DURATION", + "QUARTER_HOURLY", + "HALF_HOURLY", + "HOURLY" + ], + "x-enum-elements": [ + { + "name": "SERVICE_DURATION", + "description": "The service duration unit is one visit of a fixed time interval specified by the seller." + }, + { + "name": "QUARTER_HOURLY", + "description": "The service duration unit is a 15-minute interval. Bookings can be scheduled every quarter hour." + }, + { + "name": "HALF_HOURLY", + "description": "The service duration unit is a 30-minute interval. Bookings can be scheduled every half hour." + }, + { + "name": "HOURLY", + "description": "The service duration unit is a 60-minute interval. Bookings can be scheduled every hour." + } + ], + "description": "Time units of a service duration for bookings.", + "x-release-status": "PUBLIC" + }, + "BusinessAppointmentSettingsBookingLocationType": { + "type": "string", + "enum": [ + "BUSINESS_LOCATION", + "CUSTOMER_LOCATION", + "PHONE" + ], + "x-enum-elements": [ + { + "name": "BUSINESS_LOCATION", + "description": "The service is provided at a seller location." + }, + { + "name": "CUSTOMER_LOCATION", + "description": "The service is provided at a customer location." + }, + { + "name": "PHONE", + "description": "The service is provided over the phone." + } + ], + "description": "Supported types of location where service is provided.", + "x-release-status": "PUBLIC" + }, + "BusinessAppointmentSettingsCancellationPolicy": { + "type": "string", + "enum": [ + "CANCELLATION_TREATED_AS_NO_SHOW", + "CUSTOM_POLICY" + ], + "x-enum-elements": [ + { + "name": "CANCELLATION_TREATED_AS_NO_SHOW", + "description": "Cancellations are treated as no shows and may incur a fee as specified by `cancellation_fee_money`." + }, + { + "name": "CUSTOM_POLICY", + "description": "Cancellations follow the seller-specified policy that is described in free-form text and not enforced automatically by Square." + } + ], + "description": "The category of the seller’s cancellation policy.", + "x-release-status": "PUBLIC" + }, + "BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType": { + "type": "string", + "enum": [ + "PER_TEAM_MEMBER", + "PER_LOCATION" + ], + "x-enum-elements": [ + { + "name": "PER_TEAM_MEMBER", + "description": "The maximum number of daily appointments is set on a per team member basis." + }, + { + "name": "PER_LOCATION", + "description": "The maximum number of daily appointments is set on a per location basis." + } + ], + "description": "Types of daily appointment limits.", + "x-release-status": "PUBLIC" + }, + "BusinessBookingProfile": { + "type": "object", + "description": "A seller's business booking profile, including booking policy, appointment settings, etc.", + "x-release-status": "PUBLIC", + "properties": { + "seller_id": { + "type": "string", + "description": "The ID of the seller, obtainable using the Merchants API.", + "maxLength": 32, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The RFC 3339 timestamp specifying the booking's creation time.", + "readOnly": true + }, + "booking_enabled": { + "type": "boolean", + "description": "Indicates whether the seller is open for booking.", + "nullable": true + }, + "customer_timezone_choice": { + "$ref": "#/components/schemas/BusinessBookingProfileCustomerTimezoneChoice", + "description": "The choice of customer's time zone information of a booking.\nThe Square online booking site and all notifications to customers uses either the seller location’s time zone\nor the time zone the customer chooses at booking.\nSee [BusinessBookingProfileCustomerTimezoneChoice](#type-businessbookingprofilecustomertimezonechoice) for possible values", + "nullable": true + }, + "booking_policy": { + "$ref": "#/components/schemas/BusinessBookingProfileBookingPolicy", + "description": "The policy for the seller to automatically accept booking requests (`ACCEPT_ALL`) or not (`REQUIRES_ACCEPTANCE`).\nSee [BusinessBookingProfileBookingPolicy](#type-businessbookingprofilebookingpolicy) for possible values", + "nullable": true + }, + "allow_user_cancel": { + "type": "boolean", + "description": "Indicates whether customers can cancel or reschedule their own bookings (`true`) or not (`false`).", + "nullable": true + }, + "business_appointment_settings": { + "$ref": "#/components/schemas/BusinessAppointmentSettings", + "description": "Settings for appointment-type bookings.", + "nullable": true + }, + "support_seller_level_writes": { + "type": "boolean", + "description": "Indicates whether the seller's subscription to Square Appointments supports creating, updating or canceling an appointment through the API (`true`) or not (`false`) using seller permission.", + "nullable": true + } + } + }, + "BusinessBookingProfileBookingPolicy": { + "type": "string", + "enum": [ + "ACCEPT_ALL", + "REQUIRES_ACCEPTANCE" + ], + "x-enum-elements": [ + { + "name": "ACCEPT_ALL", + "description": "The seller accepts all booking requests automatically." + }, + { + "name": "REQUIRES_ACCEPTANCE", + "description": "The seller must accept requests to complete bookings." + } + ], + "description": "Policies for accepting bookings.", + "x-release-status": "PUBLIC" + }, + "BusinessBookingProfileCustomerTimezoneChoice": { + "type": "string", + "enum": [ + "BUSINESS_LOCATION_TIMEZONE", + "CUSTOMER_CHOICE" + ], + "x-enum-elements": [ + { + "name": "BUSINESS_LOCATION_TIMEZONE", + "description": "Use the time zone of the business location for bookings." + }, + { + "name": "CUSTOMER_CHOICE", + "description": "Use the customer-chosen time zone for bookings." + } + ], + "description": "Choices of customer-facing time zone used for bookings.", + "x-release-status": "PUBLIC" + }, + "BusinessHours": { + "type": "object", + "description": "The hours of operation for a location.", + "x-release-status": "PUBLIC", + "properties": { + "periods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BusinessHoursPeriod" + }, + "description": "The list of time periods during which the business is open. There can be at most 10 periods per day.", + "nullable": true + } + } + }, + "BusinessHoursPeriod": { + "type": "object", + "description": "Represents a period of time during which a business location is open.", + "x-release-status": "PUBLIC", + "properties": { + "day_of_week": { + "$ref": "#/components/schemas/DayOfWeek", + "description": "The day of the week for this time period.\nSee [DayOfWeek](#type-dayofweek) for possible values", + "nullable": true + }, + "start_local_time": { + "type": "string", + "description": "The start time of a business hours period, specified in local time using partial-time\nRFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning.\nNote that the seconds value is always :00, but it is appended for conformance to the RFC.", + "nullable": true + }, + "end_local_time": { + "type": "string", + "description": "The end time of a business hours period, specified in local time using partial-time\nRFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening.\nNote that the seconds value is always :00, but it is appended for conformance to the RFC.", + "nullable": true + } + } + }, + "BuyNowPayLaterDetails": { + "type": "object", + "description": "Additional details about a Buy Now Pay Later payment type.", + "x-release-status": "PUBLIC", + "properties": { + "brand": { + "type": "string", + "description": "The brand used for the Buy Now Pay Later payment.\nThe brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.", + "maxLength": 50, + "nullable": true + }, + "afterpay_details": { + "$ref": "#/components/schemas/AfterpayDetails", + "description": "Details about an Afterpay payment. These details are only populated if the `brand` is\n`AFTERPAY`.", + "nullable": true + }, + "clearpay_details": { + "$ref": "#/components/schemas/ClearpayDetails", + "description": "Details about a Clearpay payment. These details are only populated if the `brand` is\n`CLEARPAY`.", + "nullable": true + } + } + }, + "CalculateLoyaltyPointsRequest": { + "type": "object", + "description": "Represents a [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?program_id=d619f755-2d17-41f3-990d-c04ecedd64dd", + "properties": { + "order_id": { + "type": "string", + "description": "The [order](entity:Order) ID for which to calculate the points.\nSpecify this field if your application uses the Orders API to process orders.\nOtherwise, specify the `transaction_amount_money`.", + "nullable": true + }, + "transaction_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The purchase amount for which to calculate the points. \nSpecify this field if your application does not use the Orders API to process orders.\nOtherwise, specify the `order_id`.", + "nullable": true + }, + "loyalty_account_id": { + "type": "string", + "description": "The ID of the target [loyalty account](entity:LoyaltyAccount). Optionally specify this field\nif your application uses the Orders API to process orders.\n\nIf specified, the `promotion_points` field in the response shows the number of points the buyer would\nearn from the purchase. In this case, Square uses the account ID to determine whether the promotion's\n`trigger_limit` (the maximum number of times that a buyer can trigger the promotion) has been reached.\nIf not specified, the `promotion_points` field shows the number of points the purchase qualifies\nfor regardless of the trigger limit.", + "minLength": 1, + "maxLength": 36, + "nullable": true + } + }, + "example": { + "loyalty_account_id": "79b807d2-d786-46a9-933b-918028d7a8c5", + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + } + }, + "CalculateLoyaltyPointsResponse": { + "type": "object", + "description": "Represents a [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "points": { + "type": "integer", + "description": "The number of points that the buyer can earn from the base loyalty program." + }, + "promotion_points": { + "type": "integer", + "description": "The number of points that the buyer can earn from a loyalty promotion. To be eligible\nto earn promotion points, the purchase must first qualify for program points. When `order_id`\nis not provided in the request, this value is always 0." + } + }, + "example": { + "points": 6, + "promotion_points": 12 + } + }, + "CalculateOrderRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "order" + ], + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The order to be calculated. Expects the entire order, not a sparse update." + }, + "proposed_rewards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReward" + }, + "description": "Identifies one or more loyalty reward tiers to apply during the order calculation.\nThe discounts defined by the reward tiers are added to the order only to preview the\neffect of applying the specified rewards. The rewards do not correspond to actual\nredemptions; that is, no `reward`s are created. Therefore, the reward `id`s are\nrandom strings used only to reference the reward tier.", + "nullable": true + } + }, + "example": { + "idempotency_key": "b3e98fe3-b8de-471c-82f1-545f371e637c", + "order": { + "discounts": [ + { + "name": "50% Off", + "percentage": "50", + "scope": "ORDER" + } + ], + "line_items": [ + { + "base_price_money": { + "amount": 500, + "currency": "USD" + }, + "name": "Item 1", + "quantity": "1" + }, + { + "base_price_money": { + "amount": 300, + "currency": "USD" + }, + "name": "Item 2", + "quantity": "2" + } + ], + "location_id": "D7AVYMEAPJ3A3" + } + } + }, + "CalculateOrderResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The calculated version of the order provided in the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "order": { + "created_at": "2020-05-18T16:30:49.614Z", + "discounts": [ + { + "applied_money": { + "amount": 550, + "currency": "USD" + }, + "name": "50% Off", + "percentage": "50", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "zGsRZP69aqSSR9lq9euSPB" + } + ], + "line_items": [ + { + "applied_discounts": [ + { + "applied_money": { + "amount": 250, + "currency": "USD" + }, + "discount_uid": "zGsRZP69aqSSR9lq9euSPB", + "uid": "9zr9S4dxvPAixvn0lpa1VC" + } + ], + "base_price_money": { + "amount": 500, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 500, + "currency": "USD" + }, + "name": "Item 1", + "quantity": "1", + "total_discount_money": { + "amount": 250, + "currency": "USD" + }, + "total_money": { + "amount": 250, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "ULkg0tQTRK2bkU9fNv3IJD", + "variation_total_price_money": { + "amount": 500, + "currency": "USD" + } + }, + { + "applied_discounts": [ + { + "applied_money": { + "amount": 300, + "currency": "USD" + }, + "discount_uid": "zGsRZP69aqSSR9lq9euSPB", + "uid": "qa8LwwZK82FgSEkQc2HYVC" + } + ], + "base_price_money": { + "amount": 300, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 600, + "currency": "USD" + }, + "name": "Item 2", + "quantity": "2", + "total_discount_money": { + "amount": 300, + "currency": "USD" + }, + "total_money": { + "amount": 300, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "mumY8Nun4BC5aKe2yyx5a", + "variation_total_price_money": { + "amount": 600, + "currency": "USD" + } + } + ], + "location_id": "D7AVYMEAPJ3A3", + "net_amounts": { + "discount_money": { + "amount": 550, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 0, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 550, + "currency": "USD" + } + }, + "state": "OPEN", + "total_discount_money": { + "amount": 550, + "currency": "USD" + }, + "total_money": { + "amount": 550, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2020-05-18T16:30:49.614Z", + "version": 1 + } + } + }, + "CancelBookingRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key to make this request an idempotent operation.", + "maxLength": 255, + "nullable": true + }, + "booking_version": { + "type": "integer", + "description": "The revision number for the booking used for optimistic concurrency.", + "nullable": true + } + } + }, + "CancelBookingResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The booking that was cancelled." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "booking": { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "created_at": "2020-10-28T15:47:41Z", + "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + "customer_note": "", + "id": "zkras0xv0xwswx", + "location_id": "LEQHH0YY8B42M", + "seller_note": "", + "start_at": "2020-11-26T13:00:00Z", + "status": "CANCELLED_BY_CUSTOMER", + "updated_at": "2020-10-28T15:49:25Z", + "version": 1 + }, + "errors": [] + } + }, + "CancelInvoiceRequest": { + "type": "object", + "description": "Describes a `CancelInvoice` request.", + "x-release-status": "PUBLIC", + "required": [ + "version" + ], + "properties": { + "version": { + "type": "integer", + "description": "The version of the [invoice](entity:Invoice) to cancel.\nIf you do not know the version, you can call \n[GetInvoice](api-endpoint:Invoices-GetInvoice) or [ListInvoices](api-endpoint:Invoices-ListInvoices)." + } + }, + "example": { + "version": 0 + } + }, + "CancelInvoiceResponse": { + "type": "object", + "description": "The response returned by the `CancelInvoice` request.", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The canceled invoice." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "CANCELED", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 1 + } + } + }, + "CancelLoyaltyPromotionResponse": { + "type": "object", + "description": "Represents a [CancelLoyaltyPromotion](api-endpoint:Loyalty-CancelLoyaltyPromotion) response.\nEither `loyalty_promotion` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The canceled loyalty promotion." + } + }, + "example": { + "loyalty_promotion": { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ] + }, + "canceled_at": "2022-08-17T12:42:49Z", + "created_at": "2022-08-16T08:38:54Z", + "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", + "incentive": { + "points_multiplier_data": { + "multiplier": "3.000", + "points_multiplier": 3 + }, + "type": "POINTS_MULTIPLIER" + }, + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Tuesday Happy Hour Promo", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "status": "CANCELED", + "trigger_limit": { + "interval": "DAY", + "times": 1 + }, + "updated_at": "2022-08-17T12:42:49Z" + } + } + }, + "CancelPaymentByIdempotencyKeyRequest": { + "type": "object", + "description": "Describes a request to cancel a payment using \n[CancelPaymentByIdempotencyKey](api-endpoint:Payments-CancelPaymentByIdempotencyKey).", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "The `idempotency_key` identifying the payment to be canceled.", + "minLength": 1, + "maxLength": 45 + } + }, + "example": { + "idempotency_key": "a7e36d40-d24b-11e8-b568-0800200c9a66" + } + }, + "CancelPaymentByIdempotencyKeyResponse": { + "type": "object", + "description": "Defines the response returned by \n[CancelPaymentByIdempotencyKey](api-endpoint:Payments-CancelPaymentByIdempotencyKey).\nOn success, `errors` is empty.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "CancelPaymentResponse": { + "type": "object", + "description": "Defines the response returned by [CancelPayment](api-endpoint:Payments-CancelPayment).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The successfully canceled `Payment` object." + } + }, + "example": { + "payment": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-TcgftTEtKxJTRF1lCFJ9TA", + "square_product": "ECOMMERCE_API" + }, + "approved_money": { + "amount": 1000, + "currency": "USD" + }, + "card_details": { + "auth_result_code": "68aLBM", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T20:26:44.364Z", + "voided_at": "2021-10-13T20:31:21.597Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "ON_FILE", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "VOIDED" + }, + "created_at": "2021-10-13T20:26:44.191Z", + "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T20:26:44.191Z", + "id": "1QjqpBVyrI9S4H9sTGDWU9JeiWdZY", + "location_id": "L88917AVBK2S5", + "note": "Example Note", + "order_id": "nUSN9TdxpiK3SrQg3wzmf6r8LP9YY", + "risk_evaluation": { + "created_at": "2021-10-13T20:26:45.271Z", + "risk_level": "NORMAL" + }, + "source_type": "CARD", + "status": "CANCELED", + "tip_money": { + "amount": 100, + "currency": "USD" + }, + "total_money": { + "amount": 1100, + "currency": "USD" + }, + "updated_at": "2021-10-13T20:31:21.597Z", + "version_token": "N8AGYgEjCiY9Q57Jw7aVHEpBq8bzGCDCQMRX8Vs56N06o" + } + } + }, + "CancelSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the \n[CancelSubscription](api-endpoint:Subscriptions-CancelSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The specified subscription scheduled for cancellation according to the action created by the request." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "A list of a single `CANCEL` action scheduled for the subscription.", + "x-release-status": "BETA" + } + }, + "example": { + "subscription": { + "canceled_date": "2023-06-05", + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "created_at": "2022-01-19T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "910afd30-464a-4e00-a8d8-2296e", + "invoice_ids": [ + "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA" + ], + "location_id": "S8GWD5R9QB376", + "paid_until_date": "2023-12-31", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2022-01-19", + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 3 + } + } + }, + "CancelTerminalActionResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The canceled `TerminalAction`" + } + }, + "example": { + "action": { + "app_id": "APP_ID", + "cancel_reason": "SELLER_CANCELED", + "created_at": "2021-07-28T23:22:07.476Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:jveJIAkkAjILHkdCE", + "location_id": "LOCATION_ID", + "save_card_options": { + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "CANCELED", + "type": "SAVE_CARD", + "updated_at": "2021-07-28T23:22:29.511Z" + } + } + }, + "CancelTerminalCheckoutResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The canceled `TerminalCheckout`." + } + }, + "example": { + "checkout": { + "amount_money": { + "amount": 123, + "currency": "USD" + }, + "app_id": "APP_ID", + "cancel_reason": "SELLER_CANCELED", + "created_at": "2020-03-16T15:31:19.934Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": true, + "tip_settings": { + "allow_tipping": true + } + }, + "id": "S1yDlPQx7slqO", + "location_id": "LOCATION_ID", + "reference_id": "id36815", + "status": "CANCELED", + "updated_at": "2020-03-16T15:31:45.787Z" + } + } + }, + "CancelTerminalRefundResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The updated `TerminalRefund`." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 100, + "currency": "CAD" + }, + "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", + "cancel_reason": "SELLER_CANCELED", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 1, + "exp_year": 2022, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "created_at": "2020-10-21T22:47:23.241Z", + "deadline_duration": "PT5M", + "device_id": "42690809-faa2-4701-a24b-19d3d34c9aaa", + "id": "g6ycb6HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "76C9W6K8CNNQ5", + "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "reason", + "status": "CANCELED", + "updated_at": "2020-10-21T22:47:30.096Z" + } + } + }, + "CaptureTransactionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint.", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {}, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.csharp", + "java": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.java", + "javascript": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.javascript", + "php": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.php", + "python": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.python", + "ruby": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.ruby" + } + }, + "Card": { + "type": "object", + "description": "Represents the payment details of a card to be used for payments. These\ndetails are determined by the payment token generated by Web Payments SDK.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "Unique ID for this card. Generated by Square.", + "maxLength": 64, + "readOnly": true + }, + "card_brand": { + "$ref": "#/components/schemas/CardBrand", + "description": "The card's brand.\nSee [CardBrand](#type-cardbrand) for possible values", + "readOnly": true + }, + "last_4": { + "type": "string", + "description": "The last 4 digits of the card number.", + "maxLength": 4, + "readOnly": true + }, + "exp_month": { + "type": "integer", + "description": "The expiration month of the associated card as an integer between 1 and 12.", + "format": "int64", + "nullable": true + }, + "exp_year": { + "type": "integer", + "description": "The four-digit year of the card's expiration date.", + "format": "int64", + "nullable": true + }, + "cardholder_name": { + "type": "string", + "description": "The name of the cardholder.", + "maxLength": 96, + "nullable": true + }, + "billing_address": { + "$ref": "#/components/schemas/Address", + "description": "The billing address for this card. `US` postal codes can be provided as a 5-digit zip code\nor 9-digit ZIP+4 (example: `12345-6789`). For a full list of field meanings by country, see\n[Working with Addresses](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-addresses).", + "nullable": true + }, + "fingerprint": { + "type": "string", + "description": "Intended as a Square-assigned identifier, based\non the card number, to identify the card across multiple locations within a\nsingle application.", + "maxLength": 255, + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "**Required** The ID of a [customer](entity:Customer) to be associated with the card.", + "nullable": true + }, + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the card.", + "readOnly": true + }, + "reference_id": { + "type": "string", + "description": "An optional user-defined reference ID that associates this card with\nanother entity in an external system. For example, a customer ID from an\nexternal customer management system.", + "maxLength": 128, + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether or not a card can be used for payments.", + "readOnly": true + }, + "card_type": { + "$ref": "#/components/schemas/CardType", + "description": "The type of the card.\nThe Card object includes this field only in response to Payments API calls.\nSee [CardType](#type-cardtype) for possible values", + "readOnly": true + }, + "prepaid_type": { + "$ref": "#/components/schemas/CardPrepaidType", + "description": "Indicates whether the card is prepaid or not.\nSee [CardPrepaidType](#type-cardprepaidtype) for possible values", + "readOnly": true + }, + "bin": { + "type": "string", + "description": "The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API\nreturns this field.", + "maxLength": 6, + "readOnly": true + }, + "version": { + "type": "integer", + "description": "Current version number of the card. Increments with each card update. Requests to update an\nexisting Card object will be rejected unless the version in the request matches the current\nversion for the Card.", + "format": "int64" + }, + "card_co_brand": { + "$ref": "#/components/schemas/CardCoBrand", + "description": "The card's co-brand if available. For example, an Afterpay virtual card would have a\nco-brand of AFTERPAY.\nSee [CardCoBrand](#type-cardcobrand) for possible values", + "readOnly": true + }, + "issuer_alert": { + "$ref": "#/components/schemas/CardIssuerAlert", + "description": "An alert from the issuing bank about the card status. Alerts can indicate whether\nfuture charges to the card are likely to fail. For more information, see\n[Manage Card on File Declines](https://developer.squareup.com/docs/cards-api/manage-card-on-file-declines).\n\nThis field is present only if there's an active issuer alert.\nSee [IssuerAlert](#type-issueralert) for possible values", + "readOnly": true, + "x-release-status": "BETA" + }, + "issuer_alert_at": { + "type": "string", + "description": "The timestamp of when the current issuer alert was received and processed, in\nRFC 3339 format.\n\nThis field is present only if there's an active issuer alert.", + "readOnly": true, + "x-release-status": "BETA" + }, + "hsa_fsa": { + "type": "boolean", + "description": "Indicates whether the card is linked to a Health Savings Account (HSA) or Flexible\nSpending Account (FSA), based on the card BIN.", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "CardAutomaticallyUpdatedEvent": { + "type": "object", + "description": "Published when Square automatically updates the expiration date or\nprimary account number (PAN) of a [card](entity:Card) or adds or removes an issuer alert.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"card.automatically_updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CardAutomaticallyUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "ccof:uIbfJXhXETSP197M3GB", + "object": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-2", + "version": 2 + } + }, + "type": "card" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "merchant_id": "6SSW7HV8K2ST5", + "type": "card.automatically_updated" + }, + "x-webhook": { + "event": "card.automatically_updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Cards", + "x-since": "2021-06-16" + }, + "CardAutomaticallyUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"card\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CardAutomaticallyUpdatedEventObject", + "description": "An object containing the automatically updated card.", + "nullable": true + } + } + }, + "CardAutomaticallyUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/Card", + "description": "The automatically updated card.", + "nullable": true + } + } + }, + "CardBrand": { + "type": "string", + "enum": [ + "OTHER_BRAND", + "VISA", + "MASTERCARD", + "AMERICAN_EXPRESS", + "DISCOVER", + "DISCOVER_DINERS", + "JCB", + "CHINA_UNIONPAY", + "SQUARE_GIFT_CARD", + "SQUARE_CAPITAL_CARD", + "INTERAC", + "EFTPOS", + "FELICA", + "EBT" + ], + "x-enum-elements": [ + { + "name": "OTHER_BRAND", + "description": "" + }, + { + "name": "VISA", + "description": "" + }, + { + "name": "MASTERCARD", + "description": "" + }, + { + "name": "AMERICAN_EXPRESS", + "description": "" + }, + { + "name": "DISCOVER", + "description": "" + }, + { + "name": "DISCOVER_DINERS", + "description": "" + }, + { + "name": "JCB", + "description": "" + }, + { + "name": "CHINA_UNIONPAY", + "description": "" + }, + { + "name": "SQUARE_GIFT_CARD", + "description": "" + }, + { + "name": "SQUARE_CAPITAL_CARD", + "description": "" + }, + { + "name": "INTERAC", + "description": "" + }, + { + "name": "EFTPOS", + "description": "" + }, + { + "name": "FELICA", + "description": "" + }, + { + "name": "EBT", + "description": "" + } + ], + "description": "Indicates a card's brand, such as `VISA` or `MASTERCARD`.", + "x-release-status": "PUBLIC" + }, + "CardCoBrand": { + "type": "string", + "enum": [ + "UNKNOWN", + "AFTERPAY", + "CLEARPAY" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN", + "description": "" + }, + { + "name": "AFTERPAY", + "description": "" + }, + { + "name": "CLEARPAY", + "description": "" + } + ], + "description": "Indicates the brand for a co-branded card.", + "x-release-status": "PUBLIC" + }, + "CardCreatedEvent": { + "type": "object", + "description": "Published when a [card](entity:Card) is created or imported.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"card.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CardCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "ccof:uIbfJXhXETSP197M3GB", + "object": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + } + }, + "type": "card" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "merchant_id": "6SSW7HV8K2ST5", + "type": "card.created" + }, + "x-webhook": { + "event": "card.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Cards", + "x-since": "2021-06-16" + }, + "CardCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"card\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CardCreatedEventObject", + "description": "An object containing the created card.", + "nullable": true + } + } + }, + "CardCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/Card", + "description": "The created card.", + "nullable": true + } + } + }, + "CardDisabledEvent": { + "type": "object", + "description": "Published when a [card](entity:Card) is disabled.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"card.disabled\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CardDisabledEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "ccof:uIbfJXhXETSP197M3GB", + "object": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": false, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 2 + } + }, + "type": "card" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "merchant_id": "6SSW7HV8K2ST5", + "type": "card.disabled" + }, + "x-webhook": { + "event": "card.disabled", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Cards", + "x-since": "2021-06-16" + }, + "CardDisabledEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"card\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CardDisabledEventObject", + "description": "An object containing the disabled card.", + "nullable": true + } + } + }, + "CardDisabledEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/Card", + "description": "The disabled card.", + "nullable": true + } + } + }, + "CardForgottenEvent": { + "type": "object", + "description": "Published when a [card](entity:Card) is GDPR forgotten or vaulted.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"card.forgotten\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CardForgottenEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "ccof:uIbfJXhXETSP197M3GB", + "object": { + "card": { + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": false, + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "merchant_id": "6SSW7HV8K2ST5", + "reference_id": "user-id-1", + "version": 2 + } + }, + "type": "card" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "merchant_id": "6SSW7HV8K2ST5", + "type": "card.forgotten" + }, + "x-webhook": { + "event": "card.forgotten", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Cards", + "x-since": "2021-06-16" + }, + "CardForgottenEventCard": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "Unique ID for this card. Generated by Square.", + "maxLength": 64, + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "The ID of a customer created using the Customers API associated with the card.", + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether or not a card can be used for payments.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "An optional user-defined reference ID that associates this card with\nanother entity in an external system. For example, a customer ID from an\nexternal customer management system.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "Current version number of the card. Increments with each card update. Requests to update an\nexisting Card object will be rejected unless the version in the request matches the current\nversion for the Card.", + "format": "int64" + }, + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the card.", + "nullable": true + } + } + }, + "CardForgottenEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"card\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CardForgottenEventObject", + "description": "An object containing the forgotten card.", + "nullable": true + } + } + }, + "CardForgottenEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/CardForgottenEventCard", + "description": "The forgotten card.", + "nullable": true + } + } + }, + "CardIssuerAlert": { + "type": "string", + "enum": [ + "ISSUER_ALERT_CARD_CLOSED" + ], + "x-enum-elements": [ + { + "name": "ISSUER_ALERT_CARD_CLOSED", + "description": "The underlying account of the card was closed, which is a strong signal that future\ncharges to the card are likely to fail." + } + ], + "description": "Indicates the type of issuer alert for a [card on file](entity:Card).", + "x-release-status": "BETA" + }, + "CardPaymentDetails": { + "type": "object", + "description": "Reflects the current status of a card payment. Contains only non-confidential information.", + "x-release-status": "PUBLIC", + "properties": { + "status": { + "type": "string", + "description": "The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or\nFAILED.", + "maxLength": 50, + "nullable": true + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The credit card's non-confidential details.", + "nullable": true + }, + "entry_method": { + "type": "string", + "description": "The method used to enter the card's details for the payment. The method can be\n`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.", + "maxLength": 50, + "nullable": true + }, + "cvv_status": { + "type": "string", + "description": "The status code returned from the Card Verification Value (CVV) check. The code can be\n`CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`.", + "maxLength": 50, + "nullable": true + }, + "avs_status": { + "type": "string", + "description": "The status code returned from the Address Verification System (AVS) check. The code can be\n`AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`.", + "maxLength": 50, + "nullable": true + }, + "auth_result_code": { + "type": "string", + "description": "The status code returned by the card issuer that describes the payment's\nauthorization status.", + "maxLength": 10, + "nullable": true + }, + "application_identifier": { + "type": "string", + "description": "For EMV payments, the application ID identifies the EMV application used for the payment.", + "maxLength": 32, + "nullable": true + }, + "application_name": { + "type": "string", + "description": "For EMV payments, the human-readable name of the EMV application used for the payment.", + "maxLength": 16, + "nullable": true + }, + "application_cryptogram": { + "type": "string", + "description": "For EMV payments, the cryptogram generated for the payment.", + "maxLength": 16, + "nullable": true + }, + "verification_method": { + "type": "string", + "description": "For EMV payments, the method used to verify the cardholder's identity. The method can be\n`PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`.", + "maxLength": 50, + "nullable": true + }, + "verification_results": { + "type": "string", + "description": "For EMV payments, the results of the cardholder verification. The result can be\n`SUCCESS`, `FAILURE`, or `UNKNOWN`.", + "maxLength": 50, + "nullable": true + }, + "statement_description": { + "type": "string", + "description": "The statement description sent to the card networks.\n\nNote: The actual statement description varies and is likely to be truncated and appended with\nadditional information on a per issuer basis.", + "maxLength": 50, + "nullable": true + }, + "device_details": { + "$ref": "#/components/schemas/DeviceDetails", + "description": "__Deprecated__: Use `Payment.device_details` instead.\n\nDetails about the device that took the payment.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "card_payment_timeline": { + "$ref": "#/components/schemas/CardPaymentTimeline", + "description": "The timeline for card payments.", + "nullable": true + }, + "refund_requires_card_presence": { + "type": "boolean", + "description": "Whether the card must be physically present for the payment to\nbe refunded. If set to `true`, the card must be present.", + "x-release-status": "BETA", + "nullable": true + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request.", + "nullable": true + } + } + }, + "CardPaymentTimeline": { + "type": "object", + "description": "The timeline for card payments.", + "x-release-status": "PUBLIC", + "properties": { + "authorized_at": { + "type": "string", + "description": "The timestamp when the payment was authorized, in RFC 3339 format.", + "nullable": true + }, + "captured_at": { + "type": "string", + "description": "The timestamp when the payment was captured, in RFC 3339 format.", + "nullable": true + }, + "voided_at": { + "type": "string", + "description": "The timestamp when the payment was voided, in RFC 3339 format.", + "nullable": true + } + } + }, + "CardPrepaidType": { + "type": "string", + "enum": [ + "UNKNOWN_PREPAID_TYPE", + "NOT_PREPAID", + "PREPAID" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_PREPAID_TYPE", + "description": "" + }, + { + "name": "NOT_PREPAID", + "description": "" + }, + { + "name": "PREPAID", + "description": "" + } + ], + "description": "Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`.", + "x-release-status": "PUBLIC" + }, + "CardType": { + "type": "string", + "enum": [ + "UNKNOWN_CARD_TYPE", + "CREDIT", + "DEBIT" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_CARD_TYPE", + "description": "" + }, + { + "name": "CREDIT", + "description": "" + }, + { + "name": "DEBIT", + "description": "" + } + ], + "description": "Indicates a card's type, such as `CREDIT` or `DEBIT`.", + "x-release-status": "PUBLIC" + }, + "CardUpdatedEvent": { + "type": "object", + "description": "Published when a [card](entity:Card) is updated by the seller in the Square Dashboard.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"card.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CardUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "ccof:uIbfJXhXETSP197M3GB", + "object": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-2", + "version": 2 + } + }, + "type": "card" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "merchant_id": "6SSW7HV8K2ST5", + "type": "card.updated" + }, + "x-webhook": { + "event": "card.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Cards", + "x-since": "2021-06-16" + }, + "CardUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"card\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CardUpdatedEventObject", + "description": "An object containing the updated card.", + "nullable": true + } + } + }, + "CardUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/Card", + "description": "The updated card.", + "nullable": true + } + } + }, + "CashAppDetails": { + "type": "object", + "description": "Additional details about `WALLET` type payments with the `brand` of `CASH_APP`.", + "x-release-status": "PUBLIC", + "properties": { + "buyer_full_name": { + "type": "string", + "description": "The name of the Cash App account holder.", + "maxLength": 255, + "nullable": true + }, + "buyer_country_code": { + "type": "string", + "description": "The country of the Cash App account holder, in ISO 3166-1-alpha-2 format.\n\nFor possible values, see [Country](entity:Country).", + "minLength": 2, + "maxLength": 2, + "nullable": true + }, + "buyer_cashtag": { + "type": "string", + "description": "$Cashtag of the Cash App account holder.", + "minLength": 1, + "maxLength": 21, + "readOnly": true + } + } + }, + "CashDrawerDevice": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The device Square-issued ID" + }, + "name": { + "type": "string", + "description": "The device merchant-specified name.", + "nullable": true + } + } + }, + "CashDrawerEventType": { + "type": "string", + "enum": [ + "NO_SALE", + "CASH_TENDER_PAYMENT", + "OTHER_TENDER_PAYMENT", + "CASH_TENDER_CANCELLED_PAYMENT", + "OTHER_TENDER_CANCELLED_PAYMENT", + "CASH_TENDER_REFUND", + "OTHER_TENDER_REFUND", + "PAID_IN", + "PAID_OUT" + ], + "x-enum-elements": [ + { + "name": "NO_SALE", + "description": "Triggered when a no sale occurs on a cash drawer.\nA CashDrawerEvent of this type must have a zero money amount." + }, + { + "name": "CASH_TENDER_PAYMENT", + "description": "Triggered when a cash tender payment occurs on a cash drawer.\nA CashDrawerEvent of this type can must not have a negative amount." + }, + { + "name": "OTHER_TENDER_PAYMENT", + "description": "Triggered when a check, gift card, or other non-cash payment occurs\non a cash drawer.\nA CashDrawerEvent of this type must have a zero money amount." + }, + { + "name": "CASH_TENDER_CANCELLED_PAYMENT", + "description": "Triggered when a split tender bill is cancelled after cash has been\ntendered.\nA CASH_TENDER_CANCELLED_PAYMENT should have a corresponding CASH_TENDER_PAYMENT.\nA CashDrawerEvent of this type must not have a negative amount." + }, + { + "name": "OTHER_TENDER_CANCELLED_PAYMENT", + "description": "Triggered when a split tender bill is cancelled after a non-cash tender\nhas been tendered. An OTHER_TENDER_CANCELLED_PAYMENT should have a corresponding\nOTHER_TENDER_PAYMENT. A CashDrawerEvent of this type must have a zero money\namount." + }, + { + "name": "CASH_TENDER_REFUND", + "description": "Triggered when a cash tender refund occurs.\nA CashDrawerEvent of this type must not have a negative amount." + }, + { + "name": "OTHER_TENDER_REFUND", + "description": "Triggered when an other tender refund occurs.\nA CashDrawerEvent of this type must have a zero money amount." + }, + { + "name": "PAID_IN", + "description": "Triggered when money unrelated to a payment is added to the cash drawer.\nFor example, an employee adds coins to the drawer.\nA CashDrawerEvent of this type must not have a negative amount." + }, + { + "name": "PAID_OUT", + "description": "Triggered when money is removed from the drawer for other reasons\nthan making change.\nFor example, an employee pays a delivery person with cash from the cash drawer.\nA CashDrawerEvent of this type must not have a negative amount." + } + ], + "description": "The types of events on a CashDrawerShift.\nEach event type represents an employee action on the actual cash drawer\nrepresented by a CashDrawerShift.", + "x-release-status": "PUBLIC" + }, + "CashDrawerShift": { + "type": "object", + "description": "This model gives the details of a cash drawer shift.\nThe cash_payment_money, cash_refund_money, cash_paid_in_money,\nand cash_paid_out_money fields are all computed by summing their respective\nevent types.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The shift unique ID." + }, + "state": { + "$ref": "#/components/schemas/CashDrawerShiftState", + "description": "The shift current state.\nSee [CashDrawerShiftState](#type-cashdrawershiftstate) for possible values", + "nullable": true + }, + "opened_at": { + "type": "string", + "description": "The time when the shift began, in ISO 8601 format.", + "nullable": true + }, + "ended_at": { + "type": "string", + "description": "The time when the shift ended, in ISO 8601 format.", + "nullable": true + }, + "closed_at": { + "type": "string", + "description": "The time when the shift was closed, in ISO 8601 format.", + "nullable": true + }, + "description": { + "type": "string", + "description": "The free-form text description of a cash drawer by an employee.", + "nullable": true + }, + "opened_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money in the cash drawer at the start of the shift.\nThe amount must be greater than or equal to zero.", + "nullable": true + }, + "cash_payment_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money added to the cash drawer from cash payments.\nThis is computed by summing all events with the types CASH_TENDER_PAYMENT and\nCASH_TENDER_CANCELED_PAYMENT. The amount is always greater than or equal to\nzero.", + "nullable": true + }, + "cash_refunds_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money removed from the cash drawer from cash refunds.\nIt is computed by summing the events of type CASH_TENDER_REFUND. The amount\nis always greater than or equal to zero.", + "nullable": true + }, + "cash_paid_in_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money added to the cash drawer for reasons other than cash\npayments. It is computed by summing the events of type PAID_IN. The amount is\nalways greater than or equal to zero.", + "nullable": true + }, + "cash_paid_out_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money removed from the cash drawer for reasons other than\ncash refunds. It is computed by summing the events of type PAID_OUT. The amount\nis always greater than or equal to zero.", + "nullable": true + }, + "expected_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money that should be in the cash drawer at the end of the\nshift, based on the shift's other money amounts.\nThis can be negative if employees have not correctly recorded all the events\non the cash drawer.\ncash_paid_out_money is a summation of amounts from cash_payment_money (zero\nor positive), cash_refunds_money (zero or negative), cash_paid_in_money (zero\nor positive), and cash_paid_out_money (zero or negative) event types.", + "nullable": true + }, + "closed_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money found in the cash drawer at the end of the shift\nby an auditing employee. The amount should be positive.", + "nullable": true + }, + "device": { + "$ref": "#/components/schemas/CashDrawerDevice", + "description": "The device running Square Point of Sale that was connected to the cash drawer.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The shift start time in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The shift updated at time in RFC 3339 format.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location the cash drawer shift belongs to.", + "readOnly": true + }, + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of all team members that were logged into Square Point of Sale at any\npoint while the cash drawer shift was open.", + "readOnly": true + }, + "opening_team_member_id": { + "type": "string", + "description": "The ID of the team member that started the cash drawer shift.", + "readOnly": true + }, + "ending_team_member_id": { + "type": "string", + "description": "The ID of the team member that ended the cash drawer shift.", + "readOnly": true + }, + "closing_team_member_id": { + "type": "string", + "description": "The ID of the team member that closed the cash drawer shift by auditing\nthe cash drawer contents.", + "readOnly": true + } + } + }, + "CashDrawerShiftEvent": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the event." + }, + "event_type": { + "$ref": "#/components/schemas/CashDrawerEventType", + "description": "The type of cash drawer shift event.\nSee [CashDrawerEventType](#type-cashdrawereventtype) for possible values", + "nullable": true + }, + "event_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money that was added to or removed from the cash drawer\nin the event. The amount can be positive (for added money)\nor zero (for other tender type payments). The addition or removal of money can be determined by\nby the event type.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The event time in RFC 3339 format.", + "readOnly": true + }, + "description": { + "type": "string", + "description": "An optional description of the event, entered by the employee that\ncreated the event.", + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "The ID of the team member that created the event.", + "readOnly": true + } + } + }, + "CashDrawerShiftState": { + "type": "string", + "enum": [ + "OPEN", + "ENDED", + "CLOSED" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "An open cash drawer shift." + }, + { + "name": "ENDED", + "description": "A cash drawer shift that is ended but has not yet had an employee content audit." + }, + { + "name": "CLOSED", + "description": "An ended cash drawer shift that is closed with a completed employee\ncontent audit and recorded result." + } + ], + "description": "The current state of a cash drawer shift.", + "x-release-status": "PUBLIC" + }, + "CashDrawerShiftSummary": { + "type": "object", + "description": "The summary of a closed cash drawer shift.\nThis model contains only the money counted to start a cash drawer shift, counted\nat the end of the shift, and the amount that should be in the drawer at shift\nend based on summing all cash drawer shift events.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The shift unique ID." + }, + "state": { + "$ref": "#/components/schemas/CashDrawerShiftState", + "description": "The shift current state.\nSee [CashDrawerShiftState](#type-cashdrawershiftstate) for possible values", + "nullable": true + }, + "opened_at": { + "type": "string", + "description": "The shift start time in ISO 8601 format.", + "nullable": true + }, + "ended_at": { + "type": "string", + "description": "The shift end time in ISO 8601 format.", + "nullable": true + }, + "closed_at": { + "type": "string", + "description": "The shift close time in ISO 8601 format.", + "nullable": true + }, + "description": { + "type": "string", + "description": "An employee free-text description of a cash drawer shift.", + "nullable": true + }, + "opened_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money in the cash drawer at the start of the shift. This\nmust be a positive amount.", + "nullable": true + }, + "expected_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money that should be in the cash drawer at the end of the\nshift, based on the cash drawer events on the shift.\nThe amount is correct if all shift employees accurately recorded their\ncash drawer shift events. Unrecorded events and events with the wrong amount\nresult in an incorrect expected_cash_money amount that can be negative.", + "nullable": true + }, + "closed_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money found in the cash drawer at the end of the shift by\nan auditing employee. The amount must be greater than or equal to zero.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The shift start time in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The shift updated at time in RFC 3339 format.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location the cash drawer shift belongs to.", + "readOnly": true + } + } + }, + "CashPaymentDetails": { + "type": "object", + "description": "Stores details about a cash payment. Contains only non-confidential information. For more information, see \n[Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments).", + "x-release-status": "PUBLIC", + "required": [ + "buyer_supplied_money" + ], + "properties": { + "buyer_supplied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount and currency of the money supplied by the buyer." + }, + "change_back_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of change due back to the buyer. \nThis read-only field is calculated\nfrom the `amount_money` and `buyer_supplied_money` fields.", + "nullable": true + } + } + }, + "CatalogAvailabilityPeriod": { + "type": "object", + "description": "Represents a time period of availability.", + "x-release-status": "BETA", + "properties": { + "start_local_time": { + "type": "string", + "description": "The start time of an availability period, specified in local time using partial-time\nRFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning.\nNote that the seconds value is always :00, but it is appended for conformance to the RFC.", + "nullable": true + }, + "end_local_time": { + "type": "string", + "description": "The end time of an availability period, specified in local time using partial-time\nRFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening.\nNote that the seconds value is always :00, but it is appended for conformance to the RFC.", + "nullable": true + }, + "day_of_week": { + "$ref": "#/components/schemas/DayOfWeek", + "description": "The day of the week for this availability period.\nSee [DayOfWeek](#type-dayofweek) for possible values", + "nullable": true + } + } + }, + "CatalogCategory": { + "type": "object", + "description": "A category to which a `CatalogItem` instance belongs.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The category name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.", + "maxLength": 255, + "nullable": true + }, + "image_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of images associated with this `CatalogCategory` instance.\nCurrently these images are not displayed by Square, but are free to be displayed in 3rd party applications.", + "nullable": true + }, + "category_type": { + "$ref": "#/components/schemas/CatalogCategoryType", + "description": "The type of the category.\nSee [CatalogCategoryType](#type-catalogcategorytype) for possible values", + "nullable": true + }, + "parent_category": { + "$ref": "#/components/schemas/CatalogObjectCategory", + "description": "The ID of the parent category of this category instance.", + "nullable": true + }, + "is_top_level": { + "type": "boolean", + "description": "Indicates whether a category is a top level category, which does not have any parent_category.", + "nullable": true + }, + "channels": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of IDs representing channels, such as a Square Online site, where the category can be made visible.", + "nullable": true + }, + "availability_period_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the `CatalogAvailabilityPeriod` objects associated with the category.", + "nullable": true + }, + "online_visibility": { + "type": "boolean", + "description": "Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square Online sites.", + "nullable": true + }, + "root_category": { + "type": "string", + "description": "The top-level category in a category hierarchy.", + "readOnly": true + }, + "ecom_seo_data": { + "$ref": "#/components/schemas/CatalogEcomSeoData", + "description": "The SEO data for a seller's Square Online store.", + "nullable": true + }, + "path_to_root": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CategoryPathToRootNode" + }, + "description": "The path from the category to its root category. The first node of the path is the parent of the category\nand the last is the root category. The path is empty if the category is a root category.", + "nullable": true + } + }, + "example": { + "object": { + "category_data": { + "name": "Beverages" + }, + "id": "#Beverages", + "present_at_all_locations": true, + "type": "CATEGORY" + } + } + }, + "CatalogCategoryType": { + "type": "string", + "enum": [ + "REGULAR_CATEGORY", + "MENU_CATEGORY", + "KITCHEN_CATEGORY" + ], + "x-enum-elements": [ + { + "name": "REGULAR_CATEGORY", + "description": "The regular category." + }, + { + "name": "MENU_CATEGORY", + "description": "The menu category." + }, + { + "name": "KITCHEN_CATEGORY", + "description": "Kitchen categories are used by KDS (Kitchen Display System) to route items to specific clients" + } + ], + "description": "Indicates the type of a category.", + "x-release-status": "PUBLIC" + }, + "CatalogCustomAttributeDefinition": { + "type": "object", + "description": "Contains information defining a custom attribute. Custom attributes are\nintended to store additional information about a catalog object or to associate a\ncatalog object with an entity in another system. Do not use custom attributes\nto store any sensitive information (personally identifiable information, card details, etc.).\n[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes)", + "x-release-status": "PUBLIC", + "required": [ + "type", + "name", + "allowed_object_types" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionType", + "description": "The type of this custom attribute. Cannot be modified after creation.\nRequired.\nSee [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) for possible values" + }, + "name": { + "type": "string", + "description": " The name of this definition for API and seller-facing UI purposes.\nThe name must be unique within the (merchant, application) pair. Required.\nMay not be empty and may not exceed 255 characters. Can be modified after creation.", + "minLength": 1, + "maxLength": 255 + }, + "description": { + "type": "string", + "description": "Seller-oriented description of the meaning of this Custom Attribute,\nany constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs.", + "maxLength": 255, + "nullable": true + }, + "source_application": { + "$ref": "#/components/schemas/SourceApplication", + "description": "__Read only.__ Contains information about the application that\ncreated this custom attribute definition.", + "nullable": true + }, + "allowed_object_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObjectType" + }, + "description": "The set of `CatalogObject` types that this custom atttribute may be applied to.\nCurrently, only `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, and `CATEGORY` are allowed. At least one type must be included.\nSee [CatalogObjectType](#type-catalogobjecttype) for possible values" + }, + "seller_visibility": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionSellerVisibility", + "description": "The visibility of a custom attribute in seller-facing UIs (including Square Point\nof Sale applications and Square Dashboard). May be modified.\nSee [CatalogCustomAttributeDefinitionSellerVisibility](#type-catalogcustomattributedefinitionsellervisibility) for possible values", + "nullable": true + }, + "app_visibility": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionAppVisibility", + "description": "The visibility of a custom attribute to applications other than the application\nthat created the attribute.\nSee [CatalogCustomAttributeDefinitionAppVisibility](#type-catalogcustomattributedefinitionappvisibility) for possible values", + "nullable": true + }, + "string_config": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionStringConfig", + "description": "Optionally, populated when `type` = `STRING`, unset otherwise.", + "nullable": true + }, + "number_config": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionNumberConfig", + "description": "Optionally, populated when `type` = `NUMBER`, unset otherwise.", + "nullable": true + }, + "selection_config": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionSelectionConfig", + "description": "Populated when `type` is set to `SELECTION`, unset otherwise.", + "nullable": true + }, + "custom_attribute_usage_count": { + "type": "integer", + "description": "The number of custom attributes that reference this\ncustom attribute definition. Set by the server in response to a ListCatalog\nrequest with `include_counts` set to `true`. If the actual count is greater\nthan 100, `custom_attribute_usage_count` will be set to `100`.", + "readOnly": true + }, + "key": { + "type": "string", + "description": "The name of the desired custom attribute key that can be used to access\nthe custom attribute value on catalog objects. Cannot be modified after the\ncustom attribute definition has been created.\nMust be between 1 and 60 characters, and may only contain the characters `[a-zA-Z0-9_-]`.", + "minLength": 1, + "maxLength": 60, + "pattern": "^[a-zA-Z0-9_-]*$", + "nullable": true + } + } + }, + "CatalogCustomAttributeDefinitionAppVisibility": { + "type": "string", + "enum": [ + "APP_VISIBILITY_HIDDEN", + "APP_VISIBILITY_READ_ONLY", + "APP_VISIBILITY_READ_WRITE_VALUES" + ], + "x-enum-elements": [ + { + "name": "APP_VISIBILITY_HIDDEN", + "description": "Other applications cannot read this custom attribute." + }, + { + "name": "APP_VISIBILITY_READ_ONLY", + "description": "Other applications can read this custom attribute definition and\nvalues." + }, + { + "name": "APP_VISIBILITY_READ_WRITE_VALUES", + "description": "Other applications can read and write custom attribute values on objects.\nThey can read but cannot edit the custom attribute definition." + } + ], + "description": "Defines the visibility of a custom attribute to applications other than their\ncreating application.", + "x-release-status": "PUBLIC" + }, + "CatalogCustomAttributeDefinitionNumberConfig": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "precision": { + "type": "integer", + "description": "An integer between 0 and 5 that represents the maximum number of\npositions allowed after the decimal in number custom attribute values\nFor example:\n\n- if the precision is 0, the quantity can be 1, 2, 3, etc.\n- if the precision is 1, the quantity can be 0.1, 0.2, etc.\n- if the precision is 2, the quantity can be 0.01, 0.12, etc.\n\nDefault: 5", + "maximum": 5, + "nullable": true + } + } + }, + "CatalogCustomAttributeDefinitionSelectionConfig": { + "type": "object", + "description": "Configuration associated with `SELECTION`-type custom attribute definitions.", + "x-release-status": "PUBLIC", + "properties": { + "max_allowed_selections": { + "type": "integer", + "description": "The maximum number of selections that can be set. The maximum value for this\nattribute is 100. The default value is 1. The value can be modified, but changing the value will not\naffect existing custom attribute values on objects. Clients need to\nhandle custom attributes with more selected values than allowed by this limit.", + "maximum": 100, + "nullable": true + }, + "allowed_selections": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection" + }, + "description": "The set of valid `CatalogCustomAttributeSelections`. Up to a maximum of 100\nselections can be defined. Can be modified.", + "nullable": true + } + } + }, + "CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection": { + "type": "object", + "description": "A named selection for this `SELECTION`-type custom attribute definition.", + "x-release-status": "PUBLIC", + "required": [ + "name" + ], + "properties": { + "uid": { + "type": "string", + "description": "Unique ID set by Square.", + "nullable": true + }, + "name": { + "type": "string", + "description": "Selection name, unique within `allowed_selections`.", + "minLength": 1, + "maxLength": 255 + } + } + }, + "CatalogCustomAttributeDefinitionSellerVisibility": { + "type": "string", + "enum": [ + "SELLER_VISIBILITY_HIDDEN", + "SELLER_VISIBILITY_READ_WRITE_VALUES" + ], + "x-enum-elements": [ + { + "name": "SELLER_VISIBILITY_HIDDEN", + "description": "Sellers cannot read this custom attribute in Square client\napplications or Square APIs." + }, + { + "name": "SELLER_VISIBILITY_READ_WRITE_VALUES", + "description": "Sellers can read and write this custom attribute value in catalog objects,\nbut cannot edit the custom attribute definition." + } + ], + "description": "Defines the visibility of a custom attribute to sellers in Square\nclient applications, Square APIs or in Square UIs (including Square Point\nof Sale applications and Square Dashboard).", + "x-release-status": "PUBLIC" + }, + "CatalogCustomAttributeDefinitionStringConfig": { + "type": "object", + "description": "Configuration associated with Custom Attribute Definitions of type `STRING`.", + "x-release-status": "PUBLIC", + "properties": { + "enforce_uniqueness": { + "type": "boolean", + "description": "If true, each Custom Attribute instance associated with this Custom Attribute\nDefinition must have a unique value within the seller's catalog. For\nexample, this may be used for a value like a SKU that should not be\nduplicated within a seller's catalog. May not be modified after the\ndefinition has been created.", + "nullable": true + } + } + }, + "CatalogCustomAttributeDefinitionType": { + "type": "string", + "enum": [ + "STRING", + "BOOLEAN", + "NUMBER", + "SELECTION" + ], + "x-enum-elements": [ + { + "name": "STRING", + "description": "A free-form string containing up to 255 characters." + }, + { + "name": "BOOLEAN", + "description": "A `true` or `false` value." + }, + { + "name": "NUMBER", + "description": "A decimal string representation of a number. Can support up to 5 digits after the decimal point." + }, + { + "name": "SELECTION", + "description": "One or more choices from `allowed_selections`." + } + ], + "description": "Defines the possible types for a custom attribute.", + "x-release-status": "PUBLIC" + }, + "CatalogCustomAttributeValue": { + "type": "object", + "description": "An instance of a custom attribute. Custom attributes can be defined and\nadded to `ITEM` and `ITEM_VARIATION` type catalog objects.\n[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes).", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The name of the custom attribute.", + "nullable": true + }, + "string_value": { + "type": "string", + "description": "The string value of the custom attribute. Populated if `type` = `STRING`.", + "nullable": true + }, + "custom_attribute_definition_id": { + "type": "string", + "description": "The id of the [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) this value belongs to.", + "readOnly": true + }, + "type": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionType", + "description": "A copy of type from the associated `CatalogCustomAttributeDefinition`.\nSee [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) for possible values", + "readOnly": true + }, + "number_value": { + "type": "string", + "description": "Populated if `type` = `NUMBER`. Contains a string\nrepresentation of a decimal number, using a `.` as the decimal separator.", + "nullable": true + }, + "boolean_value": { + "type": "boolean", + "description": "A `true` or `false` value. Populated if `type` = `BOOLEAN`.", + "nullable": true + }, + "selection_uid_values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`.", + "nullable": true + }, + "key": { + "type": "string", + "description": "If the associated `CatalogCustomAttributeDefinition` object is defined by another application, this key is prefixed by the defining application ID.\nFor example, if the CatalogCustomAttributeDefinition has a key attribute of \"cocoa_brand\" and the defining application ID is \"abcd1234\", this key is \"abcd1234:cocoa_brand\"\nwhen the application making the request is different from the application defining the custom attribute definition. Otherwise, the key is simply \"cocoa_brand\".", + "readOnly": true + } + } + }, + "CatalogDiscount": { + "type": "object", + "description": "A discount applicable to items.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The discount name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.", + "maxLength": 255, + "nullable": true + }, + "discount_type": { + "$ref": "#/components/schemas/CatalogDiscountType", + "description": "Indicates whether the discount is a fixed amount or percentage, or entered at the time of sale.\nSee [CatalogDiscountType](#type-catalogdiscounttype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the discount as a string representation of a decimal number, using a `.` as the decimal\nseparator and without a `%` sign. A value of `7.5` corresponds to `7.5%`. Specify a percentage of `0` if `discount_type`\nis `VARIABLE_PERCENTAGE`.\n\nDo not use this field for amount-based or variable discounts.", + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of the discount. Specify an amount of `0` if `discount_type` is `VARIABLE_AMOUNT`.\n\nDo not use this field for percentage-based or variable discounts.", + "nullable": true + }, + "pin_required": { + "type": "boolean", + "description": "Indicates whether a mobile staff member needs to enter their PIN to apply the\ndiscount to a payment in the Square Point of Sale app.", + "nullable": true + }, + "label_color": { + "type": "string", + "description": "The color of the discount display label in the Square Point of Sale app. This must be a valid hex color code.", + "nullable": true + }, + "modify_tax_basis": { + "$ref": "#/components/schemas/CatalogDiscountModifyTaxBasis", + "description": "Indicates whether this discount should reduce the price used to calculate tax.\n\nMost discounts should use `MODIFY_TAX_BASIS`. However, in some circumstances taxes must\nbe calculated based on an item's price, ignoring a particular discount. For example,\nin many US jurisdictions, a manufacturer coupon or instant rebate reduces the price a\ncustomer pays but does not reduce the sale price used to calculate how much sales tax is\ndue. In this case, the discount representing that manufacturer coupon should have\n`DO_NOT_MODIFY_TAX_BASIS` for this field.\n\nIf you are unsure whether you need to use this field, consult your tax professional.\nSee [CatalogDiscountModifyTaxBasis](#type-catalogdiscountmodifytaxbasis) for possible values", + "nullable": true + }, + "maximum_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "For a percentage discount, the maximum absolute value of the discount. For example, if a\n50% discount has a `maximum_amount_money` of $20, a $100 purchase will yield a $20 discount,\nnot a $50 discount.", + "nullable": true + } + }, + "example": { + "object": { + "discount_data": { + "discount_type": "FIXED_PERCENTAGE", + "label_color": "red", + "name": "Welcome to the Dark(Roast) Side!", + "percentage": "5.4", + "pin_required": false + }, + "id": "#Maythe4th", + "present_at_all_locations": true, + "type": "DISCOUNT" + } + } + }, + "CatalogDiscountModifyTaxBasis": { + "type": "string", + "enum": [ + "MODIFY_TAX_BASIS", + "DO_NOT_MODIFY_TAX_BASIS" + ], + "x-enum-elements": [ + { + "name": "MODIFY_TAX_BASIS", + "description": "Application of the discount will modify the tax basis." + }, + { + "name": "DO_NOT_MODIFY_TAX_BASIS", + "description": "Application of the discount will not modify the tax basis." + } + ], + "x-release-status": "PUBLIC" + }, + "CatalogDiscountType": { + "type": "string", + "enum": [ + "FIXED_PERCENTAGE", + "FIXED_AMOUNT", + "VARIABLE_PERCENTAGE", + "VARIABLE_AMOUNT" + ], + "x-enum-elements": [ + { + "name": "FIXED_PERCENTAGE", + "description": "Apply the discount as a fixed percentage (e.g., 5%) off the item price." + }, + { + "name": "FIXED_AMOUNT", + "description": "Apply the discount as a fixed amount (e.g., $1.00) off the item price." + }, + { + "name": "VARIABLE_PERCENTAGE", + "description": "Apply the discount as a variable percentage off the item price. The percentage will be specified at the time of sale." + }, + { + "name": "VARIABLE_AMOUNT", + "description": "Apply the discount as a variable amount off the item price. The amount will be specified at the time of sale." + } + ], + "description": "How to apply a CatalogDiscount to a CatalogItem.", + "x-release-status": "PUBLIC" + }, + "CatalogEcomSeoData": { + "type": "object", + "description": "SEO data for for a seller's Square Online store.", + "x-release-status": "PUBLIC", + "properties": { + "page_title": { + "type": "string", + "description": "The SEO title used for the Square Online store.", + "nullable": true + }, + "page_description": { + "type": "string", + "description": "The SEO description used for the Square Online store.", + "nullable": true + }, + "permalink": { + "type": "string", + "description": "The SEO permalink used for the Square Online store.", + "nullable": true + } + } + }, + "CatalogIdMapping": { + "type": "object", + "description": "A mapping between a temporary client-supplied ID and a permanent server-generated ID.\n\nWhen calling [UpsertCatalogObject](api-endpoint:Catalog-UpsertCatalogObject) or\n[BatchUpsertCatalogObjects](api-endpoint:Catalog-BatchUpsertCatalogObjects) to\ncreate a [CatalogObject](entity:CatalogObject) instance, you can supply\na temporary ID for the to-be-created object, especially when the object is to be referenced\nelsewhere in the same request body. This temporary ID can be any string unique within\nthe call, but must be prefixed by \"#\".\n\nAfter the request is submitted and the object created, a permanent server-generated ID is assigned\nto the new object. The permanent ID is unique across the Square catalog.", + "x-release-status": "PUBLIC", + "properties": { + "client_object_id": { + "type": "string", + "description": "The client-supplied temporary `#`-prefixed ID for a new `CatalogObject`.", + "nullable": true + }, + "object_id": { + "type": "string", + "description": "The permanent ID for the CatalogObject created by the server.", + "nullable": true + } + } + }, + "CatalogImage": { + "type": "object", + "description": "An image file to use in Square catalogs. It can be associated with\n`CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and `CatalogModifierList` objects.\nOnly the images on items and item variations are exposed in Dashboard.\nOnly the first image on an item is displayed in Square Point of Sale (SPOS).\nImages on items and variations are displayed through Square Online Store.\nImages on other object types are for use by 3rd party application developers.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The internal name to identify this image in calls to the Square API.\nThis is a searchable attribute for use in applicable query filters\nusing the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects).\nIt is not unique and should not be shown in a buyer facing context.", + "nullable": true + }, + "url": { + "type": "string", + "description": "The URL of this image, generated by Square after an image is uploaded\nusing the [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) endpoint.\nTo modify the image, use the UpdateCatalogImage endpoint. Do not change the URL field.", + "nullable": true + }, + "caption": { + "type": "string", + "description": "A caption that describes what is shown in the image. Displayed in the\nSquare Online Store. This is a searchable attribute for use in applicable query filters\nusing the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects).", + "nullable": true + }, + "photo_studio_order_id": { + "type": "string", + "description": "The immutable order ID for this image object created by the Photo Studio service in Square Online Store.", + "nullable": true + } + } + }, + "CatalogInfoResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "limits": { + "$ref": "#/components/schemas/CatalogInfoResponseLimits", + "description": "Limits that apply to this API." + }, + "standard_unit_description_group": { + "$ref": "#/components/schemas/StandardUnitDescriptionGroup", + "description": "Names and abbreviations for standard units." + } + }, + "example": { + "limits": { + "batch_delete_max_object_ids": 200, + "batch_retrieve_max_object_ids": 1000, + "batch_upsert_max_objects_per_batch": 1000, + "batch_upsert_max_total_objects": 10000, + "search_max_page_limit": 1000, + "update_item_modifier_lists_max_item_ids": 1000, + "update_item_modifier_lists_max_modifier_lists_to_disable": 1000, + "update_item_modifier_lists_max_modifier_lists_to_enable": 1000, + "update_item_taxes_max_item_ids": 1000, + "update_item_taxes_max_taxes_to_disable": 1000, + "update_item_taxes_max_taxes_to_enable": 1000 + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.csharp", + "java": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.java", + "javascript": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.javascript", + "php": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.php", + "python": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.python", + "ruby": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.ruby" + } + }, + "CatalogInfoResponseLimits": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "batch_upsert_max_objects_per_batch": { + "type": "integer", + "description": "The maximum number of objects that may appear within a single batch in a\n`/v2/catalog/batch-upsert` request.", + "nullable": true + }, + "batch_upsert_max_total_objects": { + "type": "integer", + "description": "The maximum number of objects that may appear across all batches in a\n`/v2/catalog/batch-upsert` request.", + "nullable": true + }, + "batch_retrieve_max_object_ids": { + "type": "integer", + "description": "The maximum number of object IDs that may appear in a `/v2/catalog/batch-retrieve`\nrequest.", + "nullable": true + }, + "search_max_page_limit": { + "type": "integer", + "description": "The maximum number of results that may be returned in a page of a\n`/v2/catalog/search` response.", + "nullable": true + }, + "batch_delete_max_object_ids": { + "type": "integer", + "description": "The maximum number of object IDs that may be included in a single\n`/v2/catalog/batch-delete` request.", + "nullable": true + }, + "update_item_taxes_max_item_ids": { + "type": "integer", + "description": "The maximum number of item IDs that may be included in a single\n`/v2/catalog/update-item-taxes` request.", + "nullable": true + }, + "update_item_taxes_max_taxes_to_enable": { + "type": "integer", + "description": "The maximum number of tax IDs to be enabled that may be included in a single\n`/v2/catalog/update-item-taxes` request.", + "nullable": true + }, + "update_item_taxes_max_taxes_to_disable": { + "type": "integer", + "description": "The maximum number of tax IDs to be disabled that may be included in a single\n`/v2/catalog/update-item-taxes` request.", + "nullable": true + }, + "update_item_modifier_lists_max_item_ids": { + "type": "integer", + "description": "The maximum number of item IDs that may be included in a single\n`/v2/catalog/update-item-modifier-lists` request.", + "nullable": true + }, + "update_item_modifier_lists_max_modifier_lists_to_enable": { + "type": "integer", + "description": "The maximum number of modifier list IDs to be enabled that may be included in\na single `/v2/catalog/update-item-modifier-lists` request.", + "nullable": true + }, + "update_item_modifier_lists_max_modifier_lists_to_disable": { + "type": "integer", + "description": "The maximum number of modifier list IDs to be disabled that may be included in\na single `/v2/catalog/update-item-modifier-lists` request.", + "nullable": true + } + } + }, + "CatalogItem": { + "type": "object", + "description": "A [CatalogObject](entity:CatalogObject) instance of the `ITEM` type, also referred to as an item, in the catalog.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The item's name. This is a searchable attribute for use in applicable query filters, its value must not be empty, and the length is of Unicode code points.", + "maxLength": 512, + "nullable": true + }, + "description": { + "type": "string", + "description": "The item's description. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.\n\nDeprecated at 2022-07-20, this field is planned to retire in 6 months. You should migrate to use `description_html` to set the description\nof the [CatalogItem](entity:CatalogItem) instance. The `description` and `description_html` field values are kept in sync. If you try to\nset the both fields, the `description_html` text value overwrites the `description` value. Updates in one field are also reflected in the other,\nexcept for when you use an early version before Square API 2022-07-20 and `description_html` is set to blank, setting the `description` value to null\ndoes not nullify `description_html`.", + "maxLength": 4096, + "x-release-status": "DEPRECATED", + "nullable": true + }, + "abbreviation": { + "type": "string", + "description": "The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used.\nThis attribute is searchable, and its value length is of Unicode code points.", + "maxLength": 24, + "nullable": true + }, + "label_color": { + "type": "string", + "description": "The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code.", + "nullable": true + }, + "is_taxable": { + "type": "boolean", + "description": "Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`.", + "nullable": true + }, + "category_id": { + "type": "string", + "description": "The ID of the item's category, if any. Deprecated since 2023-12-13. Use `CatalogItem.categories`, instead.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "tax_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A set of IDs indicating the taxes enabled for\nthis item. When updating an item, any taxes listed here will be added to the item.\nTaxes may also be added to or deleted from an item using `UpdateItemTaxes`.", + "nullable": true + }, + "modifier_list_info": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemModifierListInfo" + }, + "description": "A set of `CatalogItemModifierListInfo` objects\nrepresenting the modifier lists that apply to this item, along with the overrides and min\nand max limits that are specific to this item. Modifier lists\nmay also be added to or deleted from an item using `UpdateItemModifierLists`.", + "nullable": true + }, + "variations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must have\nat least one variation.", + "nullable": true + }, + "product_type": { + "$ref": "#/components/schemas/CatalogItemProductType", + "description": "The product type of the item. Once set, the `product_type` value cannot be modified.\n\nItems of the `LEGACY_SQUARE_ONLINE_SERVICE` and `LEGACY_SQUARE_ONLINE_MEMBERSHIP` product types can be updated\nbut cannot be created using the API.\nSee [CatalogItemProductType](#type-catalogitemproducttype) for possible values", + "nullable": true + }, + "skip_modifier_screen": { + "type": "boolean", + "description": "If `false`, the Square Point of Sale app will present the `CatalogItem`'s\ndetails screen immediately, allowing the merchant to choose `CatalogModifier`s\nbefore adding the item to the cart. This is the default behavior.\n\nIf `true`, the Square Point of Sale app will immediately add the item to the cart with the pre-selected\nmodifiers, and merchants can edit modifiers by drilling down onto the item's details.\n\nThird-party clients are encouraged to implement similar behaviors.", + "nullable": true + }, + "item_options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemOptionForItem" + }, + "description": "List of item options IDs for this item. Used to manage and group item\nvariations in a specified order.\n\nMaximum: 6 item options.", + "nullable": true + }, + "ecom_uri": { + "type": "string", + "description": "Deprecated. A URI pointing to a published e-commerce product page for the Item.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "ecom_image_uris": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Deprecated. A comma-separated list of encoded URIs pointing to a set of published e-commerce images for the Item.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "image_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of images associated with this `CatalogItem` instance.\nThese images will be shown to customers in Square Online Store.\nThe first image will show up as the icon for this item in POS.", + "x-release-status": "BETA", + "nullable": true + }, + "sort_name": { + "type": "string", + "description": "A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, the regular `name` field is used for sorting.\nIts value must not be empty.\n\nIt is currently supported for sellers of the Japanese locale only.", + "x-release-status": "BETA", + "nullable": true + }, + "categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObjectCategory" + }, + "description": "The list of categories.", + "nullable": true + }, + "description_html": { + "type": "string", + "description": "The item's description as expressed in valid HTML elements. The length of this field value, including those of HTML tags,\nis of Unicode points. With application query filters, the text values of the HTML elements and attributes are searchable. Invalid or\nunsupported HTML elements or attributes are ignored.\n\nSupported HTML elements include:\n- `a`: Link. Supports linking to website URLs, email address, and telephone numbers.\n- `b`, `strong`: Bold text\n- `br`: Line break\n- `code`: Computer code\n- `div`: Section\n- `h1-h6`: Headings\n- `i`, `em`: Italics\n- `li`: List element\n- `ol`: Numbered list\n- `p`: Paragraph\n- `ul`: Bullet list\n- `u`: Underline\n\n\nSupported HTML attributes include:\n- `align`: Alignment of the text content\n- `href`: Link destination\n- `rel`: Relationship between link's target and source\n- `target`: Place to open the linked document", + "maxLength": 65535, + "nullable": true + }, + "description_plaintext": { + "type": "string", + "description": "A server-generated plaintext version of the `description_html` field, without formatting tags.", + "maxLength": 65535, + "readOnly": true + }, + "channels": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of IDs representing channels, such as a Square Online site, where the item can be made visible or available.\nThis field is read only and cannot be edited.", + "nullable": true + }, + "is_archived": { + "type": "boolean", + "description": "Indicates whether this item is archived (`true`) or not (`false`).", + "nullable": true + }, + "ecom_seo_data": { + "$ref": "#/components/schemas/CatalogEcomSeoData", + "description": "The SEO data for a seller's Square Online store.", + "nullable": true + }, + "food_and_beverage_details": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetails", + "description": "The food and beverage-specific details for the `FOOD_AND_BEV` item.", + "nullable": true + }, + "reporting_category": { + "$ref": "#/components/schemas/CatalogObjectCategory", + "description": "The item's reporting category.", + "nullable": true + }, + "is_alcoholic": { + "type": "boolean", + "description": "Indicates whether this item is alcoholic (`true`) or not (`false`).", + "nullable": true + } + }, + "example": { + "object": { + "id": "#Cocoa", + "item_data": { + "abbreviation": "Ch", + "description": "Hot chocolate", + "name": "Cocoa", + "visibility": "PRIVATE" + }, + "present_at_all_locations": true, + "type": "ITEM" + } + } + }, + "CatalogItemFoodAndBeverageDetails": { + "type": "object", + "description": "The food and beverage-specific details of a `FOOD_AND_BEV` item.", + "x-release-status": "PUBLIC", + "properties": { + "calorie_count": { + "type": "integer", + "description": "The calorie count (in the unit of kcal) for the `FOOD_AND_BEV` type of items.", + "nullable": true + }, + "dietary_preferences": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsDietaryPreference" + }, + "description": "The dietary preferences for the `FOOD_AND_BEV` item.", + "nullable": true + }, + "ingredients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsIngredient" + }, + "description": "The ingredients for the `FOOD_AND_BEV` type item.", + "nullable": true + } + } + }, + "CatalogItemFoodAndBeverageDetailsDietaryPreference": { + "type": "object", + "description": "Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its ingredients.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType", + "description": "The dietary preference type. Supported values include `STANDARD` and `CUSTOM` as specified in `FoodAndBeverageDetails.DietaryPreferenceType`.\nSee [DietaryPreferenceType](#type-dietarypreferencetype) for possible values", + "nullable": true + }, + "standard_name": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference", + "description": "The name of the dietary preference from a standard pre-defined list. This should be null if it's a custom dietary preference.\nSee [StandardDietaryPreference](#type-standarddietarypreference) for possible values", + "nullable": true + }, + "custom_name": { + "type": "string", + "description": "The name of a user-defined custom dietary preference. This should be null if it's a standard dietary preference.", + "nullable": true + } + } + }, + "CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference": { + "type": "string", + "enum": [ + "DAIRY_FREE", + "GLUTEN_FREE", + "HALAL", + "KOSHER", + "NUT_FREE", + "VEGAN", + "VEGETARIAN" + ], + "x-enum-elements": [ + { + "name": "DAIRY_FREE", + "description": "" + }, + { + "name": "GLUTEN_FREE", + "description": "" + }, + { + "name": "HALAL", + "description": "" + }, + { + "name": "KOSHER", + "description": "" + }, + { + "name": "NUT_FREE", + "description": "" + }, + { + "name": "VEGAN", + "description": "" + }, + { + "name": "VEGETARIAN", + "description": "" + } + ], + "description": "Standard dietary preferences for food and beverage items that are recommended on item creation.", + "x-release-status": "PUBLIC" + }, + "CatalogItemFoodAndBeverageDetailsDietaryPreferenceType": { + "type": "string", + "enum": [ + "STANDARD", + "CUSTOM" + ], + "x-enum-elements": [ + { + "name": "STANDARD", + "description": "A standard value from a pre-determined list." + }, + { + "name": "CUSTOM", + "description": "A user-defined custom value." + } + ], + "description": "The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients.", + "x-release-status": "PUBLIC" + }, + "CatalogItemFoodAndBeverageDetailsIngredient": { + "type": "object", + "description": "Describes the ingredient used in a `FOOD_AND_BEV` item.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType", + "description": "The dietary preference type of the ingredient. Supported values include `STANDARD` and `CUSTOM` as specified in `FoodAndBeverageDetails.DietaryPreferenceType`.\nSee [DietaryPreferenceType](#type-dietarypreferencetype) for possible values", + "nullable": true + }, + "standard_name": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient", + "description": "The name of the ingredient from a standard pre-defined list. This should be null if it's a custom dietary preference.\nSee [StandardIngredient](#type-standardingredient) for possible values", + "nullable": true + }, + "custom_name": { + "type": "string", + "description": "The name of a custom user-defined ingredient. This should be null if it's a standard dietary preference.", + "nullable": true + } + } + }, + "CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient": { + "type": "string", + "enum": [ + "CELERY", + "CRUSTACEANS", + "EGGS", + "FISH", + "GLUTEN", + "LUPIN", + "MILK", + "MOLLUSCS", + "MUSTARD", + "PEANUTS", + "SESAME", + "SOY", + "SULPHITES", + "TREE_NUTS" + ], + "x-enum-elements": [ + { + "name": "CELERY", + "description": "" + }, + { + "name": "CRUSTACEANS", + "description": "" + }, + { + "name": "EGGS", + "description": "" + }, + { + "name": "FISH", + "description": "" + }, + { + "name": "GLUTEN", + "description": "" + }, + { + "name": "LUPIN", + "description": "" + }, + { + "name": "MILK", + "description": "" + }, + { + "name": "MOLLUSCS", + "description": "" + }, + { + "name": "MUSTARD", + "description": "" + }, + { + "name": "PEANUTS", + "description": "" + }, + { + "name": "SESAME", + "description": "" + }, + { + "name": "SOY", + "description": "" + }, + { + "name": "SULPHITES", + "description": "" + }, + { + "name": "TREE_NUTS", + "description": "" + } + ], + "description": "Standard ingredients for food and beverage items that are recommended on item creation.", + "x-release-status": "PUBLIC" + }, + "CatalogItemModifierListInfo": { + "type": "object", + "description": "Controls how a modifier list is applied to a specific item. This object allows for item-specific customization of modifier list behavior\nand provides the ability to override global modifier list settings.", + "x-release-status": "PUBLIC", + "required": [ + "modifier_list_id" + ], + "properties": { + "modifier_list_id": { + "type": "string", + "description": "The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`.", + "minLength": 1 + }, + "modifier_overrides": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogModifierOverride" + }, + "description": "A set of `CatalogModifierOverride` objects that override default modifier settings for this item.", + "nullable": true + }, + "min_selected_modifiers": { + "type": "integer", + "description": "The minimum number of modifiers that must be selected from this modifier list.\nValues:\n\n- 0: No selection is required.\n- -1: Default value, the attribute was not set by the client. When `max_selected_modifiers` is\nalso -1, use the minimum and maximum selection values set on the `CatalogItemModifierList`.\n- \u0026gt;0: The required minimum modifier selections. This can be larger than the total `CatalogModifiers` when `allow_quantities` is enabled.\n- \u0026lt; -1: Invalid. Treated as no selection required.", + "nullable": true + }, + "max_selected_modifiers": { + "type": "integer", + "description": "The maximum number of modifiers that can be selected.\nValues:\n\n- 0: No maximum limit.\n- -1: Default value, the attribute was not set by the client. When `min_selected_modifiers` is\nalso -1, use the minimum and maximum selection values set on the `CatalogItemModifierList`.\n- \u0026gt;0: The maximum total modifier selections. This can be larger than the total `CatalogModifiers` when `allow_quantities` is enabled.\n- \u0026lt; -1: Invalid. Treated as no maximum limit.", + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "If `true`, enable this `CatalogModifierList`. The default value is `true`.", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list applied \nto a `CatalogItem` instance.", + "x-release-status": "BETA", + "nullable": true + }, + "allow_quantities": { + "$ref": "#/components/schemas/CatalogModifierToggleOverrideType", + "description": "Controls whether multiple quantities of the same modifier can be selected for this item.\n- `YES` means that every modifier in the `CatalogModifierList` can have multiple quantities\nselected for this item.\n- `NO` means that each modifier in the `CatalogModifierList` can be selected only once for this item.\n- `NOT_SET` means that the `allow_quantities` setting on the `CatalogModifierList` is obeyed.\nSee [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "is_conversational": { + "$ref": "#/components/schemas/CatalogModifierToggleOverrideType", + "description": "Controls whether conversational mode is enabled for modifiers on this item.\n\n- `YES` means conversational mode is enabled for every modifier in the `CatalogModifierList`.\n- `NO` means that conversational mode is not enabled for any modifier in the `CatalogModifierList`.\n- `NOT_SET` means that conversational mode is not enabled for any modifier in the `CatalogModifierList`.\nSee [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "hidden_from_customer_override": { + "$ref": "#/components/schemas/CatalogModifierToggleOverrideType", + "description": "Controls whether all modifiers for this item are hidden from customer receipts.\n- `YES` means that all modifiers in the `CatalogModifierList` are hidden from customer\nreceipts for this item.\n- `NO` means that all modifiers in the `CatalogModifierList` are visible on customer receipts for this item.\n- `NOT_SET` means that the `hidden_from_customer` setting on the `CatalogModifierList` is obeyed.\nSee [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "CatalogItemOption": { + "type": "object", + "description": "A group of variations for a `CatalogItem`.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The item option's display name for the seller. Must be unique across\nall item options. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "display_name": { + "type": "string", + "description": "The item option's display name for the customer. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "description": { + "type": "string", + "description": "The item option's human-readable description. Displayed in the Square\nPoint of Sale app for the seller and in the Online Store or on receipts for\nthe buyer. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "show_colors": { + "type": "boolean", + "description": "If true, display colors for entries in `values` when present.", + "nullable": true + }, + "values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of CatalogObjects containing the\n`CatalogItemOptionValue`s for this item.", + "nullable": true + } + } + }, + "CatalogItemOptionForItem": { + "type": "object", + "description": " An option that can be assigned to an item.\nFor example, a t-shirt item may offer a color option or a size option.", + "x-release-status": "BETA", + "properties": { + "item_option_id": { + "type": "string", + "description": "The unique id of the item option, used to form the dimensions of the item option matrix in a specified order.", + "nullable": true + } + } + }, + "CatalogItemOptionValue": { + "type": "object", + "description": "An enumerated value that can link a\n`CatalogItemVariation` to an item option as one of\nits item option values.", + "x-release-status": "PUBLIC", + "properties": { + "item_option_id": { + "type": "string", + "description": "Unique ID of the associated item option.", + "nullable": true + }, + "name": { + "type": "string", + "description": "Name of this item option value. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "description": { + "type": "string", + "description": "A human-readable description for the option value. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "color": { + "type": "string", + "description": "The HTML-supported hex color for the item option (e.g., \"#ff8d4e85\").\nOnly displayed if `show_colors` is enabled on the parent `ItemOption`. When\nleft unset, `color` defaults to white (\"#ffffff\") when `show_colors` is\nenabled on the parent `ItemOption`.", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "Determines where this option value appears in a list of option values.", + "nullable": true + } + } + }, + "CatalogItemOptionValueForItemVariation": { + "type": "object", + "description": "A `CatalogItemOptionValue` links an item variation to an item option as\nan item option value. For example, a t-shirt item may offer a color option and\na size option. An item option value would represent each variation of t-shirt:\nFor example, \"Color:Red, Size:Small\" or \"Color:Blue, Size:Medium\".", + "x-release-status": "PUBLIC", + "properties": { + "item_option_id": { + "type": "string", + "description": "The unique id of an item option.", + "nullable": true + }, + "item_option_value_id": { + "type": "string", + "description": "The unique id of the selected value for the item option.", + "nullable": true + } + } + }, + "CatalogItemProductType": { + "type": "string", + "enum": [ + "REGULAR", + "GIFT_CARD", + "APPOINTMENTS_SERVICE", + "FOOD_AND_BEV", + "EVENT", + "DIGITAL", + "DONATION", + "LEGACY_SQUARE_ONLINE_SERVICE", + "LEGACY_SQUARE_ONLINE_MEMBERSHIP" + ], + "x-enum-elements": [ + { + "name": "REGULAR", + "description": "An ordinary item." + }, + { + "name": "GIFT_CARD", + "description": "A Square gift card." + }, + { + "name": "APPOINTMENTS_SERVICE", + "description": "A service that can be booked using the Square Appointments app." + }, + { + "name": "FOOD_AND_BEV", + "description": "A food or beverage item that can be sold by restaurants and other food venues." + }, + { + "name": "EVENT", + "description": "An event which tickets can be sold for, including location, address, and times." + }, + { + "name": "DIGITAL", + "description": "A digital item like an ebook or song." + }, + { + "name": "DONATION", + "description": "A donation which site visitors can send for any cause." + }, + { + "name": "LEGACY_SQUARE_ONLINE_SERVICE", + "description": "A legacy Square Online service that is manually fulfilled. This corresponds to the `Other` item type displayed in the Square Seller Dashboard and Square POS apps." + }, + { + "name": "LEGACY_SQUARE_ONLINE_MEMBERSHIP", + "description": "A legacy Square Online membership that is manually fulfilled. This corresponds to the `Membership` item type displayed in the Square Seller Dashboard and Square POS apps." + } + ], + "description": "The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items.", + "x-release-status": "PUBLIC" + }, + "CatalogItemVariation": { + "type": "object", + "description": "An item variation, representing a product for sale, in the Catalog object model. Each [item](entity:CatalogItem) must have at least one\nitem variation and can have at most 250 item variations.\n\nAn item variation can be sellable, stockable, or both if it has a unit of measure for its count for the sold number of the variation, the stocked\nnumber of the variation, or both. For example, when a variation representing wine is stocked and sold by the bottle, the variation is both\nstockable and sellable. But when a variation of the wine is sold by the glass, the sold units cannot be used as a measure of the stocked units. This by-the-glass\nvariation is sellable, but not stockable. To accurately keep track of the wine's inventory count at any time, the sellable count must be\nconverted to stockable count. Typically, the seller defines this unit conversion. For example, 1 bottle equals 5 glasses. The Square API exposes\nthe `stockable_conversion` property on the variation to specify the conversion. Thus, when two glasses of the wine are sold, the sellable count\ndecreases by 2, and the stockable count automatically decreases by 0.4 bottle according to the conversion.", + "x-release-status": "PUBLIC", + "properties": { + "item_id": { + "type": "string", + "description": "The ID of the `CatalogItem` associated with this item variation.", + "nullable": true + }, + "name": { + "type": "string", + "description": "The item variation's name. This is a searchable attribute for use in applicable query filters.\n\nIts value has a maximum length of 255 Unicode code points. However, when the parent [item](entity:CatalogItem)\nuses [item options](entity:CatalogItemOption), this attribute is auto-generated, read-only, and can be\nlonger than 255 Unicode code points.", + "nullable": true + }, + "sku": { + "type": "string", + "description": "The item variation's SKU, if any. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "upc": { + "type": "string", + "description": "The universal product code (UPC) of the item variation, if any. This is a searchable attribute for use in applicable query filters.\n\nThe value of this attribute should be a number of 12-14 digits long. This restriction is enforced on the Square Seller Dashboard,\nSquare Point of Sale or Retail Point of Sale apps, where this attribute shows in the GTIN field. If a non-compliant UPC value is assigned\nto this attribute using the API, the value is not editable on the Seller Dashboard, Square Point of Sale or Retail Point of Sale apps\nunless it is updated to fit the expected format.", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The order in which this item variation should be displayed. This value is read-only. On writes, the ordinal\nfor each item variation within a parent `CatalogItem` is set according to the item variations's\nposition. On reads, the value is not guaranteed to be sequential or unique.", + "readOnly": true + }, + "pricing_type": { + "$ref": "#/components/schemas/CatalogPricingType", + "description": "Indicates whether the item variation's price is fixed or determined at the time\nof sale.\nSee [CatalogPricingType](#type-catalogpricingtype) for possible values", + "nullable": true + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The item variation's price, if fixed pricing is used.", + "nullable": true + }, + "location_overrides": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemVariationLocationOverrides" + }, + "description": "Per-location price and inventory overrides.", + "nullable": true + }, + "track_inventory": { + "type": "boolean", + "description": "If `true`, inventory tracking is active for the variation.", + "nullable": true + }, + "inventory_alert_type": { + "$ref": "#/components/schemas/InventoryAlertType", + "description": "Indicates whether the item variation displays an alert when its inventory quantity is less than or equal\nto its `inventory_alert_threshold`.\nSee [InventoryAlertType](#type-inventoryalerttype) for possible values", + "nullable": true + }, + "inventory_alert_threshold": { + "type": "integer", + "description": "If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type`\nis `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard.\n\nThis value is always an integer.", + "format": "int64", + "nullable": true + }, + "user_data": { + "type": "string", + "description": "Arbitrary user metadata to associate with the item variation. This attribute value length is of Unicode code points.", + "maxLength": 255, + "nullable": true + }, + "service_duration": { + "type": "integer", + "description": "If the `CatalogItem` that owns this item variation is of type\n`APPOINTMENTS_SERVICE`, then this is the duration of the service in milliseconds. For\nexample, a 30 minute appointment would have the value `1800000`, which is equal to\n30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per second).", + "format": "int64", + "nullable": true + }, + "available_for_booking": { + "type": "boolean", + "description": "If the `CatalogItem` that owns this item variation is of type\n`APPOINTMENTS_SERVICE`, a bool representing whether this service is available for booking.", + "x-release-status": "BETA", + "nullable": true + }, + "item_option_values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemOptionValueForItemVariation" + }, + "description": "List of item option values associated with this item variation. Listed\nin the same order as the item options of the parent item.", + "nullable": true + }, + "measurement_unit_id": { + "type": "string", + "description": "ID of the ‘CatalogMeasurementUnit’ that is used to measure the quantity\nsold of this item variation. If left unset, the item will be sold in\nwhole quantities.", + "nullable": true + }, + "sellable": { + "type": "boolean", + "description": "Whether this variation can be sold. The inventory count of a sellable variation indicates\nthe number of units available for sale. When a variation is both stockable and sellable,\nits sellable inventory count can be smaller than or equal to its stockable count.", + "x-release-status": "BETA", + "nullable": true + }, + "stockable": { + "type": "boolean", + "description": "Whether stock is counted directly on this variation (TRUE) or only on its components (FALSE).\nWhen a variation is both stockable and sellable, the inventory count of a stockable variation keeps track of the number of units of this variation in stock\nand is not an indicator of the number of units of the variation that can be sold.", + "x-release-status": "BETA", + "nullable": true + }, + "image_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of images associated with this `CatalogItemVariation` instance.\nThese images will be shown to customers in Square Online Store.", + "nullable": true + }, + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tokens of employees that can perform the service represented by this variation. Only valid for\nvariations of type `APPOINTMENTS_SERVICE`.", + "x-release-status": "BETA", + "nullable": true + }, + "stockable_conversion": { + "$ref": "#/components/schemas/CatalogStockConversion", + "description": "The unit conversion rule, as prescribed by the [CatalogStockConversion](entity:CatalogStockConversion) type,\nthat describes how this non-stockable (i.e., sellable/receivable) item variation is converted\nto/from the stockable item variation sharing the same parent item. With the stock conversion,\nyou can accurately track inventory when an item variation is sold in one unit, but stocked in\nanother unit.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "CatalogMeasurementUnit": { + "type": "object", + "description": "Represents the unit used to measure a `CatalogItemVariation` and\nspecifies the precision for decimal quantities.", + "x-release-status": "PUBLIC", + "properties": { + "measurement_unit": { + "$ref": "#/components/schemas/MeasurementUnit", + "description": "Indicates the unit used to measure the quantity of a catalog item variation.", + "nullable": true + }, + "precision": { + "type": "integer", + "description": "An integer between 0 and 5 that represents the maximum number of\npositions allowed after the decimal in quantities measured with this unit.\nFor example:\n\n- if the precision is 0, the quantity can be 1, 2, 3, etc.\n- if the precision is 1, the quantity can be 0.1, 0.2, etc.\n- if the precision is 2, the quantity can be 0.01, 0.12, etc.\n\nDefault: 3", + "nullable": true + } + } + }, + "CatalogModifier": { + "type": "object", + "description": "A modifier that can be applied to items at the time of sale. For example, a cheese modifier for a burger, or a flavor modifier for a serving of ice cream.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The modifier name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.", + "maxLength": 255, + "nullable": true + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The modifier price.", + "nullable": true + }, + "on_by_default": { + "type": "boolean", + "description": "When `true`, this modifier is selected by default when displaying the modifier list.\nThis setting can be overridden at the item level using `CatalogModifierListInfo.modifier_overrides`.", + "x-release-status": "BETA", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "Determines where this `CatalogModifier` appears in the `CatalogModifierList`.", + "nullable": true + }, + "modifier_list_id": { + "type": "string", + "description": "The ID of the `CatalogModifierList` associated with this modifier.", + "nullable": true + }, + "location_overrides": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModifierLocationOverrides" + }, + "description": "Location-specific price overrides.", + "nullable": true + }, + "image_id": { + "type": "string", + "description": "The ID of the image associated with this `CatalogModifier` instance.\nCurrently this image is not displayed by Square, but is free to be displayed in 3rd party applications.", + "x-release-status": "BETA", + "nullable": true + }, + "hidden_online": { + "type": "boolean", + "description": "When `true`, this modifier is hidden from online ordering channels. This setting can be overridden at the item level using `CatalogModifierListInfo.modifier_overrides`.", + "x-release-status": "BETA", + "nullable": true + } + }, + "example": { + "object": { + "modifier_data": { + "name": "Almond Milk", + "price_money": { + "amount": 250, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + } + } + }, + "CatalogModifierList": { + "type": "object", + "description": "A container for a list of modifiers, or a text-based modifier.\nFor text-based modifiers, this represents text configuration for an item. (For example, custom text to print on a t-shirt).\nFor non text-based modifiers, this represents a list of modifiers that can be applied to items at the time of sale.\n(For example, a list of condiments for a hot dog, or a list of ice cream flavors).\nEach element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The name of the `CatalogModifierList` instance. This is a searchable attribute for use in applicable query filters, and its value length is of \nUnicode code points.", + "maxLength": 255, + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances.", + "nullable": true + }, + "selection_type": { + "$ref": "#/components/schemas/CatalogModifierListSelectionType", + "description": "__Deprecated__: Indicates whether a single (`SINGLE`) modifier or multiple (`MULTIPLE`) modifiers can be selected. Use\n`min_selected_modifiers` and `max_selected_modifiers` instead.\nSee [CatalogModifierListSelectionType](#type-catalogmodifierlistselectiontype) for possible values", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "modifiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`, \nfor non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of this list \nis a `CatalogObject` instance of the `MODIFIER` type, containing the following attributes:\n```\n{\n\"id\": \"{{catalog_modifier_id}}\",\n\"type\": \"MODIFIER\", \n\"modifier_data\": {{a CatalogModifier instance\u003e}} \n}\n```", + "nullable": true + }, + "image_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of images associated with this `CatalogModifierList` instance.\nCurrently these images are not displayed on Square products, but may be displayed in 3rd-party applications.", + "nullable": true + }, + "allow_quantities": { + "type": "boolean", + "description": "When `true`, allows multiple quantities of the same modifier to be selected.", + "x-release-status": "BETA", + "nullable": true + }, + "is_conversational": { + "type": "boolean", + "description": "True if modifiers belonging to this list can be used conversationally.", + "x-release-status": "BETA", + "nullable": true + }, + "modifier_type": { + "$ref": "#/components/schemas/CatalogModifierListModifierType", + "description": "The type of the modifier. \n\nWhen this `modifier_type` value is `TEXT`, the `CatalogModifierList` represents a text-based modifier. \nWhen this `modifier_type` value is `LIST`, the `CatalogModifierList` contains a list of `CatalogModifier` objects.\nSee [CatalogModifierListModifierType](#type-catalogmodifierlistmodifiertype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "max_length": { + "type": "integer", + "description": "The maximum length, in Unicode points, of the text string of the text-based modifier as represented by \nthis `CatalogModifierList` object with the `modifier_type` set to `TEXT`.", + "x-release-status": "BETA", + "nullable": true + }, + "text_required": { + "type": "boolean", + "description": "Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based modifier\nas represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`.", + "x-release-status": "BETA", + "nullable": true + }, + "internal_name": { + "type": "string", + "description": "A note for internal use by the business. \n\nFor example, for a text-based modifier applied to a T-shirt item, if the buyer-supplied text of \"Hello, Kitty!\" \nis to be printed on the T-shirt, this `internal_name` attribute can be \"Use italic face\" as \nan instruction for the business to follow. \n\nFor non text-based modifiers, this `internal_name` attribute can be \nused to include SKUs, internal codes, or supplemental descriptions for internal use.", + "maxLength": 512, + "x-release-status": "BETA", + "nullable": true + }, + "min_selected_modifiers": { + "type": "integer", + "description": "The minimum number of modifiers that must be selected from this list. The value can be overridden with `CatalogItemModifierListInfo`.\n\nValues:\n\n- 0: No selection is required.\n- -1: Default value, the attribute was not set by the client. Treated as no selection required.\n- \u0026gt;0: The required minimum modifier selections. This can be larger than the total `CatalogModifiers` when `allow_quantities` is enabled.\n- \u0026lt; -1: Invalid. Treated as no selection required.", + "format": "int64", + "x-release-status": "BETA", + "nullable": true + }, + "max_selected_modifiers": { + "type": "integer", + "description": "The maximum number of modifiers that must be selected from this list. The value can be overridden with `CatalogItemModifierListInfo`.\n\nValues:\n\n- 0: No maximum limit.\n- -1: Default value, the attribute was not set by the client. Treated as no maximum limit.\n- \u0026gt;0: The maximum total modifier selections. This can be larger than the total `CatalogModifiers` when `allow_quantities` is enabled.\n- \u0026lt; -1: Invalid. Treated as no maximum limit.", + "format": "int64", + "x-release-status": "BETA", + "nullable": true + }, + "hidden_from_customer": { + "type": "boolean", + "description": "If `true`, modifiers from this list are hidden from customer receipts. The default value is `false`.\nThis setting can be overridden with `CatalogItemModifierListInfo.hidden_from_customer_override`.", + "x-release-status": "BETA", + "nullable": true + } + }, + "example": { + "id": "#MilkType", + "modifier_list_data": { + "allow_quantities": false, + "modifiers": [ + { + "modifier_data": { + "name": "Whole Milk", + "price_money": { + "amount": 0, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + }, + { + "modifier_data": { + "name": "Almond Milk", + "price_money": { + "amount": 250, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + }, + { + "modifier_data": { + "name": "Soy Milk", + "price_money": { + "amount": 250, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + } + ], + "name": "Milk Type", + "selection_type": "SINGLE" + }, + "present_at_all_locations": true, + "type": "MODIFIER_LIST" + } + }, + "CatalogModifierListModifierType": { + "type": "string", + "enum": [ + "LIST", + "TEXT" + ], + "x-enum-elements": [ + { + "name": "LIST", + "description": "The `CatalogModifierList` instance is a non-empty list of non text-based modifiers." + }, + { + "name": "TEXT", + "description": "The `CatalogModifierList` instance is a single text-based modifier." + } + ], + "description": "Defines the type of `CatalogModifierList`.", + "x-release-status": "BETA" + }, + "CatalogModifierListSelectionType": { + "type": "string", + "enum": [ + "SINGLE", + "MULTIPLE" + ], + "x-enum-elements": [ + { + "name": "SINGLE", + "description": "Indicates that a CatalogModifierList allows only a\nsingle CatalogModifier to be selected." + }, + { + "name": "MULTIPLE", + "description": "Indicates that a CatalogModifierList allows multiple\nCatalogModifier to be selected." + } + ], + "description": "Indicates whether a CatalogModifierList supports multiple selections.", + "x-release-status": "PUBLIC" + }, + "CatalogModifierOverride": { + "type": "object", + "description": "Options to control how to override the default behavior of the specified modifier.", + "x-release-status": "PUBLIC", + "required": [ + "modifier_id" + ], + "properties": { + "modifier_id": { + "type": "string", + "description": "The ID of the `CatalogModifier` whose default behavior is being overridden.", + "minLength": 1 + }, + "on_by_default": { + "type": "boolean", + "description": "__Deprecated__: Use `on_by_default_override` instead.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "hidden_online_override": { + "$ref": "#/components/schemas/CatalogModifierToggleOverrideType", + "description": "If `YES`, this setting overrides the `hidden_online` setting on the `CatalogModifier` object,\nand the modifier is always hidden from online sales channels.\nIf `NO`, the modifier is not hidden. It is always visible in online sales channels for this catalog item.\n`NOT_SET` means the `hidden_online` setting on the `CatalogModifier` object is obeyed.\nSee [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "on_by_default_override": { + "$ref": "#/components/schemas/CatalogModifierToggleOverrideType", + "description": "If `YES`, this setting overrides the `on_by_default` setting on the `CatalogModifier` object,\nand the modifier is always selected by default for the catalog item.\n\nIf `NO`, the modifier is not selected by default for this catalog item.\n`NOT_SET` means the `on_by_default` setting on the `CatalogModifier` object is obeyed.\nSee [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "CatalogObject": { + "type": "object", + "description": "The wrapper object for the catalog entries of a given object type.\n\nDepending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object.\n\nFor example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance.\n\nIn general, if `type=\u003cOBJECT_TYPE\u003e`, the `CatalogObject` instance must have the `\u003cOBJECT_TYPE\u003e`-specific data set on the `\u003cobject_type\u003e_data` attribute. The resulting `CatalogObject` instance is also a `Catalog\u003cObjectType\u003e` instance.\n\nFor a more detailed discussion of the Catalog data model, please see the\n[Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide.", + "x-release-status": "PUBLIC", + "required": [ + "type", + "id" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/CatalogObjectType", + "description": "The type of this object. Each object type has expected\nproperties expressed in a structured format within its corresponding `*_data` field below.\nSee [CatalogObjectType](#type-catalogobjecttype) for possible values" + }, + "id": { + "type": "string", + "description": "An identifier to reference this object in the catalog. When a new `CatalogObject`\nis inserted, the client should set the id to a temporary identifier starting with\na \"`#`\" character. Other objects being inserted or updated within the same request\nmay use this identifier to refer to the new object.\n\nWhen the server receives the new object, it will supply a unique identifier that\nreplaces the temporary identifier for all future references.", + "minLength": 1 + }, + "updated_at": { + "type": "string", + "description": "Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `\"2016-08-15T23:59:33.123Z\"`\nwould indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds.", + "readOnly": true + }, + "version": { + "type": "integer", + "description": "The version of the object. When updating an object, the version supplied\nmust match the version in the database, otherwise the write will be rejected as conflicting.", + "format": "int64" + }, + "is_deleted": { + "type": "boolean", + "description": "If `true`, the object has been deleted from the database. Must be `false` for new objects\nbeing inserted. When deleted, the `updated_at` field will equal the deletion time.", + "nullable": true + }, + "custom_attribute_values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/CatalogCustomAttributeValue" + }, + "description": "A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair\nis a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute\nvalue defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition)\nobject defined by the application making the request.\n\nIf the `CatalogCustomAttributeDefinition` object is\ndefined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by\nthe defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of\n`\"cocoa_brand\"` and the defining application ID is `\"abcd1234\"`, the key in the map is `\"abcd1234:cocoa_brand\"`\nif the application making the request is different from the application defining the custom attribute definition.\nOtherwise, the key used in the map is simply `\"cocoa_brand\"`.\n\nApplication-defined custom attributes are set at a global (location-independent) level.\nCustom attribute values are intended to store additional information about a catalog object\nor associations with an entity in another system. Do not use custom attributes\nto store any sensitive information (personally identifiable information, card details, etc.).", + "nullable": true + }, + "catalog_v1_ids": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogV1Id" + }, + "description": "The Connect v1 IDs for this object at each location where it is present, where they\ndiffer from the object's Connect V2 ID. The field will only be present for objects that\nhave been created or modified by legacy APIs.", + "nullable": true + }, + "present_at_all_locations": { + "type": "boolean", + "description": "If `true`, this object is present at all locations (including future locations), except where specified in\nthe `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations),\nexcept where specified in the `present_at_location_ids` field. If not specified, defaults to `true`.", + "nullable": true + }, + "present_at_location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of locations where the object is present, even if `present_at_all_locations` is `false`.\nThis can include locations that are deactivated.", + "nullable": true + }, + "absent_at_location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of locations where the object is not present, even if `present_at_all_locations` is `true`.\nThis can include locations that are deactivated.", + "nullable": true + }, + "item_data": { + "$ref": "#/components/schemas/CatalogItem", + "description": "Structured data for a `CatalogItem`, set for CatalogObjects of type `ITEM`.", + "nullable": true + }, + "category_data": { + "$ref": "#/components/schemas/CatalogCategory", + "description": "Structured data for a `CatalogCategory`, set for CatalogObjects of type `CATEGORY`.", + "nullable": true + }, + "item_variation_data": { + "$ref": "#/components/schemas/CatalogItemVariation", + "description": "Structured data for a `CatalogItemVariation`, set for CatalogObjects of type `ITEM_VARIATION`.", + "nullable": true + }, + "tax_data": { + "$ref": "#/components/schemas/CatalogTax", + "description": "Structured data for a `CatalogTax`, set for CatalogObjects of type `TAX`.", + "nullable": true + }, + "discount_data": { + "$ref": "#/components/schemas/CatalogDiscount", + "description": "Structured data for a `CatalogDiscount`, set for CatalogObjects of type `DISCOUNT`.", + "nullable": true + }, + "modifier_list_data": { + "$ref": "#/components/schemas/CatalogModifierList", + "description": "Structured data for a `CatalogModifierList`, set for CatalogObjects of type `MODIFIER_LIST`.", + "nullable": true + }, + "modifier_data": { + "$ref": "#/components/schemas/CatalogModifier", + "description": "Structured data for a `CatalogModifier`, set for CatalogObjects of type `MODIFIER`.", + "nullable": true + }, + "time_period_data": { + "$ref": "#/components/schemas/CatalogTimePeriod", + "description": "Structured data for a `CatalogTimePeriod`, set for CatalogObjects of type `TIME_PERIOD`.", + "nullable": true + }, + "product_set_data": { + "$ref": "#/components/schemas/CatalogProductSet", + "description": "Structured data for a `CatalogProductSet`, set for CatalogObjects of type `PRODUCT_SET`.", + "nullable": true + }, + "pricing_rule_data": { + "$ref": "#/components/schemas/CatalogPricingRule", + "description": "Structured data for a `CatalogPricingRule`, set for CatalogObjects of type `PRICING_RULE`.\nA `CatalogPricingRule` object often works with a `CatalogProductSet` object or a `CatalogTimePeriod` object.", + "nullable": true + }, + "image_data": { + "$ref": "#/components/schemas/CatalogImage", + "description": "Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`.", + "nullable": true + }, + "measurement_unit_data": { + "$ref": "#/components/schemas/CatalogMeasurementUnit", + "description": "Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects of type `MEASUREMENT_UNIT`.", + "nullable": true + }, + "subscription_plan_data": { + "$ref": "#/components/schemas/CatalogSubscriptionPlan", + "description": "Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`.", + "nullable": true + }, + "item_option_data": { + "$ref": "#/components/schemas/CatalogItemOption", + "description": "Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`.", + "nullable": true + }, + "item_option_value_data": { + "$ref": "#/components/schemas/CatalogItemOptionValue", + "description": "Structured data for a `CatalogItemOptionValue`, set for CatalogObjects of type `ITEM_OPTION_VAL`.", + "nullable": true + }, + "custom_attribute_definition_data": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinition", + "description": "Structured data for a `CatalogCustomAttributeDefinition`, set for CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`.", + "nullable": true + }, + "quick_amounts_settings_data": { + "$ref": "#/components/schemas/CatalogQuickAmountsSettings", + "description": "Structured data for a `CatalogQuickAmountsSettings`, set for CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`.", + "x-release-status": "BETA", + "nullable": true + }, + "subscription_plan_variation_data": { + "$ref": "#/components/schemas/CatalogSubscriptionPlanVariation", + "description": "Structured data for a `CatalogSubscriptionPlanVariation`, set for CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`.", + "nullable": true + }, + "availability_period_data": { + "$ref": "#/components/schemas/CatalogAvailabilityPeriod", + "description": "Structured data for a `CatalogAvailabilityPeriod`, set for CatalogObjects of type `AVAILABILITY_PERIOD`.", + "nullable": true + } + }, + "example": { + "catalog_object": { + "absent_at_location_ids": [ + "{{ LOCATIONID-1 }}", + "{{ LOCATIONID-N }}" + ], + "category_data": "{{ CatalogCategory object only if type=CATEGORY }}", + "connect_v1_ids": { + "catalog_v1_id": "{{ itemID from Catalog v1 }}", + "location_id": "{{ location where v1 ID is used }}" + }, + "discount_data": "{{ CatalogDiscount object only if type=DISCOUNT }}", + "id": "{{ set by Catalog during object creation }}", + "is_deleted": "{{ [true | false] }}", + "item_data": "{{ CatalogItem object only if type=ITEM }}", + "item_variation_data": "{{ CatalogItemVariation object only if type=ITEM_VARIATION }}", + "modifier_data": "{{ CatalogModifier object only if type=MODIFIER }}", + "modifier_list_data": "{{ CatalogModifierList object only if type=MODIFIER_LIST }}", + "present_at_all_locations": "{{ [true | false] }}", + "present_at_location_ids": [ + "{{ LOCATIONID-1 }}", + "{{ LOCATIONID-N }}" + ], + "tax_data": "{{ CatalogTax object only if type=TAX }}", + "type": "{{ [ITEM | ITEM_VARIATION | MODIFIER | MODIFIER_LIST | CATEGORY | DISCOUNT | TAX] }}", + "updated_at": "{{ date \u0026 time of most recent update }}", + "version": "{{ version of the CatalogObject }}" + } + } + }, + "CatalogObjectBatch": { + "type": "object", + "description": "A batch of catalog objects.", + "x-release-status": "PUBLIC", + "required": [ + "objects" + ], + "properties": { + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of CatalogObjects belonging to this batch." + } + } + }, + "CatalogObjectCategory": { + "type": "object", + "description": "A category that can be assigned to an item or a parent category that can be assigned \nto another category. For example, a clothing category can be assigned to a t-shirt item or \nbe made as the parent category to the pants category.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "The ID of the object's category." + }, + "ordinal": { + "type": "integer", + "description": "The order of the object within the context of the category.", + "format": "int64", + "nullable": true + } + } + }, + "CatalogObjectReference": { + "type": "object", + "description": "A reference to a Catalog object at a specific version. In general this is\nused as an entry point into a graph of catalog objects, where the objects exist\nat a specific version.", + "x-release-status": "PUBLIC", + "properties": { + "object_id": { + "type": "string", + "description": "The ID of the referenced object.", + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the object.", + "format": "int64", + "nullable": true + } + } + }, + "CatalogObjectType": { + "type": "string", + "enum": [ + "ITEM", + "IMAGE", + "CATEGORY", + "ITEM_VARIATION", + "TAX", + "DISCOUNT", + "MODIFIER_LIST", + "MODIFIER", + "PRICING_RULE", + "PRODUCT_SET", + "TIME_PERIOD", + "MEASUREMENT_UNIT", + "SUBSCRIPTION_PLAN_VARIATION", + "ITEM_OPTION", + "ITEM_OPTION_VAL", + "CUSTOM_ATTRIBUTE_DEFINITION", + "QUICK_AMOUNTS_SETTINGS", + "SUBSCRIPTION_PLAN", + "AVAILABILITY_PERIOD" + ], + "x-enum-elements": [ + { + "name": "ITEM", + "description": "The `CatalogObject` instance is of the [CatalogItem](entity:CatalogItem) type and represents an item. The item-specific data\nmust be set on the `item_data` field." + }, + { + "name": "IMAGE", + "description": "The `CatalogObject` instance is of the [CatalogImage](entity:CatalogImage) type and represents an image. The image-specific data\nmust be set on the `image_data` field." + }, + { + "name": "CATEGORY", + "description": "The `CatalogObject` instance is of the [CatalogCategory](entity:CatalogCategory) type and represents a category. The category-specific data\nmust be set on the `category_data` field." + }, + { + "name": "ITEM_VARIATION", + "description": "The `CatalogObject` instance is of the [CatalogItemVariation](entity:CatalogItemVariation) type and represents an item variation, also referred to as variation.\nThe item variation-specific data must be set on the `item_variation_data` field." + }, + { + "name": "TAX", + "description": "The `CatalogObject` instance is of the [CatalogTax](entity:CatalogTax) type and represents a tax. The tax-specific data\nmust be set on the `tax_data` field." + }, + { + "name": "DISCOUNT", + "description": "The `CatalogObject` instance is of the [CatalogDiscount](entity:CatalogDiscount) type and represents a discount. The discount-specific data\nmust be set on the `discount_data` field." + }, + { + "name": "MODIFIER_LIST", + "description": "The `CatalogObject` instance is of the [CatalogModifierList](entity:CatalogModifierList) type and represents a modifier list.\nThe modifier-list-specific data must be set on the `modifier_list_data` field." + }, + { + "name": "MODIFIER", + "description": "The `CatalogObject` instance is of the [CatalogModifier](entity:CatalogModifier) type and represents a modifier. The modifier-specific data\nmust be set on the `modifier_data` field." + }, + { + "name": "PRICING_RULE", + "description": "The `CatalogObject` instance is of the [CatalogPricingRule](entity:CatalogPricingRule) type and represents a pricing rule. The pricing-rule-specific data\nmust be set on the `pricing_rule_data` field." + }, + { + "name": "PRODUCT_SET", + "description": "The `CatalogObject` instance is of the [CatalogProductSet](entity:CatalogProductSet) type and represents a product set.\nThe product-set-specific data will be stored in the `product_set_data` field." + }, + { + "name": "TIME_PERIOD", + "description": "The `CatalogObject` instance is of the [CatalogTimePeriod](entity:CatalogTimePeriod) type and represents a time period.\nThe time-period-specific data must be set on the `time_period_data` field." + }, + { + "name": "MEASUREMENT_UNIT", + "description": "The `CatalogObject` instance is of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) type and represents a measurement unit specifying the unit of\nmeasure and precision in which an item variation is sold. The measurement-unit-specific data must set on the `measurement_unit_data` field." + }, + { + "name": "SUBSCRIPTION_PLAN_VARIATION", + "description": "The `CatalogObject` instance is of the [CatalogSubscriptionPlan](entity:CatalogSubscriptionPlan) type and represents a subscription plan.\nThe subscription-plan-specific data must be stored on the `subscription_plan_data` field." + }, + { + "name": "ITEM_OPTION", + "description": "The `CatalogObject` instance is of the [CatalogItemOption](entity:CatalogItemOption) type and represents a list of options (such as a color or size of a T-shirt)\nthat can be assigned to item variations. The item-option-specific data must be on the `item_option_data` field." + }, + { + "name": "ITEM_OPTION_VAL", + "description": "The `CatalogObject` instance is of the [CatalogItemOptionValue](entity:CatalogItemOptionValue) type and represents a value associated with one or more item options.\nFor example, an item option of \"Size\" may have item option values such as \"Small\" or \"Medium\".\nThe item-option-value-specific data must be on the `item_option_value_data` field." + }, + { + "name": "CUSTOM_ATTRIBUTE_DEFINITION", + "description": "The `CatalogObject` instance is of the [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) type and represents the definition of a custom attribute.\nThe custom-attribute-definition-specific data must be set on the `custom_attribute_definition_data` field." + }, + { + "name": "QUICK_AMOUNTS_SETTINGS", + "description": "The `CatalogObject` instance is of the [CatalogQuickAmountsSettings](entity:CatalogQuickAmountsSettings) type and represents settings to configure preset charges for quick payments at each location.\nFor example, a location may have a list of both AUTO and MANUAL quick amounts that are set to DISABLED.\nThe quick-amounts-settings-specific data must be set on the `quick_amounts_settings_data` field." + }, + { + "name": "SUBSCRIPTION_PLAN", + "description": "The `CatalogObject` instance is of the [CatalogSubscriptionPlan](entity:CatalogSubscriptionPlan) type and represents a subscription plan.\nThe subscription plan specific data must be stored on the `subscription_plan_data` field." + }, + { + "name": "AVAILABILITY_PERIOD", + "description": "The `CatalogObject` instance is of the [CatalogAvailabilityPeriod](entity:CatalogAvailabilityPeriod) type and represents an availability period.\nThe availability period specific data must be stored on the `availability_period_data` field." + } + ], + "description": "Possible types of CatalogObjects returned from the catalog, each\ncontaining type-specific properties in the `*_data` field corresponding to the specified object type.", + "x-release-status": "PUBLIC" + }, + "CatalogPricingRule": { + "type": "object", + "description": "Defines how discounts are automatically applied to a set of items that match the pricing rule\nduring the active time period.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "User-defined name for the pricing rule. For example, \"Buy one get one\nfree\" or \"10% off\".", + "nullable": true + }, + "time_period_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique IDs for the catalog time periods when\nthis pricing rule is in effect. If left unset, the pricing rule is always\nin effect.", + "nullable": true + }, + "discount_id": { + "type": "string", + "description": "Unique ID for the `CatalogDiscount` to take off\nthe price of all matched items.", + "nullable": true + }, + "match_products_id": { + "type": "string", + "description": "Unique ID for the `CatalogProductSet` that will be matched by this rule. A match rule\nmatches within the entire cart, and can match multiple times. This field will always be set.", + "nullable": true + }, + "apply_products_id": { + "type": "string", + "description": "__Deprecated__: Please use the `exclude_products_id` field to apply\nan exclude set instead. Exclude sets allow better control over quantity\nranges and offer more flexibility for which matched items receive a discount.\n\n`CatalogProductSet` to apply the pricing to.\nAn apply rule matches within the subset of the cart that fits the match rules (the match set).\nAn apply rule can only match once in the match set.\nIf not supplied, the pricing will be applied to all products in the match set.\nOther products retain their base price, or a price generated by other rules.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "exclude_products_id": { + "type": "string", + "description": "`CatalogProductSet` to exclude from the pricing rule.\nAn exclude rule matches within the subset of the cart that fits the match rules (the match set).\nAn exclude rule can only match once in the match set.\nIf not supplied, the pricing will be applied to all products in the match set.\nOther products retain their base price, or a price generated by other rules.", + "nullable": true + }, + "valid_from_date": { + "type": "string", + "description": "Represents the date the Pricing Rule is valid from. Represented in RFC 3339 full-date format (YYYY-MM-DD).", + "nullable": true + }, + "valid_from_local_time": { + "type": "string", + "description": "Represents the local time the pricing rule should be valid from. Represented in RFC 3339 partial-time format\n(HH:MM:SS). Partial seconds will be truncated.", + "nullable": true + }, + "valid_until_date": { + "type": "string", + "description": "Represents the date the Pricing Rule is valid until. Represented in RFC 3339 full-date format (YYYY-MM-DD).", + "nullable": true + }, + "valid_until_local_time": { + "type": "string", + "description": "Represents the local time the pricing rule should be valid until. Represented in RFC 3339 partial-time format\n(HH:MM:SS). Partial seconds will be truncated.", + "nullable": true + }, + "exclude_strategy": { + "$ref": "#/components/schemas/ExcludeStrategy", + "description": "If an `exclude_products_id` was given, controls which subset of matched\nproducts is excluded from any discounts.\n\nDefault value: `LEAST_EXPENSIVE`\nSee [ExcludeStrategy](#type-excludestrategy) for possible values", + "nullable": true + }, + "minimum_order_subtotal_money": { + "$ref": "#/components/schemas/Money", + "description": "The minimum order subtotal (before discounts or taxes are applied)\nthat must be met before this rule may be applied.", + "nullable": true + }, + "customer_group_ids_any": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of IDs of customer groups, the members of which are eligible for discounts specified in this pricing rule.\nNotice that a group ID is generated by the Customers API.\nIf this field is not set, the specified discount applies to matched products sold to anyone whether the buyer\nhas a customer profile created or not. If this `customer_group_ids_any` field is set, the specified discount\napplies only to matched products sold to customers belonging to the specified customer groups.", + "nullable": true + } + } + }, + "CatalogPricingType": { + "type": "string", + "enum": [ + "FIXED_PRICING", + "VARIABLE_PRICING" + ], + "x-enum-elements": [ + { + "name": "FIXED_PRICING", + "description": "The catalog item variation's price is fixed." + }, + { + "name": "VARIABLE_PRICING", + "description": "The catalog item variation's price is entered at the time of sale." + } + ], + "description": "Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale.", + "x-release-status": "PUBLIC" + }, + "CatalogProductSet": { + "type": "object", + "description": "Represents a collection of catalog objects for the purpose of applying a\n`PricingRule`. Including a catalog object will include all of its subtypes.\nFor example, including a category in a product set will include all of its\nitems and associated item variations in the product set. Including an item in\na product set will also include its item variations.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "User-defined name for the product set. For example, \"Clearance Items\"\nor \"Winter Sale Items\".", + "nullable": true + }, + "product_ids_any": { + "type": "array", + "items": { + "type": "string" + }, + "description": " Unique IDs for any `CatalogObject` included in this product set. Any\nnumber of these catalog objects can be in an order for a pricing rule to apply.\n\nThis can be used with `product_ids_all` in a parent `CatalogProductSet` to\nmatch groups of products for a bulk discount, such as a discount for an\nentree and side combo.\n\nOnly one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.\n\nMax: 500 catalog object IDs.", + "nullable": true + }, + "product_ids_all": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique IDs for any `CatalogObject` included in this product set.\nAll objects in this set must be included in an order for a pricing rule to apply.\n\nOnly one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.\n\nMax: 500 catalog object IDs.", + "nullable": true + }, + "quantity_exact": { + "type": "integer", + "description": "If set, there must be exactly this many items from `products_any` or `products_all`\nin the cart for the discount to apply.\n\nCannot be combined with either `quantity_min` or `quantity_max`.", + "format": "int64", + "nullable": true + }, + "quantity_min": { + "type": "integer", + "description": "If set, there must be at least this many items from `products_any` or `products_all`\nin a cart for the discount to apply. See `quantity_exact`. Defaults to 0 if\n`quantity_exact`, `quantity_min` and `quantity_max` are all unspecified.", + "format": "int64", + "nullable": true + }, + "quantity_max": { + "type": "integer", + "description": "If set, the pricing rule will apply to a maximum of this many items from\n`products_any` or `products_all`.", + "format": "int64", + "nullable": true + }, + "all_products": { + "type": "boolean", + "description": "If set to `true`, the product set will include every item in the catalog.\nOnly one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.", + "nullable": true + } + } + }, + "CatalogQuery": { + "type": "object", + "description": "A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint.\n\nAlthough a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects).\nAny combination of the following types may be used together:\n- [exact_query](entity:CatalogQueryExact)\n- [prefix_query](entity:CatalogQueryPrefix)\n- [range_query](entity:CatalogQueryRange)\n- [sorted_attribute_query](entity:CatalogQuerySortedAttribute)\n- [text_query](entity:CatalogQueryText)\n\nAll other query types cannot be combined with any others.\n\nWhen a query filter is based on an attribute, the attribute must be searchable.\nSearchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters.\n\nSearchable attribute and objects queryable by searchable attributes:\n- `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, `CatalogModifierList`, `CatalogItemOption`, `CatalogItemOptionValue`\n- `description`: `CatalogItem`, `CatalogItemOptionValue`\n- `abbreviation`: `CatalogItem`\n- `upc`: `CatalogItemVariation`\n- `sku`: `CatalogItemVariation`\n- `caption`: `CatalogImage`\n- `display_name`: `CatalogItemOption`\n\nFor example, to search for [CatalogItem](entity:CatalogItem) objects by searchable attributes, you can use\nthe `\"name\"`, `\"description\"`, or `\"abbreviation\"` attribute in an applicable query filter.", + "x-release-status": "PUBLIC", + "properties": { + "sorted_attribute_query": { + "$ref": "#/components/schemas/CatalogQuerySortedAttribute", + "description": "A query expression to sort returned query result by the given attribute.", + "nullable": true + }, + "exact_query": { + "$ref": "#/components/schemas/CatalogQueryExact", + "description": "An exact query expression to return objects with attribute name and value\nmatching the specified attribute name and value exactly. Value matching is case insensitive.", + "nullable": true + }, + "set_query": { + "$ref": "#/components/schemas/CatalogQuerySet", + "description": "A set query expression to return objects with attribute name and value\nmatching the specified attribute name and any of the specified attribute values exactly.\nValue matching is case insensitive.", + "nullable": true + }, + "prefix_query": { + "$ref": "#/components/schemas/CatalogQueryPrefix", + "description": "A prefix query expression to return objects with attribute values\nthat have a prefix matching the specified string value. Value matching is case insensitive.", + "nullable": true + }, + "range_query": { + "$ref": "#/components/schemas/CatalogQueryRange", + "description": "A range query expression to return objects with numeric values\nthat lie in the specified range.", + "nullable": true + }, + "text_query": { + "$ref": "#/components/schemas/CatalogQueryText", + "description": "A text query expression to return objects whose searchable attributes contain all of the given\nkeywords, irrespective of their order. For example, if a `CatalogItem` contains custom attribute values of\n`{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Purple\"}`, the query filter of `{\"keywords\": [\"shirt\", \"sma\", \"purp\"]}`\nreturns this item.", + "nullable": true + }, + "items_for_tax_query": { + "$ref": "#/components/schemas/CatalogQueryItemsForTax", + "description": "A query expression to return items that have any of the specified taxes (as identified by the corresponding `CatalogTax` object IDs) enabled.", + "nullable": true + }, + "items_for_modifier_list_query": { + "$ref": "#/components/schemas/CatalogQueryItemsForModifierList", + "description": "A query expression to return items that have any of the given modifier list (as identified by the corresponding `CatalogModifierList`s IDs) enabled.", + "nullable": true + }, + "items_for_item_options_query": { + "$ref": "#/components/schemas/CatalogQueryItemsForItemOptions", + "description": "A query expression to return items that contains the specified item options (as identified the corresponding `CatalogItemOption` IDs).", + "nullable": true + }, + "item_variations_for_item_option_values_query": { + "$ref": "#/components/schemas/CatalogQueryItemVariationsForItemOptionValues", + "description": "A query expression to return item variations (of the [CatalogItemVariation](entity:CatalogItemVariation) type) that\ncontain all of the specified `CatalogItemOption` IDs.", + "nullable": true + } + } + }, + "CatalogQueryExact": { + "type": "object", + "description": "The query filter to return the search result by exact match of the specified attribute name and value.", + "x-release-status": "PUBLIC", + "required": [ + "attribute_name", + "attribute_value" + ], + "properties": { + "attribute_name": { + "type": "string", + "description": "The name of the attribute to be searched. Matching of the attribute name is exact.", + "minLength": 1 + }, + "attribute_value": { + "type": "string", + "description": "The desired value of the search attribute. Matching of the attribute value is case insensitive and can be partial.\nFor example, if a specified value of \"sma\", objects with the named attribute value of \"Small\", \"small\" are both matched." + } + } + }, + "CatalogQueryItemVariationsForItemOptionValues": { + "type": "object", + "description": "The query filter to return the item variations containing the specified item option value IDs.", + "x-release-status": "PUBLIC", + "properties": { + "item_option_value_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A set of `CatalogItemOptionValue` IDs to be used to find associated\n`CatalogItemVariation`s. All ItemVariations that contain all of the given\nItem Option Values (in any order) will be returned.", + "nullable": true + } + } + }, + "CatalogQueryItemsForItemOptions": { + "type": "object", + "description": "The query filter to return the items containing the specified item option IDs.", + "x-release-status": "PUBLIC", + "properties": { + "item_option_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A set of `CatalogItemOption` IDs to be used to find associated\n`CatalogItem`s. All Items that contain all of the given Item Options (in any order)\nwill be returned.", + "nullable": true + } + } + }, + "CatalogQueryItemsForModifierList": { + "type": "object", + "description": "The query filter to return the items containing the specified modifier list IDs.", + "x-release-status": "PUBLIC", + "required": [ + "modifier_list_ids" + ], + "properties": { + "modifier_list_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A set of `CatalogModifierList` IDs to be used to find associated `CatalogItem`s." + } + } + }, + "CatalogQueryItemsForTax": { + "type": "object", + "description": "The query filter to return the items containing the specified tax IDs.", + "x-release-status": "PUBLIC", + "required": [ + "tax_ids" + ], + "properties": { + "tax_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A set of `CatalogTax` IDs to be used to find associated `CatalogItem`s." + } + } + }, + "CatalogQueryPrefix": { + "type": "object", + "description": "The query filter to return the search result whose named attribute values are prefixed by the specified attribute value.", + "x-release-status": "PUBLIC", + "required": [ + "attribute_name", + "attribute_prefix" + ], + "properties": { + "attribute_name": { + "type": "string", + "description": "The name of the attribute to be searched.", + "minLength": 1 + }, + "attribute_prefix": { + "type": "string", + "description": "The desired prefix of the search attribute value.", + "minLength": 1 + } + } + }, + "CatalogQueryRange": { + "type": "object", + "description": "The query filter to return the search result whose named attribute values fall between the specified range.", + "x-release-status": "PUBLIC", + "required": [ + "attribute_name" + ], + "properties": { + "attribute_name": { + "type": "string", + "description": "The name of the attribute to be searched.", + "minLength": 1 + }, + "attribute_min_value": { + "type": "integer", + "description": "The desired minimum value for the search attribute (inclusive).", + "format": "int64", + "nullable": true + }, + "attribute_max_value": { + "type": "integer", + "description": "The desired maximum value for the search attribute (inclusive).", + "format": "int64", + "nullable": true + } + } + }, + "CatalogQuerySet": { + "type": "object", + "description": "The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of\nthe `attribute_values`.", + "x-release-status": "PUBLIC", + "required": [ + "attribute_name", + "attribute_values" + ], + "properties": { + "attribute_name": { + "type": "string", + "description": "The name of the attribute to be searched. Matching of the attribute name is exact.", + "minLength": 1 + }, + "attribute_values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The desired values of the search attribute. Matching of the attribute values is exact and case insensitive.\nA maximum of 250 values may be searched in a request." + } + } + }, + "CatalogQuerySortedAttribute": { + "type": "object", + "description": "The query expression to specify the key to sort search results.", + "x-release-status": "PUBLIC", + "required": [ + "attribute_name" + ], + "properties": { + "attribute_name": { + "type": "string", + "description": "The attribute whose value is used as the sort key.", + "minLength": 1 + }, + "initial_attribute_value": { + "type": "string", + "description": "The first attribute value to be returned by the query. Ascending sorts will return only\nobjects with this value or greater, while descending sorts will return only objects with this value\nor less. If unset, start at the beginning (for ascending sorts) or end (for descending sorts).", + "nullable": true + }, + "sort_order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The desired sort order, `\"ASC\"` (ascending) or `\"DESC\"` (descending).\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "CatalogQueryText": { + "type": "object", + "description": "The query filter to return the search result whose searchable attribute values contain all of the specified keywords or tokens, independent of the token order or case.", + "x-release-status": "PUBLIC", + "required": [ + "keywords" + ], + "properties": { + "keywords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 alphanumeric characters are ignored." + } + } + }, + "CatalogQuickAmount": { + "type": "object", + "description": "Represents a Quick Amount in the Catalog.", + "x-release-status": "BETA", + "required": [ + "type", + "amount" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/CatalogQuickAmountType", + "description": "Represents the type of the Quick Amount.\nSee [CatalogQuickAmountType](#type-catalogquickamounttype) for possible values" + }, + "amount": { + "$ref": "#/components/schemas/Money", + "description": "Represents the actual amount of the Quick Amount with Money type." + }, + "score": { + "type": "integer", + "description": "Describes the ranking of the Quick Amount provided by machine learning model, in the range [0, 100].\nMANUAL type amount will always have score = 100.", + "format": "int64", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The order in which this Quick Amount should be displayed.", + "format": "int64", + "nullable": true + } + } + }, + "CatalogQuickAmountType": { + "type": "string", + "enum": [ + "QUICK_AMOUNT_TYPE_MANUAL", + "QUICK_AMOUNT_TYPE_AUTO" + ], + "x-enum-elements": [ + { + "name": "QUICK_AMOUNT_TYPE_MANUAL", + "description": "Quick Amount is created manually by the seller." + }, + { + "name": "QUICK_AMOUNT_TYPE_AUTO", + "description": "Quick Amount is generated automatically by machine learning algorithms." + } + ], + "description": "Determines the type of a specific Quick Amount.", + "x-release-status": "BETA" + }, + "CatalogQuickAmountsSettings": { + "type": "object", + "description": "A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts.", + "x-release-status": "BETA", + "required": [ + "option" + ], + "properties": { + "option": { + "$ref": "#/components/schemas/CatalogQuickAmountsSettingsOption", + "description": "Represents the option seller currently uses on Quick Amounts.\nSee [CatalogQuickAmountsSettingsOption](#type-catalogquickamountssettingsoption) for possible values" + }, + "eligible_for_auto_amounts": { + "type": "boolean", + "description": "Represents location's eligibility for auto amounts\nThe boolean should be consistent with whether there are AUTO amounts in the `amounts`.", + "nullable": true + }, + "amounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogQuickAmount" + }, + "description": "Represents a set of Quick Amounts at this location.", + "nullable": true + } + } + }, + "CatalogQuickAmountsSettingsOption": { + "type": "string", + "enum": [ + "DISABLED", + "MANUAL", + "AUTO" + ], + "x-enum-elements": [ + { + "name": "DISABLED", + "description": "Option for seller to disable Quick Amounts." + }, + { + "name": "MANUAL", + "description": "Option for seller to choose manually created Quick Amounts." + }, + { + "name": "AUTO", + "description": "Option for seller to choose automatically created Quick Amounts." + } + ], + "description": "Determines a seller's option on Quick Amounts feature.", + "x-release-status": "BETA" + }, + "CatalogStockConversion": { + "type": "object", + "description": "Represents the rule of conversion between a stockable [CatalogItemVariation](entity:CatalogItemVariation)\nand a non-stockable sell-by or receive-by `CatalogItemVariation` that\nshare the same underlying stock.", + "x-release-status": "BETA", + "required": [ + "stockable_item_variation_id", + "stockable_quantity", + "nonstockable_quantity" + ], + "properties": { + "stockable_item_variation_id": { + "type": "string", + "description": "References to the stockable [CatalogItemVariation](entity:CatalogItemVariation)\nfor this stock conversion. Selling, receiving or recounting the non-stockable `CatalogItemVariation`\ndefined with a stock conversion results in adjustments of this stockable `CatalogItemVariation`.\nThis immutable field must reference a stockable `CatalogItemVariation`\nthat shares the parent [CatalogItem](entity:CatalogItem) of the converted `CatalogItemVariation.`", + "minLength": 1 + }, + "stockable_quantity": { + "type": "string", + "description": "The quantity of the stockable item variation (as identified by `stockable_item_variation_id`)\nequivalent to the non-stockable item variation quantity (as specified in `nonstockable_quantity`)\nas defined by this stock conversion. It accepts a decimal number in a string format that can take\nup to 10 digits before the decimal point and up to 5 digits after the decimal point.", + "minLength": 1, + "maxLength": 16 + }, + "nonstockable_quantity": { + "type": "string", + "description": "The converted equivalent quantity of the non-stockable [CatalogItemVariation](entity:CatalogItemVariation)\nin its measurement unit. The `stockable_quantity` value and this `nonstockable_quantity` value together\ndefine the conversion ratio between stockable item variation and the non-stockable item variation.\nIt accepts a decimal number in a string format that can take up to 10 digits before the decimal point\nand up to 5 digits after the decimal point.", + "minLength": 1, + "maxLength": 16 + } + } + }, + "CatalogSubscriptionPlan": { + "type": "object", + "description": "Describes a subscription plan. A subscription plan represents what you want to sell in a subscription model, and includes references to each of the associated subscription plan variations.\nFor more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations).", + "x-release-status": "PUBLIC", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the plan." + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionPhase" + }, + "description": "A list of SubscriptionPhase containing the [SubscriptionPhase](entity:SubscriptionPhase) for this plan.\nThis field it required. Not including this field will throw a REQUIRED_FIELD_MISSING error", + "nullable": true + }, + "subscription_plan_variations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "The list of subscription plan variations available for this product", + "nullable": true + }, + "eligible_item_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's variations.", + "nullable": true + }, + "eligible_category_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's variations.", + "nullable": true + }, + "all_items": { + "type": "boolean", + "description": "If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan.", + "nullable": true + } + } + }, + "CatalogSubscriptionPlanVariation": { + "type": "object", + "description": "Describes a subscription plan variation. A subscription plan variation represents how the subscription for a product or service is sold.\nFor more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations).", + "x-release-status": "PUBLIC", + "required": [ + "name", + "phases" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the plan variation." + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionPhase" + }, + "description": "A list containing each [SubscriptionPhase](entity:SubscriptionPhase) for this plan variation." + }, + "subscription_plan_id": { + "type": "string", + "description": "The id of the subscription plan, if there is one.", + "nullable": true + }, + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The day of the month the billing period starts.", + "format": "int64", + "minimum": 1, + "maximum": 31, + "nullable": true + }, + "can_prorate": { + "type": "boolean", + "description": "Whether bills for this plan variation can be split for proration.", + "nullable": true + }, + "successor_plan_variation_id": { + "type": "string", + "description": "The ID of a \"successor\" plan variation to this one. If the field is set, and this object is disabled at all\nlocations, it indicates that this variation is deprecated and the object identified by the successor ID be used in\nits stead.", + "nullable": true + } + } + }, + "CatalogTax": { + "type": "object", + "description": "A tax applicable to an item.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The tax's name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.", + "maxLength": 255, + "nullable": true + }, + "calculation_phase": { + "$ref": "#/components/schemas/TaxCalculationPhase", + "description": "Whether the tax is calculated based on a payment's subtotal or total.\nSee [TaxCalculationPhase](#type-taxcalculationphase) for possible values", + "nullable": true + }, + "inclusion_type": { + "$ref": "#/components/schemas/TaxInclusionType", + "description": "Whether the tax is `ADDITIVE` or `INCLUSIVE`.\nSee [TaxInclusionType](#type-taxinclusiontype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign.\nA value of `7.5` corresponds to 7.5%. For a location-specific tax rate, contact the tax authority of the location or a tax consultant.", + "nullable": true + }, + "applies_to_custom_amounts": { + "type": "boolean", + "description": "If `true`, the fee applies to custom amounts entered into the Square Point of Sale\napp that are not associated with a particular `CatalogItem`.", + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of Sale app or not (`false`).", + "nullable": true + }, + "applies_to_product_set_id": { + "type": "string", + "description": "The ID of a `CatalogProductSet` object. If set, the tax is applicable to all products in the product set.", + "x-release-status": "BETA", + "nullable": true + } + }, + "example": { + "object": { + "id": "#SalesTax", + "present_at_all_locations": true, + "tax_data": { + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "fee_applies_to_custom_amounts": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX" + } + } + }, + "CatalogTimePeriod": { + "type": "object", + "description": "Represents a time period - either a single period or a repeating period.", + "x-release-status": "PUBLIC", + "properties": { + "event": { + "type": "string", + "description": "An iCalendar (RFC 5545) [event](https://tools.ietf.org/html/rfc5545#section-3.6.1), which\nspecifies the name, timing, duration and recurrence of this time period.\n\nExample:\n\n```\nDTSTART:20190707T180000\nDURATION:P2H\nRRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR\n```\n\nOnly `SUMMARY`, `DTSTART`, `DURATION` and `RRULE` fields are supported.\n`DTSTART` must be in local (unzoned) time format. Note that while `BEGIN:VEVENT`\nand `END:VEVENT` is not required in the request. The response will always\ninclude them.", + "nullable": true + } + } + }, + "CatalogV1Id": { + "type": "object", + "description": "A Square API V1 identifier of an item, including the object ID and its associated location ID.", + "x-release-status": "PUBLIC", + "properties": { + "catalog_v1_id": { + "type": "string", + "description": "The ID for an object used in the Square API V1, if the object ID differs from the Square API V2 object ID.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the `Location` this Connect V1 ID is associated with.", + "nullable": true + } + } + }, + "CatalogVersionUpdatedEvent": { + "type": "object", + "description": "Published when the catalog is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CatalogVersionUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "id": "732b6677-1acb-4d81-b09c-5a3a49399d8f", + "object": { + "catalog_version": { + "updated_at": "2019-10-29T17:26:16.53Z" + } + }, + "type": "catalog_version" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "catalog.version.updated" + }, + "x-webhook": { + "event": "catalog.version.updated", + "scopes": [ + "ITEMS_READ" + ] + }, + "x-api": "#/components/x-apis/Catalog", + "x-since": "2019-09-25" + }, + "CatalogVersionUpdatedEventCatalogVersion": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "updated_at": { + "type": "string", + "description": "Last modification timestamp in RFC 3339 format.", + "readOnly": true + } + } + }, + "CatalogVersionUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type.", + "nullable": true + }, + "object": { + "$ref": "#/components/schemas/CatalogVersionUpdatedEventObject", + "description": "An object containing fields and values relevant to the event. Is absent if affected object was deleted.", + "nullable": true + } + } + }, + "CatalogVersionUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "catalog_version": { + "$ref": "#/components/schemas/CatalogVersionUpdatedEventCatalogVersion", + "description": "The version of the object.", + "nullable": true + } + } + }, + "CategoryPathToRootNode": { + "type": "object", + "description": "A node in the path from a retrieved category to its root node.", + "x-release-status": "PUBLIC", + "properties": { + "category_id": { + "type": "string", + "description": "The category's ID.", + "nullable": true + }, + "category_name": { + "type": "string", + "description": "The category's name.", + "nullable": true + } + } + }, + "ChangeBillingAnchorDateRequest": { + "type": "object", + "description": "Defines input parameters in a request to the\n[ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint.", + "x-release-status": "BETA", + "properties": { + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The anchor day for the billing cycle.", + "minimum": 1, + "maximum": 31, + "nullable": true + }, + "effective_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the scheduled `BILLING_ANCHOR_CHANGE` action takes\nplace on the subscription.\n\nWhen this date is unspecified or falls within the current billing cycle, the billing anchor date\nis changed immediately.", + "nullable": true + } + }, + "example": { + "monthly_billing_anchor_date": 1 + } + }, + "ChangeBillingAnchorDateResponse": { + "type": "object", + "description": "Defines output parameters in a request to the\n[ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The specified subscription for updating billing anchor date." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "A list of a single billing anchor date change for the subscription." + } + }, + "example": { + "actions": [ + { + "effective_date": "2023-11-01", + "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83", + "monthly_billing_anchor_date": 1, + "type": "CHANGE_BILLING_ANCHOR_DATE" + } + ], + "subscription": { + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "9ba40961-995a-4a3d-8c53-048c40cafc13", + "location_id": "S8GWD5R9QB376", + "monthly_billing_anchor_date": 20, + "phases": [ + { + "order_template_id": "E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY", + "ordinal": 0, + "plan_phase_uid": "C66BKH3ASTDYGJJCEZXQQSS7", + "uid": "98d6f53b-40e1-4714-8827-032fd923be25" + } + ], + "plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "price_override_money": { + "amount": 2000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 3 + } + } + }, + "ChangeTiming": { + "type": "string", + "enum": [ + "IMMEDIATE", + "END_OF_BILLING_CYCLE" + ], + "x-enum-elements": [ + { + "name": "IMMEDIATE", + "description": "The action occurs immediately." + }, + { + "name": "END_OF_BILLING_CYCLE", + "description": "The action occurs at the end of the billing cycle." + } + ], + "description": "Supported timings when a pending change, as an action, takes place to a subscription.", + "x-release-status": "BETA" + }, + "ChargeRequestAdditionalRecipient": { + "type": "object", + "description": "Represents an additional recipient (other than the merchant) entitled to a portion of the tender.\nSupport is currently limited to USD, CAD and GBP currencies", + "x-release-status": "DEPRECATED", + "required": [ + "location_id", + "description", + "amount_money" + ], + "properties": { + "location_id": { + "type": "string", + "description": "The location ID for a recipient (other than the merchant) receiving a portion of the tender.", + "minLength": 1, + "maxLength": 50 + }, + "description": { + "type": "string", + "description": "The description of the additional recipient.", + "minLength": 1, + "maxLength": 100 + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money distributed to the recipient." + } + } + }, + "Checkout": { + "type": "object", + "description": "Square Checkout lets merchants accept online payments for supported\npayment types using a checkout workflow hosted on squareup.com.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "ID generated by Square Checkout when a new checkout is requested." + }, + "checkout_page_url": { + "type": "string", + "description": "The URL that the buyer's browser should be redirected to after the\ncheckout is completed.", + "nullable": true + }, + "ask_for_shipping_address": { + "type": "boolean", + "description": "If `true`, Square Checkout will collect shipping information on your\nbehalf and store that information with the transaction information in your\nSquare Dashboard.\n\nDefault: `false`.", + "nullable": true + }, + "merchant_support_email": { + "type": "string", + "description": "The email address to display on the Square Checkout confirmation page\nand confirmation email that the buyer can use to contact the merchant.\n\nIf this value is not set, the confirmation page and email will display the\nprimary email address associated with the merchant's Square account.\n\nDefault: none; only exists if explicitly set.", + "nullable": true + }, + "pre_populate_buyer_email": { + "type": "string", + "description": "If provided, the buyer's email is pre-populated on the checkout page\nas an editable text field.\n\nDefault: none; only exists if explicitly set.", + "nullable": true + }, + "pre_populate_shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "If provided, the buyer's shipping info is pre-populated on the\ncheckout page as editable text fields.\n\nDefault: none; only exists if explicitly set.", + "nullable": true + }, + "redirect_url": { + "type": "string", + "description": "The URL to redirect to after checkout is completed with `checkoutId`,\nSquare's `orderId`, `transactionId`, and `referenceId` appended as URL\nparameters. For example, if the provided redirect_url is\n`http://www.example.com/order-complete`, a successful transaction redirects\nthe customer to:\n\n\u003cpre\u003e\u003ccode\u003ehttp://www.example.com/order-complete?checkoutId=xxxxxx\u0026amp;orderId=xxxxxx\u0026amp;referenceId=xxxxxx\u0026amp;transactionId=xxxxxx\u003c/code\u003e\u003c/pre\u003e\n\nIf you do not provide a redirect URL, Square Checkout will display an order\nconfirmation page on your behalf; however Square strongly recommends that\nyou provide a redirect URL so you can verify the transaction results and\nfinalize the order through your existing/normal confirmation workflow.", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/Order", + "description": "Order to be checked out.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the checkout was created, in RFC 3339 format.", + "readOnly": true + }, + "additional_recipients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdditionalRecipient" + }, + "description": "Additional recipients (other than the merchant) receiving a portion of this checkout.\nFor example, fees assessed on the purchase by a third party integration.", + "x-release-status": "DEPRECATED", + "nullable": true + } + } + }, + "CheckoutLocationSettings": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the location that these settings apply to.", + "nullable": true + }, + "customer_notes_enabled": { + "type": "boolean", + "description": "Indicates whether customers are allowed to leave notes at checkout.", + "nullable": true + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CheckoutLocationSettingsPolicy" + }, + "description": "Policy information is displayed at the bottom of the checkout pages.\nYou can set a maximum of two policies.", + "nullable": true + }, + "branding": { + "$ref": "#/components/schemas/CheckoutLocationSettingsBranding", + "description": "The branding settings for this location.", + "nullable": true + }, + "tipping": { + "$ref": "#/components/schemas/CheckoutLocationSettingsTipping", + "description": "The tip settings for this location.", + "nullable": true + }, + "coupons": { + "$ref": "#/components/schemas/CheckoutLocationSettingsCoupons", + "description": "The coupon settings for this location.", + "nullable": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the settings were last updated, in RFC 3339 format.\nExamples for January 25th, 2020 6:25:34pm Pacific Standard Time:\nUTC: 2020-01-26T02:25:34Z\nPacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00", + "readOnly": true + } + } + }, + "CheckoutLocationSettingsBranding": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "header_type": { + "$ref": "#/components/schemas/CheckoutLocationSettingsBrandingHeaderType", + "description": "Show the location logo on the checkout page.\nSee [HeaderType](#type-headertype) for possible values", + "nullable": true + }, + "button_color": { + "type": "string", + "description": "The HTML-supported hex color for the button on the checkout page (for example, \"#FFFFFF\").", + "minLength": 7, + "maxLength": 7, + "nullable": true + }, + "button_shape": { + "$ref": "#/components/schemas/CheckoutLocationSettingsBrandingButtonShape", + "description": "The shape of the button on the checkout page.\nSee [ButtonShape](#type-buttonshape) for possible values", + "nullable": true + } + } + }, + "CheckoutLocationSettingsBrandingButtonShape": { + "type": "string", + "enum": [ + "SQUARED", + "ROUNDED", + "PILL" + ], + "x-enum-elements": [ + { + "name": "SQUARED", + "description": "" + }, + { + "name": "ROUNDED", + "description": "" + }, + { + "name": "PILL", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "CheckoutLocationSettingsBrandingHeaderType": { + "type": "string", + "enum": [ + "BUSINESS_NAME", + "FRAMED_LOGO", + "FULL_WIDTH_LOGO" + ], + "x-enum-elements": [ + { + "name": "BUSINESS_NAME", + "description": "" + }, + { + "name": "FRAMED_LOGO", + "description": "" + }, + { + "name": "FULL_WIDTH_LOGO", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "CheckoutLocationSettingsCoupons": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "enabled": { + "type": "boolean", + "description": "Indicates whether coupons are enabled for this location.", + "nullable": true + } + } + }, + "CheckoutLocationSettingsPolicy": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID to identify the policy when making changes. You must set the UID for policy updates, but it’s optional when setting new policies.", + "nullable": true + }, + "title": { + "type": "string", + "description": "The title of the policy. This is required when setting the description, though you can update it in a different request.", + "maxLength": 50, + "nullable": true + }, + "description": { + "type": "string", + "description": "The description of the policy.", + "maxLength": 4096, + "nullable": true + } + } + }, + "CheckoutLocationSettingsTipping": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "percentages": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "Set three custom percentage amounts that buyers can select at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more.", + "nullable": true + }, + "smart_tipping_enabled": { + "type": "boolean", + "description": "Enables Smart Tip Amounts. If Smart Tip Amounts is enabled, tipping works as follows:\nIf a transaction is less than $10, the available tipping options include No Tip, $1, $2, or $3.\nIf a transaction is $10 or more, the available tipping options include No Tip, 15%, 20%, or 25%. \nYou can set custom percentage amounts with the `percentages` field.", + "nullable": true + }, + "default_percent": { + "type": "integer", + "description": "Set the pre-selected percentage amounts that appear at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more.", + "nullable": true + }, + "smart_tips": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Money" + }, + "description": "Show the Smart Tip Amounts for this location.", + "nullable": true + }, + "default_smart_tip": { + "$ref": "#/components/schemas/Money", + "description": "Set the pre-selected whole amount that appears at checkout when Smart Tip is enabled and the transaction amount is less than $10.", + "nullable": true + } + } + }, + "CheckoutMerchantSettings": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "payment_methods": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethods", + "description": "The set of payment methods accepted for the merchant's account.", + "nullable": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the settings were last updated, in RFC 3339 format.\nExamples for January 25th, 2020 6:25:34pm Pacific Standard Time:\nUTC: 2020-01-26T02:25:34Z\nPacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00", + "readOnly": true + } + } + }, + "CheckoutMerchantSettingsPaymentMethods": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "apple_pay": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsPaymentMethod", + "nullable": true + }, + "google_pay": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsPaymentMethod", + "nullable": true + }, + "cash_app": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsPaymentMethod", + "nullable": true + }, + "afterpay_clearpay": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay", + "nullable": true + } + } + }, + "CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay": { + "type": "object", + "description": "The settings allowed for AfterpayClearpay.", + "x-release-status": "BETA", + "properties": { + "order_eligibility_range": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange", + "description": "Afterpay is shown as an option for order totals falling within the configured range.", + "nullable": true + }, + "item_eligibility_range": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange", + "description": "Afterpay is shown as an option for item totals falling within the configured range.", + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the payment method is enabled for the account.", + "readOnly": true + } + } + }, + "CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange": { + "type": "object", + "description": "A range of purchase price that qualifies.", + "x-release-status": "BETA", + "required": [ + "min", + "max" + ], + "properties": { + "min": { + "$ref": "#/components/schemas/Money" + }, + "max": { + "$ref": "#/components/schemas/Money" + } + } + }, + "CheckoutMerchantSettingsPaymentMethodsPaymentMethod": { + "type": "object", + "description": "The settings allowed for a payment method.", + "x-release-status": "BETA", + "properties": { + "enabled": { + "type": "boolean", + "description": "Indicates whether the payment method is enabled for the account.", + "nullable": true + } + } + }, + "CheckoutOptions": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "allow_tipping": { + "type": "boolean", + "description": "Indicates whether the payment allows tipping.", + "nullable": true + }, + "custom_fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomField" + }, + "description": "The custom fields requesting information from the buyer.", + "nullable": true + }, + "subscription_plan_id": { + "type": "string", + "description": "The ID of the subscription plan for the buyer to pay and subscribe.\nFor more information, see [Subscription Plan Checkout](https://developer.squareup.com/docs/checkout-api/subscription-plan-checkout).", + "maxLength": 255, + "nullable": true + }, + "redirect_url": { + "type": "string", + "description": "The confirmation page URL to redirect the buyer to after Square processes the payment.", + "maxLength": 2048, + "nullable": true + }, + "merchant_support_email": { + "type": "string", + "description": "The email address that buyers can use to contact the seller.", + "maxLength": 256, + "nullable": true + }, + "ask_for_shipping_address": { + "type": "boolean", + "description": "Indicates whether to include the address fields in the payment form.", + "nullable": true + }, + "accepted_payment_methods": { + "$ref": "#/components/schemas/AcceptedPaymentMethods", + "description": "The methods allowed for buyers during checkout.", + "nullable": true + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money that the developer is taking as a fee for facilitating the payment on behalf of the seller.\n\nThe amount cannot be more than 90% of the total amount of the payment.\n\nThe amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-monetary-amounts).\n\nThe fee currency code must match the currency associated with the seller that is accepting the payment. The application must be from a developer account in the same country and using the same currency code as the seller. For more information about the application fee scenario, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).\n\nTo set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/collect-fees/additional-considerations#permissions).", + "nullable": true + }, + "shipping_fee": { + "$ref": "#/components/schemas/ShippingFee", + "description": "The fee associated with shipping to be applied to the `Order` as a service charge.", + "nullable": true + }, + "enable_coupon": { + "type": "boolean", + "description": "Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing coupon in the payment form.", + "nullable": true + }, + "enable_loyalty": { + "type": "boolean", + "description": "Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem rewards in the payment form, or both.", + "nullable": true + } + } + }, + "CheckoutOptionsPaymentType": { + "type": "string", + "enum": [ + "CARD_PRESENT", + "MANUAL_CARD_ENTRY", + "FELICA_ID", + "FELICA_QUICPAY", + "FELICA_TRANSPORTATION_GROUP", + "FELICA_ALL", + "PAYPAY", + "QR_CODE" + ], + "x-enum-elements": [ + { + "name": "CARD_PRESENT", + "description": "Accept credit card or debit card payments via tap, dip or swipe." + }, + { + "name": "MANUAL_CARD_ENTRY", + "description": "Launches the manual credit or debit card entry screen for the buyer to complete." + }, + { + "name": "FELICA_ID", + "description": "Launches the iD checkout screen for the buyer to complete." + }, + { + "name": "FELICA_QUICPAY", + "description": "Launches the QUICPay checkout screen for the buyer to complete." + }, + { + "name": "FELICA_TRANSPORTATION_GROUP", + "description": "Launches the Transportation Group checkout screen for the buyer to complete." + }, + { + "name": "FELICA_ALL", + "description": "Launches a checkout screen for the buyer on the Square Terminal that\nallows them to select a specific FeliCa brand or select the check balance screen." + }, + { + "name": "PAYPAY", + "description": "Replaced by `QR_CODE`." + }, + { + "name": "QR_CODE", + "description": "Launches Square's QR Code checkout screen for the buyer to complete.\nDisplays a single code that supports all digital wallets connected to the target\nSeller location (e.g. PayPay)" + } + ], + "x-release-status": "PUBLIC" + }, + "ClearpayDetails": { + "type": "object", + "description": "Additional details about Clearpay payments.", + "x-release-status": "PUBLIC", + "properties": { + "email_address": { + "type": "string", + "description": "Email address on the buyer's Clearpay account.", + "maxLength": 255, + "nullable": true + } + } + }, + "CloneOrderRequest": { + "type": "object", + "description": "Defines the fields that are included in requests to the\n[CloneOrder](api-endpoint:Orders-CloneOrder) endpoint.", + "x-release-status": "BETA", + "required": [ + "order_id" + ], + "properties": { + "order_id": { + "type": "string", + "description": "The ID of the order to clone." + }, + "version": { + "type": "integer", + "description": "An optional order version for concurrency protection.\n\nIf a version is provided, it must match the latest stored version of the order to clone.\nIf a version is not provided, the API clones the latest version." + }, + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this clone request.\n\nIf you are unsure whether a particular order was cloned successfully,\nyou can reattempt the call with the same idempotency key without\nworrying about creating duplicate cloned orders.\nThe originally cloned order is returned.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "nullable": true + } + }, + "example": { + "idempotency_key": "UNIQUE_STRING", + "order_id": "ZAISEM52YcpmcWAzERDOyiWS123", + "version": 3 + } + }, + "CloneOrderResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CloneOrder](api-endpoint:Orders-CloneOrder) endpoint.", + "x-release-status": "BETA", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The cloned order." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "order": { + "created_at": "2020-01-17T20:47:53.293Z", + "discounts": [ + { + "applied_money": { + "amount": 30, + "currency": "USD" + }, + "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", + "name": "Membership Discount", + "percentage": "0.5", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "membership-discount" + }, + { + "applied_money": { + "amount": 303, + "currency": "USD" + }, + "name": "Labor Day Sale", + "percentage": "5", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "labor-day-sale" + }, + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "name": "Sale - $1.00 off", + "scope": "LINE_ITEM", + "type": "FIXED_AMOUNT", + "uid": "one-dollar-off" + } + ], + "id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "line_items": [ + { + "applied_discounts": [ + { + "applied_money": { + "amount": 8, + "currency": "USD" + }, + "discount_uid": "membership-discount", + "uid": "jWdgP1TpHPFBuVrz81mXVC" + }, + { + "applied_money": { + "amount": 79, + "currency": "USD" + }, + "discount_uid": "labor-day-sale", + "uid": "jnZOjjVY57eRcQAVgEwFuC" + } + ], + "applied_taxes": [ + { + "applied_money": { + "amount": 136, + "currency": "USD" + }, + "tax_uid": "state-sales-tax", + "uid": "aKG87ArnDpvMLSZJHxWUl" + } + ], + "base_price_money": { + "amount": 1599, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 1599, + "currency": "USD" + }, + "name": "New York Strip Steak", + "quantity": "1", + "total_discount_money": { + "amount": 87, + "currency": "USD" + }, + "total_money": { + "amount": 1648, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 136, + "currency": "USD" + }, + "uid": "8uSwfzvUImn3IRrvciqlXC", + "variation_total_price_money": { + "amount": 1599, + "currency": "USD" + } + }, + { + "applied_discounts": [ + { + "applied_money": { + "amount": 22, + "currency": "USD" + }, + "discount_uid": "membership-discount", + "uid": "nUXvdsIItfKko0dbYtY58C" + }, + { + "applied_money": { + "amount": 224, + "currency": "USD" + }, + "discount_uid": "labor-day-sale", + "uid": "qSdkOOOernlVQqsJ94SPjB" + }, + { + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "discount_uid": "one-dollar-off", + "uid": "y7bVl4njrWAnfDwmz19izB" + } + ], + "applied_taxes": [ + { + "applied_money": { + "amount": 374, + "currency": "USD" + }, + "tax_uid": "state-sales-tax", + "uid": "v1dAgrfUVUPTnVTf9sRPz" + } + ], + "base_price_money": { + "amount": 2200, + "currency": "USD" + }, + "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", + "gross_sales_money": { + "amount": 4500, + "currency": "USD" + }, + "modifiers": [ + { + "base_price_money": { + "amount": 50, + "currency": "USD" + }, + "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ", + "name": "Well", + "total_price_money": { + "amount": 100, + "currency": "USD" + }, + "uid": "Lo3qMMckDluu9Qsb58d4CC" + } + ], + "name": "New York Steak", + "quantity": "2", + "total_discount_money": { + "amount": 346, + "currency": "USD" + }, + "total_money": { + "amount": 4528, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 374, + "currency": "USD" + }, + "uid": "v8ZuEXpOJpb0bazLuvrLDB", + "variation_name": "Larger", + "variation_total_price_money": { + "amount": 4400, + "currency": "USD" + } + } + ], + "location_id": "057P5VYJ4A5X1", + "net_amounts": { + "discount_money": { + "amount": 433, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 510, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 6176, + "currency": "USD" + } + }, + "reference_id": "my-order-001", + "source": { + "name": "My App" + }, + "state": "DRAFT", + "taxes": [ + { + "applied_money": { + "amount": 510, + "currency": "USD" + }, + "name": "State Sales Tax", + "percentage": "9", + "scope": "ORDER", + "type": "ADDITIVE", + "uid": "state-sales-tax" + } + ], + "total_discount_money": { + "amount": 433, + "currency": "USD" + }, + "total_money": { + "amount": 6176, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 510, + "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2020-01-17T20:47:53.293Z", + "version": 1 + } + } + }, + "CollectedData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "input_text": { + "type": "string", + "description": "The buyer's input text.", + "readOnly": true + } + } + }, + "CompletePaymentRequest": { + "type": "object", + "description": "Describes a request to complete (capture) a payment using \n[CompletePayment](api-endpoint:Payments-CompletePayment).\n\nBy default, payments are set to `autocomplete` immediately after they are created.\nTo complete payments manually, set `autocomplete` to `false`.", + "x-release-status": "PUBLIC", + "properties": { + "version_token": { + "type": "string", + "description": "Used for optimistic concurrency. This opaque token identifies the current `Payment` \nversion that the caller expects. If the server has a different version of the Payment, \nthe update fails and a response with a VERSION_MISMATCH error is returned.", + "x-release-status": "BETA", + "nullable": true + } + }, + "example": {} + }, + "CompletePaymentResponse": { + "type": "object", + "description": "Defines the response returned by[CompletePayment](api-endpoint:Payments-CompletePayment).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The successfully completed payment." + } + }, + "example": { + "payment": { + "amount_money": { + "amount": 555, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", + "square_product": "VIRTUAL_TERMINAL" + }, + "approved_money": { + "amount": 555, + "currency": "USD" + }, + "card_details": { + "auth_result_code": "2Nkw7q", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T19:34:33.680Z", + "captured_at": "2021-10-13T19:34:34.340Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "KEYED", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "CAPTURED" + }, + "created_at": "2021-10-13T19:34:33.524Z", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T19:34:33.524Z", + "employee_id": "TMoK_ogh6rH1o4dV", + "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "location_id": "L88917AVBK2S5", + "note": "Test Note", + "order_id": "d7eKah653Z579f3gVtjlxpSlmUcZY", + "processing_fee": [ + { + "amount_money": { + "amount": 34, + "currency": "USD" + }, + "effective_at": "2021-10-13T21:34:35.000Z", + "type": "INITIAL" + } + ], + "receipt_number": "bP9m", + "receipt_url": "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "source_type": "CARD", + "status": "COMPLETED", + "team_member_id": "TMoK_ogh6rH1o4dV", + "total_money": { + "amount": 555, + "currency": "USD" + }, + "updated_at": "2021-10-13T19:34:34.339Z", + "version_token": "56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o" + } + } + }, + "Component": { + "type": "object", + "description": "The wrapper object for the component entries of a given component type.", + "x-release-status": "BETA", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/ComponentComponentType", + "description": "The type of this component. Each component type has expected properties expressed\nin a structured format within its corresponding `*_details` field.\nSee [ComponentType](#type-componenttype) for possible values" + }, + "application_details": { + "$ref": "#/components/schemas/DeviceComponentDetailsApplicationDetails", + "description": "Structured data for an `Application`, set for Components of type `APPLICATION`.", + "nullable": true + }, + "card_reader_details": { + "$ref": "#/components/schemas/DeviceComponentDetailsCardReaderDetails", + "description": "Structured data for a `CardReader`, set for Components of type `CARD_READER`.", + "nullable": true + }, + "battery_details": { + "$ref": "#/components/schemas/DeviceComponentDetailsBatteryDetails", + "description": "Structured data for a `Battery`, set for Components of type `BATTERY`.", + "nullable": true + }, + "wifi_details": { + "$ref": "#/components/schemas/DeviceComponentDetailsWiFiDetails", + "description": "Structured data for a `WiFi` interface, set for Components of type `WIFI`.", + "nullable": true + }, + "ethernet_details": { + "$ref": "#/components/schemas/DeviceComponentDetailsEthernetDetails", + "description": "Structured data for an `Ethernet` interface, set for Components of type `ETHERNET`.", + "nullable": true + } + } + }, + "ComponentComponentType": { + "type": "string", + "enum": [ + "APPLICATION", + "CARD_READER", + "BATTERY", + "WIFI", + "ETHERNET", + "PRINTER" + ], + "x-enum-elements": [ + { + "name": "APPLICATION", + "description": "" + }, + { + "name": "CARD_READER", + "description": "" + }, + { + "name": "BATTERY", + "description": "" + }, + { + "name": "WIFI", + "description": "" + }, + { + "name": "ETHERNET", + "description": "" + }, + { + "name": "PRINTER", + "description": "" + } + ], + "description": "An enum for ComponentType.", + "x-release-status": "BETA" + }, + "ConfirmationDecision": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "has_agreed": { + "type": "boolean", + "description": "The buyer's decision to the displayed terms.", + "readOnly": true + } + } + }, + "ConfirmationOptions": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "title", + "body", + "agree_button_text" + ], + "properties": { + "title": { + "type": "string", + "description": "The title text to display in the confirmation screen flow on the Terminal.", + "minLength": 1, + "maxLength": 250 + }, + "body": { + "type": "string", + "description": "The agreement details to display in the confirmation flow on the Terminal.", + "minLength": 1, + "maxLength": 10000 + }, + "agree_button_text": { + "type": "string", + "description": "The button text to display indicating the customer agrees to the displayed terms.", + "minLength": 1, + "maxLength": 250 + }, + "disagree_button_text": { + "type": "string", + "description": "The button text to display indicating the customer does not agree to the displayed terms.", + "minLength": 1, + "maxLength": 250, + "nullable": true + }, + "decision": { + "$ref": "#/components/schemas/ConfirmationDecision", + "description": "The result of the buyer’s actions when presented with the confirmation screen.", + "readOnly": true + } + } + }, + "Coordinates": { + "type": "object", + "description": "Latitude and longitude coordinates.", + "x-release-status": "PUBLIC", + "properties": { + "latitude": { + "type": "number", + "description": "The latitude of the coordinate expressed in degrees.", + "nullable": true + }, + "longitude": { + "type": "number", + "description": "The longitude of the coordinate expressed in degrees.", + "nullable": true + } + } + }, + "Country": { + "type": "string", + "enum": [ + "ZZ", + "AD", + "AE", + "AF", + "AG", + "AI", + "AL", + "AM", + "AO", + "AQ", + "AR", + "AS", + "AT", + "AU", + "AW", + "AX", + "AZ", + "BA", + "BB", + "BD", + "BE", + "BF", + "BG", + "BH", + "BI", + "BJ", + "BL", + "BM", + "BN", + "BO", + "BQ", + "BR", + "BS", + "BT", + "BV", + "BW", + "BY", + "BZ", + "CA", + "CC", + "CD", + "CF", + "CG", + "CH", + "CI", + "CK", + "CL", + "CM", + "CN", + "CO", + "CR", + "CU", + "CV", + "CW", + "CX", + "CY", + "CZ", + "DE", + "DJ", + "DK", + "DM", + "DO", + "DZ", + "EC", + "EE", + "EG", + "EH", + "ER", + "ES", + "ET", + "FI", + "FJ", + "FK", + "FM", + "FO", + "FR", + "GA", + "GB", + "GD", + "GE", + "GF", + "GG", + "GH", + "GI", + "GL", + "GM", + "GN", + "GP", + "GQ", + "GR", + "GS", + "GT", + "GU", + "GW", + "GY", + "HK", + "HM", + "HN", + "HR", + "HT", + "HU", + "ID", + "IE", + "IL", + "IM", + "IN", + "IO", + "IQ", + "IR", + "IS", + "IT", + "JE", + "JM", + "JO", + "JP", + "KE", + "KG", + "KH", + "KI", + "KM", + "KN", + "KP", + "KR", + "KW", + "KY", + "KZ", + "LA", + "LB", + "LC", + "LI", + "LK", + "LR", + "LS", + "LT", + "LU", + "LV", + "LY", + "MA", + "MC", + "MD", + "ME", + "MF", + "MG", + "MH", + "MK", + "ML", + "MM", + "MN", + "MO", + "MP", + "MQ", + "MR", + "MS", + "MT", + "MU", + "MV", + "MW", + "MX", + "MY", + "MZ", + "NA", + "NC", + "NE", + "NF", + "NG", + "NI", + "NL", + "NO", + "NP", + "NR", + "NU", + "NZ", + "OM", + "PA", + "PE", + "PF", + "PG", + "PH", + "PK", + "PL", + "PM", + "PN", + "PR", + "PS", + "PT", + "PW", + "PY", + "QA", + "RE", + "RO", + "RS", + "RU", + "RW", + "SA", + "SB", + "SC", + "SD", + "SE", + "SG", + "SH", + "SI", + "SJ", + "SK", + "SL", + "SM", + "SN", + "SO", + "SR", + "SS", + "ST", + "SV", + "SX", + "SY", + "SZ", + "TC", + "TD", + "TF", + "TG", + "TH", + "TJ", + "TK", + "TL", + "TM", + "TN", + "TO", + "TR", + "TT", + "TV", + "TW", + "TZ", + "UA", + "UG", + "UM", + "US", + "UY", + "UZ", + "VA", + "VC", + "VE", + "VG", + "VI", + "VN", + "VU", + "WF", + "WS", + "YE", + "YT", + "ZA", + "ZM", + "ZW" + ], + "x-enum-elements": [ + { + "name": "ZZ", + "description": "Unknown" + }, + { + "name": "AD", + "description": "Andorra" + }, + { + "name": "AE", + "description": "United Arab Emirates" + }, + { + "name": "AF", + "description": "Afghanistan" + }, + { + "name": "AG", + "description": "Antigua and Barbuda" + }, + { + "name": "AI", + "description": "Anguilla" + }, + { + "name": "AL", + "description": "Albania" + }, + { + "name": "AM", + "description": "Armenia" + }, + { + "name": "AO", + "description": "Angola" + }, + { + "name": "AQ", + "description": "Antartica" + }, + { + "name": "AR", + "description": "Argentina" + }, + { + "name": "AS", + "description": "American Samoa" + }, + { + "name": "AT", + "description": "Austria" + }, + { + "name": "AU", + "description": "Australia" + }, + { + "name": "AW", + "description": "Aruba" + }, + { + "name": "AX", + "description": "Åland Islands" + }, + { + "name": "AZ", + "description": "Azerbaijan" + }, + { + "name": "BA", + "description": "Bosnia and Herzegovina" + }, + { + "name": "BB", + "description": "Barbados" + }, + { + "name": "BD", + "description": "Bangladesh" + }, + { + "name": "BE", + "description": "Belgium" + }, + { + "name": "BF", + "description": "Burkina Faso" + }, + { + "name": "BG", + "description": "Bulgaria" + }, + { + "name": "BH", + "description": "Bahrain" + }, + { + "name": "BI", + "description": "Burundi" + }, + { + "name": "BJ", + "description": "Benin" + }, + { + "name": "BL", + "description": "Saint Barthélemy" + }, + { + "name": "BM", + "description": "Bermuda" + }, + { + "name": "BN", + "description": "Brunei" + }, + { + "name": "BO", + "description": "Bolivia" + }, + { + "name": "BQ", + "description": "Bonaire" + }, + { + "name": "BR", + "description": "Brazil" + }, + { + "name": "BS", + "description": "Bahamas" + }, + { + "name": "BT", + "description": "Bhutan" + }, + { + "name": "BV", + "description": "Bouvet Island" + }, + { + "name": "BW", + "description": "Botswana" + }, + { + "name": "BY", + "description": "Belarus" + }, + { + "name": "BZ", + "description": "Belize" + }, + { + "name": "CA", + "description": "Canada" + }, + { + "name": "CC", + "description": "Cocos Islands" + }, + { + "name": "CD", + "description": "Democratic Republic of the Congo" + }, + { + "name": "CF", + "description": "Central African Republic" + }, + { + "name": "CG", + "description": "Congo" + }, + { + "name": "CH", + "description": "Switzerland" + }, + { + "name": "CI", + "description": "Ivory Coast" + }, + { + "name": "CK", + "description": "Cook Islands" + }, + { + "name": "CL", + "description": "Chile" + }, + { + "name": "CM", + "description": "Cameroon" + }, + { + "name": "CN", + "description": "China" + }, + { + "name": "CO", + "description": "Colombia" + }, + { + "name": "CR", + "description": "Costa Rica" + }, + { + "name": "CU", + "description": "Cuba" + }, + { + "name": "CV", + "description": "Cabo Verde" + }, + { + "name": "CW", + "description": "Curaçao" + }, + { + "name": "CX", + "description": "Christmas Island" + }, + { + "name": "CY", + "description": "Cyprus" + }, + { + "name": "CZ", + "description": "Czechia" + }, + { + "name": "DE", + "description": "Germany" + }, + { + "name": "DJ", + "description": "Djibouti" + }, + { + "name": "DK", + "description": "Denmark" + }, + { + "name": "DM", + "description": "Dominica" + }, + { + "name": "DO", + "description": "Dominican Republic" + }, + { + "name": "DZ", + "description": "Algeria" + }, + { + "name": "EC", + "description": "Ecuador" + }, + { + "name": "EE", + "description": "Estonia" + }, + { + "name": "EG", + "description": "Egypt" + }, + { + "name": "EH", + "description": "Western Sahara" + }, + { + "name": "ER", + "description": "Eritrea" + }, + { + "name": "ES", + "description": "Spain" + }, + { + "name": "ET", + "description": "Ethiopia" + }, + { + "name": "FI", + "description": "Finland" + }, + { + "name": "FJ", + "description": "Fiji" + }, + { + "name": "FK", + "description": "Falkland Islands" + }, + { + "name": "FM", + "description": "Federated States of Micronesia" + }, + { + "name": "FO", + "description": "Faroe Islands" + }, + { + "name": "FR", + "description": "France" + }, + { + "name": "GA", + "description": "Gabon" + }, + { + "name": "GB", + "description": "United Kingdom" + }, + { + "name": "GD", + "description": "Grenada" + }, + { + "name": "GE", + "description": "Georgia" + }, + { + "name": "GF", + "description": "French Guiana" + }, + { + "name": "GG", + "description": "Guernsey" + }, + { + "name": "GH", + "description": "Ghana" + }, + { + "name": "GI", + "description": "Gibraltar" + }, + { + "name": "GL", + "description": "Greenland" + }, + { + "name": "GM", + "description": "Gambia" + }, + { + "name": "GN", + "description": "Guinea" + }, + { + "name": "GP", + "description": "Guadeloupe" + }, + { + "name": "GQ", + "description": "Equatorial Guinea" + }, + { + "name": "GR", + "description": "Greece" + }, + { + "name": "GS", + "description": "South Georgia and the South Sandwich Islands" + }, + { + "name": "GT", + "description": "Guatemala" + }, + { + "name": "GU", + "description": "Guam" + }, + { + "name": "GW", + "description": "Guinea-Bissau" + }, + { + "name": "GY", + "description": "Guyana" + }, + { + "name": "HK", + "description": "Hong Kong" + }, + { + "name": "HM", + "description": "Heard Island and McDonald Islands" + }, + { + "name": "HN", + "description": "Honduras" + }, + { + "name": "HR", + "description": "Croatia" + }, + { + "name": "HT", + "description": "Haiti" + }, + { + "name": "HU", + "description": "Hungary" + }, + { + "name": "ID", + "description": "Indonesia" + }, + { + "name": "IE", + "description": "Ireland" + }, + { + "name": "IL", + "description": "Israel" + }, + { + "name": "IM", + "description": "Isle of Man" + }, + { + "name": "IN", + "description": "India" + }, + { + "name": "IO", + "description": "British Indian Ocean Territory" + }, + { + "name": "IQ", + "description": "Iraq" + }, + { + "name": "IR", + "description": "Iran" + }, + { + "name": "IS", + "description": "Iceland" + }, + { + "name": "IT", + "description": "Italy" + }, + { + "name": "JE", + "description": "Jersey" + }, + { + "name": "JM", + "description": "Jamaica" + }, + { + "name": "JO", + "description": "Jordan" + }, + { + "name": "JP", + "description": "Japan" + }, + { + "name": "KE", + "description": "Kenya" + }, + { + "name": "KG", + "description": "Kyrgyzstan" + }, + { + "name": "KH", + "description": "Cambodia" + }, + { + "name": "KI", + "description": "Kiribati" + }, + { + "name": "KM", + "description": "Comoros" + }, + { + "name": "KN", + "description": "Saint Kitts and Nevis" + }, + { + "name": "KP", + "description": "Democratic People's Republic of Korea" + }, + { + "name": "KR", + "description": "Republic of Korea" + }, + { + "name": "KW", + "description": "Kuwait" + }, + { + "name": "KY", + "description": "Cayman Islands" + }, + { + "name": "KZ", + "description": "Kazakhstan" + }, + { + "name": "LA", + "description": "Lao People's Democratic Republic" + }, + { + "name": "LB", + "description": "Lebanon" + }, + { + "name": "LC", + "description": "Saint Lucia" + }, + { + "name": "LI", + "description": "Liechtenstein" + }, + { + "name": "LK", + "description": "Sri Lanka" + }, + { + "name": "LR", + "description": "Liberia" + }, + { + "name": "LS", + "description": "Lesotho" + }, + { + "name": "LT", + "description": "Lithuania" + }, + { + "name": "LU", + "description": "Luxembourg" + }, + { + "name": "LV", + "description": "Latvia" + }, + { + "name": "LY", + "description": "Libya" + }, + { + "name": "MA", + "description": "Morocco" + }, + { + "name": "MC", + "description": "Monaco" + }, + { + "name": "MD", + "description": "Moldova" + }, + { + "name": "ME", + "description": "Montenegro" + }, + { + "name": "MF", + "description": "Saint Martin" + }, + { + "name": "MG", + "description": "Madagascar" + }, + { + "name": "MH", + "description": "Marshall Islands" + }, + { + "name": "MK", + "description": "North Macedonia" + }, + { + "name": "ML", + "description": "Mali" + }, + { + "name": "MM", + "description": "Myanmar" + }, + { + "name": "MN", + "description": "Mongolia" + }, + { + "name": "MO", + "description": "Macao" + }, + { + "name": "MP", + "description": "Northern Mariana Islands" + }, + { + "name": "MQ", + "description": "Martinique" + }, + { + "name": "MR", + "description": "Mauritania" + }, + { + "name": "MS", + "description": "Montserrat" + }, + { + "name": "MT", + "description": "Malta" + }, + { + "name": "MU", + "description": "Mauritius" + }, + { + "name": "MV", + "description": "Maldives" + }, + { + "name": "MW", + "description": "Malawi" + }, + { + "name": "MX", + "description": "Mexico" + }, + { + "name": "MY", + "description": "Malaysia" + }, + { + "name": "MZ", + "description": "Mozambique" + }, + { + "name": "NA", + "description": "Namibia" + }, + { + "name": "NC", + "description": "New Caledonia" + }, + { + "name": "NE", + "description": "Niger" + }, + { + "name": "NF", + "description": "Norfolk Island" + }, + { + "name": "NG", + "description": "Nigeria" + }, + { + "name": "NI", + "description": "Nicaragua" + }, + { + "name": "NL", + "description": "Netherlands" + }, + { + "name": "NO", + "description": "Norway" + }, + { + "name": "NP", + "description": "Nepal" + }, + { + "name": "NR", + "description": "Nauru" + }, + { + "name": "NU", + "description": "Niue" + }, + { + "name": "NZ", + "description": "New Zealand" + }, + { + "name": "OM", + "description": "Oman" + }, + { + "name": "PA", + "description": "Panama" + }, + { + "name": "PE", + "description": "Peru" + }, + { + "name": "PF", + "description": "French Polynesia" + }, + { + "name": "PG", + "description": "Papua New Guinea" + }, + { + "name": "PH", + "description": "Philippines" + }, + { + "name": "PK", + "description": "Pakistan" + }, + { + "name": "PL", + "description": "Poland" + }, + { + "name": "PM", + "description": "Saint Pierre and Miquelon" + }, + { + "name": "PN", + "description": "Pitcairn" + }, + { + "name": "PR", + "description": "Puerto Rico" + }, + { + "name": "PS", + "description": "Palestine" + }, + { + "name": "PT", + "description": "Portugal" + }, + { + "name": "PW", + "description": "Palau" + }, + { + "name": "PY", + "description": "Paraguay" + }, + { + "name": "QA", + "description": "Qatar" + }, + { + "name": "RE", + "description": "Réunion" + }, + { + "name": "RO", + "description": "Romania" + }, + { + "name": "RS", + "description": "Serbia" + }, + { + "name": "RU", + "description": "Russia" + }, + { + "name": "RW", + "description": "Rwanda" + }, + { + "name": "SA", + "description": "Saudi Arabia" + }, + { + "name": "SB", + "description": "Solomon Islands" + }, + { + "name": "SC", + "description": "Seychelles" + }, + { + "name": "SD", + "description": "Sudan" + }, + { + "name": "SE", + "description": "Sweden" + }, + { + "name": "SG", + "description": "Singapore" + }, + { + "name": "SH", + "description": "Saint Helena, Ascension and Tristan da Cunha" + }, + { + "name": "SI", + "description": "Slovenia" + }, + { + "name": "SJ", + "description": "Svalbard and Jan Mayen" + }, + { + "name": "SK", + "description": "Slovakia" + }, + { + "name": "SL", + "description": "Sierra Leone" + }, + { + "name": "SM", + "description": "San Marino" + }, + { + "name": "SN", + "description": "Senegal" + }, + { + "name": "SO", + "description": "Somalia" + }, + { + "name": "SR", + "description": "Suriname" + }, + { + "name": "SS", + "description": "South Sudan" + }, + { + "name": "ST", + "description": "Sao Tome and Principe" + }, + { + "name": "SV", + "description": "El Salvador" + }, + { + "name": "SX", + "description": "Sint Maarten" + }, + { + "name": "SY", + "description": "Syrian Arab Republic" + }, + { + "name": "SZ", + "description": "Eswatini" + }, + { + "name": "TC", + "description": "Turks and Caicos Islands" + }, + { + "name": "TD", + "description": "Chad" + }, + { + "name": "TF", + "description": "French Southern Territories" + }, + { + "name": "TG", + "description": "Togo" + }, + { + "name": "TH", + "description": "Thailand" + }, + { + "name": "TJ", + "description": "Tajikistan" + }, + { + "name": "TK", + "description": "Tokelau" + }, + { + "name": "TL", + "description": "Timor-Leste" + }, + { + "name": "TM", + "description": "Turkmenistan" + }, + { + "name": "TN", + "description": "Tunisia" + }, + { + "name": "TO", + "description": "Tonga" + }, + { + "name": "TR", + "description": "Turkey" + }, + { + "name": "TT", + "description": "Trinidad and Tobago" + }, + { + "name": "TV", + "description": "Tuvalu" + }, + { + "name": "TW", + "description": "Taiwan" + }, + { + "name": "TZ", + "description": "Tanzania" + }, + { + "name": "UA", + "description": "Ukraine" + }, + { + "name": "UG", + "description": "Uganda" + }, + { + "name": "UM", + "description": "United States Minor Outlying Islands" + }, + { + "name": "US", + "description": "United States of America" + }, + { + "name": "UY", + "description": "Uruguay" + }, + { + "name": "UZ", + "description": "Uzbekistan" + }, + { + "name": "VA", + "description": "Vatican City" + }, + { + "name": "VC", + "description": "Saint Vincent and the Grenadines" + }, + { + "name": "VE", + "description": "Venezuela" + }, + { + "name": "VG", + "description": "British Virgin Islands" + }, + { + "name": "VI", + "description": "U.S. Virgin Islands" + }, + { + "name": "VN", + "description": "Vietnam" + }, + { + "name": "VU", + "description": "Vanuatu" + }, + { + "name": "WF", + "description": "Wallis and Futuna" + }, + { + "name": "WS", + "description": "Samoa" + }, + { + "name": "YE", + "description": "Yemen" + }, + { + "name": "YT", + "description": "Mayotte" + }, + { + "name": "ZA", + "description": "South Africa" + }, + { + "name": "ZM", + "description": "Zambia" + }, + { + "name": "ZW", + "description": "Zimbabwe" + } + ], + "description": "Indicates the country associated with another entity, such as a business.\nValues are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm).", + "x-release-status": "PUBLIC" + }, + "CreateBookingCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents a [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) request.", + "x-release-status": "PUBLIC", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition to create, with the following fields:\n\n- `key`\n\n- `name`. If provided, `name` must be unique (case-sensitive) across all visible booking-related custom attribute\ndefinitions for the seller.\n\n- `description`\n\n- `visibility`. Note that all custom attributes are visible in exported booking data, including those set to\n`VISIBILITY_HIDDEN`.\n\n- `schema`. With the exception of the `Selection` data type, the `schema` is specified as a\nsimple URL to the JSON schema definition hosted on the Square CDN. For more information, see\n[Specifying the schema](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attribute-definitions#specify-schema)." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45 + } + } + }, + "CreateBookingCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The newly created custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-11-16T15:27:30Z", + "description": "The favorite shampoo of the customer.", + "key": "favoriteShampoo", + "name": "Favorite Shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-16T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + }, + "errors": [] + } + }, + "CreateBookingRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "booking" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key to make this request an idempotent operation.", + "maxLength": 255 + }, + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The details of the booking to be created." + } + } + }, + "CreateBookingResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The booking that was created." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "booking": { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "created_at": "2020-10-28T15:47:41Z", + "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + "customer_note": "", + "id": "zkras0xv0xwswx", + "location_id": "LEQHH0YY8B42M", + "seller_note": "", + "start_at": "2020-11-26T13:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-10-28T15:47:41Z", + "version": 0 + }, + "errors": [] + } + }, + "CreateBreakTypeRequest": { + "type": "object", + "description": "A request to create a new `BreakType`.", + "x-release-status": "PUBLIC", + "required": [ + "break_type" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string value to ensure the idempotency of the operation.", + "maxLength": 128 + }, + "break_type": { + "$ref": "#/components/schemas/BreakType", + "description": "The `BreakType` to be created." + } + }, + "example": { + "break_type": { + "break_name": "Lunch Break", + "expected_duration": "PT30M", + "is_paid": true, + "location_id": "CGJN03P1D08GF" + }, + "idempotency_key": "PAD3NG5KSN2GL" + } + }, + "CreateBreakTypeResponse": { + "type": "object", + "description": "The response to the request to create a `BreakType`. The response contains\nthe created `BreakType` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "break_type": { + "$ref": "#/components/schemas/BreakType", + "description": "The `BreakType` that was created by the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "break_type": { + "break_name": "Lunch Break", + "created_at": "2019-02-26T22:42:54Z", + "expected_duration": "PT30M", + "id": "49SSVDJG76WF3", + "is_paid": true, + "location_id": "CGJN03P1D08GF", + "updated_at": "2019-02-26T22:42:54Z", + "version": 1 + } + } + }, + "CreateCardRequest": { + "type": "object", + "description": "Creates a card from the source (payment token or payment id). Accessible via\nHTTP requests at POST https://connect.squareup.com/v2/cards", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "source_id", + "card" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this CreateCard request. Keys can be\nany valid string and must be unique for every request.\n\nMax: 45 characters\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1 + }, + "source_id": { + "type": "string", + "description": "The ID of the source which represents the card information to be stored. This can be a card nonce or a payment id.", + "minLength": 1, + "maxLength": 16384 + }, + "verification_token": { + "type": "string", + "description": "An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).\nVerification tokens encapsulate customer device information and 3-D Secure\nchallenge results to indicate that Square has verified the buyer identity.\n\nSee the [SCA Overview](https://developer.squareup.com/docs/sca-overview)." + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "Payment details associated with the card to be stored." + } + }, + "example": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "reference_id": "user-id-1" + }, + "idempotency_key": "4935a656-a929-4792-b97c-8848be85c27c", + "source_id": "cnon:uIbfJXhXETSP197M3GB" + } + }, + "CreateCardResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CreateCard](api-endpoint:Cards-CreateCard) endpoint.\n\nNote: if there are errors processing the request, the card field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors resulting from the request." + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The card created by the request." + } + }, + "example": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + } + } + }, + "CreateCatalogImageRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "image" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this CreateCatalogImage request.\nKeys can be any valid string but must be unique for every CreateCatalogImage request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 128 + }, + "object_id": { + "type": "string", + "description": "Unique ID of the `CatalogObject` to attach this `CatalogImage` object to. Leave this\nfield empty to create unattached images, for example if you are building an integration\nwhere an image can be attached to catalog items at a later time." + }, + "image": { + "$ref": "#/components/schemas/CatalogObject", + "description": "The new `CatalogObject` of the `IMAGE` type, namely, a `CatalogImage` object, to encapsulate the specified image file." + }, + "is_primary": { + "type": "boolean", + "description": "If this is set to `true`, the image created will be the primary, or first image of the object referenced by `object_id`.\nIf the `CatalogObject` already has a primary `CatalogImage`, setting this field to `true` will replace the primary image.\nIf this is set to `false` and you use the Square API version 2021-12-15 or later, the image id will be appended to the list of `image_ids` on the object.\n\nWith Square API version 2021-12-15 or later, the default value is `false`. Otherwise, the effective default value is `true`.", + "x-release-status": "BETA" + } + }, + "example": { + "idempotency_key": "528dea59-7bfb-43c1-bd48-4a6bba7dd61f86", + "image": { + "id": "#TEMP_ID", + "image_data": { + "caption": "A picture of a cup of coffee" + }, + "type": "IMAGE" + }, + "object_id": "ND6EA5AAJEO5WL3JNNIAQA32" + } + }, + "CreateCatalogImageResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "image": { + "$ref": "#/components/schemas/CatalogObject", + "description": "The newly created `CatalogImage` including a Square-generated\nURL for the encapsulated image file." + } + }, + "example": { + "image": { + "id": "KQLFFHA6K6J3YQAQAWDQAL57", + "image_data": { + "caption": "A picture of a cup of coffee", + "url": "https://..." + }, + "type": "IMAGE" + } + } + }, + "CreateCheckoutRequest": { + "type": "object", + "description": "Defines the parameters that can be included in the body of\na request to the `CreateCheckout` endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "order" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this checkout among others you have created. It can be\nany valid string but must be unique for every order sent to Square Checkout for a given location ID.\n\nThe idempotency key is used to avoid processing the same order more than once. If you are \nunsure whether a particular checkout was created successfully, you can attempt it again with\nthe same idempotency key and all the same other parameters without worrying about creating duplicates.\n\nYou should use a random number/string generator native to the language\nyou are working in to generate strings for your idempotency keys.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1, + "maxLength": 192 + }, + "order": { + "$ref": "#/components/schemas/CreateOrderRequest", + "description": "The order including line items to be checked out." + }, + "ask_for_shipping_address": { + "type": "boolean", + "description": "If `true`, Square Checkout collects shipping information on your behalf and stores \nthat information with the transaction information in the Square Seller Dashboard.\n\nDefault: `false`." + }, + "merchant_support_email": { + "type": "string", + "description": "The email address to display on the Square Checkout confirmation page\nand confirmation email that the buyer can use to contact the seller.\n\nIf this value is not set, the confirmation page and email display the\nprimary email address associated with the seller's Square account.\n\nDefault: none; only exists if explicitly set.", + "maxLength": 254 + }, + "pre_populate_buyer_email": { + "type": "string", + "description": "If provided, the buyer's email is prepopulated on the checkout page\nas an editable text field.\n\nDefault: none; only exists if explicitly set.", + "maxLength": 254 + }, + "pre_populate_shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "If provided, the buyer's shipping information is prepopulated on the\ncheckout page as editable text fields.\n\nDefault: none; only exists if explicitly set." + }, + "redirect_url": { + "type": "string", + "description": "The URL to redirect to after the checkout is completed with `checkoutId`,\n`transactionId`, and `referenceId` appended as URL parameters. For example,\nif the provided redirect URL is `http://www.example.com/order-complete`, a\nsuccessful transaction redirects the customer to:\n\n`http://www.example.com/order-complete?checkoutId=xxxxxx\u0026amp;referenceId=xxxxxx\u0026amp;transactionId=xxxxxx`\n\nIf you do not provide a redirect URL, Square Checkout displays an order\nconfirmation page on your behalf; however, it is strongly recommended that\nyou provide a redirect URL so you can verify the transaction results and\nfinalize the order through your existing/normal confirmation workflow.\n\nDefault: none; only exists if explicitly set.", + "maxLength": 800 + }, + "additional_recipients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChargeRequestAdditionalRecipient" + }, + "description": "The basic primitive of a multi-party transaction. The value is optional.\nThe transaction facilitated by you can be split from here.\n\nIf you provide this value, the `amount_money` value in your `additional_recipients` field\ncannot be more than 90% of the `total_money` calculated by Square for your order.\nThe `location_id` must be a valid seller location where the checkout is occurring.\n\nThis field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission.\n\nThis field is currently not supported in the Square Sandbox." + }, + "note": { + "type": "string", + "description": "An optional note to associate with the `checkout` object.\n\nThis value cannot exceed 60 characters.", + "maxLength": 60 + } + }, + "example": { + "additional_recipients": [ + { + "amount_money": { + "amount": 60, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "ask_for_shipping_address": true, + "idempotency_key": "86ae1696-b1e3-4328-af6d-f1e04d947ad6", + "merchant_support_email": "merchant+support@website.com", + "order": { + "idempotency_key": "12ae1696-z1e3-4328-af6d-f1e04d947gd4", + "order": { + "customer_id": "customer_id", + "discounts": [ + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "scope": "LINE_ITEM", + "type": "FIXED_AMOUNT", + "uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" + } + ], + "line_items": [ + { + "applied_discounts": [ + { + "discount_uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" + } + ], + "applied_taxes": [ + { + "tax_uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" + } + ], + "base_price_money": { + "amount": 1500, + "currency": "USD" + }, + "name": "Printed T Shirt", + "quantity": "2" + }, + { + "base_price_money": { + "amount": 2500, + "currency": "USD" + }, + "name": "Slim Jeans", + "quantity": "1" + }, + { + "base_price_money": { + "amount": 3500, + "currency": "USD" + }, + "name": "Woven Sweater", + "quantity": "3" + } + ], + "location_id": "location_id", + "reference_id": "reference_id", + "taxes": [ + { + "percentage": "7.75", + "scope": "LINE_ITEM", + "type": "INCLUSIVE", + "uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" + } + ] + } + }, + "pre_populate_buyer_email": "example@email.com", + "pre_populate_shipping_address": { + "address_line_1": "1455 Market St.", + "address_line_2": "Suite 600", + "administrative_district_level_1": "CA", + "country": "US", + "first_name": "Jane", + "last_name": "Doe", + "locality": "San Francisco", + "postal_code": "94103" + }, + "redirect_url": "https://merchant.website.com/order-confirm" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.csharp", + "java": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.java", + "javascript": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.javascript", + "php": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.php", + "python": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.python", + "ruby": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.ruby" + } + }, + "CreateCheckoutResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `CreateCheckout` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "checkout": { + "$ref": "#/components/schemas/Checkout", + "description": "The newly created `checkout` object associated with the provided idempotency key." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "checkout": { + "additional_recipients": [ + { + "amount_money": { + "amount": 60, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "ask_for_shipping_address": true, + "checkout_page_url": "https://connect.squareup.com/v2/checkout?c=CAISEHGimXh-C3RIT4og1a6u1qw\u0026l=CYTKRM7R7JMV8", + "created_at": "2017-06-16T22:25:35Z", + "id": "CAISEHGimXh-C3RIT4og1a6u1qw", + "merchant_support_email": "merchant+support@website.com", + "order": { + "customer_id": "customer_id", + "discounts": [ + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "scope": "LINE_ITEM", + "type": "FIXED_AMOUNT", + "uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" + } + ], + "line_items": [ + { + "applied_discounts": [ + { + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "discount_uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" + } + ], + "applied_taxes": [ + { + "applied_money": { + "amount": 103, + "currency": "USD" + }, + "tax_uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" + } + ], + "base_price_money": { + "amount": 1500, + "currency": "USD" + }, + "name": "Printed T Shirt", + "quantity": "2", + "total_discount_money": { + "amount": 100, + "currency": "USD" + }, + "total_money": { + "amount": 1503, + "currency": "USD" + }, + "total_tax_money": { + "amount": 103, + "currency": "USD" + } + }, + { + "base_price_money": { + "amount": 2500, + "currency": "USD" + }, + "name": "Slim Jeans", + "quantity": "1", + "total_money": { + "amount": 2500, + "currency": "USD" + } + }, + { + "base_price_money": { + "amount": 3500, + "currency": "USD" + }, + "name": "Woven Sweater", + "quantity": "3", + "total_money": { + "amount": 10500, + "currency": "USD" + } + } + ], + "location_id": "location_id", + "reference_id": "reference_id", + "taxes": [ + { + "percentage": "7.75", + "scope": "LINE_ITEM", + "type": "INCLUSIVE", + "uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" + } + ], + "total_discount_money": { + "amount": 100, + "currency": "USD" + }, + "total_money": { + "amount": 14503, + "currency": "USD" + }, + "total_tax_money": { + "amount": 103, + "currency": "USD" + } + }, + "pre_populate_buyer_email": "example@email.com", + "pre_populate_shipping_address": { + "address_line_1": "1455 Market St.", + "address_line_2": "Suite 600", + "administrative_district_level_1": "CA", + "country": "US", + "first_name": "Jane", + "last_name": "Doe", + "locality": "San Francisco", + "postal_code": "94103" + }, + "redirect_url": "https://merchant.website.com/order-confirm", + "version": 1 + } + } + }, + "CreateCustomerCardRequest": { + "type": "object", + "description": "Defines the fields that are included in the request body of a request\nto the `CreateCustomerCard` endpoint.", + "x-release-status": "DEPRECATED", + "required": [ + "card_nonce" + ], + "properties": { + "card_nonce": { + "type": "string", + "description": "A card nonce representing the credit card to link to the customer.\n\nCard nonces are generated by the Square payment form when customers enter\ntheir card information. For more information, see\n[Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/web-payments/take-card-payment).\n\n__NOTE:__ Card nonces generated by digital wallets (such as Apple Pay)\ncannot be used to create a customer card." + }, + "billing_address": { + "$ref": "#/components/schemas/Address", + "description": "Address information for the card on file.\n\n__NOTE:__ If a billing address is provided in the request, the\n`CreateCustomerCardRequest.billing_address.postal_code` must match\nthe postal code encoded in the card nonce." + }, + "cardholder_name": { + "type": "string", + "description": "The full name printed on the credit card." + }, + "verification_token": { + "type": "string", + "description": "An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).\nVerification tokens encapsulate customer device information and 3-D Secure\nchallenge results to indicate that Square has verified the buyer identity." + } + }, + "example": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "card_nonce": "YOUR_CARD_NONCE", + "cardholder_name": "Amelia Earhart" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.csharp", + "java": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.java", + "javascript": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.javascript", + "php": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.php", + "python": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.python", + "ruby": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.ruby" + } + }, + "CreateCustomerCardResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `CreateCustomerCard` endpoint.\n\nEither `errors` or `card` is present in a given response (never both).", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The created card on file." + } + }, + "example": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "card_brand": "VISA", + "cardholder_name": "Amelia Earhart", + "exp_month": 11, + "exp_year": 2018, + "id": "icard-card_id", + "last_4": "1111" + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.csharp", + "java": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.java", + "javascript": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.javascript", + "php": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.php", + "python": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.python", + "ruby": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.ruby" + } + }, + "CreateCustomerCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents a [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) request.", + "x-release-status": "PUBLIC", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition to create. Note the following:\n- With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema\ndefinition hosted on the Square CDN. For more information, including supported values and constraints, see\n[Specifying the schema](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#specify-schema).\n- If provided, `name` must be unique (case-sensitive) across all visible customer-related custom attribute definitions for the seller.\n- All custom attributes are visible in exported customer data, including those set to `VISIBILITY_HIDDEN`." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45 + } + }, + "example": { + "custom_attribute_definition": { + "description": "The favorite movie of the customer.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "visibility": "VISIBILITY_HIDDEN" + } + } + }, + "CreateCustomerCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The new custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-04-26T15:27:30Z", + "description": "The favorite movie of the customer.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + } + }, + "CreateCustomerGroupRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in a request to the\n[CreateCustomerGroup](api-endpoint:CustomerGroups-CreateCustomerGroup) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "group" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)." + }, + "group": { + "$ref": "#/components/schemas/CustomerGroup", + "description": "The customer group to create." + } + }, + "example": { + "group": { + "name": "Loyal Customers" + } + } + }, + "CreateCustomerGroupResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CreateCustomerGroup](api-endpoint:CustomerGroups-CreateCustomerGroup) endpoint.\n\nEither `errors` or `group` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "group": { + "$ref": "#/components/schemas/CustomerGroup", + "description": "The successfully created customer group." + } + }, + "example": { + "group": { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + } + } + }, + "CreateCustomerRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in a request to the\n`CreateCustomer` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "The idempotency key for the request.\tFor more information, see\n[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)." + }, + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the customer profile.\n\nThe maximum length for this value is 300 characters." + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the customer profile.\n\nThe maximum length for this value is 300 characters." + }, + "company_name": { + "type": "string", + "description": "A business name associated with the customer profile.\n\nThe maximum length for this value is 500 characters." + }, + "nickname": { + "type": "string", + "description": "A nickname for the customer profile.\n\nThe maximum length for this value is 100 characters." + }, + "email_address": { + "type": "string", + "description": "The email address associated with the customer profile.\n\nThe maximum length for this value is 254 characters." + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address associated with the customer profile. For maximum length constraints, see \n[Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).\nThe `first_name` and `last_name` fields are ignored if they are present in the request." + }, + "phone_number": { + "type": "string", + "description": "The phone number associated with the customer profile. The phone number must be valid and can contain\n9–16 digits, with an optional `+` prefix and country code. For more information, see\n[Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number)." + }, + "reference_id": { + "type": "string", + "description": "An optional second ID used to associate the customer profile with an\nentity in another system.\n\nThe maximum length for this value is 100 characters." + }, + "note": { + "type": "string", + "description": "A custom note associated with the customer profile." + }, + "birthday": { + "type": "string", + "description": "The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,\nspecify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in `YYYY-MM-DD`\nformat, where `YYYY` is the specified birth year or `0000` if a birth year is not specified." + }, + "tax_ids": { + "$ref": "#/components/schemas/CustomerTaxIds", + "description": "The tax ID associated with the customer profile. This field is available only for customers of sellers\nin EU countries or the United Kingdom. For more information,\nsee [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids)." + } + }, + "example": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "reference_id": "YOUR_REFERENCE_ID" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CreateCustomer/CreateCustomerRequest.csharp", + "java": "/sdk_samples/CreateCustomer/CreateCustomerRequest.java", + "javascript": "/sdk_samples/CreateCustomer/CreateCustomerRequest.javascript", + "php": "/sdk_samples/CreateCustomer/CreateCustomerRequest.php", + "python": "/sdk_samples/CreateCustomer/CreateCustomerRequest.python", + "ruby": "/sdk_samples/CreateCustomer/CreateCustomerRequest.ruby" + } + }, + "CreateCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CreateCustomer](api-endpoint:Customers-CreateCustomer) or\n[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint.\n\nEither `errors` or `customer` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The created customer." + } + }, + "example": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "updated_at": "2016-03-23T20:21:54.859Z", + "version": 0 + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CreateCustomer/CreateCustomerResponse.csharp", + "java": "/sdk_samples/CreateCustomer/CreateCustomerResponse.java", + "javascript": "/sdk_samples/CreateCustomer/CreateCustomerResponse.javascript", + "php": "/sdk_samples/CreateCustomer/CreateCustomerResponse.php", + "python": "/sdk_samples/CreateCustomer/CreateCustomerResponse.python", + "ruby": "/sdk_samples/CreateCustomer/CreateCustomerResponse.ruby" + } + }, + "CreateDeviceCodeRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "device_code" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this CreateDeviceCode request. Keys can\nbe any valid string but must be unique for every CreateDeviceCode request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 128 + }, + "device_code": { + "$ref": "#/components/schemas/DeviceCode", + "description": "The device code to create." + } + }, + "example": { + "device_code": { + "location_id": "B5E4484SHHNYH", + "name": "Counter 1", + "product_type": "TERMINAL_API" + }, + "idempotency_key": "01bb00a6-0c86-4770-94ed-f5fca973cd56" + } + }, + "CreateDeviceCodeResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "device_code": { + "$ref": "#/components/schemas/DeviceCode", + "description": "The created DeviceCode object containing the device code string." + } + }, + "example": { + "device_code": { + "code": "EBCARJ", + "created_at": "2020-02-06T18:44:33.000Z", + "id": "B3Z6NAMYQSMTM", + "location_id": "B5E4484SHHNYH", + "name": "Counter 1", + "pair_by": "2020-02-06T18:49:33.000Z", + "product_type": "TERMINAL_API", + "status": "UNPAIRED", + "status_changed_at": "2020-02-06T18:44:33.000Z" + } + } + }, + "CreateDisputeEvidenceFileRequest": { + "type": "object", + "description": "Defines the parameters for a `CreateDisputeEvidenceFile` request.", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1, + "maxLength": 45 + }, + "evidence_type": { + "$ref": "#/components/schemas/DisputeEvidenceType", + "description": "The type of evidence you are uploading.\nSee [DisputeEvidenceType](#type-disputeevidencetype) for possible values" + }, + "content_type": { + "type": "string", + "description": "The MIME type of the uploaded file.\nThe type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff.", + "minLength": 1, + "maxLength": 40 + } + } + }, + "CreateDisputeEvidenceFileResponse": { + "type": "object", + "description": "Defines the fields in a `CreateDisputeEvidenceFile` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "evidence": { + "$ref": "#/components/schemas/DisputeEvidence", + "description": "The metadata of the newly uploaded dispute evidence." + } + }, + "example": { + "evidence": { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_file": { + "filename": "customer-interaction.jpg", + "filetype": "image/jpeg" + }, + "id": "TOomLInj6iWmP3N8qfCXrB", + "uploaded_at": "2022-05-18T16:01:10.000Z" + } + } + }, + "CreateDisputeEvidenceTextRequest": { + "type": "object", + "description": "Defines the parameters for a `CreateDisputeEvidenceText` request.", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "evidence_text" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1, + "maxLength": 45 + }, + "evidence_type": { + "$ref": "#/components/schemas/DisputeEvidenceType", + "description": "The type of evidence you are uploading.\nSee [DisputeEvidenceType](#type-disputeevidencetype) for possible values" + }, + "evidence_text": { + "type": "string", + "description": "The evidence string.", + "minLength": 1, + "maxLength": 500 + } + }, + "example": { + "evidence_text": "1Z8888888888888888", + "evidence_type": "TRACKING_NUMBER", + "idempotency_key": "ed3ee3933d946f1514d505d173c82648" + } + }, + "CreateDisputeEvidenceTextResponse": { + "type": "object", + "description": "Defines the fields in a `CreateDisputeEvidenceText` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "evidence": { + "$ref": "#/components/schemas/DisputeEvidence", + "description": "The newly uploaded dispute evidence metadata." + } + }, + "example": { + "evidence": { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_text": "The customer purchased the item twice, on April 11 and April 28.", + "evidence_type": "REBUTTAL_EXPLANATION", + "id": "TOomLInj6iWmP3N8qfCXrB", + "uploaded_at": "2022-05-18T16:01:10.000Z" + } + } + }, + "CreateGiftCardActivityRequest": { + "type": "object", + "description": "A request to create a gift card activity.", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "gift_card_activity" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `CreateGiftCardActivity` request.", + "minLength": 1, + "maxLength": 128 + }, + "gift_card_activity": { + "$ref": "#/components/schemas/GiftCardActivity", + "description": "The activity to create for the gift card. This activity must specify `gift_card_id` or `gift_card_gan` for the target\ngift card, the `location_id` where the activity occurred, and the activity `type` along with the corresponding activity details." + } + }, + "example": { + "gift_card_activity": { + "activate_activity_details": { + "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", + "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" + }, + "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + "location_id": "81FN9BNFZTKS4", + "type": "ACTIVATE" + }, + "idempotency_key": "U16kfr-kA70er-q4Rsym-7U7NnY" + } + }, + "CreateGiftCardActivityResponse": { + "type": "object", + "description": "A response that contains a `GiftCardActivity` that was created.\nThe response might contain a set of `Error` objects if the request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card_activity": { + "$ref": "#/components/schemas/GiftCardActivity", + "description": "The gift card activity that was created." + } + }, + "example": { + "gift_card_activity": { + "activate_activity_details": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", + "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gift_card_balance_money": { + "amount": 1000, + "currency": "USD" + }, + "gift_card_gan": "7783320002929081", + "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", + "location_id": "81FN9BNFZTKS4", + "type": "ACTIVATE" + } + } + }, + "CreateGiftCardRequest": { + "type": "object", + "description": "Represents a [CreateGiftCard](api-endpoint:GiftCards-CreateGiftCard) request.", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "location_id", + "gift_card" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information, \nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 128 + }, + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location) where the gift card should be registered for \nreporting purposes. Gift cards can be redeemed at any of the seller's locations.", + "minLength": 1 + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card to create. The `type` field is required for this request. The `gan_source` \nand `gan` fields are included as follows: \n\nTo direct Square to generate a 16-digit GAN, omit `gan_source` and `gan`.\n\nTo provide a custom GAN, include `gan_source` and `gan`.\n- For `gan_source`, specify `OTHER`. \n- For `gan`, provide a custom GAN containing 8 to 20 alphanumeric characters. The GAN must be \nunique for the seller and cannot start with the same bank identification number (BIN) as major \ncredit cards. Do not use GANs that are easy to guess (such as 12345678) because they greatly \nincrease the risk of fraud. It is the responsibility of the developer to ensure the security \nof their custom GANs. For more information, see \n[Custom GANs](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#custom-gans). \n\nTo register an unused, physical gift card that the seller previously ordered from Square, \ninclude `gan` and provide the GAN that is printed on the gift card." + } + }, + "example": { + "gift_card": { + "type": "DIGITAL" + }, + "idempotency_key": "NC9Tm69EjbjtConu", + "location_id": "81FN9BNFZTKS4" + } + }, + "CreateGiftCardResponse": { + "type": "object", + "description": "A response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request\nresulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The new gift card." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 0, + "currency": "USD" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gan": "7783320006753271", + "gan_source": "SQUARE", + "id": "gftc:6cbacbb64cf54e2ca9f573d619038059", + "state": "PENDING", + "type": "DIGITAL" + } + } + }, + "CreateInvoiceAttachmentRequest": { + "type": "object", + "description": "Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) request.", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `CreateInvoiceAttachment` request.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 128 + }, + "description": { + "type": "string", + "description": "The description of the attachment to display on the invoice.", + "maxLength": 128 + } + }, + "example": { + "description": "Service contract", + "idempotency_key": "ae5e84f9-4742-4fc1-ba12-a3ce3748f1c3" + } + }, + "CreateInvoiceAttachmentResponse": { + "type": "object", + "description": "Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) response.", + "x-release-status": "PUBLIC", + "properties": { + "attachment": { + "$ref": "#/components/schemas/InvoiceAttachment", + "description": "Metadata about the attachment that was added to the invoice." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "attachment": { + "description": "Service contract", + "filename": "file.jpg", + "filesize": 102705, + "hash": "273ee02cb6f5f8a3a8ca23604930dd53", + "id": "inva:0-3bB9ZuDHiziThQhuC4fwWt", + "mime_type": "image/jpeg", + "uploaded_at": "2023-02-03T20:28:14Z" + } + } + }, + "CreateInvoiceRequest": { + "type": "object", + "description": "Describes a `CreateInvoice` request.", + "x-release-status": "PUBLIC", + "required": [ + "invoice" + ], + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The invoice to create." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `CreateInvoice` request. If you do not \nprovide `idempotency_key` (or provide an empty string as the value), the endpoint \ntreats each request as independent.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 128 + } + }, + "example": { + "idempotency_key": "ce3748f9-5fc1-4762-aa12-aae5e843f1f4", + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1 + } + ], + "request_type": "BALANCE", + "tipping_enabled": true + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "store_payment_method_enabled": false, + "title": "Event Planning Services" + } + } + }, + "CreateInvoiceResponse": { + "type": "object", + "description": "The response returned by the `CreateInvoice` request.", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The newly created invoice." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T17:45:13Z", + "version": 0 + } + } + }, + "CreateJobRequest": { + "type": "object", + "description": "Represents a [CreateJob](api-endpoint:Team-CreateJob) request.", + "x-release-status": "BETA", + "required": [ + "job", + "idempotency_key" + ], + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The job to create. The `title` field is required and `is_tip_eligible` defaults to true." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for the `CreateJob` request. Keys can be any valid string,\nbut must be unique for each request. For more information, see\n[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45 + } + }, + "example": { + "idempotency_key": "idempotency-key-0", + "job": { + "is_tip_eligible": true, + "title": "Cashier" + } + } + }, + "CreateJobResponse": { + "type": "object", + "description": "Represents a [CreateJob](api-endpoint:Team-CreateJob) response. Either `job` or `errors`\nis present in the response.", + "x-release-status": "BETA", + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The new job." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "job": { + "created_at": "2021-06-11T22:55:45Z", + "id": "1yJlHapkseYnNPETIU1B", + "is_tip_eligible": true, + "title": "Cashier", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + } + }, + "CreateLocationCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents a [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) request.", + "x-release-status": "BETA", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition to create. Note the following:\n- With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema\ndefinition hosted on the Square CDN. For more information, including supported values and constraints, see\n[Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).\n- `name` is required unless `visibility` is set to `VISIBILITY_HIDDEN`." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45 + } + }, + "example": { + "custom_attribute_definition": { + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "CreateLocationCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The new custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-12-02T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "CreateLocationRequest": { + "type": "object", + "description": "The request object for the [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "location": { + "$ref": "#/components/schemas/Location", + "description": "The initial values of the location being created. The `name` field is required and must be unique within a seller account.\nAll other fields are optional, but any information you care about for the location should be included.\nThe remaining fields are automatically added based on the data from the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location)." + } + }, + "example": { + "location": { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309" + }, + "description": "Midtown Atlanta store", + "name": "Midtown" + } + } + }, + "CreateLocationResponse": { + "type": "object", + "description": "The response object returned by the [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about [errors](https://developer.squareup.com/docs/build-basics/handling-errors) encountered during the request." + }, + "location": { + "$ref": "#/components/schemas/Location", + "description": "The newly created `Location` object." + } + }, + "example": { + "location": { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309" + }, + "business_name": "Jet Fuel Coffee", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ], + "coordinates": { + "latitude": 33.7889, + "longitude": -84.3841 + }, + "country": "US", + "created_at": "2022-02-19T17:58:25Z", + "currency": "USD", + "description": "Midtown Atlanta store", + "id": "3Z4V4WHQK64X9", + "language_code": "en-US", + "mcc": "7299", + "merchant_id": "3MYCJG5GVYQ8Q", + "name": "Midtown", + "status": "ACTIVE", + "timezone": "America/New_York", + "type": "PHYSICAL" + } + } + }, + "CreateLoyaltyAccountRequest": { + "type": "object", + "description": "A request to create a new loyalty account.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_account", + "idempotency_key" + ], + "properties": { + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The loyalty account to create." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateLoyaltyAccount` request. \nKeys can be any valid string, but must be unique for every request.", + "minLength": 1, + "maxLength": 128 + } + }, + "example": { + "idempotency_key": "ec78c477-b1c3-4899-a209-a4e71337c996", + "loyalty_account": { + "mapping": { + "phone_number": "+14155551234" + }, + "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd" + } + } + }, + "CreateLoyaltyAccountResponse": { + "type": "object", + "description": "A response that includes loyalty account created.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The newly created loyalty account." + } + }, + "example": { + "loyalty_account": { + "balance": 0, + "created_at": "2020-05-08T21:44:32Z", + "customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "id": "79b807d2-d786-46a9-933b-918028d7a8c5", + "lifetime_points": 0, + "mapping": { + "created_at": "2020-05-08T21:44:32Z", + "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234" + }, + "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "updated_at": "2020-05-08T21:44:32Z" + } + } + }, + "CreateLoyaltyPromotionRequest": { + "type": "object", + "description": "Represents a [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?program_id=d619f755-2d17-41f3-990d-c04ecedd64dd", + "required": [ + "loyalty_promotion", + "idempotency_key" + ], + "properties": { + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The loyalty promotion to create." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, which is used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 128 + } + }, + "example": { + "idempotency_key": "ec78c477-b1c3-4899-a209-a4e71337c996", + "loyalty_promotion": { + "available_time": { + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ] + }, + "incentive": { + "points_multiplier_data": { + "multiplier": "3.0" + }, + "type": "POINTS_MULTIPLIER" + }, + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Tuesday Happy Hour Promo", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "trigger_limit": { + "interval": "DAY", + "times": 1 + } + } + } + }, + "CreateLoyaltyPromotionResponse": { + "type": "object", + "description": "Represents a [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) response.\nEither `loyalty_promotion` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The new loyalty promotion." + } + }, + "example": { + "loyalty_promotion": { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ] + }, + "created_at": "2022-08-16T08:38:54Z", + "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", + "incentive": { + "points_multiplier_data": { + "multiplier": "3.000", + "points_multiplier": 3 + }, + "type": "POINTS_MULTIPLIER" + }, + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Tuesday Happy Hour Promo", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "status": "ACTIVE", + "trigger_limit": { + "interval": "DAY", + "times": 1 + }, + "updated_at": "2022-08-16T08:38:54Z" + } + } + }, + "CreateLoyaltyRewardRequest": { + "type": "object", + "description": "A request to create a loyalty reward.", + "x-release-status": "PUBLIC", + "required": [ + "reward", + "idempotency_key" + ], + "properties": { + "reward": { + "$ref": "#/components/schemas/LoyaltyReward", + "description": "The reward to create." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateLoyaltyReward` request. \nKeys can be any valid string, but must be unique for every request.", + "minLength": 1, + "maxLength": 128 + } + }, + "example": { + "idempotency_key": "18c2e5ea-a620-4b1f-ad60-7b167285e451", + "reward": { + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f" + } + } + }, + "CreateLoyaltyRewardResponse": { + "type": "object", + "description": "A response that includes the loyalty reward created.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "reward": { + "$ref": "#/components/schemas/LoyaltyReward", + "description": "The loyalty reward created." + } + }, + "example": { + "reward": { + "created_at": "2020-05-01T21:49:54Z", + "id": "a8f43ebe-2ad6-3001-bdd5-7d7c2da08943", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", + "points": 10, + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "ISSUED", + "updated_at": "2020-05-01T21:49:54Z" + } + } + }, + "CreateMerchantCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) request.", + "x-release-status": "BETA", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition to create. Note the following:\n- With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema\ndefinition hosted on the Square CDN. For more information, including supported values and constraints, see\n[Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).\n- `name` is required unless `visibility` is set to `VISIBILITY_HIDDEN`." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45 + } + }, + "example": { + "custom_attribute_definition": { + "description": "This is the other name this merchant goes by.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "CreateMerchantCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The new custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2023-05-05T19:06:36.559Z", + "description": "This is the other name this merchant goes by.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2023-05-05T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "CreateMobileAuthorizationCodeRequest": { + "type": "object", + "description": "Defines the body parameters that can be provided in a request to the\n`CreateMobileAuthorizationCode` endpoint.", + "x-release-status": "DEPRECATED", + "properties": { + "location_id": { + "type": "string", + "description": "The Square location ID that the authorization code should be tied to.", + "minLength": 1, + "maxLength": 191 + } + }, + "example": { + "location_id": "YOUR_LOCATION_ID" + } + }, + "CreateMobileAuthorizationCodeResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `CreateMobileAuthorizationCode` endpoint.", + "x-release-status": "DEPRECATED", + "properties": { + "authorization_code": { + "type": "string", + "description": "The generated authorization code that connects a mobile application instance\nto a Square account.", + "maxLength": 191 + }, + "expires_at": { + "type": "string", + "description": "The timestamp when `authorization_code` expires, in\n[RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, \"2016-09-04T23:59:33.123Z\").", + "minLength": 20, + "maxLength": 48 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "authorization_code": "YOUR_MOBILE_AUTHORIZATION_CODE", + "expires_at": "2019-01-10T19:42:08Z" + } + }, + "CreateOrderCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents a create request for an order custom attribute definition.", + "x-release-status": "BETA", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition to create. Note the following:\n- With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema\ndefinition hosted on the Square CDN. For more information, including supported values and constraints, see\n[Specifying the schema](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#specify-schema).\n- If provided, `name` must be unique (case-sensitive) across all visible customer-related custom attribute definitions for the seller.\n- All custom attributes are visible in exported customer data, including those set to `VISIBILITY_HIDDEN`." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. \nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45 + } + }, + "example": { + "custom_attribute_definition": { + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "idempotency_key": "IDEMPOTENCY_KEY" + } + }, + "CreateOrderCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from creating an order custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The new custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-10-06T16:53:23.141Z", + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-10-06T16:53:23.141Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "CreateOrderRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The order to create. If this field is set, the only other top-level field that can be\nset is the `idempotency_key`." + }, + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this\norder among orders you have created.\n\nIf you are unsure whether a particular order was created successfully,\nyou can try it again with the same idempotency key without\nworrying about creating duplicate orders.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 192 + } + }, + "example": { + "idempotency_key": "8193148c-9586-11e6-99f9-28cfe92138cf", + "order": { + "discounts": [ + { + "name": "Labor Day Sale", + "percentage": "5", + "scope": "ORDER", + "uid": "labor-day-sale" + }, + { + "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", + "scope": "ORDER", + "uid": "membership-discount" + }, + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "name": "Sale - $1.00 off", + "scope": "LINE_ITEM", + "uid": "one-dollar-off" + } + ], + "line_items": [ + { + "base_price_money": { + "amount": 1599, + "currency": "USD" + }, + "name": "New York Strip Steak", + "quantity": "1" + }, + { + "applied_discounts": [ + { + "discount_uid": "one-dollar-off" + } + ], + "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", + "modifiers": [ + { + "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ" + } + ], + "quantity": "2" + } + ], + "location_id": "057P5VYJ4A5X1", + "reference_id": "my-order-001", + "taxes": [ + { + "name": "State Sales Tax", + "percentage": "9", + "scope": "ORDER", + "uid": "state-sales-tax" + } + ] + } + } + }, + "CreateOrderResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `CreateOrder` endpoint.\n\nEither `errors` or `order` is present in a given response, but never both.", + "x-release-status": "PUBLIC", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The newly created order." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "order": { + "created_at": "2020-01-17T20:47:53.293Z", + "discounts": [ + { + "applied_money": { + "amount": 30, + "currency": "USD" + }, + "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", + "name": "Membership Discount", + "percentage": "0.5", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "membership-discount" + }, + { + "applied_money": { + "amount": 303, + "currency": "USD" + }, + "name": "Labor Day Sale", + "percentage": "5", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "labor-day-sale" + }, + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "name": "Sale - $1.00 off", + "scope": "LINE_ITEM", + "type": "FIXED_AMOUNT", + "uid": "one-dollar-off" + } + ], + "id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "line_items": [ + { + "applied_discounts": [ + { + "applied_money": { + "amount": 8, + "currency": "USD" + }, + "discount_uid": "membership-discount", + "uid": "jWdgP1TpHPFBuVrz81mXVC" + }, + { + "applied_money": { + "amount": 79, + "currency": "USD" + }, + "discount_uid": "labor-day-sale", + "uid": "jnZOjjVY57eRcQAVgEwFuC" + } + ], + "applied_taxes": [ + { + "applied_money": { + "amount": 136, + "currency": "USD" + }, + "tax_uid": "state-sales-tax", + "uid": "aKG87ArnDpvMLSZJHxWUl" + } + ], + "base_price_money": { + "amount": 1599, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 1599, + "currency": "USD" + }, + "name": "New York Strip Steak", + "quantity": "1", + "total_discount_money": { + "amount": 87, + "currency": "USD" + }, + "total_money": { + "amount": 1648, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 136, + "currency": "USD" + }, + "uid": "8uSwfzvUImn3IRrvciqlXC", + "variation_total_price_money": { + "amount": 1599, + "currency": "USD" + } + }, + { + "applied_discounts": [ + { + "applied_money": { + "amount": 22, + "currency": "USD" + }, + "discount_uid": "membership-discount", + "uid": "nUXvdsIItfKko0dbYtY58C" + }, + { + "applied_money": { + "amount": 224, + "currency": "USD" + }, + "discount_uid": "labor-day-sale", + "uid": "qSdkOOOernlVQqsJ94SPjB" + }, + { + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "discount_uid": "one-dollar-off", + "uid": "y7bVl4njrWAnfDwmz19izB" + } + ], + "applied_taxes": [ + { + "applied_money": { + "amount": 374, + "currency": "USD" + }, + "tax_uid": "state-sales-tax", + "uid": "v1dAgrfUVUPTnVTf9sRPz" + } + ], + "base_price_money": { + "amount": 2200, + "currency": "USD" + }, + "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", + "gross_sales_money": { + "amount": 4500, + "currency": "USD" + }, + "modifiers": [ + { + "base_price_money": { + "amount": 50, + "currency": "USD" + }, + "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ", + "name": "Well", + "total_price_money": { + "amount": 100, + "currency": "USD" + }, + "uid": "Lo3qMMckDluu9Qsb58d4CC" + } + ], + "name": "New York Steak", + "quantity": "2", + "total_discount_money": { + "amount": 346, + "currency": "USD" + }, + "total_money": { + "amount": 4528, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 374, + "currency": "USD" + }, + "uid": "v8ZuEXpOJpb0bazLuvrLDB", + "variation_name": "Larger", + "variation_total_price_money": { + "amount": 4400, + "currency": "USD" + } + } + ], + "location_id": "057P5VYJ4A5X1", + "net_amounts": { + "discount_money": { + "amount": 433, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 510, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 6176, + "currency": "USD" + } + }, + "reference_id": "my-order-001", + "source": { + "name": "My App" + }, + "state": "OPEN", + "taxes": [ + { + "applied_money": { + "amount": 510, + "currency": "USD" + }, + "name": "State Sales Tax", + "percentage": "9", + "scope": "ORDER", + "type": "ADDITIVE", + "uid": "state-sales-tax" + } + ], + "total_discount_money": { + "amount": 433, + "currency": "USD" + }, + "total_money": { + "amount": 6176, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 510, + "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2020-01-17T20:47:53.293Z", + "version": 1 + } + } + }, + "CreatePaymentLinkRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreatePaymentLinkRequest` request.\nIf you do not provide a unique string (or provide an empty string as the value),\nthe endpoint treats each request as independent.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "maxLength": 192 + }, + "description": { + "type": "string", + "description": "A description of the payment link. You provide this optional description that is useful in your\napplication context. It is not used anywhere.", + "maxLength": 4096 + }, + "quick_pay": { + "$ref": "#/components/schemas/QuickPay", + "description": "Describes an ad hoc item and price for which to generate a quick pay checkout link.\nFor more information,\nsee [Quick Pay Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout)." + }, + "order": { + "$ref": "#/components/schemas/Order", + "description": "Describes the `Order` for which to create a checkout link.\nFor more information,\nsee [Square Order Checkout](https://developer.squareup.com/docs/checkout-api/square-order-checkout)." + }, + "checkout_options": { + "$ref": "#/components/schemas/CheckoutOptions", + "description": "Describes optional fields to add to the resulting checkout page.\nFor more information,\nsee [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations)." + }, + "pre_populated_data": { + "$ref": "#/components/schemas/PrePopulatedData", + "description": "Describes fields to prepopulate in the resulting checkout page.\nFor more information, see [Prepopulate the shipping address](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#prepopulate-the-shipping-address)." + }, + "payment_note": { + "type": "string", + "description": "A note for the payment. After processing the payment, Square adds this note to the resulting `Payment`.", + "maxLength": 500 + } + }, + "example": { + "idempotency_key": "cd9e25dc-d9f2-4430-aedb-61605070e95f", + "quick_pay": { + "location_id": "A9Y43N9ABXZBP", + "name": "Auto Detailing", + "price_money": { + "amount": 10000, + "currency": "USD" + } + } + } + }, + "CreatePaymentLinkResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "payment_link": { + "$ref": "#/components/schemas/PaymentLink", + "description": "The created payment link." + }, + "related_resources": { + "$ref": "#/components/schemas/PaymentLinkRelatedResources", + "description": "The list of related objects." + } + }, + "example": { + "payment_link": { + "created_at": "2022-04-25T23:58:01Z", + "id": "PKVT6XGJZXYUP3NZ", + "long_url": "https://checkout.square.site/EXAMPLE", + "order_id": "o4b7saqp4HzhNttf5AJxC0Srjd4F", + "url": "https://square.link/u/EXAMPLE", + "version": 1 + }, + "related_resources": { + "orders": [ + { + "created_at": "2022-03-03T00:53:15.829Z", + "fulfillments": [ + { + "state": "PROPOSED", + "type": "DIGITAL", + "uid": "bBpNrxjdQxGQP16sTmdzi" + } + ], + "id": "o4b7saqp4HzhNttf5AJxC0Srjd4F", + "line_items": [ + { + "base_price_money": { + "amount": 12500, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 12500, + "currency": "USD" + }, + "item_type": "ITEM", + "name": "Auto Detailing", + "quantity": "1", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 12500, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "8YX13D1U3jO7czP8JVrAR", + "variation_total_price_money": { + "amount": 12500, + "currency": "USD" + } + } + ], + "location_id": "{LOCATION_ID}", + "net_amounts": { + "discount_money": { + "amount": 0, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 0, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 12500, + "currency": "USD" + } + }, + "source": { + "name": "Test Online Checkout Application" + }, + "state": "DRAFT", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 12500, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2022-03-03T00:53:15.829Z", + "version": 1 + } + ] + } + } + }, + "CreatePaymentRequest": { + "type": "object", + "description": "Describes a request to create a payment using \n[CreatePayment](api-endpoint:Payments-CreatePayment).", + "x-release-status": "PUBLIC", + "required": [ + "source_id", + "idempotency_key" + ], + "properties": { + "source_id": { + "type": "string", + "description": "The ID for the source of funds for this payment.\nThis could be a payment token generated by the Web Payments SDK for any of its\n[supported methods](https://developer.squareup.com/docs/web-payments/overview#explore-payment-methods),\nincluding cards, bank transfers, Afterpay or Cash App Pay. If recording a payment\nthat the seller received outside of Square, specify either \"CASH\" or \"EXTERNAL\".\nFor more information, see \n[Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).", + "minLength": 1 + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreatePayment` request. Keys can be any valid string\nbut must be unique for every `CreatePayment` request.\n\nNote: The number of allowed characters might be less than the stated maximum, if multi-byte\ncharacters are used.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1, + "maxLength": 45 + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money to accept for this payment, not including `tip_money`.\n\nThe amount must be specified in the smallest denomination of the applicable currency\n(for example, US dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).\n\nThe currency code must match the currency associated with the business\nthat is accepting the payment." + }, + "tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount designated as a tip, in addition to `amount_money`.\n\nThe amount must be specified in the smallest denomination of the applicable currency\n(for example, US dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).\n\nThe currency code must match the currency associated with the business\nthat is accepting the payment." + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money that the developer is taking as a fee\nfor facilitating the payment on behalf of the seller.\n\nThe amount cannot be more than 90% of the total amount of the payment.\n\nThe amount must be specified in the smallest denomination of the applicable currency\n(for example, US dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).\n\nThe fee currency code must match the currency associated with the seller\nthat is accepting the payment. The application must be from a developer\naccount in the same country and using the same currency code as the seller.\n\nFor more information about the application fee scenario, see\n[Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).\n\nTo set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.\nFor more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions)." + }, + "delay_duration": { + "type": "string", + "description": "The duration of time after the payment's creation when Square automatically \neither completes or cancels the payment depending on the `delay_action` field value. \nFor more information, see \n[Time threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). \n\nThis parameter should be specified as a time duration, in RFC 3339 format.\n\nNote: This feature is only supported for card payments. This parameter can only be set for a delayed\ncapture payment (`autocomplete=false`).\n\nDefault:\n\n- Card-present payments: \"PT36H\" (36 hours) from the creation time.\n- Card-not-present payments: \"P7D\" (7 days) from the creation time." + }, + "delay_action": { + "type": "string", + "description": "The action to be applied to the payment when the `delay_duration` has elapsed. The action must be\nCANCEL or COMPLETE. For more information, see \n[Time Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). \n\nDefault: CANCEL" + }, + "autocomplete": { + "type": "boolean", + "description": "If set to `true`, this payment will be completed when possible. If\nset to `false`, this payment is held in an approved state until either\nexplicitly completed (captured) or canceled (voided). For more information, see\n[Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment).\n\nDefault: true" + }, + "order_id": { + "type": "string", + "description": "Associates a previously created order with this payment." + }, + "customer_id": { + "type": "string", + "description": "The [Customer](entity:Customer) ID of the customer associated with the payment.\n\nThis is required if the `source_id` refers to a card on file created using the Cards API." + }, + "location_id": { + "type": "string", + "description": "The location ID to associate with the payment. If not specified, the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location) is\nused." + }, + "team_member_id": { + "type": "string", + "description": "An optional [TeamMember](entity:TeamMember) ID to associate with \nthis payment." + }, + "reference_id": { + "type": "string", + "description": "A user-defined ID to associate with the payment.\n\nYou can use this field to associate the payment to an entity in an external system \n(for example, you might specify an order ID that is generated by a third-party shopping cart).", + "maxLength": 40 + }, + "verification_token": { + "type": "string", + "description": "An identifying token generated by [payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).\nVerification tokens encapsulate customer device information and 3-D Secure\nchallenge results to indicate that Square has verified the buyer identity.\n\nFor more information, see [SCA Overview](https://developer.squareup.com/docs/sca-overview)." + }, + "accept_partial_authorization": { + "type": "boolean", + "description": "If set to `true` and charging a Square Gift Card, a payment might be returned with\n`amount_money` equal to less than what was requested. For example, a request for $20 when charging\na Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose\nto prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card\npayment. This field cannot be `true` when `autocomplete = true`.\n\nFor more information, see\n[Partial amount with Square Gift Cards](https://developer.squareup.com/docs/payments-api/take-payments#partial-payment-gift-card).\n\nDefault: false" + }, + "buyer_email_address": { + "type": "string", + "description": "The buyer's email address.", + "maxLength": 255 + }, + "buyer_phone_number": { + "type": "string", + "description": "The buyer's phone number.\nMust follow the following format:\n1. A leading + symbol (followed by a country code)\n2. The phone number can contain spaces and the special characters `(` , `)` , `-` , and `.`.\nAlphabetical characters aren't allowed.\n3. The phone number must contain between 9 and 16 digits." + }, + "billing_address": { + "$ref": "#/components/schemas/Address", + "description": "The buyer's billing address." + }, + "shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "The buyer's shipping address." + }, + "note": { + "type": "string", + "description": "An optional note to be entered by the developer when creating a payment.", + "maxLength": 500 + }, + "statement_description_identifier": { + "type": "string", + "description": "Optional additional payment information to include on the customer's card statement\nas part of the statement description. This can be, for example, an invoice number, ticket number,\nor short description that uniquely identifies the purchase.\n\nNote that the `statement_description_identifier` might get truncated on the statement description\nto fit the required information including the Square identifier (SQ *) and name of the\nseller taking the payment.", + "maxLength": 20 + }, + "cash_details": { + "$ref": "#/components/schemas/CashPaymentDetails", + "description": "Additional details required when recording a cash payment (`source_id` is CASH)." + }, + "external_details": { + "$ref": "#/components/schemas/ExternalPaymentDetails", + "description": "Additional details required when recording an external payment (`source_id` is EXTERNAL)." + }, + "customer_details": { + "$ref": "#/components/schemas/CustomerDetails", + "description": "Details about the customer making the payment." + }, + "offline_payment_details": { + "$ref": "#/components/schemas/OfflinePaymentDetails", + "description": "An optional field for specifying the offline payment details. This is intended for\ninternal 1st-party callers only." + } + }, + "example": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "app_fee_money": { + "amount": 10, + "currency": "USD" + }, + "autocomplete": true, + "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", + "idempotency_key": "7b0f3ec5-086a-4871-8f13-3c81b3875218", + "location_id": "L88917AVBK2S5", + "note": "Brief description", + "reference_id": "123456", + "source_id": "ccof:GaJGNaZa8x4OgDJn4GB" + } + }, + "CreatePaymentResponse": { + "type": "object", + "description": "Defines the response returned by [CreatePayment](api-endpoint:Payments-CreatePayment).\n\nIf there are errors processing the request, the `payment` field might not be\npresent, or it might be present with a status of `FAILED`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The newly created payment." + } + }, + "example": { + "payment": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "app_fee_money": { + "amount": 10, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-TcgftTEtKxJTRF1lCFJ9TA", + "square_product": "ECOMMERCE_API" + }, + "approved_money": { + "amount": 1000, + "currency": "USD" + }, + "card_details": { + "auth_result_code": "vNEn2f", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T21:14:29.732Z", + "captured_at": "2021-10-13T21:14:30.504Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "ON_FILE", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "CAPTURED" + }, + "created_at": "2021-10-13T21:14:29.577Z", + "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T21:14:29.577Z", + "id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", + "location_id": "L88917AVBK2S5", + "note": "Brief Description", + "order_id": "pRsjRTgFWATl7so6DxdKBJa7ssbZY", + "receipt_number": "R2B3", + "receipt_url": "https://squareup.com/receipt/preview/EXAMPLE_RECEIPT_ID", + "reference_id": "123456", + "risk_evaluation": { + "created_at": "2021-10-13T21:14:30.423Z", + "risk_level": "NORMAL" + }, + "source_type": "CARD", + "status": "COMPLETED", + "total_money": { + "amount": 1000, + "currency": "USD" + }, + "updated_at": "2021-10-13T21:14:30.504Z", + "version_token": "TPtNEOBOa6Qq6E3C3IjckSVOM6b3hMbfhjvTxHBQUsB6o" + } + } + }, + "CreateScheduledShiftRequest": { + "type": "object", + "description": "Represents a [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) request.", + "x-release-status": "BETA", + "required": [ + "scheduled_shift" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique identifier for the `CreateScheduledShift` request, used to ensure the\n[idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)\nof the operation.", + "maxLength": 128 + }, + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The scheduled shift with `draft_shift_details`.\nIf needed, call [ListLocations](api-endpoint:Locations-ListLocations) to get location IDs,\n[ListJobs](api-endpoint:Team-ListJobs) to get job IDs, and [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers)\nto get team member IDs and current job assignments.\n\nThe `start_at` and `end_at` timestamps must be provided in the time zone + offset of the\nshift location specified in `location_id`. Example for Pacific Standard Time: 2024-10-31T12:30:00-08:00" + } + }, + "example": { + "idempotency_key": "HIDSNG5KS478L", + "scheduled_shift": { + "draft_shift_details": { + "end_at": "2019-01-25T13:11:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI" + } + } + } + }, + "CreateScheduledShiftResponse": { + "type": "object", + "description": "Represents a [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) response.\nEither `scheduled_shift` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The new scheduled shift. To make the shift public, call \n[PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) or\n[BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "scheduled_shift": { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-01-25T13:11:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "updated_at": "2019-02-25T03:11:00-05:00", + "version": 1 + } + } + }, + "CreateShiftRequest": { + "type": "object", + "description": "Represents a request to create a `Shift`.", + "x-release-status": "DEPRECATED", + "required": [ + "shift" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string value to ensure the idempotency of the operation.", + "maxLength": 128 + }, + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The `Shift` to be created." + } + }, + "example": { + "idempotency_key": "HIDSNG5KS478L", + "shift": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "tip_eligible": true, + "title": "Barista" + } + } + } + }, + "CreateShiftResponse": { + "type": "object", + "description": "The response to a request to create a `Shift`. The response contains\nthe created `Shift` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The `Shift` that was created on the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "shift": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "created_at": "2019-02-28T00:39:02Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "ormj0jJJZ5OZIzxrZYJI", + "end_at": "2019-01-25T13:11:00-05:00", + "id": "K0YH4CV5462JB", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-28T00:39:02Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + } + }, + "CreateSubscriptionRequest": { + "type": "object", + "description": "Defines input parameters in a request to the \n[CreateSubscription](api-endpoint:Subscriptions-CreateSubscription) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "location_id", + "customer_id" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateSubscription` request.\nIf you do not provide a unique string (or provide an empty string as the value),\nthe endpoint treats each request as independent.\n\nFor more information, see [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)." + }, + "location_id": { + "type": "string", + "description": "The ID of the location the subscription is associated with.", + "minLength": 1 + }, + "plan_variation_id": { + "type": "string", + "description": "The ID of the [subscription plan variation](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations#plan-variations) created using the Catalog API." + }, + "customer_id": { + "type": "string", + "description": "The ID of the [customer](entity:Customer) subscribing to the subscription plan variation.", + "minLength": 1 + }, + "start_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date to start the subscription. \nIf it is unspecified, the subscription starts immediately." + }, + "canceled_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the newly created subscription is scheduled for cancellation. \n\nThis date overrides the cancellation date set in the plan variation configuration.\nIf the cancellation date is earlier than the end date of a subscription cycle, the subscription stops\nat the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle. \n\nWhen the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date`\noccurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription \nstops through the end of the last cycle." + }, + "tax_percentage": { + "type": "string", + "description": "The tax to add when billing the subscription.\nThe percentage is expressed in decimal form, using a `'.'` as the decimal\nseparator and without a `'%'` sign. For example, a value of 7.5\ncorresponds to 7.5%.", + "maxLength": 10 + }, + "price_override_money": { + "$ref": "#/components/schemas/Money", + "description": "A custom price which overrides the cost of a subscription plan variation with `STATIC` pricing.\nThis field does not affect itemized subscriptions with `RELATIVE` pricing. Instead, \nyou should edit the Subscription's [order template](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#phases-and-order-templates)." + }, + "card_id": { + "type": "string", + "description": "The ID of the [subscriber's](entity:Customer) [card](entity:Card) to charge.\nIf it is not specified, the subscriber receives an invoice via email with a link to pay for their subscription." + }, + "timezone": { + "type": "string", + "description": "The timezone that is used in date calculations for the subscription. If unset, defaults to\nthe location timezone. If a timezone is not configured for the location, defaults to \"America/New_York\".\nFormat: the IANA Timezone Database identifier for the location timezone. For\na list of time zones, see [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)." + }, + "source": { + "$ref": "#/components/schemas/SubscriptionSource", + "description": "The origination details of the subscription.", + "x-release-status": "BETA" + }, + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The day-of-the-month to change the billing date to.", + "minimum": 1, + "maximum": 31, + "x-release-status": "BETA" + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Phase" + }, + "description": "array of phases for this subscription" + } + }, + "example": { + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "idempotency_key": "8193148c-9586-11e6-99f9-28cfe92138cf", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + "ordinal": 0 + } + ], + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2023-06-20", + "timezone": "America/Los_Angeles" + } + }, + "CreateSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[CreateSubscription](api-endpoint:Subscriptions-CreateSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The newly created subscription.\n\nFor more information, see\n[Subscription object](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#subscription-object)." + } + }, + "example": { + "subscription": { + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + "ordinal": 0, + "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", + "uid": "873451e0-745b-4e87-ab0b-c574933fe616" + } + ], + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2023-06-20", + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 1 + } + } + }, + "CreateTeamMemberRequest": { + "type": "object", + "description": "Represents a create request for a `TeamMember` object.", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateTeamMember` request.\nKeys can be any valid string, but must be unique for every request.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).\n\nThe minimum length is 1 and the maximum length is 45." + }, + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "**Required** The data used to create the `TeamMember` object. If you include `wage_setting`, you must provide\n`job_id` for each job assignment. To get job IDs, call [ListJobs](api-endpoint:Team-ListJobs)." + } + }, + "example": { + "idempotency_key": "idempotency-key-0", + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "YSGH2WBKG94QZ", + "GA2Y9HSJ8KRYT" + ] + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "wage_setting": { + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "pay_type": "HOURLY" + } + ] + } + } + } + }, + "CreateTeamMemberResponse": { + "type": "object", + "description": "Represents a response from a create request containing the created `TeamMember` object or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The successfully created `TeamMember` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "GA2Y9HSJ8KRYT", + "YSGH2WBKG94QZ" + ] + }, + "created_at": "2021-06-11T22:55:45Z", + "email_address": "joe_doe@example.com", + "family_name": "Doe", + "given_name": "Joe", + "id": "1yJlHapkseYnNPETIU1B", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "updated_at": "2021-06-11T22:55:45Z", + "wage_setting": { + "created_at": "2021-06-11T22:55:45Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 1443, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "1yJlHapkseYnNPETIU1B", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + } + } + }, + "CreateTerminalActionRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "idempotency_key", + "action" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateAction` request. Keys can be any valid string\nbut must be unique for every `CreateAction` request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more\ninformation.", + "minLength": 1, + "maxLength": 64 + }, + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The Action to create." + } + }, + "example": { + "action": { + "deadline_duration": "PT5M", + "device_id": "{{DEVICE_ID}}", + "save_card_options": { + "customer_id": "{{CUSTOMER_ID}}", + "reference_id": "user-id-1" + }, + "type": "SAVE_CARD" + }, + "idempotency_key": "thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e" + } + }, + "CreateTerminalActionResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The created `TerminalAction`" + } + }, + "example": { + "action": { + "app_id": "APP_ID", + "created_at": "2021-07-28T23:22:07.476Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:jveJIAkkAjILHkdCE", + "location_id": "LOCATION_ID", + "save_card_options": { + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "PENDING", + "type": "SAVE_CARD", + "updated_at": "2021-07-28T23:22:07.476Z" + } + } + }, + "CreateTerminalCheckoutRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "checkout" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateCheckout` request. Keys can be any valid string but\nmust be unique for every `CreateCheckout` request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 64 + }, + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The checkout to create." + } + }, + "example": { + "checkout": { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003" + }, + "note": "A brief note", + "reference_id": "id11572" + }, + "idempotency_key": "28a0c3bc-7839-11ea-bc55-0242ac130003" + } + }, + "CreateTerminalCheckoutResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The created `TerminalCheckout`." + } + }, + "example": { + "checkout": { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2020-04-06T16:39:32.545Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "08YceKh7B3ZqO", + "location_id": "LOCATION_ID", + "note": "A brief note", + "payment_type": "CARD_PRESENT", + "reference_id": "id11572", + "status": "PENDING", + "updated_at": "2020-04-06T16:39:32.545Z" + } + } + }, + "CreateTerminalRefundRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateRefund` request. Keys can be any valid string but\nmust be unique for every `CreateRefund` request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 64 + }, + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The refund to create." + } + }, + "example": { + "idempotency_key": "402a640b-b26f-401f-b406-46f839590c04", + "refund": { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Returning items" + } + } + }, + "CreateTerminalRefundResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The created `TerminalRefund`." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 1, + "exp_year": 2022, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "created_at": "2020-09-29T15:21:46.771Z", + "deadline_duration": "PT5M", + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "id": "009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "76C9W6K8CNNQ5", + "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Returning items", + "status": "PENDING", + "updated_at": "2020-09-29T15:21:46.771Z" + } + } + }, + "CreateTimecardRequest": { + "type": "object", + "description": "Represents a request to create a `Timecard`.", + "x-release-status": "PUBLIC", + "required": [ + "timecard" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string value to ensure the idempotency of the operation.", + "maxLength": 128 + }, + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The `Timecard` to be created." + } + }, + "example": { + "idempotency_key": "HIDSNG5KS478L", + "timecard": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "tip_eligible": true, + "title": "Barista" + } + } + } + }, + "CreateTimecardResponse": { + "type": "object", + "description": "The response to a request to create a `Timecard`. The response contains\nthe created `Timecard` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The `Timecard` that was created on the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "timecard": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "created_at": "2019-02-28T00:39:02Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "id": "K0YH4CV5462JB", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-28T00:39:02Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + } + }, + "CreateVendorRequest": { + "type": "object", + "description": "Represents an input to a call to [CreateVendor](api-endpoint:Vendors-CreateVendor).", + "x-release-status": "BETA", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A client-supplied, universally unique identifier (UUID) to make this [CreateVendor](api-endpoint:Vendors-CreateVendor) call idempotent.\n\nSee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the\n[API Development 101](https://developer.squareup.com/docs/buildbasics) section for more\ninformation.", + "minLength": 1, + "maxLength": 128 + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The requested [Vendor](entity:Vendor) to be created." + } + }, + "example": { + "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "name": "Joe's Fresh Seafood", + "note": "a vendor" + } + } + }, + "CreateVendorResponse": { + "type": "object", + "description": "Represents an output from a call to [CreateVendor](api-endpoint:Vendors-CreateVendor).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered when the request fails." + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The successfully created [Vendor](entity:Vendor) object." + } + }, + "example": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "a vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 1 + } + } + }, + "CreateWebhookSubscriptionRequest": { + "type": "object", + "description": "Creates a [Subscription](entity:WebhookSubscription).", + "x-release-status": "PUBLIC", + "required": [ + "subscription" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) request.", + "maxLength": 45 + }, + "subscription": { + "$ref": "#/components/schemas/WebhookSubscription", + "description": "The [Subscription](entity:WebhookSubscription) to create." + } + }, + "example": { + "idempotency_key": "63f84c6c-2200-4c99-846c-2670a1311fbf", + "subscription": { + "api_version": "2021-12-15", + "event_types": [ + "payment.created", + "payment.updated" + ], + "name": "Example Webhook Subscription", + "notification_url": "https://example-webhook-url.com" + } + } + }, + "CreateWebhookSubscriptionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) endpoint.\n\nNote: if there are errors processing the request, the [Subscription](entity:WebhookSubscription) will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/WebhookSubscription", + "description": "The new [Subscription](entity:WebhookSubscription)." + } + }, + "example": { + "subscription": { + "api_version": "2021-12-15", + "created_at": "2022-01-10 23:29:48 +0000 UTC", + "enabled": true, + "event_types": [ + "payment.created", + "payment.updated" + ], + "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", + "name": "Example Webhook Subscription", + "notification_url": "https://example-webhook-url.com", + "signature_key": "1k9bIJKCeTmSQwyagtNRLg", + "updated_at": "2022-01-10 23:29:48 +0000 UTC" + } + } + }, + "Currency": { + "type": "string", + "enum": [ + "UNKNOWN_CURRENCY", + "AED", + "AFN", + "ALL", + "AMD", + "ANG", + "AOA", + "ARS", + "AUD", + "AWG", + "AZN", + "BAM", + "BBD", + "BDT", + "BGN", + "BHD", + "BIF", + "BMD", + "BND", + "BOB", + "BOV", + "BRL", + "BSD", + "BTN", + "BWP", + "BYR", + "BZD", + "CAD", + "CDF", + "CHE", + "CHF", + "CHW", + "CLF", + "CLP", + "CNY", + "COP", + "COU", + "CRC", + "CUC", + "CUP", + "CVE", + "CZK", + "DJF", + "DKK", + "DOP", + "DZD", + "EGP", + "ERN", + "ETB", + "EUR", + "FJD", + "FKP", + "GBP", + "GEL", + "GHS", + "GIP", + "GMD", + "GNF", + "GTQ", + "GYD", + "HKD", + "HNL", + "HRK", + "HTG", + "HUF", + "IDR", + "ILS", + "INR", + "IQD", + "IRR", + "ISK", + "JMD", + "JOD", + "JPY", + "KES", + "KGS", + "KHR", + "KMF", + "KPW", + "KRW", + "KWD", + "KYD", + "KZT", + "LAK", + "LBP", + "LKR", + "LRD", + "LSL", + "LTL", + "LVL", + "LYD", + "MAD", + "MDL", + "MGA", + "MKD", + "MMK", + "MNT", + "MOP", + "MRO", + "MUR", + "MVR", + "MWK", + "MXN", + "MXV", + "MYR", + "MZN", + "NAD", + "NGN", + "NIO", + "NOK", + "NPR", + "NZD", + "OMR", + "PAB", + "PEN", + "PGK", + "PHP", + "PKR", + "PLN", + "PYG", + "QAR", + "RON", + "RSD", + "RUB", + "RWF", + "SAR", + "SBD", + "SCR", + "SDG", + "SEK", + "SGD", + "SHP", + "SLL", + "SLE", + "SOS", + "SRD", + "SSP", + "STD", + "SVC", + "SYP", + "SZL", + "THB", + "TJS", + "TMT", + "TND", + "TOP", + "TRY", + "TTD", + "TWD", + "TZS", + "UAH", + "UGX", + "USD", + "USN", + "USS", + "UYI", + "UYU", + "UZS", + "VEF", + "VND", + "VUV", + "WST", + "XAF", + "XAG", + "XAU", + "XBA", + "XBB", + "XBC", + "XBD", + "XCD", + "XDR", + "XOF", + "XPD", + "XPF", + "XPT", + "XTS", + "XXX", + "YER", + "ZAR", + "ZMK", + "ZMW", + "BTC", + "XUS" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_CURRENCY", + "description": "Unknown currency" + }, + { + "name": "AED", + "description": "United Arab Emirates dirham" + }, + { + "name": "AFN", + "description": "Afghan afghani" + }, + { + "name": "ALL", + "description": "Albanian lek" + }, + { + "name": "AMD", + "description": "Armenian dram" + }, + { + "name": "ANG", + "description": "Netherlands Antillean guilder" + }, + { + "name": "AOA", + "description": "Angolan kwanza" + }, + { + "name": "ARS", + "description": "Argentine peso" + }, + { + "name": "AUD", + "description": "Australian dollar" + }, + { + "name": "AWG", + "description": "Aruban florin" + }, + { + "name": "AZN", + "description": "Azerbaijani manat" + }, + { + "name": "BAM", + "description": "Bosnia and Herzegovina convertible mark" + }, + { + "name": "BBD", + "description": "Barbados dollar" + }, + { + "name": "BDT", + "description": "Bangladeshi taka" + }, + { + "name": "BGN", + "description": "Bulgarian lev" + }, + { + "name": "BHD", + "description": "Bahraini dinar" + }, + { + "name": "BIF", + "description": "Burundian franc" + }, + { + "name": "BMD", + "description": "Bermudian dollar" + }, + { + "name": "BND", + "description": "Brunei dollar" + }, + { + "name": "BOB", + "description": "Boliviano" + }, + { + "name": "BOV", + "description": "Bolivian Mvdol" + }, + { + "name": "BRL", + "description": "Brazilian real" + }, + { + "name": "BSD", + "description": "Bahamian dollar" + }, + { + "name": "BTN", + "description": "Bhutanese ngultrum" + }, + { + "name": "BWP", + "description": "Botswana pula" + }, + { + "name": "BYR", + "description": "Belarusian ruble" + }, + { + "name": "BZD", + "description": "Belize dollar" + }, + { + "name": "CAD", + "description": "Canadian dollar" + }, + { + "name": "CDF", + "description": "Congolese franc" + }, + { + "name": "CHE", + "description": "WIR Euro" + }, + { + "name": "CHF", + "description": "Swiss franc" + }, + { + "name": "CHW", + "description": "WIR Franc" + }, + { + "name": "CLF", + "description": "Unidad de Fomento" + }, + { + "name": "CLP", + "description": "Chilean peso" + }, + { + "name": "CNY", + "description": "Chinese yuan" + }, + { + "name": "COP", + "description": "Colombian peso" + }, + { + "name": "COU", + "description": "Unidad de Valor Real" + }, + { + "name": "CRC", + "description": "Costa Rican colon" + }, + { + "name": "CUC", + "description": "Cuban convertible peso" + }, + { + "name": "CUP", + "description": "Cuban peso" + }, + { + "name": "CVE", + "description": "Cape Verdean escudo" + }, + { + "name": "CZK", + "description": "Czech koruna" + }, + { + "name": "DJF", + "description": "Djiboutian franc" + }, + { + "name": "DKK", + "description": "Danish krone" + }, + { + "name": "DOP", + "description": "Dominican peso" + }, + { + "name": "DZD", + "description": "Algerian dinar" + }, + { + "name": "EGP", + "description": "Egyptian pound" + }, + { + "name": "ERN", + "description": "Eritrean nakfa" + }, + { + "name": "ETB", + "description": "Ethiopian birr" + }, + { + "name": "EUR", + "description": "Euro" + }, + { + "name": "FJD", + "description": "Fiji dollar" + }, + { + "name": "FKP", + "description": "Falkland Islands pound" + }, + { + "name": "GBP", + "description": "Pound sterling" + }, + { + "name": "GEL", + "description": "Georgian lari" + }, + { + "name": "GHS", + "description": "Ghanaian cedi" + }, + { + "name": "GIP", + "description": "Gibraltar pound" + }, + { + "name": "GMD", + "description": "Gambian dalasi" + }, + { + "name": "GNF", + "description": "Guinean franc" + }, + { + "name": "GTQ", + "description": "Guatemalan quetzal" + }, + { + "name": "GYD", + "description": "Guyanese dollar" + }, + { + "name": "HKD", + "description": "Hong Kong dollar" + }, + { + "name": "HNL", + "description": "Honduran lempira" + }, + { + "name": "HRK", + "description": "Croatian kuna" + }, + { + "name": "HTG", + "description": "Haitian gourde" + }, + { + "name": "HUF", + "description": "Hungarian forint" + }, + { + "name": "IDR", + "description": "Indonesian rupiah" + }, + { + "name": "ILS", + "description": "Israeli new shekel" + }, + { + "name": "INR", + "description": "Indian rupee" + }, + { + "name": "IQD", + "description": "Iraqi dinar" + }, + { + "name": "IRR", + "description": "Iranian rial" + }, + { + "name": "ISK", + "description": "Icelandic króna" + }, + { + "name": "JMD", + "description": "Jamaican dollar" + }, + { + "name": "JOD", + "description": "Jordanian dinar" + }, + { + "name": "JPY", + "description": "Japanese yen" + }, + { + "name": "KES", + "description": "Kenyan shilling" + }, + { + "name": "KGS", + "description": "Kyrgyzstani som" + }, + { + "name": "KHR", + "description": "Cambodian riel" + }, + { + "name": "KMF", + "description": "Comoro franc" + }, + { + "name": "KPW", + "description": "North Korean won" + }, + { + "name": "KRW", + "description": "South Korean won" + }, + { + "name": "KWD", + "description": "Kuwaiti dinar" + }, + { + "name": "KYD", + "description": "Cayman Islands dollar" + }, + { + "name": "KZT", + "description": "Kazakhstani tenge" + }, + { + "name": "LAK", + "description": "Lao kip" + }, + { + "name": "LBP", + "description": "Lebanese pound" + }, + { + "name": "LKR", + "description": "Sri Lankan rupee" + }, + { + "name": "LRD", + "description": "Liberian dollar" + }, + { + "name": "LSL", + "description": "Lesotho loti" + }, + { + "name": "LTL", + "description": "Lithuanian litas" + }, + { + "name": "LVL", + "description": "Latvian lats" + }, + { + "name": "LYD", + "description": "Libyan dinar" + }, + { + "name": "MAD", + "description": "Moroccan dirham" + }, + { + "name": "MDL", + "description": "Moldovan leu" + }, + { + "name": "MGA", + "description": "Malagasy ariary" + }, + { + "name": "MKD", + "description": "Macedonian denar" + }, + { + "name": "MMK", + "description": "Myanmar kyat" + }, + { + "name": "MNT", + "description": "Mongolian tögrög" + }, + { + "name": "MOP", + "description": "Macanese pataca" + }, + { + "name": "MRO", + "description": "Mauritanian ouguiya" + }, + { + "name": "MUR", + "description": "Mauritian rupee" + }, + { + "name": "MVR", + "description": "Maldivian rufiyaa" + }, + { + "name": "MWK", + "description": "Malawian kwacha" + }, + { + "name": "MXN", + "description": "Mexican peso" + }, + { + "name": "MXV", + "description": "Mexican Unidad de Inversion" + }, + { + "name": "MYR", + "description": "Malaysian ringgit" + }, + { + "name": "MZN", + "description": "Mozambican metical" + }, + { + "name": "NAD", + "description": "Namibian dollar" + }, + { + "name": "NGN", + "description": "Nigerian naira" + }, + { + "name": "NIO", + "description": "Nicaraguan córdoba" + }, + { + "name": "NOK", + "description": "Norwegian krone" + }, + { + "name": "NPR", + "description": "Nepalese rupee" + }, + { + "name": "NZD", + "description": "New Zealand dollar" + }, + { + "name": "OMR", + "description": "Omani rial" + }, + { + "name": "PAB", + "description": "Panamanian balboa" + }, + { + "name": "PEN", + "description": "Peruvian sol" + }, + { + "name": "PGK", + "description": "Papua New Guinean kina" + }, + { + "name": "PHP", + "description": "Philippine peso" + }, + { + "name": "PKR", + "description": "Pakistani rupee" + }, + { + "name": "PLN", + "description": "Polish złoty" + }, + { + "name": "PYG", + "description": "Paraguayan guaraní" + }, + { + "name": "QAR", + "description": "Qatari riyal" + }, + { + "name": "RON", + "description": "Romanian leu" + }, + { + "name": "RSD", + "description": "Serbian dinar" + }, + { + "name": "RUB", + "description": "Russian ruble" + }, + { + "name": "RWF", + "description": "Rwandan franc" + }, + { + "name": "SAR", + "description": "Saudi riyal" + }, + { + "name": "SBD", + "description": "Solomon Islands dollar" + }, + { + "name": "SCR", + "description": "Seychelles rupee" + }, + { + "name": "SDG", + "description": "Sudanese pound" + }, + { + "name": "SEK", + "description": "Swedish krona" + }, + { + "name": "SGD", + "description": "Singapore dollar" + }, + { + "name": "SHP", + "description": "Saint Helena pound" + }, + { + "name": "SLL", + "description": "Sierra Leonean first leone" + }, + { + "name": "SLE", + "description": "Sierra Leonean second leone" + }, + { + "name": "SOS", + "description": "Somali shilling" + }, + { + "name": "SRD", + "description": "Surinamese dollar" + }, + { + "name": "SSP", + "description": "South Sudanese pound" + }, + { + "name": "STD", + "description": "São Tomé and Príncipe dobra" + }, + { + "name": "SVC", + "description": "Salvadoran colón" + }, + { + "name": "SYP", + "description": "Syrian pound" + }, + { + "name": "SZL", + "description": "Swazi lilangeni" + }, + { + "name": "THB", + "description": "Thai baht" + }, + { + "name": "TJS", + "description": "Tajikstani somoni" + }, + { + "name": "TMT", + "description": "Turkmenistan manat" + }, + { + "name": "TND", + "description": "Tunisian dinar" + }, + { + "name": "TOP", + "description": "Tongan pa'anga" + }, + { + "name": "TRY", + "description": "Turkish lira" + }, + { + "name": "TTD", + "description": "Trinidad and Tobago dollar" + }, + { + "name": "TWD", + "description": "New Taiwan dollar" + }, + { + "name": "TZS", + "description": "Tanzanian shilling" + }, + { + "name": "UAH", + "description": "Ukrainian hryvnia" + }, + { + "name": "UGX", + "description": "Ugandan shilling" + }, + { + "name": "USD", + "description": "United States dollar" + }, + { + "name": "USN", + "description": "United States dollar (next day)" + }, + { + "name": "USS", + "description": "United States dollar (same day)" + }, + { + "name": "UYI", + "description": "Uruguay Peso en Unidedades Indexadas" + }, + { + "name": "UYU", + "description": "Uruguyan peso" + }, + { + "name": "UZS", + "description": "Uzbekistan som" + }, + { + "name": "VEF", + "description": "Venezuelan bolívar soberano" + }, + { + "name": "VND", + "description": "Vietnamese đồng" + }, + { + "name": "VUV", + "description": "Vanuatu vatu" + }, + { + "name": "WST", + "description": "Samoan tala" + }, + { + "name": "XAF", + "description": "CFA franc BEAC" + }, + { + "name": "XAG", + "description": "Silver" + }, + { + "name": "XAU", + "description": "Gold" + }, + { + "name": "XBA", + "description": "European Composite Unit" + }, + { + "name": "XBB", + "description": "European Monetary Unit" + }, + { + "name": "XBC", + "description": "European Unit of Account 9" + }, + { + "name": "XBD", + "description": "European Unit of Account 17" + }, + { + "name": "XCD", + "description": "East Caribbean dollar" + }, + { + "name": "XDR", + "description": "Special drawing rights (International Monetary Fund)" + }, + { + "name": "XOF", + "description": "CFA franc BCEAO" + }, + { + "name": "XPD", + "description": "Palladium" + }, + { + "name": "XPF", + "description": "CFP franc" + }, + { + "name": "XPT", + "description": "Platinum" + }, + { + "name": "XTS", + "description": "Code reserved for testing" + }, + { + "name": "XXX", + "description": "No currency" + }, + { + "name": "YER", + "description": "Yemeni rial" + }, + { + "name": "ZAR", + "description": "South African rand" + }, + { + "name": "ZMK", + "description": "Zambian kwacha" + }, + { + "name": "ZMW", + "description": "Zambian kwacha" + }, + { + "name": "BTC", + "description": "Bitcoin" + }, + { + "name": "XUS", + "description": "USD Coin" + } + ], + "description": "Indicates the associated currency for an amount of money. Values correspond\nto [ISO 4217](https://wikipedia.org/wiki/ISO_4217).", + "x-release-status": "PUBLIC" + }, + "CustomAttribute": { + "type": "object", + "description": "A custom attribute value. Each custom attribute value has a corresponding\n`CustomAttributeDefinition` object.", + "x-release-status": "PUBLIC", + "properties": { + "key": { + "type": "string", + "description": "The identifier\nof the custom attribute definition and its corresponding custom attributes. This value\ncan be a simple key, which is the key that is provided when the custom attribute definition\nis created, or a qualified key, if the requesting\napplication is not the definition owner. The qualified key consists of the application ID\nof the custom attribute definition owner\nfollowed by the simple key that was provided when the definition was created. It has the\nformat application_id:simple key.\n\nThe value for a simple key can contain up to 60 alphanumeric characters, periods (.),\nunderscores (_), and hyphens (-).", + "minLength": 1, + "pattern": "^([a-zA-Z0-9\\._-]+:)?[a-zA-Z0-9\\._-]{1,60}$", + "nullable": true + }, + "value": { + "description": "The value assigned to the custom attribute. It is validated against the custom\nattribute definition's schema on write operations. For more information about custom\nattribute values,\nsee [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview).", + "nullable": true + }, + "version": { + "type": "integer", + "description": "Read only. The current version of the custom attribute. This field is incremented when the custom attribute is changed.\nWhen updating an existing custom attribute value, you can provide this field\nand specify the current version of the custom attribute to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency).\nThis field can also be used to enforce strong consistency for reads. For more information about strong consistency for reads,\nsee [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview)." + }, + "visibility": { + "$ref": "#/components/schemas/CustomAttributeDefinitionVisibility", + "description": "A copy of the `visibility` field value for the associated custom attribute definition.\nSee [CustomAttributeDefinitionVisibility](#type-customattributedefinitionvisibility) for possible values", + "readOnly": true + }, + "definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "A copy of the associated custom attribute definition object. This field is only set when\nthe optional field is specified on the request.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp that indicates when the custom attribute was created or was most recently\nupdated, in RFC 3339 format.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the custom attribute was created, in RFC 3339 format.", + "readOnly": true + } + } + }, + "CustomAttributeDefinition": { + "type": "object", + "description": "Represents a definition for custom attribute values. A custom attribute definition\nspecifies the key, visibility, schema, and other properties for a custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "key": { + "type": "string", + "description": "The identifier\nof the custom attribute definition and its corresponding custom attributes. This value\ncan be a simple key, which is the key that is provided when the custom attribute definition\nis created, or a qualified key, if the requesting\napplication is not the definition owner. The qualified key consists of the application ID\nof the custom attribute definition owner\nfollowed by the simple key that was provided when the definition was created. It has the\nformat application_id:simple key.\n\nThe value for a simple key can contain up to 60 alphanumeric characters, periods (.),\nunderscores (_), and hyphens (-).\n\nThis field can not be changed\nafter the custom attribute definition is created. This field is required when creating\na definition and must be unique per application, seller, and resource type.", + "minLength": 1, + "pattern": "^([a-zA-Z0-9\\._-]+:)?[a-zA-Z0-9\\._-]{1,60}$", + "nullable": true + }, + "schema": { + "type": "object", + "description": "The JSON schema for the custom attribute definition, which determines the data type of the corresponding custom attributes. For more information,\nsee [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). This field is required when creating a definition.", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the custom attribute definition for API and seller-facing UI purposes. The name must\nbe unique within the seller and application pair. This field is required if the\n`visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "maxLength": 255, + "nullable": true + }, + "description": { + "type": "string", + "description": "Seller-oriented description of the custom attribute definition, including any constraints\nthat the seller should observe. May be displayed as a tooltip in Square UIs. This field is\nrequired if the `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "maxLength": 255, + "nullable": true + }, + "visibility": { + "$ref": "#/components/schemas/CustomAttributeDefinitionVisibility", + "description": "Specifies how the custom attribute definition and its values should be shared with\nthe seller and other applications. If no value is specified, the value defaults to `VISIBILITY_HIDDEN`.\nSee [Visibility](#type-visibility) for possible values", + "nullable": true + }, + "version": { + "type": "integer", + "description": "Read only. The current version of the custom attribute definition.\nThe value is incremented each time the custom attribute definition is updated.\nWhen updating a custom attribute definition, you can provide this field\nand specify the current version of the custom attribute definition to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency).\n\nOn writes, this field must be set to the latest version. Stale writes are rejected.\n\nThis field can also be used to enforce strong consistency for reads. For more information about strong consistency for reads,\nsee [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview)." + }, + "updated_at": { + "type": "string", + "description": "The timestamp that indicates when the custom attribute definition was created or most recently updated,\nin RFC 3339 format.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the custom attribute definition was created, in RFC 3339 format.", + "readOnly": true + } + } + }, + "CustomAttributeDefinitionEventData": { + "type": "object", + "description": "Represents an object in the CustomAttributeDefinition event notification\npayload that contains the affected custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"custom_attribute_definition\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventDataObject", + "description": "An object containing the custom attribute definition.", + "nullable": true + } + } + }, + "CustomAttributeDefinitionEventDataObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition.", + "nullable": true + } + } + }, + "CustomAttributeDefinitionVisibility": { + "type": "string", + "enum": [ + "VISIBILITY_HIDDEN", + "VISIBILITY_READ_ONLY", + "VISIBILITY_READ_WRITE_VALUES" + ], + "x-enum-elements": [ + { + "name": "VISIBILITY_HIDDEN", + "description": "The custom attribute definition and values are hidden from the seller (except on export\nof all seller data) and other developers." + }, + { + "name": "VISIBILITY_READ_ONLY", + "description": "The seller and other developers can read the custom attribute definition and values\non resources." + }, + { + "name": "VISIBILITY_READ_WRITE_VALUES", + "description": "The seller and other developers can read the custom attribute definition,\nand can read and write values on resources. A custom attribute definition\ncan only be edited or deleted by the application that created it." + } + ], + "description": "The level of permission that a seller or other applications requires to\nview this custom attribute definition.\nThe `Visibility` field controls who can read and write the custom attribute values\nand custom attribute definition.", + "x-release-status": "PUBLIC" + }, + "CustomAttributeEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"custom_attribute\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CustomAttributeEventDataObject", + "description": "An object containing the custom attribute.", + "nullable": true + } + } + }, + "CustomAttributeEventDataObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute.", + "nullable": true + } + } + }, + "CustomAttributeFilter": { + "type": "object", + "description": "Supported custom attribute query expressions for calling the\n[SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems)\nendpoint to search for items or item variations.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition_id": { + "type": "string", + "description": "A query expression to filter items or item variations by matching their custom attributes'\n`custom_attribute_definition_id` property value against the the specified id.\nExactly one of `custom_attribute_definition_id` or `key` must be specified.", + "nullable": true + }, + "key": { + "type": "string", + "description": "A query expression to filter items or item variations by matching their custom attributes'\n`key` property value against the specified key.\nExactly one of `custom_attribute_definition_id` or `key` must be specified.", + "nullable": true + }, + "string_filter": { + "type": "string", + "description": "A query expression to filter items or item variations by matching their custom attributes'\n`string_value` property value against the specified text.\nExactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.", + "nullable": true + }, + "number_filter": { + "$ref": "#/components/schemas/Range", + "description": "A query expression to filter items or item variations with their custom attributes\ncontaining a number value within the specified range.\nExactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.", + "nullable": true + }, + "selection_uids_filter": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A query expression to filter items or item variations by matching their custom attributes'\n`selection_uid_values` values against the specified selection uids.\nExactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.", + "nullable": true + }, + "bool_filter": { + "type": "boolean", + "description": "A query expression to filter items or item variations by matching their custom attributes'\n`boolean_value` property values against the specified Boolean expression.\nExactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.", + "nullable": true + } + } + }, + "CustomField": { + "type": "object", + "description": "Describes a custom form field to add to the checkout page to collect more information from buyers during checkout.\nFor more information,\nsee [Specify checkout options](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#specify-checkout-options-1).", + "x-release-status": "PUBLIC", + "required": [ + "title" + ], + "properties": { + "title": { + "type": "string", + "description": "The title of the custom field.", + "minLength": 1, + "maxLength": 50 + } + } + }, + "Customer": { + "type": "object", + "description": "Represents a Square customer profile in the Customer Directory of a Square seller.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique Square-assigned ID for the customer profile.\n\nIf you need this ID for an API request, use the ID returned when you created the customer profile or call the [SearchCustomers](api-endpoint:Customers-SearchCustomers) \nor [ListCustomers](api-endpoint:Customers-ListCustomers) endpoint." + }, + "created_at": { + "type": "string", + "description": "The timestamp when the customer profile was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the customer profile was last updated, in RFC 3339 format.", + "readOnly": true + }, + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the customer profile.", + "nullable": true + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the customer profile.", + "nullable": true + }, + "nickname": { + "type": "string", + "description": "A nickname for the customer profile.", + "nullable": true + }, + "company_name": { + "type": "string", + "description": "A business name associated with the customer profile.", + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address associated with the customer profile.", + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address associated with the customer profile.", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number associated with the customer profile.", + "nullable": true + }, + "birthday": { + "type": "string", + "description": "The birthday associated with the customer profile, in `YYYY-MM-DD` format. For example, `1998-09-21`\nrepresents September 21, 1998, and `0000-09-21` represents September 21 (without a birth year).", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "An optional second ID used to associate the customer profile with an\nentity in another system.", + "nullable": true + }, + "note": { + "type": "string", + "description": "A custom note associated with the customer profile.", + "nullable": true + }, + "preferences": { + "$ref": "#/components/schemas/CustomerPreferences", + "description": "Represents general customer preferences.", + "nullable": true + }, + "creation_source": { + "$ref": "#/components/schemas/CustomerCreationSource", + "description": "The method used to create the customer profile.\nSee [CustomerCreationSource](#type-customercreationsource) for possible values", + "nullable": true + }, + "group_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of [customer groups](entity:CustomerGroup) the customer belongs to.", + "nullable": true + }, + "segment_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of [customer segments](entity:CustomerSegment) the customer belongs to.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership.", + "format": "int64" + }, + "tax_ids": { + "$ref": "#/components/schemas/CustomerTaxIds", + "description": "The tax ID associated with the customer profile. This field is present only for customers of sellers in EU countries or the United Kingdom. \nFor more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).", + "nullable": true + } + } + }, + "CustomerAddressFilter": { + "type": "object", + "description": "The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](entity:CustomerCustomAttributeFilterValue) filter when\nsearching by an `Address`-type custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "postal_code": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "The postal code to search for. Only an `exact` match is supported.", + "nullable": true + }, + "country": { + "$ref": "#/components/schemas/Country", + "description": "The country code to search for.\nSee [Country](#type-country) for possible values", + "nullable": true + } + } + }, + "CustomerCreatedEvent": { + "type": "object", + "description": "Published when a [customer](entity:Customer) is created. Subscribe to this event to track customer profiles affected by a merge operation.\nFor more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks).\n\nThe `customer` object in the event notification does not include the `segment_ids` field.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this object, the value is `customer.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for [idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomerCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:23:25Z", + "data": { + "id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "object": { + "customer": { + "address": { + "address_line_1": "1018 40th Street", + "administrative_district_level_1": "CA", + "locality": "Oakland", + "postal_code": "94608" + }, + "birthday": "1962-03-04", + "created_at": "2022-11-09T21:23:25.519Z", + "creation_source": "DIRECTORY", + "email_address": "jenkins+smorly@squareup.com", + "family_name": "Smorly", + "given_name": "Jenkins", + "group_ids": [ + "JGJCW9S0G68NE.APPOINTMENTS" + ], + "id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "phone_number": "+12126668929", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2022-11-09T21:23:25Z", + "version": 0 + } + }, + "type": "customer" + }, + "event_id": "e12b5591-e0b6-4967-810a-307c7efcb1a7", + "merchant_id": "G7MMEBVW021Q4", + "type": "customer.created" + }, + "x-webhook": { + "event": "customer.created", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/Customers", + "x-since": "2021-02-26" + }, + "CustomerCreatedEventData": { + "type": "object", + "description": "The data associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `customer`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the new customer.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CustomerCreatedEventObject", + "description": "An object that contains the new customer.", + "nullable": true + } + } + }, + "CustomerCreatedEventEventContext": { + "type": "object", + "description": "Information about the change that triggered the event.", + "x-release-status": "PUBLIC", + "properties": { + "merge": { + "$ref": "#/components/schemas/CustomerCreatedEventEventContextMerge", + "description": "Information about the merge operation associated with the event.", + "nullable": true + } + } + }, + "CustomerCreatedEventEventContextMerge": { + "type": "object", + "description": "Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers.", + "x-release-status": "PUBLIC", + "properties": { + "from_customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the existing customers that were merged and then deleted.", + "nullable": true + }, + "to_customer_id": { + "type": "string", + "description": "The ID of the new customer created by the merge.", + "nullable": true + } + } + }, + "CustomerCreatedEventObject": { + "type": "object", + "description": "An object that contains the customer associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The new customer.", + "nullable": true + }, + "event_context": { + "$ref": "#/components/schemas/CustomerCreatedEventEventContext", + "description": "Information about the change that triggered the event. This field is returned only if the customer is created by a merge operation.", + "nullable": true + } + } + }, + "CustomerCreationSource": { + "type": "string", + "enum": [ + "OTHER", + "APPOINTMENTS", + "COUPON", + "DELETION_RECOVERY", + "DIRECTORY", + "EGIFTING", + "EMAIL_COLLECTION", + "FEEDBACK", + "IMPORT", + "INVOICES", + "LOYALTY", + "MARKETING", + "MERGE", + "ONLINE_STORE", + "INSTANT_PROFILE", + "TERMINAL", + "THIRD_PARTY", + "THIRD_PARTY_IMPORT", + "UNMERGE_RECOVERY" + ], + "x-enum-elements": [ + { + "name": "OTHER", + "description": "The default creation source. This source is typically used for backward/future\ncompatibility when the original source of a customer profile is\nunrecognized. For example, when older clients do not support newer\nsource types." + }, + { + "name": "APPOINTMENTS", + "description": "The customer profile was created automatically when an appointment\nwas scheduled." + }, + { + "name": "COUPON", + "description": "The customer profile was created automatically when a coupon was issued\nusing Square Point of Sale." + }, + { + "name": "DELETION_RECOVERY", + "description": "The customer profile was restored through Square's deletion recovery\nprocess." + }, + { + "name": "DIRECTORY", + "description": "The customer profile was created manually through Square Seller Dashboard or the \nPoint of Sale application." + }, + { + "name": "EGIFTING", + "description": "The customer profile was created automatically when a gift card was\nissued using Square Point of Sale. Customer profiles are created for\nboth the buyer and the recipient of the gift card." + }, + { + "name": "EMAIL_COLLECTION", + "description": "The customer profile was created through Square Point of Sale when\nsigning up for marketing emails during checkout." + }, + { + "name": "FEEDBACK", + "description": "The customer profile was created automatically when providing feedback\nthrough a digital receipt." + }, + { + "name": "IMPORT", + "description": "The customer profile was created automatically when importing customer\ndata through Square Seller Dashboard." + }, + { + "name": "INVOICES", + "description": "The customer profile was created automatically during an invoice payment." + }, + { + "name": "LOYALTY", + "description": "The customer profile was created automatically when customers provide a\nphone number for loyalty reward programs during checkout." + }, + { + "name": "MARKETING", + "description": "The customer profile was created as the result of a campaign managed\nthrough Square’s Facebook integration." + }, + { + "name": "MERGE", + "description": "The customer profile was created as the result of explicitly merging\nmultiple customer profiles through the Square Seller Dashboard or the Point of\nSale application." + }, + { + "name": "ONLINE_STORE", + "description": "The customer profile was created through Square's Online Store solution\n(legacy service)." + }, + { + "name": "INSTANT_PROFILE", + "description": "The customer profile was created automatically as the result of a successful\ntransaction that did not explicitly link to an existing customer profile." + }, + { + "name": "TERMINAL", + "description": "The customer profile was created through Square's Virtual Terminal." + }, + { + "name": "THIRD_PARTY", + "description": "The customer profile was created through a Square API call." + }, + { + "name": "THIRD_PARTY_IMPORT", + "description": "The customer profile was created by a third-party product and imported\nthrough an official integration." + }, + { + "name": "UNMERGE_RECOVERY", + "description": "The customer profile was restored through Square's unmerge recovery\nprocess." + } + ], + "description": "Indicates the method used to create the customer profile.", + "x-release-status": "PUBLIC" + }, + "CustomerCreationSourceFilter": { + "type": "object", + "description": "The creation source filter.\n\nIf one or more creation sources are set, customer profiles are included in,\nor excluded from, the result if they match at least one of the filter criteria.", + "x-release-status": "PUBLIC", + "properties": { + "values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerCreationSource" + }, + "description": "The list of creation sources used as filtering criteria.\nSee [CustomerCreationSource](#type-customercreationsource) for possible values", + "nullable": true + }, + "rule": { + "$ref": "#/components/schemas/CustomerInclusionExclusion", + "description": "Indicates whether a customer profile matching the filter criteria\nshould be included in the result or excluded from the result.\n\nDefault: `INCLUDE`.\nSee [CustomerInclusionExclusion](#type-customerinclusionexclusion) for possible values", + "nullable": true + } + } + }, + "CustomerCustomAttributeDefinitionCreatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) \nis created by the subscribing application.\n\nThis event is replaced by \n[customer.custom_attribute_definition.owned.created](webhook:customer.custom_attribute_definition.owned.created).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "347ab320-c0ba-48f5-959a-4e147b9aefcf", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.created" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.created", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionCreatedPublicEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to all applications is created. A notification is sent when any application creates a custom\nattribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.\n\nThis event is replaced by \n[customer.custom_attribute_definition.visible.created](webhook:customer.custom_attribute_definition.visible.created),\nwhich applies to custom attribute definitions that are visible to the subscribing application.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.public.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "names": [ + "Small", + "Medium", + "Large" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "f679dc4f-3619-4764-a4de-94a54735cd32", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.public.created" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.public.created", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\ncreated by the subscribing application is deleted. A custom attribute definition can only be deleted by\nthe application that created it.\n\nThis event is replaced by \n[customer.custom_attribute_definition.owned.deleted](webhook:customer.custom_attribute_definition.owned.deleted).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "49363646-7ae7-49b5-aaa0-296610883c61", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionDeletedPublicEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to all applications is deleted. A notification is sent when any application deletes a custom\nattribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.\n\nThis event is replaced by \n[customer.custom_attribute_definition.visible.deleted](webhook:customer.custom_attribute_definition.visible.deleted),\nwhich applies to custom attribute definitions that are visible to the subscribing application.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.public.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's t-shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "T-Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08", + "89ca2c01-e4e3-43d6-b846-1495c4e8f97b", + "4f985a76-08fc-44b1-9ec4-b1904685c3a5" + ], + "names": [ + "Small", + "Medium", + "Large", + "Extra Large", + "Extra Small" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "81c10a07-c329-4943-af20-7d70a300c7e6", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.public.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.public.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionOwnedCreatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) \nis created by the subscribing application.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.owned.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "347ab320-c0ba-48f5-959a-4e147b9aefcf", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.owned.created" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.owned.created", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDefinitionOwnedDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\ncreated by the subscribing application is deleted. A custom attribute definition can only be deleted by\nthe application that created it.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "49363646-7ae7-49b5-aaa0-296610883c61", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.owned.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.owned.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDefinitionOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\ncreated by the subscribing application is updated. A custom attribute definition can only be updated by\nthe application that created it.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "d914e6ef-9e37-4bca-a663-ecc55f5d98d3", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.owned.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.owned.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDefinitionUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\ncreated by the subscribing application is updated. A custom attribute definition can only be updated by\nthe application that created it.\n\nThis event is replaced by \n[customer.custom_attribute_definition.owned.updated](webhook:customer.custom_attribute_definition.owned.updated).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "d914e6ef-9e37-4bca-a663-ecc55f5d98d3", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionUpdatedPublicEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to all applications is updated. A notification is sent when any application updates a custom\nattribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.\n\nThis event is replaced by \n[customer.custom_attribute_definition.visible.updated](webhook:customer.custom_attribute_definition.visible.updated),\nwhich applies to custom attribute definitions that are visible to the subscribing application.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.public.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "The customer's t-shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "T-Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08", + "89ca2c01-e4e3-43d6-b846-1495c4e8f97b", + "4f985a76-08fc-44b1-9ec4-b1904685c3a5" + ], + "names": [ + "Small", + "Medium", + "Large", + "Extra Large", + "Extra Small" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "ae376c21-d360-4694-96c7-1b27830f07d7", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.public.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.public.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionVisibleCreatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is created. A notification is sent when your application\ncreates a custom attribute definition or another application creates a custom attribute definition whose\n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.visible.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "names": [ + "Small", + "Medium", + "Large" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "f679dc4f-3619-4764-a4de-94a54735cd32", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.visible.created" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.visible.created", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDefinitionVisibleDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is deleted. A custom attribute definition can only be deleted\nby the application that created it. A notification is sent when your application deletes a custom attribute\ndefinition or when another application deletes a custom attribute definition whose `visibility` is\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's t-shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "T-Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08", + "89ca2c01-e4e3-43d6-b846-1495c4e8f97b", + "4f985a76-08fc-44b1-9ec4-b1904685c3a5" + ], + "names": [ + "Small", + "Medium", + "Large", + "Extra Large", + "Extra Small" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "81c10a07-c329-4943-af20-7d70a300c7e6", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.visible.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.visible.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDefinitionVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is updated. A custom attribute definition can only be updated\nby the application that created it. A notification is sent when your application updates a custom\nattribute definition or when another application updates a custom attribute definition whose `visibility` is\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "The customer's t-shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "T-Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08", + "89ca2c01-e4e3-43d6-b846-1495c4e8f97b", + "4f985a76-08fc-44b1-9ec4-b1904685c3a5" + ], + "names": [ + "Small", + "Medium", + "Large", + "Extra Large", + "Extra Small" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "ae376c21-d360-4694-96c7-1b27830f07d7", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.visible.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.visible.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) owned by the\nsubscribing application is deleted. Custom attributes are owned by the application that created the\ncorresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose\n`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application.\n\nThis event is replaced by \n[customer.custom_attribute.owned.deleted](webhook:customer.custom_attribute.owned.deleted).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "updated_at": "2022-04-27T11:31:29Z", + "value": "Medium coffee, 2 sugars", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "f57b27d4-a4d6-43de-9e58-bc6ff90525f1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDeletedPublicEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) that is visible\nto all applications is deleted. A notification is sent when any application deletes a custom attribute\nwhose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.\n\nThis event is replaced by \n[customer.custom_attribute.visible.deleted](webhook:customer.custom_attribute.visible.deleted),\nwhich applies to custom attributes that are visible to the subscribing application.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.public.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "updated_at": "2022-04-27T11:31:29Z", + "value": [ + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "18ef5adc-2efc-4ad9-9b1a-b274a607da3e", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.public.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute.public.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeFilter": { + "type": "object", + "description": "The custom attribute filter. Use this filter in a set of [custom attribute filters](entity:CustomerCustomAttributeFilters) to search\nbased on the value or last updated date of a customer-related [custom attribute](entity:CustomAttribute).", + "x-release-status": "PUBLIC", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string", + "description": "The `key` of the [custom attribute](entity:CustomAttribute) to filter by. The key is the identifier of the custom attribute\n(and the corresponding custom attribute definition) and can be retrieved using the [Customer Custom Attributes API](api:CustomerCustomAttributes)." + }, + "filter": { + "$ref": "#/components/schemas/CustomerCustomAttributeFilterValue", + "description": "A filter that corresponds to the data type of the target custom attribute. For example, provide the `phone` filter to\nsearch based on the value of a `PhoneNumber`-type custom attribute. The data type is specified by the schema field of the custom attribute definition,\nwhich can be retrieved using the [Customer Custom Attributes API](api:CustomerCustomAttributes).\n\nYou must provide this `filter` field, the `updated_at` field, or both.", + "nullable": true + }, + "updated_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The date range for when the custom attribute was last updated. The date range can include `start_at`, `end_at`, or\nboth. Range boundaries are inclusive. Dates are specified as RFC 3339 timestamps.\n\nYou must provide this `updated_at` field, the `filter` field, or both." + } + } + }, + "CustomerCustomAttributeFilterValue": { + "type": "object", + "description": "A type-specific filter used in a [custom attribute filter](entity:CustomerCustomAttributeFilter) to search based on the value \nof a customer-related [custom attribute](entity:CustomAttribute).", + "x-release-status": "PUBLIC", + "properties": { + "email": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter for a query based on the value of an `Email`-type custom attribute. This filter is case-insensitive and can\ninclude `exact` or `fuzzy`, but not both.\n\nFor an `exact` match, provide the complete email address.\n\nFor a `fuzzy` match, provide a query expression containing one or more query tokens to match against the email address. Square removes\nany punctuation (including periods (.), underscores (_), and the @ symbol) and tokenizes the email addresses on spaces. A match is found\nif a tokenized email address contains all the tokens in the search query, irrespective of the token order. For example, `Steven gmail`\nmatches steven.jones@gmail.com and mygmail@stevensbakery.com.", + "nullable": true + }, + "phone": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter for a query based on the value of a `PhoneNumber`-type custom attribute. This filter is case-insensitive and\ncan include `exact` or `fuzzy`, but not both.\n\nFor an `exact` match, provide the complete phone number. This is always an E.164-compliant phone number that starts\nwith the + sign followed by the country code and subscriber number. For example, the format for a US phone number is +12061112222.\n\nFor a `fuzzy` match, provide a query expression containing one or more query tokens to match against the phone number.\nSquare removes any punctuation and tokenizes the expression on spaces. A match is found if a tokenized phone number contains\nall the tokens in the search query, irrespective of the token order. For example, `415 123 45` is tokenized to `415`, `123`, and `45`,\nwhich matches +14151234567 and +12345674158, but does not match +1234156780. Similarly, the expression `415` matches\n+14151234567, +12345674158, and +1234156780.", + "nullable": true + }, + "text": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter for a query based on the value of a `String`-type custom attribute. This filter is case-insensitive and \ncan include `exact` or `fuzzy`, but not both.\n\nFor an `exact` match, provide the complete string.\n\nFor a `fuzzy` match, provide a query expression containing one or more query tokens in any order that contain complete words\nto match against the string. Square tokenizes the expression using a grammar-based tokenizer. For example, the expressions `quick brown`,\n`brown quick`, and `quick fox` match \"The quick brown fox jumps over the lazy dog\". However, `quick foxes` and `qui` do not match.", + "nullable": true + }, + "selection": { + "$ref": "#/components/schemas/FilterValue", + "description": "A filter for a query based on the display name for a `Selection`-type custom attribute value. This filter is case-sensitive\nand can contain `any`, `all`, or both. The `none` condition is not supported.\n\nProvide the display name of each item that you want to search for. To find the display names for the selection, use the \n[Customer Custom Attributes API](api:CustomerCustomAttributes) to retrieve the corresponding custom attribute definition\nand then check the `schema.items.names` field. For more information, see\n[Search based on selection](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#custom-attribute-value-filter-selection).\n\nNote that when a `Selection`-type custom attribute is assigned to a customer profile, the custom attribute value is a list of one\nor more UUIDs (sourced from the `schema.items.enum` field) that map to the item names. These UUIDs are unique per seller.", + "nullable": true + }, + "date": { + "$ref": "#/components/schemas/TimeRange", + "description": "A filter for a query based on the value of a `Date`-type custom attribute.\n\nProvide a date range for this filter using `start_at`, `end_at`, or both. Range boundaries are inclusive. Dates can be specified\nin `YYYY-MM-DD` format or as RFC 3339 timestamps.", + "nullable": true + }, + "number": { + "$ref": "#/components/schemas/FloatNumberRange", + "description": "A filter for a query based on the value of a `Number`-type custom attribute, which can be an integer or a decimal with up to\n5 digits of precision.\n\nProvide a numerical range for this filter using `start_at`, `end_at`, or both. Range boundaries are inclusive. Numbers are specified\nas decimals or integers. The absolute value of range boundaries must not exceed `(2^63-1)/10^5`, or 92233720368547.", + "nullable": true + }, + "boolean": { + "type": "boolean", + "description": "A filter for a query based on the value of a `Boolean`-type custom attribute.", + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/CustomerAddressFilter", + "description": "A filter for a query based on the value of an `Address`-type custom attribute. The filter can include `postal_code`, `country`, or both.", + "nullable": true + } + } + }, + "CustomerCustomAttributeFilters": { + "type": "object", + "description": "The custom attribute filters in a set of [customer filters](entity:CustomerFilter) used in a search query. Use this filter\nto search based on [custom attributes](entity:CustomAttribute) that are assigned to customer profiles. For more information, see\n[Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute).", + "x-release-status": "PUBLIC", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerCustomAttributeFilter" + }, + "description": "The custom attribute filters. Each filter must specify `key` and include the `filter` field with a type-specific filter,\nthe `updated_at` field, or both. The provided keys must be unique within the list of custom attribute filters.", + "nullable": true + } + } + }, + "CustomerCustomAttributeOwnedDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) owned by the\nsubscribing application is deleted. Custom attributes are owned by the application that created the\ncorresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose\n`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "updated_at": "2022-04-27T11:31:29Z", + "value": "Medium coffee, 2 sugars", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "f57b27d4-a4d6-43de-9e58-bc6ff90525f1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.owned.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute.owned.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) owned by the\nsubscribing application is created or updated. Custom attributes are owned by the application that created\nthe corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose\n`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:54Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "updated_at": "2022-04-21T21:40:54Z", + "value": "Double-shot breve", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "e26ca6f2-97f8-426a-b4bf-873044617e94", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.owned.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute.owned.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) owned by the\nsubscribing application is created or updated. Custom attributes are owned by the application that created\nthe corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose\n`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application.\n\nThis event is replaced by \n[customer.custom_attribute.owned.updated](webhook:customer.custom_attribute.owned.updated).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:54Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "updated_at": "2022-04-21T21:40:54Z", + "value": "Double-shot breve", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "e26ca6f2-97f8-426a-b4bf-873044617e94", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeUpdatedPublicEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) that is visible\nto all applications is created or updated. A notification is sent when any application creates or updates\na custom attribute whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.\n\nThis event is replaced by \n[customer.custom_attribute.visible.updated](webhook:customer.custom_attribute.visible.updated),\nwhich applies to custom attributes that are visible to the subscribing application.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.public.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "updated_at": "2022-04-26T01:22:29Z", + "value": [ + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "1cc2925c-f6e2-4fb6-a597-07c198de59e1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.public.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute.public.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeVisibleDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the\nsubscribing application is deleted. A notification is sent when:\n- Your application deletes a custom attribute owned by your application, regardless of the `visibility` setting.\n- Any application deletes a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`\nor `VISIBILITY_READ_WRITE_VALUES`.\n\nCustom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application, but those set to\n`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the owner. Custom attributes are owned\nby the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "updated_at": "2022-04-27T11:31:29Z", + "value": [ + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "18ef5adc-2efc-4ad9-9b1a-b274a607da3e", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.visible.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute.visible.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the\nsubscribing application is created or updated. A notification is sent when:\n- Your application creates or updates a custom attribute owned by your application, regardless of the `visibility` setting.\n- Any application creates or updates a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`\nor `VISIBILITY_READ_WRITE_VALUES`.\n\nCustom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application, but those set to\n`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or updated by the owner. Custom attributes are owned\nby the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "updated_at": "2022-04-26T01:22:29Z", + "value": [ + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "1cc2925c-f6e2-4fb6-a597-07c198de59e1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.visible.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute.visible.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerDeletedEvent": { + "type": "object", + "description": "Published when a [customer](entity:Customer) is deleted. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks).\n\nThe `customer` object in the event notification does not include the following fields: `group_ids` and `segment_ids`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this object, the value is `customer.deleted`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for [idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomerDeletedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:26:50Z", + "data": { + "deleted": true, + "id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "object": { + "customer": { + "address": { + "address_line_1": "1018 1st Street", + "administrative_district_level_1": "NY", + "locality": "Brooklyn", + "postal_code": "11215" + }, + "birthday": "1962-03-04", + "creation_source": "IMPORT", + "email_address": "jenkins+smorly@squareup.com", + "family_name": "Smiley", + "given_name": "Jenkins", + "id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "phone_number": "+12126668929", + "preferences": { + "email_unsubscribed": false + }, + "version": 3 + } + }, + "type": "customer" + }, + "event_id": "8e84fec8-f04b-46f0-b66d-dbb8b59590fa", + "merchant_id": "G7MMEBVW021Q4", + "type": "customer.deleted" + }, + "x-webhook": { + "event": "customer.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/Customers", + "x-since": "2021-02-26" + }, + "CustomerDeletedEventData": { + "type": "object", + "description": "The data associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `customer`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the deleted customer.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CustomerDeletedEventObject", + "description": "An object that contains the deleted customer.", + "nullable": true + } + } + }, + "CustomerDeletedEventEventContext": { + "type": "object", + "description": "Information about the change that triggered the event.", + "x-release-status": "PUBLIC", + "properties": { + "merge": { + "$ref": "#/components/schemas/CustomerDeletedEventEventContextMerge", + "description": "Information about the merge operation associated with the event.", + "nullable": true + } + } + }, + "CustomerDeletedEventEventContextMerge": { + "type": "object", + "description": "Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers.", + "x-release-status": "PUBLIC", + "properties": { + "from_customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the existing customers that were merged and then deleted.", + "nullable": true + }, + "to_customer_id": { + "type": "string", + "description": "The ID of the new customer created by the merge.", + "nullable": true + } + } + }, + "CustomerDeletedEventObject": { + "type": "object", + "description": "An object that contains the customer associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The deleted customer.", + "nullable": true + }, + "event_context": { + "$ref": "#/components/schemas/CustomerDeletedEventEventContext", + "description": "Information about the change that triggered the event. This field is returned only if the customer is deleted by a merge operation.", + "nullable": true + } + } + }, + "CustomerDetails": { + "type": "object", + "description": "Details about the customer making the payment.", + "x-release-status": "PUBLIC", + "properties": { + "customer_initiated": { + "type": "boolean", + "description": "Indicates whether the customer initiated the payment.", + "nullable": true + }, + "seller_keyed_in": { + "type": "boolean", + "description": "Indicates that the seller keyed in payment details on behalf of the customer.\nThis is used to flag a payment as Mail Order / Telephone Order (MOTO).", + "nullable": true + } + } + }, + "CustomerFilter": { + "type": "object", + "description": "Represents the filtering criteria in a [search query](entity:CustomerQuery) that defines how to filter\ncustomer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results.", + "x-release-status": "PUBLIC", + "properties": { + "creation_source": { + "$ref": "#/components/schemas/CustomerCreationSourceFilter", + "description": "A filter to select customers based on their creation source.", + "nullable": true + }, + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "A filter to select customers based on when they were created." + }, + "updated_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "A filter to select customers based on when they were last updated." + }, + "email_address": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter to [select customers by their email address](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-email-address) \nvisible to the seller. \nThis filter is case-insensitive.\n\nFor [exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-email-address), this\nfilter causes the search to return customer profiles \nwhose `email_address` field value are identical to the email address provided\nin the query.\n\nFor [fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-email-address), \nthis filter causes the search to return customer profiles \nwhose `email_address` field value has a token-wise partial match against the filtering \nexpression in the query. For example, with `Steven gmail` provided in a search\nquery, the search returns customers whose email address is `steven.johnson@gmail.com` \nor `mygmail@stevensbakery.com`. Square removes any punctuation (including periods (.),\nunderscores (_), and the @ symbol) and tokenizes the email addresses on spaces. A match is\nfound if a tokenized email address contains all the tokens in the search query, \nirrespective of the token order.", + "nullable": true + }, + "phone_number": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter to [select customers by their phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-phone-number)\nvisible to the seller.\n\nFor [exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-phone-number),\nthis filter returns customers whose phone number matches the specified query expression. The number in the query must be of an\nE.164-compliant form. In particular, it must include the leading `+` sign followed by a country code and then a subscriber number.\nFor example, the standard E.164 form of a US phone number is `+12062223333` and an E.164-compliant variation is `+1 (206) 222-3333`.\nTo match the query expression, stored customer phone numbers are converted to the standard E.164 form.\n\nFor [fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-phone-number),\nthis filter returns customers whose phone number matches the token or tokens provided in the query expression. For example, with `415`\nprovided in a search query, the search returns customers with the phone numbers `+1-415-212-1200`, `+1-212-415-1234`, and `+1 (551) 234-1567`.\nSimilarly, a search query of `415 123` returns customers with the phone numbers `+1-212-415-1234` and `+1 (551) 234-1567` but not\n`+1-212-415-1200`. A match is found if a tokenized phone number contains all the tokens in the search query, irrespective of the token order.", + "nullable": true + }, + "reference_id": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter to [select customers by their reference IDs](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-reference-id).\nThis filter is case-insensitive.\n\n[Exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-reference-id) \nof a customer's reference ID against a query's reference ID is evaluated as an\nexact match between two strings, character by character in the given order.\n\n[Fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-reference-id) \nof stored reference IDs against queried reference IDs works \nexactly the same as fuzzy matching on email addresses. Non-alphanumeric characters \nare replaced by spaces to tokenize stored and queried reference IDs. A match is found\nif a tokenized stored reference ID contains all tokens specified in any order in the query. For example,\na query of `NYC M` matches customer profiles with the `reference_id` value of `NYC_M_35_JOHNSON`\nand `NYC_27_MURRAY`.", + "nullable": true + }, + "group_ids": { + "$ref": "#/components/schemas/FilterValue", + "description": "A filter to select customers based on the [groups](entity:CustomerGroup) they belong to.\nGroup membership is controlled by sellers and developers.\n\nThe `group_ids` filter has the following syntax:\n```\n\"group_ids\": {\n\"any\": [\"{group_a_id}\", \"{group_b_id}\", ...],\n\"all\": [\"{group_1_id}\", \"{group_2_id}\", ...],\n\"none\": [\"{group_i_id}\", \"{group_ii_id}\", ...]\n}\n```\n\nYou can use any combination of the `any`, `all`, and `none` fields in the filter.\nWith `any`, the search returns customers in groups `a` or `b` or any other group specified in the list.\nWith `all`, the search returns customers in groups `1` and `2` and all other groups specified in the list.\nWith `none`, the search returns customers not in groups `i` or `ii` or any other group specified in the list.\n\nIf any of the search conditions are not met, including when an invalid or non-existent group ID is provided,\nthe result is an empty object (`{}`).", + "nullable": true + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomerCustomAttributeFilters", + "description": "A filter to select customers based on one or more custom attributes. \nThis filter can contain up to 10 custom attribute filters. Each custom attribute filter specifies filtering criteria for a target custom\nattribute. If multiple custom attribute filters are provided, they are combined as an `AND` operation.\n\nTo be valid for a search, the custom attributes must be visible to the requesting application. For more information, including example queries,\nsee [Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute).\n\nSquare returns matching customer profiles, which do not contain custom attributes. To retrieve customer-related custom attributes,\nuse the [Customer Custom Attributes API](api:CustomerCustomAttributes). For example, you can call\n[RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) using a customer ID from the result set.", + "nullable": true + }, + "segment_ids": { + "$ref": "#/components/schemas/FilterValue", + "description": " A filter to select customers based on the [segments](entity:CustomerSegment) they belong to.\nSegment membership is dynamic and adjusts automatically based on whether customers meet the segment criteria.\n\nYou can provide up to three segment IDs in the filter, using any combination of the `all`, `any`, and `none` fields.\nFor the following example, the results include customers who belong to both segment A and segment B but do not belong to segment C.\n\n```\n\"segment_ids\": {\n\"all\": [\"{segment_A_id}\", \"{segment_B_id}\"],\n\"none\": [\"{segment_C_id}\"]\n}\n```\n\nIf an invalid or non-existent segment ID is provided in the filter, Square stops processing the request\nand returns a `400 BAD_REQUEST` error that includes the segment ID.", + "nullable": true + } + } + }, + "CustomerGroup": { + "type": "object", + "description": "Represents a group of customer profiles. \n\nCustomer groups can be created, be modified, and have their membership defined using \nthe Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale.", + "x-release-status": "PUBLIC", + "required": [ + "name" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique Square-generated ID for the customer group.", + "maxLength": 255, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the customer group." + }, + "created_at": { + "type": "string", + "description": "The timestamp when the customer group was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the customer group was last updated, in RFC 3339 format.", + "readOnly": true + } + } + }, + "CustomerInclusionExclusion": { + "type": "string", + "enum": [ + "INCLUDE", + "EXCLUDE" + ], + "x-enum-elements": [ + { + "name": "INCLUDE", + "description": "Customers should be included in the result set when they match the\nfiltering criteria." + }, + { + "name": "EXCLUDE", + "description": "Customers should be excluded from the result set when they match\nthe filtering criteria." + } + ], + "description": "Indicates whether customers should be included in, or excluded from,\nthe result set when they match the filtering criteria.", + "x-release-status": "PUBLIC" + }, + "CustomerPreferences": { + "type": "object", + "description": "Represents communication preferences for the customer profile.", + "x-release-status": "PUBLIC", + "properties": { + "email_unsubscribed": { + "type": "boolean", + "description": "Indicates whether the customer has unsubscribed from marketing campaign emails. A value of `true` means that the customer chose to opt out of email marketing from the current Square seller or from all Square sellers. This value is read-only from the Customers API.", + "nullable": true + } + } + }, + "CustomerQuery": { + "type": "object", + "description": "Represents filtering and sorting criteria for a [SearchCustomers](api-endpoint:Customers-SearchCustomers) request.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/CustomerFilter", + "description": "The filtering criteria for the search query. A query can contain multiple filters in any combination.\nMultiple filters are combined as `AND` statements.\n\n__Note:__ Combining multiple filters as `OR` statements is not supported. Instead, send multiple single-filter\nsearches and join the result sets.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/CustomerSort", + "description": "Sorting criteria for query results. The default behavior is to sort \ncustomers alphabetically by `given_name` and `family_name`.", + "nullable": true + } + } + }, + "CustomerSegment": { + "type": "object", + "description": "Represents a group of customer profiles that match one or more predefined filter criteria. \n\nSegments (also known as Smart Groups) are defined and created within the Customer Directory in the\nSquare Seller Dashboard or Point of Sale.", + "x-release-status": "PUBLIC", + "required": [ + "name" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique Square-generated ID for the segment.", + "maxLength": 255, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the segment.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the segment was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the segment was last updated, in RFC 3339 format.", + "readOnly": true + } + } + }, + "CustomerSort": { + "type": "object", + "description": "Represents the sorting criteria in a [search query](entity:CustomerQuery) that defines how to sort\ncustomer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results.", + "x-release-status": "PUBLIC", + "properties": { + "field": { + "$ref": "#/components/schemas/CustomerSortField", + "description": "Indicates the fields to use as the sort key, which is either the default set of fields or `created_at`.\n\nThe default value is `DEFAULT`.\nSee [CustomerSortField](#type-customersortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "Indicates the order in which results should be sorted based on the\nsort field value. Strings use standard alphabetic comparison\nto determine order. Strings representing numbers are sorted as strings.\n\nThe default value is `ASC`.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "CustomerSortField": { + "type": "string", + "enum": [ + "DEFAULT", + "CREATED_AT" + ], + "x-enum-elements": [ + { + "name": "DEFAULT", + "description": "Use the default sort key. By default, customers are sorted\nalphanumerically by concatenating their `given_name` and `family_name`. If\nneither name field is set, string comparison is performed using one of the\nremaining fields in the following order: `company_name`, `email`,\n`phone_number`." + }, + { + "name": "CREATED_AT", + "description": "Use the creation date attribute (`created_at`) of customer profiles as the sort key." + } + ], + "description": "Specifies customer attributes as the sort key to customer profiles returned from a search.", + "x-release-status": "PUBLIC" + }, + "CustomerTaxIds": { + "type": "object", + "description": "Represents the tax ID associated with a [customer profile](entity:Customer). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom. \nFor more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).", + "x-release-status": "PUBLIC", + "properties": { + "eu_vat": { + "type": "string", + "description": "The EU VAT identification number for the customer. For example, `IE3426675K`. The ID can contain alphanumeric characters only.", + "maxLength": 20, + "nullable": true + } + } + }, + "CustomerTextFilter": { + "type": "object", + "description": "A filter to select customers based on exact or fuzzy matching of\ncustomer attributes against a specified query. Depending on the customer attributes, \nthe filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both.", + "x-release-status": "PUBLIC", + "properties": { + "exact": { + "type": "string", + "description": "Use the exact filter to select customers whose attributes match exactly the specified query.", + "nullable": true + }, + "fuzzy": { + "type": "string", + "description": "Use the fuzzy filter to select customers whose attributes match the specified query \nin a fuzzy manner. When the fuzzy option is used, search queries are tokenized, and then \neach query token must be matched somewhere in the searched attribute. For single token queries, \nthis is effectively the same behavior as a partial match operation.", + "nullable": true + } + } + }, + "CustomerUpdatedEvent": { + "type": "object", + "description": "Published when a [customer](entity:Customer) is updated. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks).\n\nUpdates to the 'segment_ids' customer field does not invoke a `customer.updated` event. In addition, the `customer` object in the event notification does not include this field.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this object, the value is `customer.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for [idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomerUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:38:29Z", + "data": { + "id": "A0AP25A6SCVTH8JES9BX01GXM4", + "object": { + "customer": { + "created_at": "2022-07-09T18:23:01.795Z", + "creation_source": "THIRD_PARTY", + "email_address": "jenkins+smorly@squareup.com", + "family_name": "Smorly", + "given_name": "Jenkins", + "id": "A0AP25A6SCVTH8JES9BX01GXM4", + "phone_number": "+13477947111", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2022-11-09T21:38:30Z", + "version": 1 + } + }, + "type": "customer" + }, + "event_id": "b4ce4698-00de-4b5d-a771-4941b3913b34", + "merchant_id": "G7MMEBVW021Q4", + "type": "customer.updated" + }, + "x-webhook": { + "event": "customer.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/Customers", + "x-since": "2021-02-26" + }, + "CustomerUpdatedEventData": { + "type": "object", + "description": "The data associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `customer`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the updated customer.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CustomerUpdatedEventObject", + "description": "An object that contains the updated customer.", + "nullable": true + } + } + }, + "CustomerUpdatedEventObject": { + "type": "object", + "description": "An object that contains the customer associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The updated customer.", + "nullable": true + } + } + }, + "DataCollectionOptions": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "title", + "body", + "input_type" + ], + "properties": { + "title": { + "type": "string", + "description": "The title text to display in the data collection flow on the Terminal.", + "minLength": 1, + "maxLength": 250 + }, + "body": { + "type": "string", + "description": "The body text to display under the title in the data collection screen flow on the\nTerminal.", + "minLength": 1, + "maxLength": 10000 + }, + "input_type": { + "$ref": "#/components/schemas/DataCollectionOptionsInputType", + "description": "Represents the type of the input text.\nSee [InputType](#type-inputtype) for possible values" + }, + "collected_data": { + "$ref": "#/components/schemas/CollectedData", + "description": "The buyer’s input text from the data collection screen.", + "readOnly": true + } + } + }, + "DataCollectionOptionsInputType": { + "type": "string", + "enum": [ + "EMAIL", + "PHONE_NUMBER" + ], + "x-enum-elements": [ + { + "name": "EMAIL", + "description": "This value is used to represent an input text that contains a email validation on the\nclient." + }, + { + "name": "PHONE_NUMBER", + "description": "This value is used to represent an input text that contains a phone number validation on\nthe client." + } + ], + "description": "Describes the input type of the data.", + "x-release-status": "BETA" + }, + "DateRange": { + "type": "object", + "description": "A range defined by two dates. Used for filtering a query for Connect v2\nobjects that have date properties.", + "x-release-status": "PUBLIC", + "properties": { + "start_date": { + "type": "string", + "description": "A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601\nextended format for calendar dates.\nThe beginning of a date range (inclusive).", + "nullable": true + }, + "end_date": { + "type": "string", + "description": "A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601\nextended format for calendar dates.\nThe end of a date range (inclusive).", + "nullable": true + } + } + }, + "DayOfWeek": { + "type": "string", + "enum": [ + "SUN", + "MON", + "TUE", + "WED", + "THU", + "FRI", + "SAT" + ], + "x-enum-elements": [ + { + "name": "SUN", + "description": "Sunday" + }, + { + "name": "MON", + "description": "Monday" + }, + { + "name": "TUE", + "description": "Tuesday" + }, + { + "name": "WED", + "description": "Wednesday" + }, + { + "name": "THU", + "description": "Thursday" + }, + { + "name": "FRI", + "description": "Friday" + }, + { + "name": "SAT", + "description": "Saturday" + } + ], + "description": "Indicates the specific day of the week.", + "x-release-status": "PUBLIC" + }, + "DeleteBookingCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [DeleteBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttributeDefinition) response\ncontaining error messages when errors occurred during the request. The successful response does not contain any payload.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "errors": [] + } + }, + "DeleteBookingCustomAttributeResponse": { + "type": "object", + "description": "Represents a [DeleteBookingCustomAttribute](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttribute) response.\nEither an empty object `{}` (for a successful deletion) or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "errors": [] + } + }, + "DeleteBreakTypeResponse": { + "type": "object", + "description": "The response to a request to delete a `BreakType`. The response might contain a set \nof `Error` objects if the request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteCatalogObjectResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "deleted_object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of all catalog objects deleted by this request.\nMultiple IDs may be returned when associated objects are also deleted, for example\na catalog item variation will be deleted (and its ID included in this field)\nwhen its parent catalog item is deleted." + }, + "deleted_at": { + "type": "string", + "description": "The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nof this deletion in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`." + } + }, + "example": { + "deleted_at": "2016-11-16T22:25:24.878Z", + "deleted_object_ids": [ + "7SB3ZQYJ5GDMVFL7JK46JCHT", + "KQLFFHA6K6J3YQAQAWDQAL57" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.csharp", + "java": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.java", + "javascript": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.javascript", + "php": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.php", + "python": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.python", + "ruby": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.ruby" + } + }, + "DeleteCustomerCardResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `DeleteCustomerCard` endpoint.", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {}, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.csharp", + "java": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.java", + "javascript": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.javascript", + "php": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.php", + "python": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.python", + "ruby": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.ruby" + } + }, + "DeleteCustomerCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from a delete request containing error messages if there are any.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteCustomerCustomAttributeResponse": { + "type": "object", + "description": "Represents a [DeleteCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-DeleteCustomerCustomAttribute) response.\nEither an empty object `{}` (for a successful deletion) or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteCustomerGroupResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [DeleteCustomerGroup](api-endpoint:CustomerGroups-DeleteCustomerGroup) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `DeleteCustomer` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {}, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.csharp", + "java": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.java", + "javascript": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.javascript", + "php": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.php", + "python": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.python", + "ruby": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.ruby" + } + }, + "DeleteDisputeEvidenceResponse": { + "type": "object", + "description": "Defines the fields in a `DeleteDisputeEvidence` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": {} + }, + "DeleteInvoiceAttachmentResponse": { + "type": "object", + "description": "Represents a [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": {} + }, + "DeleteInvoiceResponse": { + "type": "object", + "description": "Describes a `DeleteInvoice` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": {} + }, + "DeleteLocationCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from a delete request containing error messages if there are any.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteLocationCustomAttributeResponse": { + "type": "object", + "description": "Represents a [DeleteLocationCustomAttribute](api-endpoint:LocationCustomAttributes-DeleteLocationCustomAttribute) response.\nEither an empty object `{}` (for a successful deletion) or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteLoyaltyRewardResponse": { + "type": "object", + "description": "A response returned by the API call.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteMerchantCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from a delete request containing error messages if there are any.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteMerchantCustomAttributeResponse": { + "type": "object", + "description": "Represents a [DeleteMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-DeleteMerchantCustomAttribute) response.\nEither an empty object `{}` (for a successful deletion) or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteOrderCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from deleting an order custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteOrderCustomAttributeResponse": { + "type": "object", + "description": "Represents a response from deleting an order custom attribute.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeletePaymentLinkResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + } + }, + "id": { + "type": "string", + "description": "The ID of the link that is deleted." + }, + "cancelled_order_id": { + "type": "string", + "description": "The ID of the order that is canceled. When a payment link is deleted, Square updates the\nthe `state` (of the order that the checkout link created) to CANCELED." + } + }, + "example": { + "cancelled_order_id": "asx8LgZ6MRzD0fObfkJ6obBmSh4F", + "id": "MQASNYL6QB6DFCJ3" + } + }, + "DeleteShiftResponse": { + "type": "object", + "description": "The response to a request to delete a `Shift`. The response might contain a set of \n`Error` objects if the request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteSnippetResponse": { + "type": "object", + "description": "Represents a `DeleteSnippet` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteSubscriptionActionResponse": { + "type": "object", + "description": "Defines output parameters in a response of the [DeleteSubscriptionAction](api-endpoint:Subscriptions-DeleteSubscriptionAction)\nendpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The subscription that has the specified action deleted." + } + }, + "example": { + "subscription": { + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "charged_through_date": "2023-11-20", + "created_at": "2022-07-27T21:53:10Z", + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "id": "8151fc89-da15-4eb9-a685-1a70883cebfc", + "invoice_ids": [ + "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA" + ], + "location_id": "S8GWD5R9QB376", + "paid_until_date": "2024-08-01", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "price_override_money": { + "amount": 25000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "start_date": "2022-07-27", + "status": "ACTIVE", + "timezone": "America/Los_Angeles" + } + } + }, + "DeleteTimecardResponse": { + "type": "object", + "description": "The response to a request to delete a `Timecard`. The response might contain a set of \n`Error` objects if the request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteWebhookSubscriptionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [DeleteWebhookSubscription](api-endpoint:WebhookSubscriptions-DeleteWebhookSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + } + }, + "example": {} + }, + "Destination": { + "type": "object", + "description": "Information about the destination against which the payout was made.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "$ref": "#/components/schemas/DestinationType", + "description": "Type of the destination such as a bank account or debit card.\nSee [DestinationType](#type-destinationtype) for possible values", + "nullable": true + }, + "id": { + "type": "string", + "description": "Square issued unique ID (also known as the instrument ID) associated with this destination." + } + } + }, + "DestinationDetails": { + "type": "object", + "description": "Details about a refund's destination.", + "x-release-status": "PUBLIC", + "properties": { + "card_details": { + "$ref": "#/components/schemas/DestinationDetailsCardRefundDetails", + "description": "Details about a card refund. Only populated if the destination_type is `CARD`.", + "nullable": true + }, + "cash_details": { + "$ref": "#/components/schemas/DestinationDetailsCashRefundDetails", + "description": "Details about a cash refund. Only populated if the destination_type is `CASH`.", + "nullable": true + }, + "external_details": { + "$ref": "#/components/schemas/DestinationDetailsExternalRefundDetails", + "description": "Details about an external refund. Only populated if the destination_type is `EXTERNAL`.", + "nullable": true + } + } + }, + "DestinationDetailsCardRefundDetails": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/Card", + "description": "The card's non-confidential details.", + "nullable": true + }, + "entry_method": { + "type": "string", + "description": "The method used to enter the card's details for the refund. The method can be\n`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.", + "maxLength": 50, + "nullable": true + }, + "auth_result_code": { + "type": "string", + "description": "The authorization code provided by the issuer when a refund is approved.", + "maxLength": 10, + "nullable": true + } + } + }, + "DestinationDetailsCashRefundDetails": { + "type": "object", + "description": "Stores details about a cash refund. Contains only non-confidential information.", + "x-release-status": "PUBLIC", + "required": [ + "seller_supplied_money" + ], + "properties": { + "seller_supplied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount and currency of the money supplied by the seller." + }, + "change_back_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of change due back to the seller.\nThis read-only field is calculated\nfrom the `amount_money` and `seller_supplied_money` fields.", + "nullable": true + } + } + }, + "DestinationDetailsExternalRefundDetails": { + "type": "object", + "description": "Stores details about an external refund. Contains only non-confidential information.", + "x-release-status": "PUBLIC", + "required": [ + "type", + "source" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of external refund the seller paid to the buyer. It can be one of the\nfollowing:\n- CHECK - Refunded using a physical check.\n- BANK_TRANSFER - Refunded using external bank transfer.\n- OTHER\\_GIFT\\_CARD - Refunded using a non-Square gift card.\n- CRYPTO - Refunded using a crypto currency.\n- SQUARE_CASH - Refunded using Square Cash App.\n- SOCIAL - Refunded using peer-to-peer payment applications.\n- EXTERNAL - A third-party application gathered this refund outside of Square.\n- EMONEY - Refunded using an E-money provider.\n- CARD - A credit or debit card that Square does not support.\n- STORED_BALANCE - Use for house accounts, store credit, and so forth.\n- FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals\n- OTHER - A type not listed here.", + "maxLength": 50 + }, + "source": { + "type": "string", + "description": "A description of the external refund source. For example,\n\"Food Delivery Service\".", + "maxLength": 255 + }, + "source_id": { + "type": "string", + "description": "An ID to associate the refund to its originating source.", + "maxLength": 255, + "nullable": true + } + } + }, + "DestinationType": { + "type": "string", + "enum": [ + "BANK_ACCOUNT", + "CARD", + "SQUARE_BALANCE", + "SQUARE_STORED_BALANCE" + ], + "x-enum-elements": [ + { + "name": "BANK_ACCOUNT", + "description": "An external bank account outside of Square." + }, + { + "name": "CARD", + "description": "An external card outside of Square used for the transfer." + }, + { + "name": "SQUARE_BALANCE", + "description": "" + }, + { + "name": "SQUARE_STORED_BALANCE", + "description": "Square Checking or Savings account (US), Square Card (CA)" + } + ], + "description": "List of possible destinations against which a payout can be made.", + "x-release-status": "PUBLIC" + }, + "Device": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "attributes" + ], + "properties": { + "id": { + "type": "string", + "description": "A synthetic identifier for the device. The identifier includes a standardized prefix and\nis otherwise an opaque id generated from key device fields.", + "readOnly": true + }, + "attributes": { + "$ref": "#/components/schemas/DeviceAttributes", + "description": "A collection of DeviceAttributes representing the device." + }, + "components": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Component" + }, + "description": "A list of components applicable to the device.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/DeviceStatus", + "description": "The current status of the device.", + "readOnly": true + } + } + }, + "DeviceAttributes": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "type", + "manufacturer" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/DeviceAttributesDeviceType", + "description": "The device type.\nSee [DeviceType](#type-devicetype) for possible values" + }, + "manufacturer": { + "type": "string", + "description": "The maker of the device." + }, + "model": { + "type": "string", + "description": "The specific model of the device.", + "nullable": true + }, + "name": { + "type": "string", + "description": "A seller-specified name for the device.", + "nullable": true + }, + "manufacturers_id": { + "type": "string", + "description": "The manufacturer-supplied identifier for the device (where available). In many cases,\nthis identifier will be a serial number.", + "nullable": true + }, + "updated_at": { + "type": "string", + "description": "The RFC 3339-formatted value of the most recent update to the device information.\n(Could represent any field update on the device.)" + }, + "version": { + "type": "string", + "description": "The current version of software installed on the device." + }, + "merchant_token": { + "type": "string", + "description": "The merchant_token identifying the merchant controlling the device.", + "nullable": true + } + } + }, + "DeviceAttributesDeviceType": { + "type": "string", + "enum": [ + "TERMINAL" + ], + "x-enum-elements": [ + { + "name": "TERMINAL", + "description": "" + } + ], + "description": "An enum identifier of the device type.", + "x-release-status": "BETA" + }, + "DeviceCheckoutOptions": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "device_id" + ], + "properties": { + "device_id": { + "type": "string", + "description": "The unique ID of the device intended for this `TerminalCheckout`.\nA list of `DeviceCode` objects can be retrieved from the /v2/devices/codes endpoint.\nMatch a `DeviceCode.device_id` value with `device_id` to get the associated device code." + }, + "skip_receipt_screen": { + "type": "boolean", + "description": "Instructs the device to skip the receipt screen. Defaults to false.", + "nullable": true + }, + "collect_signature": { + "type": "boolean", + "description": "Indicates that signature collection is desired during checkout. Defaults to false.", + "nullable": true + }, + "tip_settings": { + "$ref": "#/components/schemas/TipSettings", + "description": "Tip-specific settings.", + "nullable": true + }, + "show_itemized_cart": { + "type": "boolean", + "description": "Show the itemization screen prior to taking a payment. This field is only meaningful when the\ncheckout includes an order ID. Defaults to true.", + "nullable": true + } + } + }, + "DeviceCode": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "product_type" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique id for this device code.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "An optional user-defined name for the device code.", + "maxLength": 128, + "nullable": true + }, + "code": { + "type": "string", + "description": "The unique code that can be used to login.", + "readOnly": true + }, + "device_id": { + "type": "string", + "description": "The unique id of the device that used this code. Populated when the device is paired up.", + "readOnly": true + }, + "product_type": { + "$ref": "#/components/schemas/ProductType", + "description": "The targeting product type of the device code." + }, + "location_id": { + "type": "string", + "description": "The location assigned to this code.", + "maxLength": 50, + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/DeviceCodeStatus", + "description": "The pairing status of the device code.\nSee [DeviceCodeStatus](#type-devicecodestatus) for possible values", + "readOnly": true + }, + "pair_by": { + "type": "string", + "description": "When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "When this DeviceCode was created. Timestamp in RFC 3339 format.", + "readOnly": true + }, + "status_changed_at": { + "type": "string", + "description": "When this DeviceCode's status was last changed. Timestamp in RFC 3339 format.", + "readOnly": true + }, + "paired_at": { + "type": "string", + "description": "When this DeviceCode was paired. Timestamp in RFC 3339 format.", + "readOnly": true + } + } + }, + "DeviceCodePairedEvent": { + "type": "object", + "description": "Published when a Square Terminal has been paired with a\nTerminal API client and the device_id of the paired Square Terminal is\navailable.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"device.code.paired\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DeviceCodePairedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-10T14:41:58.036Z", + "data": { + "id": "05NK80TRSC2ZF", + "object": { + "device_code": { + "code": "ABCDEF", + "created_at": "2020-04-10T14:41:20.000Z", + "device_id": "907CS13101300122", + "id": "05NK80TRSC2ZF", + "location_id": "AR63EC48VXVBN", + "name": "Terminal API Device created on Apr 10, 2020", + "paired_at": "2020-04-10T14:41:50.000Z", + "product_type": "TERMINAL_API", + "status": "PAIRED", + "status_changed_at": "2020-04-10T14:41:50.000Z" + } + }, + "type": "device_code" + }, + "event_id": "84ccdb8a-da90-4b14-b6b0-c5a5abbccfe6", + "location_id": "AR63EC48VXVBN", + "merchant_id": "7NZR58EPNGNPC", + "type": "device.code.paired" + }, + "x-webhook": { + "event": "device.code.paired", + "scopes": [ + "DEVICE_CREDENTIAL_MANAGEMENT" + ] + }, + "x-api": "#/components/x-apis/Devices", + "x-since": "2020-04-22" + }, + "DeviceCodePairedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the paired object’s type, `\"device_code\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the paired device code." + }, + "object": { + "$ref": "#/components/schemas/DeviceCodePairedEventObject", + "description": "An object containing the paired device code.", + "nullable": true + } + } + }, + "DeviceCodePairedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "device_code": { + "$ref": "#/components/schemas/DeviceCode", + "description": "The created terminal checkout", + "nullable": true + } + } + }, + "DeviceCodeStatus": { + "type": "string", + "enum": [ + "UNKNOWN", + "UNPAIRED", + "PAIRED", + "EXPIRED" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN", + "description": "The status cannot be determined or does not exist." + }, + { + "name": "UNPAIRED", + "description": "The device code is just created and unpaired." + }, + { + "name": "PAIRED", + "description": "The device code has been signed in and paired to a device." + }, + { + "name": "EXPIRED", + "description": "The device code was unpaired and expired before it was paired." + } + ], + "description": "DeviceCode.Status enum.", + "x-release-status": "PUBLIC" + }, + "DeviceComponentDetailsApplicationDetails": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "application_type": { + "$ref": "#/components/schemas/ApplicationType", + "description": "The type of application.\nSee [ApplicationType](#type-applicationtype) for possible values", + "nullable": true + }, + "version": { + "type": "string", + "description": "The version of the application." + }, + "session_location": { + "type": "string", + "description": "The location_id of the session for the application.", + "nullable": true + }, + "device_code_id": { + "type": "string", + "description": "The id of the device code that was used to log in to the device.", + "nullable": true + } + } + }, + "DeviceComponentDetailsBatteryDetails": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "visible_percent": { + "type": "integer", + "description": "The battery charge percentage as displayed on the device.", + "nullable": true + }, + "external_power": { + "$ref": "#/components/schemas/DeviceComponentDetailsExternalPower", + "description": "The status of external_power.\nSee [ExternalPower](#type-externalpower) for possible values", + "nullable": true + } + } + }, + "DeviceComponentDetailsCardReaderDetails": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "version": { + "type": "string", + "description": "The version of the card reader." + } + } + }, + "DeviceComponentDetailsEthernetDetails": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "active": { + "type": "boolean", + "description": "A boolean to represent whether the Ethernet interface is currently active.", + "nullable": true + }, + "ip_address_v4": { + "type": "string", + "description": "The string representation of the device’s IPv4 address.", + "nullable": true + } + } + }, + "DeviceComponentDetailsExternalPower": { + "type": "string", + "enum": [ + "AVAILABLE_CHARGING", + "AVAILABLE_NOT_IN_USE", + "UNAVAILABLE", + "AVAILABLE_INSUFFICIENT" + ], + "x-enum-elements": [ + { + "name": "AVAILABLE_CHARGING", + "description": "Plugged in and charging." + }, + { + "name": "AVAILABLE_NOT_IN_USE", + "description": "Fully charged." + }, + { + "name": "UNAVAILABLE", + "description": "On battery power." + }, + { + "name": "AVAILABLE_INSUFFICIENT", + "description": "Not providing enough power for the device." + } + ], + "description": "An enum for ExternalPower.", + "x-release-status": "BETA" + }, + "DeviceComponentDetailsMeasurement": { + "type": "object", + "description": "A value qualified by unit of measure.", + "x-release-status": "BETA", + "properties": { + "value": { + "type": "integer", + "nullable": true + } + } + }, + "DeviceComponentDetailsWiFiDetails": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "active": { + "type": "boolean", + "description": "A boolean to represent whether the WiFI interface is currently active.", + "nullable": true + }, + "ssid": { + "type": "string", + "description": "The name of the connected WIFI network.", + "nullable": true + }, + "ip_address_v4": { + "type": "string", + "description": "The string representation of the device’s IPv4 address.", + "nullable": true + }, + "secure_connection": { + "type": "string", + "description": "The security protocol for a secure connection (e.g. WPA2). None provided if the connection\nis unsecured.", + "nullable": true + }, + "signal_strength": { + "$ref": "#/components/schemas/DeviceComponentDetailsMeasurement", + "description": "A representation of signal strength of the WIFI network connection.", + "nullable": true + } + } + }, + "DeviceCreatedEvent": { + "type": "object", + "description": "Published when a Device is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The merchant the newly created device belongs to.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents. The value is `\"device.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A UUID that uniquely identifies this device creation event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the device creation event was first created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DeviceCreatedEventData", + "description": "The metadata associated with the device creation event.", + "nullable": true + } + }, + "example": { + "created_at": "2023-08-08T16:49:54.990909221Z", + "data": { + "id": "device:3136f66b-f4b0-3846-8722-7fcc55270e50", + "object": { + "device": { + "attributes": { + "manufacturer": "SQUARE", + "manufacturers_id": "3136f66b-f4b0-3846-8722-7fcc55270e50", + "merchant_token": "MLF2HW14529P1", + "model": "T2", + "name": "San Francisco Store - Device 901", + "type": "TERMINAL", + "updated_at": "2023-08-08T16:49:54.990909221Z", + "version": "9.9.3" + }, + "components": [ + { + "battery_details": { + "external_power": "AVAILABLE_INSUFFICIENT", + "visible_percent": 11 + }, + "type": "BATTERY" + }, + { + "card_reader_details": { + "version": "8.5.6" + }, + "type": "CARD_READER" + }, + { + "ethernet_details": { + "active": false, + "ip_address_v4": "109.208.212.40" + }, + "type": "ETHERNET" + }, + { + "type": "WIFI", + "wifi_details": { + "active": true, + "ip_address_v4": "187.180.54.247", + "secure_connection": "WPA/WPA2 PSK", + "signal_strength": { + "value": 3 + }, + "ssid": "San Francisco Store Wifi" + } + }, + { + "application_details": { + "application_type": "TERMINAL_API", + "device_code_id": "G5D3VSVAFYTPB", + "session_location": "LN6WR64FV0VEP", + "version": "8.6.1" + }, + "type": "APPLICATION" + }, + { + "type": "PRINTER" + } + ], + "id": "device:3136f66b-f4b0-3846-8722-7fcc55270e50", + "status": "AVAILABLE" + } + }, + "type": "device" + }, + "event_id": "e2744346-e23d-31e8-9f52-660116750760", + "merchant_id": "MLF2HW14529P1", + "type": "device.created" + }, + "x-webhook": { + "event": "device.created", + "scopes": [ + "DEVICES_READ" + ] + }, + "x-api": "#/components/x-apis/Devices", + "x-since": "2023-09-25" + }, + "DeviceCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"device\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the device." + }, + "object": { + "$ref": "#/components/schemas/DeviceCreatedEventObject", + "description": "An object containing the created device.", + "nullable": true + } + } + }, + "DeviceCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "device": { + "$ref": "#/components/schemas/Device", + "description": "The created device.", + "nullable": true + } + } + }, + "DeviceDetails": { + "type": "object", + "description": "Details about the device that took the payment.", + "x-release-status": "PUBLIC", + "properties": { + "device_id": { + "type": "string", + "description": "The Square-issued ID of the device.", + "maxLength": 255, + "nullable": true + }, + "device_installation_id": { + "type": "string", + "description": "The Square-issued installation ID for the device.", + "maxLength": 255, + "nullable": true + }, + "device_name": { + "type": "string", + "description": "The name of the device set by the seller.", + "maxLength": 255, + "nullable": true + } + } + }, + "DeviceMetadata": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "battery_percentage": { + "type": "string", + "description": "The Terminal’s remaining battery percentage, between 1-100.", + "nullable": true + }, + "charging_state": { + "type": "string", + "description": "The current charging state of the Terminal.\nOptions: `CHARGING`, `NOT_CHARGING`", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the Square seller business location associated with the Terminal.", + "nullable": true + }, + "merchant_id": { + "type": "string", + "description": "The ID of the Square merchant account that is currently signed-in to the Terminal.", + "nullable": true + }, + "network_connection_type": { + "type": "string", + "description": "The Terminal’s current network connection type.\nOptions: `WIFI`, `ETHERNET`", + "nullable": true + }, + "payment_region": { + "type": "string", + "description": "The country in which the Terminal is authorized to take payments.", + "nullable": true + }, + "serial_number": { + "type": "string", + "description": "The unique identifier assigned to the Terminal, which can be found on the lower back\nof the device.", + "nullable": true + }, + "os_version": { + "type": "string", + "description": "The current version of the Terminal’s operating system.", + "nullable": true + }, + "app_version": { + "type": "string", + "description": "The current version of the application running on the Terminal.", + "nullable": true + }, + "wifi_network_name": { + "type": "string", + "description": "The name of the Wi-Fi network to which the Terminal is connected.", + "nullable": true + }, + "wifi_network_strength": { + "type": "string", + "description": "The signal strength of the Wi-FI network connection.\nOptions: `POOR`, `FAIR`, `GOOD`, `EXCELLENT`", + "nullable": true + }, + "ip_address": { + "type": "string", + "description": "The IP address of the Terminal.", + "nullable": true + } + } + }, + "DeviceStatus": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "category": { + "$ref": "#/components/schemas/DeviceStatusCategory", + "description": "\nSee [Category](#type-category) for possible values", + "nullable": true + } + } + }, + "DeviceStatusCategory": { + "type": "string", + "enum": [ + "AVAILABLE", + "NEEDS_ATTENTION", + "OFFLINE" + ], + "x-enum-elements": [ + { + "name": "AVAILABLE", + "description": "" + }, + { + "name": "NEEDS_ATTENTION", + "description": "" + }, + { + "name": "OFFLINE", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "DigitalWalletDetails": { + "type": "object", + "description": "Additional details about `WALLET` type payments. Contains only non-confidential information.", + "x-release-status": "PUBLIC", + "properties": { + "status": { + "type": "string", + "description": "The status of the `WALLET` payment. The status can be `AUTHORIZED`, `CAPTURED`, `VOIDED`, or\n`FAILED`.", + "maxLength": 50, + "nullable": true + }, + "brand": { + "type": "string", + "description": "The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY`, `ALIPAY`,\n`RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or `UNKNOWN`.", + "maxLength": 50, + "nullable": true + }, + "cash_app_details": { + "$ref": "#/components/schemas/CashAppDetails", + "description": "Brand-specific details for payments with the `brand` of `CASH_APP`.", + "nullable": true + } + } + }, + "DisableCardResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [DisableCard](api-endpoint:Cards-DisableCard) endpoint.\n\nNote: if there are errors processing the request, the card field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The retrieved card." + } + }, + "example": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": false, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 2 + } + } + }, + "DisableEventsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [DisableEvents](api-endpoint:Events-DisableEvents) endpoint.\n\nNote: if there are errors processing the request, the events field will not be\npresent.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + } + }, + "example": {} + }, + "DismissTerminalActionResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "Current state of the action to be dismissed." + } + }, + "example": { + "action": { + "app_id": "APP_ID", + "await_next_action": true, + "await_next_action_duration": "PT5M", + "confirmation_options": { + "agree_button_text": "Agree", + "body": "I agree to receive promotional emails about future events and activities.", + "decision": { + "has_agreed": true + }, + "disagree_button_text": "Decline", + "title": "Marketing communications" + }, + "created_at": "2021-07-28T23:22:07.476Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:abcdefg1234567", + "status": "COMPLETED", + "type": "CONFIRMATION", + "updated_at": "2021-07-28T23:22:29.511Z" + } + } + }, + "DismissTerminalCheckoutResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "Current state of the checkout to be dismissed." + } + }, + "example": { + "checkout": { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2023-11-29T14:59:50.682Z", + "deadline_duration": "PT5M", + "device_options": { + "collect_signature": true, + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "loyalty_settings": { + "loyalty_screen_max_display_duration": "PT60S", + "show_card_linked_reward_redemption_screen": false, + "show_loyalty_screen": false, + "show_non_qualifying_loyalty_screen": false + }, + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": true, + "custom_tip_field": false, + "separate_tip_screen": true + } + }, + "id": "LmZEKbo3SBfqO", + "location_id": "LOCATION_ID", + "payment_ids": [ + "D7vLJqMkvSoAlX4yyFzUitOy4EPZY" + ], + "payment_options": { + "autocomplete": true + }, + "payment_type": "CARD_PRESENT", + "status": "COMPLETED", + "updated_at": "2023-11-29T15:00:18.936Z" + } + } + }, + "DismissTerminalRefundResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "Current state of the refund to be dismissed." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "app_id": "APP_ID", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 12, + "exp_year": 2024, + "fingerprint": "sq-1-ElNeDpZZqUBNDI7yNghyKO-o0yLXASp4qQDGIPtxnFvTTWoqdfdP6TV8gLsSxoztXA", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_details": { + "auth_result_code": "RNy6Lf", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 12, + "exp_year": 2024, + "fingerprint": "sq-1-ElNeDpZZqUBNDI7yNghyKO-o0yLXASp3qQDGIPtxnFvTTWoqdfdP6TV9gLsSxoztXA", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2023-11-30T16:15:06.645Z", + "captured_at": "2023-11-30T16:15:13.272Z" + }, + "cvv_status": "CVV_ACCEPTED", + "device_details": { + "device_credential": { + "name": "Terminal API Device created on Nov 2, 2023", + "token": "9BFDXEYKB7H8Y" + }, + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "device_installation_id": "0ef67d8e-61a3-4418-a0be-c143bfe6108d" + }, + "entry_method": "SWIPED", + "statement_description": "SQ TREATS", + "status": "CAPTURED" + }, + "created_at": "2023-11-30T16:16:39.299Z", + "deadline_duration": "PT5M", + "device_id": "47776348fd8b32b9", + "id": "vjkNb2HD-xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY", + "order_id": "s8OMhQcpEp1b61YywlccSHWqUaQZY", + "payment_id": "xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY", + "reason": "Returning item", + "status": "IN_PROGRESS", + "updated_at": "2023-11-30T16:16:57.863Z" + } + } + }, + "Dispute": { + "type": "object", + "description": "Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank.", + "x-release-status": "PUBLIC", + "properties": { + "dispute_id": { + "type": "string", + "description": "The unique ID for this `Dispute`, generated by Square.", + "minLength": 1, + "maxLength": 40, + "x-release-status": "DEPRECATED", + "nullable": true + }, + "id": { + "type": "string", + "description": "The unique ID for this `Dispute`, generated by Square.", + "minLength": 1, + "maxLength": 40 + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The disputed amount, which can be less than the total transaction amount.\nFor instance, if multiple items were purchased but the cardholder only initiates a dispute over some of the items.", + "nullable": true + }, + "reason": { + "$ref": "#/components/schemas/DisputeReason", + "description": "The reason why the cardholder initiated the dispute.\nSee [DisputeReason](#type-disputereason) for possible values", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/DisputeState", + "description": "The current state of this dispute.\nSee [DisputeState](#type-disputestate) for possible values", + "nullable": true + }, + "due_at": { + "type": "string", + "description": "The deadline by which the seller must respond to the dispute, in [RFC 3339 format](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates).", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "disputed_payment": { + "$ref": "#/components/schemas/DisputedPayment", + "description": "The payment challenged in this dispute.", + "nullable": true + }, + "evidence_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the evidence associated with the dispute.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "card_brand": { + "$ref": "#/components/schemas/CardBrand", + "description": "The card brand used in the disputed payment.\nSee [CardBrand](#type-cardbrand) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the dispute was created, in RFC 3339 format.", + "minLength": 1, + "maxLength": 40, + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the dispute was last updated, in RFC 3339 format.", + "minLength": 1, + "maxLength": 40, + "readOnly": true + }, + "brand_dispute_id": { + "type": "string", + "description": "The ID of the dispute in the card brand system, generated by the card brand.", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "reported_date": { + "type": "string", + "description": "The timestamp when the dispute was reported, in RFC 3339 format.", + "minLength": 1, + "maxLength": 40, + "x-release-status": "DEPRECATED", + "nullable": true + }, + "reported_at": { + "type": "string", + "description": "The timestamp when the dispute was reported, in RFC 3339 format.", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "version": { + "type": "integer", + "description": "The current version of the `Dispute`." + }, + "location_id": { + "type": "string", + "description": "The ID of the location where the dispute originated.", + "minLength": 1, + "maxLength": 40, + "nullable": true + } + } + }, + "DisputeCreatedEvent": { + "type": "object", + "description": "Published when a [Dispute](entity:Dispute) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:24:53.258Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "id": "ORSEVtZAJxb37RA1EiGw", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_at": "2020-02-19T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2020-02-19T21:24:53.258Z", + "version": 1 + } + }, + "type": "dispute" + }, + "event_id": "ce8464b5-6628-4ac2-9264-e06c34df3e82", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.created" + }, + "x-webhook": { + "event": "dispute.created", + "scopes": [ + "DISPUTES_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2020-02-26" + }, + "DisputeCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeCreatedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeEvidence": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "evidence_id": { + "type": "string", + "description": "The Square-generated ID of the evidence.", + "minLength": 1, + "maxLength": 40, + "x-release-status": "DEPRECATED", + "nullable": true + }, + "id": { + "type": "string", + "description": "The Square-generated ID of the evidence.", + "minLength": 1, + "maxLength": 40 + }, + "dispute_id": { + "type": "string", + "description": "The ID of the dispute the evidence is associated with.", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "evidence_file": { + "$ref": "#/components/schemas/DisputeEvidenceFile", + "description": "Image, PDF, TXT", + "nullable": true + }, + "evidence_text": { + "type": "string", + "description": "Raw text", + "minLength": 1, + "maxLength": 500, + "nullable": true + }, + "uploaded_at": { + "type": "string", + "description": "The time when the evidence was uploaded, in RFC 3339 format.", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "evidence_type": { + "$ref": "#/components/schemas/DisputeEvidenceType", + "description": "The type of the evidence.\nSee [DisputeEvidenceType](#type-disputeevidencetype) for possible values", + "nullable": true + } + } + }, + "DisputeEvidenceAddedEvent": { + "type": "object", + "description": "Published when evidence is added to a [Dispute](entity:Dispute)\nfrom the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,\nor by calling either [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) or [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeEvidenceAddedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:27:28.851Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "dispute_id": "ORSEVtZAJxb37RA1EiGw", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "evidence_ids": [ + "oThqMsDS9bM0LdjZzVB4qB" + ], + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_date": "2020-02-19T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2020-02-19T21:27:28.851Z", + "version": 2 + } + }, + "type": "dispute" + }, + "event_id": "6f606f30-53d0-495a-87f0-958576fc954f", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.evidence.added" + }, + "x-webhook": { + "event": "dispute.evidence.added", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2020-02-26" + }, + "DisputeEvidenceAddedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeEvidenceAddedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeEvidenceAddedEventObject": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeEvidenceCreatedEvent": { + "type": "object", + "description": "Published when evidence is added to a [Dispute](entity:Dispute)\nfrom the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,\nor by calling either [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) or [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeEvidenceCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:27:28.851Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "id": "ORSEVtZAJxb37RA1EiGw", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_at": "2020-02-19T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2020-02-19T21:27:28.851Z", + "version": 2 + } + }, + "type": "dispute" + }, + "event_id": "6f606f30-53d0-495a-87f0-958576fc954f", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.evidence.created" + }, + "x-webhook": { + "event": "dispute.evidence.created", + "scopes": [ + "DISPUTES_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2021-06-16" + }, + "DisputeEvidenceCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeEvidenceCreatedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeEvidenceCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeEvidenceDeletedEvent": { + "type": "object", + "description": "Published when evidence is removed from a [Dispute](entity:Dispute)\nfrom the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,\nor by calling [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeEvidenceDeletedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:31:55.186Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "id": "ORSEVtZAJxb37RA1EiGw", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_at": "2020-02-19T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2020-02-19T21:31:55.186Z", + "version": 3 + } + }, + "type": "dispute" + }, + "event_id": "e3fd10cc-953b-4f97-83cd-d5b7fa799a8c", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.evidence.deleted" + }, + "x-webhook": { + "event": "dispute.evidence.deleted", + "scopes": [ + "DISPUTES_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2021-06-16" + }, + "DisputeEvidenceDeletedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeEvidenceDeletedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeEvidenceDeletedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeEvidenceFile": { + "type": "object", + "description": "A file to be uploaded as dispute evidence.", + "x-release-status": "PUBLIC", + "properties": { + "filename": { + "type": "string", + "description": "The file name including the file extension. For example: \"receipt.tiff\".", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "filetype": { + "type": "string", + "description": "Dispute evidence files must be application/pdf, image/heic, image/heif, image/jpeg, image/png, or image/tiff formats.", + "minLength": 1, + "maxLength": 40, + "nullable": true + } + } + }, + "DisputeEvidenceRemovedEvent": { + "type": "object", + "description": "Published when evidence is removed from a [Dispute](entity:Dispute)\nfrom the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,\nor by calling [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeEvidenceRemovedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:31:55.186Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "dispute_id": "ORSEVtZAJxb37RA1EiGw", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_date": "2020-02-19T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2020-02-19T21:31:55.186Z", + "version": 3 + } + }, + "type": "dispute" + }, + "event_id": "e3fd10cc-953b-4f97-83cd-d5b7fa799a8c", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.evidence.removed" + }, + "x-webhook": { + "event": "dispute.evidence.removed", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2020-02-26" + }, + "DisputeEvidenceRemovedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeEvidenceRemovedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeEvidenceRemovedEventObject": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeEvidenceType": { + "type": "string", + "enum": [ + "GENERIC_EVIDENCE", + "ONLINE_OR_APP_ACCESS_LOG", + "AUTHORIZATION_DOCUMENTATION", + "CANCELLATION_OR_REFUND_DOCUMENTATION", + "CARDHOLDER_COMMUNICATION", + "CARDHOLDER_INFORMATION", + "PURCHASE_ACKNOWLEDGEMENT", + "DUPLICATE_CHARGE_DOCUMENTATION", + "PRODUCT_OR_SERVICE_DESCRIPTION", + "RECEIPT", + "SERVICE_RECEIVED_DOCUMENTATION", + "PROOF_OF_DELIVERY_DOCUMENTATION", + "RELATED_TRANSACTION_DOCUMENTATION", + "REBUTTAL_EXPLANATION", + "TRACKING_NUMBER" + ], + "x-enum-elements": [ + { + "name": "GENERIC_EVIDENCE", + "description": "Square assumes this evidence type if you do not provide a type when uploading evidence.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "ONLINE_OR_APP_ACCESS_LOG", + "description": "Server or activity logs that show proof of the cardholder’s identity and that the\ncardholder successfully ordered and received the goods (digitally or otherwise).\nExample evidence includes IP addresses, corresponding timestamps/dates, cardholder’s name and email\naddress linked to a cardholder profile held by the seller, proof the same device and card (used\nin dispute) were previously used in prior undisputed transaction, and any related detailed activity.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "AUTHORIZATION_DOCUMENTATION", + "description": "Evidence that the cardholder did provide authorization for the charge.\nExample evidence includes a signed credit card authorization.\n\nUse when uploading evidence as a file." + }, + { + "name": "CANCELLATION_OR_REFUND_DOCUMENTATION", + "description": "Evidence that the cardholder acknowledged your refund or cancellation policy.\nExample evidence includes a signature or checkbox showing the cardholder’s acknowledgement of your\nrefund or cancellation policy.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "CARDHOLDER_COMMUNICATION", + "description": "Evidence that shows relevant communication with the cardholder.\nExample evidence includes emails or texts that show the cardholder received goods/services or\ndemonstrate cardholder satisfaction.\n\nUse when uploading evidence as a file." + }, + { + "name": "CARDHOLDER_INFORMATION", + "description": "Evidence that validates the customer's identity.\nExample evidence includes personally identifiable details such as name, email address, purchaser IP\naddress, and a copy of the cardholder ID.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "PURCHASE_ACKNOWLEDGEMENT", + "description": "Evidence that shows proof of the sale/transaction.\nExample evidence includes an invoice, contract, or other item showing the customer’s acknowledgement\nof the purchase and your terms.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "DUPLICATE_CHARGE_DOCUMENTATION", + "description": "Evidence that shows the charges in question are valid and distinct from one another.\nExample evidence includes receipts, shipping labels, and invoices along with their distinct payment IDs.\n\nUse when uploading evidence as a file." + }, + { + "name": "PRODUCT_OR_SERVICE_DESCRIPTION", + "description": "A description of the product or service sold.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "RECEIPT", + "description": "A receipt or message sent to the cardholder detailing the charge.\nNote: You do not need to upload the Square receipt; Square submits the receipt on your behalf.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "SERVICE_RECEIVED_DOCUMENTATION", + "description": "Evidence that the service was provided to the cardholder or the expected date that services will be rendered.\nExample evidence includes a signed delivery form, work order, expected delivery date, or other written agreements.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "PROOF_OF_DELIVERY_DOCUMENTATION", + "description": "Evidence that shows the product was provided to the cardholder or the expected date of delivery.\nExample evidence includes a signed delivery form or written agreement acknowledging receipt of the goods or services.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "RELATED_TRANSACTION_DOCUMENTATION", + "description": "Evidence that shows the cardholder previously processed transactions on the same card and did not dispute them.\nNote: Square automatically provides up to five distinct Square receipts for related transactions, when available.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "REBUTTAL_EXPLANATION", + "description": "An explanation of why the cardholder’s claim is invalid.\nExample evidence includes an explanation of why each distinct charge is a legitimate purchase, why the cardholder’s claim\nfor credit owed due to their attempt to cancel, return, or refund is invalid per your stated policy and cardholder\nagreement, or an explanation of how the cardholder did not attempt to remedy the issue with you first to receive credit.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "TRACKING_NUMBER", + "description": "The tracking number for the order provided by the shipping carrier. If you have multiple numbers, they need to be\nsubmitted individually as separate pieces of evidence.\n\nUse when uploading evidence as a string." + } + ], + "description": "The type of the dispute evidence.", + "x-release-status": "PUBLIC" + }, + "DisputeReason": { + "type": "string", + "enum": [ + "AMOUNT_DIFFERS", + "CANCELLED", + "DUPLICATE", + "NO_KNOWLEDGE", + "NOT_AS_DESCRIBED", + "NOT_RECEIVED", + "PAID_BY_OTHER_MEANS", + "CUSTOMER_REQUESTS_CREDIT", + "EMV_LIABILITY_SHIFT" + ], + "x-enum-elements": [ + { + "name": "AMOUNT_DIFFERS", + "description": "The cardholder claims that they were charged the wrong amount for the purchase.\nTo challenge this dispute, provide specific and concrete evidence that the cardholder agreed\nto the amount charged." + }, + { + "name": "CANCELLED", + "description": "The cardholder claims that they attempted to return the goods or cancel the service.\nTo challenge this dispute, provide specific and concrete evidence to prove that the cardholder\nis not due a refund and that the cardholder acknowledged your cancellation policy." + }, + { + "name": "DUPLICATE", + "description": "The cardholder claims that they were charged twice for the same purchase.\nTo challenge this dispute, provide specific and concrete evidence that shows both charges are\nlegitimate and independent of one another." + }, + { + "name": "NO_KNOWLEDGE", + "description": "The cardholder claims that they did not make this purchase nor authorized the charge.\nTo challenge this dispute, provide specific and concrete evidence that proves that the cardholder\nidentity was verified at the time of purchase and that the purchase was authorized." + }, + { + "name": "NOT_AS_DESCRIBED", + "description": "The cardholder claims the product or service was provided, but the quality of the deliverable\ndid not align with the expectations of the cardholder based on the description.\nTo challenge this dispute, provide specific and concrete evidence that shows the cardholder is in\npossession of the product as described or received the service as described and agreed on." + }, + { + "name": "NOT_RECEIVED", + "description": "The cardholder claims the product or service was not received by the cardholder within the\nstated time frame.\nTo challenge this dispute, provide specific and concrete evidence to prove that the cardholder is\nin possession of or received the product or service sold." + }, + { + "name": "PAID_BY_OTHER_MEANS", + "description": "The cardholder claims that they previously paid for this purchase.\nTo challenge this dispute, provide specific and concrete evidence that shows both charges are\nlegitimate and independent of one another or proof that you already provided a credit for the charge." + }, + { + "name": "CUSTOMER_REQUESTS_CREDIT", + "description": "The cardholder claims that the purchase was canceled or returned, but they have not yet received\nthe credit.\nTo challenge this dispute, provide specific and concrete evidence to prove that the cardholder is not\ndue a refund and that they acknowledged your cancellation and/or refund policy." + }, + { + "name": "EMV_LIABILITY_SHIFT", + "description": "A chip-enabled card was not processed through a compliant chip-card reader (for example, it was swiped\ninstead of dipped into a chip-card reader).\nYou cannot challenge this dispute because the payment did not comply with EMV security requirements.\nFor more information, see [What Is EMV?](https://squareup.com/emv)" + } + ], + "description": "The list of possible reasons why a cardholder might initiate a\ndispute with their bank.", + "x-release-status": "PUBLIC" + }, + "DisputeState": { + "type": "string", + "enum": [ + "INQUIRY_EVIDENCE_REQUIRED", + "INQUIRY_PROCESSING", + "INQUIRY_CLOSED", + "EVIDENCE_REQUIRED", + "PROCESSING", + "WON", + "LOST", + "ACCEPTED" + ], + "x-enum-elements": [ + { + "name": "INQUIRY_EVIDENCE_REQUIRED", + "description": "The initial state of an inquiry with evidence required" + }, + { + "name": "INQUIRY_PROCESSING", + "description": "Inquiry evidence has been submitted and the bank is processing the inquiry" + }, + { + "name": "INQUIRY_CLOSED", + "description": "The inquiry is complete" + }, + { + "name": "EVIDENCE_REQUIRED", + "description": "The initial state of a dispute with evidence required" + }, + { + "name": "PROCESSING", + "description": "Dispute evidence has been submitted and the bank is processing the dispute" + }, + { + "name": "WON", + "description": "The bank has completed processing the dispute and the seller has won" + }, + { + "name": "LOST", + "description": "The bank has completed processing the dispute and the seller has lost" + }, + { + "name": "ACCEPTED", + "description": "The seller has accepted the dispute" + } + ], + "description": "The list of possible dispute states.", + "x-release-status": "PUBLIC" + }, + "DisputeStateChangedEvent": { + "type": "object", + "description": "Published when the state of a [Dispute](entity:Dispute) changes.\nThis includes the dispute resolution (WON, LOST) reported by the bank. The event\ndata includes details of what changed.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeStateChangedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:34:41.851Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "dispute_id": "ORSEVtZAJxb37RA1EiGw", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "evidence_ids": [ + "Vjq6LG8b95cnnq1AoG5bP" + ], + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_date": "2020-02-19T00:00:00.000Z", + "state": "WON", + "updated_at": "2020-02-19T21:34:41.851Z", + "version": 6 + } + }, + "type": "dispute" + }, + "event_id": "e89ff114-1972-4be0-9481-a621f2385fff", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.state.changed" + }, + "x-webhook": { + "event": "dispute.state.changed", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2020-02-26" + }, + "DisputeStateChangedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeStateChangedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeStateChangedEventObject": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeStateUpdatedEvent": { + "type": "object", + "description": "Published when the state of a [Dispute](entity:Dispute) changes.\nThis includes the dispute resolution (WON, LOST) reported by the bank. The event\ndata includes details of what changed.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeStateUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:34:41.851Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "id": "ORSEVtZAJxb37RA1EiGw", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_at": "2020-02-19T00:00:00.000Z", + "state": "WON", + "updated_at": "2020-02-19T21:34:41.851Z", + "version": 6 + } + }, + "type": "dispute" + }, + "event_id": "e89ff114-1972-4be0-9481-a621f2385fff", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.state.updated" + }, + "x-webhook": { + "event": "dispute.state.updated", + "scopes": [ + "DISPUTES_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2021-06-16" + }, + "DisputeStateUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeStateUpdatedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeStateUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputedPayment": { + "type": "object", + "description": "The payment the cardholder disputed.", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "Square-generated unique ID of the payment being disputed.", + "minLength": 1, + "maxLength": 192, + "nullable": true + } + } + }, + "EcomVisibility": { + "type": "string", + "enum": [ + "UNINDEXED", + "UNAVAILABLE", + "HIDDEN", + "VISIBLE" + ], + "x-enum-elements": [ + { + "name": "UNINDEXED", + "description": "Item is not synced with Ecom (Weebly). This is the default state" + }, + { + "name": "UNAVAILABLE", + "description": "Item is synced but is unavailable within Ecom (Weebly) and Online Checkout" + }, + { + "name": "HIDDEN", + "description": "Option for seller to choose manually created Quick Amounts." + }, + { + "name": "VISIBLE", + "description": "Item is synced but available within Ecom (Weebly) and Online Checkout but is hidden from Ecom Store." + } + ], + "description": "Determines item visibility in Ecom (Online Store) and Online Checkout.", + "x-release-status": "PUBLIC" + }, + "Employee": { + "type": "object", + "description": "An employee object that is used by the external API.\n\nDEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember).", + "x-release-status": "DEPRECATED", + "properties": { + "id": { + "type": "string", + "description": "UUID for this object." + }, + "first_name": { + "type": "string", + "description": "The employee's first name.", + "nullable": true + }, + "last_name": { + "type": "string", + "description": "The employee's last name.", + "nullable": true + }, + "email": { + "type": "string", + "description": "The employee's email address", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The employee's phone number in E.164 format, i.e. \"+12125554250\"", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of location IDs where this employee has access to.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/EmployeeStatus", + "description": "Specifies the status of the employees being fetched.\nSee [EmployeeStatus](#type-employeestatus) for possible values", + "nullable": true + }, + "is_owner": { + "type": "boolean", + "description": "Whether this employee is the owner of the merchant. Each merchant\nhas one owner employee, and that employee has full authority over\nthe account.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format.", + "readOnly": true + } + } + }, + "EmployeeStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "Specifies that the employee is in the Active state." + }, + { + "name": "INACTIVE", + "description": "Specifies that the employee is in the Inactive state." + } + ], + "description": "The status of the Employee being retrieved.\n\nDEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus).", + "x-release-status": "DEPRECATED" + }, + "EmployeeWage": { + "type": "object", + "description": "The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage).", + "x-release-status": "DEPRECATED", + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object." + }, + "employee_id": { + "type": "string", + "description": "The `Employee` that this wage is assigned to.", + "nullable": true + }, + "title": { + "type": "string", + "description": "The job title that this wage relates to.", + "nullable": true + }, + "hourly_rate": { + "$ref": "#/components/schemas/Money", + "description": "Can be a custom-set hourly wage or the calculated effective hourly\nwage based on the annual wage and hours worked per week.", + "nullable": true + } + } + }, + "EnableEventsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [EnableEvents](api-endpoint:Events-EnableEvents) endpoint.\n\nNote: if there are errors processing the request, the events field will not be\npresent.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + } + }, + "example": {} + }, + "Error": { + "type": "object", + "description": "Represents an error encountered during a request to the Connect API.\n\nSee [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information.", + "x-release-status": "PUBLIC", + "required": [ + "category", + "code" + ], + "properties": { + "category": { + "$ref": "#/components/schemas/ErrorCategory", + "description": "The high-level category for the error.\nSee [ErrorCategory](#type-errorcategory) for possible values" + }, + "code": { + "$ref": "#/components/schemas/ErrorCode", + "description": "The specific code of the error.\nSee [ErrorCode](#type-errorcode) for possible values" + }, + "detail": { + "type": "string", + "description": "A human-readable description of the error for debugging purposes." + }, + "field": { + "type": "string", + "description": "The name of the field provided in the original request (if any) that\nthe error pertains to." + } + } + }, + "ErrorCategory": { + "type": "string", + "enum": [ + "API_ERROR", + "AUTHENTICATION_ERROR", + "INVALID_REQUEST_ERROR", + "RATE_LIMIT_ERROR", + "PAYMENT_METHOD_ERROR", + "REFUND_ERROR", + "MERCHANT_SUBSCRIPTION_ERROR", + "EXTERNAL_VENDOR_ERROR" + ], + "x-enum-elements": [ + { + "name": "API_ERROR", + "description": "An error occurred with the Connect API itself." + }, + { + "name": "AUTHENTICATION_ERROR", + "description": "An authentication error occurred. Most commonly, the request had\na missing, malformed, or otherwise invalid `Authorization` header." + }, + { + "name": "INVALID_REQUEST_ERROR", + "description": "The request was invalid. Most commonly, a required parameter was\nmissing, or a provided parameter had an invalid value." + }, + { + "name": "RATE_LIMIT_ERROR", + "description": "Your application reached the Square API rate limit. You might receive this error if your application sends a high number of requests\nto Square APIs in a short period of time.\n\nYour application should monitor responses for `429 RATE_LIMITED` errors and use a retry mechanism with an [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff)\nschedule to resend the requests at an increasingly slower rate. It is also a good practice to use a randomized delay (jitter) in your retry schedule." + }, + { + "name": "PAYMENT_METHOD_ERROR", + "description": "An error occurred while processing a payment method. Most commonly,\nthe details of the payment method were invalid (such as a card's CVV\nor expiration date)." + }, + { + "name": "REFUND_ERROR", + "description": "An error occurred while attempting to process a refund." + }, + { + "name": "MERCHANT_SUBSCRIPTION_ERROR", + "description": "An error occurred when checking a merchant subscription status" + }, + { + "name": "EXTERNAL_VENDOR_ERROR", + "description": "An error that is returned from an external vendor's API" + } + ], + "description": "Indicates which high-level category of error has occurred during a\nrequest to the Connect API.", + "x-release-status": "PUBLIC" + }, + "ErrorCode": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR", + "UNAUTHORIZED", + "ACCESS_TOKEN_EXPIRED", + "ACCESS_TOKEN_REVOKED", + "CLIENT_DISABLED", + "FORBIDDEN", + "INSUFFICIENT_SCOPES", + "APPLICATION_DISABLED", + "V1_APPLICATION", + "V1_ACCESS_TOKEN", + "CARD_PROCESSING_NOT_ENABLED", + "MERCHANT_SUBSCRIPTION_NOT_FOUND", + "BAD_REQUEST", + "MISSING_REQUIRED_PARAMETER", + "INCORRECT_TYPE", + "INVALID_TIME", + "INVALID_TIME_RANGE", + "INVALID_VALUE", + "INVALID_CURSOR", + "UNKNOWN_QUERY_PARAMETER", + "CONFLICTING_PARAMETERS", + "EXPECTED_JSON_BODY", + "INVALID_SORT_ORDER", + "VALUE_REGEX_MISMATCH", + "VALUE_TOO_SHORT", + "VALUE_TOO_LONG", + "VALUE_TOO_LOW", + "VALUE_TOO_HIGH", + "VALUE_EMPTY", + "ARRAY_LENGTH_TOO_LONG", + "ARRAY_LENGTH_TOO_SHORT", + "ARRAY_EMPTY", + "EXPECTED_BOOLEAN", + "EXPECTED_INTEGER", + "EXPECTED_FLOAT", + "EXPECTED_STRING", + "EXPECTED_OBJECT", + "EXPECTED_ARRAY", + "EXPECTED_MAP", + "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", + "INVALID_ARRAY_VALUE", + "INVALID_ENUM_VALUE", + "INVALID_CONTENT_TYPE", + "INVALID_FORM_VALUE", + "CUSTOMER_NOT_FOUND", + "ONE_INSTRUMENT_EXPECTED", + "NO_FIELDS_SET", + "TOO_MANY_MAP_ENTRIES", + "MAP_KEY_LENGTH_TOO_SHORT", + "MAP_KEY_LENGTH_TOO_LONG", + "CUSTOMER_MISSING_NAME", + "CUSTOMER_MISSING_EMAIL", + "INVALID_PAUSE_LENGTH", + "INVALID_DATE", + "UNSUPPORTED_COUNTRY", + "UNSUPPORTED_CURRENCY", + "APPLE_TTP_PIN_TOKEN", + "CARD_EXPIRED", + "INVALID_EXPIRATION", + "INVALID_EXPIRATION_YEAR", + "INVALID_EXPIRATION_DATE", + "UNSUPPORTED_CARD_BRAND", + "UNSUPPORTED_ENTRY_METHOD", + "INVALID_ENCRYPTED_CARD", + "INVALID_CARD", + "PAYMENT_AMOUNT_MISMATCH", + "GENERIC_DECLINE", + "CVV_FAILURE", + "ADDRESS_VERIFICATION_FAILURE", + "INVALID_ACCOUNT", + "CURRENCY_MISMATCH", + "INSUFFICIENT_FUNDS", + "INSUFFICIENT_PERMISSIONS", + "CARDHOLDER_INSUFFICIENT_PERMISSIONS", + "INVALID_LOCATION", + "TRANSACTION_LIMIT", + "VOICE_FAILURE", + "PAN_FAILURE", + "EXPIRATION_FAILURE", + "CARD_NOT_SUPPORTED", + "READER_DECLINED", + "INVALID_PIN", + "MISSING_PIN", + "MISSING_ACCOUNT_TYPE", + "INVALID_POSTAL_CODE", + "INVALID_FEES", + "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED", + "PAYMENT_LIMIT_EXCEEDED", + "GIFT_CARD_AVAILABLE_AMOUNT", + "ACCOUNT_UNUSABLE", + "BUYER_REFUSED_PAYMENT", + "DELAYED_TRANSACTION_EXPIRED", + "DELAYED_TRANSACTION_CANCELED", + "DELAYED_TRANSACTION_CAPTURED", + "DELAYED_TRANSACTION_FAILED", + "CARD_TOKEN_EXPIRED", + "CARD_TOKEN_USED", + "AMOUNT_TOO_HIGH", + "UNSUPPORTED_INSTRUMENT_TYPE", + "REFUND_AMOUNT_INVALID", + "REFUND_ALREADY_PENDING", + "PAYMENT_NOT_REFUNDABLE", + "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE", + "REFUND_ERROR_PAYMENT_NEEDS_COMPLETION", + "REFUND_DECLINED", + "INSUFFICIENT_PERMISSIONS_FOR_REFUND", + "INVALID_CARD_DATA", + "SOURCE_USED", + "SOURCE_EXPIRED", + "UNSUPPORTED_LOYALTY_REWARD_TIER", + "LOCATION_MISMATCH", + "ORDER_UNPAID_NOT_RETURNABLE", + "IDEMPOTENCY_KEY_REUSED", + "UNEXPECTED_VALUE", + "SANDBOX_NOT_SUPPORTED", + "INVALID_EMAIL_ADDRESS", + "INVALID_PHONE_NUMBER", + "CHECKOUT_EXPIRED", + "BAD_CERTIFICATE", + "INVALID_SQUARE_VERSION_FORMAT", + "API_VERSION_INCOMPATIBLE", + "CARD_PRESENCE_REQUIRED", + "UNSUPPORTED_SOURCE_TYPE", + "CARD_MISMATCH", + "PLAID_ERROR", + "PLAID_ERROR_ITEM_LOGIN_REQUIRED", + "PLAID_ERROR_RATE_LIMIT", + "CARD_DECLINED", + "VERIFY_CVV_FAILURE", + "VERIFY_AVS_FAILURE", + "CARD_DECLINED_CALL_ISSUER", + "CARD_DECLINED_VERIFICATION_REQUIRED", + "BAD_EXPIRATION", + "CHIP_INSERTION_REQUIRED", + "ALLOWABLE_PIN_TRIES_EXCEEDED", + "RESERVATION_DECLINED", + "UNKNOWN_BODY_PARAMETER", + "NOT_FOUND", + "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", + "METHOD_NOT_ALLOWED", + "NOT_ACCEPTABLE", + "REQUEST_TIMEOUT", + "CONFLICT", + "GONE", + "REQUEST_ENTITY_TOO_LARGE", + "UNSUPPORTED_MEDIA_TYPE", + "UNPROCESSABLE_ENTITY", + "RATE_LIMITED", + "NOT_IMPLEMENTED", + "BAD_GATEWAY", + "SERVICE_UNAVAILABLE", + "TEMPORARY_ERROR", + "GATEWAY_TIMEOUT" + ], + "x-enum-elements": [ + { + "name": "INTERNAL_SERVER_ERROR", + "description": "A general server error occurred.", + "error-category": "API_ERROR" + }, + { + "name": "UNAUTHORIZED", + "description": "A general authorization error occurred.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "ACCESS_TOKEN_EXPIRED", + "description": "The provided access token has expired.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "ACCESS_TOKEN_REVOKED", + "description": "The provided access token has been revoked.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "CLIENT_DISABLED", + "description": "The provided client has been disabled.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "FORBIDDEN", + "description": "A general access error occurred.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "INSUFFICIENT_SCOPES", + "description": "The provided access token does not have permission\nto execute the requested action.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "APPLICATION_DISABLED", + "description": "The calling application was disabled.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "V1_APPLICATION", + "description": "The calling application was created prior to\n2016-03-30 and is not compatible with v2 Square API calls.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "V1_ACCESS_TOKEN", + "description": "The calling application is using an access token\ncreated prior to 2016-03-30 and is not compatible with v2 Square API\ncalls.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CARD_PROCESSING_NOT_ENABLED", + "description": "The location provided in the API call is not\nenabled for credit card processing.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "MERCHANT_SUBSCRIPTION_NOT_FOUND", + "description": "A required subscription was not found for the merchant", + "error-category": "MERCHANT_SUBSCRIPTION_ERROR" + }, + { + "name": "BAD_REQUEST", + "description": "A general error occurred with the request.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "MISSING_REQUIRED_PARAMETER", + "description": "The request is missing a required path, query, or\nbody parameter.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INCORRECT_TYPE", + "description": "The value provided in the request is the wrong\ntype. For example, a string instead of an integer.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_TIME", + "description": "Formatting for the provided time value is\nincorrect.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_TIME_RANGE", + "description": "The time range provided in the request is invalid.\nFor example, the end time is before the start time.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_VALUE", + "description": "The provided value is invalid. For example,\nincluding `%` in a phone number.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_CURSOR", + "description": "The pagination cursor included in the request is\ninvalid.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNKNOWN_QUERY_PARAMETER", + "description": "The query parameters provided is invalid for the\nrequested endpoint.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CONFLICTING_PARAMETERS", + "description": "One or more of the request parameters conflict with\neach other.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_JSON_BODY", + "description": "The request body is not a JSON object.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_SORT_ORDER", + "description": "The provided sort order is not a valid key.\nCurrently, sort order must be `ASC` or `DESC`.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_REGEX_MISMATCH", + "description": "The provided value does not match an expected\nregular expression.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_TOO_SHORT", + "description": "The provided string value is shorter than the\nminimum length allowed.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_TOO_LONG", + "description": "The provided string value is longer than the\nmaximum length allowed.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_TOO_LOW", + "description": "The provided value is less than the supported\nminimum.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_TOO_HIGH", + "description": "The provided value is greater than the supported\nmaximum.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_EMPTY", + "description": "The provided value has a default (empty) value\nsuch as a blank string.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "ARRAY_LENGTH_TOO_LONG", + "description": "The provided array has too many elements.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "ARRAY_LENGTH_TOO_SHORT", + "description": "The provided array has too few elements.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "ARRAY_EMPTY", + "description": "The provided array is empty.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_BOOLEAN", + "description": "The endpoint expected the provided value to be a\nboolean.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_INTEGER", + "description": "The endpoint expected the provided value to be an\ninteger.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_FLOAT", + "description": "The endpoint expected the provided value to be a\nfloat.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_STRING", + "description": "The endpoint expected the provided value to be a\nstring.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_OBJECT", + "description": "The endpoint expected the provided value to be a\nJSON object.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_ARRAY", + "description": "The endpoint expected the provided value to be an\narray or list.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_MAP", + "description": "The endpoint expected the provided value to be a\nmap or associative array.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", + "description": "The endpoint expected the provided value to be an\narray encoded in base64.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_ARRAY_VALUE", + "description": "One or more objects in the array does not match the\narray type.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_ENUM_VALUE", + "description": "The provided static string is not valid for the\nfield.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_CONTENT_TYPE", + "description": "Invalid content type header.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_FORM_VALUE", + "description": "Only relevant for applications created prior to\n2016-03-30. Indicates there was an error while parsing form values.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CUSTOMER_NOT_FOUND", + "description": "The provided customer id can't be found in the merchant's customers list.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "ONE_INSTRUMENT_EXPECTED", + "description": "A general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "NO_FIELDS_SET", + "description": "A general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "TOO_MANY_MAP_ENTRIES", + "description": "Too many entries in the map field.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "MAP_KEY_LENGTH_TOO_SHORT", + "description": "The length of one of the provided keys in the map is too short.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "MAP_KEY_LENGTH_TOO_LONG", + "description": "The length of one of the provided keys in the map is too long.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CUSTOMER_MISSING_NAME", + "description": "The provided customer does not have a recorded name.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CUSTOMER_MISSING_EMAIL", + "description": "The provided customer does not have a recorded email.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_PAUSE_LENGTH", + "description": "The subscription cannot be paused longer than the duration of the current phase.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_DATE", + "description": "The subscription cannot be paused/resumed on the given date.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_COUNTRY", + "description": "The API request references an unsupported country.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_CURRENCY", + "description": "The API request references an unsupported currency.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "APPLE_TTP_PIN_TOKEN", + "description": "The payment was declined by the card issuer during an Apple Tap to Pay (TTP)\ntransaction with a request for the card's PIN. This code will be returned alongside\n`CARD_DECLINED_VERIFICATION_REQUIRED` as a supplemental error, and will include an\nissuer-provided token in the `details` field that is needed to initiate the PIN\ncollection flow on the iOS device.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CARD_EXPIRED", + "description": "The card issuer declined the request because the card is expired.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_EXPIRATION", + "description": "The expiration date for the payment card is invalid. For example,\nit indicates a date in the past.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_EXPIRATION_YEAR", + "description": "The expiration year for the payment card is invalid. For example,\nit indicates a year in the past or contains invalid characters.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_EXPIRATION_DATE", + "description": "The expiration date for the payment card is invalid. For example,\nit contains invalid characters.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_CARD_BRAND", + "description": "The credit card provided is not from a supported issuer.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "UNSUPPORTED_ENTRY_METHOD", + "description": "The entry method for the credit card (swipe, dip, tap) is not supported.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_ENCRYPTED_CARD", + "description": "The encrypted card information is invalid.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_CARD", + "description": "The credit card cannot be validated based on the provided details.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "PAYMENT_AMOUNT_MISMATCH", + "description": "The payment was declined because there was a payment amount mismatch.\nThe money amount Square was expecting does not match the amount provided.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "GENERIC_DECLINE", + "description": "Square received a decline without any additional information.\nIf the payment information seems correct, the buyer can contact their\nissuer to ask for more information.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CVV_FAILURE", + "description": "The card issuer declined the request because the CVV value is invalid.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "ADDRESS_VERIFICATION_FAILURE", + "description": "The card issuer declined the request because the postal code is invalid.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_ACCOUNT", + "description": "The issuer was not able to locate the account on record.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CURRENCY_MISMATCH", + "description": "The currency associated with the payment is not valid for the provided\nfunding source. For example, a gift card funded in USD cannot be used to process\npayments in GBP.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INSUFFICIENT_FUNDS", + "description": "The funding source has insufficient funds to cover the payment.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INSUFFICIENT_PERMISSIONS", + "description": "The Square account does not have the permissions to accept\nthis payment. For example, Square may limit which merchants are\nallowed to receive gift card payments.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CARDHOLDER_INSUFFICIENT_PERMISSIONS", + "description": "The card issuer has declined the transaction due to restrictions on where the card can be used.\nFor example, a gift card is limited to a single merchant.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_LOCATION", + "description": "The Square account cannot take payments in the specified region.\nA Square account can take payments only from the region where the account was created.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "TRANSACTION_LIMIT", + "description": "The card issuer has determined the payment amount is either too high or too low.\nThe API returns the error code mostly for credit cards (for example, the card reached\nthe credit limit). However, sometimes the issuer bank can indicate the error for debit\nor prepaid cards (for example, card has insufficient funds).", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "VOICE_FAILURE", + "description": "The card issuer declined the request because the issuer requires voice authorization from the cardholder. The seller should ask the customer to contact the card issuing bank to authorize the payment.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "PAN_FAILURE", + "description": "The specified card number is invalid. For example, it is of\nincorrect length or is incorrectly formatted.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "EXPIRATION_FAILURE", + "description": "The card expiration date is either invalid or indicates that the\ncard is expired.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CARD_NOT_SUPPORTED", + "description": "The card is not supported either in the geographic region or by\nthe [merchant category code](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) (MCC).", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "READER_DECLINED", + "description": "The Square Card Reader declined the payment for an unknown reason.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_PIN", + "description": "The card issuer declined the request because the PIN is invalid.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "MISSING_PIN", + "description": "The payment is missing a required PIN.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "MISSING_ACCOUNT_TYPE", + "description": "The payment is missing a required ACCOUNT_TYPE parameter.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_POSTAL_CODE", + "description": "The postal code is incorrectly formatted.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_FEES", + "description": "The app_fee_money on a payment is too high.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED", + "description": "The card must be swiped, tapped, or dipped. Payments attempted by manually entering the card number are declined.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "PAYMENT_LIMIT_EXCEEDED", + "description": "Square declined the request because the payment amount exceeded the processing limit for this merchant.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "GIFT_CARD_AVAILABLE_AMOUNT", + "description": "When a Gift Card is a payment source, you can allow taking a partial payment\nby adding the `accept_partial_authorization` parameter in the request.\nHowever, taking such a partial payment does not work if your request also includes\n`tip_money`, `app_fee_money`, or both. Square declines such payments and returns\nthe `GIFT_CARD_AVAILABLE_AMOUNT` error.\nFor more information, see\n[CreatePayment errors (additional information)](https://developer.squareup.com/docs/payments-api/error-codes#createpayment-errors-additional-information).", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "ACCOUNT_UNUSABLE", + "description": "The account provided cannot carry out transactions.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "BUYER_REFUSED_PAYMENT", + "description": "Bank account rejected or was not authorized for the payment.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "DELAYED_TRANSACTION_EXPIRED", + "description": "The application tried to update a delayed-capture payment that has expired.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "DELAYED_TRANSACTION_CANCELED", + "description": "The application tried to cancel a delayed-capture payment that was already cancelled.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "DELAYED_TRANSACTION_CAPTURED", + "description": "The application tried to capture a delayed-capture payment that was already captured.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "DELAYED_TRANSACTION_FAILED", + "description": "The application tried to update a delayed-capture payment that failed.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CARD_TOKEN_EXPIRED", + "description": "The provided card token (nonce) has expired.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CARD_TOKEN_USED", + "description": "The provided card token (nonce) was already used to process the payment or refund.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "AMOUNT_TOO_HIGH", + "description": "The requested payment amount is too high for the provided payment source.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_INSTRUMENT_TYPE", + "description": "The API request references an unsupported instrument type.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "REFUND_AMOUNT_INVALID", + "description": "The requested refund amount exceeds the amount available to refund.", + "error-category": "REFUND_ERROR" + }, + { + "name": "REFUND_ALREADY_PENDING", + "description": "The payment already has a pending refund.", + "error-category": "REFUND_ERROR" + }, + { + "name": "PAYMENT_NOT_REFUNDABLE", + "description": "The payment is not refundable. For example, the payment is too old to be refunded.", + "error-category": "REFUND_ERROR" + }, + { + "name": "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE", + "description": "The payment is not refundable because it has been disputed.", + "error-category": "REFUND_ERROR" + }, + { + "name": "REFUND_ERROR_PAYMENT_NEEDS_COMPLETION", + "description": "The payment is not refundable because the payment is approved and needs to be completed first before the refund is issued.", + "error-category": "REFUND_ERROR" + }, + { + "name": "REFUND_DECLINED", + "description": "Request failed - The card issuer declined the refund.", + "error-category": "REFUND_ERROR" + }, + { + "name": "INSUFFICIENT_PERMISSIONS_FOR_REFUND", + "description": "The Square account does not have the permissions to process this refund.", + "error-category": "REFUND_ERROR" + }, + { + "name": "INVALID_CARD_DATA", + "description": "Generic error - the provided card data is invalid.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "SOURCE_USED", + "description": "The provided source id was already used to create a card.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "SOURCE_EXPIRED", + "description": "The provided source id has expired.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_LOYALTY_REWARD_TIER", + "description": "The referenced loyalty program reward tier is not supported.\nThis could happen if the reward tier created in a first party\napplication is incompatible with the Loyalty API.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "LOCATION_MISMATCH", + "description": "Generic error - the given location does not matching what is expected.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "ORDER_UNPAID_NOT_RETURNABLE", + "description": "The order attempting to be returned is not yet paid and cannot be returned.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "IDEMPOTENCY_KEY_REUSED", + "description": "The provided idempotency key has already been used.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNEXPECTED_VALUE", + "description": "General error - the value provided was unexpected.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "SANDBOX_NOT_SUPPORTED", + "description": "The API request is not supported in sandbox.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_EMAIL_ADDRESS", + "description": "The provided email address is invalid.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_PHONE_NUMBER", + "description": "The provided phone number is invalid.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CHECKOUT_EXPIRED", + "description": "The provided checkout URL has expired.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "BAD_CERTIFICATE", + "description": "Bad certificate.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_SQUARE_VERSION_FORMAT", + "description": "The provided Square-Version is incorrectly formatted.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "API_VERSION_INCOMPATIBLE", + "description": "The provided Square-Version is incompatible with the requested action.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CARD_PRESENCE_REQUIRED", + "description": "The transaction requires that a card be present.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_SOURCE_TYPE", + "description": "The API request references an unsupported source type.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CARD_MISMATCH", + "description": "The provided card does not match what is expected.", + "error-category": "REFUND_ERROR" + }, + { + "name": "PLAID_ERROR", + "description": "Generic plaid error", + "error-category": "EXTERNAL_VENDOR_ERROR" + }, + { + "name": "PLAID_ERROR_ITEM_LOGIN_REQUIRED", + "description": "Plaid error - ITEM_LOGIN_REQUIRED", + "error-category": "EXTERNAL_VENDOR_ERROR" + }, + { + "name": "PLAID_ERROR_RATE_LIMIT", + "description": "Plaid error - RATE_LIMIT", + "error-category": "EXTERNAL_VENDOR_ERROR" + }, + { + "name": "CARD_DECLINED", + "description": "The card was declined.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "VERIFY_CVV_FAILURE", + "description": "The CVV could not be verified.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "VERIFY_AVS_FAILURE", + "description": "The AVS could not be verified.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CARD_DECLINED_CALL_ISSUER", + "description": "The payment card was declined with a request\nfor the card holder to call the issuer.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CARD_DECLINED_VERIFICATION_REQUIRED", + "description": "The payment card was declined with a request\nfor additional verification.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "BAD_EXPIRATION", + "description": "The card expiration date is either missing or\nincorrectly formatted.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CHIP_INSERTION_REQUIRED", + "description": "The card issuer requires that the card be read\nusing a chip reader.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "ALLOWABLE_PIN_TRIES_EXCEEDED", + "description": "The card has exhausted its available pin entry\nretries set by the card issuer. Resolving the error typically requires the\ncard holder to contact the card issuer.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "RESERVATION_DECLINED", + "description": "The card issuer declined the refund.", + "error-category": "REFUND_ERROR" + }, + { + "name": "UNKNOWN_BODY_PARAMETER", + "description": "The body parameter is not recognized by the requested endpoint.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "NOT_FOUND", + "description": "Not Found - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", + "description": "Square could not find the associated Apple Pay certificate.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "METHOD_NOT_ALLOWED", + "description": "Method Not Allowed - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "NOT_ACCEPTABLE", + "description": "Not Acceptable - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "REQUEST_TIMEOUT", + "description": "Request Timeout - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CONFLICT", + "description": "Conflict - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "GONE", + "description": "The target resource is no longer available and this\ncondition is likely to be permanent.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "REQUEST_ENTITY_TOO_LARGE", + "description": "Request Entity Too Large - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_MEDIA_TYPE", + "description": "Unsupported Media Type - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNPROCESSABLE_ENTITY", + "description": "Unprocessable Entity - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "RATE_LIMITED", + "description": "Rate Limited - a general error occurred.", + "error-category": "RATE_LIMIT_ERROR" + }, + { + "name": "NOT_IMPLEMENTED", + "description": "Not Implemented - a general error occurred.", + "error-category": "API_ERROR" + }, + { + "name": "BAD_GATEWAY", + "description": "Bad Gateway - a general error occurred.", + "error-category": "API_ERROR" + }, + { + "name": "SERVICE_UNAVAILABLE", + "description": "Service Unavailable - a general error occurred.", + "error-category": "API_ERROR" + }, + { + "name": "TEMPORARY_ERROR", + "description": "A temporary internal error occurred. You can safely retry your call\nusing the same idempotency key.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "GATEWAY_TIMEOUT", + "description": "Gateway Timeout - a general error occurred.", + "error-category": "API_ERROR" + } + ], + "description": "Indicates the specific error that occurred during a request to a\nSquare API.", + "x-release-status": "PUBLIC" + }, + "Event": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/EventData", + "description": "The data associated with the event.", + "nullable": true + } + } + }, + "EventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The name of the affected object’s type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected object." + }, + "deleted": { + "type": "boolean", + "description": "This is true if the affected object has been deleted; otherwise, it's absent.", + "nullable": true + }, + "object": { + "type": "object", + "description": "An object containing fields and values relevant to the event. It is absent if the affected object has been deleted.", + "nullable": true + } + } + }, + "EventMetadata": { + "type": "object", + "description": "Contains metadata about a particular [Event](entity:Event).", + "x-release-status": "BETA", + "properties": { + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "api_version": { + "type": "string", + "description": "The API version of the event. This corresponds to the default API version of the developer application at the time when the event was created.", + "nullable": true + } + } + }, + "EventTypeMetadata": { + "type": "object", + "description": "Contains the metadata of a webhook event type.", + "x-release-status": "PUBLIC", + "properties": { + "event_type": { + "type": "string", + "description": "The event type.", + "readOnly": true + }, + "api_version_introduced": { + "type": "string", + "description": "The API version at which the event type was introduced.", + "readOnly": true + }, + "release_status": { + "type": "string", + "description": "The release status of the event type.", + "readOnly": true + } + } + }, + "ExcludeStrategy": { + "type": "string", + "enum": [ + "LEAST_EXPENSIVE", + "MOST_EXPENSIVE" + ], + "x-enum-elements": [ + { + "name": "LEAST_EXPENSIVE", + "description": "The least expensive matched products are excluded from the pricing. If\nthe pricing rule is set to exclude one product and multiple products in the\nmatch set qualify as least expensive, then one will be excluded at random.\n\nExcluding the least expensive product gives the best discount value to the buyer." + }, + { + "name": "MOST_EXPENSIVE", + "description": "The most expensive matched product is excluded from the pricing rule.\nIf multiple products have the same price and all qualify as least expensive,\none will be excluded at random.\n\nThis guarantees that the most expensive product is purchased at full price." + } + ], + "description": "Indicates which products matched by a CatalogPricingRule\nwill be excluded if the pricing rule uses an exclude set.", + "x-release-status": "BETA" + }, + "ExternalPaymentDetails": { + "type": "object", + "description": "Stores details about an external payment. Contains only non-confidential information.\nFor more information, see \n[Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external-payments).", + "x-release-status": "PUBLIC", + "required": [ + "type", + "source" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of external payment the seller received. It can be one of the following:\n- CHECK - Paid using a physical check.\n- BANK_TRANSFER - Paid using external bank transfer.\n- OTHER\\_GIFT\\_CARD - Paid using a non-Square gift card.\n- CRYPTO - Paid using a crypto currency.\n- SQUARE_CASH - Paid using Square Cash App.\n- SOCIAL - Paid using peer-to-peer payment applications.\n- EXTERNAL - A third-party application gathered this payment outside of Square.\n- EMONEY - Paid using an E-money provider.\n- CARD - A credit or debit card that Square does not support.\n- STORED_BALANCE - Use for house accounts, store credit, and so forth.\n- FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals\n- OTHER - A type not listed here.", + "maxLength": 50 + }, + "source": { + "type": "string", + "description": "A description of the external payment source. For example, \n\"Food Delivery Service\".", + "maxLength": 255 + }, + "source_id": { + "type": "string", + "description": "An ID to associate the payment to its originating source.", + "maxLength": 255, + "nullable": true + }, + "source_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The fees paid to the source. The `amount_money` minus this field is \nthe net amount seller receives.", + "nullable": true + } + } + }, + "FilterValue": { + "type": "object", + "description": "A filter to select resources based on an exact field value. For any given\nvalue, the value can only be in one property. Depending on the field, either\nall properties can be set or only a subset will be available.\n\nRefer to the documentation of the field.", + "x-release-status": "BETA", + "properties": { + "all": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of terms that must be present on the field of the resource.", + "nullable": true + }, + "any": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of terms where at least one of them must be present on the\nfield of the resource.", + "nullable": true + }, + "none": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of terms that must not be present on the field the resource", + "nullable": true + } + } + }, + "FloatNumberRange": { + "type": "object", + "description": "Specifies a decimal number range.", + "x-release-status": "PUBLIC", + "properties": { + "start_at": { + "type": "string", + "description": "A decimal value indicating where the range starts.", + "nullable": true + }, + "end_at": { + "type": "string", + "description": "A decimal value indicating where the range ends.", + "nullable": true + } + } + }, + "Fulfillment": { + "type": "object", + "description": "Contains details about how to fulfill this order.\nOrders can only be created with at most one fulfillment using the API.\nHowever, orders returned by the Orders API might contain multiple fulfillments because sellers can create multiple fulfillments using Square products such as Square Online.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the fulfillment only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/FulfillmentType", + "description": "The type of the fulfillment.\nSee [FulfillmentType](#type-fulfillmenttype) for possible values", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/FulfillmentState", + "description": "The state of the fulfillment.\nSee [FulfillmentState](#type-fulfillmentstate) for possible values", + "nullable": true + }, + "line_item_application": { + "$ref": "#/components/schemas/FulfillmentFulfillmentLineItemApplication", + "description": "Describes what order line items this fulfillment applies to.\nIt can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries.\nSee [FulfillmentFulfillmentLineItemApplication](#type-fulfillmentfulfillmentlineitemapplication) for possible values", + "readOnly": true, + "x-release-status": "BETA" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentFulfillmentEntry" + }, + "description": "A list of entries pertaining to the fulfillment of an order. Each entry must reference\na valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to\nfulfill.\n\nMultiple entries can reference the same line item `uid`, as long as the total quantity among\nall fulfillment entries referencing a single line item does not exceed the quantity of the\norder's line item itself.\n\nAn order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`,\n`CANCELED`, or `FAILED`. Fulfillments can be created and completed independently\nbefore order completion.", + "readOnly": true, + "x-release-status": "BETA" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this fulfillment. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "pickup_details": { + "$ref": "#/components/schemas/FulfillmentPickupDetails", + "description": "Contains details for a pickup fulfillment. These details are required when the fulfillment\ntype is `PICKUP`.", + "nullable": true + }, + "shipment_details": { + "$ref": "#/components/schemas/FulfillmentShipmentDetails", + "description": "Contains details for a shipment fulfillment. These details are required when the fulfillment type\nis `SHIPMENT`.\n\nA shipment fulfillment's relationship to fulfillment `state`:\n`PROPOSED`: A shipment is requested.\n`RESERVED`: Fulfillment in progress. Shipment processing.\n`PREPARED`: Shipment packaged. Shipping label created.\n`COMPLETED`: Package has been shipped.\n`CANCELED`: Shipment has been canceled.\n`FAILED`: Shipment has failed.", + "x-release-status": "BETA", + "nullable": true + }, + "delivery_details": { + "$ref": "#/components/schemas/FulfillmentDeliveryDetails", + "description": "Describes delivery details of an order fulfillment.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "FulfillmentDeliveryDetails": { + "type": "object", + "description": "Describes delivery details of an order fulfillment.", + "x-release-status": "BETA", + "properties": { + "recipient": { + "$ref": "#/components/schemas/FulfillmentRecipient", + "description": "The contact information for the person to receive the fulfillment.", + "nullable": true + }, + "schedule_type": { + "$ref": "#/components/schemas/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType", + "description": "Indicates the fulfillment delivery schedule type. If `SCHEDULED`, then\n`deliver_at` is required. If `ASAP`, then `prep_time_duration` is required. The default is `SCHEDULED`.\nSee [OrderFulfillmentDeliveryDetailsScheduleType](#type-orderfulfillmentdeliverydetailsscheduletype) for possible values", + "nullable": true + }, + "placed_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was placed.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").\n\nMust be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".", + "readOnly": true + }, + "deliver_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nthat represents the start of the delivery period.\nWhen the fulfillment `schedule_type` is `ASAP`, the field is automatically\nset to the current time plus the `prep_time_duration`.\nOtherwise, the application can set this field while the fulfillment `state` is\n`PROPOSED`, `RESERVED`, or `PREPARED` (any time before the\nterminal state such as `COMPLETED`, `CANCELED`, and `FAILED`).\n\nThe timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + }, + "prep_time_duration": { + "type": "string", + "description": "The duration of time it takes to prepare and deliver this fulfillment.\nThe duration must be in RFC 3339 format (for example, \"P1W3D\").", + "nullable": true + }, + "delivery_window_duration": { + "type": "string", + "description": "The time period after `deliver_at` in which to deliver the order.\nApplications can set this field when the fulfillment `state` is\n`PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state\nsuch as `COMPLETED`, `CANCELED`, and `FAILED`).\n\nThe duration must be in RFC 3339 format (for example, \"P1W3D\").", + "nullable": true + }, + "note": { + "type": "string", + "description": "Provides additional instructions about the delivery fulfillment.\nIt is displayed in the Square Point of Sale application and set by the API.", + "maxLength": 550, + "nullable": true + }, + "completed_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicates when the seller completed the fulfillment.\nThis field is automatically set when fulfillment `state` changes to `COMPLETED`.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + }, + "in_progress_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicates when the seller started processing the fulfillment.\nThis field is automatically set when the fulfillment `state` changes to `RESERVED`.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "rejected_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was rejected. This field is\nautomatically set when the fulfillment `state` changes to `FAILED`.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "ready_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the seller marked the fulfillment as ready for\ncourier pickup. This field is automatically set when the fulfillment `state` changes\nto PREPARED.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "delivered_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was delivered to the recipient.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "canceled_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was canceled. This field is automatically\nset when the fulfillment `state` changes to `CANCELED`.\n\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "cancel_reason": { + "type": "string", + "description": "The delivery cancellation reason. Max length: 100 characters.", + "maxLength": 100, + "nullable": true + }, + "courier_pickup_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when an order can be picked up by the courier for delivery.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + }, + "courier_pickup_window_duration": { + "type": "string", + "description": "The time period after `courier_pickup_at` in which the courier should pick up the order.\nThe duration must be in RFC 3339 format (for example, \"P1W3D\").", + "nullable": true + }, + "is_no_contact_delivery": { + "type": "boolean", + "description": "Whether the delivery is preferred to be no contact.", + "nullable": true + }, + "dropoff_notes": { + "type": "string", + "description": "A note to provide additional instructions about how to deliver the order.", + "maxLength": 550, + "nullable": true + }, + "courier_provider_name": { + "type": "string", + "description": "The name of the courier provider.", + "maxLength": 255, + "nullable": true + }, + "courier_support_phone_number": { + "type": "string", + "description": "The support phone number of the courier.", + "maxLength": 17, + "nullable": true + }, + "square_delivery_id": { + "type": "string", + "description": "The identifier for the delivery created by Square.", + "maxLength": 50, + "nullable": true + }, + "external_delivery_id": { + "type": "string", + "description": "The identifier for the delivery created by the third-party courier service.", + "maxLength": 50, + "nullable": true + }, + "managed_delivery": { + "type": "boolean", + "description": "The flag to indicate the delivery is managed by a third party (ie DoorDash), which means\nwe may not receive all recipient information for PII purposes.", + "nullable": true + } + } + }, + "FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType": { + "type": "string", + "enum": [ + "SCHEDULED", + "ASAP" + ], + "x-enum-elements": [ + { + "name": "SCHEDULED", + "description": "Indicates the fulfillment to deliver at a scheduled deliver time." + }, + { + "name": "ASAP", + "description": "Indicates that the fulfillment to deliver as soon as possible and should be prepared\nimmediately." + } + ], + "description": "The schedule type of the delivery fulfillment.", + "x-release-status": "BETA" + }, + "FulfillmentFulfillmentEntry": { + "type": "object", + "description": "Links an order line item to a fulfillment. Each entry must reference\na valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to\nfulfill.", + "x-release-status": "BETA", + "required": [ + "line_item_uid", + "quantity" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the fulfillment entry only within this order.", + "maxLength": 60, + "nullable": true + }, + "line_item_uid": { + "type": "string", + "description": "The `uid` from the order line item.", + "minLength": 1 + }, + "quantity": { + "type": "string", + "description": "The quantity of the line item being fulfilled, formatted as a decimal number.\nFor example, `\"3\"`.\n\nFulfillments for line items with a `quantity_unit` can have non-integer quantities.\nFor example, `\"1.70000\"`.", + "minLength": 1, + "maxLength": 12 + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this fulfillment entry. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "nullable": true + } + } + }, + "FulfillmentFulfillmentLineItemApplication": { + "type": "string", + "enum": [ + "ALL", + "ENTRY_LIST" + ], + "x-enum-elements": [ + { + "name": "ALL", + "description": "If `ALL`, `entries` must be unset." + }, + { + "name": "ENTRY_LIST", + "description": "If `ENTRY_LIST`, supply a list of `entries`." + } + ], + "description": "The `line_item_application` describes what order line items this fulfillment applies\nto. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries.", + "x-release-status": "BETA" + }, + "FulfillmentPickupDetails": { + "type": "object", + "description": "Contains details necessary to fulfill a pickup order.", + "x-release-status": "PUBLIC", + "properties": { + "recipient": { + "$ref": "#/components/schemas/FulfillmentRecipient", + "description": "Information about the person to pick up this fulfillment from a physical\nlocation.", + "nullable": true + }, + "expires_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when this fulfillment expires if it is not marked in progress. The timestamp must be\nin RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\"). The expiration time can only be set\nup to 7 days in the future. If `expires_at` is not set, any new payments attached to the order\nare automatically completed.", + "nullable": true + }, + "auto_complete_duration": { + "type": "string", + "description": "The duration of time after which an in progress pickup fulfillment is automatically moved\nto the `COMPLETED` state. The duration must be in RFC 3339 format (for example, \"P1W3D\").\n\nIf not set, this pickup fulfillment remains in progress until it is canceled or completed.", + "nullable": true + }, + "schedule_type": { + "$ref": "#/components/schemas/FulfillmentPickupDetailsScheduleType", + "description": "The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`.\nSee [FulfillmentPickupDetailsScheduleType](#type-fulfillmentpickupdetailsscheduletype) for possible values", + "nullable": true + }, + "pickup_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nthat represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g.,\n\"2016-09-04T23:59:33.123Z\".\n\nFor fulfillments with the schedule type `ASAP`, this is automatically set\nto the current time plus the expected duration to prepare the fulfillment.", + "nullable": true + }, + "pickup_window_duration": { + "type": "string", + "description": "The window of time in which the order should be picked up after the `pickup_at` timestamp.\nMust be in RFC 3339 duration format, e.g., \"P1W3D\". Can be used as an\ninformational guideline for merchants.", + "nullable": true + }, + "prep_time_duration": { + "type": "string", + "description": "The duration of time it takes to prepare this fulfillment.\nThe duration must be in RFC 3339 format (for example, \"P1W3D\").", + "nullable": true + }, + "note": { + "type": "string", + "description": "A note to provide additional instructions about the pickup\nfulfillment displayed in the Square Point of Sale application and set by the API.", + "maxLength": 500, + "nullable": true + }, + "placed_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was placed. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "accepted_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was marked in progress. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "rejected_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "ready_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "expired_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment expired. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "picked_up_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "canceled_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "cancel_reason": { + "type": "string", + "description": "A description of why the pickup was canceled. The maximum length: 100 characters.", + "maxLength": 100, + "nullable": true + }, + "is_curbside_pickup": { + "type": "boolean", + "description": "If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup.", + "x-release-status": "BETA", + "nullable": true + }, + "curbside_pickup_details": { + "$ref": "#/components/schemas/FulfillmentPickupDetailsCurbsidePickupDetails", + "description": "Specific details for curbside pickup. These details can only be populated if `is_curbside_pickup` is set to `true`.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "FulfillmentPickupDetailsCurbsidePickupDetails": { + "type": "object", + "description": "Specific details for curbside pickup.", + "x-release-status": "BETA", + "properties": { + "curbside_details": { + "type": "string", + "description": "Specific details for curbside pickup, such as parking number and vehicle model.", + "maxLength": 250, + "nullable": true + }, + "buyer_arrived_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + } + } + }, + "FulfillmentPickupDetailsScheduleType": { + "type": "string", + "enum": [ + "SCHEDULED", + "ASAP" + ], + "x-enum-elements": [ + { + "name": "SCHEDULED", + "description": "Indicates that the fulfillment will be picked up at a scheduled pickup time." + }, + { + "name": "ASAP", + "description": "Indicates that the fulfillment will be picked up as soon as possible and\nshould be prepared immediately." + } + ], + "description": "The schedule type of the pickup fulfillment.", + "x-release-status": "PUBLIC" + }, + "FulfillmentRecipient": { + "type": "object", + "description": "Information about the fulfillment recipient.", + "x-release-status": "PUBLIC", + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the customer associated with the fulfillment.\n\nIf `customer_id` is provided, the fulfillment recipient's `display_name`,\n`email_address`, and `phone_number` are automatically populated from the\ntargeted customer profile. If these fields are set in the request, the request\nvalues override the information from the customer profile. If the\ntargeted customer profile does not contain the necessary information and\nthese fields are left unset, the request results in an error.", + "maxLength": 191, + "nullable": true + }, + "display_name": { + "type": "string", + "description": "The display name of the fulfillment recipient. This field is required.\n\nIf provided, the display name overrides the corresponding customer profile value\nindicated by `customer_id`.", + "maxLength": 255, + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address of the fulfillment recipient.\n\nIf provided, the email address overrides the corresponding customer profile value\nindicated by `customer_id`.", + "maxLength": 255, + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number of the fulfillment recipient. This field is required.\n\nIf provided, the phone number overrides the corresponding customer profile value\nindicated by `customer_id`.", + "maxLength": 17, + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The address of the fulfillment recipient. This field is required.\n\nIf provided, the address overrides the corresponding customer profile value\nindicated by `customer_id`.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "FulfillmentShipmentDetails": { + "type": "object", + "description": "Contains the details necessary to fulfill a shipment order.", + "x-release-status": "BETA", + "properties": { + "recipient": { + "$ref": "#/components/schemas/FulfillmentRecipient", + "description": "Information about the person to receive this shipment fulfillment.", + "nullable": true + }, + "carrier": { + "type": "string", + "description": "The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).", + "maxLength": 50, + "nullable": true + }, + "shipping_note": { + "type": "string", + "description": "A note with additional information for the shipping carrier.", + "maxLength": 500, + "nullable": true + }, + "shipping_type": { + "type": "string", + "description": "A description of the type of shipping product purchased from the carrier\n(such as First Class, Priority, or Express).", + "maxLength": 50, + "nullable": true + }, + "tracking_number": { + "type": "string", + "description": "The reference number provided by the carrier to track the shipment's progress.", + "maxLength": 100, + "nullable": true + }, + "tracking_url": { + "type": "string", + "description": "A link to the tracking webpage on the carrier's website.", + "maxLength": 2000, + "nullable": true + }, + "placed_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the shipment was requested. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "in_progress_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when this fulfillment was moved to the `RESERVED` state, which indicates that preparation\nof this shipment has begun. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "packaged_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when this fulfillment was moved to the `PREPARED` state, which indicates that the\nfulfillment is packaged. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "expected_shipped_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the shipment is expected to be delivered to the shipping carrier.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + }, + "shipped_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when this fulfillment was moved to the `COMPLETED` state, which indicates that\nthe fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "canceled_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating the shipment was canceled.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + }, + "cancel_reason": { + "type": "string", + "description": "A description of why the shipment was canceled.", + "maxLength": 100, + "nullable": true + }, + "failed_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "failure_reason": { + "type": "string", + "description": "A description of why the shipment failed to be completed.", + "maxLength": 100, + "nullable": true + } + } + }, + "FulfillmentState": { + "type": "string", + "enum": [ + "PROPOSED", + "RESERVED", + "PREPARED", + "COMPLETED", + "CANCELED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "PROPOSED", + "description": "Indicates that the fulfillment has been proposed." + }, + { + "name": "RESERVED", + "description": "Indicates that the fulfillment has been reserved." + }, + { + "name": "PREPARED", + "description": "Indicates that the fulfillment has been prepared." + }, + { + "name": "COMPLETED", + "description": "Indicates that the fulfillment was successfully completed." + }, + { + "name": "CANCELED", + "description": "Indicates that the fulfillment was canceled." + }, + { + "name": "FAILED", + "description": "Indicates that the fulfillment failed to be completed, but was not explicitly\ncanceled." + } + ], + "description": "The current state of this fulfillment.", + "x-release-status": "PUBLIC" + }, + "FulfillmentType": { + "type": "string", + "enum": [ + "PICKUP", + "SHIPMENT", + "DELIVERY" + ], + "x-enum-elements": [ + { + "name": "PICKUP", + "description": "A recipient to pick up the fulfillment from a physical [location](entity:Location)." + }, + { + "name": "SHIPMENT", + "description": "A shipping carrier to ship the fulfillment." + }, + { + "name": "DELIVERY", + "description": "A courier to deliver the fulfillment." + } + ], + "description": "The type of fulfillment.", + "x-release-status": "PUBLIC" + }, + "GetBankAccountByV1IdResponse": { + "type": "object", + "description": "Response object returned by GetBankAccountByV1Id.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "bank_account": { + "$ref": "#/components/schemas/BankAccount", + "description": "The requested `BankAccount` object." + } + }, + "example": { + "bank_account": { + "account_number_suffix": "971", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": false, + "currency": "USD", + "debitable": false, + "holder_name": "Jane Doe", + "id": "w3yRgCGYQnwmdl0R3GB", + "location_id": "S8GWD5example", + "primary_bank_identification_number": "112200303", + "status": "VERIFICATION_IN_PROGRESS", + "version": 5 + } + } + }, + "GetBankAccountResponse": { + "type": "object", + "description": "Response object returned by `GetBankAccount`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "bank_account": { + "$ref": "#/components/schemas/BankAccount", + "description": "The requested `BankAccount` object." + } + }, + "example": { + "bank_account": { + "account_number_suffix": "971", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": false, + "currency": "USD", + "debitable": false, + "holder_name": "Jane Doe", + "id": "w3yRgCGYQnwmdl0R3GB", + "location_id": "S8GWD5example", + "primary_bank_identification_number": "112200303", + "status": "VERIFICATION_IN_PROGRESS", + "version": 5 + } + } + }, + "GetBreakTypeResponse": { + "type": "object", + "description": "The response to a request to get a `BreakType`. The response contains\nthe requested `BreakType` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "break_type": { + "$ref": "#/components/schemas/BreakType", + "description": "The response object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "break_type": { + "break_name": "Lunch Break", + "created_at": "2019-02-21T17:50:00Z", + "expected_duration": "PT30M", + "id": "lA0mj_RSOprNPwMUXdYp", + "is_paid": true, + "location_id": "059SB0E0WCNWS", + "updated_at": "2019-02-21T17:50:00Z", + "version": 1 + } + } + }, + "GetDeviceCodeResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "device_code": { + "$ref": "#/components/schemas/DeviceCode", + "description": "The queried DeviceCode." + } + }, + "example": { + "device_code": { + "code": "EBCARJ", + "created_at": "2020-02-06T18:44:33.000Z", + "device_id": "907CS13101300122", + "id": "B3Z6NAMYQSMTM", + "location_id": "B5E4484SHHNYH", + "name": "Counter 1", + "pair_by": "2020-02-06T18:49:33.000Z", + "product_type": "TERMINAL_API", + "status": "PAIRED", + "status_changed_at": "2020-02-06T18:47:28.000Z" + } + } + }, + "GetDeviceResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "device": { + "$ref": "#/components/schemas/Device", + "description": "The requested `Device`." + } + }, + "example": { + "device": { + "attributes": { + "manufacturer": "Square", + "manufacturers_id": "995CS397A6475287", + "merchant_token": "MLCHXZCBWFGDW", + "model": "T2", + "name": "Square Terminal 995", + "type": "TERMINAL", + "updated_at": "2023-09-29T13:12:22.365049321Z", + "version": "5.41.0085" + }, + "components": [ + { + "application_details": { + "application_type": "TERMINAL_API", + "session_location": "LMN2K7S3RTOU3", + "version": "6.25" + }, + "type": "APPLICATION" + }, + { + "card_reader_details": { + "version": "3.53.70" + }, + "type": "CARD_READER" + }, + { + "battery_details": { + "external_power": "AVAILABLE_CHARGING", + "visible_percent": 5 + }, + "type": "BATTERY" + }, + { + "type": "WIFI", + "wifi_details": { + "active": true, + "ip_address_v4": "10.0.0.7", + "secure_connection": "WPA/WPA2 PSK", + "signal_strength": { + "value": 2 + }, + "ssid": "Staff Network" + } + }, + { + "ethernet_details": { + "active": false + }, + "type": "ETHERNET" + } + ], + "id": "device:995CS397A6475287", + "status": { + "category": "AVAILABLE" + } + } + } + }, + "GetEmployeeWageResponse": { + "type": "object", + "description": "A response to a request to get an `EmployeeWage`. The response contains\nthe requested `EmployeeWage` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "employee_wage": { + "$ref": "#/components/schemas/EmployeeWage", + "description": "The requested `EmployeeWage` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "employee_wage": { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "id": "pXS3qCv7BERPnEGedM4S8mhm", + "title": "Manager" + } + } + }, + "GetInvoiceResponse": { + "type": "object", + "description": "Describes a `GetInvoice` response.", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The invoice requested." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T17:45:13Z", + "version": 0 + } + } + }, + "GetPaymentRefundResponse": { + "type": "object", + "description": "Defines the response returned by [GetRefund](api-endpoint:Refunds-GetPaymentRefund).\n\nNote: If there are errors processing the request, the refund field might not be\npresent or it might be present in a FAILED state.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/PaymentRefund", + "description": "The requested `PaymentRefund`." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 555, + "currency": "USD" + }, + "created_at": "2021-10-13T19:59:05.073Z", + "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", + "location_id": "L88917AVBK2S5", + "order_id": "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", + "payment_id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "processing_fee": [ + { + "amount_money": { + "amount": -34, + "currency": "USD" + }, + "effective_at": "2021-10-13T21:34:35.000Z", + "type": "INITIAL" + } + ], + "reason": "Example Refund", + "status": "COMPLETED", + "updated_at": "2021-10-13T20:00:02.442Z" + } + } + }, + "GetPaymentResponse": { + "type": "object", + "description": "Defines the response returned by [GetPayment](api-endpoint:Payments-GetPayment).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The requested `Payment`." + } + }, + "example": { + "payment": { + "amount_money": { + "amount": 555, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", + "square_product": "VIRTUAL_TERMINAL" + }, + "approved_money": { + "amount": 555, + "currency": "USD" + }, + "card_details": { + "auth_result_code": "2Nkw7q", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T19:34:33.680Z", + "captured_at": "2021-10-13T19:34:34.340Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "KEYED", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "CAPTURED" + }, + "created_at": "2021-10-13T19:34:33.524Z", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T19:34:33.524Z", + "employee_id": "TMoK_ogh6rH1o4dV", + "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "location_id": "L88917AVBK2S5", + "note": "Test Note", + "order_id": "d7eKah653Z579f3gVtjlxpSlmUcZY", + "processing_fee": [ + { + "amount_money": { + "amount": 34, + "currency": "USD" + }, + "effective_at": "2021-10-13T21:34:35.000Z", + "type": "INITIAL" + } + ], + "receipt_number": "bP9m", + "receipt_url": "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "source_type": "CARD", + "status": "COMPLETED", + "team_member_id": "TMoK_ogh6rH1o4dV", + "total_money": { + "amount": 555, + "currency": "USD" + }, + "updated_at": "2021-10-13T19:34:34.339Z", + "version_token": "56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o" + } + } + }, + "GetPayoutResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout": { + "$ref": "#/components/schemas/Payout", + "description": "The requested payout." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "payout": { + "amount_money": { + "amount": -103, + "currency_code": "USD" + }, + "arrival_date": "2022-03-24", + "created_at": "2022-03-24T03:07:09Z", + "destination": { + "id": "bact:ZPp3oedR3AeEUNd3z7", + "type": "BANK_ACCOUNT" + }, + "id": "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", + "location_id": "L88917AVBK2S5", + "status": "PAID", + "type": "BATCH", + "updated_at": "2022-03-24T03:07:09Z", + "version": 1 + } + } + }, + "GetShiftResponse": { + "type": "object", + "description": "A response to a request to get a `Shift`. The response contains\nthe requested `Shift` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The requested `Shift`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "shift": { + "breaks": [ + { + "break_type_id": "92EPDRQKJ5088", + "end_at": "2019-02-23T20:00:00-05:00", + "expected_duration": "PT1H", + "id": "M9BBKEPQAQD2T", + "is_paid": true, + "name": "Lunch Break", + "start_at": "2019-02-23T19:00:00-05:00" + } + ], + "created_at": "2019-02-27T00:12:12Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "D71KRMQof6cXGUW0aAv7", + "end_at": "2019-02-23T21:00:00-05:00", + "id": "T35HMQSN89SV4", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-02-23T18:00:00-05:00", + "status": "CLOSED", + "team_member_id": "D71KRMQof6cXGUW0aAv7", + "timezone": "America/New_York", + "updated_at": "2019-02-27T00:12:12Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1457, + "currency": "USD" + }, + "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", + "tip_eligible": true, + "title": "Cashier" + } + } + } + }, + "GetTeamMemberWageResponse": { + "type": "object", + "description": "A response to a request to get a `TeamMemberWage`. The response contains\nthe requested `TeamMemberWage` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "team_member_wage": { + "$ref": "#/components/schemas/TeamMemberWage", + "description": "The requested `TeamMemberWage` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "team_member_wage": { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "id": "pXS3qCv7BERPnEGedM4S8mhm", + "job_id": "jxJNN6eCJsLrhg5UFJrDWDGE", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": false, + "title": "Manager" + } + } + }, + "GetTerminalActionResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The requested `TerminalAction`" + } + }, + "example": { + "action": { + "app_id": "APP_ID", + "created_at": "2021-07-28T23:22:07.476Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:jveJIAkkAjILHkdCE", + "location_id": "LOCATION_ID", + "save_card_options": { + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "IN_PROGRESS", + "type": "SAVE_CARD", + "updated_at": "2021-07-28T23:22:08.301Z" + } + } + }, + "GetTerminalCheckoutResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The requested `TerminalCheckout`." + } + }, + "example": { + "checkout": { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2020-04-06T16:39:32.545Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "08YceKh7B3ZqO", + "location_id": "LOCATION_ID", + "note": "A brief note", + "reference_id": "id11572", + "status": "IN_PROGRESS", + "updated_at": "2020-04-06T16:39:323.001Z" + } + } + }, + "GetTerminalRefundResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The requested `Refund`." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 1, + "exp_year": 2022, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "created_at": "2020-09-29T15:21:46.771Z", + "deadline_duration": "PT5M", + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "id": "009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "76C9W6K8CNNQ5", + "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Returning item", + "refund_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb", + "status": "COMPLETED", + "updated_at": "2020-09-29T15:21:48.675Z" + } + } + }, + "GiftCard": { + "type": "object", + "description": "Represents a Square gift card.", + "x-release-status": "PUBLIC", + "required": [ + "type" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the gift card.", + "readOnly": true + }, + "type": { + "$ref": "#/components/schemas/GiftCardType", + "description": "The gift card type.\nSee [Type](#type-type) for possible values" + }, + "gan_source": { + "$ref": "#/components/schemas/GiftCardGANSource", + "description": "The source that generated the gift card account number (GAN). The default value is `SQUARE`.\nSee [GANSource](#type-gansource) for possible values", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/GiftCardStatus", + "description": "The current gift card state.\nSee [Status](#type-status) for possible values", + "readOnly": true + }, + "balance_money": { + "$ref": "#/components/schemas/Money", + "description": "The current gift card balance. This balance is always greater than or equal to zero.", + "readOnly": true + }, + "gan": { + "type": "string", + "description": "The gift card account number (GAN). Buyers can use the GAN to make purchases or check \nthe gift card balance.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the gift card was created, in RFC 3339 format. \nIn the case of a digital gift card, it is the time when you create a card \n(using the Square Point of Sale application, Seller Dashboard, or Gift Cards API). \nIn the case of a plastic gift card, it is the time when Square associates the card with the \nseller at the time of activation.", + "readOnly": true + }, + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the [customer profiles](entity:Customer) to whom this gift card is linked.", + "readOnly": true + } + } + }, + "GiftCardActivity": { + "type": "object", + "description": "Represents an action performed on a [gift card](entity:GiftCard) that affects its state or balance. \nA gift card activity contains information about a specific activity type. For example, a `REDEEM` activity\nincludes a `redeem_activity_details` field that contains information about the redemption.", + "x-release-status": "PUBLIC", + "required": [ + "type", + "location_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the gift card activity.", + "readOnly": true + }, + "type": { + "$ref": "#/components/schemas/GiftCardActivityType", + "description": "The type of gift card activity.\nSee [Type](#type-type) for possible values" + }, + "location_id": { + "type": "string", + "description": "The ID of the [business location](entity:Location) where the activity occurred." + }, + "created_at": { + "type": "string", + "description": "The timestamp when the gift card activity was created, in RFC 3339 format.", + "readOnly": true + }, + "gift_card_id": { + "type": "string", + "description": "The gift card ID. When creating a gift card activity, `gift_card_id` is not required if \n`gift_card_gan` is specified.", + "nullable": true + }, + "gift_card_gan": { + "type": "string", + "description": "The gift card account number (GAN). When creating a gift card activity, `gift_card_gan` \nis not required if `gift_card_id` is specified.", + "nullable": true + }, + "gift_card_balance_money": { + "$ref": "#/components/schemas/Money", + "description": "The final balance on the gift card after the action is completed.", + "readOnly": true + }, + "load_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityLoad", + "description": "Additional details about a `LOAD` activity, which is used to reload money onto a gift card.", + "nullable": true + }, + "activate_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityActivate", + "description": "Additional details about an `ACTIVATE` activity, which is used to activate a gift card with \nan initial balance.", + "nullable": true + }, + "redeem_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityRedeem", + "description": "Additional details about a `REDEEM` activity, which is used to redeem a gift card for a purchase.\n\nFor applications that process payments using the Square Payments API, Square creates a `REDEEM` activity that \nupdates the gift card balance after the corresponding [CreatePayment](api-endpoint:Payments-CreatePayment) \nrequest is completed. Applications that use a custom payment processing system must call \n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) to create the `REDEEM` activity.", + "nullable": true + }, + "clear_balance_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityClearBalance", + "description": "Additional details about a `CLEAR_BALANCE` activity, which is used to set the balance of a gift card to zero.", + "nullable": true + }, + "deactivate_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityDeactivate", + "description": "Additional details about a `DEACTIVATE` activity, which is used to deactivate a gift card.", + "nullable": true + }, + "adjust_increment_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityAdjustIncrement", + "description": "Additional details about an `ADJUST_INCREMENT` activity, which is used to add money to a gift card \noutside of a typical `ACTIVATE`, `LOAD`, or `REFUND` activity flow.", + "nullable": true + }, + "adjust_decrement_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityAdjustDecrement", + "description": "Additional details about an `ADJUST_DECREMENT` activity, which is used to deduct money from a gift \ncard outside of a typical `REDEEM` activity flow.", + "nullable": true + }, + "refund_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityRefund", + "description": "Additional details about a `REFUND` activity, which is used to add money to a gift card when \nrefunding a payment.\n\nFor applications that refund payments to a gift card using the Square Refunds API, Square automatically\ncreates a `REFUND` activity that updates the gift card balance after a [RefundPayment](api-endpoint:Refunds-RefundPayment)\nrequest is completed. Applications that use a custom processing system must call\n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) to create the `REFUND` activity.", + "nullable": true + }, + "unlinked_activity_refund_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityUnlinkedActivityRefund", + "description": "Additional details about an `UNLINKED_ACTIVITY_REFUND` activity. This activity is used to add money \nto a gift card when refunding a payment that was processed using a custom payment processing system\nand not linked to the gift card.", + "nullable": true + }, + "import_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityImport", + "description": "Additional details about an `IMPORT` activity, which Square uses to import a third-party \ngift card with a balance.", + "readOnly": true + }, + "block_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityBlock", + "description": "Additional details about a `BLOCK` activity, which Square uses to temporarily block a gift card.", + "readOnly": true + }, + "unblock_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityUnblock", + "description": "Additional details about an `UNBLOCK` activity, which Square uses to unblock a gift card.", + "readOnly": true + }, + "import_reversal_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityImportReversal", + "description": "Additional details about an `IMPORT_REVERSAL` activity, which Square uses to reverse the \nimport of a third-party gift card.", + "readOnly": true + }, + "transfer_balance_to_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityTransferBalanceTo", + "description": "Additional details about a `TRANSFER_BALANCE_TO` activity, which Square uses to add money to\na gift card as the result of a transfer from another gift card.", + "readOnly": true + }, + "transfer_balance_from_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityTransferBalanceFrom", + "description": "Additional details about a `TRANSFER_BALANCE_FROM` activity, which Square uses to deduct money from\na gift as the result of a transfer to another gift card.", + "readOnly": true + } + } + }, + "GiftCardActivityActivate": { + "type": "object", + "description": "Represents details about an `ACTIVATE` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card. This value is a positive integer.\n\nApplications that use a custom order processing system must specify this amount in the \n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item.\n\nApplications that use the Square Orders API to process orders must specify the order ID\n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "line_item_uid": { + "type": "string", + "description": "The UID of the `GIFT_CARD` line item in the order that represents the gift card purchase.\n\nApplications that use the Square Orders API to process orders must specify the line item UID\nin the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID that associates the gift card activity with an entity in another system. \n\nApplications that use a custom order processing system can use this field to track information \nrelated to an order or payment.", + "nullable": true + }, + "buyer_payment_instrument_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The payment instrument IDs used to process the gift card purchase, such as a credit card ID \nor bank account ID. \n\nApplications that use a custom order processing system must specify payment instrument IDs in \nthe [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.\nSquare uses this information to perform compliance checks. \n\nFor applications that use the Square Orders API to process payments, Square has the necessary \ninstrument IDs to perform compliance checks.\n\nEach buyer payment instrument ID can contain a maximum of 255 characters.", + "nullable": true + } + } + }, + "GiftCardActivityAdjustDecrement": { + "type": "object", + "description": "Represents details about an `ADJUST_DECREMENT` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "amount_money", + "reason" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount deducted from the gift card balance. This value is a positive integer." + }, + "reason": { + "$ref": "#/components/schemas/GiftCardActivityAdjustDecrementReason", + "description": "The reason the gift card balance was adjusted.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityAdjustDecrementReason": { + "type": "string", + "enum": [ + "SUSPICIOUS_ACTIVITY", + "BALANCE_ACCIDENTALLY_INCREASED", + "SUPPORT_ISSUE", + "PURCHASE_WAS_REFUNDED" + ], + "x-enum-elements": [ + { + "name": "SUSPICIOUS_ACTIVITY", + "description": "The balance was decreased because the seller detected suspicious or fraudulent activity\non the gift card." + }, + { + "name": "BALANCE_ACCIDENTALLY_INCREASED", + "description": "The balance was decreased to reverse an unintentional balance increase." + }, + { + "name": "SUPPORT_ISSUE", + "description": "The balance was decreased to accommodate support issues." + }, + { + "name": "PURCHASE_WAS_REFUNDED", + "description": "The balance was decreased because the order used to purchase or reload the\ngift card was refunded." + } + ], + "description": "Indicates the reason for deducting money from a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityAdjustIncrement": { + "type": "object", + "description": "Represents details about an `ADJUST_INCREMENT` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "amount_money", + "reason" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card balance. This value is a positive integer." + }, + "reason": { + "$ref": "#/components/schemas/GiftCardActivityAdjustIncrementReason", + "description": "The reason the gift card balance was adjusted.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityAdjustIncrementReason": { + "type": "string", + "enum": [ + "COMPLIMENTARY", + "SUPPORT_ISSUE", + "TRANSACTION_VOIDED" + ], + "x-enum-elements": [ + { + "name": "COMPLIMENTARY", + "description": "The seller gifted a complimentary gift card balance increase." + }, + { + "name": "SUPPORT_ISSUE", + "description": "The seller increased the gift card balance \nto accommodate support issues." + }, + { + "name": "TRANSACTION_VOIDED", + "description": "The transaction is voided." + } + ], + "description": "Indicates the reason for adding money to a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityBlock": { + "type": "object", + "description": "Represents details about a `BLOCK` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "reason" + ], + "properties": { + "reason": { + "$ref": "#/components/schemas/GiftCardActivityBlockReason", + "description": "The reason the gift card was blocked.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityBlockReason": { + "type": "string", + "enum": [ + "CHARGEBACK_BLOCK" + ], + "x-enum-elements": [ + { + "name": "CHARGEBACK_BLOCK", + "description": "The gift card is blocked because the buyer initiated a chargeback on the gift card purchase." + } + ], + "description": "Indicates the reason for blocking a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityClearBalance": { + "type": "object", + "description": "Represents details about a `CLEAR_BALANCE` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "reason" + ], + "properties": { + "reason": { + "$ref": "#/components/schemas/GiftCardActivityClearBalanceReason", + "description": "The reason the gift card balance was cleared.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityClearBalanceReason": { + "type": "string", + "enum": [ + "SUSPICIOUS_ACTIVITY", + "REUSE_GIFTCARD", + "UNKNOWN_REASON" + ], + "x-enum-elements": [ + { + "name": "SUSPICIOUS_ACTIVITY", + "description": "The seller suspects suspicious activity." + }, + { + "name": "REUSE_GIFTCARD", + "description": "The seller cleared the balance to reuse the gift card." + }, + { + "name": "UNKNOWN_REASON", + "description": "The gift card balance was cleared for an unknown reason.\n\nThis reason is read-only and cannot be used to create a `CLEAR_BALANCE` activity using the Gift Card Activities API." + } + ], + "description": "Indicates the reason for clearing the balance of a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityCreatedEvent": { + "type": "object", + "description": "Published when a [gift card activity](entity:GiftCardActivity) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `gift_card.activity.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardActivityCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T03:41:35.157Z", + "data": { + "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", + "object": { + "gift_card_activity": { + "activate_activity_details": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", + "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" + }, + "created_at": "2020-12-17T01:41:35.157Z", + "gift_card_balance_money": { + "amount": 1000, + "currency": "USD" + }, + "gift_card_gan": "7783320007480908", + "gift_card_id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", + "location_id": "81FN9BNFZTKS4", + "type": "ACTIVATE" + } + }, + "type": "gift_card_activity" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.activity.created" + }, + "x-webhook": { + "event": "gift_card.activity.created", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCardActivities", + "x-since": "2021-06-16" + }, + "GiftCardActivityCreatedEventData": { + "type": "object", + "description": "Represents the data associated with a `gift_card.activity.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card_activity`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the new gift card activity." + }, + "object": { + "$ref": "#/components/schemas/GiftCardActivityCreatedEventObject", + "description": "An object that contains the new gift card activity.", + "nullable": true + } + } + }, + "GiftCardActivityCreatedEventObject": { + "type": "object", + "description": "An object that contains the gift card activity associated with a \n`gift_card.activity.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card_activity": { + "$ref": "#/components/schemas/GiftCardActivity", + "description": "The new gift card activity.", + "nullable": true + } + } + }, + "GiftCardActivityDeactivate": { + "type": "object", + "description": "Represents details about a `DEACTIVATE` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "reason" + ], + "properties": { + "reason": { + "$ref": "#/components/schemas/GiftCardActivityDeactivateReason", + "description": "The reason the gift card was deactivated.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityDeactivateReason": { + "type": "string", + "enum": [ + "SUSPICIOUS_ACTIVITY", + "UNKNOWN_REASON", + "CHARGEBACK_DEACTIVATE" + ], + "x-enum-elements": [ + { + "name": "SUSPICIOUS_ACTIVITY", + "description": "The seller suspects suspicious activity." + }, + { + "name": "UNKNOWN_REASON", + "description": "The gift card was deactivated for an unknown reason.\n\nThis reason is read-only and cannot be used to create a `DEACTIVATE` activity using the Gift Card Activities API." + }, + { + "name": "CHARGEBACK_DEACTIVATE", + "description": "A chargeback on the gift card purchase (or the gift card load) was ruled in favor of the buyer.\n\nThis reason is read-only and cannot be used to create a `DEACTIVATE` activity using the Gift Card Activities API." + } + ], + "description": "Indicates the reason for deactivating a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityImport": { + "type": "object", + "description": "Represents details about an `IMPORT` [gift card activity type](entity:GiftCardActivityType).\nThis activity type is used when Square imports a third-party gift card, in which case the \n`gan_source` of the gift card is set to `OTHER`.", + "x-release-status": "PUBLIC", + "required": [ + "amount_money" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The balance amount on the imported gift card." + } + } + }, + "GiftCardActivityImportReversal": { + "type": "object", + "description": "Represents details about an `IMPORT_REVERSAL` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "amount_money" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money cleared from the third-party gift card when \nthe import was reversed." + } + } + }, + "GiftCardActivityLoad": { + "type": "object", + "description": "Represents details about a `LOAD` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card. This value is a positive integer.\n\nApplications that use a custom order processing system must specify this amount in the \n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item.\n\nApplications that use the Square Orders API to process orders must specify the order ID in the \n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "line_item_uid": { + "type": "string", + "description": "The UID of the `GIFT_CARD` line item in the order that represents the additional funds for the gift card.\n\nApplications that use the Square Orders API to process orders must specify the line item UID\nin the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID that associates the gift card activity with an entity in another system. \n\nApplications that use a custom order processing system can use this field to track information related to \nan order or payment.", + "nullable": true + }, + "buyer_payment_instrument_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The payment instrument IDs used to process the order for the additional funds, such as a credit card ID \nor bank account ID. \n\nApplications that use a custom order processing system must specify payment instrument IDs in \nthe [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.\nSquare uses this information to perform compliance checks. \n\nFor applications that use the Square Orders API to process payments, Square has the necessary \ninstrument IDs to perform compliance checks.\n\nEach buyer payment instrument ID can contain a maximum of 255 characters.", + "nullable": true + } + } + }, + "GiftCardActivityRedeem": { + "type": "object", + "description": "Represents details about a `REDEEM` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "amount_money" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount deducted from the gift card for the redemption. This value is a positive integer.\n\nApplications that use a custom payment processing system must specify this amount in the \n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request." + }, + "payment_id": { + "type": "string", + "description": "The ID of the payment that represents the gift card redemption. Square populates this field \nif the payment was processed by Square.", + "readOnly": true + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID that associates the gift card activity with an entity in another system. \n\nApplications that use a custom payment processing system can use this field to track information\nrelated to an order or payment.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/GiftCardActivityRedeemStatus", + "description": "The status of the gift card redemption. Gift cards redeemed from Square Point of Sale or the \nSquare Seller Dashboard use a two-state process: `PENDING` \nto `COMPLETED` or `PENDING` to `CANCELED`. Gift cards redeemed using the Gift Card Activities API \nalways have a `COMPLETED` status.\nSee [Status](#type-status) for possible values", + "readOnly": true + } + } + }, + "GiftCardActivityRedeemStatus": { + "type": "string", + "enum": [ + "PENDING", + "COMPLETED", + "CANCELED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The gift card redemption is pending. `PENDING` is a temporary status that applies when a \ngift card is redeemed from Square Point of Sale or another Square product. A `PENDING` status is updated to \n`COMPLETED` if the payment is captured or `CANCELED` if the authorization is voided." + }, + { + "name": "COMPLETED", + "description": "The gift card redemption is completed." + }, + { + "name": "CANCELED", + "description": "The gift card redemption is canceled. A redemption is canceled if the authorization \non the gift card is voided." + } + ], + "description": "Indicates the status of a [gift card](entity:GiftCard) redemption. This status is relevant only for\nredemptions made from Square products (such as Square Point of Sale) because Square products use a \ntwo-state process. Gift cards redeemed using the Gift Card Activities API always have a `COMPLETED` status.", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityRefund": { + "type": "object", + "description": "Represents details about a `REFUND` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "properties": { + "redeem_activity_id": { + "type": "string", + "description": "The ID of the refunded `REDEEM` gift card activity. Square populates this field if the \n`payment_id` in the corresponding [RefundPayment](api-endpoint:Refunds-RefundPayment) request \nrepresents a gift card redemption.\n\nFor applications that use a custom payment processing system, this field is required when creating\na `REFUND` activity. The provided `REDEEM` activity ID must be linked to the same gift card.", + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card for the refund. This value is a positive integer.\n\nThis field is required when creating a `REFUND` activity. The amount can represent a full or partial refund.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID that associates the gift card activity with an entity in another system.", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The ID of the refunded payment. Square populates this field if the refund is for a \npayment processed by Square. This field matches the `payment_id` in the corresponding\n[RefundPayment](api-endpoint:Refunds-RefundPayment) request.", + "readOnly": true + } + } + }, + "GiftCardActivityTransferBalanceFrom": { + "type": "object", + "description": "Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "transfer_to_gift_card_id", + "amount_money" + ], + "properties": { + "transfer_to_gift_card_id": { + "type": "string", + "description": "The ID of the gift card to which the specified amount was transferred." + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount deducted from the gift card for the transfer. This value is a positive integer." + } + } + }, + "GiftCardActivityTransferBalanceTo": { + "type": "object", + "description": "Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "transfer_from_gift_card_id", + "amount_money" + ], + "properties": { + "transfer_from_gift_card_id": { + "type": "string", + "description": "The ID of the gift card from which the specified amount was transferred." + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card balance for the transfer. This value is a positive integer." + } + } + }, + "GiftCardActivityType": { + "type": "string", + "enum": [ + "ACTIVATE", + "LOAD", + "REDEEM", + "CLEAR_BALANCE", + "DEACTIVATE", + "ADJUST_INCREMENT", + "ADJUST_DECREMENT", + "REFUND", + "UNLINKED_ACTIVITY_REFUND", + "IMPORT", + "BLOCK", + "UNBLOCK", + "IMPORT_REVERSAL", + "TRANSFER_BALANCE_FROM", + "TRANSFER_BALANCE_TO" + ], + "x-enum-elements": [ + { + "name": "ACTIVATE", + "description": "Activated a gift card with a balance. When a gift card is activated, Square changes \nthe gift card state from `PENDING` to `ACTIVE`. A gift card must be in the `ACTIVE` state \nto be used for other balance-changing activities." + }, + { + "name": "LOAD", + "description": "Loaded a gift card with additional funds." + }, + { + "name": "REDEEM", + "description": "Redeemed a gift card for a purchase." + }, + { + "name": "CLEAR_BALANCE", + "description": "Set the balance of a gift card to zero." + }, + { + "name": "DEACTIVATE", + "description": "Permanently blocked a gift card from balance-changing activities." + }, + { + "name": "ADJUST_INCREMENT", + "description": "Added money to a gift card outside of a typical `ACTIVATE`, `LOAD`, or `REFUND` activity flow." + }, + { + "name": "ADJUST_DECREMENT", + "description": "Deducted money from a gift card outside of a typical `REDEEM` activity flow." + }, + { + "name": "REFUND", + "description": "Added money to a gift card from a refunded transaction. A `REFUND` activity might be linked to \na Square payment, depending on how the payment and refund are processed. For example:\n- A payment processed by Square can be refunded to a `PENDING` or `ACTIVE` gift card using the Square\nSeller Dashboard, Square Point of Sale, or Refunds API.\n- A payment processed using a custom processing system can be refunded to the same gift card." + }, + { + "name": "UNLINKED_ACTIVITY_REFUND", + "description": "Added money to a gift card from a refunded transaction that was processed using a custom payment\nprocessing system and not linked to the gift card." + }, + { + "name": "IMPORT", + "description": "Imported a third-party gift card with a balance. `IMPORT` activities are managed \nby Square and cannot be created using the Gift Card Activities API." + }, + { + "name": "BLOCK", + "description": "Temporarily blocked a gift card from balance-changing activities. `BLOCK` activities \nare managed by Square and cannot be created using the Gift Card Activities API." + }, + { + "name": "UNBLOCK", + "description": "Unblocked a gift card, which enables it to resume balance-changing activities. `UNBLOCK` \nactivities are managed by Square and cannot be created using the Gift Card Activities API." + }, + { + "name": "IMPORT_REVERSAL", + "description": "Reversed the import of a third-party gift card, which sets the gift card state to \n`PENDING` and clears the balance. `IMPORT_REVERSAL` activities are managed by Square and \ncannot be created using the Gift Card Activities API." + }, + { + "name": "TRANSFER_BALANCE_FROM", + "description": "Deducted money from a gift card as the result of a transfer to the balance of another gift card.\n`TRANSFER_BALANCE_FROM` activities are managed by Square and cannot be created using the Gift Card Activities API." + }, + { + "name": "TRANSFER_BALANCE_TO", + "description": "Added money to a gift card as the result of a transfer from the balance of another gift card.\n`TRANSFER_BALANCE_TO` activities are managed by Square and cannot be created using the Gift Card Activities API." + } + ], + "description": "Indicates the type of [gift card activity](entity:GiftCardActivity).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityUnblock": { + "type": "object", + "description": "Represents details about an `UNBLOCK` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "reason" + ], + "properties": { + "reason": { + "$ref": "#/components/schemas/GiftCardActivityUnblockReason", + "description": "The reason the gift card was unblocked.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityUnblockReason": { + "type": "string", + "enum": [ + "CHARGEBACK_UNBLOCK" + ], + "x-enum-elements": [ + { + "name": "CHARGEBACK_UNBLOCK", + "description": "The gift card is unblocked because a chargeback was ruled in favor of the seller." + } + ], + "description": "Indicates the reason for unblocking a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityUnlinkedActivityRefund": { + "type": "object", + "description": "Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "amount_money" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card for the refund. This value is a positive integer." + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID that associates the gift card activity with an entity in another system.", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The ID of the refunded payment. This field is not used starting in Square version 2022-06-16.", + "readOnly": true + } + } + }, + "GiftCardActivityUpdatedEvent": { + "type": "object", + "description": "Published when a [gift card activity](entity:GiftCardActivity) is updated. \nSubscribe to this event to be notified about the following changes:\n- An update to the `REDEEM` activity for a gift card redemption made from a Square product (such as Square Point of Sale). \nThese redemptions are initially assigned a `PENDING` state, but then change to a `COMPLETED` or `CANCELED` state.\n- An update to the `IMPORT` activity for an imported gift card when the balance is later adjusted by Square.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `gift_card.activity.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardActivityUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T03:41:35.157Z", + "data": { + "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", + "object": { + "gift_card_activity": { + "created_at": "2020-12-17T01:41:35.157Z", + "gift_card_balance_money": { + "amount": 1500, + "currency": "USD" + }, + "gift_card_gan": "7783320007480908", + "gift_card_id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", + "import_activity_details": { + "amount_money": { + "amount": 1500, + "currency": "USD" + } + }, + "location_id": "81FN9BNFZTKS4", + "type": "IMPORT" + } + }, + "type": "gift_card_activity" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.activity.updated" + }, + "x-webhook": { + "event": "gift_card.activity.updated", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCardActivities", + "x-since": "2022-06-16" + }, + "GiftCardActivityUpdatedEventData": { + "type": "object", + "description": "The data associated with a `gift_card.activity.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card_activity`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the updated gift card activity." + }, + "object": { + "$ref": "#/components/schemas/GiftCardActivityUpdatedEventObject", + "description": "An object that contains the updated gift card activity.", + "nullable": true + } + } + }, + "GiftCardActivityUpdatedEventObject": { + "type": "object", + "description": "An object that contains the gift card activity associated with a \n`gift_card.activity.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card_activity": { + "$ref": "#/components/schemas/GiftCardActivity", + "description": "The updated gift card activity.", + "nullable": true + } + } + }, + "GiftCardCreatedEvent": { + "type": "object", + "description": "Published when a [gift card](entity:GiftCard) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `gift_card.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T01:41:35.157Z", + "data": { + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "object": { + "gift_card": { + "balance_money": { + "amount": 0, + "currency": "USD" + }, + "created_at": "2020-12-17T01:41:35.157Z", + "gan": "7783320007480908", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "NOT_ACTIVE", + "type": "DIGITAL" + } + }, + "type": "gift_card" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.created" + }, + "x-webhook": { + "event": "gift_card.created", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCards", + "x-since": "2021-06-16" + }, + "GiftCardCreatedEventData": { + "type": "object", + "description": "The data associated with a `gift_card.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the new gift card." + }, + "object": { + "$ref": "#/components/schemas/GiftCardCreatedEventObject", + "description": "An object that contains the new gift card.", + "nullable": true + } + } + }, + "GiftCardCreatedEventObject": { + "type": "object", + "description": "An object that contains the gift card associated with a `gift_card.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The new gift card.", + "nullable": true + } + } + }, + "GiftCardCustomerLinkedEvent": { + "type": "object", + "description": "Published when a [customer](entity:Customer) is linked to a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `gift_card.customer_linked`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardCustomerLinkedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T03:41:35.157Z", + "data": { + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "object": { + "gift_card": { + "balance_money": { + "amount": 1500, + "currency": "USD" + }, + "created_at": "2020-12-17T01:41:35.157Z", + "customer_ids": [ + "QPTXM8PQNX3Q726ZYHPMNP46XC" + ], + "gan": "7783320007480908", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "ACTIVE", + "type": "DIGITAL" + }, + "linked_customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC" + }, + "type": "gift_card" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.customer_linked" + }, + "x-webhook": { + "event": "gift_card.customer_linked", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCards", + "x-since": "2021-06-16" + }, + "GiftCardCustomerLinkedEventData": { + "type": "object", + "description": "The data associated with a `gift_card.customer_linked` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the updated gift card." + }, + "object": { + "$ref": "#/components/schemas/GiftCardCustomerLinkedEventObject", + "description": "An object that contains the updated gift card and the ID of the linked customer.", + "nullable": true + } + } + }, + "GiftCardCustomerLinkedEventObject": { + "type": "object", + "description": "An object that contains the gift card and customer ID associated with a \n`gift_card.customer_linked` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card with the updated `customer_ids` field.", + "nullable": true + }, + "linked_customer_id": { + "type": "string", + "description": "The ID of the linked [customer](entity:Customer).", + "nullable": true + } + } + }, + "GiftCardCustomerUnlinkedEvent": { + "type": "object", + "description": "Published when a [customer](entity:Customer) is unlinked from a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `gift_card.customer_unlinked`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardCustomerUnlinkedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T03:41:35.157Z", + "data": { + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "object": { + "gift_card": { + "balance_money": { + "amount": 1500, + "currency": "USD" + }, + "created_at": "2020-12-17T01:41:35.157Z", + "gan": "7783320007480908", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "ACTIVE", + "type": "DIGITAL" + }, + "unlinked_customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC" + }, + "type": "gift_card" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.customer_unlinked" + }, + "x-webhook": { + "event": "gift_card.customer_unlinked", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCards", + "x-since": "2021-06-16" + }, + "GiftCardCustomerUnlinkedEventData": { + "type": "object", + "description": "The data associated with a `gift_card.customer_unlinked` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the updated gift card." + }, + "object": { + "$ref": "#/components/schemas/GiftCardCustomerUnlinkedEventObject", + "description": "An object that contains the updated gift card and the ID of the unlinked customer.", + "nullable": true + } + } + }, + "GiftCardCustomerUnlinkedEventObject": { + "type": "object", + "description": "An object that contains the gift card and the customer ID associated with a \n`gift_card.customer_linked` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card with the updated `customer_ids` field. \nThe field is removed if the gift card is not linked to any customers.", + "nullable": true + }, + "unlinked_customer_id": { + "type": "string", + "description": "The ID of the unlinked [customer](entity:Customer).", + "nullable": true + } + } + }, + "GiftCardGANSource": { + "type": "string", + "enum": [ + "SQUARE", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "SQUARE", + "description": "The GAN is generated by Square." + }, + { + "name": "OTHER", + "description": "The GAN is provided by a non-Square system. For more information, see \n[Custom GANs](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#custom-gans) or \n[Third-party gift cards](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#third-party-gift-cards)." + } + ], + "description": "Indicates the source that generated the gift card \naccount number (GAN).", + "x-release-status": "PUBLIC" + }, + "GiftCardStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "DEACTIVATED", + "BLOCKED", + "PENDING" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "The gift card is active and can be used as a payment source." + }, + { + "name": "DEACTIVATED", + "description": "Any activity that changes the gift card balance is permanently forbidden." + }, + { + "name": "BLOCKED", + "description": "Any activity that changes the gift card balance is temporarily forbidden." + }, + { + "name": "PENDING", + "description": "The gift card is pending activation.\nThis is the initial state when a gift card is created. Typically, you'll call\n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) to create an\n`ACTIVATE` activity that activates the gift card with an initial balance before first use." + } + ], + "description": "Indicates the gift card state.", + "x-release-status": "PUBLIC" + }, + "GiftCardType": { + "type": "string", + "enum": [ + "PHYSICAL", + "DIGITAL" + ], + "x-enum-elements": [ + { + "name": "PHYSICAL", + "description": "A plastic gift card." + }, + { + "name": "DIGITAL", + "description": "A digital gift card." + } + ], + "description": "Indicates the gift card type.", + "x-release-status": "PUBLIC" + }, + "GiftCardUpdatedEvent": { + "type": "object", + "description": "Published when a [gift card](entity:GiftCard) is updated. This includes\nchanges to the state, balance, and customer association.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. For this event, the value is `gift_card.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T02:41:35.157Z", + "data": { + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "object": { + "gift_card": { + "balance_money": { + "amount": 3000, + "currency": "USD" + }, + "created_at": "2020-12-17T01:41:35.157Z", + "gan": "7783320007480908", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "ACTIVE", + "type": "DIGITAL" + } + }, + "type": "gift_card" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.updated" + }, + "x-webhook": { + "event": "gift_card.updated", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCards", + "x-since": "2021-06-16" + }, + "GiftCardUpdatedEventData": { + "type": "object", + "description": "The data associated with a `gift_card.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the updated gift card." + }, + "object": { + "$ref": "#/components/schemas/GiftCardUpdatedEventObject", + "description": "An object that contains the updated gift card.", + "nullable": true + } + } + }, + "GiftCardUpdatedEventObject": { + "type": "object", + "description": "An object that contains the gift card associated with a `gift_card.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card with the updated `balance_money`, `state`, or `customer_ids` field. \nSome events can affect both `balance_money` and `state`.", + "nullable": true + } + } + }, + "InventoryAdjustment": { + "type": "object", + "description": "Represents a change in state or quantity of product inventory at a\nparticular time and location.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique ID generated by Square for the\n`InventoryAdjustment`.", + "maxLength": 100 + }, + "reference_id": { + "type": "string", + "description": "An optional ID provided by the application to tie the\n`InventoryAdjustment` to an external\nsystem.", + "maxLength": 255, + "nullable": true + }, + "from_state": { + "$ref": "#/components/schemas/InventoryState", + "description": "The [inventory state](entity:InventoryState) of the related quantity\nof items before the adjustment.\nSee [InventoryState](#type-inventorystate) for possible values", + "nullable": true + }, + "to_state": { + "$ref": "#/components/schemas/InventoryState", + "description": "The [inventory state](entity:InventoryState) of the related quantity\nof items after the adjustment.\nSee [InventoryState](#type-inventorystate) for possible values", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The Square-generated ID of the [Location](entity:Location) where the related\nquantity of items is being tracked.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The Square-generated ID of the\n[CatalogObject](entity:CatalogObject) being tracked.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_type": { + "type": "string", + "description": "The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. \n\nThe Inventory API supports setting and reading the `\"catalog_object_type\": \"ITEM_VARIATION\"` field value. \nIn addition, it can also read the `\"catalog_object_type\": \"ITEM\"` field value that is set by the Square Restaurants app.", + "maxLength": 14, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The number of items affected by the adjustment as a decimal string.\nCan support up to 5 digits after the decimal point.", + "maxLength": 26, + "nullable": true + }, + "total_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The total price paid for goods associated with the\nadjustment. Present if and only if `to_state` is `SOLD`. Always\nnon-negative.", + "readOnly": true + }, + "occurred_at": { + "type": "string", + "description": "A client-generated RFC 3339-formatted timestamp that indicates when\nthe inventory adjustment took place. For inventory adjustment updates, the `occurred_at`\ntimestamp cannot be older than 24 hours or in the future relative to the\ntime of the request.", + "maxLength": 34, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received.", + "maxLength": 34, + "readOnly": true + }, + "source": { + "$ref": "#/components/schemas/SourceApplication", + "description": "Information about the application that caused the\ninventory adjustment.", + "readOnly": true + }, + "employee_id": { + "type": "string", + "description": "The Square-generated ID of the [Employee](entity:Employee) responsible for the\ninventory adjustment.", + "maxLength": 100, + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the\ninventory adjustment.", + "maxLength": 100, + "nullable": true + }, + "transaction_id": { + "type": "string", + "description": "The Square-generated ID of the [Transaction](entity:Transaction) that\ncaused the adjustment. Only relevant for payment-related state\ntransitions.", + "maxLength": 255, + "readOnly": true + }, + "refund_id": { + "type": "string", + "description": "The Square-generated ID of the [Refund](entity:Refund) that\ncaused the adjustment. Only relevant for refund-related state\ntransitions.", + "maxLength": 255, + "readOnly": true + }, + "purchase_order_id": { + "type": "string", + "description": "The Square-generated ID of the purchase order that caused the\nadjustment. Only relevant for state transitions from the Square for Retail\napp.", + "maxLength": 100, + "readOnly": true + }, + "goods_receipt_id": { + "type": "string", + "description": "The Square-generated ID of the goods receipt that caused the\nadjustment. Only relevant for state transitions from the Square for Retail\napp.", + "maxLength": 100, + "readOnly": true + }, + "adjustment_group": { + "$ref": "#/components/schemas/InventoryAdjustmentGroup", + "description": "An adjustment group bundling the related adjustments of item variations through stock conversions in a single inventory event.", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "InventoryAdjustmentGroup": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "A unique ID generated by Square for the\n`InventoryAdjustmentGroup`.", + "maxLength": 100, + "readOnly": true + }, + "root_adjustment_id": { + "type": "string", + "description": "The inventory adjustment of the composed variation.", + "maxLength": 100, + "readOnly": true + }, + "from_state": { + "$ref": "#/components/schemas/InventoryState", + "description": "Representative `from_state` for adjustments within the group. For example, for a group adjustment from `IN_STOCK` to `SOLD`,\nthere can be two component adjustments in the group: one from `IN_STOCK`to `COMPOSED` and the other one from `COMPOSED` to `SOLD`.\nHere, the representative `from_state` for the `InventoryAdjustmentGroup` is `IN_STOCK`.\nSee [InventoryState](#type-inventorystate) for possible values", + "readOnly": true + }, + "to_state": { + "$ref": "#/components/schemas/InventoryState", + "description": "Representative `to_state` for adjustments within group. For example, for a group adjustment from `IN_STOCK` to `SOLD`,\nthe two component adjustments in the group can be from `IN_STOCK` to `COMPOSED` and from `COMPOSED` to `SOLD`.\nHere, the representative `to_state` of the `InventoryAdjustmentGroup` is `SOLD`.\nSee [InventoryState](#type-inventorystate) for possible values", + "readOnly": true + } + } + }, + "InventoryAlertType": { + "type": "string", + "enum": [ + "NONE", + "LOW_QUANTITY" + ], + "x-enum-elements": [ + { + "name": "NONE", + "description": "The variation does not display an alert." + }, + { + "name": "LOW_QUANTITY", + "description": "The variation generates an alert when its quantity is low." + } + ], + "description": "Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low.", + "x-release-status": "PUBLIC" + }, + "InventoryChange": { + "type": "object", + "description": "Represents a single physical count, inventory, adjustment, or transfer\nthat is part of the history of inventory changes for a particular\n[CatalogObject](entity:CatalogObject) instance.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "$ref": "#/components/schemas/InventoryChangeType", + "description": "Indicates how the inventory change is applied. See\n[InventoryChangeType](entity:InventoryChangeType) for all possible values.\nSee [InventoryChangeType](#type-inventorychangetype) for possible values", + "nullable": true + }, + "physical_count": { + "$ref": "#/components/schemas/InventoryPhysicalCount", + "description": "Contains details about the physical count when `type` is\n`PHYSICAL_COUNT`, and is unset for all other change types.", + "nullable": true + }, + "adjustment": { + "$ref": "#/components/schemas/InventoryAdjustment", + "description": "Contains details about the inventory adjustment when `type` is\n`ADJUSTMENT`, and is unset for all other change types.", + "nullable": true + }, + "transfer": { + "$ref": "#/components/schemas/InventoryTransfer", + "description": "Contains details about the inventory transfer when `type` is\n`TRANSFER`, and is unset for all other change types.\n\n_Note:_ An [InventoryTransfer](entity:InventoryTransfer) object can only be set in the input to the\n[BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) endpoint when the seller has an active Retail Plus subscription.", + "nullable": true + }, + "measurement_unit": { + "$ref": "#/components/schemas/CatalogMeasurementUnit", + "description": "The [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change.", + "readOnly": true + }, + "measurement_unit_id": { + "type": "string", + "description": "The ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change.", + "readOnly": true + } + } + }, + "InventoryChangeType": { + "type": "string", + "enum": [ + "PHYSICAL_COUNT", + "ADJUSTMENT", + "TRANSFER" + ], + "x-enum-elements": [ + { + "name": "PHYSICAL_COUNT", + "description": "The change occurred as part of a physical count update." + }, + { + "name": "ADJUSTMENT", + "description": "The change occurred as part of the normal lifecycle of goods\n(e.g., as an inventory adjustment)." + }, + { + "name": "TRANSFER", + "description": "The change occurred as part of an inventory transfer." + } + ], + "description": "Indicates how the inventory change was applied to a tracked product quantity.", + "x-release-status": "PUBLIC" + }, + "InventoryCount": { + "type": "object", + "description": "Represents Square-estimated quantity of items in a particular state at a\nparticular seller location based on the known history of physical counts and\ninventory adjustments.", + "x-release-status": "PUBLIC", + "properties": { + "catalog_object_id": { + "type": "string", + "description": "The Square-generated ID of the\n[CatalogObject](entity:CatalogObject) being tracked.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_type": { + "type": "string", + "description": "The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. \n\nThe Inventory API supports setting and reading the `\"catalog_object_type\": \"ITEM_VARIATION\"` field value. \nIn addition, it can also read the `\"catalog_object_type\": \"ITEM\"` field value that is set by the Square Restaurants app.", + "maxLength": 14, + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/InventoryState", + "description": "The current [inventory state](entity:InventoryState) for the related\nquantity of items.\nSee [InventoryState](#type-inventorystate) for possible values", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The Square-generated ID of the [Location](entity:Location) where the related\nquantity of items is being tracked.", + "maxLength": 100, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The number of items affected by the estimated count as a decimal string.\nCan support up to 5 digits after the decimal point.", + "maxLength": 26, + "nullable": true + }, + "calculated_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when the most recent physical count or adjustment affecting\nthe estimated count is received.", + "maxLength": 34, + "readOnly": true + }, + "is_estimated": { + "type": "boolean", + "description": "Whether the inventory count is for composed variation (TRUE) or not (FALSE). If true, the inventory count will not be present in the response of\nany of these endpoints: [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory),\n[BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges),\n[BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts), and\n[RetrieveInventoryChanges](api-endpoint:Inventory-RetrieveInventoryChanges).", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "InventoryCountUpdatedEvent": { + "type": "object", + "description": "Published when the quantity is updated for a\n[CatalogItemVariation](entity:CatalogItemVariation).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InventoryCountUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T18:38:45.455006797Z", + "data": { + "id": "84e4ac73-d605-4dbd-a9e5-ffff794ddb9d", + "object": { + "inventory_counts": [ + { + "calculated_at": "2019-10-29T18:38:45.10296Z", + "catalog_object_id": "FGQ5JJWT2PYTHF35CKZ2DSKP", + "catalog_object_type": "ITEM_VARIATION", + "location_id": "YYQR03DGCTXA4", + "quantity": "10", + "state": "IN_STOCK" + } + ] + }, + "type": "inventory_counts" + }, + "event_id": "df5f3813-a913-45a1-94e9-fdc3f7d5e3b6", + "merchant_id": "6SSW7HV8K2ST5", + "type": "inventory.count.updated" + }, + "x-webhook": { + "event": "inventory.count.updated", + "scopes": [ + "INVENTORY_READ" + ] + }, + "x-api": "#/components/x-apis/Inventory", + "x-since": "2019-06-12" + }, + "InventoryCountUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type. For this event, the value is `inventory_counts`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected object." + }, + "object": { + "$ref": "#/components/schemas/InventoryCountUpdatedEventObject", + "description": "An object containing fields and values relevant to the event. Is absent if affected object was deleted.", + "nullable": true + } + } + }, + "InventoryCountUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "inventory_counts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryCount" + }, + "description": "The inventory counts.", + "nullable": true + } + } + }, + "InventoryPhysicalCount": { + "type": "object", + "description": "Represents the quantity of an item variation that is physically present\nat a specific location, verified by a seller or a seller's employee. For example,\na physical count might come from an employee counting the item variations on\nhand or from syncing with an external system.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique Square-generated ID for the\n[InventoryPhysicalCount](entity:InventoryPhysicalCount).", + "maxLength": 100 + }, + "reference_id": { + "type": "string", + "description": "An optional ID provided by the application to tie the\n[InventoryPhysicalCount](entity:InventoryPhysicalCount) to an external\nsystem.", + "maxLength": 255, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The Square-generated ID of the\n[CatalogObject](entity:CatalogObject) being tracked.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_type": { + "type": "string", + "description": "The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. \n\nThe Inventory API supports setting and reading the `\"catalog_object_type\": \"ITEM_VARIATION\"` field value. \nIn addition, it can also read the `\"catalog_object_type\": \"ITEM\"` field value that is set by the Square Restaurants app.", + "maxLength": 14, + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/InventoryState", + "description": "The current [inventory state](entity:InventoryState) for the related\nquantity of items.\nSee [InventoryState](#type-inventorystate) for possible values", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The Square-generated ID of the [Location](entity:Location) where the related\nquantity of items is being tracked.", + "maxLength": 100, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The number of items affected by the physical count as a decimal string.\nThe number can support up to 5 digits after the decimal point.", + "maxLength": 26, + "nullable": true + }, + "source": { + "$ref": "#/components/schemas/SourceApplication", + "description": "Information about the application with which the\nphysical count is submitted.", + "readOnly": true + }, + "employee_id": { + "type": "string", + "description": "The Square-generated ID of the [Employee](entity:Employee) responsible for the\nphysical count.", + "maxLength": 100, + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the\nphysical count.", + "maxLength": 100, + "nullable": true + }, + "occurred_at": { + "type": "string", + "description": "A client-generated RFC 3339-formatted timestamp that indicates when\nthe physical count was examined. For physical count updates, the `occurred_at`\ntimestamp cannot be older than 24 hours or in the future relative to the\ntime of the request.", + "maxLength": 34, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when the physical count is received.", + "maxLength": 34, + "readOnly": true + } + } + }, + "InventoryState": { + "type": "string", + "enum": [ + "CUSTOM", + "IN_STOCK", + "SOLD", + "RETURNED_BY_CUSTOMER", + "RESERVED_FOR_SALE", + "SOLD_ONLINE", + "ORDERED_FROM_VENDOR", + "RECEIVED_FROM_VENDOR", + "IN_TRANSIT_TO", + "NONE", + "WASTE", + "UNLINKED_RETURN", + "COMPOSED", + "DECOMPOSED", + "SUPPORTED_BY_NEWER_VERSION", + "IN_TRANSIT" + ], + "x-enum-elements": [ + { + "name": "CUSTOM", + "description": "The related quantity of items are in a custom state. **READ-ONLY**:\nthe Inventory API cannot move quantities to or from this state." + }, + { + "name": "IN_STOCK", + "description": "The related quantity of items are on hand and available for sale." + }, + { + "name": "SOLD", + "description": "The related quantity of items were sold as part of an itemized\ntransaction. Quantities in the `SOLD` state are no longer tracked." + }, + { + "name": "RETURNED_BY_CUSTOMER", + "description": "The related quantity of items were returned through the Square Point\nof Sale application, but are not yet available for sale. **READ-ONLY**:\nthe Inventory API cannot move quantities to or from this state." + }, + { + "name": "RESERVED_FOR_SALE", + "description": "The related quantity of items are on hand, but not currently\navailable for sale. **READ-ONLY**: the Inventory API cannot move\nquantities to or from this state." + }, + { + "name": "SOLD_ONLINE", + "description": "The related quantity of items were sold online. **READ-ONLY**: the\nInventory API cannot move quantities to or from this state." + }, + { + "name": "ORDERED_FROM_VENDOR", + "description": "The related quantity of items were ordered from a vendor but not yet\nreceived. **READ-ONLY**: the Inventory API cannot move quantities to or\nfrom this state." + }, + { + "name": "RECEIVED_FROM_VENDOR", + "description": "The related quantity of items were received from a vendor but are\nnot yet available for sale. **READ-ONLY**: the Inventory API cannot move\nquantities to or from this state." + }, + { + "name": "IN_TRANSIT_TO", + "description": "Replaced by `IN_TRANSIT` to represent quantities\nof items that are in transit between locations." + }, + { + "name": "NONE", + "description": "A placeholder indicating that the related quantity of items are not\ncurrently tracked in Square. Transferring quantities from the `NONE` state\nto a tracked state (e.g., `IN_STOCK`) introduces stock into the system." + }, + { + "name": "WASTE", + "description": "The related quantity of items are lost or damaged and cannot be\nsold." + }, + { + "name": "UNLINKED_RETURN", + "description": "The related quantity of items were returned but not linked to a\nprevious transaction. Unlinked returns are not tracked in Square.\nTransferring a quantity from `UNLINKED_RETURN` to a tracked state (e.g.,\n`IN_STOCK`) introduces new stock into the system." + }, + { + "name": "COMPOSED", + "description": "The related quantity of items that are part of a composition consisting one or more components." + }, + { + "name": "DECOMPOSED", + "description": "The related quantity of items that are part of a component." + }, + { + "name": "SUPPORTED_BY_NEWER_VERSION", + "description": "This state is not supported by this version of the Square API. We recommend that you upgrade the client to use the appropriate version of the Square API supporting this state." + }, + { + "name": "IN_TRANSIT", + "description": "The related quantity of items are in transit between locations. **READ-ONLY:** the Inventory API cannot currently be used to move quantities to or from this inventory state." + } + ], + "description": "Indicates the state of a tracked item quantity in the lifecycle of goods.", + "x-release-status": "PUBLIC" + }, + "InventoryTransfer": { + "type": "object", + "description": "Represents the transfer of a quantity of product inventory at a\nparticular time from one location to another.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique ID generated by Square for the\n`InventoryTransfer`.", + "maxLength": 100 + }, + "reference_id": { + "type": "string", + "description": "An optional ID provided by the application to tie the\n`InventoryTransfer` to an external system.", + "maxLength": 255, + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/InventoryState", + "description": "The [inventory state](entity:InventoryState) for the quantity of\nitems being transferred.\nSee [InventoryState](#type-inventorystate) for possible values", + "nullable": true + }, + "from_location_id": { + "type": "string", + "description": "The Square-generated ID of the [Location](entity:Location) where the related\nquantity of items was tracked before the transfer.", + "maxLength": 100, + "nullable": true + }, + "to_location_id": { + "type": "string", + "description": "The Square-generated ID of the [Location](entity:Location) where the related\nquantity of items was tracked after the transfer.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The Square-generated ID of the\n[CatalogObject](entity:CatalogObject) being tracked.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_type": { + "type": "string", + "description": "The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. \n\nThe Inventory API supports setting and reading the `\"catalog_object_type\": \"ITEM_VARIATION\"` field value. \nIn addition, it can also read the `\"catalog_object_type\": \"ITEM\"` field value that is set by the Square Restaurants app.", + "maxLength": 14, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The number of items affected by the transfer as a decimal string.\nCan support up to 5 digits after the decimal point.", + "maxLength": 26, + "nullable": true + }, + "occurred_at": { + "type": "string", + "description": "A client-generated RFC 3339-formatted timestamp that indicates when\nthe transfer took place. For write actions, the `occurred_at` timestamp\ncannot be older than 24 hours or in the future relative to the time of the\nrequest.", + "maxLength": 34, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when Square\nreceived the transfer request.", + "maxLength": 34, + "readOnly": true + }, + "source": { + "$ref": "#/components/schemas/SourceApplication", + "description": "Information about the application that initiated the\ninventory transfer.", + "readOnly": true + }, + "employee_id": { + "type": "string", + "description": "The Square-generated ID of the [Employee](entity:Employee) responsible for the\ninventory transfer.", + "maxLength": 100, + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the\ninventory transfer.", + "maxLength": 100, + "nullable": true + } + } + }, + "Invoice": { + "type": "object", + "description": "Stores information about an invoice. You use the Invoices API to create and manage\ninvoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the invoice.", + "readOnly": true + }, + "version": { + "type": "integer", + "description": "The Square-assigned version number, which is incremented each time an update is committed to the invoice." + }, + "location_id": { + "type": "string", + "description": "The ID of the location that this invoice is associated with. \n\nIf specified in a `CreateInvoice` request, the value must match the `location_id` of the associated order.", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) for which the invoice is created. \nThis field is required when creating an invoice, and the order must be in the `OPEN` state.\n\nTo view the line items and other information for the associated order, call the \n[RetrieveOrder](api-endpoint:Orders-RetrieveOrder) endpoint using the order ID.", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "primary_recipient": { + "$ref": "#/components/schemas/InvoiceRecipient", + "description": "The customer who receives the invoice. This customer data is displayed on the invoice and used by Square to deliver the invoice. \n\nThis field is required to publish an invoice, and it must specify the `customer_id`.", + "nullable": true + }, + "payment_requests": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InvoicePaymentRequest" + }, + "description": "The payment schedule for the invoice, represented by one or more payment requests that\ndefine payment settings, such as amount due and due date. An invoice supports the following payment request combinations:\n- One balance\n- One deposit with one balance\n- 2–12 installments \n- One deposit with 2–12 installments\n\nThis field is required when creating an invoice. It must contain at least one payment request. \nAll payment requests for the invoice must equal the total order amount. For more information, see \n[Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests).\n\nAdding `INSTALLMENT` payment requests to an invoice requires an \n[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription).", + "nullable": true + }, + "delivery_method": { + "$ref": "#/components/schemas/InvoiceDeliveryMethod", + "description": "The delivery method that Square uses to send the invoice, reminders, and receipts to\nthe customer. After the invoice is published, Square processes the invoice based on the delivery\nmethod and payment request settings, either immediately or on the `scheduled_at` date, if specified.\nFor example, Square might send the invoice or receipt for an automatic payment. For invoices with\nautomatic payments, this field must be set to `EMAIL`.\n\nOne of the following is required when creating an invoice:\n- (Recommended) This `delivery_method` field. To configure an automatic payment, the\n`automatic_payment_source` field of the payment request is also required.\n- The deprecated `request_method` field of the payment request. Note that `invoice`\nobjects returned in responses do not include `request_method`.\nSee [InvoiceDeliveryMethod](#type-invoicedeliverymethod) for possible values", + "nullable": true + }, + "invoice_number": { + "type": "string", + "description": "A user-friendly invoice number that is displayed on the invoice. The value is unique within a location.\nIf not provided when creating an invoice, Square assigns a value.\nIt increments from 1 and is padded with zeros making it 7 characters long\n(for example, 0000001 and 0000002).", + "minLength": 1, + "maxLength": 191, + "nullable": true + }, + "title": { + "type": "string", + "description": "The title of the invoice, which is displayed on the invoice.", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "description": { + "type": "string", + "description": "The description of the invoice, which is displayed on the invoice.", + "minLength": 1, + "maxLength": 65536, + "nullable": true + }, + "scheduled_at": { + "type": "string", + "description": "The timestamp when the invoice is scheduled for processing, in RFC 3339 format.\nAfter the invoice is published, Square processes the invoice on the specified date,\naccording to the delivery method and payment request settings.\n\nIf the field is not set, Square processes the invoice immediately after it is published.", + "nullable": true + }, + "public_url": { + "type": "string", + "description": "A temporary link to the Square-hosted payment page where the customer can pay the\ninvoice. If the link expires, customers can provide the email address or phone number\nassociated with the invoice and request a new link directly from the expired payment page. \n\nThis field is added after the invoice is published and reaches the scheduled date\n(if one is defined).", + "readOnly": true + }, + "next_payment_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The current amount due for the invoice. In addition to the\namount due on the next payment request, this includes any overdue payment amounts.", + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/InvoiceStatus", + "description": "The status of the invoice.\nSee [InvoiceStatus](#type-invoicestatus) for possible values", + "readOnly": true + }, + "timezone": { + "type": "string", + "description": "The time zone used to interpret calendar dates on the invoice, such as `due_date`.\nWhen an invoice is created, this field is set to the `timezone` specified for the seller\nlocation. The value cannot be changed.\n\nFor example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\\_Angeles\nbecomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC timestamp\nof 2021-03-10T08:00:00Z).", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the invoice was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the invoice was last updated, in RFC 3339 format.", + "readOnly": true + }, + "accepted_payment_methods": { + "$ref": "#/components/schemas/InvoiceAcceptedPaymentMethods", + "description": "The payment methods that customers can use to pay the invoice on the Square-hosted\ninvoice page. This setting is independent of any automatic payment requests for the invoice.\n\nThis field is required when creating an invoice and must set at least one payment method to `true`.", + "nullable": true + }, + "custom_fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InvoiceCustomField" + }, + "description": "Additional seller-defined fields that are displayed on the invoice. For more information, see\n[Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields).\n\nAdding custom fields to an invoice requires an \n[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription).\n\nMax: 2 custom fields", + "nullable": true + }, + "subscription_id": { + "type": "string", + "description": "The ID of the [subscription](entity:Subscription) associated with the invoice.\nThis field is present only on subscription billing invoices.", + "readOnly": true + }, + "sale_or_service_date": { + "type": "string", + "description": "The date of the sale or the date that the service is rendered, in `YYYY-MM-DD` format.\nThis field can be used to specify a past or future date which is displayed on the invoice.", + "nullable": true + }, + "payment_conditions": { + "type": "string", + "description": "**France only.** The payment terms and conditions that are displayed on the invoice. For more information, \nsee [Payment conditions](https://developer.squareup.com/docs/invoices-api/overview#payment-conditions).\n\nFor countries other than France, Square returns an `INVALID_REQUEST_ERROR` with a `BAD_REQUEST` code and \n\"Payment conditions are not supported for this location's country\" detail if this field is included in `CreateInvoice` or `UpdateInvoice` requests.", + "minLength": 1, + "maxLength": 2000, + "nullable": true + }, + "store_payment_method_enabled": { + "type": "boolean", + "description": "Indicates whether to allow a customer to save a credit or debit card as a card on file or a bank transfer as a\nbank account on file. If `true`, Square displays a __Save my card on file__ or __Save my bank on file__ checkbox on the\ninvoice payment page. Stored payment information can be used for future automatic payments. The default value is `false`.", + "nullable": true + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InvoiceAttachment" + }, + "description": "Metadata about the attachments on the invoice. Invoice attachments are managed using the\n[CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) and [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) endpoints.", + "readOnly": true + }, + "creator_team_member_id": { + "type": "string", + "description": "The ID of the [team member](entity:TeamMember) who created the invoice.\nThis field is present only on invoices created in the Square Dashboard or Square Invoices app by a logged-in team member.", + "readOnly": true + } + } + }, + "InvoiceAcceptedPaymentMethods": { + "type": "object", + "description": "The payment methods that customers can use to pay an [invoice](entity:Invoice) on the Square-hosted invoice payment page.", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "type": "boolean", + "description": "Indicates whether credit card or debit card payments are accepted. The default value is `false`.", + "nullable": true + }, + "square_gift_card": { + "type": "boolean", + "description": "Indicates whether Square gift card payments are accepted. The default value is `false`.", + "nullable": true + }, + "bank_account": { + "type": "boolean", + "description": "Indicates whether ACH bank transfer payments are accepted. The default value is `false`.", + "nullable": true + }, + "buy_now_pay_later": { + "type": "boolean", + "description": "Indicates whether Afterpay (also known as Clearpay) payments are accepted. The default value is `false`.\n\nThis option is allowed only for invoices that have a single payment request of the `BALANCE` type. This payment method is\nsupported if the seller account accepts Afterpay payments and the seller location is in a country where Afterpay\ninvoice payments are supported. As a best practice, consider enabling an additional payment method when allowing\n`buy_now_pay_later` payments. For more information, including detailed requirements and processing limits, see\n[Buy Now Pay Later payments with Afterpay](https://developer.squareup.com/docs/invoices-api/overview#buy-now-pay-later).", + "nullable": true + }, + "cash_app_pay": { + "type": "boolean", + "description": "Indicates whether Cash App payments are accepted. The default value is `false`.\n\nThis payment method is supported only for seller [locations](entity:Location) in the United States.", + "nullable": true + } + } + }, + "InvoiceAttachment": { + "type": "object", + "description": "Represents a file attached to an [invoice](entity:Invoice).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the attachment.", + "readOnly": true + }, + "filename": { + "type": "string", + "description": "The file name of the attachment, which is displayed on the invoice.", + "readOnly": true + }, + "description": { + "type": "string", + "description": "The description of the attachment, which is displayed on the invoice.\nThis field maps to the seller-defined **Message** field.", + "readOnly": true + }, + "filesize": { + "type": "integer", + "description": "The file size of the attachment in bytes.", + "readOnly": true + }, + "hash": { + "type": "string", + "description": "The MD5 hash that was generated from the file contents.", + "readOnly": true + }, + "mime_type": { + "type": "string", + "description": "The mime type of the attachment.\nThe following mime types are supported: \nimage/gif, image/jpeg, image/png, image/tiff, image/bmp, application/pdf.", + "readOnly": true + }, + "uploaded_at": { + "type": "string", + "description": "The timestamp when the attachment was uploaded, in RFC 3339 format.", + "readOnly": true + } + } + }, + "InvoiceAutomaticPaymentSource": { + "type": "string", + "enum": [ + "NONE", + "CARD_ON_FILE", + "BANK_ON_FILE" + ], + "x-enum-elements": [ + { + "name": "NONE", + "description": "An automatic payment is not configured for the payment request." + }, + { + "name": "CARD_ON_FILE", + "description": "Use a card on file as the automatic payment method. On the due date, Square charges the card\nfor the amount of the payment request.\n\nFor `CARD_ON_FILE` payments, the invoice delivery method must be `EMAIL` and `card_id` must be\nspecified for the payment request before the invoice can be published." + }, + { + "name": "BANK_ON_FILE", + "description": "Use a bank account on file as the automatic payment method. On the due date, Square charges the bank\naccount for the amount of the payment request if the buyer has approved the payment. The buyer receives a\nrequest to approve the payment when the invoice is sent or the invoice is updated.\n\nThis payment method applies only to invoices that sellers create in the Seller Dashboard or other\nSquare product. The bank account is provided by the customer during the payment flow. \n\nYou cannot set `BANK_ON_FILE` as a payment method using the Invoices API, but you can change a `BANK_ON_FILE`\npayment method to `NONE` or `CARD_ON_FILE`. For `BANK_ON_FILE` payments, the invoice delivery method must be `EMAIL`." + } + ], + "description": "Indicates the automatic payment method for an [invoice payment request](entity:InvoicePaymentRequest).", + "x-release-status": "PUBLIC" + }, + "InvoiceCanceledEvent": { + "type": "object", + "description": "Published when an [Invoice](entity:Invoice) is canceled.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.canceled\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceCanceledEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "CANCELED", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 1 + } + }, + "type": "invoice" + }, + "event_id": "742ef00c-446b-4fca-b3d5-f177d816ee54", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.canceled" + }, + "x-webhook": { + "event": "invoice.canceled", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceCanceledEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoiceCanceledEventObject", + "description": "An object containing the canceled invoice.", + "nullable": true + } + } + }, + "InvoiceCanceledEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoiceCreatedEvent": { + "type": "object", + "description": "Published when an [Invoice](entity:Invoice) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T17:45:13Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T17:45:13Z", + "version": 0 + } + }, + "type": "invoice" + }, + "event_id": "012c1bfa-c239-4fc0-b16d-5809928b54fe", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.created" + }, + "x-webhook": { + "event": "invoice.created", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoiceCreatedEventObject", + "description": "An object containing the created invoice.", + "nullable": true + } + } + }, + "InvoiceCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoiceCustomField": { + "type": "object", + "description": "An additional seller-defined and customer-facing field to include on the invoice. For more information, \nsee [Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields).\n\nAdding custom fields to an invoice requires an \n[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription).", + "x-release-status": "PUBLIC", + "properties": { + "label": { + "type": "string", + "description": "The label or title of the custom field. This field is required for a custom field.", + "maxLength": 30, + "nullable": true + }, + "value": { + "type": "string", + "description": "The text of the custom field. If omitted, only the label is rendered.", + "maxLength": 2000, + "nullable": true + }, + "placement": { + "$ref": "#/components/schemas/InvoiceCustomFieldPlacement", + "description": "The location of the custom field on the invoice. This field is required for a custom field.\nSee [InvoiceCustomFieldPlacement](#type-invoicecustomfieldplacement) for possible values", + "nullable": true + } + } + }, + "InvoiceCustomFieldPlacement": { + "type": "string", + "enum": [ + "ABOVE_LINE_ITEMS", + "BELOW_LINE_ITEMS" + ], + "x-enum-elements": [ + { + "name": "ABOVE_LINE_ITEMS", + "description": "Render the custom field above the invoice line items." + }, + { + "name": "BELOW_LINE_ITEMS", + "description": "Render the custom field below the invoice line items." + } + ], + "description": "Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF \ncopies of the invoice.", + "x-release-status": "PUBLIC" + }, + "InvoiceDeletedEvent": { + "type": "object", + "description": "Published when a draft [Invoice](entity:Invoice) is deleted.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceDeletedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "deleted": true, + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "type": "invoice" + }, + "event_id": "742ef00c-446b-4fca-b3d5-f177d816ee54", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.deleted" + }, + "x-webhook": { + "event": "invoice.deleted", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceDeletedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "deleted": { + "type": "boolean", + "description": "Indicates that the invoice was deleted.", + "nullable": true + } + } + }, + "InvoiceDeliveryMethod": { + "type": "string", + "enum": [ + "EMAIL", + "SHARE_MANUALLY", + "SMS" + ], + "x-enum-elements": [ + { + "name": "EMAIL", + "description": "Directs Square to send invoices, reminders, and receipts to the customer using email." + }, + { + "name": "SHARE_MANUALLY", + "description": "Directs Square to take no action on the invoice. In this case, the seller\nor application developer follows up with the customer for payment. For example,\na seller might collect a payment in the Seller Dashboard or Point of Sale (POS) application.\nThe seller might also share the URL of the Square-hosted invoice page (`public_url`) with the customer to request payment." + }, + { + "name": "SMS", + "description": "Directs Square to send invoices and receipts to the customer using SMS (text message).\n\nYou cannot set `SMS` as a delivery method using the Invoices API, but you can change an `SMS` delivery method to `EMAIL` or `SHARE_MANUALLY`." + } + ], + "description": "Indicates how Square delivers the [invoice](entity:Invoice) to the customer.", + "x-release-status": "PUBLIC" + }, + "InvoiceFilter": { + "type": "object", + "description": "Describes query filters to apply.", + "x-release-status": "PUBLIC", + "required": [ + "location_ids" + ], + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Limits the search to the specified locations. A location is required. \nIn the current implementation, only one location can be specified." + }, + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Limits the search to the specified customers, within the specified locations. \nSpecifying a customer is optional. In the current implementation, \na maximum of one customer can be specified.", + "nullable": true + } + } + }, + "InvoicePaymentMadeEvent": { + "type": "object", + "description": "Published when a payment that is associated with an [invoice](entity:Invoice) is completed.\nFor more information about invoice payments, see [Pay an invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#pay-invoice).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.payment_made\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoicePaymentMadeEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "status": "PAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 3 + } + }, + "type": "invoice" + }, + "event_id": "891e3589-462f-4215-9b61-f6df2d4432b7", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.payment_made" + }, + "x-webhook": { + "event": "invoice.payment_made", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoicePaymentMadeEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoicePaymentMadeEventObject", + "description": "An object containing the invoice that was paid.", + "nullable": true + } + } + }, + "InvoicePaymentMadeEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoicePaymentReminder": { + "type": "object", + "description": "Describes a payment request reminder (automatic notification) that Square sends\nto the customer. You configure a reminder relative to the payment request\n`due_date`.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A Square-assigned ID that uniquely identifies the reminder within the\n`InvoicePaymentRequest`.", + "readOnly": true + }, + "relative_scheduled_days": { + "type": "integer", + "description": "The number of days before (a negative number) or after (a positive number)\nthe payment request `due_date` when the reminder is sent. For example, -3 indicates that\nthe reminder should be sent 3 days before the payment request `due_date`.", + "minimum": -32767, + "maximum": 32767, + "nullable": true + }, + "message": { + "type": "string", + "description": "The reminder message.", + "minLength": 1, + "maxLength": 1000, + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/InvoicePaymentReminderStatus", + "description": "The status of the reminder.\nSee [InvoicePaymentReminderStatus](#type-invoicepaymentreminderstatus) for possible values", + "readOnly": true + }, + "sent_at": { + "type": "string", + "description": "If sent, the timestamp when the reminder was sent, in RFC 3339 format.", + "readOnly": true + } + } + }, + "InvoicePaymentReminderStatus": { + "type": "string", + "enum": [ + "PENDING", + "NOT_APPLICABLE", + "SENT" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The reminder will be sent on the `relative_scheduled_date` (if the invoice is published)." + }, + { + "name": "NOT_APPLICABLE", + "description": "The reminder is not applicable and is not sent. The following are examples\nof when reminders are not applicable and are not sent:\n- You schedule a reminder to be sent before the invoice is published.\n- The invoice is configured with multiple payment requests and a payment request reminder\nis configured to be sent after the next payment request `due_date`.\n- Two reminders (for different payment requests) are configured to be sent on the\nsame date. Therefore, only one reminder is sent.\n- You configure a reminder to be sent on the date that the invoice is scheduled to be sent.\n- The payment request is already paid.\n- The invoice status is `CANCELED` or `FAILED`." + }, + { + "name": "SENT", + "description": "The reminder is sent." + } + ], + "description": "The status of a payment request reminder.", + "x-release-status": "PUBLIC" + }, + "InvoicePaymentRequest": { + "type": "object", + "description": "Represents a payment request for an [invoice](entity:Invoice). Invoices can specify a maximum\nof 13 payment requests, with up to 12 `INSTALLMENT` request types. For more information, \nsee [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests).\n\nAdding `INSTALLMENT` payment requests to an invoice requires an \n[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription).", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "The Square-generated ID of the payment request in an [invoice](entity:Invoice).", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "request_method": { + "$ref": "#/components/schemas/InvoiceRequestMethod", + "description": "Indicates how Square processes the payment request. DEPRECATED at version 2021-01-21. Replaced by the\n`Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields.\n\nOne of the following is required when creating an invoice:\n- (Recommended) The `delivery_method` field of the invoice. To configure an automatic payment, the\n`automatic_payment_source` field of the payment request is also required.\n- This `request_method` field. Note that `invoice` objects returned in responses do not include `request_method`.\nSee [InvoiceRequestMethod](#type-invoicerequestmethod) for possible values", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "request_type": { + "$ref": "#/components/schemas/InvoiceRequestType", + "description": "Identifies the payment request type. This type defines how the payment request amount is determined. \nThis field is required to create a payment request.\nSee [InvoiceRequestType](#type-invoicerequesttype) for possible values", + "nullable": true + }, + "due_date": { + "type": "string", + "description": "The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This field\nis required to create a payment request. If an `automatic_payment_source` is defined for the request, Square\ncharges the payment source on this date.\n\nAfter this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a `timezone`\nof America/Los\\_Angeles becomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC\ntimestamp of 2021-03-10T08:00:00Z).", + "nullable": true + }, + "fixed_amount_requested_money": { + "$ref": "#/components/schemas/Money", + "description": "If the payment request specifies `DEPOSIT` or `INSTALLMENT` as the `request_type`, \nthis indicates the request amount.\nYou cannot specify this when `request_type` is `BALANCE` or when the \npayment request includes the `percentage_requested` field.", + "nullable": true + }, + "percentage_requested": { + "type": "string", + "description": "Specifies the amount for the payment request in percentage:\n\n- When the payment `request_type` is `DEPOSIT`, it is the percentage of the order's total amount.\n- When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order's total less \nthe deposit, if requested. The sum of the `percentage_requested` in all installment \npayment requests must be equal to 100.\n\nYou cannot specify this when the payment `request_type` is `BALANCE` or when the \npayment request specifies the `fixed_amount_requested_money` field.", + "nullable": true + }, + "tipping_enabled": { + "type": "boolean", + "description": "If set to true, the Square-hosted invoice page (the `public_url` field of the invoice) \nprovides a place for the customer to pay a tip. \n\nThis field is allowed only on the final payment request \nand the payment `request_type` must be `BALANCE` or `INSTALLMENT`.", + "nullable": true + }, + "automatic_payment_source": { + "$ref": "#/components/schemas/InvoiceAutomaticPaymentSource", + "description": "The payment method for an automatic payment.\n\nThe default value is `NONE`.\nSee [InvoiceAutomaticPaymentSource](#type-invoiceautomaticpaymentsource) for possible values", + "nullable": true + }, + "card_id": { + "type": "string", + "description": "The ID of the credit or debit card on file to charge for the payment request. To get the cards on file for a customer,\ncall [ListCards](api-endpoint:Cards-ListCards) and include the `customer_id` of the invoice recipient.", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "reminders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InvoicePaymentReminder" + }, + "description": "A list of one or more reminders to send for the payment request.", + "nullable": true + }, + "computed_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of the payment request, computed using the order amount and information from the various payment\nrequest fields (`request_type`, `fixed_amount_requested_money`, and `percentage_requested`).", + "readOnly": true + }, + "total_completed_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money already paid for the specific payment request. \nThis amount might include a rounding adjustment if the most recent invoice payment \nwas in cash in a currency that rounds cash payments (such as, `CAD` or `AUD`).", + "readOnly": true + }, + "rounding_adjustment_included_money": { + "$ref": "#/components/schemas/Money", + "description": "If the most recent payment was a cash payment \nin a currency that rounds cash payments (such as, `CAD` or `AUD`) and the payment \nis rounded from `computed_amount_money` in the payment request, then this \nfield specifies the rounding adjustment applied. This amount \nmight be negative.", + "readOnly": true + } + } + }, + "InvoicePublishedEvent": { + "type": "object", + "description": "Published when an [Invoice](entity:Invoice) transitions from a draft to a non-draft status.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.published\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoicePublishedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "SCHEDULED", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 1 + } + }, + "type": "invoice" + }, + "event_id": "52246644-98ba-411a-874c-ba35ccdb831c", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.published" + }, + "x-webhook": { + "event": "invoice.published", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoicePublishedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoicePublishedEventObject", + "description": "An object containing the published invoice.", + "nullable": true + } + } + }, + "InvoicePublishedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoiceQuery": { + "type": "object", + "description": "Describes query criteria for searching invoices.", + "x-release-status": "PUBLIC", + "required": [ + "filter" + ], + "properties": { + "filter": { + "$ref": "#/components/schemas/InvoiceFilter", + "description": "Query filters to apply in searching invoices. \nFor more information, see [Search for invoices](https://developer.squareup.com/docs/invoices-api/retrieve-list-search-invoices#search-invoices)." + }, + "sort": { + "$ref": "#/components/schemas/InvoiceSort", + "description": "Describes the sort order for the search result.", + "nullable": true + } + } + }, + "InvoiceRecipient": { + "type": "object", + "description": "Represents a snapshot of customer data. This object stores customer data that is displayed on the invoice \nand that Square uses to deliver the invoice.\n\nWhen you provide a customer ID for a draft invoice, Square retrieves the associated customer profile and populates \nthe remaining `InvoiceRecipient` fields. You cannot update these fields after the invoice is published. \nSquare updates the customer ID in response to a merge operation, but does not update other fields.", + "x-release-status": "PUBLIC", + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the customer. This is the customer profile ID that \nyou provide when creating a draft invoice.", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "given_name": { + "type": "string", + "description": "The recipient's given (that is, first) name.", + "readOnly": true + }, + "family_name": { + "type": "string", + "description": "The recipient's family (that is, last) name.", + "readOnly": true + }, + "email_address": { + "type": "string", + "description": "The recipient's email address.", + "readOnly": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The recipient's physical address.", + "readOnly": true + }, + "phone_number": { + "type": "string", + "description": "The recipient's phone number.", + "readOnly": true + }, + "company_name": { + "type": "string", + "description": "The name of the recipient's company.", + "readOnly": true + }, + "tax_ids": { + "$ref": "#/components/schemas/InvoiceRecipientTaxIds", + "description": "The recipient's tax IDs. The country of the seller account determines whether this field \nis available for the customer. For more information, see [Invoice recipient tax IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids).", + "readOnly": true + } + } + }, + "InvoiceRecipientTaxIds": { + "type": "object", + "description": "Represents the tax IDs for an invoice recipient. The country of the seller account determines \nwhether the corresponding `tax_ids` field is available for the customer. For more information, \nsee [Invoice recipient tax IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids).", + "x-release-status": "PUBLIC", + "properties": { + "eu_vat": { + "type": "string", + "description": "The EU VAT identification number for the invoice recipient. For example, `IE3426675K`.", + "readOnly": true + } + } + }, + "InvoiceRefundedEvent": { + "type": "object", + "description": "Published when a refund is applied toward a payment of an [invoice](entity:Invoice). \nFor more information about invoice refunds, see [Refund an invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#refund-invoice).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.refunded\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceRefundedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "status": "REFUNDED", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 4 + } + }, + "type": "invoice" + }, + "event_id": "aedeb1fb-6c7d-4484-8106-866d97652388", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.refunded" + }, + "x-webhook": { + "event": "invoice.refunded", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceRefundedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoiceRefundedEventObject", + "description": "An object containing the refunded invoice.", + "nullable": true + } + } + }, + "InvoiceRefundedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoiceRequestMethod": { + "type": "string", + "enum": [ + "EMAIL", + "CHARGE_CARD_ON_FILE", + "SHARE_MANUALLY", + "CHARGE_BANK_ON_FILE", + "SMS", + "SMS_CHARGE_CARD_ON_FILE", + "SMS_CHARGE_BANK_ON_FILE" + ], + "x-enum-elements": [ + { + "name": "EMAIL", + "description": "Directs Square to send invoices, reminders, and receipts to the customer using email.\nSquare sends the invoice after it is published (either immediately or at the `scheduled_at`\ntime, if specified in the [invoice](entity:Invoice))." + }, + { + "name": "CHARGE_CARD_ON_FILE", + "description": "Directs Square to charge the card on file on the `due_date` specified in the payment request\nand to use email to send invoices, reminders, and receipts." + }, + { + "name": "SHARE_MANUALLY", + "description": "Directs Square to take no specific action on the invoice. In this case, the seller \n(or the application developer) follows up with the customer for payment. For example, \na seller might collect a payment in the Seller Dashboard or use the Point of Sale (POS) application. \nThe seller might also share the URL of the Square-hosted invoice page (`public_url`) with the customer requesting payment." + }, + { + "name": "CHARGE_BANK_ON_FILE", + "description": "Directs Square to charge the customer's bank account on file and to use email to send invoices, reminders, and receipts.\nThe customer must approve the payment.\n\nThe bank on file payment method applies only to invoices that sellers create in the Seller Dashboard or other\nSquare product. The bank account is provided by the customer during the payment flow. You \ncannot set `CHARGE_BANK_ON_FILE` as a request method using the Invoices API." + }, + { + "name": "SMS", + "description": "Directs Square to send invoices and receipts to the customer using SMS (text message). Square sends the invoice\nafter it is published (either immediately or at the `scheduled_at` time, if specified in the [invoice](entity:Invoice)). \n\nYou cannot set `SMS` as a request method using the Invoices API." + }, + { + "name": "SMS_CHARGE_CARD_ON_FILE", + "description": "Directs Square to charge the card on file on the `due_date` specified in the payment request and to\nuse SMS (text message) to send invoices and receipts. \n\nYou cannot set `SMS_CHARGE_CARD_ON_FILE` as a request method using the Invoices API." + }, + { + "name": "SMS_CHARGE_BANK_ON_FILE", + "description": "Directs Square to charge the customer's bank account on file and to use SMS (text message) to send invoices and receipts.\nThe customer must approve the payment.\n\nThe bank on file payment method applies only to invoices that sellers create in the Seller Dashboard\nor other Square product. The bank account is provided by the customer during the payment flow. \nYou cannot set `SMS_CHARGE_BANK_ON_FILE` as a request method using the Invoices API." + } + ], + "description": "Specifies the action for Square to take for processing the invoice. For example, \nemail the invoice, charge a customer's card on file, or do nothing. DEPRECATED at\nversion 2021-01-21. The corresponding `request_method` field is replaced by the\n`Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields.", + "x-release-status": "DEPRECATED" + }, + "InvoiceRequestType": { + "type": "string", + "enum": [ + "BALANCE", + "DEPOSIT", + "INSTALLMENT" + ], + "x-enum-elements": [ + { + "name": "BALANCE", + "description": "A request for a balance payment. The balance amount is computed as follows: \n\n- If the invoice specifies only a balance payment request, the balance amount is the \ntotal amount of the associated order. \n- If the invoice also specifies a deposit request, the balance amount is the amount \nremaining after the deposit.\n\n`INSTALLMENT` and `BALANCE` payment requests are not allowed in the same invoice." + }, + { + "name": "DEPOSIT", + "description": "A request for a deposit payment. You have the option of specifying \nan exact amount or a percentage of the total order amount. If you request a deposit, \nit must be due before any other payment requests." + }, + { + "name": "INSTALLMENT", + "description": "A request for an installment payment. Installments allow buyers to pay the invoice over time. Installments can optionally be combined with a deposit. \n\nAdding `INSTALLMENT` payment requests to an invoice requires an \n[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription)." + } + ], + "description": "Indicates the type of the payment request. For more information, see \n[Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests).", + "x-release-status": "PUBLIC" + }, + "InvoiceScheduledChargeFailedEvent": { + "type": "object", + "description": "Published when an automatic scheduled payment for an [Invoice](entity:Invoice) has failed.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.scheduled_charge_failed\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceScheduledChargeFailedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "UNPAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 4 + } + }, + "type": "invoice" + }, + "event_id": "3cabb64e-16ba-40c2-b605-5c51a06ec794", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.scheduled_charge_failed" + }, + "x-webhook": { + "event": "invoice.scheduled_charge_failed", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceScheduledChargeFailedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoiceScheduledChargeFailedEventObject", + "description": "An object containing the invoice that experienced the failed scheduled charge.", + "nullable": true + } + } + }, + "InvoiceScheduledChargeFailedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoiceSort": { + "type": "object", + "description": "Identifies the sort field and sort order.", + "x-release-status": "PUBLIC", + "required": [ + "field" + ], + "properties": { + "field": { + "$ref": "#/components/schemas/InvoiceSortField", + "description": "The field to use for sorting.\nSee [InvoiceSortField](#type-invoicesortfield) for possible values" + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order to use for sorting the results.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "InvoiceSortField": { + "type": "string", + "enum": [ + "INVOICE_SORT_DATE" + ], + "x-enum-elements": [ + { + "name": "INVOICE_SORT_DATE", + "description": "The field works as follows:\n\n- If the invoice is a draft, it uses the invoice `created_at` date.\n- If the invoice is scheduled for publication, it uses the `scheduled_at` date.\n- If the invoice is published, it uses the invoice publication date." + } + ], + "description": "The field to use for sorting.", + "x-release-status": "PUBLIC" + }, + "InvoiceStatus": { + "type": "string", + "enum": [ + "DRAFT", + "UNPAID", + "SCHEDULED", + "PARTIALLY_PAID", + "PAID", + "PARTIALLY_REFUNDED", + "REFUNDED", + "CANCELED", + "FAILED", + "PAYMENT_PENDING" + ], + "x-enum-elements": [ + { + "name": "DRAFT", + "description": "The invoice is a draft. You must publish a draft invoice before Square can process it.\nA draft invoice has no `public_url`, so it is not available to customers." + }, + { + "name": "UNPAID", + "description": "The invoice is published but not yet paid." + }, + { + "name": "SCHEDULED", + "description": "The invoice is scheduled to be processed. On the scheduled date,\nSquare sends the invoice, initiates an automatic payment, or takes no action, depending on\nthe delivery method and payment request settings. Square also sets the invoice status to the\nappropriate state: `UNPAID`, `PAID`, `PARTIALLY_PAID`, or `PAYMENT_PENDING`." + }, + { + "name": "PARTIALLY_PAID", + "description": "A partial payment is received for the invoice." + }, + { + "name": "PAID", + "description": "The customer paid the invoice in full." + }, + { + "name": "PARTIALLY_REFUNDED", + "description": "The invoice is paid (or partially paid) and some but not all the amount paid is\nrefunded." + }, + { + "name": "REFUNDED", + "description": "The full amount that the customer paid for the invoice is refunded." + }, + { + "name": "CANCELED", + "description": "The invoice is canceled. Square no longer requests payments from the customer.\nThe Square-hosted payment page is still accessible using the temporary `public_url`\nlink, but the invoice is shown as canceled and does not accept payment." + }, + { + "name": "FAILED", + "description": "Square canceled the invoice due to suspicious activity." + }, + { + "name": "PAYMENT_PENDING", + "description": "A payment on the invoice was initiated but has not yet been processed.\n\nWhen in this state, invoices cannot be updated and other payments cannot be initiated." + } + ], + "description": "Indicates the status of an [invoice](entity:Invoice).", + "x-release-status": "PUBLIC" + }, + "InvoiceUpdatedEvent": { + "type": "object", + "description": "Published when an [Invoice](entity:Invoice) is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "attachments": [ + { + "description": "Service contract", + "filename": "terms_and_agreements.pdf", + "filesize": 81839, + "hash": "273ee02cb6f5f8a3a8ca23604930dd53", + "id": "inva:0-ChBIMZJ99MugJFCUBjUVfdwY", + "mime_type": "application/pdf", + "uploaded_at": "2023-03-03T00:07:52Z" + } + ], + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "UNPAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 2 + } + }, + "type": "invoice" + }, + "event_id": "0312a8c5-af0f-49f4-ba29-291ef08dcd7e", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.updated" + }, + "x-webhook": { + "event": "invoice.updated", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoiceUpdatedEventObject", + "description": "An object containing the updated invoice.", + "nullable": true + } + } + }, + "InvoiceUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "ItemVariationLocationOverrides": { + "type": "object", + "description": "Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`.", + "x-release-status": "PUBLIC", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the `Location`. This can include locations that are deactivated.", + "nullable": true + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The price of the `CatalogItemVariation` at the given `Location`, or blank for variable pricing.", + "nullable": true + }, + "pricing_type": { + "$ref": "#/components/schemas/CatalogPricingType", + "description": "The pricing type (fixed or variable) for the `CatalogItemVariation` at the given `Location`.\nSee [CatalogPricingType](#type-catalogpricingtype) for possible values", + "nullable": true + }, + "track_inventory": { + "type": "boolean", + "description": "If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`.", + "nullable": true + }, + "inventory_alert_type": { + "$ref": "#/components/schemas/InventoryAlertType", + "description": "Indicates whether the `CatalogItemVariation` displays an alert when its inventory\nquantity is less than or equal to its `inventory_alert_threshold`.\nSee [InventoryAlertType](#type-inventoryalerttype) for possible values", + "nullable": true + }, + "inventory_alert_threshold": { + "type": "integer", + "description": "If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type`\nis `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard.\n\nThis value is always an integer.", + "format": "int64", + "nullable": true + }, + "sold_out": { + "type": "boolean", + "description": "Indicates whether the overridden item variation is sold out at the specified location.\n\nWhen inventory tracking is enabled on the item variation either globally or at the specified location,\nthe item variation is automatically marked as sold out when its inventory count reaches zero. The seller\ncan manually set the item variation as sold out even when the inventory count is greater than zero.\nAttempts by an application to set this attribute are ignored. Regardless how the sold-out status is set,\napplications should treat its inventory count as zero when this attribute value is `true`.", + "readOnly": true + }, + "sold_out_valid_until": { + "type": "string", + "description": "The seller-assigned timestamp, of the RFC 3339 format, to indicate when this sold-out variation\nbecomes available again at the specified location. Attempts by an application to set this attribute are ignored.\nWhen the current time is later than this attribute value, the affected item variation is no longer sold out.", + "readOnly": true + } + } + }, + "Job": { + "type": "object", + "description": "Represents a job that can be assigned to [team members](entity:TeamMember). This object defines the\njob's title and tip eligibility. Compensation is defined in a [job assignment](entity:JobAssignment)\nin a team member's wage setting.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "**Read only** The unique Square-assigned ID of the job. If you need a job ID for an API request,\ncall [ListJobs](api-endpoint:Team-ListJobs) or use the ID returned when you created the job.\nYou can also get job IDs from a team member's wage setting." + }, + "title": { + "type": "string", + "description": "The title of the job.", + "maxLength": 150, + "nullable": true + }, + "is_tip_eligible": { + "type": "boolean", + "description": "Indicates whether team members can earn tips for the job.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the job was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the job was last updated, in RFC 3339 format.", + "readOnly": true + }, + "version": { + "type": "integer", + "description": "**Read only** The current version of the job. Include this field in `UpdateJob` requests to enable\n[optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency)\ncontrol and avoid overwrites from concurrent requests. Requests fail if the provided version doesn't\nmatch the server version at the time of the request." + } + } + }, + "JobAssignment": { + "type": "object", + "description": "Represents a job assigned to a [team member](entity:TeamMember), including the compensation the team\nmember earns for the job. Job assignments are listed in the team member's [wage setting](entity:WageSetting).", + "x-release-status": "PUBLIC", + "required": [ + "pay_type" + ], + "properties": { + "job_title": { + "type": "string", + "description": "The title of the job.", + "nullable": true + }, + "pay_type": { + "$ref": "#/components/schemas/JobAssignmentPayType", + "description": "The current pay type for the job assignment used to\ncalculate the pay amount in a pay period.\nSee [JobAssignmentPayType](#type-jobassignmentpaytype) for possible values" + }, + "hourly_rate": { + "$ref": "#/components/schemas/Money", + "description": "The hourly pay rate of the job. For `SALARY` pay types, Square calculates the hourly rate based on\n`annual_rate` and `weekly_hours`.", + "nullable": true + }, + "annual_rate": { + "$ref": "#/components/schemas/Money", + "description": "The total pay amount for a 12-month period on the job. Set if the job `PayType` is `SALARY`.", + "nullable": true + }, + "weekly_hours": { + "type": "integer", + "description": "The planned hours per week for the job. Set if the job `PayType` is `SALARY`.", + "nullable": true + }, + "job_id": { + "type": "string", + "description": "The ID of the [job](entity:Job).", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "JobAssignmentPayType": { + "type": "string", + "enum": [ + "NONE", + "HOURLY", + "SALARY" + ], + "x-enum-elements": [ + { + "name": "NONE", + "description": "The job does not have a defined pay type." + }, + { + "name": "HOURLY", + "description": "The job pays an hourly rate." + }, + { + "name": "SALARY", + "description": "The job pays an annual salary." + } + ], + "description": "Enumerates the possible pay types that a job can be assigned.", + "x-release-status": "PUBLIC" + }, + "JobCreatedEvent": { + "type": "object", + "description": "Published when a Job is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"job.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/JobCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2024-12-20T01:16:04.253Z", + "data": { + "id": "9AMrnT51mWUa31uN4QziQZXF", + "object": { + "job": { + "created_at": "2024-12-20T01:15:55Z", + "id": "9AMrnT51mWUa31uN4QziQZXF", + "is_tip_eligible": true, + "title": "Cashier", + "updated_at": "2024-12-20T01:15:55Z", + "version": 1 + } + }, + "type": "job" + }, + "event_id": "91484f7e-63bc-4253-a86d-18e7ea0b0cfb", + "merchant_id": "0JV5BGNW4EG9R", + "type": "job.created" + }, + "x-webhook": { + "event": "job.created", + "scopes": [ + "EMPLOYEES_READ" + ] + }, + "x-api": "#/components/x-apis/Team", + "x-since": "2024-12-18" + }, + "JobCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"job\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the created job." + }, + "object": { + "$ref": "#/components/schemas/JobCreatedEventObject", + "description": "An object containing the created job.", + "nullable": true + } + } + }, + "JobCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The created job.", + "nullable": true + } + } + }, + "JobUpdatedEvent": { + "type": "object", + "description": "Published when a Job is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"job.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/JobUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2024-12-21T02:34:55.253Z", + "data": { + "id": "9AMrnT51mWUa31uN4QziQZXF", + "object": { + "job": { + "created_at": "2024-12-20T01:15:55Z", + "id": "9AMrnT51mWUa31uN4QziQZXF", + "is_tip_eligible": false, + "title": "Cashier", + "updated_at": "2024-12-21T02:34:14Z", + "version": 2 + } + }, + "type": "job" + }, + "event_id": "91484f7e-63bc-4253-a86d-18e7ea0b0cfb", + "merchant_id": "0JV5BGNW4EG9R", + "type": "job.updated" + }, + "x-webhook": { + "event": "job.updated", + "scopes": [ + "EMPLOYEES_READ" + ] + }, + "x-api": "#/components/x-apis/Team", + "x-since": "2024-12-18" + }, + "JobUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"job\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated job." + }, + "object": { + "$ref": "#/components/schemas/JobUpdatedEventObject", + "description": "An object containing the updated job.", + "nullable": true + } + } + }, + "JobUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The updated job.", + "nullable": true + } + } + }, + "LaborScheduledShiftCreatedEvent": { + "type": "object", + "description": "Published when a [ScheduledShift](entity:ScheduledShift) is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.scheduled_shift.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborScheduledShiftCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2025-02-11T18:02:00.084598063Z", + "data": { + "id": "509RM55G6R17F", + "object": { + "scheduled_shift": { + "created_at": "2025-02-11T18:02:00Z", + "draft_shift_details": { + "end_at": "2025-02-14T09:11:00-08:00", + "is_deleted": false, + "job_id": "ioeL1Mp7iZwCAWxeGMAT7ggB", + "location_id": "LR473RTW59VRY", + "notes": "Dont forget to prep the vegetables", + "start_at": "2025-02-13T23:11:00-08:00", + "team_member_id": "TMnsTAouYbvmp-8O", + "timezone": "America/Los_Angeles" + }, + "id": "509RM55G6R17F", + "updated_at": "2025-02-11T18:02:00Z", + "version": 1 + } + }, + "type": "scheduled_shift" + }, + "event_id": "d0fabe2e-791c-398e-a349-79f6ec7dfa69", + "merchant_id": "MLHZRVNSD91A1", + "type": "labor.scheduled_shift.created" + }, + "x-webhook": { + "event": "labor.scheduled_shift.created", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborScheduledShiftCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `scheduled_shift`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `ScheduledShift`.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/LaborScheduledShiftCreatedEventObject", + "description": "An object containing the affected `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborScheduledShiftCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "ScheduledShift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The new `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborScheduledShiftDeletedEvent": { + "type": "object", + "description": "Published when a [ScheduledShift](entity:ScheduledShift) is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.scheduled_shift.deleted`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborScheduledShiftDeletedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2025-02-11T18:03:12.879368768Z", + "data": { + "deleted": true, + "id": "509RM55G6R17F", + "type": "scheduled_shift" + }, + "event_id": "58d3897e-951c-337f-ac01-84c20ed6007d", + "merchant_id": "MLHZRVNSD91A1", + "type": "labor.scheduled_shift.deleted" + }, + "x-webhook": { + "event": "labor.scheduled_shift.deleted", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborScheduledShiftDeletedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `scheduled_shift`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `ScheduledShift`.", + "maxLength": 255 + }, + "deleted": { + "type": "boolean", + "description": "Is true if the affected object was deleted. Otherwise absent.", + "nullable": true + } + } + }, + "LaborScheduledShiftPublishedEvent": { + "type": "object", + "description": "Published when a [ScheduledShift](entity:ScheduledShift) is published.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.scheduled_shift.published`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborScheduledShiftPublishedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2025-02-11T18:54:08.044355293Z", + "data": { + "id": "WA09SDV3DNJ54", + "object": { + "scheduled_shift": { + "created_at": "2025-02-11T18:53:35Z", + "draft_shift_details": { + "end_at": "2025-02-14T09:11:00-08:00", + "is_deleted": false, + "job_id": "ioeL1Mp7iZwCAWxeGMAT7ggB", + "location_id": "LR473RTW59VRY", + "notes": "Dont forget to prep the vegetables", + "start_at": "2025-02-13T23:11:00-08:00", + "team_member_id": "TMnsTAouYbvmp-8O", + "timezone": "America/Los_Angeles" + }, + "id": "WA09SDV3DNJ54", + "published_shift_details": { + "end_at": "2025-02-14T09:11:00-08:00", + "is_deleted": false, + "job_id": "ioeL1Mp7iZwCAWxeGMAT7ggB", + "location_id": "LR473RTW59VRY", + "notes": "Dont forget to prep the vegetables", + "start_at": "2025-02-13T23:11:00-08:00", + "team_member_id": "TMnsTAouYbvmp-8O", + "timezone": "America/Los_Angeles" + }, + "updated_at": "2025-02-11T18:54:08Z", + "version": 2 + } + }, + "type": "scheduled_shift" + }, + "event_id": "4e31748e-1219-3f6f-a5c7-6fe3464705cd", + "merchant_id": "MLHZRVNSD91A1", + "type": "labor.scheduled_shift.published" + }, + "x-webhook": { + "event": "labor.scheduled_shift.published", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborScheduledShiftPublishedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `scheduled_shift`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `ScheduledShift`.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/LaborScheduledShiftPublishedEventObject", + "description": "An object containing the affected `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborScheduledShiftPublishedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "ScheduledShift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The published `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborScheduledShiftUpdatedEvent": { + "type": "object", + "description": "Published when a [ScheduledShift](entity:ScheduledShift) is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.scheduled_shift.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborScheduledShiftUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2025-02-11T18:54:08.044355293Z", + "data": { + "id": "WA09SDV3DNJ54", + "object": { + "scheduled_shift": { + "created_at": "2025-02-11T18:53:35Z", + "draft_shift_details": { + "end_at": "2025-02-14T09:11:00-08:00", + "is_deleted": false, + "job_id": "ioeL1Mp7iZwCAWxeGMAT7ggB", + "location_id": "LR473RTW59VRY", + "notes": "Dont forget to prep the vegetables", + "start_at": "2025-02-13T23:11:00-08:00", + "team_member_id": "TMnsTAouYbvmp-8O", + "timezone": "America/Los_Angeles" + }, + "id": "WA09SDV3DNJ54", + "published_shift_details": { + "end_at": "2025-02-14T09:11:00-08:00", + "is_deleted": false, + "job_id": "ioeL1Mp7iZwCAWxeGMAT7ggB", + "location_id": "LR473RTW59VRY", + "notes": "Dont forget to prep the vegetables", + "start_at": "2025-02-13T23:11:00-08:00", + "team_member_id": "TMnsTAouYbvmp-8O", + "timezone": "America/Los_Angeles" + }, + "updated_at": "2025-02-11T18:54:08Z", + "version": 2 + } + }, + "type": "scheduled_shift" + }, + "event_id": "d7052271-25e7-303f-9684-3f994dc9eaa3", + "merchant_id": "MLHZRVNSD91A1", + "type": "labor.scheduled_shift.updated" + }, + "x-webhook": { + "event": "labor.scheduled_shift.updated", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborScheduledShiftUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `scheduled_shift`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `ScheduledShift`.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/LaborScheduledShiftUpdatedEventObject", + "description": "An object containing the affected `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborScheduledShiftUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "ScheduledShift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The updated `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborShiftCreatedEvent": { + "type": "object", + "description": "Published when a worker starts a [Shift](entity:Shift).\n\nDeprecated at Square API version 2025-05-21. Replaced by `labor.timecard.created`.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.shift.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborShiftCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "id": "PY4YSMVKXFY9E", + "object": { + "shift": { + "created_at": "2019-11-06T19:14:55Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "AnuhZhsN95oT8f-eCn9D", + "end_at": "2019-01-25T18:11:00Z", + "id": "PY4YSMVKXFY9E", + "location_id": "NAQ1FHV6ZJ8YV", + "start_at": "2019-01-25T08:11:00Z", + "status": "OPEN", + "team_member_id": "AnuhZhsN95oT8f-eCn9D", + "timezone": "Etc/UTC", + "updated_at": "2019-11-06T19:14:55Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + }, + "type": "shift" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.shift.created" + }, + "x-webhook": { + "event": "labor.shift.created", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2019-11-20" + }, + "LaborShiftCreatedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `shift`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `Shift`." + }, + "object": { + "$ref": "#/components/schemas/LaborShiftCreatedEventObject", + "description": "An object containing the affected `Shift`.", + "nullable": true + } + } + }, + "LaborShiftCreatedEventObject": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The new `Shift`.", + "nullable": true + } + } + }, + "LaborShiftDeletedEvent": { + "type": "object", + "description": "Published when a [Shift](entity:Shift) is deleted.\n\nDeprecated at Square API version 2025-05-21. Replaced by `labor.timecard.deleted`.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.shift.deleted`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborShiftDeletedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "deleted": true, + "id": "PY4YSMVKXFY9E", + "type": "labor" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.shift.deleted" + }, + "x-webhook": { + "event": "labor.shift.deleted", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2019-11-20" + }, + "LaborShiftDeletedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `shift`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `Shift`." + }, + "deleted": { + "type": "boolean", + "description": "Is true if the affected object was deleted. Otherwise absent.", + "nullable": true + } + } + }, + "LaborShiftUpdatedEvent": { + "type": "object", + "description": "Published when a [Shift](entity:Shift) is updated.\n\nDeprecated at Square API version 2025-05-21. Replaced by `labor.timecard.updated`.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.shift.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborShiftUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "id": "PY4YSMVKXFY9E", + "object": { + "shift": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T11:16:00Z", + "expected_duration": "PT5M", + "id": "0EGK74E8BJF62", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T11:11:00Z" + } + ], + "created_at": "2019-11-06T19:14:55Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "AnuhZhsN95oT8f-eCn9D", + "end_at": "2019-01-25T18:11:00Z", + "id": "PY4YSMVKXFY9E", + "location_id": "NAQ1FHV6ZJ8YV", + "start_at": "2019-01-25T08:11:00Z", + "status": "CLOSED", + "team_member_id": "AnuhZhsN95oT8f-eCn9D", + "timezone": "Etc/UTC", + "updated_at": "2019-11-06T19:14:55Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + }, + "type": "shift" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.shift.updated" + }, + "x-webhook": { + "event": "labor.shift.updated", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2019-11-20" + }, + "LaborShiftUpdatedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `shift`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected `Shift`." + }, + "object": { + "$ref": "#/components/schemas/LaborShiftUpdatedEventObject", + "description": "An object containing the affected `Shift`.", + "nullable": true + } + } + }, + "LaborShiftUpdatedEventObject": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The updated `Shift`.", + "nullable": true + } + } + }, + "LaborTimecardCreatedEvent": { + "type": "object", + "description": "Published when a worker starts a [Timecard](entity:Timecard).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.timecard.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborTimecardCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "id": "PY4YSMVKXFY9E", + "object": { + "timecard": { + "created_at": "2019-11-06T19:14:55Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T18:11:00Z", + "id": "PY4YSMVKXFY9E", + "location_id": "NAQ1FHV6ZJ8YV", + "start_at": "2019-01-25T08:11:00Z", + "status": "OPEN", + "team_member_id": "AnuhZhsN95oT8f-eCn9D", + "timezone": "Etc/UTC", + "updated_at": "2019-11-06T19:14:55Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + }, + "type": "timecard" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.timecard.created" + }, + "x-webhook": { + "event": "labor.timecard.created", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborTimecardCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `timecard`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `Timecard`." + }, + "object": { + "$ref": "#/components/schemas/LaborTimecardCreatedEventObject", + "description": "An object containing the affected `Timecard`.", + "nullable": true + } + } + }, + "LaborTimecardCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The new `Timecard`.", + "nullable": true + } + } + }, + "LaborTimecardDeletedEvent": { + "type": "object", + "description": "Published when a [Timecard](entity:Timecard) is deleted.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.timecard.deleted`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborTimecardDeletedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "deleted": true, + "id": "PY4YSMVKXFY9E", + "type": "labor" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.timecard.deleted" + }, + "x-webhook": { + "event": "labor.timecard.deleted", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborTimecardDeletedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `timecard`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `Timecard`." + }, + "deleted": { + "type": "boolean", + "description": "Is true if the affected object was deleted. Otherwise absent.", + "nullable": true + } + } + }, + "LaborTimecardUpdatedEvent": { + "type": "object", + "description": "Published when a [Timecard](entity:Timecard) is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.timecard.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborTimecardUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "id": "PY4YSMVKXFY9E", + "object": { + "timecard": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T11:16:00Z", + "expected_duration": "PT5M", + "id": "0EGK74E8BJF62", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T11:11:00Z" + } + ], + "created_at": "2019-11-06T19:14:55Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T18:11:00Z", + "id": "PY4YSMVKXFY9E", + "location_id": "NAQ1FHV6ZJ8YV", + "start_at": "2019-01-25T08:11:00Z", + "status": "CLOSED", + "team_member_id": "AnuhZhsN95oT8f-eCn9D", + "timezone": "Etc/UTC", + "updated_at": "2019-11-06T19:14:55Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + }, + "type": "timecard" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.timecard.updated" + }, + "x-webhook": { + "event": "labor.timecard.updated", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborTimecardUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `timecard`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `Timecard`." + }, + "object": { + "$ref": "#/components/schemas/LaborTimecardUpdatedEventObject", + "description": "An object containing the affected `Timecard`.", + "nullable": true + } + } + }, + "LaborTimecardUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The updated `Timecard`.", + "nullable": true + } + } + }, + "LinkCustomerToGiftCardRequest": { + "type": "object", + "description": "A request to link a customer to a gift card.", + "x-release-status": "PUBLIC", + "x-params-example": "?gift_card_id=gftc:71ea002277a34f8a945e284b04822edb", + "required": [ + "customer_id" + ], + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the customer to link to the gift card.", + "minLength": 1, + "maxLength": 191 + } + }, + "example": { + "customer_id": "GKY0FZ3V717AH8Q2D821PNT2ZW" + } + }, + "LinkCustomerToGiftCardResponse": { + "type": "object", + "description": "A response that contains the linked `GiftCard` object. If the request resulted in errors, \nthe response contains a set of `Error` objects.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card with the ID of the linked customer listed in the `customer_ids` field." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 2500, + "currency": "USD" + }, + "created_at": "2021-03-25T05:13:01Z", + "customer_ids": [ + "GKY0FZ3V717AH8Q2D821PNT2ZW" + ], + "gan": "7783320005440920", + "gan_source": "SQUARE", + "id": "gftc:71ea002277a34f8a945e284b04822edb", + "state": "ACTIVE", + "type": "DIGITAL" + } + } + }, + "ListBankAccountsResponse": { + "type": "object", + "description": "Response object returned by ListBankAccounts.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "bank_accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BankAccount" + }, + "description": "List of BankAccounts associated with this account." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can \nuse in a subsequent request to fetch next set of bank accounts.\nIf empty, this is the final response.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." + } + }, + "example": { + "bank_accounts": [ + { + "account_number_suffix": "971", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": false, + "currency": "USD", + "debitable": false, + "holder_name": "Jane Doe", + "id": "ao6iaQ9vhDiaQD7n3GB", + "location_id": "S8GWD5example", + "primary_bank_identification_number": "112200303", + "status": "VERIFICATION_IN_PROGRESS", + "version": 5 + }, + { + "account_number_suffix": "972", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": false, + "currency": "USD", + "debitable": false, + "holder_name": "Jane Doe", + "id": "4x7WXuaxrkQkVlka3GB", + "location_id": "S8GWD5example", + "primary_bank_identification_number": "112200303", + "status": "VERIFICATION_IN_PROGRESS", + "version": 5 + } + ] + } + }, + "ListBookingCustomAttributeDefinitionsResponse": { + "type": "object", + "description": "Represents a [ListBookingCustomAttributeDefinitions](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributeDefinitions) response.\nEither `custom_attribute_definitions`, an empty object, or `errors` is present in the response.\nIf additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definitions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeDefinition" + }, + "description": "The retrieved custom attribute definitions. If no custom attribute definitions are found,\nSquare returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of\nresults for your original request. This field is present only if the request succeeded and\nadditional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", + "custom_attribute_definitions": [ + { + "created_at": "2022-11-16T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoriteShampoo", + "name": "Favorite shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-16T15:39:38Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + { + "created_at": "2022-11-16T15:49:05Z", + "description": "Number of people in the party for dine-in", + "key": "partySize", + "name": "Party size", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-11-16T15:49:05Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + ], + "errors": [] + } + }, + "ListBookingCustomAttributesResponse": { + "type": "object", + "description": "Represents a [ListBookingCustomAttributes](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributes) response.\nEither `custom_attributes`, an empty object, or `errors` is present in the response. If additional\nresults are available, the `cursor` field is also present along with `custom_attributes`.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttribute" + }, + "description": "The retrieved custom attributes. If `with_definitions` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field of each custom attribute.\n\nIf no custom attributes are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to use in your next call to this endpoint to retrieve the next page of results\nfor your original request. This field is present only if the request succeeded and additional\nresults are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attributes": [ + { + "created_at": "2022-11-16T15:50:27Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T15:50:27Z", + "value": "Hydro-Cool", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + { + "created_at": "2022-11-16T15:51:53Z", + "key": "hasShoes", + "updated_at": "2022-11-16T15:51:53Z", + "value": false, + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + ], + "errors": [] + } + }, + "ListBookingsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "bookings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Booking" + }, + "description": "The list of targeted bookings." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set.", + "maxLength": 65536 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "bookings": [ + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "created_at": "2020-10-28T15:47:41Z", + "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + "customer_note": "", + "id": "zkras0xv0xwswx", + "location_id": "LEQHH0YY8B42M", + "seller_note": "", + "start_at": "2020-11-26T13:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-10-28T15:49:25Z", + "version": 1 + } + ], + "cursor": null, + "errors": [] + } + }, + "ListBreakTypesResponse": { + "type": "object", + "description": "The response to a request for a set of `BreakType` objects. The response contains\nthe requested `BreakType` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "break_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BreakType" + }, + "description": " A page of `BreakType` results." + }, + "cursor": { + "type": "string", + "description": "The value supplied in the subsequent request to fetch the next page\nof `BreakType` results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "break_types": [ + { + "break_name": "Coffee Break", + "created_at": "2019-01-22T20:47:37Z", + "expected_duration": "PT5M", + "id": "REGS1EQR1TPZ5", + "is_paid": false, + "location_id": "PAA1RJZZKXBFG", + "updated_at": "2019-01-22T20:47:37Z", + "version": 1 + }, + { + "break_name": "Lunch Break", + "created_at": "2019-01-25T19:26:30Z", + "expected_duration": "PT1H", + "id": "92EPDRQKJ5088", + "is_paid": true, + "location_id": "PAA1RJZZKXBFG", + "updated_at": "2019-01-25T19:26:30Z", + "version": 3 + } + ], + "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED" + } + }, + "ListCardsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListCards](api-endpoint:Cards-ListCards) endpoint.\n\nNote: if there are errors processing the request, the card field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "cards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Card" + }, + "description": "The requested list of `Card`s." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + } + }, + "example": { + "cards": [ + { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + } + ] + } + }, + "ListCashDrawerShiftEventsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "cursor": { + "type": "string", + "description": "Opaque cursor for fetching the next page. Cursor is not present in\nthe last page of results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "cash_drawer_shift_events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CashDrawerShiftEvent" + }, + "description": "All of the events (payments, refunds, etc.) for a cash drawer during\nthe shift." + } + }, + "example": { + "cash_drawer_shift_events": [ + { + "created_at": "2019-11-22T00:43:02.000Z", + "description": "", + "event_money": { + "amount": 100, + "currency": "USD" + }, + "event_type": "CASH_TENDER_PAYMENT", + "id": "9F07DB01-D85A-4B77-88C3-D5C64CEB5155", + "team_member_id": "" + }, + { + "created_at": "2019-11-22T00:43:12.000Z", + "description": "", + "event_money": { + "amount": 250, + "currency": "USD" + }, + "event_type": "CASH_TENDER_PAYMENT", + "id": "B2854CEA-A781-49B3-8F31-C64558231F48", + "team_member_id": "" + }, + { + "created_at": "2019-11-22T00:43:23.000Z", + "description": "", + "event_money": { + "amount": 250, + "currency": "USD" + }, + "event_type": "CASH_TENDER_CANCELLED_PAYMENT", + "id": "B5FB7F72-95CD-44A3-974D-26C41064D042", + "team_member_id": "" + }, + { + "created_at": "2019-11-22T00:43:46.000Z", + "description": "", + "event_money": { + "amount": 100, + "currency": "USD" + }, + "event_type": "CASH_TENDER_REFUND", + "id": "0B425480-8504-40B4-A867-37B23543931B", + "team_member_id": "" + }, + { + "created_at": "2019-11-22T00:44:18.000Z", + "description": "Transfer from another drawer", + "event_money": { + "amount": 10000, + "currency": "USD" + }, + "event_type": "PAID_IN", + "id": "8C66E60E-FDCF-4EEF-A98D-3B14B7ED5CBE", + "team_member_id": "" + }, + { + "created_at": "2019-11-22T00:44:29.000Z", + "description": "Transfer out to another drawer", + "event_money": { + "amount": 10000, + "currency": "USD" + }, + "event_type": "PAID_OUT", + "id": "D5ACA7FE-C64D-4ADA-8BC8-82118A2DAE4F", + "team_member_id": "" + } + ] + } + }, + "ListCashDrawerShiftsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "cursor": { + "type": "string", + "description": "Opaque cursor for fetching the next page of results. Cursor is not\npresent in the last page of results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "cash_drawer_shifts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CashDrawerShiftSummary" + }, + "description": "A collection of CashDrawerShiftSummary objects for shifts that match\nthe query." + } + }, + "example": { + "cash_drawer_shifts": [ + { + "closed_at": "2019-11-22T00:44:49.000Z", + "closed_cash_money": { + "amount": 9970, + "currency": "USD" + }, + "description": "Misplaced some change", + "ended_at": "2019-11-22T00:44:49.000Z", + "expected_cash_money": { + "amount": 10000, + "currency": "USD" + }, + "id": "DCC99978-09A6-4926-849F-300BE9C5793A", + "opened_at": "2019-11-22T00:42:54.000Z", + "opened_cash_money": { + "amount": 10000, + "currency": "USD" + }, + "state": "CLOSED" + } + ] + } + }, + "ListCatalogResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset, this is the final response.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + }, + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "The CatalogObjects returned." + } + }, + "example": { + "objects": [ + { + "category_data": { + "name": "Beverages" + }, + "id": "5ZYQZZ2IECPVJ2IJ5KQPRDC3", + "is_deleted": false, + "present_at_all_locations": true, + "type": "CATEGORY", + "updated_at": "2017-02-21T14:50:26.495Z", + "version": 1487688626495 + }, + { + "id": "L5R47DGBZOOVKCAFIXC56AEN", + "is_deleted": false, + "present_at_all_locations": true, + "tax_data": { + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX", + "updated_at": "2017-02-21T14:50:26.495Z", + "version": 1487688626495 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.csharp", + "java": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.java", + "javascript": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.javascript", + "php": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.php", + "python": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.python", + "ruby": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.ruby" + } + }, + "ListCustomerCustomAttributeDefinitionsResponse": { + "type": "object", + "description": "Represents a [ListCustomerCustomAttributeDefinitions](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributeDefinitions) response.\nEither `custom_attribute_definitions`, an empty object, or `errors` is present in the response.\nIf additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definitions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeDefinition" + }, + "description": "The retrieved custom attribute definitions. If no custom attribute definitions are found,\nSquare returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of\nresults for your original request. This field is present only if the request succeeded and\nadditional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", + "custom_attribute_definitions": [ + { + "created_at": "2022-04-26T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T15:39:38Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + { + "created_at": "2022-04-26T15:49:05Z", + "description": "Customer owns movie.", + "key": "ownsmovie", + "name": "Owns Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-04-26T15:49:05Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + ] + } + }, + "ListCustomerCustomAttributesResponse": { + "type": "object", + "description": "Represents a [ListCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributes) response.\nEither `custom_attributes`, an empty object, or `errors` is present in the response. If additional\nresults are available, the `cursor` field is also present along with `custom_attributes`.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttribute" + }, + "description": "The retrieved custom attributes. If `with_definitions` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field of each custom attribute.\n\nIf no custom attributes are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to use in your next call to this endpoint to retrieve the next page of results\nfor your original request. This field is present only if the request succeeded and additional\nresults are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attributes": [ + { + "created_at": "2022-04-26T15:50:27Z", + "key": "favoritemovie", + "updated_at": "2022-04-26T15:50:27Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + { + "created_at": "2022-04-26T15:51:53Z", + "key": "ownsmovie", + "updated_at": "2022-04-26T15:51:53Z", + "value": false, + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + ] + } + }, + "ListCustomerGroupsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListCustomerGroups](api-endpoint:CustomerGroups-ListCustomerGroups) endpoint.\n\nEither `errors` or `groups` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerGroup" + }, + "description": "A list of customer groups belonging to the current seller." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor to retrieve the next set of results for your\noriginal query to the endpoint. This value is present only if the request\nsucceeded and additional results are available.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "groups": [ + { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + }, + { + "created_at": "2020-04-13T21:55:18.795Z", + "id": "4XMEHESXJBNE9S9JAKZD2FGB14", + "name": "Super Loyal Customers", + "updated_at": "2020-04-13T21:55:19Z" + } + ] + } + }, + "ListCustomerSegmentsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body for requests to the `ListCustomerSegments` endpoint.\n\nEither `errors` or `segments` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerSegment" + }, + "description": "The list of customer segments belonging to the associated Square account." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor to be used in subsequent calls to `ListCustomerSegments`\nto retrieve the next set of query results. The cursor is only present if the request succeeded and\nadditional results are available.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "segments": [ + { + "created_at": "2020-01-09T19:33:24.469Z", + "id": "GMNXRZVEXNQDF.CHURN_RISK", + "name": "Lapsed", + "updated_at": "2020-04-13T21:47:04Z" + }, + { + "created_at": "2020-01-09T19:33:24.486Z", + "id": "GMNXRZVEXNQDF.LOYAL", + "name": "Regulars", + "updated_at": "2020-04-13T21:47:04Z" + }, + { + "created_at": "2020-01-09T19:33:21.813Z", + "id": "GMNXRZVEXNQDF.REACHABLE", + "name": "Reachable", + "updated_at": "2020-04-13T21:47:04Z" + }, + { + "created_at": "2020-01-09T19:33:25Z", + "id": "gv2:KF92J19VXN5FK30GX2E8HSGQ20", + "name": "Instant Profile", + "updated_at": "2020-04-13T23:01:03Z" + } + ] + } + }, + "ListCustomersResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `ListCustomers` endpoint.\n\nEither `errors` or `customers` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Customer" + }, + "description": "The customer profiles associated with the Square account or an empty object (`{}`) if none are found.\nOnly customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or\n`phone_number`) are included in the response." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor to retrieve the next set of results for the\noriginal query. A cursor is only present if the request succeeded and additional results\nare available.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "count": { + "type": "integer", + "description": "The total count of customers associated with the Square account. Only customer profiles with public information\n(`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is present\nonly if `count` is set to `true` in the request.", + "format": "int64" + } + }, + "example": { + "customers": [ + { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "group_ids": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ], + "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "segment_ids": [ + "1KB9JE5EGJXCW.REACHABLE" + ], + "updated_at": "2016-03-23T20:21:55Z", + "version": 1 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ListCustomers/ListCustomersResponse.csharp", + "java": "/sdk_samples/ListCustomers/ListCustomersResponse.java", + "javascript": "/sdk_samples/ListCustomers/ListCustomersResponse.javascript", + "php": "/sdk_samples/ListCustomers/ListCustomersResponse.php", + "python": "/sdk_samples/ListCustomers/ListCustomersResponse.python", + "ruby": "/sdk_samples/ListCustomers/ListCustomersResponse.ruby" + } + }, + "ListDeviceCodesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "device_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceCode" + }, + "description": "The queried DeviceCode." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor to retrieve the next set of results for your\noriginal query to the endpoint. This value is present only if the request\nsucceeded and additional results are available.\n\nSee [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information." + } + }, + "example": { + "device_codes": [ + { + "code": "EBCARJ", + "created_at": "2020-02-06T18:44:33.000Z", + "device_id": "907CS13101300122", + "id": "B3Z6NAMYQSMTM", + "location_id": "B5E4484SHHNYH", + "name": "Counter 1", + "pair_by": "2020-02-06T18:49:33.000Z", + "product_type": "TERMINAL_API", + "status": "PAIRED", + "status_changed_at": "2020-02-06T18:47:28.000Z" + }, + { + "code": "GVXNYN", + "created_at": "2020-02-07T19:55:04.000Z", + "id": "YKGMJMYK8H4PQ", + "location_id": "A6SYFRSV4WAFW", + "name": "Unused device code", + "pair_by": "2020-02-07T20:00:04.000Z", + "product_type": "TERMINAL_API", + "status": "UNPAIRED", + "status_changed_at": "2020-02-07T19:55:04.000Z" + } + ] + } + }, + "ListDevicesResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors that occurred during the request." + }, + "devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Device" + }, + "description": "The requested list of `Device` objects." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + } + }, + "example": { + "cursor": "GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM", + "devices": [ + { + "attributes": { + "manufacturer": "Square", + "manufacturers_id": "995CS397A6475287", + "merchant_token": "MLCHNZCBWFDZB", + "model": "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" + }, + "type": "APPLICATION" + }, + { + "card_reader_details": { + "version": "3.53.70" + }, + "type": "CARD_READER" + }, + { + "battery_details": { + "external_power": "AVAILABLE_CHARGING", + "visible_percent": 5 + }, + "type": "BATTERY" + }, + { + "type": "WIFI", + "wifi_details": { + "active": true, + "ip_address_v4": "10.0.0.7", + "secure_connection": "WPA/WPA2 PSK", + "signal_strength": { + "value": 2 + }, + "ssid": "Staff Network" + } + }, + { + "ethernet_details": { + "active": false + }, + "type": "ETHERNET" + } + ], + "id": "device:995CS397A6475287", + "status": { + "category": "AVAILABLE" + } + }, + { + "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": "3.53.70" + }, + "type": "CARD_READER" + }, + { + "battery_details": { + "external_power": "AVAILABLE_CHARGING", + "visible_percent": 24 + }, + "type": "BATTERY" + }, + { + "type": "WIFI", + "wifi_details": { + "active": true, + "ip_address_v4": "10.0.0.7", + "secure_connection": "WPA/WPA2 PSK", + "signal_strength": { + "value": 2 + }, + "ssid": "Staff Network" + } + }, + { + "ethernet_details": { + "active": false + }, + "type": "ETHERNET" + } + ], + "id": "device:995CS234B5493559", + "status": { + "category": "NEEDS_ATTENTION" + } + } + ] + } + }, + "ListDisputeEvidenceResponse": { + "type": "object", + "description": "Defines the fields in a `ListDisputeEvidence` response.", + "x-release-status": "PUBLIC", + "properties": { + "evidence": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DisputeEvidence" + }, + "description": "The list of evidence previously uploaded to the specified dispute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request.\nIf unset, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "evidence": [ + { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_file": { + "filename": "customer-interaction", + "filetype": "JPG" + }, + "evidence_type": "CARDHOLDER_COMMUNICATION", + "id": "CpfnkwGselCwS8QFvxN6", + "uploaded_at": "2022-05-10T15:57:13.802Z" + }, + { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_file": { + "filename": "", + "filetype": "" + }, + "evidence_type": "REBUTTAL_EXPLANATION", + "id": "TOomLInj6iWmP3N8qfCXrB", + "uploaded_at": "2022-05-18T16:01:10.000Z" + } + ] + } + }, + "ListDisputesResponse": { + "type": "object", + "description": "Defines fields in a `ListDisputes` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "disputes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Dispute" + }, + "description": "The list of disputes." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request.\nIf unset, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "cursor": "G1aSTRm48CLjJsg6Sg3hQN1b1OMaoVuG", + "disputes": [ + { + "amount_money": { + "amount": 2500, + "currency": "USD" + }, + "brand_dispute_id": "100000809947", + "card_brand": "VISA", + "created_at": "2022-06-29T18:45:22.265Z", + "disputed_payment": { + "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" + }, + "due_at": "2022-07-13T00:00:00.000Z", + "id": "XDgyFu7yo1E2S5lQGGpYn", + "location_id": "L1HN3ZMQK64X9", + "reason": "NO_KNOWLEDGE", + "reported_at": "2022-06-29T00:00:00.000Z", + "state": "ACCEPTED", + "updated_at": "2022-07-07T19:14:42.650Z", + "version": 2 + }, + { + "amount_money": { + "amount": 2209, + "currency": "USD" + }, + "brand_dispute_id": "r5Of6YaGT7AdeRaVoAGCJw", + "card_brand": "VISA", + "created_at": "2022-04-29T18:45:22.265Z", + "disputed_payment": { + "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" + }, + "due_at": "2022-05-13T00:00:00.000Z", + "id": "jLGg7aXC7lvKPr9PISt0T", + "location_id": "18YC4JDH91E1H", + "reason": "NOT_AS_DESCRIBED", + "reported_at": "2022-04-29T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2022-04-29T18:45:22.265Z", + "version": 1 + } + ] + } + }, + "ListEmployeeWagesResponse": { + "type": "object", + "description": "The response to a request for a set of `EmployeeWage` objects. The response contains\na set of `EmployeeWage` objects.", + "x-release-status": "DEPRECATED", + "properties": { + "employee_wages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeWage" + }, + "description": "A page of `EmployeeWage` results." + }, + "cursor": { + "type": "string", + "description": "The value supplied in the subsequent request to fetch the next page\nof `EmployeeWage` results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + "employee_wages": [ + { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 3250, + "currency": "USD" + }, + "id": "pXS3qCv7BERPnEGedM4S8mhm", + "title": "Manager" + }, + { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 2600, + "currency": "USD" + }, + "id": "rZduCkzYDUVL3ovh1sQgbue6", + "title": "Cook" + }, + { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 1600, + "currency": "USD" + }, + "id": "FxLbs5KpPUHa8wyt5ctjubDX", + "title": "Barista" + }, + { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 1700, + "currency": "USD" + }, + "id": "vD1wCgijMDR3cX5TPnu7VXto", + "title": "Cashier" + } + ] + } + }, + "ListEmployeesResponse": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "employees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Employee" + } + }, + "cursor": { + "type": "string", + "description": "The token to be used to retrieve the next page of results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + } + }, + "ListEventTypesResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListEventTypes](api-endpoint:Events-ListEventTypes) endpoint.\n\nNote: if there are errors processing the request, the event types field will not be\npresent.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "event_types": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of event types." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EventTypeMetadata" + }, + "description": "Contains the metadata of an event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata)." + } + }, + "example": { + "event_types": [ + "inventory.count.updated" + ], + "metadata": [ + { + "api_version_introduced": "2018-07-12", + "event_type": "inventory.count.updated", + "release_status": "PUBLIC" + } + ] + } + }, + "ListGiftCardActivitiesResponse": { + "type": "object", + "description": "A response that contains a list of `GiftCardActivity` objects. If the request resulted in errors, \nthe response contains a set of `Error` objects.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card_activities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCardActivity" + }, + "description": "The requested gift card activities or an empty object if none are found." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can use in a\nsubsequent request to retrieve the next set of activities. If a cursor is not present, this is\nthe final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." + } + }, + "example": { + "gift_card_activities": [ + { + "created_at": "2021-06-02T22:26:38.000Z", + "gift_card_balance_money": { + "amount": 700, + "currency": "USD" + }, + "gift_card_gan": "7783320002929081", + "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + "id": "gcact_897698f894b44b3db46c6147e26a0e19", + "location_id": "81FN9BNFZTKS4", + "payment_id": "dEv2eksNPy6GqdYiLe4ZBNk6HqXZY", + "redeem_activity_details": { + "amount_money": { + "amount": 300, + "currency": "USD" + } + }, + "status": "COMPLETED", + "type": "REDEEM" + }, + { + "activate_activity_details": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", + "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gift_card_balance_money": { + "amount": 1000, + "currency": "USD" + }, + "gift_card_gan": "7783320002929081", + "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + "id": "gcact_b968ebfc7d46437b945be7b9e09123b4", + "location_id": "81FN9BNFZTKS4", + "type": "ACTIVATE" + } + ] + } + }, + "ListGiftCardsResponse": { + "type": "object", + "description": "A response that contains a list of `GiftCard` objects. If the request resulted in errors, \nthe response contains a set of `Error` objects.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_cards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCard" + }, + "description": "The requested gift cards or an empty object if none are found." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can use in a\nsubsequent request to retrieve the next set of gift cards. If a cursor is not present, this is\nthe final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." + } + }, + "example": { + "cursor": "JbFmyvUpaNKsfC1hoLSA4WlqkgkZXTWeKuStajR5BkP7OE0ETAbeWSi6U6u7sH", + "gift_cards": [ + { + "balance_money": { + "amount": 3900, + "currency": "USD" + }, + "created_at": "2021-06-09T22:26:54.000Z", + "gan": "7783320008524605", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "ACTIVE", + "type": "DIGITAL" + }, + { + "balance_money": { + "amount": 2000, + "currency": "USD" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gan": "7783320002692465", + "gan_source": "SQUARE", + "id": "gftc:00128a12725b41e58e0de1d20497a9dd", + "state": "ACTIVE", + "type": "DIGITAL" + } + ] + } + }, + "ListInvoicesResponse": { + "type": "object", + "description": "Describes a `ListInvoice` response.", + "x-release-status": "PUBLIC", + "properties": { + "invoices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Invoice" + }, + "description": "The invoices retrieved." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can use in a \nsubsequent request to retrieve the next set of invoices. If empty, this is the final \nresponse. \nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "cursor": "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", + "invoices": [ + { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "attachments": [ + { + "description": "Service contract", + "filename": "file.jpg", + "filesize": 102705, + "hash": "273ee02cb6f5f8a3a8ca23604930dd53", + "id": "inva:0-3bB9ZuDHiziThQhuC4fwWt", + "mime_type": "image/jpeg", + "uploaded_at": "2030-01-13T21:24:10Z" + } + ], + "created_at": "2030-01-13T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2030-01-13T21:24:10Z", + "version": 1 + }, + { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": true + }, + "created_at": "2021-01-23T15:29:12Z", + "delivery_method": "EMAIL", + "id": "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", + "invoice_number": "inv-455", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "order_id": "a65jnS8NXbfprvGJzY9F4fQTuaB", + "payment_requests": [ + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "due_date": "2021-01-23", + "percentage_requested": "25", + "request_type": "DEPOSIT", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "uid": "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176" + }, + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "due_date": "2021-06-15", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "120c5e18-4f80-4f6b-b159-774cb9bf8f99" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "public_url": "https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9", + "sale_or_service_date": "2030-01-24", + "status": "PARTIALLY_PAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "updated_at": "2021-01-23T15:29:56Z", + "version": 3 + } + ] + } + }, + "ListJobsResponse": { + "type": "object", + "description": "Represents a [ListJobs](api-endpoint:Team-ListJobs) response. Either `jobs` or `errors`\nis present in the response. If additional results are available, the `cursor` field is also present.", + "x-release-status": "BETA", + "properties": { + "jobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Job" + }, + "description": "The retrieved jobs. A single paged response contains up to 100 jobs." + }, + "cursor": { + "type": "string", + "description": "An opaque cursor used to retrieve the next page of results. This field is present only\nif the request succeeded and additional results are available. For more information, see\n[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "jobs": [ + { + "created_at": "2021-06-11T22:55:45Z", + "id": "VDNpRv8da51NU8qZFC5zDWpF", + "is_tip_eligible": true, + "title": "Cashier", + "updated_at": "2021-06-11T22:55:45Z", + "version": 2 + }, + { + "created_at": "2021-06-11T22:55:45Z", + "id": "FjS8x95cqHiMenw4f1NAUH4P", + "is_tip_eligible": false, + "title": "Chef", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + ] + } + }, + "ListLocationBookingProfilesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "location_booking_profiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationBookingProfile" + }, + "description": "The list of a seller's location booking profiles." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "errors": [], + "location_booking_profiles": [ + { + "booking_site_url": "https://squareup.com/book/LY6WNBPVM6VGV/testbusiness", + "location_id": "LY6WNBPVM6VGV", + "online_booking_enabled": true + }, + { + "location_id": "PYTRNBPVMJUPV", + "online_booking_enabled": false + } + ] + } + }, + "ListLocationCustomAttributeDefinitionsResponse": { + "type": "object", + "description": "Represents a [ListLocationCustomAttributeDefinitions](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributeDefinitions) response.\nEither `custom_attribute_definitions`, an empty object, or `errors` is present in the response.\nIf additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definitions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeDefinition" + }, + "description": "The retrieved custom attribute definitions. If no custom attribute definitions are found,\nSquare returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of\nresults for your original request. This field is present only if the request succeeded and\nadditional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", + "custom_attribute_definitions": [ + { + "created_at": "2022-12-02T19:50:21.832Z", + "description": "Location's phone number", + "key": "phone-number", + "name": "phone number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.PhoneNumber" + }, + "updated_at": "2022-12-02T19:50:21.832Z", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-12-03T10:17:52.341Z", + "version": 4, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + ] + } + }, + "ListLocationCustomAttributesResponse": { + "type": "object", + "description": "Represents a [ListLocationCustomAttributes](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributes) response.\nEither `custom_attributes`, an empty object, or `errors` is present in the response. If additional\nresults are available, the `cursor` field is also present along with `custom_attributes`.", + "x-release-status": "BETA", + "properties": { + "custom_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttribute" + }, + "description": "The retrieved custom attributes. If `with_definitions` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field of each custom attribute.\nIf no custom attributes are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to use in your next call to this endpoint to retrieve the next page of results\nfor your original request. This field is present only if the request succeeded and additional\nresults are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attributes": [ + { + "created_at": "2022-12-12T18:13:03.745Z", + "key": "phone-number", + "updated_at": "2022-12-12T18:13:03.745Z", + "value": "+12223334444", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + { + "created_at": "2022-12-12T19:27:57.975Z", + "key": "bestseller", + "updated_at": "2022-12-12T19:27:57.975Z", + "value": "hot cocoa", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + ] + } + }, + "ListLocationsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of a request\nto the [ListLocations](api-endpoint:Locations-ListLocations) endpoint.\n\nEither `errors` or `locations` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "locations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Location" + }, + "description": "The business locations." + } + }, + "example": { + "locations": [ + { + "address": { + "address_line_1": "123 Main St", + "administrative_district_level_1": "CA", + "country": "US", + "locality": "San Francisco", + "postal_code": "94114" + }, + "business_name": "Jet Fuel Coffee", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ], + "country": "US", + "created_at": "2016-09-19T17:33:12Z", + "currency": "USD", + "id": "18YC4JDH91E1H", + "language_code": "en-US", + "merchant_id": "3MYCJG5GVYQ8Q", + "name": "Grant Park", + "phone_number": "+1 650-354-7217", + "status": "ACTIVE", + "timezone": "America/Los_Angeles" + }, + { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309" + }, + "business_name": "Jet Fuel Coffee", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ], + "coordinates": { + "latitude": 33.7889, + "longitude": -84.3841 + }, + "country": "US", + "created_at": "2022-02-19T17:58:25Z", + "currency": "USD", + "description": "Midtown Atlanta store", + "id": "3Z4V4WHQK64X9", + "language_code": "en-US", + "mcc": "7299", + "merchant_id": "3MYCJG5GVYQ8Q", + "name": "Midtown", + "status": "ACTIVE", + "timezone": "America/New_York", + "type": "PHYSICAL" + } + ] + } + }, + "ListLoyaltyProgramsResponse": { + "type": "object", + "description": "A response that contains all loyalty programs.", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "programs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyProgram" + }, + "description": "A list of `LoyaltyProgram` for the merchant." + } + }, + "example": { + "programs": [ + { + "accrual_rules": [ + { + "accrual_type": "SPEND", + "points": 1, + "spend_data": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "excluded_category_ids": [ + "7ZERJKO5PVYXCVUHV2JCZ2UG", + "FQKAOJE5C4FIMF5A2URMLW6V" + ], + "excluded_item_variation_ids": [ + "CBZXBUVVTYUBZGQO44RHMR6B", + "EDILT24Z2NISEXDKGY6HP7XV" + ], + "tax_mode": "BEFORE_TAX" + } + } + ], + "created_at": "2020-04-20T16:55:11Z", + "id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "location_ids": [ + "P034NEENMD09F" + ], + "reward_tiers": [ + { + "created_at": "2020-04-20T16:55:11Z", + "id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "name": "10% off entire sale", + "points": 10, + "pricing_rule_reference": { + "catalog_version": "1605486402527", + "object_id": "74C4JSHESNLTB2A7ITO5HO6F" + } + } + ], + "status": "ACTIVE", + "terminology": { + "one": "Point", + "other": "Points" + }, + "updated_at": "2020-05-01T02:00:02Z" + } + ] + } + }, + "ListLoyaltyPromotionsResponse": { + "type": "object", + "description": "Represents a [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) response.\nOne of `loyalty_promotions`, an empty object, or `errors` is present in the response.\nIf additional results are available, the `cursor` field is also present along with `loyalty_promotions`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_promotions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyPromotion" + }, + "description": "The retrieved loyalty promotions." + }, + "cursor": { + "type": "string", + "description": "The cursor to use in your next call to this endpoint to retrieve the next page of results\nfor your original request. This field is present only if the request succeeded and additional\nresults are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "loyalty_promotions": [ + { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ] + }, + "created_at": "2022-08-16T08:38:54Z", + "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", + "incentive": { + "points_multiplier_data": { + "multiplier": "3.000", + "points_multiplier": 3 + }, + "type": "POINTS_MULTIPLIER" + }, + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "name": "Tuesday Happy Hour Promo", + "qualifying_item_variation_ids": [ + "CJ3RYL56ITAKMD4VRCM7XERS", + "AT3RYLR3TUA9C34VRCB7X5RR" + ], + "status": "ACTIVE", + "trigger_limit": { + "interval": "DAY", + "times": 1 + }, + "updated_at": "2022-08-16T08:38:54Z" + }, + { + "available_time": { + "end_date": "2022-08-01", + "start_date": "2022-07-01", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220704T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=MO\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220705T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220706T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=WE\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220707T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TH\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220701T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=FR\nEND:VEVENT" + ] + }, + "created_at": "2022-06-27T15:37:38Z", + "id": "loypromo_e696f057-2286-35ff-8108-132241328106", + "incentive": { + "points_multiplier_data": { + "multiplier": "2.000", + "points_multiplier": 2 + }, + "type": "POINTS_MULTIPLIER" + }, + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "July Special", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "status": "ENDED", + "trigger_limit": { + "interval": "ALL_TIME", + "times": 5 + }, + "updated_at": "2022-06-27T15:37:38Z" + } + ] + } + }, + "ListMerchantCustomAttributeDefinitionsResponse": { + "type": "object", + "description": "Represents a [ListMerchantCustomAttributeDefinitions](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributeDefinitions) response.\nEither `custom_attribute_definitions`, an empty object, or `errors` is present in the response.\nIf additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definitions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeDefinition" + }, + "description": "The retrieved custom attribute definitions. If no custom attribute definitions are found,\nSquare returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of\nresults for your original request. This field is present only if the request succeeded and\nadditional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", + "custom_attribute_definitions": [ + { + "created_at": "2023-05-05T16:50:21.832Z", + "description": "Whether the merchant has seen the tutorial screen for using the app.", + "key": "has_seen_tutorial", + "name": "NAME", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2023-05-05T16:50:21.832Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + { + "created_at": "2023-05-05T19:06:36.559Z", + "description": "This is the other name this merchant goes by.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2023-05-05T10:17:52.341Z", + "version": 4, + "visibility": "VISIBILITY_READ_ONLY" + } + ] + } + }, + "ListMerchantCustomAttributesResponse": { + "type": "object", + "description": "Represents a [ListMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributes) response.\nEither `custom_attributes`, an empty object, or `errors` is present in the response. If additional\nresults are available, the `cursor` field is also present along with `custom_attributes`.", + "x-release-status": "BETA", + "properties": { + "custom_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttribute" + }, + "description": "The retrieved custom attributes. If `with_definitions` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field of each custom attribute.\nIf no custom attributes are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to use in your next call to this endpoint to retrieve the next page of results\nfor your original request. This field is present only if the request succeeded and additional\nresults are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attributes": [ + { + "created_at": "2023-05-05T18:13:03.745Z", + "key": "has_seen_tutorial", + "updated_at": "2023-05-05T18:13:03.745Z", + "value": true, + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + { + "created_at": "2023-05-05T19:27:57.975Z", + "key": "alternative_seller_name", + "updated_at": "2023-05-05T19:27:57.975Z", + "value": "Ultimate Sneaker Store", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + } + ] + } + }, + "ListMerchantsResponse": { + "type": "object", + "description": "The response object returned by the [ListMerchant](api-endpoint:Merchants-ListMerchants) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "merchant": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Merchant" + }, + "description": "The requested `Merchant` entities." + }, + "cursor": { + "type": "integer", + "description": "If the response is truncated, the cursor to use in next request to fetch next set of objects." + } + }, + "example": { + "merchant": [ + { + "business_name": "Apple A Day", + "country": "US", + "created_at": "2021-12-10T19:25:52.484Z", + "currency": "USD", + "id": "DM7VKY8Q63GNP", + "language_code": "en-US", + "main_location_id": "9A65CGC72ZQG1", + "status": "ACTIVE" + } + ] + } + }, + "ListOrderCustomAttributeDefinitionsResponse": { + "type": "object", + "description": "Represents a response from listing order custom attribute definitions.", + "x-release-status": "BETA", + "required": [ + "custom_attribute_definitions" + ], + "properties": { + "custom_attribute_definitions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeDefinition" + }, + "description": "The retrieved custom attribute definitions. If no custom attribute definitions are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of results for your original request. \nThis field is present only if the request succeeded and additional results are available.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "minLength": 1 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definitions": [ + { + "created_at": "2022-11-16T18:03:44.051Z", + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-11-16T18:03:44.051Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + { + "created_at": "2022-11-16T18:04:32.059Z", + "description": "The identifier for a particular seat", + "key": "seat-number", + "name": "Seat number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-11-16T18:04:32.059Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + { + "created_at": "2022-11-16T18:04:21.912Z", + "description": "The identifier for a particular table", + "key": "table-number", + "name": "Table number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-11-16T18:04:21.912Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + ] + } + }, + "ListOrderCustomAttributesResponse": { + "type": "object", + "description": "Represents a response from listing order custom attributes.", + "x-release-status": "BETA", + "properties": { + "custom_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttribute" + }, + "description": "The retrieved custom attributes. If no custom attribute are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of results for your original request. \nThis field is present only if the request succeeded and additional results are available.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "minLength": 1 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attributes": [ + { + "created_at": "2022-11-10T17:31:36.111Z", + "key": "wayne-test-15", + "updated_at": "2022-11-10T17:31:36.111Z", + "value": "TEST", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + ] + } + }, + "ListPaymentLinksResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + }, + "payment_links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentLink" + }, + "description": "The list of payment links." + }, + "cursor": { + "type": "string", + "description": " When a response is truncated, it includes a cursor that you can use in a subsequent request\nto retrieve the next set of gift cards. If a cursor is not present, this is the final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "cursor": "MTY1NQ==", + "payment_links": [ + { + "checkout_options": { + "ask_for_shipping_address": true + }, + "created_at": "2022-04-26T00:15:15Z", + "id": "TN4BWEDJ9AI5MBIV", + "order_id": "Qqc6yppGvxVwc46Cch4zHTaJqc4F", + "payment_note": "test", + "updated_at": "2022-04-26T00:18:24Z", + "url": "https://square.link/u/EXAMPLE", + "version": 2 + }, + { + "created_at": "2022-04-11T23:14:59Z", + "description": "", + "id": "RY5UNCUMPJN5XKCT", + "order_id": "EmBmGt3zJD15QeO1dxzBTxMxtwfZY", + "url": "https://square.link/u/EXAMPLE", + "version": 1 + } + ] + } + }, + "ListPaymentRefundsRequestSortField": { + "type": "string", + "enum": [ + "CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "CREATED_AT", + "description": "" + }, + { + "name": "UPDATED_AT", + "description": "" + } + ], + "x-release-status": "PUBLIC" + }, + "ListPaymentRefundsResponse": { + "type": "object", + "description": "Defines the response returned by [ListPaymentRefunds](api-endpoint:Refunds-ListPaymentRefunds).\n\nEither `errors` or `refunds` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refunds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentRefund" + }, + "description": "The list of requested refunds." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "cursor": "5evquW1YswHoT4EoyUhzMmTsCnsSXBU9U0WJ4FU4623nrMQcocH0RGU6Up1YkwfiMcF59ood58EBTEGgzMTGHQJpocic7ExOL0NtrTXCeWcv0UJIJNk8eXb", + "refunds": [ + { + "amount_money": { + "amount": 555, + "currency": "USD" + }, + "created_at": "2021-10-13T19:59:05.342Z", + "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", + "location_id": "L88917AVBK2S5", + "order_id": "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", + "payment_id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "processing_fee": [ + { + "amount_money": { + "amount": -34, + "currency": "USD" + }, + "effective_at": "2021-10-13T21:34:35.000Z", + "type": "INITIAL" + } + ], + "reason": "Example Refund", + "status": "COMPLETED", + "updated_at": "2021-10-13T20:00:03.497Z" + } + ] + } + }, + "ListPaymentsRequestSortField": { + "type": "string", + "enum": [ + "CREATED_AT", + "OFFLINE_CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "CREATED_AT", + "description": "" + }, + { + "name": "OFFLINE_CREATED_AT", + "description": "" + }, + { + "name": "UPDATED_AT", + "description": "" + } + ], + "x-release-status": "PUBLIC" + }, + "ListPaymentsResponse": { + "type": "object", + "description": "Defines the response returned by [ListPayments](api-endpoint:Payments-ListPayments).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "payments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment" + }, + "description": "The requested list of payments." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "payments": [ + { + "amount_money": { + "amount": 555, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", + "square_product": "VIRTUAL_TERMINAL" + }, + "approved_money": { + "amount": 555, + "currency": "USD" + }, + "card_details": { + "auth_result_code": "2Nkw7q", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T19:34:33.680Z", + "captured_at": "2021-10-13T19:34:34.340Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "KEYED", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "CAPTURED" + }, + "created_at": "2021-10-13T19:34:33.524Z", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T19:34:33.524Z", + "employee_id": "TMoK_ogh6rH1o4dV", + "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "location_id": "L88917AVBK2S5", + "note": "Test Note", + "order_id": "d7eKah653Z579f3gVtjlxpSlmUcZY", + "processing_fee": [ + { + "amount_money": { + "amount": 34, + "currency": "USD" + }, + "effective_at": "2021-10-13T21:34:35.000Z", + "type": "INITIAL" + } + ], + "receipt_number": "bP9m", + "receipt_url": "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "source_type": "CARD", + "status": "COMPLETED", + "team_member_id": "TMoK_ogh6rH1o4dV", + "total_money": { + "amount": 555, + "currency": "USD" + }, + "updated_at": "2021-10-13T19:34:37.261Z", + "version_token": "vguW2km0KpVCdAXZcNTZ438qg5LlVPTP4HO5OpiHNfa6o" + } + ] + } + }, + "ListPayoutEntriesResponse": { + "type": "object", + "description": "The response to retrieve payout records entries.", + "x-release-status": "PUBLIC", + "properties": { + "payout_entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayoutEntry" + }, + "description": "The requested list of payout entries, ordered with the given or default sort order." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty, this is the final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "cursor": "TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO", + "payout_entries": [ + { + "effective_at": "2021-12-14T23:31:49Z", + "fee_amount_money": { + "amount": -2, + "currency_code": "USD" + }, + "gross_amount_money": { + "amount": -50, + "currency_code": "USD" + }, + "id": "poe_ZQWcw41d0SGJS6IWd4cSi8mKHk", + "net_amount_money": { + "amount": -48, + "currency_code": "USD" + }, + "payout_id": "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", + "type": "REFUND", + "type_refund_details": { + "payment_id": "HVdG62HeMlti8YYf94oxrN", + "refund_id": "HVdG62HeMlti8YYf94oxrN_dR8Nztxg7umf94oxrN12Ji5r2KW14FAY" + } + }, + { + "effective_at": "2021-12-14T23:31:49Z", + "fee_amount_money": { + "amount": 19, + "currency_code": "USD" + }, + "gross_amount_money": { + "amount": 100, + "currency_code": "USD" + }, + "id": "poe_EibbY9Ob1d0SGJS6IWd4cSiSi6wkaPk", + "net_amount_money": { + "amount": 81, + "currency_code": "USD" + }, + "payout_id": "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", + "type": "CHARGE", + "type_charge_details": { + "payment_id": "HVdG62H5K3291d0SGJS6IWd4cSi8YY" + } + } + ] + } + }, + "ListPayoutsResponse": { + "type": "object", + "description": "The response to retrieve payout records entries.", + "x-release-status": "PUBLIC", + "properties": { + "payouts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Payout" + }, + "description": "The requested list of payouts." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty, this is the final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "cursor": "EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU", + "payouts": [ + { + "amount_money": { + "amount": 6259, + "currency_code": "USD" + }, + "arrival_date": "2022-03-29", + "created_at": "2022-03-29T16:12:31Z", + "destination": { + "id": "ccof:ZPp3oedR3AeEUNd3z7", + "type": "CARD" + }, + "end_to_end_id": "L2100000005", + "id": "po_b345d2c7-90b3-4f0b-a2aa-df1def7f8afc", + "location_id": "L88917AVBK2S5", + "payout_fee": [ + { + "amount_money": { + "amount": 95, + "currency_code": "USD" + }, + "effective_at": "2022-03-29T16:12:31Z", + "type": "TRANSFER_FEE" + } + ], + "status": "PAID", + "type": "BATCH", + "updated_at": "2022-03-30T01:07:22.875Z", + "version": 2 + }, + { + "amount_money": { + "amount": -103, + "currency_code": "USD" + }, + "arrival_date": "2022-03-24", + "created_at": "2022-03-24T03:07:09Z", + "destination": { + "id": "bact:ZPp3oedR3AeEUNd3z7", + "type": "BANK_ACCOUNT" + }, + "end_to_end_id": "L2100000006", + "id": "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", + "location_id": "L88917AVBK2S5", + "status": "PAID", + "type": "BATCH", + "updated_at": "2022-03-24T03:07:09Z", + "version": 1 + } + ] + } + }, + "ListSitesResponse": { + "type": "object", + "description": "Represents a `ListSites` response. The response can include either `sites` or `errors`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "sites": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Site" + }, + "description": "The sites that belong to the seller." + } + }, + "example": { + "sites": [ + { + "created_at": "2020-10-28T13:22:51.000000Z", + "domain": "mysite2.square.site", + "id": "site_278075276488921835", + "is_published": false, + "site_title": "My Second Site", + "updated_at": "2020-10-28T13:22:51.000000Z" + }, + { + "created_at": "2020-06-18T17:45:13.000000Z", + "domain": "mysite1.square.site", + "id": "site_102725345836253849", + "is_published": true, + "site_title": "My First Site", + "updated_at": "2020-11-23T02:19:10.000000Z" + } + ] + } + }, + "ListSubscriptionEventsResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[ListSubscriptionEvents](api-endpoint:Subscriptions-ListSubscriptionEvents).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription_events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionEvent" + }, + "description": "The retrieved subscription events." + }, + "cursor": { + "type": "string", + "description": "When the total number of resulting subscription events exceeds the limit of a paged response, \nthe response includes a cursor for you to use in a subsequent request to fetch the next set of events.\nIf the cursor is unset, the response contains the last page of the results.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "subscription_events": [ + { + "effective_date": "2020-04-24", + "id": "06809161-3867-4598-8269-8aea5be4f9de", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "START_SUBSCRIPTION" + }, + { + "effective_date": "2020-05-01", + "id": "f2736603-cd2e-47ec-8675-f815fff54f88", + "info": { + "code": "CUSTOMER_NO_NAME", + "detail": "The customer with ID `V74BMG0GPS2KNCWJE1BTYJ37Y0` does not have a name on record." + }, + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "DEACTIVATE_SUBSCRIPTION" + }, + { + "effective_date": "2022-05-01", + "id": "b426fc85-6859-450b-b0d0-fe3a5d1b565f", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "RESUME_SUBSCRIPTION" + }, + { + "effective_date": "2022-09-01", + "id": "09f14de1-2f53-4dae-9091-49aa53f83d01", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "PAUSE_SUBSCRIPTION" + }, + { + "effective_date": "2022-12-01", + "id": "f28a73ac-1a1b-4b0f-8eeb-709a72945776", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "RESUME_SUBSCRIPTION" + }, + { + "effective_date": "2023-04-01", + "id": "1eee8790-472d-4efe-8c69-8ad84e9cefe0", + "plan_variation_id": "02CD53CFA4d1498AFAD42", + "subscription_event_type": "PLAN_CHANGE" + }, + { + "effective_date": "2023-06-21", + "id": "a0c08083-5db0-4800-85c7-d398de4fbb6e", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "STOP_SUBSCRIPTION" + } + ] + } + }, + "ListTeamMemberBookingProfilesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "team_member_booking_profiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TeamMemberBookingProfile" + }, + "description": "The list of team member booking profiles. The results are returned in the ascending order of the time\nwhen the team member booking profiles were last updated. Multiple booking profiles updated at the same time\nare further sorted in the ascending order of their IDs." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set.", + "maxLength": 65536 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "errors": [], + "team_member_booking_profiles": [ + { + "display_name": "Sandbox Seller", + "is_bookable": true, + "team_member_id": "TMXUrsBWWcHTt79t" + }, + { + "display_name": "Sandbox Staff", + "is_bookable": true, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ] + } + }, + "ListTeamMemberWagesResponse": { + "type": "object", + "description": "The response to a request for a set of `TeamMemberWage` objects. The response contains\na set of `TeamMemberWage` objects.", + "x-release-status": "PUBLIC", + "properties": { + "team_member_wages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TeamMemberWage" + }, + "description": "A page of `TeamMemberWage` results." + }, + "cursor": { + "type": "string", + "description": "The value supplied in the subsequent request to fetch the next page\nof `TeamMemberWage` results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + "team_member_wages": [ + { + "hourly_rate": { + "amount": 3250, + "currency": "USD" + }, + "id": "pXS3qCv7BERPnEGedM4S8mhm", + "job_id": "jxJNN6eCJsLrhg5UFJrDWDGE", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": false, + "title": "Manager" + }, + { + "hourly_rate": { + "amount": 2600, + "currency": "USD" + }, + "id": "rZduCkzYDUVL3ovh1sQgbue6", + "job_id": "gcbz15vKGnMKmaWJJ152kjim", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": true, + "title": "Cook" + }, + { + "hourly_rate": { + "amount": 1600, + "currency": "USD" + }, + "id": "FxLbs5KpPUHa8wyt5ctjubDX", + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": true, + "title": "Barista" + }, + { + "hourly_rate": { + "amount": 1700, + "currency": "USD" + }, + "id": "vD1wCgijMDR3cX5TPnu7VXto", + "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": true, + "title": "Cashier" + } + ] + } + }, + "ListTransactionsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListTransactions](api-endpoint:Transactions-ListTransactions) endpoint.\n\nOne of `errors` or `transactions` is present in a given response (never both).", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Transaction" + }, + "description": "An array of transactions that match your query." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor for retrieving the next set of results,\nif any remain. Provide this value as the `cursor` parameter in a subsequent\nrequest to this endpoint.\n\nSee [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information." + } + }, + "example": { + "transactions": [ + { + "created_at": "2016-01-20T22:57:56Z", + "id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "location_id": "18YC4JDH91E1H", + "product": "EXTERNAL_API", + "reference_id": "some optional reference id", + "refunds": [ + { + "additional_recipients": [ + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "amount_money": { + "amount": 5000, + "currency": "USD" + }, + "created_at": "2016-01-20T22:59:20Z", + "id": "7a5RcVI0CxbOcJ2wMOkE", + "location_id": "18YC4JDH91E1H", + "processing_fee_money": { + "amount": 138, + "currency": "USD" + }, + "reason": "some reason why", + "status": "APPROVED", + "tender_id": "MtZRYYdDrYNQbOvV7nbuBvMF", + "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF" + } + ], + "tenders": [ + { + "additional_recipients": [ + { + "amount_money": { + "amount": 20, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "amount_money": { + "amount": 5000, + "currency": "USD" + }, + "card_details": { + "card": { + "card_brand": "VISA", + "last_4": "1111" + }, + "entry_method": "KEYED", + "status": "CAPTURED" + }, + "created_at": "2016-01-20T22:57:56Z", + "id": "MtZRYYdDrYNQbOvV7nbuBvMF", + "location_id": "18YC4JDH91E1H", + "note": "some optional note", + "processing_fee_money": { + "amount": 138, + "currency": "USD" + }, + "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "type": "CARD" + } + ] + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ListTransactions/ListTransactionsResponse.csharp", + "java": "/sdk_samples/ListTransactions/ListTransactionsResponse.java", + "javascript": "/sdk_samples/ListTransactions/ListTransactionsResponse.javascript", + "php": "/sdk_samples/ListTransactions/ListTransactionsResponse.php", + "python": "/sdk_samples/ListTransactions/ListTransactionsResponse.python", + "ruby": "/sdk_samples/ListTransactions/ListTransactionsResponse.ruby" + } + }, + "ListWebhookEventTypesResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListWebhookEventTypes](api-endpoint:WebhookSubscriptions-ListWebhookEventTypes) endpoint.\n\nNote: if there are errors processing the request, the event types field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "event_types": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of event types." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EventTypeMetadata" + }, + "description": "Contains the metadata of a webhook event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata)." + } + }, + "example": { + "event_types": [ + "inventory.count.updated" + ], + "metadata": [ + { + "api_version_introduced": "2018-07-12", + "event_type": "inventory.count.updated", + "release_status": "PUBLIC" + } + ] + } + }, + "ListWebhookSubscriptionsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListWebhookSubscriptions](api-endpoint:WebhookSubscriptions-ListWebhookSubscriptions) endpoint.\n\nNote: if there are errors processing the request, the subscriptions field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "subscriptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebhookSubscription" + }, + "description": "The requested list of [Subscription](entity:WebhookSubscription)s." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "subscriptions": [ + { + "api_version": "2021-12-15", + "created_at": "2022-01-10 23:29:48 +0000 UTC", + "enabled": true, + "event_types": [ + "payment.created", + "payment.updated" + ], + "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", + "name": "Example Webhook Subscription", + "notification_url": "https://example-webhook-url.com", + "updated_at": "2022-01-10 23:29:48 +0000 UTC" + } + ] + } + }, + "ListWorkweekConfigsResponse": { + "type": "object", + "description": "The response to a request for a set of `WorkweekConfig` objects. The response contains\nthe requested `WorkweekConfig` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "workweek_configs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorkweekConfig" + }, + "description": "A page of `WorkweekConfig` results." + }, + "cursor": { + "type": "string", + "description": "The value supplied in the subsequent request to fetch the next page of\n`WorkweekConfig` results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + "workweek_configs": [ + { + "created_at": "2016-02-04T00:58:24Z", + "id": "FY4VCAQN700GM", + "start_of_day_local_time": "10:00", + "start_of_week": "MON", + "updated_at": "2019-02-28T01:04:35Z", + "version": 11 + } + ] + } + }, + "Location": { + "type": "object", + "description": "Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A short generated string of letters and numbers that uniquely identifies this location instance.", + "maxLength": 32, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the location.\nThis information appears in the Seller Dashboard as the nickname.\nA location name must be unique within a seller account.", + "maxLength": 255, + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address of the location.", + "nullable": true + }, + "timezone": { + "type": "string", + "description": "The [IANA time zone](https://www.iana.org/time-zones) identifier for\nthe time zone of the location. For example, `America/Los_Angeles`.", + "maxLength": 30, + "nullable": true + }, + "capabilities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationCapability" + }, + "description": "The Square features that are enabled for the location.\nSee [LocationCapability](entity:LocationCapability) for possible values.\nSee [LocationCapability](#type-locationcapability) for possible values", + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/LocationStatus", + "description": "The status of the location.\nSee [LocationStatus](#type-locationstatus) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the location was created, in RFC 3339 format.\nFor more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates).", + "minLength": 20, + "maxLength": 25, + "readOnly": true + }, + "merchant_id": { + "type": "string", + "description": "The ID of the merchant that owns the location.", + "maxLength": 32, + "readOnly": true + }, + "country": { + "$ref": "#/components/schemas/Country", + "description": "The country of the location, in the two-letter format of ISO 3166. For example, `US` or `JP`.\n\nSee [Country](entity:Country) for possible values.\nSee [Country](#type-country) for possible values", + "readOnly": true + }, + "language_code": { + "type": "string", + "description": "The language associated with the location, in\n[BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A).\nFor more information, see [Language Preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences).", + "minLength": 2, + "maxLength": 5, + "nullable": true + }, + "currency": { + "$ref": "#/components/schemas/Currency", + "description": "The currency used for all transactions at this location,\nin ISO 4217 format. For example, the currency code for US dollars is `USD`.\nSee [Currency](entity:Currency) for possible values.\nSee [Currency](#type-currency) for possible values", + "readOnly": true + }, + "phone_number": { + "type": "string", + "description": "The phone number of the location. For example, `+1 855-700-6000`.", + "maxLength": 17, + "nullable": true + }, + "business_name": { + "type": "string", + "description": "The name of the location's overall business. This name is present on receipts and other customer-facing branding, and can be changed no more than three times in a twelve-month period.", + "maxLength": 255, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/LocationType", + "description": "The type of the location.\nSee [LocationType](#type-locationtype) for possible values", + "nullable": true + }, + "website_url": { + "type": "string", + "description": "The website URL of the location. For example, `https://squareup.com`.", + "maxLength": 255, + "nullable": true + }, + "business_hours": { + "$ref": "#/components/schemas/BusinessHours", + "description": "The hours of operation for the location.", + "nullable": true + }, + "business_email": { + "type": "string", + "description": "The email address of the location. This can be unique to the location and is not always the email address for the business owner or administrator.", + "maxLength": 255, + "nullable": true + }, + "description": { + "type": "string", + "description": "The description of the location. For example, `Main Street location`.", + "maxLength": 1024, + "nullable": true + }, + "twitter_username": { + "type": "string", + "description": "The Twitter username of the location without the '@' symbol. For example, `Square`.", + "minLength": 1, + "maxLength": 15, + "nullable": true + }, + "instagram_username": { + "type": "string", + "description": "The Instagram username of the location without the '@' symbol. For example, `square`.", + "minLength": 1, + "maxLength": 30, + "nullable": true + }, + "facebook_url": { + "type": "string", + "description": "The Facebook profile URL of the location. The URL should begin with 'facebook.com/'. For example, `https://www.facebook.com/square`.", + "maxLength": 255, + "nullable": true + }, + "coordinates": { + "$ref": "#/components/schemas/Coordinates", + "description": "The physical coordinates (latitude and longitude) of the location.", + "nullable": true + }, + "logo_url": { + "type": "string", + "description": "The URL of the logo image for the location. When configured in the Seller\nDashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that Square generates on behalf of the seller.\nThis image should have a roughly square (1:1) aspect ratio and should be at least 200x200 pixels.", + "maxLength": 255, + "readOnly": true + }, + "pos_background_url": { + "type": "string", + "description": "The URL of the Point of Sale background image for the location.", + "maxLength": 255, + "readOnly": true + }, + "mcc": { + "type": "string", + "description": "A four-digit number that describes the kind of goods or services sold at the location.\nThe [merchant category code (MCC)](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) of the location as standardized by ISO 18245.\nFor example, `5045`, for a location that sells computer goods and software.", + "minLength": 4, + "maxLength": 4, + "x-release-status": "BETA", + "nullable": true + }, + "full_format_logo_url": { + "type": "string", + "description": "The URL of a full-format logo image for the location. When configured in the Seller\nDashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that Square generates on behalf of the seller.\nThis image can be wider than it is tall and should be at least 1280x648 pixels.", + "readOnly": true + }, + "tax_ids": { + "$ref": "#/components/schemas/TaxIds", + "description": "The tax IDs for this location.", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "LocationBookingProfile": { + "type": "object", + "description": "The booking profile of a seller's location, including the location's ID and whether the location is enabled for online booking.", + "x-release-status": "PUBLIC", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location).", + "nullable": true + }, + "booking_site_url": { + "type": "string", + "description": "Url for the online booking site for this location.", + "nullable": true + }, + "online_booking_enabled": { + "type": "boolean", + "description": "Indicates whether the location is enabled for online booking.", + "nullable": true + } + } + }, + "LocationCapability": { + "type": "string", + "enum": [ + "CREDIT_CARD_PROCESSING", + "AUTOMATIC_TRANSFERS", + "UNLINKED_REFUNDS" + ], + "x-enum-elements": [ + { + "name": "CREDIT_CARD_PROCESSING", + "description": "The capability to process credit card transactions with Square." + }, + { + "name": "AUTOMATIC_TRANSFERS", + "description": "The capability to receive automatic transfers from Square." + }, + { + "name": "UNLINKED_REFUNDS", + "description": "The capability to process unlinked refunds with Square." + } + ], + "description": "The capabilities a location might have.", + "x-release-status": "PUBLIC" + }, + "LocationCreatedEvent": { + "type": "object", + "description": "Published when a [Location](entity:Location) is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the [Location](entity:Location) associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"location.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LocationCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T21:27:34.308Z", + "data": { + "id": "S8GWD5DBJ3HF3", + "type": "Location" + }, + "event_id": "de45d351-8ad2-400a-97af-e9f89da3d19d", + "location_id": "S8GWD5DBJ3HF3", + "merchant_id": "6SSW7HV8K2ST5", + "type": "location.created" + }, + "x-webhook": { + "event": "location.created", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/Locations", + "x-since": "2020-10-28" + }, + "LocationCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"location\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated [Location](entity:Location)." + } + } + }, + "LocationCustomAttributeDefinitionOwnedCreatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition)\nis created by the subscribing application.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.owned.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T21:40:49.943Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "object": { + "created_at": "2022-11-26T21:40:49Z", + "description": "What region the location is in.", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "name": "Region Location", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-26T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "347ab320-c0ba-48f5-959a-4e147b9aefcf", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.owned.created" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.owned.created", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeDefinitionOwnedDeletedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition) \ncreated by the subscribing application is deleted. A custom attribute definition can only be deleted by \nthe application that created it.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-27T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "object": { + "created_at": "2022-11-26T21:40:49Z", + "description": "What region the location is in.", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "name": "Region Location", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "49363646-7ae7-49b5-aaa0-296610883c61", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.owned.deleted" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.owned.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeDefinitionOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition) \ncreated by the subscribing application is updated. A custom attribute definition can only be updated \nby the application that created it.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T01:22:29Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "object": { + "created_at": "2022-11-26T21:57:39Z", + "description": "What region the location is in.", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "name": "Operating Region", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "d914e6ef-9e37-4bca-a663-ecc55f5d98d3", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.owned.updated" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.owned.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeDefinitionVisibleCreatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is created. A notification is sent when your application \ncreates a custom attribute definition or another application creates a custom attribute definition whose\n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.visible.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "Square footage of the facility.", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "name": "Square Footage", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "f679dc4f-3619-4764-a4de-94a54735cd32", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.visible.created" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.visible.created", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeDefinitionVisibleDeletedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition) \nthat is visible to the subscribing application is deleted. A custom attribute definition can only \nbe deleted by the application that created it. A notification is sent when your application deletes \na custom attribute definition or when another application deletes a custom attribute definition whose \n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "Square footage of the facility.", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "name": "Facility Square Footage", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "81c10a07-c329-4943-af20-7d70a300c7e6", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.visible.deleted" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.visible.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeDefinitionVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition) \nthat is visible to the subscribing application is updated. A custom attribute definition can only be updated\nby the application that created it. A notification is sent when your application updates a custom attribute \ndefinition or when another application updates a custom attribute definition whose `visibility` is \n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "Square footage of the facility.", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "name": "Facility Square Footage", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "ae376c21-d360-4694-96c7-1b27830f07d7", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.visible.updated" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.visible.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeOwnedDeletedEvent": { + "type": "object", + "description": "Published when a location [custom attribute](entity:CustomAttribute) \nowned by the subscribing application is deleted. Custom attributes are owned by the\napplication that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).\nCustom attributes whose `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T21:40:54Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo:LOCATION:0V3BVT5RHZ835", + "object": { + "created_at": "2022-11-26T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "updated_at": "2022-11-27T12:40:54Z", + "value": "PNW", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "473795bf-6ce4-4595-88ae-a5e7cc690c02", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute.owned.deleted" + }, + "x-webhook": { + "event": "location.custom_attribute.owned.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute](entity:CustomAttribute) owned by the\nsubscribing application is created or updated. Custom attributes are owned by the application that created\nthe corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose\n`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T21:40:54Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo:LOCATION:0V3BVT5RHZ835", + "object": { + "created_at": "2022-11-26T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "updated_at": "2022-11-26T21:40:54Z", + "value": "PNW", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "e26ca6f2-97f8-426a-b4bf-873044617e94", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute.owned.updated" + }, + "x-webhook": { + "event": "location.custom_attribute.owned.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeVisibleDeletedEvent": { + "type": "object", + "description": "Published when a location [custom attribute](entity:CustomAttribute) that is visible to the\nsubscribing application is deleted. A notification is sent when:\n- Your application deletes a custom attribute owned by your application, regardless of the `visibility` setting.\n- Any application deletes a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`\nor `VISIBILITY_READ_WRITE_VALUES`.\n\nCustom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application, but those set to\n`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the owner. Custom attributes are owned\nby the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft:LOCATION:0V3BVT5RHZ835", + "object": { + "created_at": "2022-11-21T21:58:59Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "updated_at": "2022-11-27T11:31:29Z", + "value": "2718", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "18ef5adc-2efc-4ad9-9b1a-b274a607da3e", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute.visible.deleted" + }, + "x-webhook": { + "event": "location.custom_attribute.visible.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute](entity:CustomAttribute) that is visible\nto the subscribing application is created or updated. A notification is sent when:\n- Your application creates or updates a custom attribute owned by your application, regardless of the `visibility` setting.\n- Any application creates or updates a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`\nor `VISIBILITY_READ_WRITE_VALUES`.\n\nCustom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application, but those set to\n`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or updated by the owner. Custom attributes are owned\nby the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft:LOCATION:0V3BVT5RHZ835", + "object": { + "created_at": "2022-11-21T21:40:54Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "updated_at": "2022-11-26T01:22:29Z", + "value": "2718", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "1cc2925c-f6e2-4fb6-a597-07c198de59e1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute.visible.updated" + }, + "x-webhook": { + "event": "location.custom_attribute.visible.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationSettingsUpdatedEvent": { + "type": "object", + "description": "Published when online checkout location settings are updated", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"online_checkout.location_settings.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LocationSettingsUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2023-11-09T18:05:02.078121868Z", + "data": { + "id": "LJSYDQDQMDFNQ", + "object": { + "location_settings": { + "branding": { + "button_color": "#006aff", + "button_shape": "SQUARED", + "header_type": "FULL_WIDTH_LOGO" + }, + "coupons": { + "enabled": true + }, + "customer_notes_enabled": true, + "location_id": "LJSYDQDQMDFNQ", + "tipping": { + "default_percent": 15, + "default_smart_tip": { + "amount": 100, + "currency": "USD" + }, + "percentages": [ + 15, + 20, + 25 + ], + "smart_tipping_enabled": true, + "smart_tips": [ + { + "amount": 100, + "currency": "USD" + }, + { + "amount": 200, + "currency": "USD" + }, + { + "amount": 300, + "currency": "USD" + } + ] + }, + "updated_at": "2023-11-09 18:05:02 +0000 UTC" + } + }, + "type": "location_settings" + }, + "event_id": "eda83745-f27e-3812-a368-b61665e466f5", + "merchant_id": "MLX0WMXAER48M", + "type": "online_checkout.location_settings.updated" + }, + "x-webhook": { + "event": "online_checkout.location_settings.updated", + "scopes": [ + "MERCHANT_PROFILE_WRITE", + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/Checkout", + "x-since": "2023-12-13" + }, + "LocationSettingsUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the updated object’s type, `\"online_checkout.location_settings\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated location settings." + }, + "object": { + "$ref": "#/components/schemas/LocationSettingsUpdatedEventObject", + "description": "An object containing the updated location settings.", + "nullable": true + } + } + }, + "LocationSettingsUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "location_settings": { + "$ref": "#/components/schemas/CheckoutLocationSettings", + "description": "The updated location settings.", + "nullable": true + } + } + }, + "LocationStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "A location that is active for business." + }, + { + "name": "INACTIVE", + "description": "A location that is not active for business. Inactive locations provide historical\ninformation. Hide inactive locations unless the user has requested to see them." + } + ], + "description": "A location's status.", + "x-release-status": "PUBLIC" + }, + "LocationType": { + "type": "string", + "enum": [ + "PHYSICAL", + "MOBILE" + ], + "x-enum-elements": [ + { + "name": "PHYSICAL", + "description": "A place of business with a physical location." + }, + { + "name": "MOBILE", + "description": "A place of business that is mobile, such as a food truck or online store." + } + ], + "description": "A location's type.", + "x-release-status": "PUBLIC" + }, + "LocationUpdatedEvent": { + "type": "object", + "description": "Published when a [Location](entity:Location) is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the [Location](entity:Location) associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"location.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LocationUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T21:27:34.308Z", + "data": { + "id": "S8GWD5DBJ3HF3", + "type": "Location" + }, + "event_id": "de45d351-8ad2-400a-97af-e9f89da3d19d", + "location_id": "S8GWD5DBJ3HF3", + "merchant_id": "6SSW7HV8K2ST5", + "type": "location.updated" + }, + "x-webhook": { + "event": "location.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/Locations", + "x-since": "2020-10-28" + }, + "LocationUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"location\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated [Location](entity:Location)." + } + } + }, + "LoyaltyAccount": { + "type": "object", + "description": "Describes a loyalty account in a [loyalty program](entity:LoyaltyProgram). For more information, see\n[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts).", + "x-release-status": "PUBLIC", + "required": [ + "program_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the loyalty account.", + "maxLength": 36, + "readOnly": true + }, + "program_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram) to which the account belongs.", + "minLength": 1, + "maxLength": 36 + }, + "balance": { + "type": "integer", + "description": "The available point balance in the loyalty account. If points are scheduled to expire, they are listed in the `expiring_point_deadlines` field.\n\nYour application should be able to handle loyalty accounts that have a negative point balance (`balance` is less than 0). This might occur if a seller makes a manual adjustment or as a result of a refund or exchange.", + "readOnly": true + }, + "lifetime_points": { + "type": "integer", + "description": "The total points accrued during the lifetime of the account.", + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "The Square-assigned ID of the [customer](entity:Customer) that is associated with the account.", + "nullable": true + }, + "enrolled_at": { + "type": "string", + "description": "The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the **Enrolled On** or **Member Since** date in first-party Square products.\n\nIf this field is not set in a `CreateLoyaltyAccount` request, Square populates it after the buyer's first action on their account \n(when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service in Square Point of Sale. \n\nThis field is typically specified in a `CreateLoyaltyAccount` request when creating a loyalty account for a buyer who already interacted with their account. \nFor 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.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the loyalty account was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the loyalty account was last updated, in RFC 3339 format.", + "readOnly": true + }, + "mapping": { + "$ref": "#/components/schemas/LoyaltyAccountMapping", + "description": "The mapping that associates the loyalty account with a buyer. Currently,\na loyalty account can only be mapped to a buyer by phone number.\n\nTo create a loyalty account, you must specify the `mapping` field, with the buyer's phone number\nin the `phone_number` field.", + "nullable": true + }, + "expiring_point_deadlines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyAccountExpiringPointDeadline" + }, + "description": "The schedule for when points expire in the loyalty account balance. This field is present only if the account has points that are scheduled to expire. \n\nThe total number of points in this field equals the number of points in the `balance` field.", + "nullable": true + } + } + }, + "LoyaltyAccountCreatedEvent": { + "type": "object", + "description": "Published when a [loyalty account](entity:LoyaltyAccount) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.account.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyAccountCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:41:35.157Z", + "data": { + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "object": { + "loyalty_account": { + "balance": 0, + "created_at": "2020-05-13T01:41:34Z", + "customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "enrolled_at": "2020-05-13T01:41:34Z", + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "lifetime_points": 0, + "mapping": { + "created_at": "2020-05-13T01:41:34Z", + "id": "664c22ba-9460-45a5-8917-381ae72dcfdc", + "phone_number": "+14155551234" + }, + "program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "updated_at": "2020-05-13T01:41:34Z" + } + }, + "type": "loyalty_account" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.account.created" + }, + "x-webhook": { + "event": "loyalty.account.created", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2020-05-28" + }, + "LoyaltyAccountCreatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.account.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_account`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty account." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyAccountCreatedEventObject", + "description": "An object that contains the new loyalty account.", + "nullable": true + } + } + }, + "LoyaltyAccountCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The loyalty account that was created.", + "nullable": true + } + } + }, + "LoyaltyAccountDeletedEvent": { + "type": "object", + "description": "Published when a [loyalty account](entity:LoyaltyAccount) is deleted.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.account.deleted`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyAccountDeletedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:50:45.656Z", + "data": { + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "object": { + "loyalty_account": { + "balance": 10, + "created_at": "2020-05-13T01:41:34Z", + "customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "enrolled_at": "2020-05-13T01:41:34Z", + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "lifetime_points": 10, + "mapping": { + "created_at": "2020-05-13T01:41:34Z", + "id": "664c22ba-9460-45a5-8917-381ae72dcfdc", + "phone_number": "+14155551234" + }, + "program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "updated_at": "2020-05-13T01:41:34Z" + } + }, + "type": "loyalty_account" + }, + "event_id": "7c365846-a64b-40ba-a406-8a0354a63d79", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.account.deleted" + }, + "x-webhook": { + "event": "loyalty.account.deleted", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2020-05-28" + }, + "LoyaltyAccountDeletedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.account.deleted` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_account`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty account." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyAccountDeletedEventObject", + "description": "An object that contains the loyalty account that was deleted.", + "nullable": true + } + } + }, + "LoyaltyAccountDeletedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The loyalty account that was deleted.", + "nullable": true + } + } + }, + "LoyaltyAccountExpiringPointDeadline": { + "type": "object", + "description": "Represents a set of points for a loyalty account that are scheduled to expire on a specific date.", + "x-release-status": "PUBLIC", + "required": [ + "points", + "expires_at" + ], + "properties": { + "points": { + "type": "integer", + "description": "The number of points scheduled to expire at the `expires_at` timestamp." + }, + "expires_at": { + "type": "string", + "description": "The timestamp of when the points are scheduled to expire, in RFC 3339 format.", + "minLength": 1 + } + } + }, + "LoyaltyAccountMapping": { + "type": "object", + "description": "Represents the mapping that associates a loyalty account with a buyer. \n\nCurrently, a loyalty account can only be mapped to a buyer by phone number. For more information, see \n[Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the mapping.", + "maxLength": 36, + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the mapping was created, in RFC 3339 format.", + "readOnly": true + }, + "phone_number": { + "type": "string", + "description": "The phone number of the buyer, in E.164 format. For example, \"+14155551111\".", + "nullable": true + } + } + }, + "LoyaltyAccountMappingType": { + "type": "string", + "enum": [ + "PHONE" + ], + "x-enum-elements": [ + { + "name": "PHONE", + "description": "The loyalty account is mapped by phone." + } + ], + "description": "The type of mapping.", + "x-release-status": "PUBLIC" + }, + "LoyaltyAccountUpdatedEvent": { + "type": "object", + "description": "Published when a [loyalty account](entity:LoyaltyAccount) is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.account.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyAccountUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:46:58.794Z", + "data": { + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "object": { + "loyalty_account": { + "balance": 10, + "created_at": "2020-05-13T01:41:34Z", + "customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "enrolled_at": "2020-05-13T01:41:34Z", + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "lifetime_points": 10, + "mapping": { + "created_at": "2020-05-13T01:41:34Z", + "id": "664c22ba-9460-45a5-8917-381ae72dcfdc", + "phone_number": "+14155551234" + }, + "program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "updated_at": "2020-05-13T01:41:34Z" + } + }, + "type": "loyalty_account" + }, + "event_id": "3ca83966-230e-4a61-8484-22ea749ea765", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.account.updated" + }, + "x-webhook": { + "event": "loyalty.account.updated", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2020-05-28" + }, + "LoyaltyAccountUpdatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.account.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_account`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty account." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyAccountUpdatedEventObject", + "description": "An object that contains the loyalty account that was updated.", + "nullable": true + } + } + }, + "LoyaltyAccountUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The loyalty account that was updated.", + "nullable": true + } + } + }, + "LoyaltyEvent": { + "type": "object", + "description": "Provides information about a loyalty event. \nFor more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events).", + "x-release-status": "PUBLIC", + "required": [ + "id", + "type", + "created_at", + "loyalty_account_id", + "source" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the loyalty event.", + "minLength": 1, + "readOnly": true + }, + "type": { + "$ref": "#/components/schemas/LoyaltyEventType", + "description": "The type of the loyalty event.\nSee [LoyaltyEventType](#type-loyaltyeventtype) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the event was created, in RFC 3339 format.", + "minLength": 1, + "readOnly": true + }, + "accumulate_points": { + "$ref": "#/components/schemas/LoyaltyEventAccumulatePoints", + "description": "Provides metadata when the event `type` is `ACCUMULATE_POINTS`.", + "readOnly": true + }, + "create_reward": { + "$ref": "#/components/schemas/LoyaltyEventCreateReward", + "description": "Provides metadata when the event `type` is `CREATE_REWARD`.", + "readOnly": true + }, + "redeem_reward": { + "$ref": "#/components/schemas/LoyaltyEventRedeemReward", + "description": "Provides metadata when the event `type` is `REDEEM_REWARD`.", + "readOnly": true + }, + "delete_reward": { + "$ref": "#/components/schemas/LoyaltyEventDeleteReward", + "description": "Provides metadata when the event `type` is `DELETE_REWARD`.", + "readOnly": true + }, + "adjust_points": { + "$ref": "#/components/schemas/LoyaltyEventAdjustPoints", + "description": "Provides metadata when the event `type` is `ADJUST_POINTS`.", + "readOnly": true + }, + "loyalty_account_id": { + "type": "string", + "description": "The ID of the [loyalty account](entity:LoyaltyAccount) associated with the event.", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location) where the event occurred.", + "readOnly": true + }, + "source": { + "$ref": "#/components/schemas/LoyaltyEventSource", + "description": "Defines whether the event was generated by the Square Point of Sale.\nSee [LoyaltyEventSource](#type-loyaltyeventsource) for possible values", + "readOnly": true + }, + "expire_points": { + "$ref": "#/components/schemas/LoyaltyEventExpirePoints", + "description": "Provides metadata when the event `type` is `EXPIRE_POINTS`.", + "readOnly": true + }, + "other_event": { + "$ref": "#/components/schemas/LoyaltyEventOther", + "description": "Provides metadata when the event `type` is `OTHER`.", + "readOnly": true + }, + "accumulate_promotion_points": { + "$ref": "#/components/schemas/LoyaltyEventAccumulatePromotionPoints", + "description": "Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`.", + "readOnly": true + } + } + }, + "LoyaltyEventAccumulatePoints": { + "type": "object", + "description": "Provides metadata when the event `type` is `ACCUMULATE_POINTS`.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram).", + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points accumulated by the event.", + "minimum": 1, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) for which the buyer accumulated the points.\nThis field is returned only if the Orders API is used to process orders.", + "nullable": true + } + } + }, + "LoyaltyEventAccumulatePromotionPoints": { + "type": "object", + "description": "Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`.", + "x-release-status": "PUBLIC", + "required": [ + "points", + "order_id" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).", + "maxLength": 36, + "readOnly": true + }, + "loyalty_promotion_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty promotion](entity:LoyaltyPromotion).", + "minLength": 1, + "maxLength": 255, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points earned by the event.", + "readOnly": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) for which the buyer earned the promotion points.\nOnly applications that use the Orders API to process orders can trigger this event.", + "minLength": 1, + "readOnly": true + } + } + }, + "LoyaltyEventAdjustPoints": { + "type": "object", + "description": "Provides metadata when the event `type` is `ADJUST_POINTS`.", + "x-release-status": "PUBLIC", + "required": [ + "points" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).", + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points added or removed." + }, + "reason": { + "type": "string", + "description": "The reason for the adjustment of points.", + "maxLength": 3500, + "nullable": true + } + } + }, + "LoyaltyEventCreateReward": { + "type": "object", + "description": "Provides metadata when the event `type` is `CREATE_REWARD`.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_program_id", + "points" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram).", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "reward_id": { + "type": "string", + "description": "The Square-assigned ID of the created [loyalty reward](entity:LoyaltyReward).\nThis field is returned only if the event source is `LOYALTY_API`.", + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The loyalty points used to create the reward.", + "readOnly": true + } + } + }, + "LoyaltyEventCreatedEvent": { + "type": "object", + "description": "Published when a [loyalty event](entity:LoyaltyEvent) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.event.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyEventCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:46:58.783Z", + "data": { + "id": "iirpaae81f66e-a7ea-4fcf-a04f-f0d29fdc60e6", + "object": { + "loyalty_event": { + "adjust_points": { + "loyalty_program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "points": 10 + }, + "created_at": "2020-05-13T01:46:58Z", + "id": "d0bd89a5-3d04-389e-a54b-4e509658fe41", + "location_id": "2Z3BMKQB939X0", + "loyalty_account_id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "source": "SQUARE", + "type": "ADJUST_POINTS" + } + }, + "type": "loyalty_event" + }, + "event_id": "f151e2c6-9340-4cca-9d37-1bcd1c2d6a0d", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.event.created" + }, + "x-webhook": { + "event": "loyalty.event.created", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2020-05-28" + }, + "LoyaltyEventCreatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.event.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_event`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected loyalty event." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyEventCreatedEventObject", + "description": "An object that contains the new loyalty event.", + "nullable": true + } + } + }, + "LoyaltyEventCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_event": { + "$ref": "#/components/schemas/LoyaltyEvent", + "description": "The loyalty event that was created.", + "nullable": true + } + } + }, + "LoyaltyEventDateTimeFilter": { + "type": "object", + "description": "Filter events by date time range.", + "x-release-status": "PUBLIC", + "required": [ + "created_at" + ], + "properties": { + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The `created_at` date time range used to filter the result." + } + } + }, + "LoyaltyEventDeleteReward": { + "type": "object", + "description": "Provides metadata when the event `type` is `DELETE_REWARD`.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_program_id", + "points" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram).", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "reward_id": { + "type": "string", + "description": "The ID of the deleted [loyalty reward](entity:LoyaltyReward).\nThis field is returned only if the event source is `LOYALTY_API`.", + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points returned to the loyalty account.", + "readOnly": true + } + } + }, + "LoyaltyEventExpirePoints": { + "type": "object", + "description": "Provides metadata when the event `type` is `EXPIRE_POINTS`.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_program_id", + "points" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points expired." + } + } + }, + "LoyaltyEventFilter": { + "type": "object", + "description": "The filtering criteria. If the request specifies multiple filters, \nthe endpoint uses a logical AND to evaluate them.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_account_filter": { + "$ref": "#/components/schemas/LoyaltyEventLoyaltyAccountFilter", + "description": "Filter events by loyalty account.", + "nullable": true + }, + "type_filter": { + "$ref": "#/components/schemas/LoyaltyEventTypeFilter", + "description": "Filter events by event type.", + "nullable": true + }, + "date_time_filter": { + "$ref": "#/components/schemas/LoyaltyEventDateTimeFilter", + "description": "Filter events by date time range. \nFor each range, the start time is inclusive and the end time \nis exclusive.", + "nullable": true + }, + "location_filter": { + "$ref": "#/components/schemas/LoyaltyEventLocationFilter", + "description": "Filter events by location.", + "nullable": true + }, + "order_filter": { + "$ref": "#/components/schemas/LoyaltyEventOrderFilter", + "description": "Filter events by the order associated with the event.", + "nullable": true + } + } + }, + "LoyaltyEventLocationFilter": { + "type": "object", + "description": "Filter events by location.", + "x-release-status": "PUBLIC", + "required": [ + "location_ids" + ], + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The [location](entity:Location) IDs for loyalty events to query.\nIf multiple values are specified, the endpoint uses \na logical OR to combine them." + } + } + }, + "LoyaltyEventLoyaltyAccountFilter": { + "type": "object", + "description": "Filter events by loyalty account.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_account_id" + ], + "properties": { + "loyalty_account_id": { + "type": "string", + "description": "The ID of the [loyalty account](entity:LoyaltyAccount) associated with loyalty events.", + "minLength": 1 + } + } + }, + "LoyaltyEventOrderFilter": { + "type": "object", + "description": "Filter events by the order associated with the event.", + "x-release-status": "PUBLIC", + "required": [ + "order_id" + ], + "properties": { + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) associated with the event.", + "minLength": 1 + } + } + }, + "LoyaltyEventOther": { + "type": "object", + "description": "Provides metadata when the event `type` is `OTHER`.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_program_id", + "points" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points added or removed." + } + } + }, + "LoyaltyEventQuery": { + "type": "object", + "description": "Represents a query used to search for loyalty events.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/LoyaltyEventFilter", + "description": "The query filter criteria.", + "nullable": true + } + } + }, + "LoyaltyEventRedeemReward": { + "type": "object", + "description": "Provides metadata when the event `type` is `REDEEM_REWARD`.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_program_id" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram).", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "reward_id": { + "type": "string", + "description": "The ID of the redeemed [loyalty reward](entity:LoyaltyReward).\nThis field is returned only if the event source is `LOYALTY_API`.", + "maxLength": 36, + "readOnly": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) that redeemed the reward.\nThis field is returned only if the Orders API is used to process orders.", + "readOnly": true + } + } + }, + "LoyaltyEventSource": { + "type": "string", + "enum": [ + "SQUARE", + "LOYALTY_API" + ], + "x-enum-elements": [ + { + "name": "SQUARE", + "description": "The event is generated by the Square Point of Sale (POS)." + }, + { + "name": "LOYALTY_API", + "description": "The event is generated by something other than the Square Point of Sale that used the Loyalty API." + } + ], + "description": "Defines whether the event was generated by the Square Point of Sale.", + "x-release-status": "PUBLIC" + }, + "LoyaltyEventType": { + "type": "string", + "enum": [ + "ACCUMULATE_POINTS", + "CREATE_REWARD", + "REDEEM_REWARD", + "DELETE_REWARD", + "ADJUST_POINTS", + "EXPIRE_POINTS", + "OTHER", + "ACCUMULATE_PROMOTION_POINTS" + ], + "x-enum-elements": [ + { + "name": "ACCUMULATE_POINTS", + "description": "Points are added to a loyalty account for a purchase that\nqualified for points based on an [accrual rule](entity:LoyaltyProgramAccrualRule)." + }, + { + "name": "CREATE_REWARD", + "description": "A [loyalty reward](entity:LoyaltyReward) is created." + }, + { + "name": "REDEEM_REWARD", + "description": "A loyalty reward is redeemed." + }, + { + "name": "DELETE_REWARD", + "description": "A loyalty reward is deleted." + }, + { + "name": "ADJUST_POINTS", + "description": "Loyalty points are manually adjusted." + }, + { + "name": "EXPIRE_POINTS", + "description": "Loyalty points are expired according to the \nexpiration policy of the loyalty program." + }, + { + "name": "OTHER", + "description": "Some other loyalty event occurred." + }, + { + "name": "ACCUMULATE_PROMOTION_POINTS", + "description": " Points are added to a loyalty account for a purchase that\nqualified for a [loyalty promotion](entity:LoyaltyPromotion)." + } + ], + "description": "The type of the loyalty event.", + "x-release-status": "PUBLIC" + }, + "LoyaltyEventTypeFilter": { + "type": "object", + "description": "Filter events by event type.", + "x-release-status": "PUBLIC", + "required": [ + "types" + ], + "properties": { + "types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyEventType" + }, + "description": "The loyalty event types used to filter the result.\nIf multiple values are specified, the endpoint uses a \nlogical OR to combine them.\nSee [LoyaltyEventType](#type-loyaltyeventtype) for possible values" + } + } + }, + "LoyaltyProgram": { + "type": "object", + "description": "Represents a Square loyalty program. Loyalty programs define how buyers can earn points and redeem points for rewards. \nSquare sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. \nFor more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the loyalty program. Updates to \nthe loyalty program do not modify the identifier.", + "maxLength": 36, + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/LoyaltyProgramStatus", + "description": "Whether the program is currently active.\nSee [LoyaltyProgramStatus](#type-loyaltyprogramstatus) for possible values", + "nullable": true + }, + "reward_tiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyProgramRewardTier" + }, + "description": "The list of rewards for buyers, sorted by ascending points.", + "nullable": true + }, + "expiration_policy": { + "$ref": "#/components/schemas/LoyaltyProgramExpirationPolicy", + "description": "If present, details for how points expire.", + "nullable": true + }, + "terminology": { + "$ref": "#/components/schemas/LoyaltyProgramTerminology", + "description": "A cosmetic name for the “points” currency.", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The [locations](entity:Location) at which the program is active.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the program was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the reward was last updated, in RFC 3339 format.", + "readOnly": true + }, + "accrual_rules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRule" + }, + "description": "Defines how buyers can earn loyalty points from the base loyalty program.\nTo check for associated [loyalty promotions](entity:LoyaltyPromotion) that enable\nbuyers to earn extra points, call [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions).", + "nullable": true + } + } + }, + "LoyaltyProgramAccrualRule": { + "type": "object", + "description": "Represents an accrual rule, which defines how buyers can earn points from the base [loyalty program](entity:LoyaltyProgram).", + "x-release-status": "PUBLIC", + "required": [ + "accrual_type" + ], + "properties": { + "accrual_type": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleType", + "description": "The type of the accrual rule that defines how buyers can earn points.\nSee [LoyaltyProgramAccrualRuleType](#type-loyaltyprogramaccrualruletype) for possible values" + }, + "points": { + "type": "integer", + "description": "The number of points that \nbuyers earn based on the `accrual_type`.", + "minimum": 1, + "nullable": true + }, + "visit_data": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleVisitData", + "description": "Additional data for rules with the `VISIT` accrual type.", + "nullable": true + }, + "spend_data": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleSpendData", + "description": "Additional data for rules with the `SPEND` accrual type.", + "nullable": true + }, + "item_variation_data": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleItemVariationData", + "description": "Additional data for rules with the `ITEM_VARIATION` accrual type.", + "nullable": true + }, + "category_data": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleCategoryData", + "description": "Additional data for rules with the `CATEGORY` accrual type.", + "nullable": true + } + } + }, + "LoyaltyProgramAccrualRuleCategoryData": { + "type": "object", + "description": "Represents additional data for rules with the `CATEGORY` accrual type.", + "x-release-status": "PUBLIC", + "required": [ + "category_id" + ], + "properties": { + "category_id": { + "type": "string", + "description": "The ID of the `CATEGORY` [catalog object](entity:CatalogObject) that buyers can purchase to earn\npoints.", + "minLength": 1 + } + } + }, + "LoyaltyProgramAccrualRuleItemVariationData": { + "type": "object", + "description": "Represents additional data for rules with the `ITEM_VARIATION` accrual type.", + "x-release-status": "PUBLIC", + "required": [ + "item_variation_id" + ], + "properties": { + "item_variation_id": { + "type": "string", + "description": "The ID of the `ITEM_VARIATION` [catalog object](entity:CatalogObject) that buyers can purchase to earn\npoints.", + "minLength": 1 + } + } + }, + "LoyaltyProgramAccrualRuleSpendData": { + "type": "object", + "description": "Represents additional data for rules with the `SPEND` accrual type.", + "x-release-status": "PUBLIC", + "required": [ + "amount_money", + "tax_mode" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount that buyers must spend to earn points. \nFor example, given an \"Earn 1 point for every $10 spent\" accrual rule, a buyer who spends $105 earns 10 points." + }, + "excluded_category_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of any `CATEGORY` catalog objects that are excluded from points accrual.\n\nYou can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects)\nendpoint to retrieve information about the excluded categories.", + "nullable": true + }, + "excluded_item_variation_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of any `ITEM_VARIATION` catalog objects that are excluded from points accrual.\n\nYou can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects)\nendpoint to retrieve information about the excluded item variations.", + "nullable": true + }, + "tax_mode": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleTaxMode", + "description": "Indicates how taxes should be treated when calculating the purchase amount used for points accrual.\nSee [LoyaltyProgramAccrualRuleTaxMode](#type-loyaltyprogramaccrualruletaxmode) for possible values" + } + } + }, + "LoyaltyProgramAccrualRuleTaxMode": { + "type": "string", + "enum": [ + "BEFORE_TAX", + "AFTER_TAX" + ], + "x-enum-elements": [ + { + "name": "BEFORE_TAX", + "description": "Exclude taxes from the purchase amount used for loyalty points accrual." + }, + { + "name": "AFTER_TAX", + "description": "Include taxes in the purchase amount used for loyalty points accrual." + } + ], + "description": "Indicates how taxes should be treated when calculating the purchase amount used for loyalty points accrual. \nThis setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum spend requirement.", + "x-release-status": "PUBLIC" + }, + "LoyaltyProgramAccrualRuleType": { + "type": "string", + "enum": [ + "VISIT", + "SPEND", + "ITEM_VARIATION", + "CATEGORY" + ], + "x-enum-elements": [ + { + "name": "VISIT", + "description": "A visit-based accrual rule. A buyer earns points for each visit. \nYou can specify the minimum purchase required." + }, + { + "name": "SPEND", + "description": "A spend-based accrual rule. A buyer earns points based on the amount \nspent." + }, + { + "name": "ITEM_VARIATION", + "description": "An accrual rule based on an item variation. For example, accrue \npoints for purchasing a coffee." + }, + { + "name": "CATEGORY", + "description": "An accrual rule based on an item category. For example, accrue points \nfor purchasing any item in the \"hot drink\" category: coffee, tea, or hot cocoa." + } + ], + "description": "The type of the accrual rule that defines how buyers can earn points.", + "x-release-status": "PUBLIC" + }, + "LoyaltyProgramAccrualRuleVisitData": { + "type": "object", + "description": "Represents additional data for rules with the `VISIT` accrual type.", + "x-release-status": "PUBLIC", + "required": [ + "tax_mode" + ], + "properties": { + "minimum_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The minimum purchase required during the visit to quality for points.", + "nullable": true + }, + "tax_mode": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleTaxMode", + "description": "Indicates how taxes should be treated when calculating the purchase amount to determine whether the visit qualifies for points. \nThis setting applies only if `minimum_amount_money` is specified.\nSee [LoyaltyProgramAccrualRuleTaxMode](#type-loyaltyprogramaccrualruletaxmode) for possible values" + } + } + }, + "LoyaltyProgramCreatedEvent": { + "type": "object", + "description": "Published when a [loyalty program](entity:LoyaltyProgram) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.program.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyProgramCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:38:42.785Z", + "data": { + "id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "object": { + "loyalty_program": { + "accrual_rules": [ + { + "accrual_type": "SPEND", + "points": 1, + "spend_data": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "tax_mode": "BEFORE_TAX" + } + } + ], + "created_at": "2019-08-19T18:22:46Z", + "id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "location_ids": [ + "2Z3BMKQB939X0" + ], + "reward_tiers": [ + { + "created_at": "2019-08-19T18:22:45Z", + "id": "927cab58-09cd-410f-aa68-a44015d8bbbb", + "name": "5% off entire sale", + "points": 5, + "pricing_rule_reference": { + "catalog_version": "1603960067138", + "object_id": "ZKFKBH5IINTZLY3VA2OWIFX3" + } + }, + { + "created_at": "2020-05-13T01:38:40Z", + "id": "aa5373ef-191d-4cb5-b122-8e8de41ab32f", + "name": "20% off entire sale", + "points": 15, + "pricing_rule_reference": { + "catalog_version": "1605486402527", + "object_id": "74C4JSHESNLTB2A7ITO5HO6F" + } + } + ], + "status": "ACTIVE", + "terminology": { + "one": "Point", + "other": "Points" + }, + "updated_at": "2020-05-13T01:38:40Z" + } + }, + "type": "loyalty_program" + }, + "event_id": "b10404b2-08c4-4c66-9299-c11feceb43dd", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.program.created" + }, + "x-webhook": { + "event": "loyalty.program.created", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2021-04-21" + }, + "LoyaltyProgramCreatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.program.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_program`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the created loyalty program." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyProgramCreatedEventObject", + "description": "An object that contains the loyalty program that was created.", + "nullable": true + } + } + }, + "LoyaltyProgramCreatedEventObject": { + "type": "object", + "description": "An object that contains the loyalty program associated with a `loyalty.program.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_program": { + "$ref": "#/components/schemas/LoyaltyProgram", + "description": "The loyalty program that was created.", + "nullable": true + } + } + }, + "LoyaltyProgramExpirationPolicy": { + "type": "object", + "description": "Describes when the loyalty program expires.", + "x-release-status": "PUBLIC", + "required": [ + "expiration_duration" + ], + "properties": { + "expiration_duration": { + "type": "string", + "description": "The number of months before points expire, in `P[n]M` RFC 3339 duration format. For example, a value of `P12M` represents a duration of 12 months. \nPoints are valid through the last day of the month in which they are scheduled to expire. For example, with a `P12M` duration, points earned on July 6, 2020 expire on August 1, 2021.", + "minLength": 1 + } + } + }, + "LoyaltyProgramRewardTier": { + "type": "object", + "description": "Represents a reward tier in a loyalty program. A reward tier defines how buyers can redeem points for a reward, such as the number of points required and the value and scope of the discount. A loyalty program can offer multiple reward tiers.", + "x-release-status": "PUBLIC", + "required": [ + "points", + "pricing_rule_reference" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the reward tier.", + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The points exchanged for the reward tier.", + "minimum": 1 + }, + "name": { + "type": "string", + "description": "The name of the reward tier.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the reward tier was created, in RFC 3339 format.", + "readOnly": true + }, + "pricing_rule_reference": { + "$ref": "#/components/schemas/CatalogObjectReference", + "description": "A reference to the specific version of a `PRICING_RULE` catalog object that contains information about the reward tier discount.\n\nUse `object_id` and `catalog_version` with the [RetrieveCatalogObject](api-endpoint:Catalog-RetrieveCatalogObject) endpoint\nto get discount details. Make sure to set `include_related_objects` to true in the request to retrieve all catalog objects\nthat define the discount. For more information, see [Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details)." + } + } + }, + "LoyaltyProgramStatus": { + "type": "string", + "enum": [ + "INACTIVE", + "ACTIVE" + ], + "x-enum-elements": [ + { + "name": "INACTIVE", + "description": "The loyalty program does not have an active subscription. \nLoyalty API requests fail." + }, + { + "name": "ACTIVE", + "description": "The program is fully functional. The program has an active subscription." + } + ], + "description": "Indicates whether the program is currently active.", + "x-release-status": "PUBLIC" + }, + "LoyaltyProgramTerminology": { + "type": "object", + "description": "Represents the naming used for loyalty points.", + "x-release-status": "PUBLIC", + "required": [ + "one", + "other" + ], + "properties": { + "one": { + "type": "string", + "description": "A singular unit for a point (for example, 1 point is called 1 star).", + "minLength": 1 + }, + "other": { + "type": "string", + "description": "A plural unit for point (for example, 10 points is called 10 stars).", + "minLength": 1 + } + } + }, + "LoyaltyProgramUpdatedEvent": { + "type": "object", + "description": "Published when a [loyalty program](entity:LoyaltyProgram) is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.program.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyProgramUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:38:42.785Z", + "data": { + "id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "object": { + "loyalty_program": { + "accrual_rules": [ + { + "accrual_type": "SPEND", + "points": 1, + "spend_data": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "tax_mode": "BEFORE_TAX" + } + } + ], + "created_at": "2019-08-19T18:22:46Z", + "id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "location_ids": [ + "2Z3BMKQB939X0" + ], + "reward_tiers": [ + { + "created_at": "2019-08-19T18:22:45Z", + "id": "927cab58-09cd-410f-aa68-a44015d8bbbb", + "name": "5% off entire sale", + "points": 5, + "pricing_rule_reference": { + "catalog_version": "1603960067138", + "object_id": "ZKFKBH5IINTZLY3VA2OWIFX3" + } + }, + { + "created_at": "2020-05-13T01:38:40Z", + "id": "aa5373ef-191d-4cb5-b122-8e8de41ab32f", + "name": "20% off entire sale", + "points": 15, + "pricing_rule_reference": { + "catalog_version": "1605486402527", + "object_id": "74C4JSHESNLTB2A7ITO5HO6F" + } + } + ], + "status": "ACTIVE", + "terminology": { + "one": "Point", + "other": "Points" + }, + "updated_at": "2020-05-13T01:38:40Z" + } + }, + "type": "loyalty_program" + }, + "event_id": "b10404b2-08c4-4c66-9299-c11feceb43dd", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.program.updated" + }, + "x-webhook": { + "event": "loyalty.program.updated", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2020-05-28" + }, + "LoyaltyProgramUpdatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.program.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_program`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty program." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyProgramUpdatedEventObject", + "description": "An object that contains the loyalty program that was updated.", + "nullable": true + } + } + }, + "LoyaltyProgramUpdatedEventObject": { + "type": "object", + "description": "An object that contains the loyalty program associated with a `loyalty.program.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_program": { + "$ref": "#/components/schemas/LoyaltyProgram", + "description": "The loyalty program that was updated.", + "nullable": true + } + } + }, + "LoyaltyPromotion": { + "type": "object", + "description": "Represents a promotion for a [loyalty program](entity:LoyaltyProgram). Loyalty promotions enable buyers\nto earn extra points on top of those earned from the base program.\n\nA loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status.", + "x-release-status": "PUBLIC", + "required": [ + "name", + "incentive", + "available_time" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the promotion.", + "minLength": 1, + "maxLength": 255, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the promotion.", + "minLength": 1, + "maxLength": 70 + }, + "incentive": { + "$ref": "#/components/schemas/LoyaltyPromotionIncentive", + "description": "The points incentive for the promotion. This field defines whether promotion points\nare earned by multiplying base program points or by adding a specified number of points." + }, + "available_time": { + "$ref": "#/components/schemas/LoyaltyPromotionAvailableTimeData", + "description": "The scheduling information that defines when purchases can qualify to earn points from an `ACTIVE` promotion." + }, + "trigger_limit": { + "$ref": "#/components/schemas/LoyaltyPromotionTriggerLimit", + "description": "The number of times a buyer can earn promotion points during a specified interval.\nIf not specified, buyers can trigger the promotion an unlimited number of times.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/LoyaltyPromotionStatus", + "description": "The current status of the promotion.\nSee [LoyaltyPromotionStatus](#type-loyaltypromotionstatus) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the promotion was created, in RFC 3339 format.", + "readOnly": true + }, + "canceled_at": { + "type": "string", + "description": "The timestamp of when the promotion was canceled, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the promotion was last updated, in RFC 3339 format.", + "readOnly": true + }, + "loyalty_program_id": { + "type": "string", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram) associated with the promotion.", + "readOnly": true + }, + "minimum_spend_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The minimum purchase amount required to earn promotion points. If specified, this amount is positive.", + "nullable": true + }, + "qualifying_item_variation_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of any qualifying `ITEM_VARIATION` [catalog objects](entity:CatalogObject). If specified,\nthe purchase must include at least one of these items to qualify for the promotion.\n\nThis option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule.\nWith `SPEND` accrual rules, make sure that qualifying promotional items are not excluded.\n\nYou can specify `qualifying_item_variation_ids` or `qualifying_category_ids` for a given promotion, but not both.", + "nullable": true + }, + "qualifying_category_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of any qualifying `CATEGORY` [catalog objects](entity:CatalogObject). If specified,\nthe purchase must include at least one item from one of these categories to qualify for the promotion.\n\nThis option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule.\nWith `SPEND` accrual rules, make sure that qualifying promotional items are not excluded.\n\nYou can specify `qualifying_category_ids` or `qualifying_item_variation_ids` for a promotion, but not both.", + "nullable": true + } + } + }, + "LoyaltyPromotionAvailableTimeData": { + "type": "object", + "description": "Represents scheduling information that determines when purchases can qualify to earn points\nfrom a [loyalty promotion](entity:LoyaltyPromotion).", + "x-release-status": "PUBLIC", + "required": [ + "time_periods" + ], + "properties": { + "start_date": { + "type": "string", + "description": "The date that the promotion starts, in `YYYY-MM-DD` format. Square populates this field\nbased on the provided `time_periods`.", + "readOnly": true + }, + "end_date": { + "type": "string", + "description": "The date that the promotion ends, in `YYYY-MM-DD` format. Square populates this field\nbased on the provided `time_periods`. If an end date is not specified, an `ACTIVE` promotion\nremains available until it is canceled.", + "readOnly": true + }, + "time_periods": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of [iCalendar (RFC 5545) events](https://tools.ietf.org/html/rfc5545#section-3.6.1)\n(`VEVENT`). Each event represents an available time period per day or days of the week. \nA day can have a maximum of one available time period.\n\nOnly `DTSTART`, `DURATION`, and `RRULE` are supported. `DTSTART` and `DURATION` are required and\ntimestamps must be in local (unzoned) time format. Include `RRULE` to specify recurring promotions,\nan end date (using the `UNTIL` keyword), or both. For more information, see\n[Available time](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#available-time).\n\nNote that `BEGIN:VEVENT` and `END:VEVENT` are optional in a `CreateLoyaltyPromotion` request\nbut are always included in the response." + } + } + }, + "LoyaltyPromotionCreatedEvent": { + "type": "object", + "description": "Published when a [loyalty promotion](entity:LoyaltyPromotion) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.promotion.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyPromotionCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-06-03T01:41:34Z", + "data": { + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "object": { + "loyalty_promotion": { + "available_time": { + "start_date": "2022-06-06", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220612T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=SU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220606T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=MO\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220607T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220608T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=WE\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220609T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=TH\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220610T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=FR\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220611T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=SA\nEND:VEVENT" + ] + }, + "created_at": "2022-06-03T01:41:34Z", + "id": "loypromo_ba2f8ab6-e131-46d9-9882-17714404eb49", + "incentive": { + "points_addition_data": { + "points_addition": 5 + }, + "type": "POINTS_ADDITION" + }, + "loyalty_program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Happy Hour", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "status": "SCHEDULED", + "updated_at": "2022-06-03T01:41:34Z" + } + }, + "type": "loyalty_promotion" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.promotion.created" + }, + "x-webhook": { + "event": "loyalty.promotion.created", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2022-08-17" + }, + "LoyaltyPromotionCreatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.promotion.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_promotion`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty promotion." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyPromotionCreatedEventObject", + "description": "An object that contains the loyalty promotion that was created.", + "nullable": true + } + } + }, + "LoyaltyPromotionCreatedEventObject": { + "type": "object", + "description": "An object that contains the loyalty promotion associated with a `loyalty.promotion.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The loyalty promotion that was created.", + "nullable": true + } + } + }, + "LoyaltyPromotionIncentive": { + "type": "object", + "description": "Represents how points for a [loyalty promotion](entity:LoyaltyPromotion) are calculated,\neither by multiplying the points earned from the base program or by adding a specified number\nof points to the points earned from the base program.", + "x-release-status": "PUBLIC", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/LoyaltyPromotionIncentiveType", + "description": "The type of points incentive.\nSee [LoyaltyPromotionIncentiveType](#type-loyaltypromotionincentivetype) for possible values" + }, + "points_multiplier_data": { + "$ref": "#/components/schemas/LoyaltyPromotionIncentivePointsMultiplierData", + "description": "Additional data for a `POINTS_MULTIPLIER` incentive type.", + "nullable": true + }, + "points_addition_data": { + "$ref": "#/components/schemas/LoyaltyPromotionIncentivePointsAdditionData", + "description": "Additional data for a `POINTS_ADDITION` incentive type.", + "nullable": true + } + } + }, + "LoyaltyPromotionIncentivePointsAdditionData": { + "type": "object", + "description": "Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive).", + "x-release-status": "PUBLIC", + "required": [ + "points_addition" + ], + "properties": { + "points_addition": { + "type": "integer", + "description": "The number of additional points to earn each time the promotion is triggered. For example,\nsuppose a purchase qualifies for 5 points from the base loyalty program. If the purchase also\nqualifies for a `POINTS_ADDITION` promotion incentive with a `points_addition` of 3, the buyer\nearns a total of 8 points (5 program points + 3 promotion points = 8 points).", + "minimum": 1 + } + } + }, + "LoyaltyPromotionIncentivePointsMultiplierData": { + "type": "object", + "description": "Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive).", + "x-release-status": "PUBLIC", + "properties": { + "points_multiplier": { + "type": "integer", + "description": "The multiplier used to calculate the number of points earned each time the promotion\nis triggered. For example, suppose a purchase qualifies for 5 points from the base loyalty program.\nIf the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive with a `points_multiplier`\nof 3, the buyer earns a total of 15 points (5 program points x 3 promotion multiplier = 15 points).\n\nDEPRECATED at version 2023-08-16. Replaced by the `multiplier` field.\n\nOne of the following is required when specifying a points multiplier:\n- (Recommended) The `multiplier` field.\n- This deprecated `points_multiplier` field. If provided in the request, Square also returns `multiplier`\nwith the equivalent value.", + "minimum": 2, + "maximum": 10, + "x-release-status": "DEPRECATED", + "nullable": true + }, + "multiplier": { + "type": "string", + "description": "The multiplier used to calculate the number of points earned each time the promotion is triggered,\nspecified as a string representation of a decimal. Square supports multipliers up to 10x, with three\npoint precision for decimal multipliers. For example, suppose a purchase qualifies for 4 points from the\nbase loyalty program. If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive with a\n`multiplier` of \"1.5\", the buyer earns a total of 6 points (4 program points x 1.5 promotion multiplier = 6 points).\nFractional points are dropped.\n\nOne of the following is required when specifying a points multiplier:\n- (Recommended) This `multiplier` field.\n- The deprecated `points_multiplier` field. If provided in the request, Square also returns `multiplier`\nwith the equivalent value.", + "maxLength": 5, + "nullable": true + } + } + }, + "LoyaltyPromotionIncentiveType": { + "type": "string", + "enum": [ + "POINTS_MULTIPLIER", + "POINTS_ADDITION" + ], + "x-enum-elements": [ + { + "name": "POINTS_MULTIPLIER", + "description": "Multiply the number of points earned from the base loyalty program.\nFor example, \"Earn double points.\"" + }, + { + "name": "POINTS_ADDITION", + "description": "Add a specified number of points to those earned from the base loyalty program.\nFor example, \"Earn 10 additional points.\"" + } + ], + "description": "Indicates the type of points incentive for a [loyalty promotion](entity:LoyaltyPromotion),\nwhich is used to determine how buyers can earn points from the promotion.", + "x-release-status": "PUBLIC" + }, + "LoyaltyPromotionStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "ENDED", + "CANCELED", + "SCHEDULED" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "The loyalty promotion is currently active. Buyers can earn points for purchases\nthat meet the promotion conditions, such as the promotion's `available_time`." + }, + { + "name": "ENDED", + "description": "The loyalty promotion has ended because the specified `end_date` was reached.\n`ENDED` is a terminal status." + }, + { + "name": "CANCELED", + "description": "The loyalty promotion was canceled. `CANCELED` is a terminal status." + }, + { + "name": "SCHEDULED", + "description": "The loyalty promotion is scheduled to start in the future. Square changes the\npromotion status to `ACTIVE` when the `start_date` is reached." + } + ], + "description": "Indicates the status of a [loyalty promotion](entity:LoyaltyPromotion).", + "x-release-status": "PUBLIC" + }, + "LoyaltyPromotionTriggerLimit": { + "type": "object", + "description": "Represents the number of times a buyer can earn points during a [loyalty promotion](entity:LoyaltyPromotion).\nIf this field is not set, buyers can trigger the promotion an unlimited number of times to earn points during\nthe time that the promotion is available.\n\nA purchase that is disqualified from earning points because of this limit might qualify for another active promotion.", + "x-release-status": "PUBLIC", + "required": [ + "times" + ], + "properties": { + "times": { + "type": "integer", + "description": "The maximum number of times a buyer can trigger the promotion during the specified `interval`.", + "minimum": 1, + "maximum": 30 + }, + "interval": { + "$ref": "#/components/schemas/LoyaltyPromotionTriggerLimitInterval", + "description": "The time period the limit applies to.\nSee [LoyaltyPromotionTriggerLimitInterval](#type-loyaltypromotiontriggerlimitinterval) for possible values", + "nullable": true + } + } + }, + "LoyaltyPromotionTriggerLimitInterval": { + "type": "string", + "enum": [ + "ALL_TIME", + "DAY" + ], + "x-enum-elements": [ + { + "name": "ALL_TIME", + "description": "The limit applies to the entire time that the promotion is active. For example, if `times`\nis set to 1 and `time_period` is set to `ALL_TIME`, a buyer can earn promotion points a maximum\nof one time during the promotion." + }, + { + "name": "DAY", + "description": "The limit applies per day, according to the `available_time` schedule specified for the promotion.\nFor example, if the `times` field of the trigger limit is set to 1, a buyer can trigger the promotion\na maximum of once per day." + } + ], + "description": "Indicates the time period that the [trigger limit](entity:LoyaltyPromotionTriggerLimit) applies to,\nwhich is used to determine the number of times a buyer can earn points for a [loyalty promotion](entity:LoyaltyPromotion).", + "x-release-status": "PUBLIC" + }, + "LoyaltyPromotionUpdatedEvent": { + "type": "object", + "description": "Published when a [loyalty promotion](entity:LoyaltyPromotion) is updated. This event is\ninvoked only when a loyalty promotion is canceled.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.promotion.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyPromotionUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-07-14T01:23:45Z", + "data": { + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "object": { + "loyalty_promotion": { + "available_time": { + "start_date": "2022-06-06", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220612T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=SU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220606T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=MO\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220607T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220608T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=WE\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220609T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=TH\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220610T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=FR\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220611T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=SA\nEND:VEVENT" + ] + }, + "canceled_at": "2022-07-14T01:23:45Z", + "created_at": "2022-06-03T01:41:34Z", + "id": "loypromo_ba2f8ab6-e131-46d9-9882-17714404eb49", + "incentive": { + "points_addition_data": { + "points_addition": 5 + }, + "type": "POINTS_ADDITION" + }, + "loyalty_program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Happy Hour", + "qualifying_item_variation_ids": [ + "CJ3RYL56ITAKMD4VRCM7XERS", + "AT3RYLR3TUA9C34VRCB7X5RR" + ], + "status": "CANCELED", + "updated_at": "2022-07-14T01:23:45Z" + } + }, + "type": "loyalty_promotion" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.promotion.updated" + }, + "x-webhook": { + "event": "loyalty.promotion.updated", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2022-08-17" + }, + "LoyaltyPromotionUpdatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.promotion.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_promotion`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty promotion." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyPromotionUpdatedEventObject", + "description": "An object that contains the loyalty promotion that was updated.", + "nullable": true + } + } + }, + "LoyaltyPromotionUpdatedEventObject": { + "type": "object", + "description": "An object that contains the loyalty promotion associated with a `loyalty.promotion.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The loyalty promotion that was updated.", + "nullable": true + } + } + }, + "LoyaltyReward": { + "type": "object", + "description": "Represents a contract to redeem loyalty points for a [reward tier](entity:LoyaltyProgramRewardTier) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. \nFor more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards).", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_account_id", + "reward_tier_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the loyalty reward.", + "maxLength": 36, + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/LoyaltyRewardStatus", + "description": "The status of a loyalty reward.\nSee [LoyaltyRewardStatus](#type-loyaltyrewardstatus) for possible values", + "readOnly": true + }, + "loyalty_account_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty account](entity:LoyaltyAccount) to which the reward belongs.", + "minLength": 1, + "maxLength": 36 + }, + "reward_tier_id": { + "type": "string", + "description": "The Square-assigned ID of the [reward tier](entity:LoyaltyProgramRewardTier) used to create the reward.", + "minLength": 1, + "maxLength": 36 + }, + "points": { + "type": "integer", + "description": "The number of loyalty points used for the reward.", + "minimum": 1, + "readOnly": true + }, + "order_id": { + "type": "string", + "description": "The Square-assigned ID of the [order](entity:Order) to which the reward is attached.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the reward was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the reward was last updated, in RFC 3339 format.", + "readOnly": true + }, + "redeemed_at": { + "type": "string", + "description": "The timestamp when the reward was redeemed, in RFC 3339 format.", + "readOnly": true + } + } + }, + "LoyaltyRewardStatus": { + "type": "string", + "enum": [ + "ISSUED", + "REDEEMED", + "DELETED" + ], + "x-enum-elements": [ + { + "name": "ISSUED", + "description": "The reward is issued." + }, + { + "name": "REDEEMED", + "description": "The reward is redeemed." + }, + { + "name": "DELETED", + "description": "The reward is deleted." + } + ], + "description": "The status of the loyalty reward.", + "x-release-status": "PUBLIC" + }, + "MeasurementUnit": { + "type": "object", + "description": "Represents a unit of measurement to use with a quantity, such as ounces\nor inches. Exactly one of the following fields are required: `custom_unit`,\n`area_unit`, `length_unit`, `volume_unit`, and `weight_unit`.", + "x-release-status": "PUBLIC", + "properties": { + "custom_unit": { + "$ref": "#/components/schemas/MeasurementUnitCustom", + "description": "A custom unit of measurement defined by the seller using the Point of Sale\napp or ad-hoc as an order line item.", + "nullable": true + }, + "area_unit": { + "$ref": "#/components/schemas/MeasurementUnitArea", + "description": "Represents a standard area unit.\nSee [MeasurementUnitArea](#type-measurementunitarea) for possible values", + "nullable": true + }, + "length_unit": { + "$ref": "#/components/schemas/MeasurementUnitLength", + "description": "Represents a standard length unit.\nSee [MeasurementUnitLength](#type-measurementunitlength) for possible values", + "nullable": true + }, + "volume_unit": { + "$ref": "#/components/schemas/MeasurementUnitVolume", + "description": "Represents a standard volume unit.\nSee [MeasurementUnitVolume](#type-measurementunitvolume) for possible values", + "nullable": true + }, + "weight_unit": { + "$ref": "#/components/schemas/MeasurementUnitWeight", + "description": "Represents a standard unit of weight or mass.\nSee [MeasurementUnitWeight](#type-measurementunitweight) for possible values", + "nullable": true + }, + "generic_unit": { + "$ref": "#/components/schemas/MeasurementUnitGeneric", + "description": "Reserved for API integrations that lack the ability to specify a real measurement unit\nSee [MeasurementUnitGeneric](#type-measurementunitgeneric) for possible values", + "nullable": true + }, + "time_unit": { + "$ref": "#/components/schemas/MeasurementUnitTime", + "description": "Represents a standard unit of time.\nSee [MeasurementUnitTime](#type-measurementunittime) for possible values", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/MeasurementUnitUnitType", + "description": "Represents the type of the measurement unit.\nSee [MeasurementUnitUnitType](#type-measurementunitunittype) for possible values", + "nullable": true + } + } + }, + "MeasurementUnitArea": { + "type": "string", + "enum": [ + "IMPERIAL_ACRE", + "IMPERIAL_SQUARE_INCH", + "IMPERIAL_SQUARE_FOOT", + "IMPERIAL_SQUARE_YARD", + "IMPERIAL_SQUARE_MILE", + "METRIC_SQUARE_CENTIMETER", + "METRIC_SQUARE_METER", + "METRIC_SQUARE_KILOMETER" + ], + "x-enum-elements": [ + { + "name": "IMPERIAL_ACRE", + "description": "The area is measured in acres." + }, + { + "name": "IMPERIAL_SQUARE_INCH", + "description": "The area is measured in square inches." + }, + { + "name": "IMPERIAL_SQUARE_FOOT", + "description": "The area is measured in square feet." + }, + { + "name": "IMPERIAL_SQUARE_YARD", + "description": "The area is measured in square yards." + }, + { + "name": "IMPERIAL_SQUARE_MILE", + "description": "The area is measured in square miles." + }, + { + "name": "METRIC_SQUARE_CENTIMETER", + "description": "The area is measured in square centimeters." + }, + { + "name": "METRIC_SQUARE_METER", + "description": "The area is measured in square meters." + }, + { + "name": "METRIC_SQUARE_KILOMETER", + "description": "The area is measured in square kilometers." + } + ], + "description": "Unit of area used to measure a quantity.", + "x-release-status": "PUBLIC" + }, + "MeasurementUnitCustom": { + "type": "object", + "description": "The information needed to define a custom unit, provided by the seller.", + "x-release-status": "PUBLIC", + "required": [ + "name", + "abbreviation" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the custom unit, for example \"bushel\"." + }, + "abbreviation": { + "type": "string", + "description": "The abbreviation of the custom unit, such as \"bsh\" (bushel). This appears\nin the cart for the Point of Sale app, and in reports." + } + } + }, + "MeasurementUnitGeneric": { + "type": "string", + "enum": [ + "UNIT" + ], + "x-enum-elements": [ + { + "name": "UNIT", + "description": "The generic unit." + } + ], + "x-release-status": "PUBLIC" + }, + "MeasurementUnitLength": { + "type": "string", + "enum": [ + "IMPERIAL_INCH", + "IMPERIAL_FOOT", + "IMPERIAL_YARD", + "IMPERIAL_MILE", + "METRIC_MILLIMETER", + "METRIC_CENTIMETER", + "METRIC_METER", + "METRIC_KILOMETER" + ], + "x-enum-elements": [ + { + "name": "IMPERIAL_INCH", + "description": "The length is measured in inches." + }, + { + "name": "IMPERIAL_FOOT", + "description": "The length is measured in feet." + }, + { + "name": "IMPERIAL_YARD", + "description": "The length is measured in yards." + }, + { + "name": "IMPERIAL_MILE", + "description": "The length is measured in miles." + }, + { + "name": "METRIC_MILLIMETER", + "description": "The length is measured in millimeters." + }, + { + "name": "METRIC_CENTIMETER", + "description": "The length is measured in centimeters." + }, + { + "name": "METRIC_METER", + "description": "The length is measured in meters." + }, + { + "name": "METRIC_KILOMETER", + "description": "The length is measured in kilometers." + } + ], + "description": "The unit of length used to measure a quantity.", + "x-release-status": "PUBLIC" + }, + "MeasurementUnitTime": { + "type": "string", + "enum": [ + "GENERIC_MILLISECOND", + "GENERIC_SECOND", + "GENERIC_MINUTE", + "GENERIC_HOUR", + "GENERIC_DAY" + ], + "x-enum-elements": [ + { + "name": "GENERIC_MILLISECOND", + "description": "The time is measured in milliseconds." + }, + { + "name": "GENERIC_SECOND", + "description": "The time is measured in seconds." + }, + { + "name": "GENERIC_MINUTE", + "description": "The time is measured in minutes." + }, + { + "name": "GENERIC_HOUR", + "description": "The time is measured in hours." + }, + { + "name": "GENERIC_DAY", + "description": "The time is measured in days." + } + ], + "description": "Unit of time used to measure a quantity (a duration).", + "x-release-status": "PUBLIC" + }, + "MeasurementUnitUnitType": { + "type": "string", + "enum": [ + "TYPE_CUSTOM", + "TYPE_AREA", + "TYPE_LENGTH", + "TYPE_VOLUME", + "TYPE_WEIGHT", + "TYPE_GENERIC" + ], + "x-enum-elements": [ + { + "name": "TYPE_CUSTOM", + "description": "The unit details are contained in the custom_unit field." + }, + { + "name": "TYPE_AREA", + "description": "The unit details are contained in the area_unit field." + }, + { + "name": "TYPE_LENGTH", + "description": "The unit details are contained in the length_unit field." + }, + { + "name": "TYPE_VOLUME", + "description": "The unit details are contained in the volume_unit field." + }, + { + "name": "TYPE_WEIGHT", + "description": "The unit details are contained in the weight_unit field." + }, + { + "name": "TYPE_GENERIC", + "description": "The unit details are contained in the generic_unit field." + } + ], + "description": "Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum.", + "x-release-status": "PUBLIC" + }, + "MeasurementUnitVolume": { + "type": "string", + "enum": [ + "GENERIC_FLUID_OUNCE", + "GENERIC_SHOT", + "GENERIC_CUP", + "GENERIC_PINT", + "GENERIC_QUART", + "GENERIC_GALLON", + "IMPERIAL_CUBIC_INCH", + "IMPERIAL_CUBIC_FOOT", + "IMPERIAL_CUBIC_YARD", + "METRIC_MILLILITER", + "METRIC_LITER" + ], + "x-enum-elements": [ + { + "name": "GENERIC_FLUID_OUNCE", + "description": "The volume is measured in ounces." + }, + { + "name": "GENERIC_SHOT", + "description": "The volume is measured in shots." + }, + { + "name": "GENERIC_CUP", + "description": "The volume is measured in cups." + }, + { + "name": "GENERIC_PINT", + "description": "The volume is measured in pints." + }, + { + "name": "GENERIC_QUART", + "description": "The volume is measured in quarts." + }, + { + "name": "GENERIC_GALLON", + "description": "The volume is measured in gallons." + }, + { + "name": "IMPERIAL_CUBIC_INCH", + "description": "The volume is measured in cubic inches." + }, + { + "name": "IMPERIAL_CUBIC_FOOT", + "description": "The volume is measured in cubic feet." + }, + { + "name": "IMPERIAL_CUBIC_YARD", + "description": "The volume is measured in cubic yards." + }, + { + "name": "METRIC_MILLILITER", + "description": "The volume is measured in metric milliliters." + }, + { + "name": "METRIC_LITER", + "description": "The volume is measured in metric liters." + } + ], + "description": "The unit of volume used to measure a quantity.", + "x-release-status": "PUBLIC" + }, + "MeasurementUnitWeight": { + "type": "string", + "enum": [ + "IMPERIAL_WEIGHT_OUNCE", + "IMPERIAL_POUND", + "IMPERIAL_STONE", + "METRIC_MILLIGRAM", + "METRIC_GRAM", + "METRIC_KILOGRAM" + ], + "x-enum-elements": [ + { + "name": "IMPERIAL_WEIGHT_OUNCE", + "description": "The weight is measured in ounces." + }, + { + "name": "IMPERIAL_POUND", + "description": "The weight is measured in pounds." + }, + { + "name": "IMPERIAL_STONE", + "description": "The weight is measured in stones." + }, + { + "name": "METRIC_MILLIGRAM", + "description": "The weight is measured in milligrams." + }, + { + "name": "METRIC_GRAM", + "description": "The weight is measured in grams." + }, + { + "name": "METRIC_KILOGRAM", + "description": "The weight is measured in kilograms." + } + ], + "description": "Unit of weight used to measure a quantity.", + "x-release-status": "PUBLIC" + }, + "Merchant": { + "type": "object", + "description": "Represents a business that sells with Square.", + "x-release-status": "PUBLIC", + "required": [ + "country" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-issued ID of the merchant." + }, + "business_name": { + "type": "string", + "description": "The name of the merchant's overall business.", + "nullable": true + }, + "country": { + "$ref": "#/components/schemas/Country", + "description": "The country code associated with the merchant, in the two-letter format of ISO 3166. For example, `US` or `JP`.\nSee [Country](#type-country) for possible values" + }, + "language_code": { + "type": "string", + "description": "The code indicating the [language preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences) of the merchant, in [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). For example, `en-US` or `fr-CA`.", + "nullable": true + }, + "currency": { + "$ref": "#/components/schemas/Currency", + "description": "The currency associated with the merchant, in ISO 4217 format. For example, the currency code for US dollars is `USD`.\nSee [Currency](#type-currency) for possible values", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/MerchantStatus", + "description": "The merchant's status.\nSee [MerchantStatus](#type-merchantstatus) for possible values", + "nullable": true + }, + "main_location_id": { + "type": "string", + "description": "The ID of the [main `Location`](https://developer.squareup.com/docs/locations-api#about-the-main-location) for this merchant.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the merchant was created, in RFC 3339 format.\n For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates).", + "readOnly": true + } + } + }, + "MerchantCustomAttributeDefinitionOwnedCreatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nis created by the subscribing application. Subscribe to this event to be notified\nwhen your application creates a merchant custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.owned.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T21:40:49.943Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "object": { + "created_at": "2023-126T21:40:49Z", + "description": "Whether the merchant has seen the tutorial screen for using the app.", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "name": "Seen tutorial Screen", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-01-26T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + }, + "type": "custom_attribute_definition" + }, + "event_id": "347ab320-c0ba-48f5-959a-4e147b9aefcf", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.owned.created" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.owned.created", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeDefinitionOwnedDeletedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nis deleted by the subscribing application. Subscribe to this event to be notified\nwhen your application deletes a merchant custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-27T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "object": { + "created_at": "2022-126T21:40:49Z", + "description": "Has seen the merchant seen the tutorial screen for using the app?", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "name": "Seen tutorial screen", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-01-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_HIDDEN" + }, + "type": "custom_attribute_definition" + }, + "event_id": "49363646-7ae7-49b5-aaa0-296610883c61", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.owned.deleted" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.owned.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeDefinitionOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nis updated by the subscribing application. Subscribe to this event to be notified\nwhen your application updates a merchant custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T01:22:29Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "object": { + "created_at": "2022-1-26T21:57:39Z", + "description": "Has seen the merchant seen the tutorial screen for using the app?", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "name": "Seen tutorial screen", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-01-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_HIDDEN" + }, + "type": "custom_attribute_definition" + }, + "event_id": "d914e6ef-9e37-4bca-a663-ecc55f5d98d3", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.owned.updated" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.owned.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeDefinitionVisibleCreatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is created. A notification is sent when your application\ncreates a custom attribute definition or another application creates a custom attribute definition whose\n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.visible.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-02-21T21:40:49.943Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "object": { + "created_at": "2022-02-21T21:40:49Z", + "description": "Can this seller provide 2 day shipping?", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "name": "Ships Quickly", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-02-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "f679dc4f-3619-4764-a4de-94a54735cd32", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.visible.created" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.visible.created", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeDefinitionVisibleDeletedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is deleted. A notification is sent when your application\ndeletes a custom attribute definition or another application deletes a custom attribute definition whose\n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-02-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "object": { + "created_at": "2022-02-21T21:40:49Z", + "description": "Can this seller provide 2 day shipping?", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "name": "Provides 2 day shipping", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-02-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "81c10a07-c329-4943-af20-7d70a300c7e6", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.visible.deleted" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.visible.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeDefinitionVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is updated. A notification is sent when your application\nupdates a custom attribute definition or another application updates a custom attribute definition whose\n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-02-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "object": { + "created_at": "2022-02-21T21:57:39Z", + "description": "Can this seller provide 2 day shipping?", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "name": "Provides 2 day shipping", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-02-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "ae376c21-d360-4694-96c7-1b27830f07d7", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.visible.updated" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.visible.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeOwnedDeletedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute](entity:CustomAttribute)\nassociated with a [custom attribute definition](entity:CustomAttributeDefinition) that is\nowned by the subscribing application is deleted. Subscribe to this event to be notified\nwhen your application deletes a merchant custom attribute.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T21:40:54Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial:MERCHANT:DM7VKY8Q63GNP", + "object": { + "created_at": "2022-1-26T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "updated_at": "2022-01-27T12:40:54Z", + "value": true, + "version": 2, + "visibility": "VISIBILITY_HIDDEN" + }, + "type": "custom_attribute" + }, + "event_id": "473795bf-6ce4-4595-88ae-a5e7cc690c02", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute.owned.deleted" + }, + "x-webhook": { + "event": "merchant.custom_attribute.owned.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute](entity:CustomAttribute)\nassociated with a [custom attribute definition](entity:CustomAttributeDefinition) that is\nowned by the subscribing application is updated. Subscribe to this event to be notified\nwhen your application updates a merchant custom attribute.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T21:40:54Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial:MERCHANT:DM7VKY8Q63GNP", + "object": { + "created_at": "2022-1-26T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "updated_at": "2022-01-26T21:40:54Z", + "value": true, + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + }, + "type": "custom_attribute" + }, + "event_id": "e26ca6f2-97f8-426a-b4bf-873024617e94", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute.owned.updated" + }, + "x-webhook": { + "event": "merchant.custom_attribute.owned.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeVisibleDeletedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute](entity:CustomAttribute) with\nthe `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted.\nAn application that subscribes to this event is notified when a merchant custom attribute is deleted\nby any application for which the subscribing application has read access to the merchant custom attribute.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled:MERCHANT:DM7VKY8Q63GNP", + "object": { + "created_at": "2022-1-21T21:58:59Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "updated_at": "2022-01-27T11:31:29Z", + "value": false, + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "18ef5adc-2efc-4ad9-9b1a-b274a607da3e", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute.visible.deleted" + }, + "x-webhook": { + "event": "merchant.custom_attribute.visible.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute](entity:CustomAttribute) with\nthe `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated.\nAn application that subscribes to this event is notified when a merchant custom attribute is updated\nby any application for which the subscribing application has read access to the merchant custom attribute.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled:MERCHANT:DM7VKY8Q63GNP", + "object": { + "created_at": "2022-1-21T21:40:54Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "updated_at": "2022-01-26T01:22:29Z", + "value": false, + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "1cc2925c-f6e2-4fb6-a597-07c198de59e1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute.visible.updated" + }, + "x-webhook": { + "event": "merchant.custom_attribute.visible.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantSettingsUpdatedEvent": { + "type": "object", + "description": "Published when online checkout merchant settings are updated", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"online_checkout.merchant_settings.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/MerchantSettingsUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2023-11-09T18:04:58.856036784Z", + "data": { + "id": "MLX0WMXAER48M", + "object": { + "merchant_settings": { + "payment_methods": { + "afterpay_clearpay": { + "enabled": true, + "item_eligibility_range": { + "max": { + "amount": 200000, + "currency": "USD" + }, + "min": { + "amount": 200, + "currency": "USD" + } + }, + "order_eligibility_range": { + "max": { + "amount": 200000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + } + }, + "apple_pay": { + "enabled": false + }, + "cash_app": { + "enabled": true + }, + "google_pay": { + "enabled": true + } + }, + "updated_at": "2023-11-09 18:04:58 +0000 UTC" + } + }, + "type": "merchant_settings" + }, + "event_id": "8bfc6b46-b274-376f-b5e7-0575827f6f29", + "merchant_id": "MLX0WMXAER48M", + "type": "online_checkout.merchant_settings.updated" + }, + "x-webhook": { + "event": "online_checkout.merchant_settings.updated", + "scopes": [ + "MERCHANT_PROFILE_WRITE", + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/Checkout", + "x-since": "2023-12-13" + }, + "MerchantSettingsUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the updated object’s type, `\"online_checkout.merchant_settings\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated merchant settings." + }, + "object": { + "$ref": "#/components/schemas/MerchantSettingsUpdatedEventObject", + "description": "An object containing the updated merchant settings.", + "nullable": true + } + } + }, + "MerchantSettingsUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "merchant_settings": { + "$ref": "#/components/schemas/CheckoutMerchantSettings", + "description": "The updated merchant settings.", + "nullable": true + } + } + }, + "MerchantStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "A fully operational merchant account. The merchant can interact with Square products and APIs." + }, + { + "name": "INACTIVE", + "description": "A functionally limited merchant account. The merchant can only have limited interaction\nvia Square APIs. The merchant cannot log in or access the seller dashboard." + } + ], + "x-release-status": "PUBLIC" + }, + "ModifierLocationOverrides": { + "type": "object", + "description": "Location-specific overrides for specified properties of a `CatalogModifier` object.", + "x-release-status": "PUBLIC", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the `Location` object representing the location. This can include a deactivated location.", + "nullable": true + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The overridden price at the specified location. If this is unspecified, the modifier price is not overridden.\nThe modifier becomes free of charge at the specified location, when this `price_money` field is set to 0.", + "nullable": true + }, + "sold_out": { + "type": "boolean", + "description": "Indicates whether the modifier is sold out at the specified location or not. As an example, for cheese (modifier) burger (item), when the modifier is sold out, it is the cheese, but not the burger, that is sold out.\nThe seller can manually set this sold out status. Attempts by an application to set this attribute are ignored.", + "readOnly": true + } + } + }, + "Money": { + "type": "object", + "description": "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information.", + "x-release-status": "PUBLIC", + "properties": { + "amount": { + "type": "integer", + "description": "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case.", + "format": "int64", + "nullable": true + }, + "currency": { + "$ref": "#/components/schemas/Currency", + "description": "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](entity:Currency) for possible values.\nSee [Currency](#type-currency) for possible values", + "nullable": true + } + } + }, + "OauthAuthorizationRevokedEvent": { + "type": "object", + "description": "Published when a merchant/application revokes all access tokens and refresh tokens granted to an application.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"oauth.authorization.revoked\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/OauthAuthorizationRevokedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-08-14T15:51:04.246373287Z", + "data": { + "id": "415641cf-eba2-4dfa-88cc-c4be1301fdc6", + "object": { + "revocation": { + "revoked_at": "2020-08-14T15:51:00.246373287Z", + "revoker_type": "MERCHANT" + } + }, + "type": "revocation" + }, + "event_id": "e1d6ae37-5aa9-45a5-b525-b12caf819fdb", + "merchant_id": "J9Z30SF99NPFJ", + "type": "oauth.authorization.revoked" + }, + "x-webhook": { + "event": "oauth.authorization.revoked", + "scopes": null + }, + "x-api": "#/components/x-apis/OAuth", + "x-since": "2020-08-26" + }, + "OauthAuthorizationRevokedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"revocation\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "Not applicable, revocation is not an object" + }, + "object": { + "$ref": "#/components/schemas/OauthAuthorizationRevokedEventObject", + "description": "An object containing information about revocation event.", + "nullable": true + } + } + }, + "OauthAuthorizationRevokedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "revocation": { + "$ref": "#/components/schemas/OauthAuthorizationRevokedEventRevocationObject", + "description": "The revocation event.", + "nullable": true + } + } + }, + "OauthAuthorizationRevokedEventRevocationObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "revoked_at": { + "type": "string", + "description": "Timestamp of when the revocation event occurred, in RFC 3339 format.", + "nullable": true + }, + "revoker_type": { + "$ref": "#/components/schemas/OauthAuthorizationRevokedEventRevokerType", + "description": "Type of client that performed the revocation, either APPLICATION, MERCHANT, or SQUARE.\nSee [OauthAuthorizationRevokedEventRevokerType](#type-oauthauthorizationrevokedeventrevokertype) for possible values", + "nullable": true + } + } + }, + "OauthAuthorizationRevokedEventRevokerType": { + "type": "string", + "enum": [ + "APPLICATION", + "MERCHANT", + "SQUARE" + ], + "x-enum-elements": [ + { + "name": "APPLICATION", + "description": "The application that requested access to a merchant's data." + }, + { + "name": "MERCHANT", + "description": "The admin for the merchant." + }, + { + "name": "SQUARE", + "description": "An internal Square employee." + } + ], + "description": "Defines the possible types for the revoking client.", + "x-release-status": "PUBLIC" + }, + "ObtainTokenRequest": { + "type": "object", + "description": "Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) request.", + "x-release-status": "PUBLIC", + "required": [ + "client_id", + "grant_type" + ], + "properties": { + "client_id": { + "type": "string", + "description": "The Square-issued ID of your application, which is available as the **Application ID**\non the **OAuth** page in the [Developer Console](https://developer.squareup.com/apps).\n\nRequired for the code flow and PKCE flow for any grant type.", + "maxLength": 191 + }, + "client_secret": { + "type": "string", + "description": "The secret key for your application, which is available as the **Application secret**\non the **OAuth** page in the [Developer Console](https://developer.squareup.com/apps).\n\nRequired for the code flow for any grant type. Don't confuse your client secret with your\npersonal access token.", + "minLength": 2, + "maxLength": 1024, + "nullable": true + }, + "code": { + "type": "string", + "description": "The authorization code to exchange for an OAuth access token. This is the `code`\nvalue that Square sent to your redirect URL in the authorization response.\n\nRequired for the code flow and PKCE flow if `grant_type` is `authorization_code`.", + "maxLength": 191, + "nullable": true + }, + "redirect_uri": { + "type": "string", + "description": "The redirect URL for your application, which you registered as the **Redirect URL**\non the **OAuth** page in the [Developer Console](https://developer.squareup.com/apps).\n\nRequired for the code flow and PKCE flow if `grant_type` is `authorization_code` and\nyou provided the `redirect_uri` parameter in your authorization URL.", + "maxLength": 2048, + "nullable": true + }, + "grant_type": { + "type": "string", + "description": "The method used to obtain an OAuth access token. The request must include the\ncredential that corresponds to the specified grant type. Valid values are:\n- `authorization_code` - Requires the `code` field.\n- `refresh_token` - Requires the `refresh_token` field.\n- `migration_token` - LEGACY for access tokens obtained using a Square API version prior\nto 2019-03-13. Requires the `migration_token` field.", + "minLength": 10, + "maxLength": 20 + }, + "refresh_token": { + "type": "string", + "description": "A valid refresh token used to generate a new OAuth access token. This is a\nrefresh token that was returned in a previous `ObtainToken` response.\n\nRequired for the code flow and PKCE flow if `grant_type` is `refresh_token`.", + "minLength": 2, + "maxLength": 1024, + "nullable": true + }, + "migration_token": { + "type": "string", + "description": "__LEGACY__ A valid access token (obtained using a Square API version prior to 2019-03-13)\nused to generate a new OAuth access token.\n\nRequired if `grant_type` is `migration_token`. For more information, see\n[Migrate to Using Refresh Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens).", + "minLength": 2, + "maxLength": 1024, + "nullable": true + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of permissions that are explicitly requested for the access token.\nFor example, [\"MERCHANT_PROFILE_READ\",\"PAYMENTS_READ\",\"BANK_ACCOUNTS_READ\"].\n\nThe returned access token is limited to the permissions that are the intersection\nof these requested permissions and those authorized by the provided `refresh_token`.\n\nOptional for the code flow and PKCE flow if `grant_type` is `refresh_token`.", + "nullable": true + }, + "short_lived": { + "type": "boolean", + "description": "Indicates whether the returned access token should expire in 24 hours.\n\nOptional for the code flow and PKCE flow for any grant type. The default value is `false`.", + "nullable": true + }, + "code_verifier": { + "type": "string", + "description": "The secret your application generated for the authorization request used to\nobtain the authorization code. This is the source of the `code_challenge` hash you\nprovided in your authorization URL.\n\nRequired for the PKCE flow if `grant_type` is `authorization_code`.", + "nullable": true + } + }, + "example": { + "client_id": "sq0idp-uaPHILoPzWZk3tlJqlML0g", + "client_secret": "sq0csp-30a-4C_tVOnTh14Piza2BfTPBXyLafLPWSzY1qAjeBfM", + "code": "sq0cgb-l0SBqxs4uwxErTVyYOdemg", + "grant_type": "authorization_code" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ObtainToken/ObtainTokenRequest.csharp", + "java": "/sdk_samples/ObtainToken/ObtainTokenRequest.java", + "javascript": "/sdk_samples/ObtainToken/ObtainTokenRequest.javascript", + "php": "/sdk_samples/ObtainToken/ObtainTokenRequest.php", + "python": "/sdk_samples/ObtainToken/ObtainTokenRequest.python", + "ruby": "/sdk_samples/ObtainToken/ObtainTokenRequest.ruby" + } + }, + "ObtainTokenResponse": { + "type": "object", + "description": "Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) response.", + "x-release-status": "PUBLIC", + "properties": { + "access_token": { + "type": "string", + "description": "An OAuth access token used to authorize Square API requests on behalf of the seller.\nInclude this token as a bearer token in the `Authorization` header of your API requests.\n\nOAuth access tokens expire in 30 days (except `short_lived` access tokens). You should call\n`ObtainToken` and provide the returned `refresh_token` to get a new access token well before\nthe current one expires. For more information, see [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough).", + "minLength": 2, + "maxLength": 1024 + }, + "token_type": { + "type": "string", + "description": "The type of access token. This value is always `bearer`.", + "minLength": 2, + "maxLength": 10 + }, + "expires_at": { + "type": "string", + "description": "The timestamp of when the `access_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.", + "minLength": 20, + "maxLength": 48 + }, + "merchant_id": { + "type": "string", + "description": "The ID of the authorizing [merchant](entity:Merchant) (seller), which represents a business.", + "minLength": 8, + "maxLength": 191 + }, + "subscription_id": { + "type": "string", + "description": "__LEGACY__ The ID of merchant's subscription.\nThe ID is only present if the merchant signed up for a subscription plan during authorization." + }, + "plan_id": { + "type": "string", + "description": "__LEGACY__ The ID of the subscription plan the merchant signed\nup for. The ID is only present if the merchant signed up for a subscription plan during\nauthorization." + }, + "id_token": { + "type": "string", + "description": "The OpenID token that belongs to this person. This token is only present if the\n`OPENID` scope is included in the authorization request.\n\nDeprecated at version 2021-09-15. Square doesn't support OpenID or other single sign-on (SSO)\nprotocols on top of OAuth.", + "x-release-status": "DEPRECATED" + }, + "refresh_token": { + "type": "string", + "description": "A refresh token that can be used in an `ObtainToken` request to generate a new access token.\n\nWith the code flow:\n- For the `authorization_code` grant type, the refresh token is multi-use and never expires.\n- For the `refresh_token` grant type, the response returns the same refresh token.\n\nWith the PKCE flow:\n- For the `authorization_code` grant type, the refresh token is single-use and expires in 90 days.\n- For the `refresh_token` grant type, the refresh token is a new single-use refresh token that expires in 90 days.\n\nFor more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope).", + "minLength": 2, + "maxLength": 1024 + }, + "short_lived": { + "type": "boolean", + "description": "Indicates whether the access_token is short lived. If `true`, the access token expires\nin 24 hours. If `false`, the access token expires in 30 days." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "refresh_token_expires_at": { + "type": "string", + "description": "The timestamp of when the `refresh_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm)\nformat.\n\nThis field is only returned for the PKCE flow.", + "minLength": 20, + "maxLength": 48 + } + }, + "example": { + "access_token": "EAAl3ikZIe18J-2-cHlV2bL4-EaZHGoJUhtEBT7QA6-7AgwIHw8Xe1IoUvGsNxA", + "expires_at": "2025-04-03T18:31:06Z", + "merchant_id": "MLQW2MYBY81PZ", + "refresh_token": "EQAAl0OcByu3IYJYScGGg-8E5YNf0r0b6jCTCMy5nOcRZ4ok0wbWAL8vY3tZWNcc", + "short_lived": false, + "token_type": "bearer" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ObtainToken/ObtainTokenResponse.csharp", + "java": "/sdk_samples/ObtainToken/ObtainTokenResponse.java", + "javascript": "/sdk_samples/ObtainToken/ObtainTokenResponse.javascript", + "php": "/sdk_samples/ObtainToken/ObtainTokenResponse.php", + "python": "/sdk_samples/ObtainToken/ObtainTokenResponse.python", + "ruby": "/sdk_samples/ObtainToken/ObtainTokenResponse.ruby" + } + }, + "OfflinePaymentDetails": { + "type": "object", + "description": "Details specific to offline payments.", + "x-release-status": "PUBLIC", + "properties": { + "client_created_at": { + "type": "string", + "description": "The client-side timestamp of when the offline payment was created, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + } + } + }, + "Order": { + "type": "object", + "description": "Contains all information related to a single order to process with Square,\nincluding line items that specify the products to purchase. `Order` objects also\ninclude information about any associated tenders, refunds, and returns.\n\nAll Connect V2 Transactions have all been converted to Orders including all associated\nitemization data.", + "x-release-status": "PUBLIC", + "required": [ + "location_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The order's unique ID.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the seller location that this order is associated with.", + "minLength": 1 + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID to associate an entity in another system\nwith this order.", + "maxLength": 40, + "nullable": true + }, + "source": { + "$ref": "#/components/schemas/OrderSource", + "description": "The origination details of the order.", + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "The ID of the [customer](entity:Customer) associated with the order.\n\nYou should specify a `customer_id` on the order (or the payment) to ensure that transactions\nare reliably linked to customers. Omitting this field might result in the creation of new\n[instant profiles](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles).", + "maxLength": 191, + "x-release-status": "BETA", + "nullable": true + }, + "line_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItem" + }, + "description": "The line items included in the order.", + "nullable": true + }, + "taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemTax" + }, + "description": "The list of all taxes associated with the order.\n\nTaxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with `LINE_ITEM` scope, an\n`OrderLineItemAppliedTax` must be added to each line item that the tax applies to. For taxes\nwith `ORDER` scope, the server generates an `OrderLineItemAppliedTax` for every line item.\n\nOn reads, each tax in the list includes the total amount of that tax applied to the order.\n\n__IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated\n`line_items.taxes` field results in an error. Use `line_items.applied_taxes`\ninstead.", + "nullable": true + }, + "discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemDiscount" + }, + "description": "The list of all discounts associated with the order.\n\nDiscounts can be scoped to either `ORDER` or `LINE_ITEM`. For discounts scoped to `LINE_ITEM`,\nan `OrderLineItemAppliedDiscount` must be added to each line item that the discount applies to.\nFor discounts with `ORDER` scope, the server generates an `OrderLineItemAppliedDiscount`\nfor every line item.\n\n__IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated\n`line_items.discounts` field results in an error. Use `line_items.applied_discounts`\ninstead.", + "nullable": true + }, + "service_charges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderServiceCharge" + }, + "description": "A list of service charges applied to the order.", + "nullable": true + }, + "fulfillments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Fulfillment" + }, + "description": "Details about order fulfillment.\n\nOrders can only be created with at most one fulfillment. However, orders returned\nby the API might contain multiple fulfillments.", + "nullable": true + }, + "returns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturn" + }, + "description": "A collection of items from sale orders being returned in this one. Normally part of an\nitemized return or exchange. There is exactly one `Return` object per sale `Order` being\nreferenced.", + "readOnly": true, + "x-release-status": "BETA" + }, + "return_amounts": { + "$ref": "#/components/schemas/OrderMoneyAmounts", + "description": "The rollup of the returned money amounts.", + "readOnly": true, + "x-release-status": "BETA" + }, + "net_amounts": { + "$ref": "#/components/schemas/OrderMoneyAmounts", + "description": "The net money amounts (sale money - return money).", + "readOnly": true, + "x-release-status": "BETA" + }, + "rounding_adjustment": { + "$ref": "#/components/schemas/OrderRoundingAdjustment", + "description": "A positive rounding adjustment to the total of the order. This adjustment is commonly\nused to apply cash rounding when the minimum unit of account is smaller than the lowest physical\ndenomination of the currency.", + "readOnly": true, + "x-release-status": "BETA" + }, + "tenders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tender" + }, + "description": "The tenders that were used to pay for the order.", + "readOnly": true, + "x-release-status": "BETA" + }, + "refunds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Refund" + }, + "description": "The refunds that are part of this order.", + "readOnly": true, + "x-release-status": "BETA" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this order. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the order was created, at server side, in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp for when the order was last updated, at server side, in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "closed_at": { + "type": "string", + "description": "The timestamp for when the order reached a terminal [state](entity:OrderState), in RFC 3339 format (for example \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "state": { + "$ref": "#/components/schemas/OrderState", + "description": "The current state of the order.\nSee [OrderState](#type-orderstate) for possible values", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is committed to the order.\nOrders not created through the API do not include a version number and\ntherefore cannot be updated.\n\n[Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders).", + "x-release-status": "BETA" + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money to collect for the order.", + "readOnly": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tax money to collect for the order.", + "readOnly": true + }, + "total_discount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of discount money to collect for the order.", + "readOnly": true + }, + "total_tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tip money to collect for the order.", + "readOnly": true + }, + "total_service_charge_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money collected in service charges for the order.\n\nNote: `total_service_charge_money` is the sum of `applied_money` fields for each individual\nservice charge. Therefore, `total_service_charge_money` only includes inclusive tax amounts,\nnot additive tax amounts.", + "readOnly": true + }, + "ticket_name": { + "type": "string", + "description": "A short-term identifier for the order (such as a customer first name,\ntable number, or auto-generated order number that resets daily).", + "maxLength": 30, + "x-release-status": "BETA", + "nullable": true + }, + "pricing_options": { + "$ref": "#/components/schemas/OrderPricingOptions", + "description": "Pricing options for an order. The options affect how the order's price is calculated.\nThey can be used, for example, to apply automatic price adjustments that are based on\npreconfigured [pricing rules](entity:CatalogPricingRule).", + "nullable": true + }, + "rewards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReward" + }, + "description": "A set-like list of Rewards that have been added to the Order.", + "readOnly": true, + "x-release-status": "BETA" + }, + "net_amount_due_money": { + "$ref": "#/components/schemas/Money", + "description": "The net amount of money due on the order.", + "readOnly": true + } + } + }, + "OrderCreated": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_id": { + "type": "string", + "description": "The order's unique ID.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is committed to the order.\nOrders that were not created through the API do not include a version number and\ntherefore cannot be updated.\n\n[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)" + }, + "location_id": { + "type": "string", + "description": "The ID of the seller location that this order is associated with.", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/OrderState", + "description": "The state of the order.\nSee [OrderState](#type-orderstate) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the order was created, in RFC 3339 format.", + "readOnly": true + } + } + }, + "OrderCreatedEvent": { + "type": "object", + "description": "Published when an [Order](entity:Order) is created. This event is\ntriggered only by the [CreateOrder](api-endpoint:Orders-CreateOrder) endpoint call.\n\nCreating an order in the Point of Sale app will **not** publish this event.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"order.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/OrderCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-16T23:14:26.129Z", + "data": { + "id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "object": { + "order_created": { + "created_at": "2020-04-16T23:14:26.129Z", + "location_id": "FPYCBCHYMXFK1", + "order_id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "state": "OPEN", + "version": 1 + } + }, + "type": "order_created" + }, + "event_id": "116038d3-2948-439f-8679-fc86dbf80f69", + "merchant_id": "5S9MXCS9Y99KK", + "type": "order.created" + }, + "x-webhook": { + "event": "order.created", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/Orders", + "x-since": "2020-04-22" + }, + "OrderCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"order_created\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected order." + }, + "object": { + "$ref": "#/components/schemas/OrderCreatedObject", + "description": "An object containing information about the created Order.", + "nullable": true + } + } + }, + "OrderCreatedObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_created": { + "$ref": "#/components/schemas/OrderCreated", + "description": "Information about the created order.", + "nullable": true + } + } + }, + "OrderCustomAttributeDefinitionOwnedCreatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.owned.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T20:59:17.185Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T20:59:17.185Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T20:59:17.185Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "11d7bdf0-773a-3e9e-9d59-d91fe31110db", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.owned.created" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.owned.created", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeDefinitionOwnedDeletedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:04:52Z", + "data": { + "deleted": true, + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T20:56:14.351Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T20:56:14.351Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "4cadb90e-8dac-38c0-8f50-521f477cf4a7", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.owned.deleted" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.owned.deleted", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeDefinitionOwnedUpdatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:25:45.592Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T21:25:28.693Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T21:25:45.592Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "39b6f636-7fcb-38f0-acbf-7e221e829496", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.owned.updated" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.owned.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeDefinitionVisibleCreatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.visible.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T20:59:17.185Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T20:59:17.185Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T20:59:17.185Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "32515c08-b0c3-3835-9606-f43f613e4635", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.visible.created" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.visible.created", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeDefinitionVisibleDeletedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:04:52Z", + "data": { + "deleted": true, + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T20:56:14.351Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T20:56:14.351Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "536e094e-d704-3962-9caa-a981240f13f1", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.visible.deleted" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.visible.deleted", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeDefinitionVisibleUpdatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:25:45.592Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T21:25:28.693Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T21:25:45.592Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "b0262c17-dea7-3a7e-aeb2-52bfb962959b", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.visible.updated" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.visible.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeOwnedDeletedEvent": { + "type": "object", + "description": "Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:36:17Z", + "data": { + "deleted": true, + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number:ORDER:VilxhxZHuWEqDC6GQNgiLNshRMYZY", + "object": { + "created_at": "2022-11-09T21:30:17.093Z", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "updated_at": "2022-11-09T21:34:20.906Z", + "value": "TEST", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "0026e02d-de6f-32b3-ba9f-d353d46544eb", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute.owned.deleted" + }, + "x-webhook": { + "event": "order.custom_attribute.owned.deleted", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeOwnedUpdatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:30:17.093Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number:ORDER:VilxhxZHuWEqDC6GQNgiLNshRMYZY", + "object": { + "created_at": "2022-11-09T21:30:17.093Z", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "updated_at": "2022-11-09T21:30:17.093Z", + "value": "Table-WK", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "92322a74-fd56-304e-aba7-4c4a7b82c003", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute.owned.updated" + }, + "x-webhook": { + "event": "order.custom_attribute.owned.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeVisibleDeletedEvent": { + "type": "object", + "description": "Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:36:17Z", + "data": { + "deleted": true, + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number:ORDER:VilxhxZHuWEqDC6GQNgiLNshRMYZY", + "object": { + "created_at": "2022-11-09T21:30:17.093Z", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "updated_at": "2022-11-09T21:34:20.906Z", + "value": "Table-WK", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "0a847808-3985-361d-b31f-b6060ccfea43", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute.visible.deleted" + }, + "x-webhook": { + "event": "order.custom_attribute.visible.deleted", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeVisibleUpdatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:30:17.093Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number:ORDER:VilxhxZHuWEqDC6GQNgiLNshRMYZY", + "object": { + "created_at": "2022-11-09T21:30:17.093Z", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "updated_at": "2022-11-09T21:30:17.093Z", + "value": "Table-WK", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "ff7b8470-95fc-3f29-8939-2a6cc23aca95", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute.visible.updated" + }, + "x-webhook": { + "event": "order.custom_attribute.visible.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderEntry": { + "type": "object", + "description": "A lightweight description of an [order](entity:Order) that is returned when\n`returned_entries` is `true` on a [SearchOrdersRequest](api-endpoint:Orders-SearchOrders).", + "x-release-status": "PUBLIC", + "properties": { + "order_id": { + "type": "string", + "description": "The ID of the order.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is committed to the order.\nOrders that were not created through the API do not include a version number and\ntherefore cannot be updated.\n\n[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)", + "readOnly": true, + "x-release-status": "BETA" + }, + "location_id": { + "type": "string", + "description": "The location ID the order belongs to.", + "nullable": true + } + } + }, + "OrderFulfillmentDeliveryDetailsScheduleType": { + "type": "string", + "enum": [ + "SCHEDULED", + "ASAP" + ], + "x-enum-elements": [ + { + "name": "SCHEDULED", + "description": "Indicates the fulfillment to deliver at a scheduled deliver time." + }, + { + "name": "ASAP", + "description": "Indicates that the fulfillment to deliver as soon as possible and should be prepared\nimmediately." + } + ], + "description": "The schedule type of the delivery fulfillment.", + "x-release-status": "BETA" + }, + "OrderFulfillmentFulfillmentLineItemApplication": { + "type": "string", + "enum": [ + "ALL", + "ENTRY_LIST" + ], + "x-enum-elements": [ + { + "name": "ALL", + "description": "If `ALL`, `entries` must be unset." + }, + { + "name": "ENTRY_LIST", + "description": "If `ENTRY_LIST`, supply a list of `entries`." + } + ], + "description": "The `line_item_application` describes what order line items this fulfillment applies\nto. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries.", + "x-release-status": "BETA" + }, + "OrderFulfillmentPickupDetailsScheduleType": { + "type": "string", + "enum": [ + "SCHEDULED", + "ASAP" + ], + "x-enum-elements": [ + { + "name": "SCHEDULED", + "description": "Indicates that the fulfillment will be picked up at a scheduled pickup time." + }, + { + "name": "ASAP", + "description": "Indicates that the fulfillment will be picked up as soon as possible and\nshould be prepared immediately." + } + ], + "description": "The schedule type of the pickup fulfillment.", + "x-release-status": "PUBLIC" + }, + "OrderFulfillmentState": { + "type": "string", + "enum": [ + "PROPOSED", + "RESERVED", + "PREPARED", + "COMPLETED", + "CANCELED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "PROPOSED", + "description": "Indicates that the fulfillment has been proposed." + }, + { + "name": "RESERVED", + "description": "Indicates that the fulfillment has been reserved." + }, + { + "name": "PREPARED", + "description": "Indicates that the fulfillment has been prepared." + }, + { + "name": "COMPLETED", + "description": "Indicates that the fulfillment was successfully completed." + }, + { + "name": "CANCELED", + "description": "Indicates that the fulfillment was canceled." + }, + { + "name": "FAILED", + "description": "Indicates that the fulfillment failed to be completed, but was not explicitly\ncanceled." + } + ], + "description": "The current state of this fulfillment.", + "x-release-status": "PUBLIC" + }, + "OrderFulfillmentType": { + "type": "string", + "enum": [ + "PICKUP", + "SHIPMENT", + "DELIVERY" + ], + "x-enum-elements": [ + { + "name": "PICKUP", + "description": "A recipient to pick up the fulfillment from a physical [location](entity:Location)." + }, + { + "name": "SHIPMENT", + "description": "A shipping carrier to ship the fulfillment." + }, + { + "name": "DELIVERY", + "description": "A courier to deliver the fulfillment." + } + ], + "description": "The type of fulfillment.", + "x-release-status": "PUBLIC" + }, + "OrderFulfillmentUpdated": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_id": { + "type": "string", + "description": "The order's unique ID.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is committed to the order.\nOrders that were not created through the API do not include a version number and\ntherefore cannot be updated.\n\n[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)" + }, + "location_id": { + "type": "string", + "description": "The ID of the seller location that this order is associated with.", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/OrderState", + "description": "The state of the order.\nSee [OrderState](#type-orderstate) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the order was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp for when the order was last updated, in RFC 3339 format.", + "readOnly": true + }, + "fulfillment_update": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderFulfillmentUpdatedUpdate" + }, + "description": "The fulfillments that were updated with this version change.", + "nullable": true + } + } + }, + "OrderFulfillmentUpdatedEvent": { + "type": "object", + "description": "Published when an [OrderFulfillment](entity:OrderFulfillment)\nis created or updated. This event is triggered only by the\n[UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint call.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"order.fulfillment.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/OrderFulfillmentUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-16T23:16:30.789Z", + "data": { + "id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "object": { + "order_fulfillment_updated": { + "created_at": "2020-04-16T23:14:26.129Z", + "fulfillment_update": [ + { + "fulfillment_uid": "VWJ1N9leLqjSDLvF2hvYjD", + "new_state": "RESERVED", + "old_state": "PROPOSED" + } + ], + "location_id": "FPYCBCHYMXFK1", + "order_id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "state": "OPEN", + "updated_at": "2020-04-16T23:16:30.789Z", + "version": 6 + } + }, + "type": "order_fulfillment_updated" + }, + "event_id": "b3adf364-4937-436e-a833-49c72b4baee8", + "merchant_id": "5S9MXCS9Y99KK", + "type": "order.fulfillment.updated" + }, + "x-webhook": { + "event": "order.fulfillment.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/Orders", + "x-since": "2020-04-22" + }, + "OrderFulfillmentUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"order_fulfillment_updated\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected order." + }, + "object": { + "$ref": "#/components/schemas/OrderFulfillmentUpdatedObject", + "description": "An object containing information about the updated Order.", + "nullable": true + } + } + }, + "OrderFulfillmentUpdatedObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_fulfillment_updated": { + "$ref": "#/components/schemas/OrderFulfillmentUpdated", + "description": "Information about the updated order fulfillment.", + "nullable": true + } + } + }, + "OrderFulfillmentUpdatedUpdate": { + "type": "object", + "description": "Information about fulfillment updates.", + "x-release-status": "BETA", + "properties": { + "fulfillment_uid": { + "type": "string", + "description": "A unique ID that identifies the fulfillment only within this order.", + "nullable": true + }, + "old_state": { + "$ref": "#/components/schemas/FulfillmentState", + "description": "The state of the fulfillment before the change.\nThe state is not populated if the fulfillment is created with this new `Order` version.", + "nullable": true + }, + "new_state": { + "$ref": "#/components/schemas/FulfillmentState", + "description": "The state of the fulfillment after the change. The state might be equal to `old_state` if a non-state\nfield was changed on the fulfillment (such as the tracking number).", + "nullable": true + } + } + }, + "OrderLineItem": { + "type": "object", + "description": "Represents a line item in an order. Each line item describes a different\nproduct to purchase, with its own quantity and price details.", + "x-release-status": "PUBLIC", + "required": [ + "quantity" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the line item only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the line item.", + "maxLength": 512, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The count, or measurement, of a line item being purchased:\n\nIf `quantity` is a whole number, and `quantity_unit` is not specified, then `quantity` denotes an item count. For example: `3` apples.\n\nIf `quantity` is a whole or decimal number, and `quantity_unit` is also specified, then `quantity` denotes a measurement. For example: `2.25` pounds of broccoli.\n\nFor more information, see [Specify item quantity and measurement unit](https://developer.squareup.com/docs/orders-api/create-orders#specify-item-quantity-and-measurement-unit).\n\nLine items with a quantity of `0` are automatically removed\nwhen paying for or otherwise completing the order.", + "minLength": 1, + "maxLength": 12 + }, + "quantity_unit": { + "$ref": "#/components/schemas/OrderQuantityUnit", + "description": "The measurement unit and decimal precision that this line item's quantity is measured in.", + "nullable": true + }, + "note": { + "type": "string", + "description": "An optional note associated with the line item.", + "maxLength": 2000, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this line item.", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this line item references.", + "format": "int64", + "nullable": true + }, + "variation_name": { + "type": "string", + "description": "The name of the variation applied to this line item.", + "maxLength": 400, + "nullable": true + }, + "item_type": { + "$ref": "#/components/schemas/OrderLineItemItemType", + "description": "The type of line item: an itemized sale, a non-itemized sale (custom amount), or the\nactivation or reloading of a gift card.\nSee [OrderLineItemItemType](#type-orderlineitemitemtype) for possible values", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this line item. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "modifiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemModifier" + }, + "description": "The [CatalogModifier](entity:CatalogModifier)s applied to this line item.", + "nullable": true + }, + "applied_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedTax" + }, + "description": "The list of references to taxes applied to this line item. Each\n`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a\ntop-level `OrderLineItemTax` applied to the line item. On reads, the\namount applied is populated.\n\nAn `OrderLineItemAppliedTax` is automatically created on every line\nitem for all `ORDER` scoped taxes added to the order. `OrderLineItemAppliedTax`\nrecords for `LINE_ITEM` scoped taxes must be added in requests for the tax\nto apply to any line items.\n\nTo change the amount of a tax, modify the referenced top-level tax.", + "x-release-status": "BETA", + "nullable": true + }, + "applied_discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedDiscount" + }, + "description": "The list of references to discounts applied to this line item. Each\n`OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level\n`OrderLineItemDiscounts` applied to the line item. On reads, the amount\napplied is populated.\n\nAn `OrderLineItemAppliedDiscount` is automatically created on every line item for all\n`ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` records\nfor `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any\nline items.\n\nTo change the amount of a discount, modify the referenced top-level discount.", + "x-release-status": "BETA", + "nullable": true + }, + "applied_service_charges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedServiceCharge" + }, + "description": "The list of references to service charges applied to this line item. Each\n`OrderLineItemAppliedServiceCharge` has a `service_charge_id` that references the `uid` of a\ntop-level `OrderServiceCharge` applied to the line item. On reads, the amount applied is\npopulated.\n\nTo change the amount of a service charge, modify the referenced top-level service charge.", + "x-release-status": "BETA", + "nullable": true + }, + "base_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The base price for a single unit of the line item.", + "nullable": true + }, + "variation_total_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The total price of all item variations sold in this line item.\nThe price is calculated as `base_price_money` multiplied by `quantity`.\nIt does not include modifiers.", + "readOnly": true + }, + "gross_sales_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money made in gross sales for this line item.\nThe amount is calculated as the sum of the variation's total price and each modifier's total price.\nFor inclusive tax items in the US, Canada, and Japan, tax is deducted from `gross_sales_money`. For Europe and\nAustralia, inclusive tax remains as part of the gross sale calculation.", + "readOnly": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tax money to collect for the line item.", + "readOnly": true + }, + "total_discount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of discount money to collect for the line item.", + "readOnly": true + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money to collect for this line item.", + "readOnly": true + }, + "pricing_blocklists": { + "$ref": "#/components/schemas/OrderLineItemPricingBlocklists", + "description": "Describes pricing adjustments that are blocked from automatic\napplication to a line item. For more information, see\n[Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts).", + "x-release-status": "BETA", + "nullable": true + }, + "total_service_charge_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of apportioned service charge money to collect for the line item.", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "OrderLineItemAppliedDiscount": { + "type": "object", + "description": "Represents an applied portion of a discount to a line item in an order.\n\nOrder scoped discounts have automatically applied discounts present for each line item.\nLine-item scoped discounts must have applied discounts added manually for any applicable line\nitems. The corresponding applied money is automatically computed based on participating\nline items.", + "x-release-status": "BETA", + "required": [ + "discount_uid" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the applied discount only within this order.", + "maxLength": 60, + "nullable": true + }, + "discount_uid": { + "type": "string", + "description": "The `uid` of the discount that the applied discount represents. It must\nreference a discount present in the `order.discounts` field.\n\nThis field is immutable. To change which discounts apply to a line item,\nyou must delete the discount and re-add it as a new `OrderLineItemAppliedDiscount`.", + "minLength": 1, + "maxLength": 60 + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied by the discount to the line item.", + "readOnly": true + } + } + }, + "OrderLineItemAppliedServiceCharge": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "service_charge_uid" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the applied service charge only within this order.", + "maxLength": 60, + "nullable": true + }, + "service_charge_uid": { + "type": "string", + "description": "The `uid` of the service charge that the applied service charge represents. It must\nreference a service charge present in the `order.service_charges` field.\n\nThis field is immutable. To change which service charges apply to a line item,\ndelete and add a new `OrderLineItemAppliedServiceCharge`.", + "minLength": 1, + "maxLength": 60 + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied by the service charge to the line item.", + "readOnly": true + } + } + }, + "OrderLineItemAppliedTax": { + "type": "object", + "description": "Represents an applied portion of a tax to a line item in an order.\n\nOrder-scoped taxes automatically include the applied taxes in each line item.\nLine item taxes must be referenced from any applicable line items.\nThe corresponding applied money is automatically computed, based on the\nset of participating line items.", + "x-release-status": "BETA", + "required": [ + "tax_uid" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the applied tax only within this order.", + "maxLength": 60, + "nullable": true + }, + "tax_uid": { + "type": "string", + "description": "The `uid` of the tax for which this applied tax represents. It must reference\na tax present in the `order.taxes` field.\n\nThis field is immutable. To change which taxes apply to a line item, delete and add a new\n`OrderLineItemAppliedTax`.", + "minLength": 1, + "maxLength": 60 + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied by the tax to the line item.", + "readOnly": true + } + } + }, + "OrderLineItemDiscount": { + "type": "object", + "description": "Represents a discount that applies to one or more line items in an\norder.\n\nFixed-amount, order-scoped discounts are distributed across all non-zero line item totals.\nThe amount distributed to each line item is relative to the\namount contributed by the item to the order subtotal.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the discount only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this discount references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The discount's name.", + "maxLength": 255, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/OrderLineItemDiscountType", + "description": "The type of the discount.\n\nDiscounts that do not reference a catalog object ID must have a type of\n`FIXED_PERCENTAGE` or `FIXED_AMOUNT`.\nSee [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the discount, as a string representation of a decimal number.\nA value of `7.25` corresponds to a percentage of 7.25%.\n\n`percentage` is not set for amount-based discounts.", + "maxLength": 10, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total declared monetary amount of the discount.\n\n`amount_money` is not set for percentage-based discounts.", + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of discount actually applied to the line item.\n\nThe amount represents the amount of money applied as a line-item scoped discount.\nWhen an amount-based discount is scoped to the entire order, the value\nof `applied_money` is different than `amount_money` because the total\namount of the discount is distributed across all line items.", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this discount. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "scope": { + "$ref": "#/components/schemas/OrderLineItemDiscountScope", + "description": "Indicates the level at which the discount applies. For `ORDER` scoped discounts,\nSquare generates references in `applied_discounts` on all order line items that do\nnot have them. For `LINE_ITEM` scoped discounts, the discount only applies to line items\nwith a discount reference in their `applied_discounts` field.\n\nThis field is immutable. To change the scope of a discount, you must delete\nthe discount and re-add it as a new discount.\nSee [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values", + "nullable": true + }, + "reward_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The reward IDs corresponding to this discount. The application and\nspecification of discounts that have `reward_ids` are completely controlled by the backing\ncriteria corresponding to the reward tiers of the rewards that are added to the order\nthrough the Loyalty API. To manually unapply discounts that are the result of added rewards,\nthe rewards must be removed from the order through the Loyalty API.", + "readOnly": true, + "x-release-status": "BETA" + }, + "pricing_rule_id": { + "type": "string", + "description": "The object ID of a [pricing rule](entity:CatalogPricingRule) to be applied\nautomatically to this discount. The specification and application of the discounts, to\nwhich a `pricing_rule_id` is assigned, are completely controlled by the corresponding\npricing rule.", + "readOnly": true + } + } + }, + "OrderLineItemDiscountScope": { + "type": "string", + "enum": [ + "OTHER_DISCOUNT_SCOPE", + "LINE_ITEM", + "ORDER" + ], + "x-enum-elements": [ + { + "name": "OTHER_DISCOUNT_SCOPE", + "description": "Used for reporting only.\nThe original transaction discount scope is currently not supported by the API." + }, + { + "name": "LINE_ITEM", + "description": "The discount should be applied to only line items specified by\n`OrderLineItemAppliedDiscount` reference records." + }, + { + "name": "ORDER", + "description": "The discount should be applied to the entire order." + } + ], + "description": "Indicates whether this is a line-item or order-level discount.", + "x-release-status": "PUBLIC" + }, + "OrderLineItemDiscountType": { + "type": "string", + "enum": [ + "UNKNOWN_DISCOUNT", + "FIXED_PERCENTAGE", + "FIXED_AMOUNT", + "VARIABLE_PERCENTAGE", + "VARIABLE_AMOUNT" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_DISCOUNT", + "description": "Used for reporting only.\nThe original transaction discount type is currently not supported by the API." + }, + { + "name": "FIXED_PERCENTAGE", + "description": "Apply the discount as a fixed percentage (such as 5%) off the item price." + }, + { + "name": "FIXED_AMOUNT", + "description": "Apply the discount as a fixed monetary value (such as $1.00) off the item price." + }, + { + "name": "VARIABLE_PERCENTAGE", + "description": "Apply the discount as a variable percentage based on the item\nprice.\n\nThe specific discount percentage of a `VARIABLE_PERCENTAGE` discount\nis assigned at the time of the purchase." + }, + { + "name": "VARIABLE_AMOUNT", + "description": "Apply the discount as a variable amount based on the item price.\n\nThe specific discount amount of a `VARIABLE_AMOUNT` discount\nis assigned at the time of the purchase." + } + ], + "description": "Indicates how the discount is applied to the associated line item or order.", + "x-release-status": "PUBLIC" + }, + "OrderLineItemItemType": { + "type": "string", + "enum": [ + "ITEM", + "CUSTOM_AMOUNT", + "GIFT_CARD" + ], + "x-enum-elements": [ + { + "name": "ITEM", + "description": "Indicates that the line item is an itemized sale." + }, + { + "name": "CUSTOM_AMOUNT", + "description": "Indicates that the line item is a non-itemized sale." + }, + { + "name": "GIFT_CARD", + "description": "Indicates that the line item is a gift card sale. Gift cards sold through\nthe Orders API are sold in an unactivated state and can be activated through the\nGift Cards API using the line item `uid`." + } + ], + "description": "Represents the line item type.", + "x-release-status": "BETA" + }, + "OrderLineItemModifier": { + "type": "object", + "description": "A [CatalogModifier](entity:CatalogModifier).", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the modifier only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogModifier](entity:CatalogModifier).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this modifier references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the item modifier.", + "maxLength": 255, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The quantity of the line item modifier. The modifier quantity can be 0 or more.\nFor example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders\nthis item, the restaurant records the purchase by creating an `Order` object with a line item\nfor a burger. The line item includes a line item modifier: the name is cheese and the quantity\nis 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses\nthe extra cheese option, the modifier quantity increases to 2. If the buyer does not want\nany cheese, the modifier quantity is set to 0.", + "nullable": true + }, + "base_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The base price for the modifier.\n\n`base_price_money` is required for ad hoc modifiers.\nIf both `catalog_object_id` and `base_price_money` are set, `base_price_money` will\noverride the predefined [CatalogModifier](entity:CatalogModifier) price.", + "nullable": true + }, + "total_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The total price of the item modifier for its line item.\nThis is the modifier's `base_price_money` multiplied by the line item's quantity.", + "readOnly": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this order. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "OrderLineItemPricingBlocklists": { + "type": "object", + "description": "Describes pricing adjustments that are blocked from automatic\napplication to a line item. For more information, see\n[Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts).", + "x-release-status": "BETA", + "properties": { + "blocked_discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemPricingBlocklistsBlockedDiscount" + }, + "description": "A list of discounts blocked from applying to the line item.\nDiscounts can be blocked by the `discount_uid` (for ad hoc discounts) or\nthe `discount_catalog_object_id` (for catalog discounts).", + "nullable": true + }, + "blocked_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemPricingBlocklistsBlockedTax" + }, + "description": "A list of taxes blocked from applying to the line item.\nTaxes can be blocked by the `tax_uid` (for ad hoc taxes) or\nthe `tax_catalog_object_id` (for catalog taxes).", + "nullable": true + } + } + }, + "OrderLineItemPricingBlocklistsBlockedDiscount": { + "type": "object", + "description": "A discount to block from applying to a line item. The discount must be\nidentified by either `discount_uid` or `discount_catalog_object_id`, but not both.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID of the `BlockedDiscount` within the order.", + "maxLength": 60, + "nullable": true + }, + "discount_uid": { + "type": "string", + "description": "The `uid` of the discount that should be blocked. Use this field to block\nad hoc discounts. For catalog discounts, use the `discount_catalog_object_id` field.", + "maxLength": 60, + "nullable": true + }, + "discount_catalog_object_id": { + "type": "string", + "description": "The `catalog_object_id` of the discount that should be blocked.\nUse this field to block catalog discounts. For ad hoc discounts, use the\n`discount_uid` field.", + "maxLength": 192, + "nullable": true + } + } + }, + "OrderLineItemPricingBlocklistsBlockedTax": { + "type": "object", + "description": "A tax to block from applying to a line item. The tax must be\nidentified by either `tax_uid` or `tax_catalog_object_id`, but not both.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID of the `BlockedTax` within the order.", + "maxLength": 60, + "nullable": true + }, + "tax_uid": { + "type": "string", + "description": "The `uid` of the tax that should be blocked. Use this field to block\nad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` field.", + "maxLength": 60, + "nullable": true + }, + "tax_catalog_object_id": { + "type": "string", + "description": "The `catalog_object_id` of the tax that should be blocked.\nUse this field to block catalog taxes. For ad hoc taxes, use the\n`tax_uid` field.", + "maxLength": 192, + "nullable": true + } + } + }, + "OrderLineItemTax": { + "type": "object", + "description": "Represents a tax that applies to one or more line item in the order.\n\nFixed-amount, order-scoped taxes are distributed across all non-zero line item totals.\nThe amount distributed to each line item is relative to the amount the item\ncontributes to the order subtotal.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the tax only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogTax](entity:CatalogTax).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this tax references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The tax's name.", + "maxLength": 255, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/OrderLineItemTaxType", + "description": "Indicates the calculation method used to apply the tax.\nSee [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the tax, as a string representation of a decimal\nnumber. For example, a value of `\"7.25\"` corresponds to a percentage of\n7.25%.", + "maxLength": 10, + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this tax. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied to the order by the tax.\n\n- For percentage-based taxes, `applied_money` is the money\ncalculated using the percentage.", + "nullable": true + }, + "scope": { + "$ref": "#/components/schemas/OrderLineItemTaxScope", + "description": "Indicates the level at which the tax applies. For `ORDER` scoped taxes,\nSquare generates references in `applied_taxes` on all order line items that do\nnot have them. For `LINE_ITEM` scoped taxes, the tax only applies to line items\nwith references in their `applied_taxes` field.\n\nThis field is immutable. To change the scope, you must delete the tax and\nre-add it as a new tax.\nSee [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible values", + "nullable": true + }, + "auto_applied": { + "type": "boolean", + "description": "Determines whether the tax was automatically applied to the order based on\nthe catalog configuration. For an example, see\n[Automatically Apply Taxes to an Order](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-taxes).", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "OrderLineItemTaxScope": { + "type": "string", + "enum": [ + "OTHER_TAX_SCOPE", + "LINE_ITEM", + "ORDER" + ], + "x-enum-elements": [ + { + "name": "OTHER_TAX_SCOPE", + "description": "Used for reporting only.\nThe original transaction tax scope is currently not supported by the API." + }, + { + "name": "LINE_ITEM", + "description": "The tax should be applied only to line items specified by\nthe `OrderLineItemAppliedTax` reference records." + }, + { + "name": "ORDER", + "description": "The tax should be applied to the entire order." + } + ], + "description": "Indicates whether this is a line-item or order-level tax.", + "x-release-status": "PUBLIC" + }, + "OrderLineItemTaxType": { + "type": "string", + "enum": [ + "UNKNOWN_TAX", + "ADDITIVE", + "INCLUSIVE" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_TAX", + "description": "Used for reporting only.\nThe original transaction tax type is currently not supported by the API." + }, + { + "name": "ADDITIVE", + "description": "The tax is an additive tax. The tax amount is added on top of the price.\nFor example, an item with a cost of 1.00 USD and a 10% additive tax has a total\ncost to the buyer of 1.10 USD." + }, + { + "name": "INCLUSIVE", + "description": "The tax is an inclusive tax. Inclusive taxes are already included\nin the line item price or order total. For example, an item with a cost of\n1.00 USD and a 10% inclusive tax has a pretax cost of 0.91 USD\n(91 cents) and a 0.09 (9 cents) tax for a total cost of 1.00 USD to\nthe buyer." + } + ], + "description": "Indicates how the tax is applied to the associated line item or order.", + "x-release-status": "PUBLIC" + }, + "OrderMoneyAmounts": { + "type": "object", + "description": "A collection of various money amounts.", + "x-release-status": "BETA", + "properties": { + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total money.", + "nullable": true + }, + "tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The money associated with taxes.", + "nullable": true + }, + "discount_money": { + "$ref": "#/components/schemas/Money", + "description": "The money associated with discounts.", + "nullable": true + }, + "tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The money associated with tips.", + "nullable": true + }, + "service_charge_money": { + "$ref": "#/components/schemas/Money", + "description": "The money associated with service charges.", + "nullable": true + } + } + }, + "OrderPricingOptions": { + "type": "object", + "description": "Pricing options for an order. The options affect how the order's price is calculated.\nThey can be used, for example, to apply automatic price adjustments that are based on preconfigured\n[pricing rules](entity:CatalogPricingRule).", + "x-release-status": "PUBLIC", + "properties": { + "auto_apply_discounts": { + "type": "boolean", + "description": "The option to determine whether pricing rule-based\ndiscounts are automatically applied to an order.", + "nullable": true + }, + "auto_apply_taxes": { + "type": "boolean", + "description": "The option to determine whether rule-based taxes are automatically\napplied to an order when the criteria of the corresponding rules are met.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "OrderQuantityUnit": { + "type": "object", + "description": "Contains the measurement unit for a quantity and a precision that\nspecifies the number of digits after the decimal point for decimal quantities.", + "x-release-status": "PUBLIC", + "properties": { + "measurement_unit": { + "$ref": "#/components/schemas/MeasurementUnit", + "description": "A [MeasurementUnit](entity:MeasurementUnit) that represents the\nunit of measure for the quantity.", + "nullable": true + }, + "precision": { + "type": "integer", + "description": "For non-integer quantities, represents the number of digits after the decimal point that are\nrecorded for this quantity.\n\nFor example, a precision of 1 allows quantities such as `\"1.0\"` and `\"1.1\"`, but not `\"1.01\"`.\n\nMin: 0. Max: 5.", + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing the\n[CatalogMeasurementUnit](entity:CatalogMeasurementUnit).\n\nThis field is set when this is a catalog-backed measurement unit.", + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this measurement unit references.\n\nThis field is set when this is a catalog-backed measurement unit.", + "format": "int64", + "nullable": true + } + } + }, + "OrderReturn": { + "type": "object", + "description": "The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the return only within this order.", + "maxLength": 60, + "nullable": true + }, + "source_order_id": { + "type": "string", + "description": "An order that contains the original sale of these return line items. This is unset\nfor unlinked returns.", + "nullable": true + }, + "return_line_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnLineItem" + }, + "description": "A collection of line items that are being returned.", + "nullable": true + }, + "return_service_charges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnServiceCharge" + }, + "description": "A collection of service charges that are being returned.", + "nullable": true + }, + "return_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnTax" + }, + "description": "A collection of references to taxes being returned for an order, including the total\napplied tax amount to be returned. The taxes must reference a top-level tax ID from the source\norder.", + "readOnly": true + }, + "return_discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnDiscount" + }, + "description": "A collection of references to discounts being returned for an order, including the total\napplied discount amount to be returned. The discounts must reference a top-level discount ID\nfrom the source order.", + "readOnly": true + }, + "return_tips": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnTip" + }, + "description": "A collection of references to tips being returned for an order.", + "nullable": true + }, + "rounding_adjustment": { + "$ref": "#/components/schemas/OrderRoundingAdjustment", + "description": "A positive or negative rounding adjustment to the total value being returned. Adjustments are commonly\nused to apply cash rounding when the minimum unit of the account is smaller than the lowest\nphysical denomination of the currency.", + "nullable": true + }, + "return_amounts": { + "$ref": "#/components/schemas/OrderMoneyAmounts", + "description": "An aggregate monetary value being returned by this return entry.", + "nullable": true + } + } + }, + "OrderReturnDiscount": { + "type": "object", + "description": "Represents a discount being returned that applies to one or more return line items in an\norder.\n\nFixed-amount, order-scoped discounts are distributed across all non-zero return line item totals.\nThe amount distributed to each return line item is relative to that item’s contribution to the\norder subtotal.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the returned discount only within this order.", + "maxLength": 60, + "nullable": true + }, + "source_discount_uid": { + "type": "string", + "description": "The discount `uid` from the order that contains the original application of this discount.", + "maxLength": 60, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this discount references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The discount's name.", + "maxLength": 255, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/OrderLineItemDiscountType", + "description": "The type of the discount. If it is created by the API, it is `FIXED_PERCENTAGE` or `FIXED_AMOUNT`.\n\nDiscounts that do not reference a catalog object ID must have a type of\n`FIXED_PERCENTAGE` or `FIXED_AMOUNT`.\nSee [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the tax, as a string representation of a decimal number.\nA value of `\"7.25\"` corresponds to a percentage of 7.25%.\n\n`percentage` is not set for amount-based discounts.", + "maxLength": 10, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total declared monetary amount of the discount.\n\n`amount_money` is not set for percentage-based discounts.", + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of discount actually applied to this line item. When an amount-based\ndiscount is at the order level, this value is different from `amount_money` because the discount\nis distributed across the line items.", + "readOnly": true + }, + "scope": { + "$ref": "#/components/schemas/OrderLineItemDiscountScope", + "description": "Indicates the level at which the `OrderReturnDiscount` applies. For `ORDER` scoped\ndiscounts, the server generates references in `applied_discounts` on all\n`OrderReturnLineItem`s. For `LINE_ITEM` scoped discounts, the discount is only applied to\n`OrderReturnLineItem`s with references in their `applied_discounts` field.\nSee [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values", + "nullable": true + } + } + }, + "OrderReturnLineItem": { + "type": "object", + "description": "The line item being returned in an order.", + "x-release-status": "BETA", + "required": [ + "quantity" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID for this return line-item entry.", + "maxLength": 60, + "nullable": true + }, + "source_line_item_uid": { + "type": "string", + "description": "The `uid` of the line item in the original sale order.", + "maxLength": 60, + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the line item.", + "maxLength": 512, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The quantity returned, formatted as a decimal number.\nFor example, `\"3\"`.\n\nLine items with a `quantity_unit` can have non-integer quantities.\nFor example, `\"1.70000\"`.", + "minLength": 1, + "maxLength": 12 + }, + "quantity_unit": { + "$ref": "#/components/schemas/OrderQuantityUnit", + "description": "The unit and precision that this return line item's quantity is measured in.", + "nullable": true + }, + "note": { + "type": "string", + "description": "The note of the return line item.", + "maxLength": 2000, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this return line item.", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this line item references.", + "format": "int64", + "nullable": true + }, + "variation_name": { + "type": "string", + "description": "The name of the variation applied to this return line item.", + "maxLength": 400, + "nullable": true + }, + "item_type": { + "$ref": "#/components/schemas/OrderLineItemItemType", + "description": "The type of line item: an itemized return, a non-itemized return (custom amount),\nor the return of an unactivated gift card sale.\nSee [OrderLineItemItemType](#type-orderlineitemitemtype) for possible values", + "nullable": true + }, + "return_modifiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnLineItemModifier" + }, + "description": "The [CatalogModifier](entity:CatalogModifier)s applied to this line item.", + "nullable": true + }, + "applied_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedTax" + }, + "description": "The list of references to `OrderReturnTax` entities applied to the return line item. Each\n`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level\n`OrderReturnTax` applied to the return line item. On reads, the applied amount\nis populated.", + "nullable": true + }, + "applied_discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedDiscount" + }, + "description": "The list of references to `OrderReturnDiscount` entities applied to the return line item. Each\n`OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level\n`OrderReturnDiscount` applied to the return line item. On reads, the applied amount\nis populated.", + "nullable": true + }, + "base_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The base price for a single unit of the line item.", + "nullable": true + }, + "variation_total_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The total price of all item variations returned in this line item.\nThe price is calculated as `base_price_money` multiplied by `quantity` and\ndoes not include modifiers.", + "readOnly": true + }, + "gross_return_money": { + "$ref": "#/components/schemas/Money", + "description": "The gross return amount of money calculated as (item base price + modifiers price) * quantity.", + "readOnly": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tax money to return for the line item.", + "readOnly": true + }, + "total_discount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of discount money to return for the line item.", + "readOnly": true + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money to return for this line item.", + "readOnly": true + }, + "applied_service_charges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedServiceCharge" + }, + "description": "The list of references to `OrderReturnServiceCharge` entities applied to the return\nline item. Each `OrderLineItemAppliedServiceCharge` has a `service_charge_uid` that\nreferences the `uid` of a top-level `OrderReturnServiceCharge` applied to the return line\nitem. On reads, the applied amount is populated.", + "nullable": true + }, + "total_service_charge_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of apportioned service charge money to return for the line item.", + "readOnly": true + } + } + }, + "OrderReturnLineItemModifier": { + "type": "object", + "description": "A line item modifier being returned.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the return modifier only within this order.", + "maxLength": 60, + "nullable": true + }, + "source_modifier_uid": { + "type": "string", + "description": "The modifier `uid` from the order's line item that contains the\noriginal sale of this line item modifier.", + "maxLength": 60, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogModifier](entity:CatalogModifier).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this line item modifier references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the item modifier.", + "maxLength": 255, + "nullable": true + }, + "base_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The base price for the modifier.\n\n`base_price_money` is required for ad hoc modifiers.\nIf both `catalog_object_id` and `base_price_money` are set, `base_price_money` overrides the predefined [CatalogModifier](entity:CatalogModifier) price.", + "nullable": true + }, + "total_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The total price of the item modifier for its line item.\nThis is the modifier's `base_price_money` multiplied by the line item's quantity.", + "readOnly": true + }, + "quantity": { + "type": "string", + "description": "The quantity of the line item modifier. The modifier quantity can be 0 or more.\nFor example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders\nthis item, the restaurant records the purchase by creating an `Order` object with a line item\nfor a burger. The line item includes a line item modifier: the name is cheese and the quantity\nis 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses\nthe extra cheese option, the modifier quantity increases to 2. If the buyer does not want\nany cheese, the modifier quantity is set to 0.", + "nullable": true + } + } + }, + "OrderReturnServiceCharge": { + "type": "object", + "description": "Represents the service charge applied to the original order.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the return service charge only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "source_service_charge_uid": { + "type": "string", + "description": "The service charge `uid` from the order containing the original\nservice charge. `source_service_charge_uid` is `null` for\nunlinked returns.", + "maxLength": 60, + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the service charge.", + "maxLength": 255, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID of the associated [OrderServiceCharge](entity:OrderServiceCharge).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this service charge references.", + "format": "int64", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the service charge, as a string representation of\na decimal number. For example, a value of `\"7.25\"` corresponds to a\npercentage of 7.25%.\n\nEither `percentage` or `amount_money` should be set, but not both.", + "maxLength": 10, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of a non-percentage-based service charge.\n\nEither `percentage` or `amount_money` should be set, but not both.", + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied to the order by the service charge, including\nany inclusive tax amounts, as calculated by Square.\n\n- For fixed-amount service charges, `applied_money` is equal to `amount_money`.\n- For percentage-based service charges, `applied_money` is the money calculated using the percentage.", + "readOnly": true + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money to collect for the service charge.\n\n__NOTE__: If an inclusive tax is applied to the service charge, `total_money`\ndoes not equal `applied_money` plus `total_tax_money` because the inclusive\ntax amount is already included in both `applied_money` and `total_tax_money`.", + "readOnly": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tax money to collect for the service charge.", + "readOnly": true + }, + "calculation_phase": { + "$ref": "#/components/schemas/OrderServiceChargeCalculationPhase", + "description": "The calculation phase after which to apply the service charge.\nSee [OrderServiceChargeCalculationPhase](#type-orderservicechargecalculationphase) for possible values", + "readOnly": true + }, + "taxable": { + "type": "boolean", + "description": "Indicates whether the surcharge can be taxed. Service charges\ncalculated in the `TOTAL_PHASE` cannot be marked as taxable.", + "nullable": true + }, + "applied_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedTax" + }, + "description": "The list of references to `OrderReturnTax` entities applied to the\n`OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid`\nthat references the `uid` of a top-level `OrderReturnTax` that is being\napplied to the `OrderReturnServiceCharge`. On reads, the applied amount is\npopulated.", + "x-release-status": "BETA", + "nullable": true + }, + "treatment_type": { + "$ref": "#/components/schemas/OrderServiceChargeTreatmentType", + "description": "The treatment type of the service charge.\nSee [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "scope": { + "$ref": "#/components/schemas/OrderServiceChargeScope", + "description": "Indicates the level at which the apportioned service charge applies. For `ORDER`\nscoped service charges, Square generates references in `applied_service_charges` on\nall order line items that do not have them. For `LINE_ITEM` scoped service charges,\nthe service charge only applies to line items with a service charge reference in their\n`applied_service_charges` field.\n\nThis field is immutable. To change the scope of an apportioned service charge, you must delete\nthe apportioned service charge and re-add it as a new apportioned service charge.\nSee [OrderServiceChargeScope](#type-orderservicechargescope) for possible values", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "OrderReturnTax": { + "type": "object", + "description": "Represents a tax being returned that applies to one or more return line items in an order.\n\nFixed-amount, order-scoped taxes are distributed across all non-zero return line item totals.\nThe amount distributed to each return line item is relative to that item’s contribution to the\norder subtotal.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the returned tax only within this order.", + "maxLength": 60, + "nullable": true + }, + "source_tax_uid": { + "type": "string", + "description": "The tax `uid` from the order that contains the original tax charge.", + "maxLength": 60, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogTax](entity:CatalogTax).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this tax references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The tax's name.", + "maxLength": 255, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/OrderLineItemTaxType", + "description": "Indicates the calculation method used to apply the tax.\nSee [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the tax, as a string representation of a decimal number.\nFor example, a value of `\"7.25\"` corresponds to a percentage of 7.25%.", + "maxLength": 10, + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied by the tax in an order.", + "readOnly": true + }, + "scope": { + "$ref": "#/components/schemas/OrderLineItemTaxScope", + "description": "Indicates the level at which the `OrderReturnTax` applies. For `ORDER` scoped\ntaxes, Square generates references in `applied_taxes` on all\n`OrderReturnLineItem`s. For `LINE_ITEM` scoped taxes, the tax is only applied to\n`OrderReturnLineItem`s with references in their `applied_discounts` field.\nSee [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible values", + "nullable": true + } + } + }, + "OrderReturnTip": { + "type": "object", + "description": "A tip being returned.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the tip only within this order.", + "maxLength": 60, + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of tip being returned\n--", + "readOnly": true + }, + "source_tender_uid": { + "type": "string", + "description": "The tender `uid` from the order that contains the original application of this tip.", + "maxLength": 192, + "nullable": true + }, + "source_tender_id": { + "type": "string", + "description": "The tender `id` from the order that contains the original application of this tip.", + "maxLength": 192, + "nullable": true + } + } + }, + "OrderReward": { + "type": "object", + "description": "Represents a reward that can be applied to an order if the necessary\nreward tier criteria are met. Rewards are created through the Loyalty API.", + "x-release-status": "BETA", + "required": [ + "id", + "reward_tier_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The identifier of the reward.", + "minLength": 1 + }, + "reward_tier_id": { + "type": "string", + "description": "The identifier of the reward tier corresponding to this reward.", + "minLength": 1 + } + } + }, + "OrderRoundingAdjustment": { + "type": "object", + "description": "A rounding adjustment of the money being returned. Commonly used to apply cash rounding\nwhen the minimum unit of the account is smaller than the lowest physical denomination of the currency.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the rounding adjustment only within this order.", + "maxLength": 60, + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the rounding adjustment from the original sale order.", + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The actual rounding adjustment amount.", + "nullable": true + } + } + }, + "OrderServiceCharge": { + "type": "object", + "description": "Represents a service charge applied to an order.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the service charge only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the service charge.", + "maxLength": 512, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing the service charge [CatalogObject](entity:CatalogObject).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this service charge references.", + "format": "int64", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The service charge percentage as a string representation of a\ndecimal number. For example, `\"7.25\"` indicates a service charge of 7.25%.\n\nExactly 1 of `percentage` or `amount_money` should be set.", + "maxLength": 10, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of a non-percentage-based service charge.\n\nExactly one of `percentage` or `amount_money` should be set.", + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied to the order by the service charge,\nincluding any inclusive tax amounts, as calculated by Square.\n\n- For fixed-amount service charges, `applied_money` is equal to `amount_money`.\n- For percentage-based service charges, `applied_money` is the money\ncalculated using the percentage.", + "readOnly": true + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money to collect for the service charge.\n\n__Note__: If an inclusive tax is applied to the service charge,\n`total_money` does not equal `applied_money` plus `total_tax_money`\nbecause the inclusive tax amount is already included in both\n`applied_money` and `total_tax_money`.", + "readOnly": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tax money to collect for the service charge.", + "readOnly": true + }, + "calculation_phase": { + "$ref": "#/components/schemas/OrderServiceChargeCalculationPhase", + "description": "The calculation phase at which to apply the service charge.\nSee [OrderServiceChargeCalculationPhase](#type-orderservicechargecalculationphase) for possible values", + "nullable": true + }, + "taxable": { + "type": "boolean", + "description": "Indicates whether the service charge can be taxed. If set to `true`,\norder-level taxes automatically apply to the service charge. Note that\nservice charges calculated in the `TOTAL_PHASE` cannot be marked as taxable.", + "nullable": true + }, + "applied_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedTax" + }, + "description": "The list of references to the taxes applied to this service charge. Each\n`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level\n`OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied\nis populated.\n\nAn `OrderLineItemAppliedTax` is automatically created on every taxable service charge\nfor all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records\nfor `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable\nservice charge. Taxable service charges have the `taxable` field set to `true` and calculated\nin the `SUBTOTAL_PHASE`.\n\nTo change the amount of a tax, modify the referenced top-level tax.", + "x-release-status": "BETA", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this service charge. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/OrderServiceChargeType", + "description": "The type of the service charge.\nSee [OrderServiceChargeType](#type-orderservicechargetype) for possible values", + "readOnly": true + }, + "treatment_type": { + "$ref": "#/components/schemas/OrderServiceChargeTreatmentType", + "description": "The treatment type of the service charge.\nSee [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "scope": { + "$ref": "#/components/schemas/OrderServiceChargeScope", + "description": "Indicates the level at which the apportioned service charge applies. For `ORDER`\nscoped service charges, Square generates references in `applied_service_charges` on\nall order line items that do not have them. For `LINE_ITEM` scoped service charges,\nthe service charge only applies to line items with a service charge reference in their\n`applied_service_charges` field.\n\nThis field is immutable. To change the scope of an apportioned service charge, you must delete\nthe apportioned service charge and re-add it as a new apportioned service charge.\nSee [OrderServiceChargeScope](#type-orderservicechargescope) for possible values", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "OrderServiceChargeCalculationPhase": { + "type": "string", + "enum": [ + "SUBTOTAL_PHASE", + "TOTAL_PHASE", + "APPORTIONED_PERCENTAGE_PHASE", + "APPORTIONED_AMOUNT_PHASE" + ], + "x-enum-elements": [ + { + "name": "SUBTOTAL_PHASE", + "description": "The service charge is applied after discounts, but before\ntaxes." + }, + { + "name": "TOTAL_PHASE", + "description": "The service charge is applied after all discounts and taxes\nare applied." + }, + { + "name": "APPORTIONED_PERCENTAGE_PHASE", + "description": "The service charge is calculated as a compounding adjustment\nafter any discounts, but before amount based apportioned service charges\nand any tax considerations." + }, + { + "name": "APPORTIONED_AMOUNT_PHASE", + "description": "The service charge is calculated as a compounding adjustment\nafter any discounts and percentage based apportioned service charges,\nbut before any tax considerations." + } + ], + "description": "Represents a phase in the process of calculating order totals.\nService charges are applied after the indicated phase.\n\n[Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated)", + "x-release-status": "PUBLIC" + }, + "OrderServiceChargeScope": { + "type": "string", + "enum": [ + "OTHER_SERVICE_CHARGE_SCOPE", + "LINE_ITEM", + "ORDER" + ], + "x-enum-elements": [ + { + "name": "OTHER_SERVICE_CHARGE_SCOPE", + "description": "Used for reporting only.\nThe original transaction service charge scope is currently not supported by the API." + }, + { + "name": "LINE_ITEM", + "description": "The service charge should be applied to only line items specified by\n`OrderLineItemAppliedServiceCharge` reference records." + }, + { + "name": "ORDER", + "description": "The service charge should be applied to the entire order." + } + ], + "description": "Indicates whether this is a line-item or order-level apportioned\nservice charge.", + "x-release-status": "BETA" + }, + "OrderServiceChargeTreatmentType": { + "type": "string", + "enum": [ + "LINE_ITEM_TREATMENT", + "APPORTIONED_TREATMENT" + ], + "x-enum-elements": [ + { + "name": "LINE_ITEM_TREATMENT", + "description": "" + }, + { + "name": "APPORTIONED_TREATMENT", + "description": "" + } + ], + "description": "Indicates whether the service charge will be treated as a value-holding line item or\napportioned toward a line item.", + "x-release-status": "BETA" + }, + "OrderServiceChargeType": { + "type": "string", + "enum": [ + "AUTO_GRATUITY", + "CUSTOM" + ], + "x-enum-elements": [ + { + "name": "AUTO_GRATUITY", + "description": "" + }, + { + "name": "CUSTOM", + "description": "" + } + ], + "x-release-status": "PUBLIC" + }, + "OrderSource": { + "type": "object", + "description": "Represents the origination details of an order.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The name used to identify the place (physical or digital) that an order originates.\nIf unset, the name defaults to the name of the application that created the order.", + "nullable": true + } + } + }, + "OrderState": { + "type": "string", + "enum": [ + "OPEN", + "COMPLETED", + "CANCELED", + "DRAFT" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "Indicates that the order is open. Open orders can be updated." + }, + { + "name": "COMPLETED", + "description": "Indicates that the order is completed. Completed orders are fully paid. This is a terminal state." + }, + { + "name": "CANCELED", + "description": "Indicates that the order is canceled. Canceled orders are not paid. This is a terminal state." + }, + { + "name": "DRAFT", + "description": "Indicates that the order is in a draft state. Draft orders can be updated,\nbut cannot be paid or fulfilled.\nFor more information, see [Create Orders](https://developer.squareup.com/docs/orders-api/create-orders)." + } + ], + "description": "The state of the order.", + "x-release-status": "PUBLIC" + }, + "OrderUpdated": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_id": { + "type": "string", + "description": "The order's unique ID.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is committed to the order.\nOrders that were not created through the API do not include a version number and\ntherefore cannot be updated.\n\n[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)" + }, + "location_id": { + "type": "string", + "description": "The ID of the seller location that this order is associated with.", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/OrderState", + "description": "The state of the order.\nSee [OrderState](#type-orderstate) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the order was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp for when the order was last updated, in RFC 3339 format.", + "readOnly": true + } + } + }, + "OrderUpdatedEvent": { + "type": "object", + "description": "Published when an [Order](entity:Order) is updated. This\nevent is triggered by the [UpdateOrder](api-endpoint:Orders-UpdateOrder)\nendpoint call, Order Manager, or the Square Dashboard.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"order.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/OrderUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-16T23:14:26.359Z", + "data": { + "id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "object": { + "order_updated": { + "created_at": "2020-04-16T23:14:26.129Z", + "location_id": "FPYCBCHYMXFK1", + "order_id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "state": "OPEN", + "updated_at": "2020-04-16T23:14:26.359Z", + "version": 2 + } + }, + "type": "order_updated" + }, + "event_id": "4b8e5c91-9f17-4cf1-900a-4a0629f81add", + "merchant_id": "5S9MXCS9Y99KK", + "type": "order.updated" + }, + "x-webhook": { + "event": "order.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/Orders", + "x-since": "2020-04-22" + }, + "OrderUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"order_updated\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected order." + }, + "object": { + "$ref": "#/components/schemas/OrderUpdatedObject", + "description": "An object containing information about the updated Order.", + "nullable": true + } + } + }, + "OrderUpdatedObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_updated": { + "$ref": "#/components/schemas/OrderUpdated", + "description": "Information about the updated order.", + "nullable": true + } + } + }, + "PauseSubscriptionRequest": { + "type": "object", + "description": "Defines input parameters in a request to the\n[PauseSubscription](api-endpoint:Subscriptions-PauseSubscription) endpoint.", + "x-release-status": "BETA", + "properties": { + "pause_effective_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the scheduled `PAUSE` action takes place on the subscription.\n\nWhen this date is unspecified or falls within the current billing cycle, the subscription is paused\non the starting date of the next billing cycle.", + "nullable": true + }, + "pause_cycle_duration": { + "type": "integer", + "description": "The number of billing cycles the subscription will be paused before it is reactivated. \n\nWhen this is set, a `RESUME` action is also scheduled to take place on the subscription at \nthe end of the specified pause cycle duration. In this case, neither `resume_effective_date` \nnor `resume_change_timing` may be specified.", + "format": "int64", + "nullable": true + }, + "resume_effective_date": { + "type": "string", + "description": "The date when the subscription is reactivated by a scheduled `RESUME` action. \nThis date must be at least one billing cycle ahead of `pause_effective_date`.", + "nullable": true + }, + "resume_change_timing": { + "$ref": "#/components/schemas/ChangeTiming", + "description": "The timing whether the subscription is reactivated immediately or at the end of the billing cycle, relative to \n`resume_effective_date`.\nSee [ChangeTiming](#type-changetiming) for possible values", + "nullable": true + }, + "pause_reason": { + "type": "string", + "description": "The user-provided reason to pause the subscription.", + "maxLength": 255, + "nullable": true + } + } + }, + "PauseSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[PauseSubscription](api-endpoint:Subscriptions-PauseSubscription) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The subscription to be paused by the scheduled `PAUSE` action." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "The list of a `PAUSE` action and a possible `RESUME` action created by the request." + } + }, + "example": { + "actions": [ + { + "effective_date": "2023-11-17", + "id": "99b2439e-63f7-3ad5-95f7-ab2447a80673", + "type": "PAUSE" + } + ], + "subscription": { + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + "ordinal": 0, + "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", + "uid": "873451e0-745b-4e87-ab0b-c574933fe616" + } + ], + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2023-06-20", + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 1 + } + } + }, + "PayOrderRequest": { + "type": "object", + "description": "Defines the fields that are included in requests to the\n[PayOrder](api-endpoint:Orders-PayOrder) endpoint.", + "x-release-status": "BETA", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this request among requests you have sent. If\nyou are unsure whether a particular payment request was completed successfully, you can reattempt\nit with the same idempotency key without worrying about duplicate payments.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1, + "maxLength": 192 + }, + "order_version": { + "type": "integer", + "description": "The version of the order being paid. If not supplied, the latest version will be paid.", + "nullable": true + }, + "payment_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the [payments](entity:Payment) to collect.\nThe payment total must match the order total.", + "nullable": true + } + }, + "example": { + "idempotency_key": "c043a359-7ad9-4136-82a9-c3f1d66dcbff", + "payment_ids": [ + "EnZdNAlWCmfh6Mt5FMNST1o7taB", + "0LRiVlbXVwe8ozu4KbZxd12mvaB" + ] + } + }, + "PayOrderResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of a request to the\n[PayOrder](api-endpoint:Orders-PayOrder) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "order": { + "$ref": "#/components/schemas/Order", + "description": "The paid, updated [order](entity:Order)." + } + }, + "example": { + "order": { + "closed_at": "2019-08-06T02:47:37.140Z", + "created_at": "2019-08-06T02:47:35.693Z", + "id": "lgwOlEityYPJtcuvKTVKT1pA986YY", + "line_items": [ + { + "base_price_money": { + "amount": 500, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 500, + "currency": "USD" + }, + "name": "Item 1", + "quantity": "1", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 500, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "QW6kofLHJK7JEKMjlSVP5C" + }, + { + "base_price_money": { + "amount": 750, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 1500, + "currency": "USD" + }, + "name": "Item 2", + "quantity": "2", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 1500, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "zhw8MNfRGdFQMI2WE1UBJD" + } + ], + "location_id": "P3CCK6HSNDAS7", + "net_amounts": { + "discount_money": { + "amount": 0, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 0, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 2000, + "currency": "USD" + } + }, + "source": { + "name": "Source Name" + }, + "state": "COMPLETED", + "tenders": [ + { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "card_details": { + "card": { + "card_brand": "VISA", + "exp_month": 2, + "exp_year": 2022, + "fingerprint": "sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ", + "last_4": "1111" + }, + "entry_method": "KEYED", + "status": "CAPTURED" + }, + "created_at": "2019-08-06T02:47:36.293Z", + "id": "EnZdNAlWCmfh6Mt5FMNST1o7taB", + "location_id": "P3CCK6HSNDAS7", + "payment_id": "EnZdNAlWCmfh6Mt5FMNST1o7taB", + "transaction_id": "lgwOlEityYPJtcuvKTVKT1pA986YY", + "type": "CARD" + }, + { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "card_details": { + "card": { + "card_brand": "VISA", + "exp_month": 2, + "exp_year": 2022, + "fingerprint": "sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ", + "last_4": "1111" + }, + "entry_method": "KEYED", + "status": "CAPTURED" + }, + "created_at": "2019-08-06T02:47:36.809Z", + "id": "0LRiVlbXVwe8ozu4KbZxd12mvaB", + "location_id": "P3CCK6HSNDAS7", + "payment_id": "0LRiVlbXVwe8ozu4KbZxd12mvaB", + "transaction_id": "lgwOlEityYPJtcuvKTVKT1pA986YY", + "type": "CARD" + } + ], + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 2000, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2019-08-06T02:47:37.140Z", + "version": 4 + } + } + }, + "Payment": { + "type": "object", + "description": "Represents a payment processed by the Square API.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique ID for the payment.", + "maxLength": 192, + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the payment was created, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the payment was last updated, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount processed for this payment, not including `tip_money`.\n\nThe amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).", + "nullable": true + }, + "tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount designated as a tip. \n\nThis amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).", + "nullable": true + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount for the payment, including `amount_money` and `tip_money`.\nThis amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).", + "readOnly": true + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount the developer is taking as a fee for facilitating the payment on behalf\nof the seller. This amount is specified in the smallest denomination of the applicable currency\n(for example, US dollar amounts are specified in cents). For more information,\nsee [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).\n\nThe amount cannot be more than 90% of the `total_money` value.\n\nTo set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.\nFor more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).", + "nullable": true + }, + "approved_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money approved for this payment. This value may change if Square chooses to\nobtain reauthorization as part of a call to [UpdatePayment](api-endpoint:Payments-UpdatePayment).", + "nullable": true + }, + "processing_fee": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessingFee" + }, + "description": "The processing fees and fee adjustments assessed by Square for this payment.", + "readOnly": true + }, + "refunded_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of the payment refunded to date. \n\nThis amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents).", + "readOnly": true + }, + "status": { + "type": "string", + "description": "Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED.", + "maxLength": 50, + "readOnly": true + }, + "delay_duration": { + "type": "string", + "description": "The duration of time after the payment's creation when Square automatically applies the\n`delay_action` to the payment. This automatic `delay_action` applies only to payments that\ndo not reach a terminal state (COMPLETED, CANCELED, or FAILED) before the `delay_duration`\ntime period.\n\nThis field is specified as a time duration, in RFC 3339 format.\n\nNotes:\nThis feature is only supported for card payments.\n\nDefault:\n\n- Card-present payments: \"PT36H\" (36 hours) from the creation time.\n- Card-not-present payments: \"P7D\" (7 days) from the creation time.", + "readOnly": true + }, + "delay_action": { + "type": "string", + "description": "The action to be applied to the payment when the `delay_duration` has elapsed.\n\nCurrent values include `CANCEL` and `COMPLETE`.", + "nullable": true + }, + "delayed_until": { + "type": "string", + "description": "The read-only timestamp of when the `delay_action` is automatically applied,\nin RFC 3339 format.\n\nNote that this field is calculated by summing the payment's `delay_duration` and `created_at`\nfields. The `created_at` field is generated by Square and might not exactly match the\ntime on your local machine.", + "readOnly": true + }, + "source_type": { + "type": "string", + "description": "The source type for this payment.\n\nCurrent values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `SQUARE_ACCOUNT`,\n`CASH` and `EXTERNAL`. For information about these payment source types,\nsee [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).", + "maxLength": 50, + "readOnly": true + }, + "card_details": { + "$ref": "#/components/schemas/CardPaymentDetails", + "description": "Details about a card payment. These details are only populated if the source_type is `CARD`.", + "readOnly": true + }, + "cash_details": { + "$ref": "#/components/schemas/CashPaymentDetails", + "description": "Details about a cash payment. These details are only populated if the source_type is `CASH`.", + "nullable": true + }, + "bank_account_details": { + "$ref": "#/components/schemas/BankAccountPaymentDetails", + "description": "Details about a bank account payment. These details are only populated if the source_type is `BANK_ACCOUNT`.", + "readOnly": true + }, + "external_details": { + "$ref": "#/components/schemas/ExternalPaymentDetails", + "description": "Details about an external payment. The details are only populated \nif the `source_type` is `EXTERNAL`.", + "readOnly": true + }, + "wallet_details": { + "$ref": "#/components/schemas/DigitalWalletDetails", + "description": "Details about an wallet payment. The details are only populated \nif the `source_type` is `WALLET`.", + "readOnly": true + }, + "buy_now_pay_later_details": { + "$ref": "#/components/schemas/BuyNowPayLaterDetails", + "description": "Details about a Buy Now Pay Later payment. The details are only populated\nif the `source_type` is `BUY_NOW_PAY_LATER`. For more information, see \n[Afterpay Payments](https://developer.squareup.com/docs/payments-api/take-payments/afterpay-payments).", + "readOnly": true + }, + "square_account_details": { + "$ref": "#/components/schemas/SquareAccountDetails", + "description": "Details about a Square Account payment. The details are only populated\nif the `source_type` is `SQUARE_ACCOUNT`.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the payment.", + "maxLength": 50, + "readOnly": true + }, + "order_id": { + "type": "string", + "description": "The ID of the order associated with the payment.", + "maxLength": 192, + "readOnly": true + }, + "reference_id": { + "type": "string", + "description": "An optional ID that associates the payment with an entity in\nanother system.", + "maxLength": 40, + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "The ID of the customer associated with the payment. If the ID is \nnot provided in the `CreatePayment` request that was used to create the `Payment`, \nSquare may use information in the request \n(such as the billing and shipping address, email address, and payment source) \nto identify a matching customer profile in the Customer Directory. \nIf found, the profile ID is used. If a profile is not found, the \nAPI attempts to create an \n[instant profile](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). \nIf the API cannot create an \ninstant profile (either because the seller has disabled it or the \nseller's region prevents creating it), this field remains unset. Note that \nthis process is asynchronous and it may take some time before a \ncustomer ID is added to the payment.", + "maxLength": 191, + "readOnly": true + }, + "employee_id": { + "type": "string", + "description": "__Deprecated__: Use `Payment.team_member_id` instead.\n\nAn optional ID of the employee associated with taking the payment.", + "maxLength": 192, + "readOnly": true, + "x-release-status": "DEPRECATED" + }, + "team_member_id": { + "type": "string", + "description": "An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment.", + "maxLength": 192, + "nullable": true + }, + "refund_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of `refund_id`s identifying refunds for the payment.", + "readOnly": true + }, + "risk_evaluation": { + "$ref": "#/components/schemas/RiskEvaluation", + "description": "Provides information about the risk associated with the payment, as determined by Square.\nThis field is present for payments to sellers that have opted in to receive risk\nevaluations.", + "readOnly": true, + "x-release-status": "BETA" + }, + "terminal_checkout_id": { + "type": "string", + "description": "An optional ID for a Terminal checkout that is associated with the payment.", + "readOnly": true, + "x-release-status": "BETA" + }, + "buyer_email_address": { + "type": "string", + "description": "The buyer's email address.", + "maxLength": 255, + "readOnly": true + }, + "billing_address": { + "$ref": "#/components/schemas/Address", + "description": "The buyer's billing address.", + "readOnly": true + }, + "shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "The buyer's shipping address.", + "readOnly": true + }, + "note": { + "type": "string", + "description": "An optional note to include when creating a payment.", + "maxLength": 500, + "readOnly": true + }, + "statement_description_identifier": { + "type": "string", + "description": "Additional payment information that gets added to the customer's card statement\nas part of the statement description.\n\nNote that the `statement_description_identifier` might get truncated on the statement description\nto fit the required information including the Square identifier (SQ *) and the name of the\nseller taking the payment.", + "readOnly": true + }, + "capabilities": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Actions that can be performed on this payment:\n- `EDIT_AMOUNT_UP` - The payment amount can be edited up.\n- `EDIT_AMOUNT_DOWN` - The payment amount can be edited down.\n- `EDIT_TIP_AMOUNT_UP` - The tip amount can be edited up.\n- `EDIT_TIP_AMOUNT_DOWN` - The tip amount can be edited down.\n- `EDIT_DELAY_ACTION` - The delay_action can be edited.", + "readOnly": true + }, + "receipt_number": { + "type": "string", + "description": "The payment's receipt number.\nThe field is missing if a payment is canceled.", + "maxLength": 4, + "readOnly": true + }, + "receipt_url": { + "type": "string", + "description": "The URL for the payment's receipt.\nThe field is only populated for COMPLETED payments.", + "maxLength": 255, + "readOnly": true + }, + "device_details": { + "$ref": "#/components/schemas/DeviceDetails", + "description": "Details about the device that took the payment.", + "readOnly": true + }, + "application_details": { + "$ref": "#/components/schemas/ApplicationDetails", + "description": "Details about the application that took the payment.", + "readOnly": true + }, + "is_offline_payment": { + "type": "boolean", + "description": "Whether or not this payment was taken offline.", + "readOnly": true + }, + "offline_payment_details": { + "$ref": "#/components/schemas/OfflinePaymentDetails", + "description": "Additional information about the payment if it was taken offline.", + "readOnly": true + }, + "version_token": { + "type": "string", + "description": "Used for optimistic concurrency. This opaque token identifies a specific version of the\n`Payment` object.", + "nullable": true + } + } + }, + "PaymentBalanceActivityAppFeeRefundDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "refund_id": { + "type": "string", + "description": "The ID of the refund associated with this activity.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location of the merchant associated with the payment refund activity", + "nullable": true + } + } + }, + "PaymentBalanceActivityAppFeeRevenueDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location of the merchant associated with the payment activity", + "nullable": true + } + } + }, + "PaymentBalanceActivityAutomaticSavingsDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "payout_id": { + "type": "string", + "description": "The ID of the payout associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityAutomaticSavingsReversedDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "payout_id": { + "type": "string", + "description": "The ID of the payout associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityChargeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityDepositFeeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout_id": { + "type": "string", + "description": "The ID of the payout that triggered this deposit fee activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityDepositFeeReversedDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout_id": { + "type": "string", + "description": "The ID of the payout that triggered this deposit fee activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityDisputeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "dispute_id": { + "type": "string", + "description": "The ID of the dispute associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityFeeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity\nThis will only be populated when a principal LedgerEntryToken is also populated.\nIf the fee is independent (there is no principal LedgerEntryToken) then this will likely not\nbe populated.", + "nullable": true + } + } + }, + "PaymentBalanceActivityFreeProcessingDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityHoldAdjustmentDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityOpenDisputeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "dispute_id": { + "type": "string", + "description": "The ID of the dispute associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityOtherAdjustmentDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityOtherDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityRefundDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "refund_id": { + "type": "string", + "description": "The ID of the refund associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityReleaseAdjustmentDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityReserveHoldDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityReserveReleaseDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivitySquareCapitalPaymentDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivitySquareCapitalReversedPaymentDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivitySquarePayrollTransferDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivitySquarePayrollTransferReversedDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityTaxOnFeeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "tax_rate_description": { + "type": "string", + "description": "The description of the tax rate being applied. For example: \"GST\", \"HST\".", + "nullable": true + } + } + }, + "PaymentBalanceActivityThirdPartyFeeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityThirdPartyFeeRefundDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "refund_id": { + "type": "string", + "description": "The public refund id associated with this activity.", + "nullable": true + } + } + }, + "PaymentCreatedEvent": { + "type": "object", + "description": "Published when a [Payment](entity:Payment) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"payment.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/PaymentCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T21:27:30.792Z", + "data": { + "id": "KkAkhdMsgzn59SM8A89WgKwekxLZY", + "object": { + "payment": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "approved_money": { + "amount": 100, + "currency": "USD" + }, + "capabilities": [ + "EDIT_TIP_AMOUNT", + "EDIT_TIP_AMOUNT_UP", + "EDIT_TIP_AMOUNT_DOWN" + ], + "card_details": { + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "540988", + "card_brand": "MASTERCARD", + "card_type": "CREDIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg", + "last_4": "9029", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2020-11-22T21:16:51.198Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "KEYED", + "statement_description": "SQ *DEFAULT TEST ACCOUNT", + "status": "AUTHORIZED" + }, + "created_at": "2020-11-22T21:16:51.086Z", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2020-11-29T21:16:51.086Z", + "id": "hYy9pRFVxpDsO1FB05SunFWUe9JZY", + "location_id": "S8GWD5R9QB376", + "order_id": "03O3USaPaAaFnI6kkwB1JxGgBsUZY", + "receipt_number": "hYy9", + "risk_evaluation": { + "created_at": "2020-11-22T21:16:51.198Z", + "risk_level": "NORMAL" + }, + "source_type": "CARD", + "status": "APPROVED", + "total_money": { + "amount": 100, + "currency": "USD" + }, + "updated_at": "2020-11-22T21:16:51.198Z", + "version_token": "FfQhQJf9r3VSQIgyWBk1oqhIwiznLwVwJbVVA0bdyEv6o" + } + }, + "type": "payment" + }, + "event_id": "13b867cf-db3d-4b1c-90b6-2f32a9d78124", + "merchant_id": "6SSW7HV8K2ST5", + "type": "payment.created" + }, + "x-webhook": { + "event": "payment.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Payments", + "x-since": "2020-02-26" + }, + "PaymentCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"payment\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected payment.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/PaymentCreatedEventObject", + "description": "An object containing the created payment.", + "nullable": true + } + } + }, + "PaymentCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The created payment.", + "nullable": true + } + } + }, + "PaymentLink": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "version" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the payment link.", + "readOnly": true + }, + "version": { + "type": "integer", + "description": "The Square-assigned version number, which is incremented each time an update is committed to the payment link.", + "maximum": 65535 + }, + "description": { + "type": "string", + "description": "The optional description of the `payment_link` object.\nIt is primarily for use by your application and is not used anywhere.", + "maxLength": 4096, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the order associated with the payment link.", + "maxLength": 192, + "readOnly": true + }, + "checkout_options": { + "$ref": "#/components/schemas/CheckoutOptions", + "description": "The checkout options configured for the payment link.\nFor more information, see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations).", + "nullable": true + }, + "pre_populated_data": { + "$ref": "#/components/schemas/PrePopulatedData", + "description": "Describes buyer data to prepopulate\non the checkout page.", + "nullable": true + }, + "url": { + "type": "string", + "description": "The shortened URL of the payment link.", + "maxLength": 255, + "readOnly": true + }, + "long_url": { + "type": "string", + "description": "The long URL of the payment link.", + "maxLength": 255, + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the payment link was created, in RFC 3339 format." + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the payment link was last updated, in RFC 3339 format." + }, + "payment_note": { + "type": "string", + "description": "An optional note. After Square processes the payment, this note is added to the\nresulting `Payment`.", + "maxLength": 500, + "nullable": true + } + } + }, + "PaymentLinkRelatedResources": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + }, + "description": "The order associated with the payment link.", + "nullable": true + }, + "subscription_plans": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "The subscription plan associated with the payment link.", + "nullable": true + } + } + }, + "PaymentOptions": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "autocomplete": { + "type": "boolean", + "description": "Indicates whether the `Payment` objects created from this `TerminalCheckout` are\nautomatically `COMPLETED` or left in an `APPROVED` state for later modification.\n\nDefault: true", + "nullable": true + }, + "delay_duration": { + "type": "string", + "description": "The duration of time after the payment's creation when Square automatically resolves the\npayment. This automatic resolution applies only to payments that do not reach a terminal state\n(`COMPLETED` or `CANCELED`) before the `delay_duration` time period.\n\nThis parameter should be specified as a time duration, in RFC 3339 format, with a minimum value\nof 1 minute and a maximum value of 36 hours. This feature is only supported for card payments,\nand all payments will be considered card-present.\n\nThis parameter can only be set for a delayed capture payment (`autocomplete=false`). For more\ninformation, see [Delayed Capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold).\n\nDefault: \"PT36H\" (36 hours) from the creation time", + "nullable": true + }, + "accept_partial_authorization": { + "type": "boolean", + "description": "If set to `true` and charging a Square Gift Card, a payment might be returned with\n`amount_money` equal to less than what was requested. For example, a request for $20 when charging\na Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose\nto prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card\npayment.\n\nThis parameter can only be set for a delayed capture payment (`autocomplete=false`).\n\nFor more information, see [Take Partial Payments](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/partial-payments-with-gift-cards).\n\nDefault: false", + "nullable": true + }, + "delay_action": { + "$ref": "#/components/schemas/PaymentOptionsDelayAction", + "description": "The action to be applied to the `Payment` when the delay_duration has elapsed.\nThe action must be CANCEL or COMPLETE.\n\nThe action cannot be set to COMPLETE if an `order_id` is present on the TerminalCheckout.\n\nThis parameter can only be set for a delayed capture payment (`autocomplete=false`). For more\ninformation, see [Delayed Capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold).\n\nDefault: CANCEL\nSee [DelayAction](#type-delayaction) for possible values", + "nullable": true + } + } + }, + "PaymentOptionsDelayAction": { + "type": "string", + "enum": [ + "CANCEL", + "COMPLETE" + ], + "x-enum-elements": [ + { + "name": "CANCEL", + "description": "Indicates that the payment should be automatically canceled when the delay duration\nelapses." + }, + { + "name": "COMPLETE", + "description": "Indicates that the payment should be automatically completed when the delay duration\nelapses." + } + ], + "description": "Describes the action to be applied to a delayed capture payment when the delay_duration\nhas elapsed.", + "x-release-status": "PUBLIC" + }, + "PaymentRefund": { + "type": "object", + "description": "Represents a refund of a payment made using Square. Contains information about\nthe original payment and the amount of money refunded.", + "x-release-status": "PUBLIC", + "required": [ + "id", + "amount_money" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID for this refund, generated by Square.", + "minLength": 1, + "maxLength": 255 + }, + "status": { + "type": "string", + "description": "The refund's status:\n- `PENDING` - Awaiting approval.\n- `COMPLETED` - Successfully completed.\n- `REJECTED` - The refund was rejected.\n- `FAILED` - An error occurred.", + "maxLength": 50, + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The location ID associated with the payment this refund is attached to.", + "maxLength": 50, + "nullable": true + }, + "unlinked": { + "type": "boolean", + "description": "Flag indicating whether or not the refund is linked to an existing payment in Square.", + "readOnly": true + }, + "destination_type": { + "type": "string", + "description": "The destination type for this refund.\n\nCurrent values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`,\n`EXTERNAL`, and `SQUARE_ACCOUNT`.", + "maxLength": 50, + "nullable": true + }, + "destination_details": { + "$ref": "#/components/schemas/DestinationDetails", + "description": "Contains information about the refund destination. This field is populated only if\n`destination_id` is defined in the `RefundPayment` request.", + "readOnly": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money refunded. This amount is specified in the smallest denomination\nof the applicable currency (for example, US dollar amounts are specified in cents)." + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money the application developer contributed to help cover the refunded amount.\nThis amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).", + "nullable": true + }, + "processing_fee": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessingFee" + }, + "description": "Processing fees and fee adjustments assessed by Square for this refund.", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this refund.", + "maxLength": 192, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the order associated with the refund.", + "maxLength": 192, + "nullable": true + }, + "reason": { + "type": "string", + "description": "The reason for the refund.", + "maxLength": 192, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the refund was created, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the refund was last updated, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "team_member_id": { + "type": "string", + "description": "An optional ID of the team member associated with taking the payment.", + "maxLength": 192, + "readOnly": true + }, + "terminal_refund_id": { + "type": "string", + "description": "An optional ID for a Terminal refund.", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "PaymentUpdatedEvent": { + "type": "object", + "description": "Published when a [Payment](entity:Payment) is updated.\nTypically the `payment.status`, or `card_details.status` fields are updated\nas a payment is canceled, authorized, or completed.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"payment.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/PaymentUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T21:27:34.308Z", + "data": { + "id": "hYy9pRFVxpDsO1FB05SunFWUe9JZY", + "object": { + "payment": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "approved_money": { + "amount": 100, + "currency": "USD" + }, + "card_details": { + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "540988", + "card_brand": "MASTERCARD", + "card_type": "CREDIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg", + "last_4": "9029", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2020-11-22T21:16:51.198Z", + "captured_at": "2020-11-22T21:19:00.832Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "KEYED", + "statement_description": "SQ *DEFAULT TEST ACCOUNT", + "status": "CAPTURED" + }, + "created_at": "2020-11-22T21:16:51.086Z", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2020-11-29T21:16:51.086Z", + "id": "hYy9pRFVxpDsO1FB05SunFWUe9JZY", + "location_id": "S8GWD5R9QB376", + "order_id": "03O3USaPaAaFnI6kkwB1JxGgBsUZY", + "receipt_number": "hYy9", + "receipt_url": "https://squareup.com/receipt/preview/hYy9pRFVxpDsO1FB05SunFWUe9JZY", + "risk_evaluation": { + "created_at": "2020-11-22T21:16:51.198Z", + "risk_level": "NORMAL" + }, + "source_type": "CARD", + "status": "COMPLETED", + "total_money": { + "amount": 100, + "currency": "USD" + }, + "updated_at": "2020-11-22T21:19:00.831Z", + "version_token": "bhC3b8qKJvNDdxqKzXaeDsAjS1oMFuAKxGgT32HbE6S6o" + } + }, + "type": "payment" + }, + "event_id": "6a8f5f28-54a1-4eb0-a98a-3111513fd4fc", + "merchant_id": "6SSW7HV8K2ST5", + "type": "payment.updated" + }, + "x-webhook": { + "event": "payment.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Payments", + "x-since": "2020-02-26" + }, + "PaymentUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"payment\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected payment.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/PaymentUpdatedEventObject", + "description": "An object containing the updated payment.", + "nullable": true + } + } + }, + "PaymentUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The updated payment.", + "nullable": true + } + } + }, + "Payout": { + "type": "object", + "description": "An accounting of the amount owed the seller and record of the actual transfer to their\nexternal bank account or to the Square balance.", + "x-release-status": "PUBLIC", + "required": [ + "id", + "location_id" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique ID for the payout.", + "minLength": 1 + }, + "status": { + "$ref": "#/components/schemas/PayoutStatus", + "description": "Indicates the payout status.\nSee [PayoutStatus](#type-payoutstatus) for possible values", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the payout.", + "minLength": 1 + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the payout was created and submitted for deposit to the seller's banking destination, in RFC 3339 format." + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the payout was last updated, in RFC 3339 format." + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money involved in the payout. A positive amount indicates a deposit, and a negative amount indicates a withdrawal. This amount is never zero.", + "nullable": true + }, + "destination": { + "$ref": "#/components/schemas/Destination", + "description": "Information about the banking destination (such as a bank account, Square checking account, or debit card)\nagainst which the payout was made.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is made to this payout record.\nThe version number helps developers receive event notifications or feeds out of order." + }, + "type": { + "$ref": "#/components/schemas/PayoutType", + "description": "Indicates the payout type.\nSee [PayoutType](#type-payouttype) for possible values", + "nullable": true + }, + "payout_fee": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayoutFee" + }, + "description": "A list of transfer fees and any taxes on the fees assessed by Square for this payout.", + "nullable": true + }, + "arrival_date": { + "type": "string", + "description": "The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s banking destination.", + "nullable": true + }, + "end_to_end_id": { + "type": "string", + "description": "A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can use this ID to automate the process of reconciling each payout with the corresponding line item on the bank statement.", + "nullable": true + } + } + }, + "PayoutEntry": { + "type": "object", + "description": "One or more PayoutEntries that make up a Payout. Each one has a date, amount, and type of activity.\nThe total amount of the payout will equal the sum of the payout entries for a batch payout", + "x-release-status": "PUBLIC", + "required": [ + "id", + "payout_id" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique ID for the payout entry.", + "minLength": 1 + }, + "payout_id": { + "type": "string", + "description": "The ID of the payout entries’ associated payout.", + "minLength": 1 + }, + "effective_at": { + "type": "string", + "description": "The timestamp of when the payout entry affected the balance, in RFC 3339 format.", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/ActivityType", + "description": "The type of activity associated with this payout entry.\nSee [ActivityType](#type-activitytype) for possible values", + "nullable": true + }, + "gross_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money involved in this payout entry.", + "nullable": true + }, + "fee_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of Square fees associated with this payout entry.", + "nullable": true + }, + "net_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The net proceeds from this transaction after any fees.", + "nullable": true + }, + "type_app_fee_revenue_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityAppFeeRevenueDetail", + "description": "Details of any developer app fee revenue generated on a payment.", + "nullable": true + }, + "type_app_fee_refund_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityAppFeeRefundDetail", + "description": "Details of a refund for an app fee on a payment.", + "nullable": true + }, + "type_automatic_savings_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityAutomaticSavingsDetail", + "description": "Details of any automatic transfer from the payment processing balance to the Square Savings account. These are, generally, proportional to the merchant's sales.", + "nullable": true + }, + "type_automatic_savings_reversed_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityAutomaticSavingsReversedDetail", + "description": "Details of any automatic transfer from the Square Savings account back to the processing balance. These are, generally, proportional to the merchant's refunds.", + "nullable": true + }, + "type_charge_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityChargeDetail", + "description": "Details of credit card payment captures.", + "nullable": true + }, + "type_deposit_fee_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityDepositFeeDetail", + "description": "Details of any fees involved with deposits such as for instant deposits.", + "nullable": true + }, + "type_deposit_fee_reversed_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityDepositFeeReversedDetail", + "description": "Details of any reversal or refund of fees involved with deposits such as for instant deposits.", + "nullable": true + }, + "type_dispute_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityDisputeDetail", + "description": "Details of any balance change due to a dispute event.", + "nullable": true + }, + "type_fee_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityFeeDetail", + "description": "Details of adjustments due to the Square processing fee.", + "nullable": true + }, + "type_free_processing_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityFreeProcessingDetail", + "description": "Square offers Free Payments Processing for a variety of business scenarios including seller referral or when Square wants to apologize for a bug, customer service, repricing complication, and so on. This entry represents details of any credit to the merchant for the purposes of Free Processing.", + "nullable": true + }, + "type_hold_adjustment_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityHoldAdjustmentDetail", + "description": "Details of any adjustment made by Square related to the holding or releasing of a payment.", + "nullable": true + }, + "type_open_dispute_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityOpenDisputeDetail", + "description": "Details of any open disputes.", + "nullable": true + }, + "type_other_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityOtherDetail", + "description": "Details of any other type that does not belong in the rest of the types.", + "nullable": true + }, + "type_other_adjustment_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityOtherAdjustmentDetail", + "description": "Details of any other type of adjustments that don't fall under existing types.", + "nullable": true + }, + "type_refund_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityRefundDetail", + "description": "Details of a refund for an existing card payment.", + "nullable": true + }, + "type_release_adjustment_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityReleaseAdjustmentDetail", + "description": "Details of fees released for adjustments.", + "nullable": true + }, + "type_reserve_hold_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityReserveHoldDetail", + "description": "Details of fees paid for funding risk reserve.", + "nullable": true + }, + "type_reserve_release_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityReserveReleaseDetail", + "description": "Details of fees released from risk reserve.", + "nullable": true + }, + "type_square_capital_payment_details": { + "$ref": "#/components/schemas/PaymentBalanceActivitySquareCapitalPaymentDetail", + "description": "Details of capital merchant cash advance (MCA) assessments. These are, generally, proportional to the merchant's sales but may be issued for other reasons related to the MCA.", + "nullable": true + }, + "type_square_capital_reversed_payment_details": { + "$ref": "#/components/schemas/PaymentBalanceActivitySquareCapitalReversedPaymentDetail", + "description": "Details of capital merchant cash advance (MCA) assessment refunds. These are, generally, proportional to the merchant's refunds but may be issued for other reasons related to the MCA.", + "nullable": true + }, + "type_tax_on_fee_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityTaxOnFeeDetail", + "description": "Details of tax paid on fee amounts.", + "nullable": true + }, + "type_third_party_fee_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityThirdPartyFeeDetail", + "description": "Details of fees collected by a 3rd party platform.", + "nullable": true + }, + "type_third_party_fee_refund_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityThirdPartyFeeRefundDetail", + "description": "Details of refunded fees from a 3rd party platform.", + "nullable": true + }, + "type_square_payroll_transfer_details": { + "$ref": "#/components/schemas/PaymentBalanceActivitySquarePayrollTransferDetail", + "description": "Details of a payroll payment that was transferred to a team member’s bank account.", + "nullable": true + }, + "type_square_payroll_transfer_reversed_details": { + "$ref": "#/components/schemas/PaymentBalanceActivitySquarePayrollTransferReversedDetail", + "description": "Details of a payroll payment to a team member’s bank account that was deposited back to the seller’s account by Square.", + "nullable": true + } + } + }, + "PayoutFailedEvent": { + "type": "object", + "description": "Published when a [Payout](entity:Payout) has failed.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event that this represents, `payout.failed`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was verified, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/PayoutFailedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "1970-01-01T00:20:28.481Z", + "data": { + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "object": { + "payout": { + "amount_money": { + "amount": 457, + "currency_code": "EUR" + }, + "arrival_date": "2021-07-13", + "created_at": "2021-07-12T20:37:51Z", + "destination": { + "id": "bact:c164d7ec7302", + "type": "BANK_ACCOUNT" + }, + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "location_id": "LRJNZCB190DTQ", + "status": "FAILED", + "type": "BATCH", + "updated_at": "1970-01-01T00:20:28.481Z", + "version": 2 + } + }, + "type": "payout" + }, + "event_id": "7116e4a4-7622-42b0-b16c-c164d7ec7302", + "location_id": "LRJNZCB190DTQ", + "merchant_id": "MLEWJTMNJN37Z", + "type": "payout.failed" + }, + "x-webhook": { + "event": "payout.failed", + "scopes": [ + "PAYOUTS_READ", + "SETTLEMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Payouts", + "x-since": "2022-04-20" + }, + "PayoutFailedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The name of the affected object's type, `payout`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the failed payout." + }, + "object": { + "$ref": "#/components/schemas/PayoutFailedEventObject", + "description": "An object containing the failed payout.", + "nullable": true + } + } + }, + "PayoutFailedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout": { + "$ref": "#/components/schemas/Payout", + "description": "The payout that failed.", + "nullable": true + } + } + }, + "PayoutFee": { + "type": "object", + "description": "Represents a payout fee that can incur as part of a payout.", + "x-release-status": "PUBLIC", + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The money amount of the payout fee.", + "nullable": true + }, + "effective_at": { + "type": "string", + "description": "The timestamp of when the fee takes effect, in RFC 3339 format.", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/PayoutFeeType", + "description": "The type of fee assessed as part of the payout.\nSee [PayoutFeeType](#type-payoutfeetype) for possible values", + "nullable": true + } + } + }, + "PayoutFeeType": { + "type": "string", + "enum": [ + "TRANSFER_FEE", + "TAX_ON_TRANSFER_FEE" + ], + "x-enum-elements": [ + { + "name": "TRANSFER_FEE", + "description": "Fee type associated with transfers." + }, + { + "name": "TAX_ON_TRANSFER_FEE", + "description": "Taxes associated with the transfer fee." + } + ], + "description": "Represents the type of payout fee that can incur as part of a payout.", + "x-release-status": "PUBLIC" + }, + "PayoutPaidEvent": { + "type": "object", + "description": "Published when a [Payout](entity:Payout) is complete.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"payout.paid\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was verified, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/PayoutPaidEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "1970-01-01T00:20:28.481Z", + "data": { + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "object": { + "payout": { + "amount_money": { + "amount": 457, + "currency_code": "EUR" + }, + "arrival_date": "2021-07-13", + "created_at": "2021-07-12T20:37:51Z", + "destination": { + "id": "bact:c164d7ec7302", + "type": "BANK_ACCOUNT" + }, + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "location_id": "LRJNZCB190DTQ", + "status": "PAID", + "type": "BATCH", + "updated_at": "1970-01-01T00:20:28.481Z", + "version": 2 + } + }, + "type": "payout" + }, + "event_id": "7116e4a4-7622-42b0-b16c-c164d7ec7302", + "location_id": "LRJNZCB190DTQ", + "merchant_id": "MLEWJTMNJN37Z", + "type": "payout.paid" + }, + "x-webhook": { + "event": "payout.paid", + "scopes": [ + "PAYOUTS_READ", + "SETTLEMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Payouts", + "x-since": "2022-04-20" + }, + "PayoutPaidEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"payout\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the completed payout." + }, + "object": { + "$ref": "#/components/schemas/PayoutPaidEventObject", + "description": "An object containing the completed payout.", + "nullable": true + } + } + }, + "PayoutPaidEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout": { + "$ref": "#/components/schemas/Payout", + "description": "The payout that has completed.", + "nullable": true + } + } + }, + "PayoutSentEvent": { + "type": "object", + "description": "Published when a [Payout](entity:Payout) is sent.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"payout.sent\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was verified, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/PayoutSentEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "1970-01-01T00:20:28.481Z", + "data": { + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "object": { + "payout": { + "amount_money": { + "amount": 457, + "currency_code": "EUR" + }, + "arrival_date": "2021-07-13", + "created_at": "2021-07-12T20:37:51Z", + "destination": { + "id": "bact:c164d7ec7302", + "type": "BANK_ACCOUNT" + }, + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "location_id": "LRJNZCB190DTQ", + "status": "SENT", + "type": "BATCH", + "updated_at": "1970-01-01T00:20:28.481Z", + "version": 1 + } + }, + "type": "payout" + }, + "event_id": "7116e4a4-7622-42b0-b16c-c164d7ec7302", + "location_id": "LRJNZCB190DTQ", + "merchant_id": "MLEWJTMNJN37Z", + "type": "payout.sent" + }, + "x-webhook": { + "event": "payout.sent", + "scopes": [ + "PAYOUTS_READ", + "SETTLEMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Payouts", + "x-since": "2022-04-20" + }, + "PayoutSentEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"payout\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the sent payout." + }, + "object": { + "$ref": "#/components/schemas/PayoutSentEventObject", + "description": "An object containing the sent payout.", + "nullable": true + } + } + }, + "PayoutSentEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout": { + "$ref": "#/components/schemas/Payout", + "description": "The payout that was sent.", + "nullable": true + } + } + }, + "PayoutStatus": { + "type": "string", + "enum": [ + "SENT", + "FAILED", + "PAID" + ], + "x-enum-elements": [ + { + "name": "SENT", + "description": "Indicates that the payout was successfully sent to the banking destination." + }, + { + "name": "FAILED", + "description": "Indicates that the payout was rejected by the banking destination." + }, + { + "name": "PAID", + "description": "Indicates that the payout has successfully completed." + } + ], + "description": "Payout status types", + "x-release-status": "PUBLIC" + }, + "PayoutType": { + "type": "string", + "enum": [ + "BATCH", + "SIMPLE" + ], + "x-enum-elements": [ + { + "name": "BATCH", + "description": "Payouts that include a list of payout entries that can be considered settled." + }, + { + "name": "SIMPLE", + "description": "Payouts that do not have any payout entries associated with them and will\nshow up as one of the payout entries in a future BATCH payout." + } + ], + "description": "The type of payout: “BATCH” or “SIMPLE”.\nBATCH payouts include a list of payout entries that can be considered settled.\nSIMPLE payouts do not have any payout entries associated with them\nand will show up as one of the payout entries in a future BATCH payout.", + "x-release-status": "PUBLIC" + }, + "Phase": { + "type": "object", + "description": "Represents a phase, which can override subscription phases as defined by plan_id", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "id of subscription phase", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "index of phase in total subscription plan", + "format": "int64", + "nullable": true + }, + "order_template_id": { + "type": "string", + "description": "id of order to be used in billing", + "nullable": true + }, + "plan_phase_uid": { + "type": "string", + "description": "the uid from the plan's phase in catalog", + "nullable": true + } + } + }, + "PhaseInput": { + "type": "object", + "description": "Represents the arguments used to construct a new phase.", + "x-release-status": "PUBLIC", + "required": [ + "ordinal" + ], + "properties": { + "ordinal": { + "type": "integer", + "description": "index of phase in total subscription plan", + "format": "int64" + }, + "order_template_id": { + "type": "string", + "description": "id of order to be used in billing", + "nullable": true + } + } + }, + "PrePopulatedData": { + "type": "object", + "description": "Describes buyer data to prepopulate in the payment form.\nFor more information,\nsee [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations).", + "x-release-status": "PUBLIC", + "properties": { + "buyer_email": { + "type": "string", + "description": "The buyer email to prepopulate in the payment form.", + "maxLength": 256, + "nullable": true + }, + "buyer_phone_number": { + "type": "string", + "description": "The buyer phone number to prepopulate in the payment form.", + "maxLength": 17, + "nullable": true + }, + "buyer_address": { + "$ref": "#/components/schemas/Address", + "description": "The buyer address to prepopulate in the payment form.", + "nullable": true + } + } + }, + "ProcessingFee": { + "type": "object", + "description": "Represents the Square processing fee.", + "x-release-status": "PUBLIC", + "properties": { + "effective_at": { + "type": "string", + "description": "The timestamp of when the fee takes effect, in RFC 3339 format.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of fee assessed or adjusted. The fee type can be `INITIAL` or `ADJUSTMENT`.", + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The fee amount, which might be negative, that is assessed or adjusted by Square.\n\nPositive values represent funds being assessed, while negative values represent\nfunds being returned.", + "nullable": true + } + } + }, + "Product": { + "type": "string", + "enum": [ + "SQUARE_POS", + "EXTERNAL_API", + "BILLING", + "APPOINTMENTS", + "INVOICES", + "ONLINE_STORE", + "PAYROLL", + "DASHBOARD", + "ITEM_LIBRARY_IMPORT", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "SQUARE_POS", + "description": "Square Point of Sale application." + }, + { + "name": "EXTERNAL_API", + "description": "Square Connect APIs (for example, Orders API or Checkout API)." + }, + { + "name": "BILLING", + "description": "A Square subscription (various products)." + }, + { + "name": "APPOINTMENTS", + "description": "Square Appointments." + }, + { + "name": "INVOICES", + "description": "Square Invoices." + }, + { + "name": "ONLINE_STORE", + "description": "Square Online Store." + }, + { + "name": "PAYROLL", + "description": "Square Payroll." + }, + { + "name": "DASHBOARD", + "description": "Square Dashboard." + }, + { + "name": "ITEM_LIBRARY_IMPORT", + "description": "Item Library Import." + }, + { + "name": "OTHER", + "description": "A Square product that does not match any other value." + } + ], + "description": "Indicates the Square product used to generate a change.", + "x-release-status": "PUBLIC" + }, + "ProductType": { + "type": "string", + "enum": [ + "TERMINAL_API" + ], + "x-enum-elements": [ + { + "name": "TERMINAL_API", + "description": "" + } + ], + "x-release-status": "PUBLIC" + }, + "PublishInvoiceRequest": { + "type": "object", + "description": "Describes a `PublishInvoice` request.", + "x-release-status": "PUBLIC", + "required": [ + "version" + ], + "properties": { + "version": { + "type": "integer", + "description": "The version of the [invoice](entity:Invoice) to publish.\nThis must match the current version of the invoice; otherwise, the request is rejected." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `PublishInvoice` request. If you do not \nprovide `idempotency_key` (or provide an empty string as the value), the endpoint \ntreats each request as independent.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 128, + "nullable": true + } + }, + "example": { + "idempotency_key": "32da42d0-1997-41b0-826b-f09464fc2c2e", + "version": 1 + } + }, + "PublishInvoiceResponse": { + "type": "object", + "description": "Describes a `PublishInvoice` response.", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The published invoice." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "public_url": "https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9", + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "SCHEDULED", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 1 + } + } + }, + "PublishScheduledShiftRequest": { + "type": "object", + "description": "Represents a [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) request.", + "x-release-status": "BETA", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique identifier for the `PublishScheduledShift` request, used to ensure the\n[idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)\nof the operation.", + "minLength": 1, + "maxLength": 128 + }, + "version": { + "type": "integer", + "description": "The current version of the scheduled shift, used to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol. If the provided version doesn't match the server version, the request fails.\nIf omitted, Square executes a blind write, potentially overwriting data from another publish request." + }, + "scheduled_shift_notification_audience": { + "$ref": "#/components/schemas/ScheduledShiftNotificationAudience", + "description": "Indicates whether Square should send an email notification to team members and\nwhich team members should receive the notification. The default value is `AFFECTED`.\nSee [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudience) for possible values", + "nullable": true + } + }, + "example": { + "idempotency_key": "HIDSNG5KS478L", + "scheduled_shift_notification_audience": "ALL", + "version": 2 + } + }, + "PublishScheduledShiftResponse": { + "type": "object", + "description": "Represents a [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) response.\nEither `scheduled_shift` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The published scheduled shift." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "scheduled_shift": { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-01-25T13:11:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "published_shift_details": { + "end_at": "2019-01-25T13:11:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "updated_at": "2019-02-25T03:11:00-05:00", + "version": 2 + } + } + }, + "QrCodeOptions": { + "type": "object", + "description": "Fields to describe the action that displays QR-Codes.", + "x-release-status": "BETA", + "required": [ + "title", + "body", + "barcode_contents" + ], + "properties": { + "title": { + "type": "string", + "description": "The title text to display in the QR code flow on the Terminal.", + "minLength": 1, + "maxLength": 250 + }, + "body": { + "type": "string", + "description": "The body text to display in the QR code flow on the Terminal.", + "minLength": 1, + "maxLength": 10000 + }, + "barcode_contents": { + "type": "string", + "description": "The text representation of the data to show in the QR code\nas UTF8-encoded data.", + "minLength": 1, + "maxLength": 1024 + } + } + }, + "QuickPay": { + "type": "object", + "description": "Describes an ad hoc item and price to generate a quick pay checkout link.\nFor more information,\nsee [Quick Pay Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout).", + "x-release-status": "PUBLIC", + "required": [ + "name", + "price_money", + "location_id" + ], + "properties": { + "name": { + "type": "string", + "description": "The ad hoc item name. In the resulting `Order`, this name appears as the line item name.", + "minLength": 1, + "maxLength": 255 + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The price of the item." + }, + "location_id": { + "type": "string", + "description": "The ID of the business location the checkout is associated with." + } + } + }, + "Range": { + "type": "object", + "description": "The range of a number value between the specified lower and upper bounds.", + "x-release-status": "PUBLIC", + "properties": { + "min": { + "type": "string", + "description": "The lower bound of the number range. At least one of `min` or `max` must be specified.\nIf unspecified, the results will have no minimum value.", + "nullable": true + }, + "max": { + "type": "string", + "description": "The upper bound of the number range. At least one of `min` or `max` must be specified.\nIf unspecified, the results will have no maximum value.", + "nullable": true + } + } + }, + "ReceiptOptions": { + "type": "object", + "description": "Describes receipt action fields.", + "x-release-status": "BETA", + "required": [ + "payment_id" + ], + "properties": { + "payment_id": { + "type": "string", + "description": "The reference to the Square payment ID for the receipt." + }, + "print_only": { + "type": "boolean", + "description": "Instructs the device to print the receipt without displaying the receipt selection screen.\nRequires `printer_enabled` set to true.\nDefaults to false.", + "nullable": true + }, + "is_duplicate": { + "type": "boolean", + "description": "Identify the receipt as a reprint rather than an original receipt.\nDefaults to false.", + "nullable": true + } + } + }, + "RedeemLoyaltyRewardRequest": { + "type": "object", + "description": "A request to redeem a loyalty reward.", + "x-release-status": "PUBLIC", + "x-params-example": "?reward_id=9f18ac21-233a-31c3-be77-b45840f5a810", + "required": [ + "idempotency_key", + "location_id" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `RedeemLoyaltyReward` request. \nKeys can be any valid string, but must be unique for every request.", + "minLength": 1, + "maxLength": 128 + }, + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location) where the reward is redeemed.", + "minLength": 1 + } + }, + "example": { + "idempotency_key": "98adc7f7-6963-473b-b29c-f3c9cdd7d994", + "location_id": "P034NEENMD09F" + } + }, + "RedeemLoyaltyRewardResponse": { + "type": "object", + "description": "A response that includes the `LoyaltyEvent` published for redeeming the reward.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "event": { + "$ref": "#/components/schemas/LoyaltyEvent", + "description": "The `LoyaltyEvent` for redeeming the reward." + } + }, + "example": { + "event": { + "created_at": "2020-05-08T21:56:00Z", + "id": "67377a6e-dbdc-369d-aa16-2e7ed422e71f", + "location_id": "P034NEENMD09F", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "redeem_reward": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "reward_id": "9f18ac21-233a-31c3-be77-b45840f5a810" + }, + "source": "LOYALTY_API", + "type": "REDEEM_REWARD" + } + } + }, + "Refund": { + "type": "object", + "description": "Represents a refund processed for a Square transaction.", + "x-release-status": "PUBLIC", + "required": [ + "id", + "location_id", + "reason", + "amount_money", + "status" + ], + "properties": { + "id": { + "type": "string", + "description": "The refund's unique ID.", + "maxLength": 255 + }, + "location_id": { + "type": "string", + "description": "The ID of the refund's associated location.", + "maxLength": 50 + }, + "transaction_id": { + "type": "string", + "description": "The ID of the transaction that the refunded tender is part of.", + "maxLength": 192, + "nullable": true + }, + "tender_id": { + "type": "string", + "description": "The ID of the refunded tender.", + "maxLength": 192, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the refund was created, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "reason": { + "type": "string", + "description": "The reason for the refund being issued.", + "maxLength": 192 + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money refunded to the buyer." + }, + "status": { + "$ref": "#/components/schemas/RefundStatus", + "description": "The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`,\nor `FAILED`).\nSee [RefundStatus](#type-refundstatus) for possible values" + }, + "processing_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of Square processing fee money refunded to the *merchant*.", + "nullable": true + }, + "additional_recipients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdditionalRecipient" + }, + "description": "Additional recipients (other than the merchant) receiving a portion of this refund.\nFor example, fees assessed on a refund of a purchase by a third party integration.", + "x-release-status": "DEPRECATED", + "nullable": true + } + } + }, + "RefundCreatedEvent": { + "type": "object", + "description": "Published when a [Refund](entity:PaymentRefund) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"refund.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/RefundCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T21:27:41.852Z", + "data": { + "id": "KkAkhdMsgzn59SM8A89WgKwekxLZY_ptNBVqHYxt5gAdfcobBe4u1AZsXhoz06KTtuq9Ls24P", + "object": { + "refund": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "created_at": "2020-02-06T21:27:41.836Z", + "id": "KkAkhdMsgzn59SM8A89WgKwekxLZY_ptNBVqHYxt5gAdfcobBe4u1AZsXhoz06KTtuq9Ls24P", + "location_id": "NAQ1FHV6ZJ8YV", + "order_id": "haOyDuHiqtAXMk0d8pDKXpL7Jg4F", + "payment_id": "KkAkhdMsgzn59SM8A89WgKwekxLZY", + "status": "PENDING", + "updated_at": "2020-02-06T21:27:41.846Z", + "version": 7 + } + }, + "type": "refund" + }, + "event_id": "bc316346-6691-4243-88ed-6d651a0d0c47", + "merchant_id": "6SSW7HV8K2ST5", + "type": "refund.created" + }, + "x-webhook": { + "event": "refund.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Refunds", + "x-since": "2020-02-26" + }, + "RefundCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"refund\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected refund.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/RefundCreatedEventObject", + "description": "An object containing the created refund.", + "nullable": true + } + } + }, + "RefundCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "refund": { + "$ref": "#/components/schemas/PaymentRefund", + "description": "The created refund.", + "nullable": true + } + } + }, + "RefundPaymentRequest": { + "type": "object", + "description": "Describes a request to refund a payment using [RefundPayment](api-endpoint:Refunds-RefundPayment).", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "amount_money" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": " A unique string that identifies this `RefundPayment` request. The key can be any valid string\nbut must be unique for every `RefundPayment` request.\n\nKeys are limited to a max of 45 characters - however, the number of allowed characters might be\nless than 45, if multi-byte characters are used.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1 + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money to refund.\n\nThis amount cannot be more than the `total_money` value of the payment minus the total\namount of all previously completed refunds for this payment.\n\nThis amount must be specified in the smallest denomination of the applicable currency\n(for example, US dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).\n\nThe currency code must match the currency associated with the business\nthat is charging the card." + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money the developer contributes to help cover the refunded amount.\nThis amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents).\n\nThe value cannot be more than the `amount_money`.\n\nYou can specify this parameter in a refund request only if the same parameter was also included\nwhen taking the payment. This is part of the application fee scenario the API supports. For more\ninformation, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).\n\nTo set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.\nFor more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).", + "x-release-status": "BETA", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The unique ID of the payment being refunded.\nRequired when unlinked=false, otherwise must not be set.", + "nullable": true + }, + "destination_id": { + "type": "string", + "description": "The ID indicating where funds will be refunded to. Required for unlinked refunds. For more\ninformation, see [Process an Unlinked Refund](https://developer.squareup.com/docs/refunds-api/unlinked-refunds).\n\nFor refunds linked to Square payments, `destination_id` is usually omitted; in this case, funds\nwill be returned to the original payment source. The field may be specified in order to request\na cross-method refund to a gift card. For more information,\nsee [Cross-method refunds to gift cards](https://developer.squareup.com/docs/payments-api/refund-payments#cross-method-refunds-to-gift-cards).", + "nullable": true + }, + "unlinked": { + "type": "boolean", + "description": "Indicates that the refund is not linked to a Square payment.\nIf set to true, `destination_id` and `location_id` must be supplied while `payment_id` must not\nbe provided.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The location ID associated with the unlinked refund.\nRequired for requests specifying `unlinked=true`.\nOtherwise, if included when `unlinked=false`, will throw an error.", + "maxLength": 50, + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "The [Customer](entity:Customer) ID of the customer associated with the refund.\nThis is required if the `destination_id` refers to a card on file created using the Cards\nAPI. Only allowed when `unlinked=true`.", + "nullable": true + }, + "reason": { + "type": "string", + "description": "A description of the reason for the refund.", + "maxLength": 192, + "nullable": true + }, + "payment_version_token": { + "type": "string", + "description": " Used for optimistic concurrency. This opaque token identifies the current `Payment`\nversion that the caller expects. If the server has a different version of the Payment,\nthe update fails and a response with a VERSION_MISMATCH error is returned.\nIf the versions match, or the field is not provided, the refund proceeds as normal.", + "x-release-status": "BETA", + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "An optional [TeamMember](entity:TeamMember) ID to associate with this refund.", + "maxLength": 192, + "nullable": true + }, + "cash_details": { + "$ref": "#/components/schemas/DestinationDetailsCashRefundDetails", + "description": "Additional details required when recording an unlinked cash refund (`destination_id` is CASH).", + "nullable": true + }, + "external_details": { + "$ref": "#/components/schemas/DestinationDetailsExternalRefundDetails", + "description": "Additional details required when recording an unlinked external refund\n(`destination_id` is EXTERNAL).", + "nullable": true + } + }, + "example": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "app_fee_money": { + "amount": 10, + "currency": "USD" + }, + "idempotency_key": "9b7f2dcf-49da-4411-b23e-a2d6af21333a", + "payment_id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", + "reason": "Example" + } + }, + "RefundPaymentResponse": { + "type": "object", + "description": "Defines the response returned by\n[RefundPayment](api-endpoint:Refunds-RefundPayment).\n\nIf there are errors processing the request, the `refund` field might not be\npresent, or it might be present with a status of `FAILED`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/PaymentRefund", + "description": "The successfully created `PaymentRefund`." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "app_fee_money": { + "amount": 10, + "currency": "USD" + }, + "created_at": "2021-10-13T21:23:19.116Z", + "id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY_KlWP8IC1557ddwc9QWTKrCVU6m0JXDz15R2Qym5eQfR", + "location_id": "L88917AVBK2S5", + "order_id": "1JLEUZeEooAIX8HMqm9kvWd69aQZY", + "payment_id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", + "reason": "Example", + "status": "PENDING", + "updated_at": "2021-10-13T21:23:19.508Z" + } + } + }, + "RefundStatus": { + "type": "string", + "enum": [ + "PENDING", + "APPROVED", + "REJECTED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The refund is pending." + }, + { + "name": "APPROVED", + "description": "The refund has been approved by Square." + }, + { + "name": "REJECTED", + "description": "The refund has been rejected by Square." + }, + { + "name": "FAILED", + "description": "The refund failed." + } + ], + "description": "Indicates a refund's current status.", + "x-release-status": "PUBLIC" + }, + "RefundUpdatedEvent": { + "type": "object", + "description": "Published when a [Refund](entity:PaymentRefund) is updated.\nTypically the `refund.status` changes when a refund is completed.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"refund.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/RefundUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T22:14:16.421Z", + "data": { + "id": "KkAkhdMsgzn59SM8A89WgKwekxLZY_ptNBVqHYxt5gAdfcobBe4u1AZsXhoz06KTtuq9Ls24P", + "object": { + "refund": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "created_at": "2020-02-06T21:27:41.836Z", + "id": "KkAkhdMsgzn59SM8A89WgKwekxLZY_ptNBVqHYxt5gAdfcobBe4u1AZsXhoz06KTtuq9Ls24P", + "location_id": "NAQ1FHV6ZJ8YV", + "order_id": "haOyDuHiqtAXMk0d8pDKXpL7Jg4F", + "payment_id": "KkAkhdMsgzn59SM8A89WgKwekxLZY", + "processing_fee": [ + { + "amount_money": { + "amount": -59, + "currency": "USD" + }, + "effective_at": "2020-02-06T23:27:31.000Z", + "type": "INITIAL" + } + ], + "status": "COMPLETED", + "updated_at": "2020-02-06T22:14:16.381Z", + "version": 10 + } + }, + "type": "refund" + }, + "event_id": "bc316346-6691-4243-88ed-6d651a0d0c47", + "merchant_id": "6SSW7HV8K2ST5", + "type": "refund.updated" + }, + "x-webhook": { + "event": "refund.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Refunds", + "x-since": "2020-02-26" + }, + "RefundUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"refund\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected refund.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/RefundUpdatedEventObject", + "description": "An object containing the updated refund.", + "nullable": true + } + } + }, + "RefundUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "refund": { + "$ref": "#/components/schemas/PaymentRefund", + "description": "The updated refund.", + "nullable": true + } + } + }, + "RegisterDomainRequest": { + "type": "object", + "description": "Defines the parameters that can be included in the body of\na request to the [RegisterDomain](api-endpoint:ApplePay-RegisterDomain) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "domain_name" + ], + "properties": { + "domain_name": { + "type": "string", + "description": "A domain name as described in RFC-1034 that will be registered with ApplePay.", + "minLength": 1, + "maxLength": 255 + } + }, + "example": { + "domain_name": "example.com" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.csharp", + "java": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.java", + "javascript": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.javascript", + "php": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.php", + "python": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.python", + "ruby": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.ruby" + } + }, + "RegisterDomainResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RegisterDomain](api-endpoint:ApplePay-RegisterDomain) endpoint.\n\nEither `errors` or `status` are present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "status": { + "$ref": "#/components/schemas/RegisterDomainResponseStatus", + "description": "The status of the domain registration.\n\nSee [RegisterDomainResponseStatus](entity:RegisterDomainResponseStatus) for possible values.\nSee [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values" + } + }, + "example": { + "status": "VERIFIED" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.csharp", + "java": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.java", + "javascript": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.javascript", + "php": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.php", + "python": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.python", + "ruby": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.ruby" + } + }, + "RegisterDomainResponseStatus": { + "type": "string", + "enum": [ + "PENDING", + "VERIFIED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The domain is added, but not verified." + }, + { + "name": "VERIFIED", + "description": "The domain is added and verified. It can be used to accept Apple Pay transactions." + } + ], + "description": "The status of the domain registration.", + "x-release-status": "PUBLIC" + }, + "RemoveGroupFromCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RemoveGroupFromCustomer](api-endpoint:Customers-RemoveGroupFromCustomer)\nendpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "ResumeSubscriptionRequest": { + "type": "object", + "description": "Defines input parameters in a request to the\n[ResumeSubscription](api-endpoint:Subscriptions-ResumeSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "resume_effective_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the subscription reactivated.", + "x-release-status": "BETA", + "nullable": true + }, + "resume_change_timing": { + "$ref": "#/components/schemas/ChangeTiming", + "description": "The timing to resume a subscription, relative to the specified\n`resume_effective_date` attribute value.\nSee [ChangeTiming](#type-changetiming) for possible values", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "ResumeSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the \n[ResumeSubscription](api-endpoint:Subscriptions-ResumeSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The resumed subscription." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "A list of `RESUME` actions created by the request and scheduled for the subscription.", + "x-release-status": "BETA" + } + }, + "example": { + "actions": [ + { + "effective_date": "2023-09-01", + "id": "18ff74f4-3da4-30c5-929f-7d6fca84f115", + "type": "RESUME" + } + ], + "subscription": { + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + "ordinal": 0, + "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", + "uid": "873451e0-745b-4e87-ab0b-c574933fe616" + } + ], + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2023-06-20", + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 1 + } + } + }, + "RetrieveBookingCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [RetrieveBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The retrieved custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-11-16T15:27:30Z", + "description": "The favorite shampoo of the customer.", + "key": "favoriteShampoo", + "name": "Favorite shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-16T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + } + }, + "RetrieveBookingCustomAttributeResponse": { + "type": "object", + "description": "Represents a [RetrieveBookingCustomAttribute](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The retrieved custom attribute. If `with_definition` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-11-16T15:50:27Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T15:50:27Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [] + } + }, + "RetrieveBookingResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The booking that was requested." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "booking": { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "created_at": "2020-10-28T15:47:41Z", + "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + "customer_note": "", + "id": "zkras0xv0xwswx", + "location_id": "LEQHH0YY8B42M", + "seller_note": "", + "start_at": "2020-11-26T13:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-10-28T15:49:25Z", + "version": 1 + }, + "errors": [] + } + }, + "RetrieveBusinessBookingProfileResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "business_booking_profile": { + "$ref": "#/components/schemas/BusinessBookingProfile", + "description": "The seller's booking profile." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "business_booking_profile": { + "allow_user_cancel": true, + "booking_enabled": true, + "booking_policy": "ACCEPT_ALL", + "business_appointment_settings": { + "alignment_time": "HALF_HOURLY", + "any_team_member_booking_enabled": true, + "cancellation_fee_money": { + "currency": "USD" + }, + "cancellation_policy": "CUSTOM_POLICY", + "location_types": [ + "BUSINESS_LOCATION" + ], + "max_booking_lead_time_seconds": 31536000, + "min_booking_lead_time_seconds": 0, + "multiple_service_booking_enabled": true, + "skip_booking_flow_staff_selection": false + }, + "created_at": "2020-09-10T21:40:38Z", + "customer_timezone_choice": "CUSTOMER_CHOICE", + "seller_id": "MLJQYZZRM0D3Y" + }, + "errors": [] + } + }, + "RetrieveCardResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RetrieveCard](api-endpoint:Cards-RetrieveCard) endpoint.\n\nNote: if there are errors processing the request, the card field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The retrieved card." + } + }, + "example": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + } + } + }, + "RetrieveCashDrawerShiftResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "cash_drawer_shift": { + "$ref": "#/components/schemas/CashDrawerShift", + "description": "The cash drawer shift queried for." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cash_drawer_shift": { + "cash_paid_in_money": { + "amount": 10000, + "currency": "USD" + }, + "cash_paid_out_money": { + "amount": -10000, + "currency": "USD" + }, + "cash_payment_money": { + "amount": 100, + "currency": "USD" + }, + "cash_refunds_money": { + "amount": -100, + "currency": "USD" + }, + "closed_at": "2019-11-22T00:44:49.000Z", + "closed_cash_money": { + "amount": 9970, + "currency": "USD" + }, + "closing_team_member_id": "", + "description": "Misplaced some change", + "device": { + "name": "My iPad" + }, + "ended_at": "2019-11-22T00:44:49.000Z", + "ending_team_member_id": "", + "expected_cash_money": { + "amount": 10000, + "currency": "USD" + }, + "id": "DCC99978-09A6-4926-849F-300BE9C5793A", + "opened_at": "2019-11-22T00:42:54.000Z", + "opened_cash_money": { + "amount": 10000, + "currency": "USD" + }, + "opening_team_member_id": "", + "state": "CLOSED" + } + } + }, + "RetrieveCatalogObjectResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "object": { + "$ref": "#/components/schemas/CatalogObject", + "description": "The `CatalogObject`s returned." + }, + "related_objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of `CatalogObject`s referenced by the object in the `object` field." + } + }, + "example": { + "object": { + "id": "W62UWFY35CWMYGVWK6TWJDNI", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "ordinal": 0 + } + ], + "description": "Hot Leaf Juice", + "name": "Tea", + "tax_ids": [ + "HURXQOOAIC4IZSI2BEXQRYFY" + ], + "variations": [ + { + "id": "2TZFAOHWGG7PAK2QEXWYPZSP", + "is_deleted": false, + "item_variation_data": { + "item_id": "W62UWFY35CWMYGVWK6TWJDNI", + "name": "Mug", + "ordinal": 0, + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + }, + "related_objects": [ + { + "category_data": { + "name": "Beverages" + }, + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "is_deleted": false, + "present_at_all_locations": true, + "type": "CATEGORY", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + }, + { + "id": "HURXQOOAIC4IZSI2BEXQRYFY", + "is_deleted": false, + "present_at_all_locations": true, + "tax_data": { + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.csharp", + "java": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.java", + "javascript": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.javascript", + "php": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.php", + "python": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.python", + "ruby": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.ruby" + } + }, + "RetrieveCustomerCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [RetrieveCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The retrieved custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-04-26T15:27:30Z", + "description": "The favorite movie of the customer.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "RetrieveCustomerCustomAttributeResponse": { + "type": "object", + "description": "Represents a [RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The retrieved custom attribute. If `with_definition` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-04-26T15:50:27Z", + "key": "favoritemovie", + "updated_at": "2022-04-26T15:50:27Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "RetrieveCustomerGroupResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RetrieveCustomerGroup](api-endpoint:CustomerGroups-RetrieveCustomerGroup) endpoint.\n\nEither `errors` or `group` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "group": { + "$ref": "#/components/schemas/CustomerGroup", + "description": "The retrieved customer group." + } + }, + "example": { + "group": { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + } + } + }, + "RetrieveCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `RetrieveCustomer` endpoint.\n\nEither `errors` or `customer` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The requested customer." + } + }, + "example": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "group_ids": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ], + "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "segment_ids": [ + "1KB9JE5EGJXCW.REACHABLE" + ], + "updated_at": "2016-03-23T20:21:54.859Z", + "version": 1 + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.csharp", + "java": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.java", + "javascript": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.javascript", + "php": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.php", + "python": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.python", + "ruby": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.ruby" + } + }, + "RetrieveCustomerSegmentResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body for requests to the `RetrieveCustomerSegment` endpoint.\n\nEither `errors` or `segment` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "segment": { + "$ref": "#/components/schemas/CustomerSegment", + "description": "The retrieved customer segment." + } + }, + "example": { + "segment": { + "created_at": "2020-01-09T19:33:24.469Z", + "id": "GMNXRZVEXNQDF.CHURN_RISK", + "name": "Lapsed", + "updated_at": "2020-04-13T23:01:13Z" + } + } + }, + "RetrieveDisputeEvidenceResponse": { + "type": "object", + "description": "Defines the fields in a `RetrieveDisputeEvidence` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "evidence": { + "$ref": "#/components/schemas/DisputeEvidence", + "description": "Metadata about the dispute evidence file." + } + }, + "example": { + "evidence": { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_file": { + "filename": "customer-interaction.jpg", + "filetype": "image/jpeg" + }, + "evidence_type": "CARDHOLDER_COMMUNICATION", + "id": "TOomLInj6iWmP3N8qfCXrB", + "uploaded_at": "2022-05-18T16:01:10.000Z" + } + } + }, + "RetrieveDisputeResponse": { + "type": "object", + "description": "Defines fields in a `RetrieveDispute` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "dispute": { + "$ref": "#/components/schemas/Dispute", + "description": "Details about the requested `Dispute`." + } + }, + "example": { + "dispute": { + "amount_money": { + "amount": 2500, + "currency": "USD" + }, + "brand_dispute_id": "100000809947", + "card_brand": "VISA", + "created_at": "2022-06-29T18:45:22.265Z", + "disputed_payment": { + "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" + }, + "due_at": "2022-07-13T00:00:00.000Z", + "id": "XDgyFu7yo1E2S5lQGGpYn", + "location_id": "L1HN3ZMQK64X9", + "reason": "NO_KNOWLEDGE", + "reported_at": "2022-06-29T00:00:00.000Z", + "state": "ACCEPTED", + "updated_at": "2022-07-07T19:14:42.650Z", + "version": 2 + } + } + }, + "RetrieveEmployeeResponse": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "employee": { + "$ref": "#/components/schemas/Employee" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + } + }, + "RetrieveGiftCardFromGANRequest": { + "type": "object", + "description": "A request to retrieve gift cards by their GANs.", + "x-release-status": "PUBLIC", + "required": [ + "gan" + ], + "properties": { + "gan": { + "type": "string", + "description": "The gift card account number (GAN) of the gift card to retrieve.\nThe maximum length of a GAN is 255 digits to account for third-party GANs that have been imported.\nSquare-issued gift cards have 16-digit GANs.", + "minLength": 1, + "maxLength": 255 + } + }, + "example": { + "gan": "7783320001001635" + } + }, + "RetrieveGiftCardFromGANResponse": { + "type": "object", + "description": "A response that contains a `GiftCard`. This response might contain a set of `Error` objects\nif the request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "A gift card that was fetched, if present. It returns empty if an error occurred." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 5000, + "currency": "USD" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gan": "7783320001001635", + "gan_source": "SQUARE", + "id": "gftc:6944163553804e439d89adb47caf806a", + "state": "ACTIVE", + "type": "DIGITAL" + } + } + }, + "RetrieveGiftCardFromNonceRequest": { + "type": "object", + "description": "A request to retrieve a gift card by using a payment token.", + "x-release-status": "PUBLIC", + "required": [ + "nonce" + ], + "properties": { + "nonce": { + "type": "string", + "description": "The payment token of the gift card to retrieve. Payment tokens are generated by the \nWeb Payments SDK or In-App Payments SDK.", + "minLength": 1 + } + }, + "example": { + "nonce": "cnon:7783322135245171" + } + }, + "RetrieveGiftCardFromNonceResponse": { + "type": "object", + "description": "A response that contains a `GiftCard` object. If the request resulted in errors, \nthe response contains a set of `Error` objects.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The retrieved gift card." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 5000, + "currency": "USD" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gan": "7783320001001635", + "gan_source": "SQUARE", + "id": "gftc:6944163553804e439d89adb47caf806a", + "state": "ACTIVE", + "type": "DIGITAL" + } + } + }, + "RetrieveGiftCardResponse": { + "type": "object", + "description": "A response that contains a `GiftCard`. The response might contain a set of `Error` objects\nif the request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card retrieved." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 1000, + "currency": "USD" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gan": "7783320001001635", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "ACTIVE", + "type": "DIGITAL" + } + } + }, + "RetrieveInventoryAdjustmentResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "adjustment": { + "$ref": "#/components/schemas/InventoryAdjustment", + "description": "The requested [InventoryAdjustment](entity:InventoryAdjustment)." + } + }, + "example": { + "adjustment": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-17T13:02:15.142Z", + "from_state": "IN_STOCK", + "id": "UDMOEO78BG6GYWA2XDRYX3KB", + "location_id": "C6W5YS5QM06F5", + "occurred_at": "2016-11-16T25:44:22.837Z", + "quantity": "7", + "reference_id": "4a366069-4096-47a2-99a5-0084ac879509", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "team_member_id": "LRK57NSQ5X7PUD05", + "to_state": "SOLD", + "total_price_money": { + "amount": 4550, + "currency": "USD" + } + }, + "errors": [] + } + }, + "RetrieveInventoryChangesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "changes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryChange" + }, + "description": "The set of inventory changes for the requested object and locations." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "changes": [ + { + "adjustment": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-16T22:25:24.878Z", + "from_state": "IN_STOCK", + "id": "OJKJIUANKLMLQANZADNPLKAD", + "location_id": "C6W5YS5QM06F5", + "occurred_at": "2016-11-16T22:25:24.878Z", + "quantity": "3", + "reference_id": "d8207693-168f-4b44-a2fd-a7ff533ddd26", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "team_member_id": "AV7YRCGI2H1J5NQ8E1XIZCNA", + "to_state": "SOLD", + "total_price_money": { + "amount": 5000, + "currency": "USD" + }, + "transaction_id": "5APV6JYK1SNCZD11AND2RX1Z" + }, + "type": "ADJUSTMENT" + } + ], + "errors": [] + } + }, + "RetrieveInventoryCountResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "counts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryCount" + }, + "description": "The current calculated inventory counts for the requested object and\nlocations." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "counts": [ + { + "calculated_at": "2016-11-16T22:28:01.223Z", + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "location_id": "C6W5YS5QM06F5", + "quantity": "22", + "state": "IN_STOCK" + } + ], + "errors": [] + } + }, + "RetrieveInventoryPhysicalCountResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "count": { + "$ref": "#/components/schemas/InventoryPhysicalCount", + "description": "The requested [InventoryPhysicalCount](entity:InventoryPhysicalCount)." + } + }, + "example": { + "count": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-16T22:25:24.878Z", + "id": "ANZADNPLKADOJKJIUANKLMLQ", + "location_id": "C6W5YS5QM06F5", + "occurred_at": "2016-11-16T22:25:24.878Z", + "quantity": "15", + "reference_id": "f857ec37-f9a0-4458-8e23-5b5e0bea4e53", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "state": "IN_STOCK", + "team_member_id": "LRK57NSQ5X7PUD05" + }, + "errors": [] + } + }, + "RetrieveInventoryTransferResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "transfer": { + "$ref": "#/components/schemas/InventoryTransfer", + "description": "The requested [InventoryTransfer](entity:InventoryTransfer)." + } + }, + "example": { + "errors": [], + "transfer": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-17T13:02:15.142Z", + "from_location_id": "C6W5YS5QM06F5", + "id": "UDMOEO78BG6GYWA2XDRYX3KB", + "occurred_at": "2016-11-16T25:44:22.837Z", + "quantity": "7", + "reference_id": "4a366069-4096-47a2-99a5-0084ac879509", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "state": "IN_STOCK", + "team_member_id": "LRK57NSQ5X7PUD05", + "to_location_id": "59TNP9SA8VGDA" + } + } + }, + "RetrieveJobResponse": { + "type": "object", + "description": "Represents a [RetrieveJob](api-endpoint:Team-RetrieveJob) response. Either `job` or `errors`\nis present in the response.", + "x-release-status": "BETA", + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The retrieved job." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "job": { + "created_at": "2021-06-11T22:55:45Z", + "id": "1yJlHapkseYnNPETIU1B", + "is_tip_eligible": true, + "title": "Cashier 1", + "updated_at": "2021-06-11T22:55:45Z", + "version": 2 + } + } + }, + "RetrieveLocationBookingProfileResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "location_booking_profile": { + "$ref": "#/components/schemas/LocationBookingProfile", + "description": "The requested location booking profile." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "errors": [], + "location_booking_profile": { + "booking_enabled": true, + "booking_site_url": "https://square.site/book/L3HETDGYQ4A2C/prod-business", + "location_id": "L3HETDGYQ4A2C" + } + } + }, + "RetrieveLocationCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [RetrieveLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The retrieved custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-12-02T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "RetrieveLocationCustomAttributeResponse": { + "type": "object", + "description": "Represents a [RetrieveLocationCustomAttribute](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The retrieved custom attribute. If `with_definition` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-01-09T19:02:58.647Z", + "key": "bestseller", + "updated_at": "2023-01-09T19:21:04.551Z", + "value": "hot cocoa", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "RetrieveLocationResponse": { + "type": "object", + "description": "Defines the fields that the [RetrieveLocation](api-endpoint:Locations-RetrieveLocation)\nendpoint returns in a response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "location": { + "$ref": "#/components/schemas/Location", + "description": "The requested location." + } + }, + "example": { + "location": { + "address": { + "address_line_1": "123 Main St", + "administrative_district_level_1": "CA", + "country": "US", + "locality": "San Francisco", + "postal_code": "94114" + }, + "business_name": "Jet Fuel Coffee", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ], + "country": "US", + "created_at": "2016-09-19T17:33:12Z", + "currency": "USD", + "id": "18YC4JDH91E1H", + "language_code": "en-US", + "merchant_id": "3MYCJG5GVYQ8Q", + "name": "Grant Park", + "phone_number": "+1 650-354-7217", + "status": "ACTIVE", + "timezone": "America/Los_Angeles" + } + } + }, + "RetrieveLocationSettingsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "location_settings": { + "$ref": "#/components/schemas/CheckoutLocationSettings", + "description": "The location settings." + } + }, + "example": { + "location_settings": { + "branding": { + "button_color": "#ffffff", + "button_shape": "ROUNDED", + "header_type": "FRAMED_LOGO" + }, + "customer_notes_enabled": true, + "location_id": "LOCATION_ID_1", + "policies": [ + { + "description": "This is my Return Policy", + "title": "Return Policy", + "uid": "POLICY_ID_1" + } + ], + "tipping": { + "default_percent": 15, + "default_whole_amount_money": { + "amount": 100, + "currency": "USD" + }, + "percentages": [ + 10, + 15, + 20 + ], + "smart_tipping_enabled": true, + "whole_amounts": [ + { + "amount": 1000, + "currency": "USD" + }, + { + "amount": 1500, + "currency": "USD" + }, + { + "amount": 2000, + "currency": "USD" + } + ] + }, + "updated_at": "2022-06-16T22:25:35Z" + } + } + }, + "RetrieveLoyaltyAccountResponse": { + "type": "object", + "description": "A response that includes the loyalty account.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The loyalty account." + } + }, + "example": { + "loyalty_account": { + "balance": 10, + "created_at": "2020-05-08T21:44:32Z", + "customer_id": "Q8002FAM9V1EZ0ADB2T5609X6NET1H0", + "id": "79b807d2-d786-46a9-933b-918028d7a8c5", + "lifetime_points": 20, + "mapping": { + "created_at": "2020-05-08T21:44:32Z", + "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234" + }, + "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "updated_at": "2020-05-08T21:44:32Z" + } + } + }, + "RetrieveLoyaltyProgramResponse": { + "type": "object", + "description": "A response that contains the loyalty program.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "program": { + "$ref": "#/components/schemas/LoyaltyProgram", + "description": "The loyalty program that was requested." + } + }, + "example": { + "program": { + "accrual_rules": [ + { + "accrual_type": "SPEND", + "points": 1, + "spend_data": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "excluded_category_ids": [ + "7ZERJKO5PVYXCVUHV2JCZ2UG", + "FQKAOJE5C4FIMF5A2URMLW6V" + ], + "excluded_item_variation_ids": [ + "CBZXBUVVTYUBZGQO44RHMR6B", + "EDILT24Z2NISEXDKGY6HP7XV" + ], + "tax_mode": "BEFORE_TAX" + } + } + ], + "created_at": "2020-04-20T16:55:11Z", + "id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "location_ids": [ + "P034NEENMD09F" + ], + "reward_tiers": [ + { + "created_at": "2020-04-20T16:55:11Z", + "id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "name": "10% off entire sale", + "points": 10, + "pricing_rule_reference": { + "catalog_version": "1605486402527", + "object_id": "74C4JSHESNLTB2A7ITO5HO6F" + } + } + ], + "status": "ACTIVE", + "terminology": { + "one": "Point", + "other": "Points" + }, + "updated_at": "2020-05-01T02:00:02Z" + } + } + }, + "RetrieveLoyaltyPromotionResponse": { + "type": "object", + "description": "Represents a [RetrieveLoyaltyPromotionPromotions](api-endpoint:Loyalty-RetrieveLoyaltyPromotion) response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The retrieved loyalty promotion." + } + }, + "example": { + "loyalty_promotion": { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ] + }, + "created_at": "2022-08-16T08:38:54Z", + "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", + "incentive": { + "points_multiplier_data": { + "multiplier": "3.000", + "points_multiplier": 3 + }, + "type": "POINTS_MULTIPLIER" + }, + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Tuesday Happy Hour Promo", + "qualifying_item_variation_ids": [ + "CJ3RYL56ITAKMD4VRCM7XERS", + "AT3RYLR3TUA9C34VRCB7X5RR" + ], + "status": "ACTIVE", + "trigger_limit": { + "interval": "DAY", + "times": 1 + }, + "updated_at": "2022-08-16T08:38:54Z" + } + } + }, + "RetrieveLoyaltyRewardResponse": { + "type": "object", + "description": "A response that includes the loyalty reward.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "reward": { + "$ref": "#/components/schemas/LoyaltyReward", + "description": "The loyalty reward retrieved." + } + }, + "example": { + "reward": { + "created_at": "2020-05-08T21:55:42Z", + "id": "9f18ac21-233a-31c3-be77-b45840f5a810", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "points": 10, + "redeemed_at": "2020-05-08T21:56:00Z", + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "REDEEMED", + "updated_at": "2020-05-08T21:56:00Z" + } + } + }, + "RetrieveMerchantCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [RetrieveMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The retrieved custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2023-05-05T19:06:36.559Z", + "description": "This is the other name this merchant goes by.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2023-05-05T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "RetrieveMerchantCustomAttributeResponse": { + "type": "object", + "description": "Represents a [RetrieveMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The retrieved custom attribute. If `with_definition` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-05-06T19:02:58.647Z", + "key": "alternative_seller_name", + "updated_at": "2023-05-06T19:21:04.551Z", + "value": "Ultimate Sneaker Store", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "RetrieveMerchantResponse": { + "type": "object", + "description": "The response object returned by the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "merchant": { + "$ref": "#/components/schemas/Merchant", + "description": "The requested `Merchant` object." + } + }, + "example": { + "merchant": { + "business_name": "Apple A Day", + "country": "US", + "created_at": "2021-12-10T19:25:52.484Z", + "currency": "USD", + "id": "DM7VKY8Q63GNP", + "language_code": "en-US", + "main_location_id": "9A65CGC72ZQG1", + "status": "ACTIVE" + } + } + }, + "RetrieveMerchantSettingsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "merchant_settings": { + "$ref": "#/components/schemas/CheckoutMerchantSettings", + "description": "The merchant settings." + } + }, + "example": { + "merchant_settings": { + "merchant_id": "MERCHANT_ID", + "payment_methods": { + "afterpay_clearpay": { + "enabled": true, + "item_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + }, + "order_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + } + }, + "apple_pay": { + "enabled": true + }, + "cash_app_pay": { + "enabled": true + }, + "google_pay": { + "enabled": true + } + }, + "updated_at": "2022-06-16T22:25:35Z" + } + } + }, + "RetrieveOrderCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from getting an order custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The retrieved custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-10-06T16:53:23.141Z", + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-10-06T16:53:23.141Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "RetrieveOrderCustomAttributeResponse": { + "type": "object", + "description": "Represents a response from getting an order custom attribute.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The retrieved custom attribute. If `with_definition` was set to `true` in the request, the custom attribute definition is returned in the `definition field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-11-22T21:27:33.429Z", + "key": "cover-count", + "updated_at": "2022-11-22T21:28:35.721Z", + "value": "6", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "RetrieveOrderResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The requested order." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "order": { + "created_at": "2020-05-18T16:30:49.614Z", + "discounts": [ + { + "applied_money": { + "amount": 550, + "currency": "USD" + }, + "name": "50% Off", + "percentage": "50", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "zGsRZP69aqSSR9lq9euSPB" + } + ], + "id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "line_items": [ + { + "applied_discounts": [ + { + "applied_money": { + "amount": 250, + "currency": "USD" + }, + "discount_uid": "zGsRZP69aqSSR9lq9euSPB", + "uid": "9zr9S4dxvPAixvn0lpa1VC" + } + ], + "base_price_money": { + "amount": 500, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 500, + "currency": "USD" + }, + "name": "Item 1", + "quantity": "1", + "total_discount_money": { + "amount": 250, + "currency": "USD" + }, + "total_money": { + "amount": 250, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "ULkg0tQTRK2bkU9fNv3IJD", + "variation_total_price_money": { + "amount": 500, + "currency": "USD" + } + }, + { + "applied_discounts": [ + { + "applied_money": { + "amount": 300, + "currency": "USD" + }, + "discount_uid": "zGsRZP69aqSSR9lq9euSPB", + "uid": "qa8LwwZK82FgSEkQc2HYVC" + } + ], + "base_price_money": { + "amount": 300, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 600, + "currency": "USD" + }, + "name": "Item 2", + "quantity": "2", + "total_discount_money": { + "amount": 300, + "currency": "USD" + }, + "total_money": { + "amount": 300, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "mumY8Nun4BC5aKe2yyx5a", + "variation_total_price_money": { + "amount": 600, + "currency": "USD" + } + } + ], + "location_id": "D7AVYMEAPJ3A3", + "net_amounts": { + "discount_money": { + "amount": 550, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 0, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 550, + "currency": "USD" + } + }, + "state": "OPEN", + "total_discount_money": { + "amount": 550, + "currency": "USD" + }, + "total_money": { + "amount": 550, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2020-05-18T16:30:49.614Z", + "version": 1 + } + } + }, + "RetrievePaymentLinkResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "payment_link": { + "$ref": "#/components/schemas/PaymentLink", + "description": "The payment link that is retrieved." + } + }, + "example": { + "payment_link": { + "created_at": "2022-04-26T00:10:29Z", + "id": "LLO5Q3FRCFICDB4B", + "long_url": "https://checkout.square.site/EXAMPLE", + "order_id": "4uKASDATqSd1QQ9jV86sPhMdVEbSJc4F", + "url": "https://square.link/u/EXAMPLE", + "version": 1 + } + } + }, + "RetrieveScheduledShiftResponse": { + "type": "object", + "description": "Represents a [RetrieveScheduledShift](api-endpoint:Labor-RetrieveScheduledShift) response.\nEither `scheduled_shift` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The requested scheduled shift." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "scheduled_shift": { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-03-25T13:18:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Don't forget to prep the vegetables", + "start_at": "2019-03-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "updated_at": "2019-02-25T03:11:15-05:00", + "version": 2 + } + } + }, + "RetrieveSnippetResponse": { + "type": "object", + "description": "Represents a `RetrieveSnippet` response. The response can include either `snippet` or `errors`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "snippet": { + "$ref": "#/components/schemas/Snippet", + "description": "The retrieved snippet." + } + }, + "example": { + "snippet": { + "content": "\u003cscript\u003evar js = 1;\u003c/script\u003e", + "created_at": "2021-03-11T25:40:09.000000Z", + "id": "snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7", + "site_id": "site_278075276488921835", + "updated_at": "2021-03-11T25:40:09.000000Z" + } + } + }, + "RetrieveSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The subscription retrieved." + } + }, + "example": { + "subscription": { + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "charged_through_date": "2023-11-20", + "created_at": "2022-07-27T21:53:10Z", + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "id": "8151fc89-da15-4eb9-a685-1a70883cebfc", + "invoice_ids": [ + "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA" + ], + "location_id": "S8GWD5R9QB376", + "paid_until_date": "2024-08-01", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "price_override_money": { + "amount": 25000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "start_date": "2022-07-27", + "status": "ACTIVE", + "timezone": "America/Los_Angeles" + } + } + }, + "RetrieveTeamMemberBookingProfileResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "team_member_booking_profile": { + "$ref": "#/components/schemas/TeamMemberBookingProfile", + "description": "The returned team member booking profile." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "errors": [], + "team_member_booking_profile": { + "display_name": "Sandbox Staff", + "is_bookable": true, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + } + }, + "RetrieveTeamMemberResponse": { + "type": "object", + "description": "Represents a response from a retrieve request containing a `TeamMember` object or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The successfully retrieved `TeamMember` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "GA2Y9HSJ8KRYT", + "YSGH2WBKG94QZ" + ] + }, + "created_at": "2021-06-11T22:55:45Z", + "email_address": "joe_doe@example.com", + "family_name": "Doe", + "given_name": "Joe", + "id": "1yJlHapkseYnNPETIU1B", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "updated_at": "2021-06-15T17:38:05Z", + "wage_setting": { + "created_at": "2021-06-11T22:55:45Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 1443, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "1yJlHapkseYnNPETIU1B", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + } + } + }, + "RetrieveTimecardResponse": { + "type": "object", + "description": "A response to a request to get a `Timecard`. The response contains\nthe requested `Timecard` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The requested `Timecard`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "timecard": { + "breaks": [ + { + "break_type_id": "92EPDRQKJ5088", + "end_at": "2019-02-23T20:00:00-05:00", + "expected_duration": "PT1H", + "id": "M9BBKEPQAQD2T", + "is_paid": true, + "name": "Lunch Break", + "start_at": "2019-02-23T19:00:00-05:00" + } + ], + "created_at": "2019-02-27T00:12:12Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-02-23T21:00:00-05:00", + "id": "T35HMQSN89SV4", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-02-23T18:00:00-05:00", + "status": "CLOSED", + "team_member_id": "D71KRMQof6cXGUW0aAv7", + "timezone": "America/New_York", + "updated_at": "2019-02-27T00:12:12Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1457, + "currency": "USD" + }, + "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", + "tip_eligible": true, + "title": "Cashier" + } + } + } + }, + "RetrieveTokenStatusResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `RetrieveTokenStatus` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of scopes associated with an access token." + }, + "expires_at": { + "type": "string", + "description": "The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never expires." + }, + "client_id": { + "type": "string", + "description": "The Square-issued application ID associated with the access token. This is the same application ID used to obtain the token.", + "maxLength": 191 + }, + "merchant_id": { + "type": "string", + "description": "The ID of the authorizing merchant's business.", + "minLength": 8, + "maxLength": 191 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": " Any errors that occurred during the request." + } + }, + "example": { + "client_id": "CLIENT_ID", + "expires_at": "2022-10-14T14:44:00Z", + "merchant_id": "MERCHANT_ID", + "scopes": [ + "PAYMENTS_READ", + "PAYMENTS_WRITE" + ] + } + }, + "RetrieveTransactionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RetrieveTransaction](api-endpoint:Transactions-RetrieveTransaction) endpoint.\n\nOne of `errors` or `transaction` is present in a given response (never both).", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "transaction": { + "$ref": "#/components/schemas/Transaction", + "description": "The requested transaction." + } + }, + "example": { + "transaction": { + "created_at": "2016-03-10T22:57:56Z", + "id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "location_id": "18YC4JDH91E1H", + "product": "EXTERNAL_API", + "reference_id": "some optional reference id", + "tenders": [ + { + "additional_recipients": [ + { + "amount_money": { + "amount": 20, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "amount_money": { + "amount": 5000, + "currency": "USD" + }, + "card_details": { + "card": { + "card_brand": "VISA", + "last_4": "1111" + }, + "entry_method": "KEYED", + "status": "CAPTURED" + }, + "created_at": "2016-03-10T22:57:56Z", + "id": "MtZRYYdDrYNQbOvV7nbuBvMF", + "location_id": "18YC4JDH91E1H", + "note": "some optional note", + "processing_fee_money": { + "amount": 138, + "currency": "USD" + }, + "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "type": "CARD" + } + ] + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.csharp", + "java": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.java", + "javascript": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.javascript", + "php": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.php", + "python": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.python", + "ruby": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.ruby" + } + }, + "RetrieveVendorResponse": { + "type": "object", + "description": "Represents an output from a call to [RetrieveVendor](api-endpoint:Vendors-RetrieveVendor).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered when the request fails." + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The successfully retrieved [Vendor](entity:Vendor) object." + } + }, + "example": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "a vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 1 + } + } + }, + "RetrieveWageSettingResponse": { + "type": "object", + "description": "Represents a response from a retrieve request containing the specified `WageSetting` object or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "wage_setting": { + "$ref": "#/components/schemas/WageSetting", + "description": "The successfully retrieved `WageSetting` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "wage_setting": { + "created_at": "2020-06-11T23:01:21+00:00", + "is_overtime_exempt": false, + "job_assignments": [ + { + "annual_rate": { + "amount": 4500000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 2164, + "currency": "USD" + }, + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + } + ], + "team_member_id": "1yJlHapkseYnNPETIU1B", + "updated_at": "2020-06-11T23:01:21+00:00", + "version": 1 + } + } + }, + "RetrieveWebhookSubscriptionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RetrieveWebhookSubscription](api-endpoint:WebhookSubscriptions-RetrieveWebhookSubscription) endpoint.\n\nNote: if there are errors processing the request, the [Subscription](entity:WebhookSubscription) will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/WebhookSubscription", + "description": "The requested [Subscription](entity:WebhookSubscription)." + } + }, + "example": { + "subscription": { + "api_version": "2021-12-15", + "created_at": "2022-01-10 23:29:48 +0000 UTC", + "enabled": true, + "event_types": [ + "payment.created", + "payment.updated" + ], + "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", + "name": "Example Webhook Subscription", + "notification_url": "https://example-webhook-url.com", + "signature_key": "1k9bIJKCeTmSQwyagtNRLg", + "updated_at": "2022-01-10 23:29:48 +0000 UTC" + } + } + }, + "RevokeTokenRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "client_id": { + "type": "string", + "description": "The Square-issued ID for your application, which is available on the **OAuth** page in the\n[Developer Dashboard](https://developer.squareup.com/apps).", + "maxLength": 191, + "nullable": true + }, + "access_token": { + "type": "string", + "description": "The access token of the merchant whose token you want to revoke.\nDo not provide a value for `merchant_id` if you provide this parameter.", + "minLength": 2, + "maxLength": 1024, + "nullable": true + }, + "merchant_id": { + "type": "string", + "description": "The ID of the merchant whose token you want to revoke.\nDo not provide a value for `access_token` if you provide this parameter.", + "nullable": true + }, + "revoke_only_access_token": { + "type": "boolean", + "description": "If `true`, terminate the given single access token, but do not\nterminate the entire authorization.\nDefault: `false`", + "nullable": true + } + }, + "example": { + "access_token": "ACCESS_TOKEN", + "client_id": "CLIENT_ID" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/RevokeToken/RevokeTokenRequest.csharp", + "java": "/sdk_samples/RevokeToken/RevokeTokenRequest.java", + "javascript": "/sdk_samples/RevokeToken/RevokeTokenRequest.javascript", + "php": "/sdk_samples/RevokeToken/RevokeTokenRequest.php", + "python": "/sdk_samples/RevokeToken/RevokeTokenRequest.python", + "ruby": "/sdk_samples/RevokeToken/RevokeTokenRequest.ruby" + } + }, + "RevokeTokenResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "success": { + "type": "boolean", + "description": "If the request is successful, this is `true`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "success": true + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/RevokeToken/RevokeTokenResponse.csharp", + "java": "/sdk_samples/RevokeToken/RevokeTokenResponse.java", + "javascript": "/sdk_samples/RevokeToken/RevokeTokenResponse.javascript", + "php": "/sdk_samples/RevokeToken/RevokeTokenResponse.php", + "python": "/sdk_samples/RevokeToken/RevokeTokenResponse.python", + "ruby": "/sdk_samples/RevokeToken/RevokeTokenResponse.ruby" + } + }, + "RiskEvaluation": { + "type": "object", + "description": "Represents fraud risk information for the associated payment.\n\nWhen you take a payment through Square's Payments API (using the `CreatePayment`\nendpoint), Square evaluates it and assigns a risk level to the payment. Sellers\ncan use this information to determine the course of action (for example,\nprovide the goods/services or refund the payment).", + "x-release-status": "BETA", + "required": [ + "status" + ], + "properties": { + "created_at": { + "type": "string", + "description": "The timestamp when payment risk was evaluated, in RFC 3339 format.", + "readOnly": true + }, + "risk_level": { + "$ref": "#/components/schemas/RiskEvaluationRiskLevel", + "description": "The risk level associated with the payment\nSee [RiskEvaluationRiskLevel](#type-riskevaluationrisklevel) for possible values", + "nullable": true + } + } + }, + "RiskEvaluationRiskLevel": { + "type": "string", + "enum": [ + "PENDING", + "NORMAL", + "MODERATE", + "HIGH" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "Indicates Square is still evaluating the payment." + }, + { + "name": "NORMAL", + "description": "Indicates payment risk is within the normal range." + }, + { + "name": "MODERATE", + "description": "Indicates elevated risk level associated with the payment." + }, + { + "name": "HIGH", + "description": "Indicates significantly elevated risk level with the payment." + } + ], + "x-release-status": "BETA" + }, + "SaveCardOptions": { + "type": "object", + "description": "Describes save-card action fields.", + "x-release-status": "BETA", + "required": [ + "customer_id" + ], + "properties": { + "customer_id": { + "type": "string", + "description": "The square-assigned ID of the customer linked to the saved card." + }, + "card_id": { + "type": "string", + "description": "The id of the created card-on-file.", + "maxLength": 64, + "readOnly": true + }, + "reference_id": { + "type": "string", + "description": "An optional user-defined reference ID that can be used to associate\nthis `Card` to another entity in an external system. For example, a customer\nID generated by a third-party system.", + "maxLength": 128, + "nullable": true + } + } + }, + "ScheduledShift": { + "type": "object", + "description": "Represents a specific time slot in a work schedule. This object is used to manage the\nlifecycle of a scheduled shift from the draft to published state. A scheduled shift contains\nthe latest draft shift details and current published shift details.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "**Read only** The Square-issued ID of the scheduled shift.", + "maxLength": 255 + }, + "draft_shift_details": { + "$ref": "#/components/schemas/ScheduledShiftDetails", + "description": "The latest draft shift details for the scheduled shift. Draft shift details are used to\nstage and manage shifts before publishing. This field is always present.", + "nullable": true + }, + "published_shift_details": { + "$ref": "#/components/schemas/ScheduledShiftDetails", + "description": "The current published (public) shift details for the scheduled shift. This field is\npresent only if the shift was published.", + "readOnly": true + }, + "version": { + "type": "integer", + "description": "**Read only** The current version of the scheduled shift, which is incremented with each update.\nThis field is used for [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol to ensure that requests don't overwrite data from another request." + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the scheduled shift was created, in RFC 3339 format presented as UTC.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the scheduled shift was last updated, in RFC 3339 format presented as UTC.", + "readOnly": true + } + } + }, + "ScheduledShiftDetails": { + "type": "object", + "description": "Represents shift details for draft and published versions of a [scheduled shift](entity:ScheduledShift),\nsuch as job ID, team member assignment, and start and end times.", + "x-release-status": "BETA", + "properties": { + "team_member_id": { + "type": "string", + "description": "The ID of the [team member](entity:TeamMember) scheduled for the shift.", + "maxLength": 255, + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location) the shift is scheduled for.", + "maxLength": 255, + "nullable": true + }, + "job_id": { + "type": "string", + "description": "The ID of the [job](entity:Job) the shift is scheduled for.", + "nullable": true + }, + "start_at": { + "type": "string", + "description": "The start time of the shift, in RFC 3339 format in the time zone \u0026plus;\noffset of the shift location specified in `location_id`. Precision up to the minute\nis respected; seconds are truncated.", + "nullable": true + }, + "end_at": { + "type": "string", + "description": "The end time for the shift, in RFC 3339 format in the time zone \u0026plus;\noffset of the shift location specified in `location_id`. Precision up to the minute\nis respected; seconds are truncated.", + "nullable": true + }, + "notes": { + "type": "string", + "description": "Optional notes for the shift.", + "maxLength": 1000, + "nullable": true + }, + "is_deleted": { + "type": "boolean", + "description": "Indicates whether the draft shift version is deleted. If set to `true` when the shift\nis published, the entire scheduled shift (including the published shift) is deleted and\ncannot be accessed using any endpoint.", + "nullable": true + }, + "timezone": { + "type": "string", + "description": "The time zone of the shift location, calculated based on the `location_id`. This field\nis provided for convenience.", + "readOnly": true + } + } + }, + "ScheduledShiftFilter": { + "type": "object", + "description": "Defines filter criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts)\nrequest. Multiple filters in a query are combined as an `AND` operation.", + "x-release-status": "BETA", + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Return shifts for the specified locations. When omitted, shifts for all\nlocations are returned. If needed, call [ListLocations](api-endpoint:Locations-ListLocations)\nto get location IDs.", + "nullable": true + }, + "start": { + "$ref": "#/components/schemas/TimeRange", + "description": "Return shifts whose `start_at` time is within the specified\ntime range (inclusive).", + "nullable": true + }, + "end": { + "$ref": "#/components/schemas/TimeRange", + "description": "Return shifts whose `end_at` time is within the specified\ntime range (inclusive).", + "nullable": true + }, + "workday": { + "$ref": "#/components/schemas/ScheduledShiftWorkday", + "description": "Return shifts based on a workday date range.", + "nullable": true + }, + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Return shifts assigned to specified team members. If needed, call\n[SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) to get team member IDs.\n\nTo return only the shifts assigned to the specified team members, include the\n`assignment_status` filter in the query. Otherwise, all unassigned shifts are\nreturned along with shifts assigned to the specified team members.", + "nullable": true + }, + "assignment_status": { + "$ref": "#/components/schemas/ScheduledShiftFilterAssignmentStatus", + "description": "Return shifts based on whether a team member is assigned. A shift is\nassigned if the `team_member_id` field is populated in the `draft_shift_details`\nor `published_shift details` field of the shift.\n\nTo return only draft or published shifts, include the `scheduled_shift_statuses`\nfilter in the query.\nSee [ScheduledShiftFilterAssignmentStatus](#type-scheduledshiftfilterassignmentstatus) for possible values", + "nullable": true + }, + "scheduled_shift_statuses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScheduledShiftFilterScheduledShiftStatus" + }, + "description": "Return shifts based on the draft or published status of the shift.\nA shift is published if the `published_shift_details` field is present.\n\nNote that shifts with `draft_shift_details.is_deleted` set to `true` are ignored\nwith the `DRAFT` filter.\nSee [ScheduledShiftFilterScheduledShiftStatus](#type-scheduledshiftfilterscheduledshiftstatus) for possible values", + "nullable": true + } + } + }, + "ScheduledShiftFilterAssignmentStatus": { + "type": "string", + "enum": [ + "ASSIGNED", + "UNASSIGNED" + ], + "x-enum-elements": [ + { + "name": "ASSIGNED", + "description": "The shift is assigned to a team member." + }, + { + "name": "UNASSIGNED", + "description": "The shift isn't assigned to a team member." + } + ], + "description": "Defines valid values for the `assignment_status` filter in a\n[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request.\nAssignment status is based on the `draft_shift_details.team_member_id` and\n`published_shift_details.team_member_id` fields of the scheduled shift.", + "x-release-status": "BETA" + }, + "ScheduledShiftFilterScheduledShiftStatus": { + "type": "string", + "enum": [ + "DRAFT", + "PUBLISHED" + ], + "x-enum-elements": [ + { + "name": "DRAFT", + "description": "The scheduled shift has never been published or its draft details were\nupdated after it was published. This means that the shift has no `published_shift_details`\nfield or that `draft_shift_details` has different settings than `published_shift_details`." + }, + { + "name": "PUBLISHED", + "description": "The scheduled shift was published. This means that the shift has a\n`published_shift_details` field." + } + ], + "description": "Defines valid values for the `scheduled_shift_statuses` filter in a\n[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request.", + "x-release-status": "BETA" + }, + "ScheduledShiftNotificationAudience": { + "type": "string", + "enum": [ + "ALL", + "AFFECTED", + "NONE" + ], + "x-enum-elements": [ + { + "name": "ALL", + "description": "Notify all active team members. Note that republishing an unchanged\nshift with this setting resends the notification." + }, + { + "name": "AFFECTED", + "description": "Notify the team member assigned to the shift. If the shift assignment\nchanges, notify both the newly assigned and previously assigned team members." + }, + { + "name": "NONE", + "description": "Do not send a notification." + } + ], + "description": "Indicates whether Square sends an email notification to team members\nwhen a scheduled shift is published and which team members receive the notification.", + "x-release-status": "BETA" + }, + "ScheduledShiftQuery": { + "type": "object", + "description": "Represents filter and sort criteria for the `query` field in a\n[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request.", + "x-release-status": "BETA", + "properties": { + "filter": { + "$ref": "#/components/schemas/ScheduledShiftFilter", + "description": "Filtering options for the query.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/ScheduledShiftSort", + "description": "Sorting options for the query.", + "nullable": true + } + } + }, + "ScheduledShiftSort": { + "type": "object", + "description": "Defines sort criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts)\nrequest.", + "x-release-status": "BETA", + "properties": { + "field": { + "$ref": "#/components/schemas/ScheduledShiftSortField", + "description": "The field to sort on. The default value is `START_AT`.\nSee [ScheduledShiftSortField](#type-scheduledshiftsortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order in which results are returned. The default value is `ASC`.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "ScheduledShiftSortField": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "Sort by the start time of the shift." + }, + { + "name": "END_AT", + "description": "Sort by the end time of the shift." + }, + { + "name": "CREATED_AT", + "description": "Sort by the creation date of the shift." + }, + { + "name": "UPDATED_AT", + "description": "Sort by the last updated date of the shift." + } + ], + "description": "Defines valid values for the `field` sort setting in a\n[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request.", + "x-release-status": "BETA" + }, + "ScheduledShiftWorkday": { + "type": "object", + "description": "A `ScheduledShift` search query filter parameter that sets a range of days that\na `Shift` must start or end in before passing the filter condition.", + "x-release-status": "BETA", + "properties": { + "date_range": { + "$ref": "#/components/schemas/DateRange", + "description": "Dates for fetching the scheduled shifts.", + "nullable": true + }, + "match_scheduled_shifts_by": { + "$ref": "#/components/schemas/ScheduledShiftWorkdayMatcher", + "description": "The strategy on which the dates are applied.\nSee [ScheduledShiftWorkdayMatcher](#type-scheduledshiftworkdaymatcher) for possible values", + "nullable": true + }, + "default_timezone": { + "type": "string", + "description": "Location-specific timezones convert workdays to datetime filters.\nEvery location included in the query must have a timezone or this field\nmust be provided as a fallback. Format: the IANA timezone database\nidentifier for the relevant timezone.", + "nullable": true + } + } + }, + "ScheduledShiftWorkdayMatcher": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "INTERSECTION" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "All shifts that start on or after the specified workday" + }, + { + "name": "END_AT", + "description": "All shifts that end on or before the specified workday" + }, + { + "name": "INTERSECTION", + "description": "All shifts that start between the start and end workdays (inclusive)" + } + ], + "description": "Defines the logic used to apply a workday filter.", + "x-release-status": "BETA" + }, + "SearchAvailabilityFilter": { + "type": "object", + "description": "A query filter to search for buyer-accessible availabilities by.", + "x-release-status": "PUBLIC", + "required": [ + "start_at_range" + ], + "properties": { + "start_at_range": { + "$ref": "#/components/schemas/TimeRange", + "description": "The query expression to search for buy-accessible availabilities with their starting times falling within the specified time range.\nThe time range must be at least 24 hours and at most 32 days long.\nFor waitlist availabilities, the time range can be 0 or more up to 367 days long." + }, + "location_id": { + "type": "string", + "description": "The query expression to search for buyer-accessible availabilities with their location IDs matching the specified location ID.\nThis query expression cannot be set if `booking_id` is set.", + "maxLength": 32, + "nullable": true + }, + "segment_filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SegmentFilter" + }, + "description": "The query expression to search for buyer-accessible availabilities matching the specified list of segment filters.\nIf the size of the `segment_filters` list is `n`, the search returns availabilities with `n` segments per availability.\n\nThis query expression cannot be set if `booking_id` is set.", + "nullable": true + }, + "booking_id": { + "type": "string", + "description": "The query expression to search for buyer-accessible availabilities for an existing booking by matching the specified `booking_id` value.\nThis is commonly used to reschedule an appointment.\nIf this expression is set, the `location_id` and `segment_filters` expressions cannot be set.", + "maxLength": 36, + "nullable": true + } + } + }, + "SearchAvailabilityQuery": { + "type": "object", + "description": "The query used to search for buyer-accessible availabilities of bookings.", + "x-release-status": "PUBLIC", + "required": [ + "filter" + ], + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchAvailabilityFilter", + "description": "The query filter to search for buyer-accessible availabilities of existing bookings." + } + } + }, + "SearchAvailabilityRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "query" + ], + "properties": { + "query": { + "$ref": "#/components/schemas/SearchAvailabilityQuery", + "description": "Query conditions used to filter buyer-accessible booking availabilities." + } + } + }, + "SearchAvailabilityResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "availabilities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Availability" + }, + "description": "List of appointment slots available for booking." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "availabilities": [ + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T13:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T13:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T14:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T14:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T15:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T15:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T16:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T09:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T09:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T10:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T10:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T11:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T11:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T12:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T12:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T13:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T13:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T14:00:00Z" + } + ], + "errors": [] + } + }, + "SearchCatalogItemsRequest": { + "type": "object", + "description": "Defines the request body for the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "text_filter": { + "type": "string", + "description": "The text filter expression to return items or item variations containing specified text in\nthe `name`, `description`, or `abbreviation` attribute value of an item, or in\nthe `name`, `sku`, or `upc` attribute value of an item variation." + }, + "category_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The category id query expression to return items containing the specified category IDs." + }, + "stock_levels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SearchCatalogItemsRequestStockLevel" + }, + "description": "The stock-level query expression to return item variations with the specified stock levels.\nSee [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) for possible values" + }, + "enabled_location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The enabled-location query expression to return items and item variations having specified enabled locations." + }, + "cursor": { + "type": "string", + "description": "The pagination token, returned in the previous response, used to fetch the next batch of pending results." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to return per page. The default value is 100.", + "maximum": 100 + }, + "sort_order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order to sort the results by item names. The default sort order is ascending (`ASC`).\nSee [SortOrder](#type-sortorder) for possible values" + }, + "product_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemProductType" + }, + "description": "The product types query expression to return items or item variations having the specified product types." + }, + "custom_attribute_filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeFilter" + }, + "description": "The customer-attribute filter to return items or item variations matching the specified\ncustom attribute expressions. A maximum number of 10 custom attribute expressions are supported in\na single call to the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint." + }, + "archived_state": { + "$ref": "#/components/schemas/ArchivedState", + "description": "The query filter to return not archived (`ARCHIVED_STATE_NOT_ARCHIVED`), archived (`ARCHIVED_STATE_ARCHIVED`), or either type (`ARCHIVED_STATE_ALL`) of items." + } + }, + "example": { + "category_ids": [ + "WINE_CATEGORY_ID" + ], + "custom_attribute_filters": [ + { + "bool_filter": true, + "custom_attribute_definition_id": "VEGAN_DEFINITION_ID" + }, + { + "custom_attribute_definition_id": "BRAND_DEFINITION_ID", + "string_filter": "Dark Horse" + }, + { + "key": "VINTAGE", + "number_filter": { + "max": 2018, + "min": 2017 + } + }, + { + "custom_attribute_definition_id": "VARIETAL_DEFINITION_ID", + "selection_ids_filter": "MERLOT_SELECTION_ID" + } + ], + "enabled_location_ids": [ + "ATL_LOCATION_ID" + ], + "limit": 100, + "product_types": [ + "REGULAR" + ], + "sort_order": "ASC", + "stock_levels": [ + "OUT", + "LOW" + ], + "text_filter": "red" + } + }, + "SearchCatalogItemsRequestStockLevel": { + "type": "string", + "enum": [ + "OUT", + "LOW" + ], + "x-enum-elements": [ + { + "name": "OUT", + "description": "The item inventory is empty." + }, + { + "name": "LOW", + "description": "The item inventory is low." + } + ], + "description": "Defines supported stock levels of the item inventory.", + "x-release-status": "PUBLIC" + }, + "SearchCatalogItemsResponse": { + "type": "object", + "description": "Defines the response body returned from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "Returned items matching the specified query expressions." + }, + "cursor": { + "type": "string", + "description": "Pagination token used in the next request to return more of the search result." + }, + "matched_variation_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids of returned item variations matching the specified query expression." + } + }, + "example": { + "items": [ + { + "custom_attribute_values": { + "BRAND": { + "custom_attribute_definition_id": "BRAND_DEFINITION_ID", + "key": "BRAND", + "name": "Brand", + "string_value": "Dark Horse", + "type": "STRING" + }, + "VARIETAL": { + "custom_attribute_definition_id": "VARIETAL_DEFINITION_ID", + "key": "VARIETAL", + "name": "Varietal", + "selection_uid_values": [ + "MERLOT_SELECTION_ID", + null + ], + "type": "SELECTION" + }, + "VINTAGE": { + "custom_attribute_definition_id": "EI7IJQDUKYSHULREPIPH6HNU", + "key": "VINTAGE", + "name": "Vintage", + "number_value": 2018, + "type": "NUMBER" + } + }, + "id": "GPOKJPTV2KDLVKCADJ7I77EZ", + "is_deleted": false, + "item_data": { + "description": "A nice red wine", + "is_archived": false, + "name": "Dark Horse Merlot 2018", + "product_type": "REGULAR", + "variations": [ + { + "id": "VBJNPHCOKDFECR6VU25WRJUD", + "is_deleted": false, + "item_variation_data": { + "item_id": "GPOKJPTV2KDLVKCADJ7I77EZ", + "name": "750 mL", + "ordinal": 0, + "price_money": { + "amount": 1000, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2020-06-18T17:55:56.646Z", + "version": 1592502956646 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2020-06-18T17:55:56.646Z", + "version": 1592502956646 + } + ], + "matched_variation_ids": [ + "VBJNPHCOKDFECR6VU25WRJUD" + ] + } + }, + "SearchCatalogObjectsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "cursor": { + "type": "string", + "description": "The pagination cursor returned in the previous response. Leave unset for an initial request.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + }, + "object_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObjectType" + }, + "description": "The desired set of object types to appear in the search results.\n\nIf this is unspecified, the operation returns objects of all the top level types at the version\nof the Square API used to make the request. Object types that are nested onto other object types\nare not included in the defaults.\n\nAt the current API version the default object types are:\nITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, \nPRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,\nSUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS.\n\nNote that if you wish for the query to return objects belonging to nested types (i.e., COMPONENT, IMAGE,\nITEM_OPTION_VAL, ITEM_VARIATION, or MODIFIER), you must explicitly include all the types of interest\nin this field." + }, + "include_deleted_objects": { + "type": "boolean", + "description": "If `true`, deleted objects will be included in the results. Defaults to `false`. Deleted objects will have their `is_deleted` field set to `true`. If `include_deleted_objects` is `true`, then the `include_category_path_to_root` request parameter must be `false`. Both properties cannot be `true` at the same time." + }, + "include_related_objects": { + "type": "boolean", + "description": "If `true`, the response will include additional objects that are related to the\nrequested objects. Related objects are objects that are referenced by object ID by the objects\nin the response. This is helpful if the objects are being fetched for immediate display to a user.\nThis process only goes one level deep. Objects referenced by the related objects will not be included.\nFor example:\n\nIf the `objects` field of the response contains a CatalogItem, its associated\nCatalogCategory objects, CatalogTax objects, CatalogImage objects and\nCatalogModifierLists will be returned in the `related_objects` field of the\nresponse. If the `objects` field of the response contains a CatalogItemVariation,\nits parent CatalogItem will be returned in the `related_objects` field of\nthe response.\n\nDefault value: `false`" + }, + "begin_time": { + "type": "string", + "description": "Return objects modified after this [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), in RFC 3339\nformat, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is exclusive - objects with a\ntimestamp equal to `begin_time` will not be included in the response." + }, + "query": { + "$ref": "#/components/schemas/CatalogQuery", + "description": "A query to be used to filter or sort the results. If no query is specified, the entire catalog will be returned." + }, + "limit": { + "type": "integer", + "description": "A limit on the number of results to be returned in a single page. The limit is advisory -\nthe implementation may return more or fewer results. If the supplied limit is negative, zero, or\nis higher than the maximum limit of 1,000, it will be ignored." + }, + "include_category_path_to_root": { + "type": "boolean", + "description": "Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned in the response payload. If `include_category_path_to_root` is `true`, then the `include_deleted_objects` request parameter must be `false`. Both properties cannot be `true` at the same time." + } + }, + "example": { + "limit": 100, + "object_types": [ + "ITEM" + ], + "query": { + "prefix_query": { + "attribute_name": "name", + "attribute_prefix": "tea" + } + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.csharp", + "java": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.java", + "javascript": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.javascript", + "php": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.php", + "python": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.python", + "ruby": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.ruby" + } + }, + "SearchCatalogObjectsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset, this is the final response.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + }, + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "The CatalogObjects returned." + }, + "related_objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of CatalogObjects referenced by the objects in the `objects` field." + }, + "latest_time": { + "type": "string", + "description": "When the associated product catalog was last updated. Will\nmatch the value for `end_time` or `cursor` if either field is included in the `SearchCatalog` request.", + "x-release-status": "BETA" + } + }, + "example": { + "objects": [ + { + "id": "X5DZ5NWWAQ44CKBLKIFQGOWK", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "E7CLE5RZZ744BHWVQQEAHI2C", + "ordinal": 0 + } + ], + "description": "A delicious blend of black tea.", + "name": "Tea - Black", + "product_type": "REGULAR", + "tax_ids": [ + "ZXITPM6RWHZ7GZ7EIP3YKECM" + ], + "variations": [ + { + "id": "5GSZPX6EU7MM75S57OONG3V5", + "is_deleted": false, + "item_variation_data": { + "item_id": "X5DZ5NWWAQ44CKBLKIFQGOWK", + "name": "Regular", + "ordinal": 1, + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2017-10-26T15:27:31.626Z", + "version": 1509031651626 + }, + { + "id": "XVLBN7DU6JTWHJTG5F265B43", + "is_deleted": false, + "item_variation_data": { + "item_id": "X5DZ5NWWAQ44CKBLKIFQGOWK", + "name": "Large", + "ordinal": 2, + "price_money": { + "amount": 225, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2017-10-26T15:27:31.626Z", + "version": 1509031651626 + } + ], + "visibility": "PRIVATE" + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2017-10-26T15:41:32.337Z", + "version": 1509032492337 + }, + { + "id": "NNNEM3LA656Q46NXLWCNI7S5", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "E7CLE5RZZ744BHWVQQEAHI2C", + "ordinal": 0 + } + ], + "description": "Relaxing green herbal tea.", + "name": "Tea - Green", + "product_type": "REGULAR", + "tax_ids": [ + "ZXITPM6RWHZ7GZ7EIP3YKECM" + ], + "variations": [ + { + "id": "FHYBVIA6NVBCSOVETA62WEA4", + "is_deleted": false, + "item_variation_data": { + "item_id": "NNNEM3LA656Q46NXLWCNI7S5", + "name": "Regular", + "ordinal": 1, + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2017-10-26T15:29:00.524Z", + "version": 1509031740524 + } + ], + "visibility": "PRIVATE" + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2017-10-26T15:41:23.232Z", + "version": 1509032483232 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.csharp", + "java": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.java", + "javascript": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.javascript", + "php": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.php", + "python": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.python", + "ruby": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.ruby" + } + }, + "SearchCustomersRequest": { + "type": "object", + "description": "Defines the fields that are included in the request body of a request to the\n`SearchCustomers` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "cursor": { + "type": "string", + "description": "Include the pagination cursor in subsequent calls to this endpoint to retrieve\nthe next set of results associated with the original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.\nIf the specified limit is invalid, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "format": "int64", + "minimum": 1, + "maximum": 100 + }, + "query": { + "$ref": "#/components/schemas/CustomerQuery", + "description": "The filtering and sorting criteria for the search request. If a query is not specified,\nSquare returns all customer profiles ordered alphabetically by `given_name` and `family_name`." + }, + "count": { + "type": "boolean", + "description": "Indicates whether to return the total count of matching customers in the `count` field of the response.\n\nThe default value is `false`." + } + }, + "example": { + "limit": 2, + "query": { + "filter": { + "created_at": { + "end_at": "2018-02-01T00:00:00-00:00", + "start_at": "2018-01-01T00:00:00-00:00" + }, + "creation_source": { + "rule": "INCLUDE", + "values": [ + "THIRD_PARTY" + ] + }, + "email_address": { + "fuzzy": "example.com" + }, + "group_ids": { + "all": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ] + } + }, + "sort": { + "field": "CREATED_AT", + "order": "ASC" + } + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/SearchCustomers/SearchCustomersRequest.csharp", + "java": "/sdk_samples/SearchCustomers/SearchCustomersRequest.java", + "javascript": "/sdk_samples/SearchCustomers/SearchCustomersRequest.javascript", + "php": "/sdk_samples/SearchCustomers/SearchCustomersRequest.php", + "python": "/sdk_samples/SearchCustomers/SearchCustomersRequest.python", + "ruby": "/sdk_samples/SearchCustomers/SearchCustomersRequest.ruby" + } + }, + "SearchCustomersResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `SearchCustomers` endpoint.\n\nEither `errors` or `customers` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Customer" + }, + "description": "The customer profiles that match the search query. If any search condition is not met, the result is an empty object (`{}`).\nOnly customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`)\nare included in the response." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor that can be used during subsequent calls\nto `SearchCustomers` to retrieve the next set of results associated\nwith the original query. Pagination cursors are only present when\na request succeeds and additional results are available.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "count": { + "type": "integer", + "description": "The total count of customers associated with the Square account that match the search query. Only customer profiles with\npublic information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is\npresent only if `count` is set to `true` in the request.", + "format": "int64" + } + }, + "example": { + "cursor": "9dpS093Uy12AzeE", + "customers": [ + { + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2018-01-23T20:21:54.859Z", + "creation_source": "DIRECTORY", + "email_address": "james.bond@example.com", + "family_name": "Bond", + "given_name": "James", + "group_ids": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ], + "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "phone_number": "+1-212-555-4250", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID_2", + "segment_ids": [ + "1KB9JE5EGJXCW.REACHABLE" + ], + "updated_at": "2020-04-20T10:02:43.083Z", + "version": 7 + }, + { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2018-01-30T14:10:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "amelia.earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "group_ids": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ], + "id": "A9641GZW2H7Z56YYSD41Q12HDW", + "note": "a customer", + "phone_number": "+1-212-555-9238", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID_1", + "segment_ids": [ + "1KB9JE5EGJXCW.REACHABLE" + ], + "updated_at": "2018-03-08T18:25:21.342Z", + "version": 1 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/SearchCustomers/SearchCustomersResponse.csharp", + "java": "/sdk_samples/SearchCustomers/SearchCustomersResponse.java", + "javascript": "/sdk_samples/SearchCustomers/SearchCustomersResponse.javascript", + "php": "/sdk_samples/SearchCustomers/SearchCustomersResponse.php", + "python": "/sdk_samples/SearchCustomers/SearchCustomersResponse.python", + "ruby": "/sdk_samples/SearchCustomers/SearchCustomersResponse.ruby" + } + }, + "SearchEventsFilter": { + "type": "object", + "description": "Criteria to filter events by.", + "x-release-status": "BETA", + "properties": { + "event_types": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter events by event types.", + "nullable": true + }, + "merchant_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter events by merchant.", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter events by location.", + "nullable": true + }, + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "Filter events by when they were created." + } + } + }, + "SearchEventsQuery": { + "type": "object", + "description": "Contains query criteria for the search.", + "x-release-status": "BETA", + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchEventsFilter", + "description": "Criteria to filter events by.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/SearchEventsSort", + "description": "Criteria to sort events by.", + "nullable": true + } + } + }, + "SearchEventsRequest": { + "type": "object", + "description": "Searches [Event](entity:Event)s for your application.", + "x-release-status": "BETA", + "properties": { + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of events for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "maxLength": 256 + }, + "limit": { + "type": "integer", + "description": "The maximum number of events to return in a single page. The response might contain fewer events. The default value is 100, which is also the maximum allowed value.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).\n\nDefault: 100", + "minimum": 1, + "maximum": 100 + }, + "query": { + "$ref": "#/components/schemas/SearchEventsQuery", + "description": "The filtering and sorting criteria for the search request. To retrieve additional pages using a cursor, you must use the original query." + } + } + }, + "SearchEventsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [SearchEvents](api-endpoint:Events-SearchEvents) endpoint.\n\nNote: if there are errors processing the request, the events field will not be\npresent.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Event" + }, + "description": "The list of [Event](entity:Event)s returned by the search." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EventMetadata" + }, + "description": "Contains the metadata of an event. For more information, see [Event](entity:Event)." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next set of events. If empty, this is the final response.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "cursor": "6b571fc9773647f=", + "events": [ + { + "created_at": "2022-04-26T10:08:40.454726", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "id": "ORSEVtZAJxb37RA1EiGw", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_at": "2020-02-19T00:00:00.000Z", + "state": "WON", + "updated_at": "2020-02-19T21:34:41.851Z", + "version": 6 + } + }, + "type": "dispute" + }, + "event_id": "73ecd468-0aba-424f-b862-583d44efe7c8", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.state.updated" + } + ], + "metadata": [ + { + "api_version": "2022-12-13", + "event_id": "73ecd468-0aba-424f-b862-583d44efe7c8" + } + ] + } + }, + "SearchEventsSort": { + "type": "object", + "description": "Criteria to sort events by.", + "x-release-status": "BETA", + "properties": { + "field": { + "$ref": "#/components/schemas/SearchEventsSortField", + "description": "Sort events by event types.\nSee [SearchEventsSortField](#type-searcheventssortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order to use for sorting the events.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "SearchEventsSortField": { + "type": "string", + "enum": [ + "DEFAULT" + ], + "x-enum-elements": [ + { + "name": "DEFAULT", + "description": "Use the default sort key. The default behavior is to sort events by when they were created (`created_at`)." + } + ], + "description": "Specifies the sort key for events returned from a search.", + "x-release-status": "BETA" + }, + "SearchInvoicesRequest": { + "type": "object", + "description": "Describes a `SearchInvoices` request.", + "x-release-status": "PUBLIC", + "required": [ + "query" + ], + "properties": { + "query": { + "$ref": "#/components/schemas/InvoiceQuery", + "description": "Describes the query criteria for searching invoices." + }, + "limit": { + "type": "integer", + "description": "The maximum number of invoices to return (200 is the maximum `limit`). \nIf not provided, the server uses a default limit of 100 invoices." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint. \nProvide this cursor to retrieve the next set of results for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "limit": 100, + "query": { + "filter": { + "customer_ids": [ + "JDKYHBWT1D4F8MFH63DBMEN8Y4" + ], + "location_ids": [ + "ES0RJRZYEC39A" + ] + }, + "sort": { + "field": "INVOICE_SORT_DATE", + "order": "DESC" + } + } + } + }, + "SearchInvoicesResponse": { + "type": "object", + "description": "Describes a `SearchInvoices` response.", + "x-release-status": "PUBLIC", + "properties": { + "invoices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Invoice" + }, + "description": "The list of invoices returned by the search." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can use in a \nsubsequent request to fetch the next set of invoices. If empty, this is the final \nresponse. \nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "cursor": "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", + "invoices": [ + { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T17:45:13Z", + "version": 0 + }, + { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": true + }, + "created_at": "2021-01-23T15:29:12Z", + "delivery_method": "EMAIL", + "id": "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", + "invoice_number": "inv-455", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "order_id": "a65jnS8NXbfprvGJzY9F4fQTuaB", + "payment_requests": [ + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "due_date": "2021-01-23", + "percentage_requested": "25", + "request_type": "DEPOSIT", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "uid": "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176" + }, + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "due_date": "2021-06-15", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "120c5e18-4f80-4f6b-b159-774cb9bf8f99" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "public_url": "https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9", + "sale_or_service_date": "2030-01-24", + "status": "PARTIALLY_PAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "updated_at": "2021-01-23T15:29:56Z", + "version": 3 + } + ] + } + }, + "SearchLoyaltyAccountsRequest": { + "type": "object", + "description": "A request to search for loyalty accounts.", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/SearchLoyaltyAccountsRequestLoyaltyAccountQuery", + "description": "The search criteria for the request." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to include in the response. The default value is 30.", + "minimum": 1, + "maximum": 200 + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to \nthis endpoint. Provide this to retrieve the next set of \nresults for the original query.\n\nFor more information, \nsee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "limit": 10, + "query": { + "mappings": [ + { + "phone_number": "+14155551234" + } + ] + } + } + }, + "SearchLoyaltyAccountsRequestLoyaltyAccountQuery": { + "type": "object", + "description": "The search criteria for the loyalty accounts.", + "x-release-status": "PUBLIC", + "properties": { + "mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyAccountMapping" + }, + "description": "The set of mappings to use in the loyalty account search. \n\nThis cannot be combined with `customer_ids`. \n\nMax: 30 mappings", + "nullable": true + }, + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The set of customer IDs to use in the loyalty account search. \n\nThis cannot be combined with `mappings`. \n\nMax: 30 customer IDs", + "nullable": true + } + } + }, + "SearchLoyaltyAccountsResponse": { + "type": "object", + "description": "A response that includes loyalty accounts that satisfy the search criteria.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyAccount" + }, + "description": "The loyalty accounts that met the search criteria, \nin order of creation date." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to use in a subsequent \nrequest. If empty, this is the final response.\nFor more information, \nsee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "loyalty_accounts": [ + { + "balance": 10, + "created_at": "2020-05-08T21:44:32Z", + "customer_id": "Q8002FAM9V1EZ0ADB2T5609X6NET1H0", + "id": "79b807d2-d786-46a9-933b-918028d7a8c5", + "lifetime_points": 20, + "mapping": { + "created_at": "2020-05-08T21:44:32Z", + "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234" + }, + "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "updated_at": "2020-05-08T21:44:32Z" + } + ] + } + }, + "SearchLoyaltyEventsRequest": { + "type": "object", + "description": "A request to search for loyalty events.", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/LoyaltyEventQuery", + "description": "A set of one or more predefined query filters to apply when \nsearching for loyalty events. The endpoint performs a logical AND to \nevaluate multiple filters and performs a logical OR on arrays \nthat specifies multiple field values." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to include in the response. \nThe last page might contain fewer events. \nThe default is 30 events.", + "minimum": 1, + "maximum": 30 + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for your original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "limit": 30, + "query": { + "filter": { + "order_filter": { + "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY" + } + } + } + } + }, + "SearchLoyaltyEventsResponse": { + "type": "object", + "description": "A response that contains loyalty events that satisfy the search \ncriteria, in order by the `created_at` date.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyEvent" + }, + "description": "The loyalty events that satisfy the search criteria." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent \nrequest. If empty, this is the final response. \nFor more information, \nsee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "events": [ + { + "accumulate_points": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY", + "points": 5 + }, + "created_at": "2020-05-08T22:01:30Z", + "id": "c27c8465-806e-36f2-b4b3-71f5887b5ba8", + "location_id": "P034NEENMD09F", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "source": "LOYALTY_API", + "type": "ACCUMULATE_POINTS" + }, + { + "created_at": "2020-05-08T22:01:15Z", + "id": "e4a5cbc3-a4d0-3779-98e9-e578885d9430", + "location_id": "P034NEENMD09F", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "redeem_reward": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY", + "reward_id": "d03f79f4-815f-3500-b851-cc1e68a457f9" + }, + "source": "LOYALTY_API", + "type": "REDEEM_REWARD" + }, + { + "create_reward": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "points": -10, + "reward_id": "d03f79f4-815f-3500-b851-cc1e68a457f9" + }, + "created_at": "2020-05-08T22:00:44Z", + "id": "5e127479-0b03-3671-ab1e-15faea8b7188", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "source": "LOYALTY_API", + "type": "CREATE_REWARD" + } + ] + } + }, + "SearchLoyaltyRewardsRequest": { + "type": "object", + "description": "A request to search for loyalty rewards.", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/SearchLoyaltyRewardsRequestLoyaltyRewardQuery", + "description": "The search criteria for the request. \nIf empty, the endpoint retrieves all loyalty rewards in the loyalty program." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to return in the response. The default value is 30.", + "minimum": 1, + "maximum": 30 + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to \nthis endpoint. Provide this to retrieve the next set of \nresults for the original query.\nFor more information, \nsee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "limit": 10, + "query": { + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" + } + } + }, + "SearchLoyaltyRewardsRequestLoyaltyRewardQuery": { + "type": "object", + "description": "The set of search requirements.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_account_id" + ], + "properties": { + "loyalty_account_id": { + "type": "string", + "description": "The ID of the [loyalty account](entity:LoyaltyAccount) to which the loyalty reward belongs.", + "minLength": 1 + }, + "status": { + "$ref": "#/components/schemas/LoyaltyRewardStatus", + "description": "The status of the loyalty reward.\nSee [LoyaltyRewardStatus](#type-loyaltyrewardstatus) for possible values", + "nullable": true + } + } + }, + "SearchLoyaltyRewardsResponse": { + "type": "object", + "description": "A response that includes the loyalty rewards satisfying the search criteria.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "rewards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyReward" + }, + "description": "The loyalty rewards that satisfy the search criteria.\nThese are returned in descending order by `updated_at`." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent \nrequest. If empty, this is the final response." + } + }, + "example": { + "rewards": [ + { + "created_at": "2020-05-08T22:00:44Z", + "id": "d03f79f4-815f-3500-b851-cc1e68a457f9", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY", + "points": 10, + "redeemed_at": "2020-05-08T22:01:17Z", + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "REDEEMED", + "updated_at": "2020-05-08T22:01:17Z" + }, + { + "created_at": "2020-05-08T21:55:42Z", + "id": "9f18ac21-233a-31c3-be77-b45840f5a810", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "points": 10, + "redeemed_at": "2020-05-08T21:56:00Z", + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "REDEEMED", + "updated_at": "2020-05-08T21:56:00Z" + }, + { + "created_at": "2020-05-01T21:49:54Z", + "id": "a8f43ebe-2ad6-3001-bdd5-7d7c2da08943", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "order_id": "5NB69ZNh3FbsOs1ox43bh1xrli6YY", + "points": 10, + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "DELETED", + "updated_at": "2020-05-08T21:55:10Z" + }, + { + "created_at": "2020-05-01T20:20:37Z", + "id": "a051254c-f840-3b45-8cf1-50bcd38ff92a", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "order_id": "LQQ16znvi2VIUKPVhUfJefzr1eEZY", + "points": 10, + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "ISSUED", + "updated_at": "2020-05-01T20:20:40Z" + } + ] + } + }, + "SearchOrdersCustomerFilter": { + "type": "object", + "description": "A filter based on the order `customer_id` and any tender `customer_id`\nassociated with the order. It does not filter based on the\n[FulfillmentRecipient](entity:FulfillmentRecipient) `customer_id`.", + "x-release-status": "BETA", + "properties": { + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of customer IDs to filter by.\n\nMax: 10 customer ids.", + "nullable": true + } + } + }, + "SearchOrdersDateTimeFilter": { + "type": "object", + "description": "Filter for `Order` objects based on whether their `CREATED_AT`,\n`CLOSED_AT`, or `UPDATED_AT` timestamps fall within a specified time range.\nYou can specify the time range and which timestamp to filter for. You can filter\nfor only one time range at a time.\n\nFor each time range, the start time and end time are inclusive. If the end time\nis absent, it defaults to the time of the first request for the cursor.\n\n__Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query,\nyou must set the `sort_field` in [OrdersSort](entity:SearchOrdersSort)\nto the same field you filter for. For example, if you set the `CLOSED_AT` field\nin `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to\n`CLOSED_AT`. Otherwise, `SearchOrders` throws an error.\n[Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range)", + "x-release-status": "PUBLIC", + "properties": { + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The time range for filtering on the `created_at` timestamp. If you use this\nvalue, you must set the `sort_field` in the `OrdersSearchSort` object to\n`CREATED_AT`." + }, + "updated_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The time range for filtering on the `updated_at` timestamp. If you use this\nvalue, you must set the `sort_field` in the `OrdersSearchSort` object to\n`UPDATED_AT`." + }, + "closed_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The time range for filtering on the `closed_at` timestamp. If you use this\nvalue, you must set the `sort_field` in the `OrdersSearchSort` object to\n`CLOSED_AT`.", + "nullable": true + } + } + }, + "SearchOrdersFilter": { + "type": "object", + "description": "Filtering criteria to use for a `SearchOrders` request. Multiple filters\nare ANDed together.", + "x-release-status": "PUBLIC", + "properties": { + "state_filter": { + "$ref": "#/components/schemas/SearchOrdersStateFilter", + "description": "Filter by [OrderState](entity:OrderState).", + "nullable": true + }, + "date_time_filter": { + "$ref": "#/components/schemas/SearchOrdersDateTimeFilter", + "description": "Filter for results within a time range.\n\n__Important:__ If you filter for orders by time range, you must set `SearchOrdersSort`\nto sort by the same field.\n[Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range)", + "nullable": true + }, + "fulfillment_filter": { + "$ref": "#/components/schemas/SearchOrdersFulfillmentFilter", + "description": "Filter by the fulfillment type or state.", + "nullable": true + }, + "source_filter": { + "$ref": "#/components/schemas/SearchOrdersSourceFilter", + "description": "Filter by the source of the order.", + "nullable": true + }, + "customer_filter": { + "$ref": "#/components/schemas/SearchOrdersCustomerFilter", + "description": "Filter by customers associated with the order.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "SearchOrdersFulfillmentFilter": { + "type": "object", + "description": "Filter based on [order fulfillment](entity:Fulfillment) information.", + "x-release-status": "PUBLIC", + "properties": { + "fulfillment_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentType" + }, + "description": "A list of [fulfillment types](entity:FulfillmentType) to filter\nfor. The list returns orders if any of its fulfillments match any of the fulfillment types\nlisted in this field.\nSee [FulfillmentType](#type-fulfillmenttype) for possible values", + "nullable": true + }, + "fulfillment_states": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentState" + }, + "description": "A list of [fulfillment states](entity:FulfillmentState) to filter\nfor. The list returns orders if any of its fulfillments match any of the\nfulfillment states listed in this field.\nSee [FulfillmentState](#type-fulfillmentstate) for possible values", + "nullable": true + } + } + }, + "SearchOrdersQuery": { + "type": "object", + "description": "Contains query criteria for the search.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchOrdersFilter", + "description": "Criteria to filter results by.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/SearchOrdersSort", + "description": "Criteria to sort results by.", + "nullable": true + } + } + }, + "SearchOrdersRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The location IDs for the orders to query. All locations must belong to\nthe same merchant.\n\nMax: 10 location IDs." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for your original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "query": { + "$ref": "#/components/schemas/SearchOrdersQuery", + "description": "Query conditions used to filter or sort the results. Note that when\nretrieving additional pages using a cursor, you must use the original query." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to be returned in a single page.\n\nDefault: `500`\nMax: `1000`" + }, + "return_entries": { + "type": "boolean", + "description": "A Boolean that controls the format of the search results. If `true`,\n`SearchOrders` returns [OrderEntry](entity:OrderEntry) objects. If `false`, `SearchOrders`\nreturns complete order objects.\n\nDefault: `false`." + } + }, + "example": { + "limit": 3, + "location_ids": [ + "057P5VYJ4A5X1", + "18YC4JDH91E1H" + ], + "query": { + "filter": { + "date_time_filter": { + "closed_at": { + "end_at": "2019-03-04T21:54:45+00:00", + "start_at": "2018-03-03T20:00:00+00:00" + } + }, + "state_filter": { + "states": [ + "COMPLETED" + ] + } + }, + "sort": { + "sort_field": "CLOSED_AT", + "sort_order": "DESC" + } + }, + "return_entries": true + } + }, + "SearchOrdersResponse": { + "type": "object", + "description": "Either the `order_entries` or `orders` field is set, depending on whether\n`return_entries` is set on the [SearchOrdersRequest](api-endpoint:Orders-SearchOrders).", + "x-release-status": "PUBLIC", + "properties": { + "order_entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderEntry" + }, + "description": "A list of [OrderEntries](entity:OrderEntry) that fit the query\nconditions. The list is populated only if `return_entries` is set to `true` in the request." + }, + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + }, + "description": "A list of\n[Order](entity:Order) objects that match the query conditions. The list is populated only if\n`return_entries` is set to `false` in the request." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "[Errors](entity:Error) encountered during the search." + } + }, + "example": { + "cursor": "123", + "order_entries": [ + { + "location_id": "057P5VYJ4A5X1", + "order_id": "CAISEM82RcpmcFBM0TfOyiHV3es", + "version": 1 + }, + { + "location_id": "18YC4JDH91E1H", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY" + }, + { + "location_id": "057P5VYJ4A5X1", + "order_id": "CAISEM52YcpmcWAzERDOyiWS3ty" + } + ] + } + }, + "SearchOrdersSort": { + "type": "object", + "description": "Sorting criteria for a `SearchOrders` request. Results can only be sorted\nby a timestamp field.", + "x-release-status": "PUBLIC", + "required": [ + "sort_field" + ], + "properties": { + "sort_field": { + "$ref": "#/components/schemas/SearchOrdersSortField", + "description": "The field to sort by.\n\n__Important:__ When using a [DateTimeFilter](entity:SearchOrdersFilter),\n`sort_field` must match the timestamp field that the `DateTimeFilter` uses to\nfilter. For example, if you set your `sort_field` to `CLOSED_AT` and you use a\n`DateTimeFilter`, your `DateTimeFilter` must filter for orders by their `CLOSED_AT` date.\nIf this field does not match the timestamp field in `DateTimeFilter`,\n`SearchOrders` returns an error.\n\nDefault: `CREATED_AT`.\nSee [SearchOrdersSortField](#type-searchorderssortfield) for possible values" + }, + "sort_order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The chronological order in which results are returned. Defaults to `DESC`.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "SearchOrdersSortField": { + "type": "string", + "enum": [ + "CREATED_AT", + "UPDATED_AT", + "CLOSED_AT" + ], + "x-enum-elements": [ + { + "name": "CREATED_AT", + "description": "The time when the order was created, in RFC-3339 format. If you are also\nfiltering for a time range in this query, you must set the `CREATED_AT`\nfield in your `DateTimeFilter`." + }, + { + "name": "UPDATED_AT", + "description": "The time when the order last updated, in RFC-3339 format. If you are also\nfiltering for a time range in this query, you must set the `UPDATED_AT`\nfield in your `DateTimeFilter`." + }, + { + "name": "CLOSED_AT", + "description": "The time when the order was closed, in RFC-3339 format. If you use this\nvalue, you must also set a `StateFilter` with closed states. If you are also\nfiltering for a time range in this query, you must set the `CLOSED_AT`\nfield in your `DateTimeFilter`." + } + ], + "description": "Specifies which timestamp to use to sort `SearchOrder` results.", + "x-release-status": "PUBLIC" + }, + "SearchOrdersSourceFilter": { + "type": "object", + "description": "A filter based on order `source` information.", + "x-release-status": "PUBLIC", + "properties": { + "source_names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filters by the [Source](entity:OrderSource) `name`. The filter returns any orders\nwith a `source.name` that matches any of the listed source names.\n\nMax: 10 source names.", + "nullable": true + } + } + }, + "SearchOrdersStateFilter": { + "type": "object", + "description": "Filter by the current order `state`.", + "x-release-status": "PUBLIC", + "required": [ + "states" + ], + "properties": { + "states": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderState" + }, + "description": "States to filter for.\nSee [OrderState](#type-orderstate) for possible values" + } + } + }, + "SearchScheduledShiftsRequest": { + "type": "object", + "description": "Represents a [SearchScheduledShift](api-endpoint:Labor-SearchScheduledShift) request.", + "x-release-status": "BETA", + "properties": { + "query": { + "$ref": "#/components/schemas/ScheduledShiftQuery", + "description": "Query conditions used to filter and sort the results." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to return in a single response page. The default value is 50.", + "minimum": 1, + "maximum": 50 + }, + "cursor": { + "type": "string", + "description": "The pagination cursor returned by the previous call to this endpoint. Provide\nthis cursor to retrieve the next page of results for your original request. For more\ninformation, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "cursor": "xoxp-1234-5678-90123", + "limit": 2, + "query": { + "filter": { + "assignment_status": "ASSIGNED", + "scheduled_shift_status": [ + "PUBLISHED", + "DRAFT" + ] + }, + "sort": { + "field": "CREATED_AT", + "order": "ASC" + } + } + } + }, + "SearchScheduledShiftsResponse": { + "type": "object", + "description": "Represents a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) response.\nEither `scheduled_shifts` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "scheduled_shifts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScheduledShift" + }, + "description": "A paginated list of scheduled shifts that match the query conditions." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor used to retrieve the next page of results. This field is present\nonly if additional results are available." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "xoxp-123-2123-123232", + "scheduled_shifts": [ + { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-01-25T13:11:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "updated_at": "2019-02-25T03:11:00-05:00", + "version": 1 + } + ] + } + }, + "SearchShiftsRequest": { + "type": "object", + "description": "A request for a filtered and sorted set of `Shift` objects.", + "x-release-status": "DEPRECATED", + "properties": { + "query": { + "$ref": "#/components/schemas/ShiftQuery", + "description": "Query filters." + }, + "limit": { + "type": "integer", + "description": "The number of resources in a page (200 by default).", + "minimum": 1, + "maximum": 200 + }, + "cursor": { + "type": "string", + "description": "An opaque cursor for fetching the next page." + } + }, + "example": { + "limit": 100, + "query": { + "filter": { + "workday": { + "date_range": { + "end_date": "2019-02-03", + "start_date": "2019-01-20" + }, + "default_timezone": "America/Los_Angeles", + "match_shifts_by": "START_AT" + } + } + } + } + }, + "SearchShiftsResponse": { + "type": "object", + "description": "The response to a request for `Shift` objects. The response contains\nthe requested `Shift` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "shifts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Shift" + }, + "description": "Shifts." + }, + "cursor": { + "type": "string", + "description": "An opaque cursor for fetching the next page." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "shifts": [ + { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-21T06:11:00-05:00", + "expected_duration": "PT10M", + "id": "SJW7X6AKEJQ65", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-21T06:11:00-05:00" + } + ], + "created_at": "2019-01-24T01:12:03Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "ormj0jJJZ5OZIzxrZYJI", + "end_at": "2019-01-21T13:11:00-05:00", + "id": "X714F3HA6D1PT", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-21T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-07T22:21:08Z", + "version": 6, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + }, + { + "breaks": [ + { + "break_type_id": "WQX00VR99F53J", + "end_at": "2019-01-23T14:40:00-05:00", + "expected_duration": "PT10M", + "id": "BKS6VR7WR748A", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-23T14:30:00-05:00" + }, + { + "break_type_id": "P6Q468ZFRN1AC", + "end_at": "2019-01-22T12:44:00-05:00", + "expected_duration": "PT15M", + "id": "BQFEZSHFZSC51", + "is_paid": false, + "name": "Coffee Break", + "start_at": "2019-01-22T12:30:00-05:00" + } + ], + "created_at": "2019-01-23T23:32:45Z", + "declared_cash_tip_money": { + "amount": 0, + "currency": "USD" + }, + "employee_id": "33fJchumvVdJwxV0H6L9", + "end_at": "2019-01-22T13:02:00-05:00", + "id": "GDHYBZYWK0P2V", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-22T12:02:00-05:00", + "status": "CLOSED", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "timezone": "America/New_York", + "updated_at": "2019-01-24T00:56:25Z", + "version": 16, + "wage": { + "hourly_rate": { + "amount": 1600, + "currency": "USD" + }, + "job_id": "gcbz15vKGnMKmaWJJ152kjim", + "tip_eligible": true, + "title": "Cook" + } + } + ] + } + }, + "SearchSubscriptionsFilter": { + "type": "object", + "description": "Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions returned by \nthe [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A filter to select subscriptions based on the subscribing customer IDs.", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A filter to select subscriptions based on the location.", + "nullable": true + }, + "source_names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A filter to select subscriptions based on the source application.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "SearchSubscriptionsQuery": { + "type": "object", + "description": "Represents a query, consisting of specified query expressions, used to search for subscriptions.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchSubscriptionsFilter", + "description": "A list of query expressions.", + "nullable": true + } + } + }, + "SearchSubscriptionsRequest": { + "type": "object", + "description": "Defines input parameters in a request to the \n[SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "cursor": { + "type": "string", + "description": "When the total number of resulting subscriptions exceeds the limit of a paged response, \nspecify the cursor returned from a preceding response here to fetch the next set of results.\nIf the cursor is unset, the response contains the last page of the results.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "limit": { + "type": "integer", + "description": "The upper limit on the number of subscriptions to return\nin a paged response.", + "minimum": 1 + }, + "query": { + "$ref": "#/components/schemas/SearchSubscriptionsQuery", + "description": "A subscription query consisting of specified filtering conditions.\n\nIf this `query` field is unspecified, the `SearchSubscriptions` call will return all subscriptions." + }, + "include": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An option to include related information in the response. \n\nThe supported values are: \n\n- `actions`: to include scheduled actions on the targeted subscriptions.", + "x-release-status": "BETA" + } + }, + "example": { + "query": { + "filter": { + "customer_ids": [ + "CHFGVKYY8RSV93M5KCYTG4PN0G" + ], + "location_ids": [ + "S8GWD5R9QB376" + ], + "source_names": [ + "My App" + ] + } + } + } + }, + "SearchSubscriptionsResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscriptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Subscription" + }, + "description": "The subscriptions matching the specified query expressions." + }, + "cursor": { + "type": "string", + "description": "When the total number of resulting subscription exceeds the limit of a paged response, \nthe response includes a cursor for you to use in a subsequent request to fetch the next set of results.\nIf the cursor is unset, the response contains the last page of the results.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "subscriptions": [ + { + "canceled_date": "2021-10-30", + "card_id": "ccof:mueUsvgajChmjEbp4GB", + "charged_through_date": "2021-11-20", + "created_at": "2021-10-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "de86fc96-8664-474b-af1a-abbe59cacf0e", + "location_id": "S8GWD5R9QB376", + "paid_until_date": "2021-11-20", + "plan_variation_id": "L3TJVDHVBEQEGQDEZL2JJM7R", + "source": { + "name": "My Application" + }, + "start_date": "2021-10-20", + "status": "CANCELED", + "timezone": "UTC" + }, + { + "charged_through_date": "2022-08-19", + "created_at": "2022-01-19T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", + "invoice_ids": [ + "grebK0Q_l8H4fqoMMVvt-Q", + "rcX_i3sNmHTGKhI4W2mceA" + ], + "location_id": "S8GWD5R9QB376", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "price_override_money": { + "amount": 1000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "start_date": "2022-01-19", + "status": "PAUSED", + "tax_percentage": "5", + "timezone": "America/Los_Angeles", + "version": 2 + }, + { + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + "ordinal": 0, + "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", + "uid": "873451e0-745b-4e87-ab0b-c574933fe616" + } + ], + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2023-06-20", + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 1 + } + ] + } + }, + "SearchTeamMembersFilter": { + "type": "object", + "description": "Represents a filter used in a search for `TeamMember` objects. `AND` logic is applied\nbetween the individual fields, and `OR` logic is applied within list-based fields.\nFor example, setting this filter value:\n```\nfilter = (locations_ids = [\"A\", \"B\"], status = ACTIVE)\n```\nreturns only active team members assigned to either location \"A\" or \"B\".", + "x-release-status": "PUBLIC", + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "When present, filters by team members assigned to the specified locations.\nWhen empty, includes team members assigned to any location.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/TeamMemberStatus", + "description": "When present, filters by team members who match the given status.\nWhen empty, includes team members of all statuses.\nSee [TeamMemberStatus](#type-teammemberstatus) for possible values", + "nullable": true + }, + "is_owner": { + "type": "boolean", + "description": "When present and set to true, returns the team member who is the owner of the Square account.", + "nullable": true + } + } + }, + "SearchTeamMembersQuery": { + "type": "object", + "description": "Represents the parameters in a search for `TeamMember` objects.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchTeamMembersFilter", + "description": "The options to filter by.", + "nullable": true + } + } + }, + "SearchTeamMembersRequest": { + "type": "object", + "description": "Represents a search request for a filtered list of `TeamMember` objects.", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/SearchTeamMembersQuery", + "description": "The query parameters." + }, + "limit": { + "type": "integer", + "description": "The maximum number of `TeamMember` objects in a page (100 by default).", + "minimum": 1, + "maximum": 200 + }, + "cursor": { + "type": "string", + "description": "The opaque cursor for fetching the next page. For more information, see\n[pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." + } + }, + "example": { + "limit": 10, + "query": { + "filter": { + "location_ids": [ + "0G5P3VGACMMQZ" + ], + "status": "ACTIVE" + } + } + } + }, + "SearchTeamMembersResponse": { + "type": "object", + "description": "Represents a response from a search request containing a filtered list of `TeamMember` objects.", + "x-release-status": "PUBLIC", + "properties": { + "team_members": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TeamMember" + }, + "description": "The filtered list of `TeamMember` objects." + }, + "cursor": { + "type": "string", + "description": "The opaque cursor for fetching the next page. For more information, see\n[pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "cursor": "N:9UglUjOXQ13-hMFypCft", + "team_members": [ + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2019-07-10T17:26:48Z", + "email_address": "johnny_cash@squareup.com", + "family_name": "Cash", + "given_name": "Johnny", + "id": "-3oZQKPKVk6gUXU_V5Qa", + "is_owner": false, + "reference_id": "12345678", + "status": "ACTIVE", + "updated_at": "2020-04-28T21:49:28Z", + "wage_setting": { + "created_at": "2021-06-11T22:55:45Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 1443, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "-3oZQKPKVk6gUXU_V5Qa", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:01Z", + "family_name": "Smith", + "given_name": "Lombard", + "id": "1AVJj0DjkzbmbJw5r4KK", + "is_owner": false, + "phone_number": "+14155552671", + "reference_id": "abcded", + "status": "ACTIVE", + "updated_at": "2020-06-09T17:38:05Z", + "wage_setting": { + "created_at": "2020-03-24T18:14:01Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "hourly_rate": { + "amount": 2400, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "1AVJj0DjkzbmbJw5r4KK", + "updated_at": "2020-06-09T17:38:05Z", + "version": 2 + } + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T01:09:25Z", + "family_name": "Sway", + "given_name": "Monica", + "id": "2JCmiJol_KKFs9z2Evim", + "is_owner": false, + "status": "ACTIVE", + "updated_at": "2020-03-24T01:11:25Z", + "wage_setting": { + "created_at": "2020-03-24T01:09:25Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "hourly_rate": { + "amount": 2400, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "2JCmiJol_KKFs9z2Evim", + "updated_at": "2020-03-24T01:09:25Z", + "version": 1 + } + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T01:09:23Z", + "family_name": "Ipsum", + "given_name": "Elton", + "id": "4uXcJQSLtbk3F0UQHFNQ", + "is_owner": false, + "status": "ACTIVE", + "updated_at": "2020-03-24T01:15:23Z" + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T01:09:23Z", + "family_name": "Lo", + "given_name": "Steven", + "id": "5CoUpyrw1YwGWcRd-eDL", + "is_owner": false, + "status": "ACTIVE", + "updated_at": "2020-03-24T01:19:23Z" + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:03Z", + "family_name": "Steward", + "given_name": "Patrick", + "id": "5MRPTTp8MMBLVSmzrGha", + "is_owner": false, + "phone_number": "+14155552671", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:18:03Z", + "wage_setting": { + "created_at": "2020-03-24T18:14:03Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "5MRPTTp8MMBLVSmzrGha", + "updated_at": "2020-03-24T18:14:03Z", + "version": 1 + } + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T01:09:25Z", + "family_name": "Manny", + "given_name": "Ivy", + "id": "7F5ZxsfRnkexhu1PTbfh", + "is_owner": false, + "status": "ACTIVE", + "updated_at": "2020-03-24T01:09:25Z" + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:02Z", + "email_address": "john_smith@example.com", + "family_name": "Smith", + "given_name": "John", + "id": "808X9HR72yKvVaigQXf4", + "is_owner": false, + "phone_number": "+14155552671", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:14:02Z" + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:00Z", + "email_address": "r_wen@example.com", + "family_name": "Wen", + "given_name": "Robert", + "id": "9MVDVoY4hazkWKGo_OuZ", + "is_owner": false, + "phone_number": "+14155552671", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:14:00Z" + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:00Z", + "email_address": "asimpson@example.com", + "family_name": "Simpson", + "given_name": "Ashley", + "id": "9UglUjOXQ13-hMFypCft", + "is_owner": false, + "phone_number": "+14155552671", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:18:00Z", + "wage_setting": { + "created_at": "2020-03-24T18:14:00Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "9UglUjOXQ13-hMFypCft", + "updated_at": "2020-03-24T18:14:03Z", + "version": 1 + } + } + ] + } + }, + "SearchTerminalActionsRequest": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "query": { + "$ref": "#/components/schemas/TerminalActionQuery", + "description": "Queries terminal actions based on given conditions and sort order.\nLeaving this unset will return all actions with the default sort order." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more\ninformation." + }, + "limit": { + "type": "integer", + "description": "Limit the number of results returned for a single request.", + "minimum": 1, + "maximum": 100 + } + }, + "example": { + "limit": 2, + "query": { + "filter": { + "created_at": { + "start_at": "2022-04-01T00:00:00.000Z" + } + }, + "sort": { + "sort_order": "DESC" + } + } + } + }, + "SearchTerminalActionsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "action": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TerminalAction" + }, + "description": "The requested search result of `TerminalAction`s." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more\ninformation." + } + }, + "example": { + "action": [ + { + "app_id": "APP_ID", + "created_at": "2022-04-08T15:14:04.895Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:oBGWlAats8xWCiCE", + "location_id": "LOCATION_ID", + "save_card_options": { + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "IN_PROGRESS", + "type": "SAVE_CARD", + "updated_at": "2022-04-08T15:14:05.446Z" + }, + { + "app_id": "APP_ID", + "created_at": "2022-04-08T15:14:01.210Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:K2NY2YSSml3lTiCE", + "location_id": "LOCATION_ID", + "save_card_options": { + "card_id": "ccof:CARD_ID", + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "COMPLETED", + "type": "SAVE_CARD", + "updated_at": "2022-04-08T15:14:09.861Z" + } + ], + "cursor": "CURSOR" + } + }, + "SearchTerminalCheckoutsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/TerminalCheckoutQuery", + "description": "Queries Terminal checkouts based on given conditions and the sort order.\nLeaving these unset returns all checkouts with the default sort order." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + }, + "limit": { + "type": "integer", + "description": "Limits the number of results returned for a single request.", + "minimum": 1, + "maximum": 100 + } + }, + "example": { + "limit": 2, + "query": { + "filter": { + "status": "COMPLETED" + } + } + } + }, + "SearchTerminalCheckoutsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "checkouts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TerminalCheckout" + }, + "description": "The requested search result of `TerminalCheckout` objects." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + } + }, + "example": { + "checkouts": [ + { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2020-03-31T18:13:15.921Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "tsQPvzwBpMqqO", + "note": "A brief note", + "payment_ids": [ + "rXnhZzywrEk4vR6pw76fPZfgvaB" + ], + "reference_id": "id14467", + "status": "COMPLETED", + "updated_at": "2020-03-31T18:13:52.725Z" + }, + { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2020-03-31T18:08:31.882Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": true, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "XlOPTgcEhrbqO", + "note": "A brief note", + "payment_ids": [ + "VYBF861PaoKPP7Pih0TlbZiNvaB" + ], + "reference_id": "id41623", + "status": "COMPLETED", + "updated_at": "2020-03-31T18:08:41.635Z" + } + ], + "cursor": "RiTJqBoTuXlbLmmrPvEkX9iG7XnQ4W4RjGnH" + } + }, + "SearchTerminalRefundsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/TerminalRefundQuery", + "description": "Queries the Terminal refunds based on given conditions and the sort order. Calling\n`SearchTerminalRefunds` without an explicit query parameter returns all available\nrefunds with the default sort order." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query." + }, + "limit": { + "type": "integer", + "description": "Limits the number of results returned for a single request.", + "minimum": 1, + "maximum": 100 + } + }, + "example": { + "limit": 1, + "query": { + "filter": { + "status": "COMPLETED" + } + } + } + }, + "SearchTerminalRefundsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refunds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TerminalRefund" + }, + "description": "The requested search result of `TerminalRefund` objects." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + } + }, + "example": { + "refunds": [ + { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 1, + "exp_year": 2022, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "created_at": "2020-09-29T15:21:46.771Z", + "deadline_duration": "PT5M", + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "id": "009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "76C9W6K8CNNQ5", + "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Returning item", + "refund_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb", + "status": "COMPLETED", + "updated_at": "2020-09-29T15:21:48.675Z" + } + ] + } + }, + "SearchTimecardsRequest": { + "type": "object", + "description": "A request for a filtered and sorted set of `Timecard` objects.", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/TimecardQuery", + "description": "Query filters." + }, + "limit": { + "type": "integer", + "description": "The number of resources in a page (200 by default).", + "minimum": 1, + "maximum": 200 + }, + "cursor": { + "type": "string", + "description": "An opaque cursor for fetching the next page." + } + }, + "example": { + "limit": 100, + "query": { + "filter": { + "workday": { + "date_range": { + "end_date": "2019-02-03", + "start_date": "2019-01-20" + }, + "default_timezone": "America/Los_Angeles", + "match_timecards_by": "START_AT" + } + } + } + } + }, + "SearchTimecardsResponse": { + "type": "object", + "description": "The response to a request for `Timecard` objects. The response contains\nthe requested `Timecard` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "timecards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Timecard" + }, + "description": "Timecards." + }, + "cursor": { + "type": "string", + "description": "An opaque cursor for fetching the next page." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "timecards": [ + { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-21T06:11:00-05:00", + "expected_duration": "PT10M", + "id": "SJW7X6AKEJQ65", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-21T06:11:00-05:00" + } + ], + "created_at": "2019-01-24T01:12:03Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-21T13:11:00-05:00", + "id": "X714F3HA6D1PT", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-21T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-07T22:21:08Z", + "version": 6, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + }, + { + "breaks": [ + { + "break_type_id": "WQX00VR99F53J", + "end_at": "2019-01-22T14:40:00-05:00", + "expected_duration": "PT10M", + "id": "BKS6VR7WR748A", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-22T14:30:00-05:00" + }, + { + "break_type_id": "P6Q468ZFRN1AC", + "end_at": "2019-01-22T12:44:00-05:00", + "expected_duration": "PT15M", + "id": "BQFEZSHFZSC51", + "is_paid": false, + "name": "Coffee Break", + "start_at": "2019-01-22T12:30:00-05:00" + } + ], + "created_at": "2019-01-23T23:32:45Z", + "declared_cash_tip_money": { + "amount": 0, + "currency": "USD" + }, + "end_at": "2019-01-22T13:02:00-05:00", + "id": "GDHYBZYWK0P2V", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-22T12:02:00-05:00", + "status": "CLOSED", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "timezone": "America/New_York", + "updated_at": "2019-01-24T00:56:25Z", + "version": 16, + "wage": { + "hourly_rate": { + "amount": 1600, + "currency": "USD" + }, + "job_id": "gcbz15vKGnMKmaWJJ152kjim", + "tip_eligible": true, + "title": "Cook" + } + } + ] + } + }, + "SearchVendorsRequest": { + "type": "object", + "description": "Represents an input into a call to [SearchVendors](api-endpoint:Vendors-SearchVendors).", + "x-release-status": "BETA", + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchVendorsRequestFilter", + "description": "Specifies a filter used to search for vendors." + }, + "sort": { + "$ref": "#/components/schemas/SearchVendorsRequestSort", + "description": "Specifies a sorter used to sort the returned vendors." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "query": { + "filter": { + "name": [ + "Joe's Fresh Seafood", + "Hannah's Bakery" + ], + "status": [ + "ACTIVE" + ] + }, + "sort": { + "field": "CREATED_AT", + "order": "ASC" + } + } + } + }, + "SearchVendorsRequestFilter": { + "type": "object", + "description": "Defines supported query expressions to search for vendors by.", + "x-release-status": "BETA", + "properties": { + "name": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The names of the [Vendor](entity:Vendor) objects to retrieve.", + "nullable": true + }, + "status": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VendorStatus" + }, + "description": "The statuses of the [Vendor](entity:Vendor) objects to retrieve.\nSee [VendorStatus](#type-vendorstatus) for possible values", + "nullable": true + } + } + }, + "SearchVendorsRequestSort": { + "type": "object", + "description": "Defines a sorter used to sort results from [SearchVendors](api-endpoint:Vendors-SearchVendors).", + "x-release-status": "BETA", + "properties": { + "field": { + "$ref": "#/components/schemas/SearchVendorsRequestSortField", + "description": "Specifies the sort key to sort the returned vendors.\nSee [Field](#type-field) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "Specifies the sort order for the returned vendors.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "SearchVendorsRequestSortField": { + "type": "string", + "enum": [ + "NAME", + "CREATED_AT" + ], + "x-enum-elements": [ + { + "name": "NAME", + "description": "To sort the result by the name of the [Vendor](entity:Vendor) objects." + }, + { + "name": "CREATED_AT", + "description": "To sort the result by the creation time of the [Vendor](entity:Vendor) objects." + } + ], + "description": "The field to sort the returned [Vendor](entity:Vendor) objects by.", + "x-release-status": "BETA" + }, + "SearchVendorsResponse": { + "type": "object", + "description": "Represents an output from a call to [SearchVendors](api-endpoint:Vendors-SearchVendors).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered when the request fails." + }, + "vendors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Vendor" + }, + "description": "The [Vendor](entity:Vendor) objects matching the specified search filter." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "vendors": [ + { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "a vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 1 + } + ] + } + }, + "SegmentFilter": { + "type": "object", + "description": "A query filter to search for buyer-accessible appointment segments by.", + "x-release-status": "PUBLIC", + "required": [ + "service_variation_id" + ], + "properties": { + "service_variation_id": { + "type": "string", + "description": "The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.", + "minLength": 1, + "maxLength": 36 + }, + "team_member_id_filter": { + "$ref": "#/components/schemas/FilterValue", + "description": "A query filter to search for buyer-accessible appointment segments with service-providing team members matching the specified list of team member IDs. Supported query expressions are\n- `ANY`: return the appointment segments with team members whose IDs match any member in this list.\n- `NONE`: return the appointment segments with team members whose IDs are not in this list.\n- `ALL`: not supported.\n\nWhen no expression is specified, any service-providing team member is eligible to fulfill the Booking.", + "nullable": true + } + } + }, + "SelectOption": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "reference_id", + "title" + ], + "properties": { + "reference_id": { + "type": "string", + "description": "The reference id for the option.", + "minLength": 1, + "maxLength": 40 + }, + "title": { + "type": "string", + "description": "The title text that displays in the select option button.", + "minLength": 1, + "maxLength": 250 + } + } + }, + "SelectOptions": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "title", + "body", + "options" + ], + "properties": { + "title": { + "type": "string", + "description": "The title text to display in the select flow on the Terminal.", + "minLength": 1, + "maxLength": 250 + }, + "body": { + "type": "string", + "description": "The body text to display in the select flow on the Terminal.", + "minLength": 1, + "maxLength": 10000 + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SelectOption" + }, + "description": "Represents the buttons/options that should be displayed in the select flow on the Terminal." + }, + "selected_option": { + "$ref": "#/components/schemas/SelectOption", + "description": "The buyer’s selected option.", + "readOnly": true + } + } + }, + "Shift": { + "type": "object", + "description": "A record of the hourly rate, start, and end times for a single work shift\nfor an employee. This might include a record of the start and end times for breaks\ntaken during the shift.\n\nDeprecated at Square API version 2025-05-21. Replaced by [Timecard](entity:Timecard).\nSee the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "required": [ + "location_id", + "start_at" + ], + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object.", + "maxLength": 255 + }, + "employee_id": { + "type": "string", + "description": "The ID of the employee this shift belongs to. DEPRECATED at version 2020-08-26. Use `team_member_id` instead.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location this shift occurred at. The location should be based on\nwhere the employee clocked in.", + "minLength": 1 + }, + "timezone": { + "type": "string", + "description": "The read-only convenience value that is calculated from the location based\non the `location_id`. Format: the IANA timezone database identifier for the\nlocation timezone.", + "nullable": true + }, + "start_at": { + "type": "string", + "description": "RFC 3339; shifted to the location timezone + offset. Precision up to the\nminute is respected; seconds are truncated.", + "minLength": 1 + }, + "end_at": { + "type": "string", + "description": "RFC 3339; shifted to the timezone + offset. Precision up to the minute is\nrespected; seconds are truncated.", + "nullable": true + }, + "wage": { + "$ref": "#/components/schemas/ShiftWage", + "description": "Job and pay related information. If the wage is not set on create, it defaults to a wage\nof zero. If the title is not set on create, it defaults to the name of the role the employee\nis assigned to, if any.", + "nullable": true + }, + "breaks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Break" + }, + "description": "A list of all the paid or unpaid breaks that were taken during this shift.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ShiftStatus", + "description": "Describes the working state of the current `Shift`.\nSee [ShiftStatus](#type-shiftstatus) for possible values", + "nullable": true + }, + "version": { + "type": "integer", + "description": "Used for resolving concurrency issues. The request fails if the version\nprovided does not match the server version at the time of the request. If not provided,\nSquare executes a blind write; potentially overwriting data from another\nwrite." + }, + "created_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format; presented in UTC.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format; presented in UTC.", + "readOnly": true + }, + "team_member_id": { + "type": "string", + "description": "The ID of the team member this shift belongs to. Replaced `employee_id` at version \"2020-08-26\".", + "nullable": true + }, + "declared_cash_tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The tips declared by the team member for the shift.", + "nullable": true + } + } + }, + "ShiftFilter": { + "type": "object", + "description": "Defines a filter used in a search for `Shift` records. `AND` logic is\nused by Square's servers to apply each filter property specified.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fetch shifts for the specified location.", + "nullable": true + }, + "employee_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` instead.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ShiftFilterStatus", + "description": "Fetch a `Shift` instance by `Shift.status`.\nSee [ShiftFilterStatus](#type-shiftfilterstatus) for possible values", + "nullable": true + }, + "start": { + "$ref": "#/components/schemas/TimeRange", + "description": "Fetch `Shift` instances that start in the time range - Inclusive.", + "nullable": true + }, + "end": { + "$ref": "#/components/schemas/TimeRange", + "description": "Fetch the `Shift` instances that end in the time range - Inclusive.", + "nullable": true + }, + "workday": { + "$ref": "#/components/schemas/ShiftWorkday", + "description": "Fetch the `Shift` instances based on the workday date range.", + "nullable": true + }, + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fetch shifts for the specified team members. Replaced `employee_ids` at version \"2020-08-26\".", + "nullable": true + } + } + }, + "ShiftFilterStatus": { + "type": "string", + "enum": [ + "OPEN", + "CLOSED" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "Shifts that have been started and not ended." + }, + { + "name": "CLOSED", + "description": "Shifts that have been started and ended." + } + ], + "description": "Specifies the `status` of `Shift` records to be returned.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED" + }, + "ShiftQuery": { + "type": "object", + "description": "The parameters of a `Shift` search query, which includes filter and sort options.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "properties": { + "filter": { + "$ref": "#/components/schemas/ShiftFilter", + "description": "Query filter options.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/ShiftSort", + "description": "Sort order details.", + "nullable": true + } + } + }, + "ShiftSort": { + "type": "object", + "description": "Sets the sort order of search results.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "properties": { + "field": { + "$ref": "#/components/schemas/ShiftSortField", + "description": "The field to sort on.\nSee [ShiftSortField](#type-shiftsortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order in which results are returned. Defaults to DESC.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "ShiftSortField": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "The start date/time of a `Shift`" + }, + { + "name": "END_AT", + "description": "The end date/time of a `Shift`" + }, + { + "name": "CREATED_AT", + "description": "The date/time that a `Shift` is created" + }, + { + "name": "UPDATED_AT", + "description": "The most recent date/time that a `Shift` is updated" + } + ], + "description": "Enumerates the `Shift` fields to sort on.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED" + }, + "ShiftStatus": { + "type": "string", + "enum": [ + "OPEN", + "CLOSED" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "Employee started a work shift and the shift is not complete" + }, + { + "name": "CLOSED", + "description": "Employee started and ended a work shift." + } + ], + "description": "Enumerates the possible status of a `Shift`.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED" + }, + "ShiftWage": { + "type": "object", + "description": "The hourly wage rate used to compensate an employee for this shift.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "properties": { + "title": { + "type": "string", + "description": "The name of the job performed during this shift.", + "nullable": true + }, + "hourly_rate": { + "$ref": "#/components/schemas/Money", + "description": "Can be a custom-set hourly wage or the calculated effective hourly\nwage based on the annual wage and hours worked per week.", + "nullable": true + }, + "job_id": { + "type": "string", + "description": "The id of the job performed during this shift. Square\nlabor-reporting UIs might group shifts together by id.", + "readOnly": true + }, + "tip_eligible": { + "type": "boolean", + "description": "Whether team members are eligible for tips when working this job.", + "nullable": true + } + } + }, + "ShiftWorkday": { + "type": "object", + "description": "A `Shift` search query filter parameter that sets a range of days that\na `Shift` must start or end in before passing the filter condition.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "properties": { + "date_range": { + "$ref": "#/components/schemas/DateRange", + "description": "Dates for fetching the shifts.", + "nullable": true + }, + "match_shifts_by": { + "$ref": "#/components/schemas/ShiftWorkdayMatcher", + "description": "The strategy on which the dates are applied.\nSee [ShiftWorkdayMatcher](#type-shiftworkdaymatcher) for possible values", + "nullable": true + }, + "default_timezone": { + "type": "string", + "description": "Location-specific timezones convert workdays to datetime filters.\nEvery location included in the query must have a timezone or this field\nmust be provided as a fallback. Format: the IANA timezone database\nidentifier for the relevant timezone.", + "nullable": true + } + } + }, + "ShiftWorkdayMatcher": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "INTERSECTION" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "All shifts that start on or after the specified workday" + }, + { + "name": "END_AT", + "description": "All shifts that end on or before the specified workday" + }, + { + "name": "INTERSECTION", + "description": "All shifts that start between the start and end workdays (inclusive)" + } + ], + "description": "Defines the logic used to apply a workday filter.", + "x-release-status": "DEPRECATED" + }, + "ShippingFee": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "charge" + ], + "properties": { + "name": { + "type": "string", + "description": "The name for the shipping fee.", + "nullable": true + }, + "charge": { + "$ref": "#/components/schemas/Money", + "description": "The amount and currency for the shipping fee." + } + } + }, + "SignatureImage": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "image_type": { + "type": "string", + "description": "The mime/type of the image data.\nUse `image/png;base64` for png.", + "readOnly": true + }, + "data": { + "type": "string", + "description": "The base64 representation of the image.", + "readOnly": true + } + } + }, + "SignatureOptions": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "title", + "body" + ], + "properties": { + "title": { + "type": "string", + "description": "The title text to display in the signature capture flow on the Terminal.", + "minLength": 1, + "maxLength": 250 + }, + "body": { + "type": "string", + "description": "The body text to display in the signature capture flow on the Terminal.", + "minLength": 1, + "maxLength": 10000 + }, + "signature": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SignatureImage" + }, + "description": "An image representation of the collected signature.", + "readOnly": true + } + } + }, + "Site": { + "type": "object", + "description": "Represents a Square Online site, which is an online store for a Square seller.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the site.", + "maxLength": 32, + "readOnly": true + }, + "site_title": { + "type": "string", + "description": "The title of the site.", + "nullable": true + }, + "domain": { + "type": "string", + "description": "The domain of the site (without the protocol). For example, `mysite1.square.site`.", + "nullable": true + }, + "is_published": { + "type": "boolean", + "description": "Indicates whether the site is published.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the site was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the site was last updated, in RFC 3339 format.", + "readOnly": true + } + } + }, + "Snippet": { + "type": "object", + "description": "Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages.", + "x-release-status": "PUBLIC", + "required": [ + "content" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID for the snippet.", + "maxLength": 48, + "readOnly": true + }, + "site_id": { + "type": "string", + "description": "The ID of the site that contains the snippet.", + "readOnly": true + }, + "content": { + "type": "string", + "description": "The snippet code, which can contain valid HTML, JavaScript, or both.", + "minLength": 1, + "maxLength": 65535 + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the snippet was initially added to the site, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the snippet was last updated on the site, in RFC 3339 format.", + "readOnly": true + } + } + }, + "SortOrder": { + "type": "string", + "enum": [ + "DESC", + "ASC" + ], + "x-enum-elements": [ + { + "name": "DESC", + "description": "The results are returned in descending (e.g., newest-first or Z-A) order." + }, + { + "name": "ASC", + "description": "The results are returned in ascending (e.g., oldest-first or A-Z) order." + } + ], + "description": "The order (e.g., chronological or alphabetical) in which results from a request are returned.", + "x-release-status": "PUBLIC" + }, + "SourceApplication": { + "type": "object", + "description": "Represents information about the application used to generate a change.", + "x-release-status": "PUBLIC", + "properties": { + "product": { + "$ref": "#/components/schemas/Product", + "description": "__Read only__ The [product](entity:Product) type of the application.\nSee [Product](#type-product) for possible values", + "nullable": true + }, + "application_id": { + "type": "string", + "description": "__Read only__ The Square-assigned ID of the application. This field is used only if the\n[product](entity:Product) type is `EXTERNAL_API`.", + "nullable": true + }, + "name": { + "type": "string", + "description": "__Read only__ The display name of the application\n(for example, `\"Custom Application\"` or `\"Square POS 4.74 for Android\"`).", + "nullable": true + } + } + }, + "SquareAccountDetails": { + "type": "object", + "description": "Additional details about Square Account payments.", + "x-release-status": "PUBLIC", + "properties": { + "payment_source_token": { + "type": "string", + "description": "Unique identifier for the payment source used for this payment.", + "maxLength": 255, + "nullable": true + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request.", + "nullable": true + } + } + }, + "StandardUnitDescription": { + "type": "object", + "description": "Contains the name and abbreviation for standard measurement unit.", + "x-release-status": "PUBLIC", + "properties": { + "unit": { + "$ref": "#/components/schemas/MeasurementUnit", + "description": "Identifies the measurement unit being described.", + "nullable": true + }, + "name": { + "type": "string", + "description": "UI display name of the measurement unit. For example, 'Pound'.", + "nullable": true + }, + "abbreviation": { + "type": "string", + "description": "UI display abbreviation for the measurement unit. For example, 'lb'.", + "nullable": true + } + } + }, + "StandardUnitDescriptionGroup": { + "type": "object", + "description": "Group of standard measurement units.", + "x-release-status": "PUBLIC", + "properties": { + "standard_unit_descriptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StandardUnitDescription" + }, + "description": "List of standard (non-custom) measurement units in this description group.", + "nullable": true + }, + "language_code": { + "type": "string", + "description": "IETF language tag.", + "nullable": true + } + } + }, + "SubmitEvidenceResponse": { + "type": "object", + "description": "Defines the fields in a `SubmitEvidence` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "dispute": { + "$ref": "#/components/schemas/Dispute", + "description": "The `Dispute` for which evidence was submitted." + } + }, + "example": { + "dispute": { + "amount_money": { + "amount": 4350, + "currency": "USD" + }, + "brand_dispute_id": "100000399240", + "card_brand": "VISA", + "created_at": "2022-05-18T16:02:15.313Z", + "disputed_payment": { + "payment_id": "2yeBUWJzllJTpmnSqtMRAL19taB" + }, + "due_at": "2022-06-01T00:00:00.000Z", + "id": "EAZoK70gX3fyvibecLwIGB", + "location_id": "LSY8XKGSMMX94", + "reason": "CUSTOMER_REQUESTS_CREDIT", + "reported_at": "2022-05-18T00:00:00.000Z", + "state": "PROCESSING", + "updated_at": "2022-05-18T16:02:15.313Z", + "version": 4 + } + } + }, + "Subscription": { + "type": "object", + "description": "Represents a subscription purchased by a customer.\n\nFor more information, see\n[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the subscription.", + "maxLength": 255, + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the subscription.", + "readOnly": true + }, + "plan_variation_id": { + "type": "string", + "description": "The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation).", + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "The ID of the subscribing [customer](entity:Customer) profile.", + "readOnly": true + }, + "start_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the subscription.", + "readOnly": true + }, + "canceled_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to cancel the subscription, \nwhen the subscription status changes to `CANCELED` and the subscription billing stops.\n\nIf this field is not set, the subscription ends according its subscription plan.\n\nThis field cannot be updated, other than being cleared.", + "nullable": true + }, + "charged_through_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date up to when the subscriber is invoiced for the\nsubscription.\n\nAfter the invoice is sent for a given billing period,\nthis date will be the last day of the billing period.\nFor example,\nsuppose for the month of May a subscriber gets an invoice\n(or charged the card) on May 1. For the monthly billing scenario,\nthis date is then set to May 31.", + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/SubscriptionStatus", + "description": "The current status of the subscription.\nSee [SubscriptionStatus](#type-subscriptionstatus) for possible values", + "readOnly": true + }, + "tax_percentage": { + "type": "string", + "description": "The tax amount applied when billing the subscription. The\npercentage is expressed in decimal form, using a `'.'` as the decimal\nseparator and without a `'%'` sign. For example, a value of `7.5`\ncorresponds to 7.5%.", + "nullable": true + }, + "invoice_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the [invoices](entity:Invoice) created for the\nsubscription, listed in order when the invoices were created\n(newest invoices appear first).", + "readOnly": true + }, + "price_override_money": { + "$ref": "#/components/schemas/Money", + "description": "A custom price which overrides the cost of a subscription plan variation with `STATIC` pricing.\nThis field does not affect itemized subscriptions with `RELATIVE` pricing. Instead, \nyou should edit the Subscription's [order template](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#phases-and-order-templates).", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version of the object. When updating an object, the version\nsupplied must match the version in the database, otherwise the write will\nbe rejected as conflicting.", + "format": "int64" + }, + "created_at": { + "type": "string", + "description": "The timestamp when the subscription was created, in RFC 3339 format.", + "readOnly": true + }, + "card_id": { + "type": "string", + "description": "The ID of the [subscriber's](entity:Customer) [card](entity:Card)\nused to charge for the subscription.", + "nullable": true + }, + "timezone": { + "type": "string", + "description": "Timezone that will be used in date calculations for the subscription.\nDefaults to the timezone of the location based on `location_id`.\nFormat: the IANA Timezone Database identifier for the location timezone (for example, `America/Los_Angeles`).", + "readOnly": true + }, + "source": { + "$ref": "#/components/schemas/SubscriptionSource", + "description": "The origination details of the subscription.", + "x-release-status": "BETA", + "nullable": true + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "The list of scheduled actions on this subscription. It is set only in the response from \n[RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) with the query parameter\nof `include=actions` or from \n[SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) with the input parameter \nof `include:[\"actions\"]`.", + "x-release-status": "BETA", + "nullable": true + }, + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The day of the month on which the subscription will issue invoices and publish orders.", + "readOnly": true, + "x-release-status": "BETA" + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Phase" + }, + "description": "array of phases for this subscription", + "readOnly": true + } + } + }, + "SubscriptionAction": { + "type": "object", + "description": "Represents an action as a pending change to a subscription.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "The ID of an action scoped to a subscription." + }, + "type": { + "$ref": "#/components/schemas/SubscriptionActionType", + "description": "The type of the action.\nSee [SubscriptionActionType](#type-subscriptionactiontype) for possible values", + "nullable": true + }, + "effective_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the action occurs on the subscription.", + "nullable": true + }, + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` action.", + "nullable": true + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Phase" + }, + "description": "A list of Phases, to pass phase-specific information used in the swap.", + "nullable": true + }, + "new_plan_variation_id": { + "type": "string", + "description": "The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action.", + "nullable": true + } + } + }, + "SubscriptionActionType": { + "type": "string", + "enum": [ + "CANCEL", + "PAUSE", + "RESUME", + "SWAP_PLAN", + "CHANGE_BILLING_ANCHOR_DATE" + ], + "x-enum-elements": [ + { + "name": "CANCEL", + "description": "The action to execute a scheduled cancellation of a subscription." + }, + { + "name": "PAUSE", + "description": "The action to execute a scheduled pause of a subscription." + }, + { + "name": "RESUME", + "description": "The action to execute a scheduled resumption of a subscription." + }, + { + "name": "SWAP_PLAN", + "description": "The action to execute a scheduled swap of a subscription plan in a subscription." + }, + { + "name": "CHANGE_BILLING_ANCHOR_DATE", + "description": "A billing anchor date change action." + } + ], + "description": "Supported types of an action as a pending change to a subscription.", + "x-release-status": "BETA" + }, + "SubscriptionCadence": { + "type": "string", + "enum": [ + "DAILY", + "WEEKLY", + "EVERY_TWO_WEEKS", + "THIRTY_DAYS", + "SIXTY_DAYS", + "NINETY_DAYS", + "MONTHLY", + "EVERY_TWO_MONTHS", + "QUARTERLY", + "EVERY_FOUR_MONTHS", + "EVERY_SIX_MONTHS", + "ANNUAL", + "EVERY_TWO_YEARS" + ], + "x-enum-elements": [ + { + "name": "DAILY", + "description": "Once per day" + }, + { + "name": "WEEKLY", + "description": "Once per week" + }, + { + "name": "EVERY_TWO_WEEKS", + "description": "Every two weeks" + }, + { + "name": "THIRTY_DAYS", + "description": "Once every 30 days" + }, + { + "name": "SIXTY_DAYS", + "description": "Once every 60 days" + }, + { + "name": "NINETY_DAYS", + "description": "Once every 90 days" + }, + { + "name": "MONTHLY", + "description": "Once per month" + }, + { + "name": "EVERY_TWO_MONTHS", + "description": "Once every two months" + }, + { + "name": "QUARTERLY", + "description": "Once every three months" + }, + { + "name": "EVERY_FOUR_MONTHS", + "description": "Once every four months" + }, + { + "name": "EVERY_SIX_MONTHS", + "description": "Once every six months" + }, + { + "name": "ANNUAL", + "description": "Once per year" + }, + { + "name": "EVERY_TWO_YEARS", + "description": "Once every two years" + } + ], + "description": "Determines the billing cadence of a [Subscription](entity:Subscription)", + "x-release-status": "PUBLIC" + }, + "SubscriptionCreatedEvent": { + "type": "object", + "description": "Published when a [Subscription](entity:Subscription) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"subscription.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/SubscriptionCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-07-15T05:14:11.002Z", + "data": { + "id": "592b9720-d2ef-4ee4-b3fd-9d98e4f829d2", + "object": { + "subscription": { + "created_date": "2020-07-15", + "customer_id": "QX2XG9GMQS2BVBJKPG8CJ8JKCR", + "id": "592b9720-d2ef-4ee4-b3fd-9d98e4f829d2", + "location_id": "EZHGJ7SNVAJ19", + "plan_variation_id": "CRUUZUK5W6PIIM6H54242NV6", + "start_date": "2020-07-15", + "status": "ACTIVE", + "tax_percentage": "5", + "timezone": "America/New_York", + "version": 1594790050754 + } + }, + "type": "subscription" + }, + "event_id": "65bc2e81-bcdc-4add-abfd-7a012b8f3d2a", + "merchant_id": "VSE65BA53PXCC", + "type": "subscription.created" + }, + "x-webhook": { + "event": "subscription.created", + "scopes": [ + "SUBSCRIPTIONS_READ" + ] + }, + "x-api": "#/components/x-apis/Subscriptions", + "x-since": "2020-08-12" + }, + "SubscriptionCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"subscription\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected subscription.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/SubscriptionCreatedEventObject", + "description": "An object containing the created subscription.", + "nullable": true + } + } + }, + "SubscriptionCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The created subscription.", + "nullable": true + } + } + }, + "SubscriptionEvent": { + "type": "object", + "description": "Describes changes to a subscription and the subscription status.", + "x-release-status": "PUBLIC", + "required": [ + "id", + "subscription_event_type", + "effective_date", + "plan_variation_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the subscription event." + }, + "subscription_event_type": { + "$ref": "#/components/schemas/SubscriptionEventSubscriptionEventType", + "description": "Type of the subscription event.\nSee [SubscriptionEventSubscriptionEventType](#type-subscriptioneventsubscriptioneventtype) for possible values" + }, + "effective_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the subscription event occurred." + }, + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The day-of-the-month the billing anchor date was changed to, if applicable.", + "readOnly": true, + "x-release-status": "BETA" + }, + "info": { + "$ref": "#/components/schemas/SubscriptionEventInfo", + "description": "Additional information about the subscription event.", + "nullable": true + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Phase" + }, + "description": "A list of Phases, to pass phase-specific information used in the swap.", + "nullable": true + }, + "plan_variation_id": { + "type": "string", + "description": "The ID of the subscription plan variation associated with the subscription." + } + } + }, + "SubscriptionEventInfo": { + "type": "object", + "description": "Provides information about the subscription event.", + "x-release-status": "PUBLIC", + "properties": { + "detail": { + "type": "string", + "description": "A human-readable explanation for the event.", + "nullable": true + }, + "code": { + "$ref": "#/components/schemas/SubscriptionEventInfoCode", + "description": "An info code indicating the subscription event that occurred.\nSee [InfoCode](#type-infocode) for possible values", + "nullable": true + } + } + }, + "SubscriptionEventInfoCode": { + "type": "string", + "enum": [ + "LOCATION_NOT_ACTIVE", + "LOCATION_CANNOT_ACCEPT_PAYMENT", + "CUSTOMER_DELETED", + "CUSTOMER_NO_EMAIL", + "CUSTOMER_NO_NAME", + "USER_PROVIDED" + ], + "x-enum-elements": [ + { + "name": "LOCATION_NOT_ACTIVE", + "description": "The location is not active." + }, + { + "name": "LOCATION_CANNOT_ACCEPT_PAYMENT", + "description": "The location cannot accept payments." + }, + { + "name": "CUSTOMER_DELETED", + "description": "The subscribing customer profile has been deleted." + }, + { + "name": "CUSTOMER_NO_EMAIL", + "description": "The subscribing customer does not have an email." + }, + { + "name": "CUSTOMER_NO_NAME", + "description": "The subscribing customer does not have a name." + }, + { + "name": "USER_PROVIDED", + "description": "User-provided detail." + } + ], + "description": "Supported info codes of a subscription event.", + "x-release-status": "PUBLIC" + }, + "SubscriptionEventSubscriptionEventType": { + "type": "string", + "enum": [ + "START_SUBSCRIPTION", + "PLAN_CHANGE", + "STOP_SUBSCRIPTION", + "DEACTIVATE_SUBSCRIPTION", + "RESUME_SUBSCRIPTION", + "PAUSE_SUBSCRIPTION", + "BILLING_ANCHOR_DATE_CHANGED" + ], + "x-enum-elements": [ + { + "name": "START_SUBSCRIPTION", + "description": "The subscription was started." + }, + { + "name": "PLAN_CHANGE", + "description": "The subscription plan was changed." + }, + { + "name": "STOP_SUBSCRIPTION", + "description": "The subscription was stopped." + }, + { + "name": "DEACTIVATE_SUBSCRIPTION", + "description": "The subscription was deactivated" + }, + { + "name": "RESUME_SUBSCRIPTION", + "description": "The subscription was resumed." + }, + { + "name": "PAUSE_SUBSCRIPTION", + "description": "The subscription was paused." + }, + { + "name": "BILLING_ANCHOR_DATE_CHANGED", + "description": "The billing anchor date was changed." + } + ], + "description": "Supported types of an event occurred to a subscription.", + "x-release-status": "PUBLIC" + }, + "SubscriptionPhase": { + "type": "object", + "description": "Describes a phase in a subscription plan variation. For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations).", + "x-release-status": "PUBLIC", + "required": [ + "cadence" + ], + "properties": { + "uid": { + "type": "string", + "description": "The Square-assigned ID of the subscription phase. This field cannot be changed after a `SubscriptionPhase` is created.", + "nullable": true + }, + "cadence": { + "$ref": "#/components/schemas/SubscriptionCadence", + "description": "The billing cadence of the phase. For example, weekly or monthly. This field cannot be changed after a `SubscriptionPhase` is created.\nSee [SubscriptionCadence](#type-subscriptioncadence) for possible values" + }, + "periods": { + "type": "integer", + "description": "The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can be indefinite. This field cannot be changed after a `SubscriptionPhase` is created.", + "nullable": true + }, + "recurring_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount to bill for each `cadence`. Failure to specify this field results in a `MISSING_REQUIRED_PARAMETER` error at runtime.", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The position this phase appears in the sequence of phases defined for the plan, indexed from 0. This field cannot be changed after a `SubscriptionPhase` is created.", + "format": "int64", + "nullable": true + }, + "pricing": { + "$ref": "#/components/schemas/SubscriptionPricing", + "description": "The subscription pricing.", + "nullable": true + } + } + }, + "SubscriptionPricing": { + "type": "object", + "description": "Describes the pricing for the subscription.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "$ref": "#/components/schemas/SubscriptionPricingType", + "description": "RELATIVE or STATIC\nSee [SubscriptionPricingType](#type-subscriptionpricingtype) for possible values", + "nullable": true + }, + "discount_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The ids of the discount catalog objects", + "nullable": true + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The price of the subscription, if STATIC", + "nullable": true + } + } + }, + "SubscriptionPricingType": { + "type": "string", + "enum": [ + "STATIC", + "RELATIVE" + ], + "x-enum-elements": [ + { + "name": "STATIC", + "description": "Static pricing" + }, + { + "name": "RELATIVE", + "description": "Relative pricing" + } + ], + "description": "Determines the pricing of a [Subscription](entity:Subscription)", + "x-release-status": "PUBLIC" + }, + "SubscriptionSource": { + "type": "object", + "description": "The origination details of the subscription.", + "x-release-status": "BETA", + "properties": { + "name": { + "type": "string", + "description": "The name used to identify the place (physical or digital) that\na subscription originates. If unset, the name defaults to the name\nof the application that created the subscription.", + "maxLength": 255, + "nullable": true + } + } + }, + "SubscriptionStatus": { + "type": "string", + "enum": [ + "PENDING", + "ACTIVE", + "CANCELED", + "DEACTIVATED", + "PAUSED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The subscription is pending to start in the future." + }, + { + "name": "ACTIVE", + "description": "The subscription is active." + }, + { + "name": "CANCELED", + "description": "The subscription is canceled." + }, + { + "name": "DEACTIVATED", + "description": "The subscription is deactivated." + }, + { + "name": "PAUSED", + "description": "The subscription is paused." + } + ], + "description": "Supported subscription statuses.", + "x-release-status": "PUBLIC" + }, + "SubscriptionTestResult": { + "type": "object", + "description": "Represents the details of a webhook subscription, including notification URL,\nevent types, and signature key.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A Square-generated unique ID for the subscription test result.", + "maxLength": 64, + "readOnly": true + }, + "status_code": { + "type": "integer", + "description": "The status code returned by the subscription notification URL.", + "nullable": true + }, + "payload": { + "type": "string", + "description": "An object containing the payload of the test event. For example, a `payment.created` event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the subscription was created, in RFC 3339 format. \nFor example, \"2016-09-04T23:59:33.123Z\".", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the subscription was updated, in RFC 3339 format. For example, \"2016-09-04T23:59:33.123Z\".\nBecause a subscription test result is unique, this field is the same as the `created_at` field.", + "readOnly": true + } + } + }, + "SubscriptionUpdatedEvent": { + "type": "object", + "description": "Published when a [Subscription](entity:Subscription) is updated.\nTypically the `subscription.status` is updated as subscriptions become active\nor cancelled.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"subscription.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/SubscriptionUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-07-15T05:14:11.213Z", + "data": { + "id": "592b9720-d2ef-4ee4-b3fd-9d98e4f829d2", + "object": { + "subscription": { + "created_date": "2020-07-15", + "customer_id": "QX2XG9GMQS2BVBJKPG8CJ8JKCR", + "id": "592b9720-d2ef-4ee4-b3fd-9d98e4f829d2", + "location_id": "EZHGJ7SNVAJ19", + "plan_variation_id": "CRUUZUK5W6PIIM6H54242NV6", + "start_date": "2020-07-15", + "status": "ACTIVE", + "tax_percentage": "5", + "timezone": "America/New_York", + "version": 1594790050754 + } + }, + "type": "subscription" + }, + "event_id": "c0b40cc0-7cb2-4aa1-81ce-0893b9b0b9b8", + "merchant_id": "VSE65BA53PXCC", + "type": "subscription.updated" + }, + "x-webhook": { + "event": "subscription.updated", + "scopes": [ + "SUBSCRIPTIONS_READ" + ] + }, + "x-api": "#/components/x-apis/Subscriptions", + "x-since": "2020-08-12" + }, + "SubscriptionUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"subscription\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected subscription.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/SubscriptionUpdatedEventObject", + "description": "An object containing the updated subscription.", + "nullable": true + } + } + }, + "SubscriptionUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The updated subscription.", + "nullable": true + } + } + }, + "SwapPlanRequest": { + "type": "object", + "description": "Defines input parameters in a call to the\n[SwapPlan](api-endpoint:Subscriptions-SwapPlan) endpoint.", + "x-release-status": "BETA", + "properties": { + "new_plan_variation_id": { + "type": "string", + "description": "The ID of the new subscription plan variation.\n\nThis field is required.", + "nullable": true + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PhaseInput" + }, + "description": "A list of PhaseInputs, to pass phase-specific information used in the swap.", + "nullable": true + } + }, + "example": { + "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "phases": [ + { + "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY", + "ordinal": 0 + } + ] + } + }, + "SwapPlanResponse": { + "type": "object", + "description": "Defines output parameters in a response of the \n[SwapPlan](api-endpoint:Subscriptions-SwapPlan) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The subscription with the updated subscription plan." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "A list of a `SWAP_PLAN` action created by the request." + } + }, + "example": { + "actions": [ + { + "effective_date": "2023-11-17", + "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83", + "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "phases": [ + { + "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY", + "ordinal": 0 + } + ], + "type": "SWAP_PLAN" + } + ], + "subscription": { + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "9ba40961-995a-4a3d-8c53-048c40cafc13", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY", + "ordinal": 0, + "plan_phase_uid": "C66BKH3ASTDYGJJCEZXQQSS7", + "uid": "98d6f53b-40e1-4714-8827-032fd923be25" + } + ], + "plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "price_override_money": { + "amount": 2000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 3 + } + } + }, + "TaxCalculationPhase": { + "type": "string", + "enum": [ + "TAX_SUBTOTAL_PHASE", + "TAX_TOTAL_PHASE" + ], + "x-enum-elements": [ + { + "name": "TAX_SUBTOTAL_PHASE", + "description": "The fee is calculated based on the payment's subtotal." + }, + { + "name": "TAX_TOTAL_PHASE", + "description": "The fee is calculated based on the payment's total." + } + ], + "description": "When to calculate the taxes due on a cart.", + "x-release-status": "PUBLIC" + }, + "TaxIds": { + "type": "object", + "description": "Identifiers for the location used by various governments for tax purposes.", + "x-release-status": "BETA", + "properties": { + "eu_vat": { + "type": "string", + "description": "The EU VAT number for this location. For example, `IE3426675K`.\nIf the EU VAT number is present, it is well-formed and has been\nvalidated with VIES, the VAT Information Exchange System.", + "readOnly": true + }, + "fr_siret": { + "type": "string", + "description": "The SIRET (Système d'Identification du Répertoire des Entreprises et de leurs Etablissements)\nnumber is a 14-digit code issued by the French INSEE. For example, `39922799000021`.", + "readOnly": true + }, + "fr_naf": { + "type": "string", + "description": "The French government uses the NAF (Nomenclature des Activités Françaises) to display and\ntrack economic statistical data. This is also called the APE (Activite Principale de l’Entreprise) code.\nFor example, `6910Z`.", + "readOnly": true + }, + "es_nif": { + "type": "string", + "description": "The NIF (Numero de Identificacion Fiscal) number is a nine-character tax identifier used in Spain.\nIf it is present, it has been validated. For example, `73628495A`.", + "readOnly": true + }, + "jp_qii": { + "type": "string", + "description": "The QII (Qualified Invoice Issuer) number is a 14-character tax identifier used in Japan.\nFor example, `T1234567890123`.", + "readOnly": true + } + } + }, + "TaxInclusionType": { + "type": "string", + "enum": [ + "ADDITIVE", + "INCLUSIVE" + ], + "x-enum-elements": [ + { + "name": "ADDITIVE", + "description": "The tax is an additive tax. The tax amount is added on top of the\nCatalogItemVariation price. For example, a $1.00 item with a 10% additive\ntax would have a total cost to the buyer of $1.10." + }, + { + "name": "INCLUSIVE", + "description": "The tax is an inclusive tax. The tax amount is included in the\nCatalogItemVariation price. For example, a $1.00 item with a 10% inclusive\ntax would have a total cost to the buyer of $1.00, with $0.91 (91 cents) of\nthat total being the cost of the item and $0.09 (9 cents) being tax." + } + ], + "description": "Whether to the tax amount should be additional to or included in the CatalogItem price.", + "x-release-status": "PUBLIC" + }, + "TeamMember": { + "type": "object", + "description": "A record representing an individual team member for a business.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The unique ID for the team member.", + "readOnly": true + }, + "reference_id": { + "type": "string", + "description": "A second ID used to associate the team member with an entity in another system.", + "nullable": true + }, + "is_owner": { + "type": "boolean", + "description": "Whether the team member is the owner of the Square account.", + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/TeamMemberStatus", + "description": "Describes the status of the team member.\nSee [TeamMemberStatus](#type-teammemberstatus) for possible values", + "nullable": true + }, + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the team member.", + "nullable": true + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the team member.", + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address associated with the team member. After accepting the invitation\nfrom Square, only the team member can change this value.", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The team member's phone number, in E.164 format. For example:\n+14155552671 - the country code is 1 for US\n+551155256325 - the country code is 55 for BR", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the team member was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the team member was last updated, in RFC 3339 format.", + "readOnly": true + }, + "assigned_locations": { + "$ref": "#/components/schemas/TeamMemberAssignedLocations", + "description": "Describes the team member's assigned locations.", + "nullable": true + }, + "wage_setting": { + "$ref": "#/components/schemas/WageSetting", + "description": "Information about the team member's overtime exemption status, job assignments, and compensation.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "TeamMemberAssignedLocations": { + "type": "object", + "description": "An object that represents a team member's assignment to locations.", + "x-release-status": "PUBLIC", + "properties": { + "assignment_type": { + "$ref": "#/components/schemas/TeamMemberAssignedLocationsAssignmentType", + "description": "The current assignment type of the team member.\nSee [TeamMemberAssignedLocationsAssignmentType](#type-teammemberassignedlocationsassignmenttype) for possible values", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The explicit locations that the team member is assigned to.", + "nullable": true + } + } + }, + "TeamMemberAssignedLocationsAssignmentType": { + "type": "string", + "enum": [ + "ALL_CURRENT_AND_FUTURE_LOCATIONS", + "EXPLICIT_LOCATIONS" + ], + "x-enum-elements": [ + { + "name": "ALL_CURRENT_AND_FUTURE_LOCATIONS", + "description": "The team member is assigned to all current and future locations. The `location_ids` field\nis empty if the team member has this assignment type." + }, + { + "name": "EXPLICIT_LOCATIONS", + "description": "The team member is assigned to an explicit subset of locations. The `location_ids` field\nis the list of locations that the team member is assigned to." + } + ], + "description": "Enumerates the possible assignment types that the team member can have.", + "x-release-status": "PUBLIC" + }, + "TeamMemberBookingProfile": { + "type": "object", + "description": "The booking profile of a seller's team member, including the team member's ID, display name, description and whether the team member can be booked as a service provider.", + "x-release-status": "PUBLIC", + "properties": { + "team_member_id": { + "type": "string", + "description": "The ID of the [TeamMember](entity:TeamMember) object for the team member associated with the booking profile.", + "maxLength": 32, + "readOnly": true + }, + "description": { + "type": "string", + "description": "The description of the team member.", + "maxLength": 65536, + "readOnly": true + }, + "display_name": { + "type": "string", + "description": "The display name of the team member.", + "maxLength": 512, + "readOnly": true + }, + "is_bookable": { + "type": "boolean", + "description": "Indicates whether the team member can be booked through the Bookings API or the seller's online booking channel or site (`true`) or not (`false`).", + "nullable": true + }, + "profile_image_url": { + "type": "string", + "description": "The URL of the team member's image for the bookings profile.", + "maxLength": 2048, + "readOnly": true + } + } + }, + "TeamMemberCreatedEvent": { + "type": "object", + "description": "Published when a Team Member is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"team_member.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TeamMemberCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2021-03-11T01:16:04.253Z", + "data": { + "id": "TMfCNDbg_wwJvUJY", + "object": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS" + }, + "created_at": "2021-03-11T01:16:03.697Z", + "email_address": "amelia.earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "TMfCNDbg_wwJvUJY", + "is_owner": false, + "phone_number": "+12125554240", + "reference_id": "example-reference-id", + "status": "ACTIVE", + "updated_at": "2021-03-11T01:16:03.697Z" + } + }, + "type": "team_member" + }, + "event_id": "91484f7e-63bc-4253-a86d-18e7ea0b0cfb", + "merchant_id": "0JV5BGNW4EG9R", + "type": "team_member.created" + }, + "x-webhook": { + "event": "team_member.created", + "scopes": [ + "EMPLOYEES_READ" + ] + }, + "x-api": "#/components/x-apis/Team", + "x-since": "2021-04-21" + }, + "TeamMemberCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"team_member\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the created team member." + }, + "object": { + "$ref": "#/components/schemas/TeamMemberCreatedEventObject", + "description": "An object containing the created team member.", + "nullable": true + } + } + }, + "TeamMemberCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The created team member.", + "nullable": true + } + } + }, + "TeamMemberInvitationStatus": { + "type": "string", + "enum": [ + "UNINVITED", + "PENDING", + "ACCEPTED" + ], + "x-enum-elements": [ + { + "name": "UNINVITED", + "description": "The team member has not received an invitation." + }, + { + "name": "PENDING", + "description": "The team member has received an invitation, but had not accepted it." + }, + { + "name": "ACCEPTED", + "description": "The team member has both received and accepted an invitation." + } + ], + "description": "Enumerates the possible invitation statuses the team member can have within a business.", + "x-release-status": "PUBLIC" + }, + "TeamMemberStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "The team member can sign in to Point of Sale and the Seller Dashboard." + }, + { + "name": "INACTIVE", + "description": "The team member can no longer sign in to Point of Sale or the Seller Dashboard,\nbut the team member's sales reports remain available." + } + ], + "description": "Enumerates the possible statuses the team member can have within a business.", + "x-release-status": "PUBLIC" + }, + "TeamMemberUpdatedEvent": { + "type": "object", + "description": "Published when a Team Member is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"team_member.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TeamMemberUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2021-03-11T01:16:04.254Z", + "data": { + "id": "TMfCNDbg_wwJvUJY", + "object": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS" + }, + "created_at": "2021-03-11T01:16:03.697Z", + "email_address": "amelia.earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "TMfCNDbg_wwJvUJY", + "is_owner": false, + "phone_number": "+12125554240", + "reference_id": "example-reference-id", + "status": "ACTIVE", + "updated_at": "2021-03-11T01:16:03.697Z" + } + }, + "type": "team_member" + }, + "event_id": "86c18838-51a7-4bdd-a6ff-3ffd2c1c5eb9", + "merchant_id": "0JV5BGNW4EG9R", + "type": "team_member.updated" + }, + "x-webhook": { + "event": "team_member.updated", + "scopes": [ + "EMPLOYEES_READ" + ] + }, + "x-api": "#/components/x-apis/Team", + "x-since": "2021-04-21" + }, + "TeamMemberUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"team_member\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected team member." + }, + "object": { + "$ref": "#/components/schemas/TeamMemberUpdatedEventObject", + "description": "An object containing the updated team member.", + "nullable": true + } + } + }, + "TeamMemberUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The updated team member.", + "nullable": true + } + } + }, + "TeamMemberWage": { + "type": "object", + "description": "Job and wage information for a [team member](entity:TeamMember).\nThis convenience object provides details needed to specify the `wage`\nfield for a [timecard](entity:Timecard).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object." + }, + "team_member_id": { + "type": "string", + "description": "The `TeamMember` that this wage is assigned to.", + "nullable": true + }, + "title": { + "type": "string", + "description": "The job title that this wage relates to.", + "nullable": true + }, + "hourly_rate": { + "$ref": "#/components/schemas/Money", + "description": "Can be a custom-set hourly wage or the calculated effective hourly\nwage based on the annual wage and hours worked per week.", + "nullable": true + }, + "job_id": { + "type": "string", + "description": "An identifier for the [job](entity:Job) that this wage relates to.", + "nullable": true + }, + "tip_eligible": { + "type": "boolean", + "description": "Whether team members are eligible for tips when working this job.", + "nullable": true + } + } + }, + "TeamMemberWageSettingUpdatedEvent": { + "type": "object", + "description": "Published when a Wage Setting is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"team_member.wage_setting.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TeamMemberWageSettingUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2021-03-11T01:17:03Z", + "data": { + "id": "TMfCNDbg_wwJvUJY", + "object": { + "wage_setting": { + "created_at": "2021-03-11T01:17:02+00:00", + "is_overtime_exempt": true, + "job_assignments": [ + { + "hourly_rate": { + "amount": 800, + "currency": "USD" + }, + "job_title": "Barista", + "pay_type": "HOURLY" + } + ], + "team_member_id": "TMfCNDbg_wwJvUJY", + "updated_at": "2021-03-11T01:17:03+00:00", + "version": 1 + } + }, + "type": "wage_setting" + }, + "event_id": "22ce9c01-d5bc-50ca-85f5-f97140537837", + "merchant_id": "0JV5BGNW4EG9R", + "type": "team_member.wage_setting.updated" + }, + "x-webhook": { + "event": "team_member.wage_setting.updated", + "scopes": [ + "EMPLOYEES_READ" + ] + }, + "x-api": "#/components/x-apis/Team", + "x-since": "2021-04-21" + }, + "TeamMemberWageSettingUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"wage_setting\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated team member wage setting." + }, + "object": { + "$ref": "#/components/schemas/TeamMemberWageSettingUpdatedEventObject", + "description": "An object containing the updated team member wage setting.", + "nullable": true + } + } + }, + "TeamMemberWageSettingUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "wage_setting": { + "$ref": "#/components/schemas/WageSetting", + "description": "The updated team member wage setting.", + "nullable": true + } + } + }, + "Tender": { + "type": "object", + "description": "Represents a tender (i.e., a method of payment) used in a Square transaction.", + "x-release-status": "PUBLIC", + "required": [ + "type" + ], + "properties": { + "id": { + "type": "string", + "description": "The tender's unique ID. It is the associated payment ID.", + "maxLength": 192 + }, + "location_id": { + "type": "string", + "description": "The ID of the transaction's associated location.", + "maxLength": 50, + "nullable": true + }, + "transaction_id": { + "type": "string", + "description": "The ID of the tender's associated transaction.", + "maxLength": 192, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the tender was created, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "note": { + "type": "string", + "description": "An optional note associated with the tender at the time of payment.", + "maxLength": 500, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of the tender, including `tip_money`. If the tender has a `payment_id`,\nthe `total_money` of the corresponding [Payment](entity:Payment) will be equal to the\n`amount_money` of the tender.", + "nullable": true + }, + "tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The tip's amount of the tender.", + "nullable": true + }, + "processing_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of any Square processing fees applied to the tender.\n\nThis field is not immediately populated when a new transaction is created.\nIt is usually available after about ten seconds.", + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "If the tender is associated with a customer or represents a customer's card on file,\nthis is the ID of the associated customer.", + "maxLength": 191, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/TenderType", + "description": "The type of tender, such as `CARD` or `CASH`.\nSee [TenderType](#type-tendertype) for possible values" + }, + "card_details": { + "$ref": "#/components/schemas/TenderCardDetails", + "description": "The details of the card tender.\n\nThis value is present only if the value of `type` is `CARD`.", + "nullable": true + }, + "cash_details": { + "$ref": "#/components/schemas/TenderCashDetails", + "description": "The details of the cash tender.\n\nThis value is present only if the value of `type` is `CASH`.", + "nullable": true + }, + "bank_account_details": { + "$ref": "#/components/schemas/TenderBankAccountDetails", + "description": "The details of the bank account tender.\n\nThis value is present only if the value of `type` is `BANK_ACCOUNT`.", + "nullable": true + }, + "buy_now_pay_later_details": { + "$ref": "#/components/schemas/TenderBuyNowPayLaterDetails", + "description": "The details of a Buy Now Pay Later tender.\n\nThis value is present only if the value of `type` is `BUY_NOW_PAY_LATER`.", + "nullable": true + }, + "square_account_details": { + "$ref": "#/components/schemas/TenderSquareAccountDetails", + "description": "The details of a Square Account tender.\n\nThis value is present only if the value of `type` is `SQUARE_ACCOUNT`.", + "nullable": true + }, + "additional_recipients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdditionalRecipient" + }, + "description": "Additional recipients (other than the merchant) receiving a portion of this tender.\nFor example, fees assessed on the purchase by a third party integration.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The ID of the [Payment](entity:Payment) that corresponds to this tender.\nThis value is only present for payments created with the v2 Payments API.", + "maxLength": 192, + "nullable": true + } + } + }, + "TenderBankAccountDetails": { + "type": "object", + "description": "Represents the details of a tender with `type` `BANK_ACCOUNT`.\n\nSee [BankAccountPaymentDetails](entity:BankAccountPaymentDetails)\nfor more exposed details of a bank account payment.", + "x-release-status": "PUBLIC", + "properties": { + "status": { + "$ref": "#/components/schemas/TenderBankAccountDetailsStatus", + "description": "The bank account payment's current state.\n\nSee [TenderBankAccountPaymentDetailsStatus](entity:TenderBankAccountDetailsStatus) for possible values.\nSee [TenderBankAccountDetailsStatus](#type-tenderbankaccountdetailsstatus) for possible values", + "nullable": true + } + } + }, + "TenderBankAccountDetailsStatus": { + "type": "string", + "enum": [ + "PENDING", + "COMPLETED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The bank account payment is in progress." + }, + { + "name": "COMPLETED", + "description": "The bank account payment has been completed." + }, + { + "name": "FAILED", + "description": "The bank account payment failed." + } + ], + "description": "Indicates the bank account payment's current status.", + "x-release-status": "PUBLIC" + }, + "TenderBuyNowPayLaterDetails": { + "type": "object", + "description": "Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`.", + "x-release-status": "PUBLIC", + "properties": { + "buy_now_pay_later_brand": { + "$ref": "#/components/schemas/TenderBuyNowPayLaterDetailsBrand", + "description": "The Buy Now Pay Later brand.\nSee [Brand](#type-brand) for possible values", + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/TenderBuyNowPayLaterDetailsStatus", + "description": "The buy now pay later payment's current state (such as `AUTHORIZED` or\n`CAPTURED`). See [TenderBuyNowPayLaterDetailsStatus](entity:TenderBuyNowPayLaterDetailsStatus)\nfor possible values.\nSee [Status](#type-status) for possible values", + "nullable": true + } + } + }, + "TenderBuyNowPayLaterDetailsBrand": { + "type": "string", + "enum": [ + "OTHER_BRAND", + "AFTERPAY" + ], + "x-enum-elements": [ + { + "name": "OTHER_BRAND", + "description": "" + }, + { + "name": "AFTERPAY", + "description": "" + } + ], + "x-release-status": "PUBLIC" + }, + "TenderBuyNowPayLaterDetailsStatus": { + "type": "string", + "enum": [ + "AUTHORIZED", + "CAPTURED", + "VOIDED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "AUTHORIZED", + "description": "The buy now pay later payment has been authorized but not yet captured." + }, + { + "name": "CAPTURED", + "description": "The buy now pay later payment was authorized and subsequently captured (i.e., completed)." + }, + { + "name": "VOIDED", + "description": "The buy now pay later payment was authorized and subsequently voided (i.e., canceled)." + }, + { + "name": "FAILED", + "description": "The buy now pay later payment failed." + } + ], + "x-release-status": "PUBLIC" + }, + "TenderCardDetails": { + "type": "object", + "description": "Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD`", + "x-release-status": "PUBLIC", + "properties": { + "status": { + "$ref": "#/components/schemas/TenderCardDetailsStatus", + "description": "The credit card payment's current state (such as `AUTHORIZED` or\n`CAPTURED`). See [TenderCardDetailsStatus](entity:TenderCardDetailsStatus)\nfor possible values.\nSee [TenderCardDetailsStatus](#type-tendercarddetailsstatus) for possible values", + "nullable": true + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The credit card's non-confidential details.", + "nullable": true + }, + "entry_method": { + "$ref": "#/components/schemas/TenderCardDetailsEntryMethod", + "description": "The method used to enter the card's details for the transaction.\nSee [TenderCardDetailsEntryMethod](#type-tendercarddetailsentrymethod) for possible values", + "nullable": true + } + } + }, + "TenderCardDetailsEntryMethod": { + "type": "string", + "enum": [ + "SWIPED", + "KEYED", + "EMV", + "ON_FILE", + "CONTACTLESS" + ], + "x-enum-elements": [ + { + "name": "SWIPED", + "description": "The card was swiped through a Square reader or Square stand." + }, + { + "name": "KEYED", + "description": "The card information was keyed manually into Square Point of Sale or a\nSquare-hosted web form." + }, + { + "name": "EMV", + "description": "The card was processed via EMV with a Square reader." + }, + { + "name": "ON_FILE", + "description": "The buyer's card details were already on file with Square." + }, + { + "name": "CONTACTLESS", + "description": "The card was processed via a contactless (i.e., NFC) transaction\nwith a Square reader." + } + ], + "description": "Indicates the method used to enter the card's details.", + "x-release-status": "PUBLIC" + }, + "TenderCardDetailsStatus": { + "type": "string", + "enum": [ + "AUTHORIZED", + "CAPTURED", + "VOIDED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "AUTHORIZED", + "description": "The card transaction has been authorized but not yet captured." + }, + { + "name": "CAPTURED", + "description": "The card transaction was authorized and subsequently captured (i.e., completed)." + }, + { + "name": "VOIDED", + "description": "The card transaction was authorized and subsequently voided (i.e., canceled)." + }, + { + "name": "FAILED", + "description": "The card transaction failed." + } + ], + "description": "Indicates the card transaction's current status.", + "x-release-status": "PUBLIC" + }, + "TenderCashDetails": { + "type": "object", + "description": "Represents the details of a tender with `type` `CASH`.", + "x-release-status": "PUBLIC", + "properties": { + "buyer_tendered_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of cash provided by the buyer, before change is given.", + "nullable": true + }, + "change_back_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of change returned to the buyer.", + "nullable": true + } + } + }, + "TenderSquareAccountDetails": { + "type": "object", + "description": "Represents the details of a tender with `type` `SQUARE_ACCOUNT`.", + "x-release-status": "PUBLIC", + "properties": { + "status": { + "$ref": "#/components/schemas/TenderSquareAccountDetailsStatus", + "description": "The Square Account payment's current state (such as `AUTHORIZED` or\n`CAPTURED`). See [TenderSquareAccountDetailsStatus](entity:TenderSquareAccountDetailsStatus)\nfor possible values.\nSee [Status](#type-status) for possible values", + "nullable": true + } + } + }, + "TenderSquareAccountDetailsStatus": { + "type": "string", + "enum": [ + "AUTHORIZED", + "CAPTURED", + "VOIDED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "AUTHORIZED", + "description": "The Square Account payment has been authorized but not yet captured." + }, + { + "name": "CAPTURED", + "description": "The Square Account payment was authorized and subsequently captured (i.e., completed)." + }, + { + "name": "VOIDED", + "description": "The Square Account payment was authorized and subsequently voided (i.e., canceled)." + }, + { + "name": "FAILED", + "description": "The Square Account payment failed." + } + ], + "x-release-status": "PUBLIC" + }, + "TenderType": { + "type": "string", + "enum": [ + "CARD", + "CASH", + "THIRD_PARTY_CARD", + "SQUARE_GIFT_CARD", + "NO_SALE", + "BANK_ACCOUNT", + "WALLET", + "BUY_NOW_PAY_LATER", + "SQUARE_ACCOUNT", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "CARD", + "description": "A credit card." + }, + { + "name": "CASH", + "description": "Cash." + }, + { + "name": "THIRD_PARTY_CARD", + "description": "A credit card processed with a card processor other than Square.\n\nThis value applies only to merchants in countries where Square does not\nyet provide card processing." + }, + { + "name": "SQUARE_GIFT_CARD", + "description": "A Square gift card." + }, + { + "name": "NO_SALE", + "description": "This tender represents the register being opened for a \"no sale\" event." + }, + { + "name": "BANK_ACCOUNT", + "description": "A bank account payment." + }, + { + "name": "WALLET", + "description": "A payment from a digital wallet, e.g. Cash App, Paypay, Rakuten Pay,\nAu Pay, D Barai, Merpay, Wechat Pay, Alipay.\n\nNote: Some \"digital wallets\", including Google Pay and Apple Pay, facilitate\ncard payments. Those payments have the `CARD` type." + }, + { + "name": "BUY_NOW_PAY_LATER", + "description": "A Buy Now Pay Later payment." + }, + { + "name": "SQUARE_ACCOUNT", + "description": "A Square House Account payment." + }, + { + "name": "OTHER", + "description": "A form of tender that does not match any other value." + } + ], + "description": "Indicates a tender's type.", + "x-release-status": "PUBLIC" + }, + "TerminalAction": { + "type": "object", + "description": "Represents an action processed by the Square Terminal.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "A unique ID for this `TerminalAction`.", + "minLength": 10, + "maxLength": 255, + "readOnly": true + }, + "device_id": { + "type": "string", + "description": "The unique Id of the device intended for this `TerminalAction`.\nThe Id can be retrieved from /v2/devices api.", + "nullable": true + }, + "deadline_duration": { + "type": "string", + "description": "The duration as an RFC 3339 duration, after which the action will be automatically canceled.\nTerminalActions that are `PENDING` will be automatically `CANCELED` and have a cancellation reason\nof `TIMED_OUT`\n\nDefault: 5 minutes from creation\n\nMaximum: 5 minutes", + "nullable": true + }, + "status": { + "type": "string", + "description": "The status of the `TerminalAction`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`", + "readOnly": true + }, + "cancel_reason": { + "$ref": "#/components/schemas/ActionCancelReason", + "description": "The reason why `TerminalAction` is canceled. Present if the status is `CANCELED`.\nSee [ActionCancelReason](#type-actioncancelreason) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The time when the `TerminalAction` was created as an RFC 3339 timestamp.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The time when the `TerminalAction` was last updated as an RFC 3339 timestamp.", + "readOnly": true + }, + "app_id": { + "type": "string", + "description": "The ID of the application that created the action.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The location id the action is attached to, if a link can be made.", + "maxLength": 64, + "readOnly": true, + "x-release-status": "PUBLIC" + }, + "type": { + "$ref": "#/components/schemas/TerminalActionActionType", + "description": "Represents the type of the action.\nSee [ActionType](#type-actiontype) for possible values", + "nullable": true + }, + "qr_code_options": { + "$ref": "#/components/schemas/QrCodeOptions", + "description": "Describes configuration for the QR code action. Requires `QR_CODE` type.", + "nullable": true + }, + "save_card_options": { + "$ref": "#/components/schemas/SaveCardOptions", + "description": "Describes configuration for the save-card action. Requires `SAVE_CARD` type.", + "nullable": true + }, + "signature_options": { + "$ref": "#/components/schemas/SignatureOptions", + "description": "Describes configuration for the signature capture action. Requires `SIGNATURE` type.", + "nullable": true + }, + "confirmation_options": { + "$ref": "#/components/schemas/ConfirmationOptions", + "description": "Describes configuration for the confirmation action. Requires `CONFIRMATION` type.", + "nullable": true + }, + "receipt_options": { + "$ref": "#/components/schemas/ReceiptOptions", + "description": "Describes configuration for the receipt action. Requires `RECEIPT` type.", + "nullable": true + }, + "data_collection_options": { + "$ref": "#/components/schemas/DataCollectionOptions", + "description": "Describes configuration for the data collection action. Requires `DATA_COLLECTION` type.", + "nullable": true + }, + "select_options": { + "$ref": "#/components/schemas/SelectOptions", + "description": "Describes configuration for the select action. Requires `SELECT` type.", + "nullable": true + }, + "device_metadata": { + "$ref": "#/components/schemas/DeviceMetadata", + "description": "Details about the Terminal that received the action request (such as battery level,\noperating system version, and network connection settings).\n\nOnly available for `PING` action type.", + "readOnly": true + }, + "await_next_action": { + "type": "boolean", + "description": "Indicates the action will be linked to another action and requires a waiting dialog to be\ndisplayed instead of returning to the idle screen on completion of the action.\n\nOnly supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types.", + "nullable": true + }, + "await_next_action_duration": { + "type": "string", + "description": "The timeout duration of the waiting dialog as an RFC 3339 duration, after which the\nwaiting dialog will no longer be displayed and the Terminal will return to the idle screen.\n\nDefault: 5 minutes from when the waiting dialog is displayed\n\nMaximum: 5 minutes", + "nullable": true + } + } + }, + "TerminalActionActionType": { + "type": "string", + "enum": [ + "QR_CODE", + "PING", + "SAVE_CARD", + "SIGNATURE", + "CONFIRMATION", + "RECEIPT", + "DATA_COLLECTION", + "SELECT" + ], + "x-enum-elements": [ + { + "name": "QR_CODE", + "description": "The action represents a request to display a QR code. Details are contained in\nthe `qr_code_options` object." + }, + { + "name": "PING", + "description": "The action represents a request to check if the specific device is\nonline or currently active with the merchant in question. Does not require an action options value." + }, + { + "name": "SAVE_CARD", + "description": "Represents a request to save a card for future card-on-file use. Details are contained\nin the `save_card_options` object." + }, + { + "name": "SIGNATURE", + "description": "The action represents a request to capture a buyer's signature. Details are contained\nin the `signature_options` object." + }, + { + "name": "CONFIRMATION", + "description": "The action represents a request to collect a buyer's confirmation decision to the\ndisplayed terms. Details are contained in the `confirmation_options` object." + }, + { + "name": "RECEIPT", + "description": "The action represents a request to display the receipt screen options. Details are\ncontained in the `receipt_options` object." + }, + { + "name": "DATA_COLLECTION", + "description": "The action represents a request to collect a buyer's text data. Details\nare contained in the `data_collection_options` object." + }, + { + "name": "SELECT", + "description": "The action represents a request to allow the buyer to select from provided options.\nDetails are contained in the `select_options` object." + } + ], + "description": "Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum.", + "x-release-status": "BETA" + }, + "TerminalActionCreatedEvent": { + "type": "object", + "description": "Published when a TerminalAction is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.action.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalActionCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2021-03-10T14:43:55.262Z", + "data": { + "id": "dhgENdnFOPXqO", + "object": { + "action": { + "app_id": "APP_ID", + "created_at": "2021-03-10T14:43:55.262Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:jveJIAkkAjILHkdCE", + "save_card_options": { + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "PENDING", + "type": "SAVE_CARD", + "updated_at": "2020-04-10T14:43:55.262Z" + } + }, + "type": "action" + }, + "event_id": "7229a692-def5-4a7e-b4f3-80638aa2f24d", + "merchant_id": "MERCHANT_ID", + "type": "terminal.action.created" + }, + "x-webhook": { + "event": "terminal.action.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2022-05-12" + }, + "TerminalActionCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the created object’s type, `\"action\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the created terminal action." + }, + "object": { + "$ref": "#/components/schemas/TerminalActionCreatedEventObject", + "description": "An object containing the created terminal action.", + "nullable": true + } + } + }, + "TerminalActionCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The created terminal action.", + "nullable": true + } + } + }, + "TerminalActionQuery": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "filter": { + "$ref": "#/components/schemas/TerminalActionQueryFilter", + "description": "Options for filtering returned `TerminalAction`s", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/TerminalActionQuerySort", + "description": "Option for sorting returned `TerminalAction` objects.", + "nullable": true + } + }, + "example": { + "include": [ + "CUSTOMER" + ], + "limit": 2, + "query": { + "filter": { + "status": "COMPLETED" + } + } + } + }, + "TerminalActionQueryFilter": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "device_id": { + "type": "string", + "description": "`TerminalAction`s associated with a specific device. If no device is specified then all\n`TerminalAction`s for the merchant will be displayed.", + "nullable": true + }, + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "Time range for the beginning of the reporting period. Inclusive.\nDefault value: The current time minus one day.\nNote that `TerminalAction`s are available for 30 days after creation." + }, + "status": { + "type": "string", + "description": "Filter results with the desired status of the `TerminalAction`\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/TerminalActionActionType", + "description": "Filter results with the requested ActionType.\nSee [TerminalActionActionType](#type-terminalactionactiontype) for possible values", + "nullable": true + } + } + }, + "TerminalActionQuerySort": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "sort_order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order in which results are listed.\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "TerminalActionUpdatedEvent": { + "type": "object", + "description": "Published when a TerminalAction is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.action.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalActionUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2021-03-10T14:44:06.039Z", + "data": { + "id": "dhgENdnFOPXqO", + "object": { + "action": { + "app_id": "APP_ID", + "created_at": "2021-03-10T14:43:55.262Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:RZDei5nMuO0rMmCE", + "save_card_options": { + "card_id": "ccof:CARD_ID", + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "COMPLETED", + "type": "SAVE_CARD", + "updated_at": "2021-03-10T14:44:55.262Z" + } + }, + "type": "action" + }, + "event_id": "1c3ef831-670d-4f4c-b59c-f0bb2d2fc872", + "merchant_id": "MERCHANT_ID", + "type": "terminal.action.updated" + }, + "x-webhook": { + "event": "terminal.action.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2022-05-12" + }, + "TerminalActionUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the updated object’s type, `\"action\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated terminal action." + }, + "object": { + "$ref": "#/components/schemas/TerminalActionUpdatedEventObject", + "description": "An object containing the updated terminal action.", + "nullable": true + } + } + }, + "TerminalActionUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The updated terminal action.", + "nullable": true + } + } + }, + "TerminalCheckout": { + "type": "object", + "description": "Represents a checkout processed by the Square Terminal.", + "x-release-status": "PUBLIC", + "required": [ + "amount_money", + "device_options" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique ID for this `TerminalCheckout`.", + "minLength": 10, + "maxLength": 255, + "readOnly": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money (including the tax amount) that the Square Terminal device should try to collect." + }, + "reference_id": { + "type": "string", + "description": "An optional user-defined reference ID that can be used to associate\nthis `TerminalCheckout` to another entity in an external system. For example, an order\nID generated by a third-party shopping cart. The ID is also associated with any payments\nused to complete the checkout.", + "maxLength": 40, + "nullable": true + }, + "note": { + "type": "string", + "description": "An optional note to associate with the checkout, as well as with any payments used to complete the checkout.\nNote: maximum 500 characters", + "maxLength": 500, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The reference to the Square order ID for the checkout request.", + "nullable": true + }, + "payment_options": { + "$ref": "#/components/schemas/PaymentOptions", + "description": "Payment-specific options for the checkout request.", + "nullable": true + }, + "device_options": { + "$ref": "#/components/schemas/DeviceCheckoutOptions", + "description": "Options to control the display and behavior of the Square Terminal device." + }, + "deadline_duration": { + "type": "string", + "description": "An RFC 3339 duration, after which the checkout is automatically canceled.\nA `TerminalCheckout` that is `PENDING` is automatically `CANCELED` and has a cancellation reason\nof `TIMED_OUT`.\n\nDefault: 5 minutes from creation\n\nMaximum: 5 minutes", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "status": { + "type": "string", + "description": "The status of the `TerminalCheckout`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`", + "readOnly": true + }, + "cancel_reason": { + "$ref": "#/components/schemas/ActionCancelReason", + "description": "The reason why `TerminalCheckout` is canceled. Present if the status is `CANCELED`.\nSee [ActionCancelReason](#type-actioncancelreason) for possible values", + "readOnly": true + }, + "payment_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of IDs for payments created by this `TerminalCheckout`.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The time when the `TerminalCheckout` was created, as an RFC 3339 timestamp.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The time when the `TerminalCheckout` was last updated, as an RFC 3339 timestamp.", + "readOnly": true + }, + "app_id": { + "type": "string", + "description": "The ID of the application that created the checkout.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The location of the device where the `TerminalCheckout` was directed.", + "maxLength": 64, + "readOnly": true + }, + "payment_type": { + "$ref": "#/components/schemas/CheckoutOptionsPaymentType", + "description": "The type of payment the terminal should attempt to capture from. Defaults to `CARD_PRESENT`.\nSee [CheckoutOptionsPaymentType](#type-checkoutoptionspaymenttype) for possible values", + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "An optional ID of the team member associated with creating the checkout.", + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "An optional ID of the customer associated with the checkout.", + "nullable": true + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount the developer is taking as a fee for facilitating the payment on behalf\nof the seller.\n\nThe amount cannot be more than 90% of the total amount of the payment.\n\nThe amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).\n\nThe fee currency code must match the currency associated with the seller that is accepting the payment. The application must be from a developer account in the same country and using the same currency code as the seller.\n\nFor more information about the application fee scenario, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).\n\nTo set this field, PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).", + "nullable": true + }, + "statement_description_identifier": { + "type": "string", + "description": "Optional additional payment information to include on the customer's card statement as\npart of the statement description. This can be, for example, an invoice number, ticket number,\nor short description that uniquely identifies the purchase.", + "maxLength": 20, + "nullable": true + }, + "tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount designated as a tip, in addition to `amount_money`. This may only be set for a\ncheckout that has tipping disabled (`tip_settings.allow_tipping` is `false`).", + "nullable": true + } + } + }, + "TerminalCheckoutCreatedEvent": { + "type": "object", + "description": "Published when a [TerminalCheckout](entity:TerminalCheckout) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.checkout.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalCheckoutCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-10T14:43:55.262Z", + "data": { + "id": "dhgENdnFOPXqO", + "object": { + "checkout": { + "amount_money": { + "amount": 111, + "currency": "USD" + }, + "app_id": "sq0idp-734Md5EcFjFmwpaR0Snm6g", + "created_at": "2020-04-10T14:43:55.262Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "907CS13101300122", + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "dhgENdnFOPXqO", + "note": "A simple note", + "reference_id": "id72709", + "status": "PENDING", + "updated_at": "2020-04-10T14:43:55.262Z" + } + }, + "type": "checkout" + }, + "event_id": "7229a692-def5-4a7e-b4f3-80638aa2f24d", + "merchant_id": "7NZR58EPNGNPC", + "type": "terminal.checkout.created" + }, + "x-webhook": { + "event": "terminal.checkout.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2020-04-22" + }, + "TerminalCheckoutCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the created object’s type, `\"checkout\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the created terminal checkout.", + "minLength": 10, + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/TerminalCheckoutCreatedEventObject", + "description": "An object containing the created terminal checkout", + "nullable": true + } + } + }, + "TerminalCheckoutCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The created terminal checkout", + "nullable": true + } + } + }, + "TerminalCheckoutQuery": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/TerminalCheckoutQueryFilter", + "description": "Options for filtering returned `TerminalCheckout` objects.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/TerminalCheckoutQuerySort", + "description": "Option for sorting returned `TerminalCheckout` objects.", + "nullable": true + } + } + }, + "TerminalCheckoutQueryFilter": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "device_id": { + "type": "string", + "description": "The `TerminalCheckout` objects associated with a specific device. If no device is specified, then all\n`TerminalCheckout` objects for the merchant are displayed.", + "nullable": true + }, + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The time range for the beginning of the reporting period, which is inclusive.\nDefault value: The current time minus one day.\nNote that `TerminalCheckout`s are available for 30 days after creation." + }, + "status": { + "type": "string", + "description": "Filtered results with the desired status of the `TerminalCheckout`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`", + "nullable": true + } + } + }, + "TerminalCheckoutQuerySort": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "sort_order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order in which results are listed.\nDefault: `DESC`\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "TerminalCheckoutUpdatedEvent": { + "type": "object", + "description": "Published when a [TerminalCheckout](entity:TerminalCheckout) is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.checkout.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalCheckoutUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-10T14:44:06.039Z", + "data": { + "id": "dhgENdnFOPXqO", + "object": { + "checkout": { + "amount_money": { + "amount": 111, + "currency": "USD" + }, + "app_id": "sq0idp-734Md5EcFjFmwpaR0Snm6g", + "created_at": "2020-04-10T14:43:55.262Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "907CS13101300122", + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "dhgENdnFOPXqO", + "note": "A simple note", + "payment_ids": [ + "dgzrZTeIeVuOGwYgekoTHsPouaB" + ], + "reference_id": "id72709", + "status": "COMPLETED", + "updated_at": "2020-04-10T14:44:06.039Z" + } + }, + "type": "checkout" + }, + "event_id": "1c3ef831-670d-4f4c-b59c-f0bb2d2fc872", + "merchant_id": "7NZR58EPNGNPC", + "type": "terminal.checkout.updated" + }, + "x-webhook": { + "event": "terminal.checkout.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2020-04-22" + }, + "TerminalCheckoutUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the updated object’s type, `\"checkout\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated terminal checkout.", + "minLength": 10, + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/TerminalCheckoutUpdatedEventObject", + "description": "An object containing the updated terminal checkout", + "nullable": true + } + } + }, + "TerminalCheckoutUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The updated terminal checkout", + "nullable": true + } + } + }, + "TerminalRefund": { + "type": "object", + "description": "Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds.", + "x-release-status": "PUBLIC", + "required": [ + "payment_id", + "amount_money", + "reason", + "device_id" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique ID for this `TerminalRefund`.", + "minLength": 10, + "maxLength": 255, + "readOnly": true + }, + "refund_id": { + "type": "string", + "description": "The reference to the payment refund created by completing this `TerminalRefund`.", + "readOnly": true + }, + "payment_id": { + "type": "string", + "description": "The unique ID of the payment being refunded.", + "minLength": 1 + }, + "order_id": { + "type": "string", + "description": "The reference to the Square order ID for the payment identified by the `payment_id`.", + "readOnly": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money, inclusive of `tax_money`, that the `TerminalRefund` should return.\nThis value is limited to the amount taken in the original payment minus any completed or\npending refunds." + }, + "reason": { + "type": "string", + "description": "A description of the reason for the refund.", + "maxLength": 192 + }, + "device_id": { + "type": "string", + "description": "The unique ID of the device intended for this `TerminalRefund`.\nThe Id can be retrieved from /v2/devices api." + }, + "deadline_duration": { + "type": "string", + "description": "The RFC 3339 duration, after which the refund is automatically canceled.\nA `TerminalRefund` that is `PENDING` is automatically `CANCELED` and has a cancellation reason\nof `TIMED_OUT`.\n\nDefault: 5 minutes from creation.\n\nMaximum: 5 minutes", + "nullable": true + }, + "status": { + "type": "string", + "description": "The status of the `TerminalRefund`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`.", + "readOnly": true + }, + "cancel_reason": { + "$ref": "#/components/schemas/ActionCancelReason", + "description": "Present if the status is `CANCELED`.\nSee [ActionCancelReason](#type-actioncancelreason) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The time when the `TerminalRefund` was created, as an RFC 3339 timestamp.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The time when the `TerminalRefund` was last updated, as an RFC 3339 timestamp.", + "readOnly": true + }, + "app_id": { + "type": "string", + "description": "The ID of the application that created the refund.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The location of the device where the `TerminalRefund` was directed.", + "maxLength": 64, + "readOnly": true + } + } + }, + "TerminalRefundCreatedEvent": { + "type": "object", + "description": "Published when a Terminal API refund is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.refund.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalRefundCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-09-22T14:29:19.459Z", + "data": { + "id": "S67MS3HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "object": { + "refund": { + "amount_money": { + "amount": 100, + "currency": "CAD" + }, + "app_id": "sq0idp-734Md5EcFjFmwpaR0Snm6g", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 12, + "exp_year": 2020, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "card_details": { + "avs_status": "AVS_NOT_CHECKED", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 12, + "exp_year": 2020, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "cvv_status": "CVV_NOT_CHECKED", + "entry_method": "EMV", + "statement_description": "SQ *DEFAULT TEST ACCOUNT", + "status": "CAPTURED" + }, + "created_at": "2020-09-22T14:29:19.459Z", + "deadline_duration": "PT5M", + "device_id": "907CS13101300122", + "id": "S67MS3HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "A6SYFRSV4WAFW", + "order_id": "9VeViC6PeooYw4GVAgiuEMseV", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Refund reason", + "status": "PENDING", + "updated_at": "2020-09-22T14:29:19.459Z" + } + }, + "type": "refund" + }, + "event_id": "9232cde1-6e72-4356-8b08-bd2af7bb87a2", + "merchant_id": "7NZR58EPNGNPC", + "type": "terminal.refund.created" + }, + "x-webhook": { + "event": "terminal.refund.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2020-10-28" + }, + "TerminalRefundCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the created object’s type, `\"refund\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the created terminal refund." + }, + "object": { + "$ref": "#/components/schemas/TerminalRefundCreatedEventObject", + "description": "An object containing the created terminal refund.", + "nullable": true + } + } + }, + "TerminalRefundCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The created terminal refund.", + "nullable": true + } + } + }, + "TerminalRefundQuery": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/TerminalRefundQueryFilter", + "description": "The filter for the Terminal refund query.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/TerminalRefundQuerySort", + "description": "The sort order for the Terminal refund query.", + "nullable": true + } + } + }, + "TerminalRefundQueryFilter": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "device_id": { + "type": "string", + "description": "`TerminalRefund` objects associated with a specific device. If no device is specified, then all\n`TerminalRefund` objects for the signed-in account are displayed.", + "nullable": true + }, + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The timestamp for the beginning of the reporting period, in RFC 3339 format. Inclusive.\nDefault value: The current time minus one day.\nNote that `TerminalRefund`s are available for 30 days after creation." + }, + "status": { + "type": "string", + "description": "Filtered results with the desired status of the `TerminalRefund`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`.", + "nullable": true + } + } + }, + "TerminalRefundQuerySort": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "sort_order": { + "type": "string", + "description": "The order in which results are listed.\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).", + "nullable": true + } + } + }, + "TerminalRefundUpdatedEvent": { + "type": "object", + "description": "Published when a Terminal API refund is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.refund.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalRefundUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-09-22T14:34:40.334Z", + "data": { + "id": "S67MS3HD-rbh7ygmmPfnEsP6OcuOEFL9FuaB", + "object": { + "refund": { + "amount_money": { + "amount": 100, + "currency": "CAD" + }, + "app_id": "sq0idp-734Md5EcFjFmwpaR0Snm6g", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 12, + "exp_year": 2020, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "card_details": { + "avs_status": "AVS_NOT_CHECKED", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 12, + "exp_year": 2020, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "cvv_status": "CVV_NOT_CHECKED", + "entry_method": "EMV", + "statement_description": "SQ *DEFAULT TEST ACCOUNT", + "status": "CAPTURED" + }, + "created_at": "2020-09-22T14:29:19.459Z", + "deadline_duration": "PT5M", + "device_id": "907CS13101300122", + "id": "S67MS3HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "A6SYFRSV4WAFW", + "order_id": "9VeViC6PeooYw4GVAgiuEMseV", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Refund reason", + "status": "IN PROGRESS", + "updated_at": "2020-09-22T14:34:40.334Z" + } + }, + "type": "refund" + }, + "event_id": "d15cfe13-f02c-4155-b381-ef36dd5be92f", + "merchant_id": "ET1TXH00Q2X3B", + "type": "terminal.refund.updated" + }, + "x-webhook": { + "event": "terminal.refund.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2020-10-28" + }, + "TerminalRefundUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the updated object’s type, `\"refund\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated terminal refund." + }, + "object": { + "$ref": "#/components/schemas/TerminalRefundUpdatedEventObject", + "description": "An object containing the updated terminal refund.", + "nullable": true + } + } + }, + "TerminalRefundUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The updated terminal refund.", + "nullable": true + } + } + }, + "TestWebhookSubscriptionRequest": { + "type": "object", + "description": "Tests a [Subscription](entity:WebhookSubscription) by sending a test event to its notification URL.", + "x-release-status": "PUBLIC", + "properties": { + "event_type": { + "type": "string", + "description": "The event type that will be used to test the [Subscription](entity:WebhookSubscription). The event type must be\ncontained in the list of event types in the [Subscription](entity:WebhookSubscription).", + "nullable": true + } + }, + "example": { + "event_type": "payment.created" + } + }, + "TestWebhookSubscriptionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [TestWebhookSubscription](api-endpoint:WebhookSubscriptions-TestWebhookSubscription) endpoint.\n\nNote: If there are errors processing the request, the [SubscriptionTestResult](entity:SubscriptionTestResult) field is not\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "subscription_test_result": { + "$ref": "#/components/schemas/SubscriptionTestResult", + "description": "The [SubscriptionTestResult](entity:SubscriptionTestResult)." + } + }, + "example": { + "subscription_test_result": { + "created_at": "2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746", + "id": "23eed5a9-2b12-403e-b212-7e2889aea0f6", + "payload": "{\"merchant_id\":\"1ZYMKZY1YFGBW\",\"type\":\"payment.created\",\"event_id\":\"23eed5a9-2b12-403e-b212-7e2889aea0f6\",\"created_at\":\"2022-01-11T00:06:48.322945116Z\",\"data\":{\"type\":\"payment\",\"id\":\"KkAkhdMsgzn59SM8A89WgKwekxLZY\",\"object\":{\"payment\":{\"amount_money\":{\"amount\":100,\"currency\":\"USD\"},\"approved_money\":{\"amount\":100,\"currency\":\"USD\"},\"capabilities\":[\"EDIT_TIP_AMOUNT\",\"EDIT_TIP_AMOUNT_UP\",\"EDIT_TIP_AMOUNT_DOWN\"],\"card_details\":{\"avs_status\":\"AVS_ACCEPTED\",\"card\":{\"bin\":\"540988\",\"card_brand\":\"MASTERCARD\",\"card_type\":\"CREDIT\",\"exp_month\":11,\"exp_year\":2022,\"fingerprint\":\"sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg\",\"last_4\":\"9029\",\"prepaid_type\":\"NOT_PREPAID\"},\"card_payment_timeline\":{\"authorized_at\":\"2020-11-22T21:16:51.198Z\"},\"cvv_status\":\"CVV_ACCEPTED\",\"entry_method\":\"KEYED\",\"statement_description\":\"SQ *DEFAULT TEST ACCOUNT\",\"status\":\"AUTHORIZED\"},\"created_at\":\"2020-11-22T21:16:51.086Z\",\"delay_action\":\"CANCEL\",\"delay_duration\":\"PT168H\",\"delayed_until\":\"2020-11-29T21:16:51.086Z\",\"id\":\"hYy9pRFVxpDsO1FB05SunFWUe9JZY\",\"location_id\":\"S8GWD5R9QB376\",\"order_id\":\"03O3USaPaAaFnI6kkwB1JxGgBsUZY\",\"receipt_number\":\"hYy9\",\"risk_evaluation\":{\"created_at\":\"2020-11-22T21:16:51.198Z\",\"risk_level\":\"NORMAL\"},\"source_type\":\"CARD\",\"status\":\"APPROVED\",\"total_money\":{\"amount\":100,\"currency\":\"USD\"},\"updated_at\":\"2020-11-22T21:16:51.198Z\",\"version_token\":\"FfQhQJf9r3VSQIgyWBk1oqhIwiznLwVwJbVVA0bdyEv6o\"}}}}", + "status_code": 404, + "updated_at": "2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746" + } + } + }, + "TimeRange": { + "type": "object", + "description": "Represents a generic time range. The start and end values are\nrepresented in RFC 3339 format. Time ranges are customized to be\ninclusive or exclusive based on the needs of a particular endpoint.\nRefer to the relevant endpoint-specific documentation to determine\nhow time ranges are handled.", + "x-release-status": "PUBLIC", + "properties": { + "start_at": { + "type": "string", + "description": "A datetime value in RFC 3339 format indicating when the time range\nstarts.", + "nullable": true + }, + "end_at": { + "type": "string", + "description": "A datetime value in RFC 3339 format indicating when the time range\nends.", + "nullable": true + } + } + }, + "Timecard": { + "type": "object", + "description": "A record of the hourly rate, start time, and end time of a single timecard (shift)\nfor a team member. This might include a record of the start and end times of breaks\ntaken during the shift.", + "x-release-status": "PUBLIC", + "required": [ + "location_id", + "start_at", + "team_member_id" + ], + "properties": { + "id": { + "type": "string", + "description": "**Read only** The Square-issued UUID for this object.", + "maxLength": 255 + }, + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location) for this timecard. The location should be based on\nwhere the team member clocked in.", + "minLength": 1 + }, + "timezone": { + "type": "string", + "description": "**Read only** The time zone calculated from the location based on the `location_id`,\nprovided as a convenience value. Format: the IANA time zone database identifier for the\nlocation time zone.", + "nullable": true + }, + "start_at": { + "type": "string", + "description": "The start time of the timecard, in RFC 3339 format and shifted to the location\ntimezone + offset. Precision up to the minute is respected; seconds are truncated.", + "minLength": 1 + }, + "end_at": { + "type": "string", + "description": "The end time of the timecard, in RFC 3339 format and shifted to the location\ntimezone + offset. Precision up to the minute is respected; seconds are truncated.", + "nullable": true + }, + "wage": { + "$ref": "#/components/schemas/TimecardWage", + "description": "Job and pay related information. If the wage is not set on create, it defaults to a wage\nof zero. If the title is not set on create, it defaults to the name of the role the team member\nis assigned to, if any.", + "nullable": true + }, + "breaks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Break" + }, + "description": "A list of all the paid or unpaid breaks that were taken during this timecard.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/TimecardStatus", + "description": "Describes the working state of the timecard.\nSee [TimecardStatus](#type-timecardstatus) for possible values", + "nullable": true + }, + "version": { + "type": "integer", + "description": "**Read only** The current version of the timecard, which is incremented with each update.\nThis field is used for [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol to ensure that requests don't overwrite data from another request." + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the timecard was created, in RFC 3339 format presented as UTC.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the timecard was last updated, in RFC 3339 format presented as UTC.", + "readOnly": true + }, + "team_member_id": { + "type": "string", + "description": "The ID of the [team member](entity:TeamMember) this timecard belongs to.", + "minLength": 1 + }, + "declared_cash_tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The cash tips declared by the team member for this timecard.", + "nullable": true + } + } + }, + "TimecardFilter": { + "type": "object", + "description": "Defines a filter used in a search for `Timecard` records. `AND` logic is\nused by Square's servers to apply each filter property specified.", + "x-release-status": "PUBLIC", + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fetch timecards for the specified location.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/TimecardFilterStatus", + "description": "Fetch a `Timecard` instance by `Timecard.status`.\nSee [TimecardFilterStatus](#type-timecardfilterstatus) for possible values", + "nullable": true + }, + "start": { + "$ref": "#/components/schemas/TimeRange", + "description": "Fetch `Timecard` instances that start in the time range - Inclusive.", + "nullable": true + }, + "end": { + "$ref": "#/components/schemas/TimeRange", + "description": "Fetch the `Timecard` instances that end in the time range - Inclusive.", + "nullable": true + }, + "workday": { + "$ref": "#/components/schemas/TimecardWorkday", + "description": "Fetch the `Timecard` instances based on the workday date range.", + "nullable": true + }, + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fetch timecards for the specified team members.", + "nullable": true + } + } + }, + "TimecardFilterStatus": { + "type": "string", + "enum": [ + "OPEN", + "CLOSED" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "Timecards that have been started and not ended." + }, + { + "name": "CLOSED", + "description": "Timecards that have been started and ended." + } + ], + "description": "Specifies the `status` of `Timecard` records to be returned.", + "x-release-status": "PUBLIC" + }, + "TimecardQuery": { + "type": "object", + "description": "The parameters of a `Timecard` search query, which includes filter and sort options.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/TimecardFilter", + "description": "Query filter options.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/TimecardSort", + "description": "Sort order details.", + "nullable": true + } + } + }, + "TimecardSort": { + "type": "object", + "description": "Sets the sort order of search results.", + "x-release-status": "PUBLIC", + "properties": { + "field": { + "$ref": "#/components/schemas/TimecardSortField", + "description": "The field to sort on.\nSee [TimecardSortField](#type-timecardsortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order in which results are returned. Defaults to DESC.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "TimecardSortField": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "The start date/time of a `Timecard`" + }, + { + "name": "END_AT", + "description": "The end date/time of a `Timecard`" + }, + { + "name": "CREATED_AT", + "description": "The date/time that a `Timecard` is created" + }, + { + "name": "UPDATED_AT", + "description": "The most recent date/time that a `Timecard` is updated" + } + ], + "description": "Enumerates the `Timecard` fields to sort on.", + "x-release-status": "PUBLIC" + }, + "TimecardStatus": { + "type": "string", + "enum": [ + "OPEN", + "CLOSED" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "The timecard has a `start_at` time but no `end_at` time, indicating an ongoing shift." + }, + { + "name": "CLOSED", + "description": "The timecard has both `start_at` and `end_at` times, indicating a completed shift." + } + ], + "description": "**Read only** Enumerates the possible status of a [timecard](entity:Timecard).", + "x-release-status": "PUBLIC" + }, + "TimecardWage": { + "type": "object", + "description": "The hourly wage rate used to compensate a team member for a [timecard](entity:Timecard).", + "x-release-status": "PUBLIC", + "properties": { + "title": { + "type": "string", + "description": "The name of the job performed during this timecard.", + "nullable": true + }, + "hourly_rate": { + "$ref": "#/components/schemas/Money", + "description": "Can be a custom-set hourly wage or the calculated effective hourly\nwage based on the annual wage and hours worked per week.", + "nullable": true + }, + "job_id": { + "type": "string", + "description": "The ID of the [job](entity:Job) performed for this timecard. Square\nlabor-reporting UIs might group timecards together by ID.", + "readOnly": true + }, + "tip_eligible": { + "type": "boolean", + "description": "Whether team members are eligible for tips when working this job.", + "nullable": true + } + } + }, + "TimecardWorkday": { + "type": "object", + "description": "A `Timecard` search query filter parameter that sets a range of days that\na `Timecard` must start or end in before passing the filter condition.", + "x-release-status": "PUBLIC", + "properties": { + "date_range": { + "$ref": "#/components/schemas/DateRange", + "description": "Dates for fetching the timecards.", + "nullable": true + }, + "match_timecards_by": { + "$ref": "#/components/schemas/TimecardWorkdayMatcher", + "description": "The strategy on which the dates are applied.\nSee [TimecardWorkdayMatcher](#type-timecardworkdaymatcher) for possible values", + "nullable": true + }, + "default_timezone": { + "type": "string", + "description": "Location-specific timezones convert workdays to datetime filters.\nEvery location included in the query must have a timezone or this field\nmust be provided as a fallback. Format: the IANA timezone database\nidentifier for the relevant timezone.", + "nullable": true + } + } + }, + "TimecardWorkdayMatcher": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "INTERSECTION" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "All timecards that start on or after the specified workday" + }, + { + "name": "END_AT", + "description": "All timecards that end on or before the specified workday" + }, + { + "name": "INTERSECTION", + "description": "All timecards that start between the start and end workdays (inclusive)" + } + ], + "description": "Defines the logic used to apply a workday filter.", + "x-release-status": "PUBLIC" + }, + "TipSettings": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "allow_tipping": { + "type": "boolean", + "description": "Indicates whether tipping is enabled for this checkout. Defaults to false.", + "nullable": true + }, + "separate_tip_screen": { + "type": "boolean", + "description": "Indicates whether tip options should be presented on the screen before presenting\nthe signature screen during card payment. Defaults to false.", + "nullable": true + }, + "custom_tip_field": { + "type": "boolean", + "description": "Indicates whether custom tip amounts are allowed during the checkout flow. Defaults to false.", + "nullable": true + }, + "tip_percentages": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "A list of tip percentages that should be presented during the checkout flow, specified as\nup to 3 non-negative integers from 0 to 100 (inclusive). Defaults to 15, 20, and 25.", + "nullable": true + }, + "smart_tipping": { + "type": "boolean", + "description": "Enables the \"Smart Tip Amounts\" behavior.\nExact tipping options depend on the region in which the Square seller is active.\n\nFor payments under 10.00, in the Australia, Canada, Ireland, United Kingdom, and United States, tipping options are presented as no tip, .50, 1.00 or 2.00.\n\nFor payment amounts of 10.00 or greater, tipping options are presented as the following percentages: 0%, 5%, 10%, 15%.\n\nIf set to true, the `tip_percentages` settings is ignored.\nDefaults to false.\n\nTo learn more about smart tipping, see [Accept Tips with the Square App](https://squareup.com/help/us/en/article/5069-accept-tips-with-the-square-app).", + "nullable": true + } + } + }, + "Transaction": { + "type": "object", + "description": "Represents a transaction processed with Square, either with the\nConnect API or with Square Point of Sale.\n\nThe `tenders` field of this object lists all methods of payment used to pay in\nthe transaction.", + "x-release-status": "DEPRECATED", + "properties": { + "id": { + "type": "string", + "description": "The transaction's unique ID, issued by Square payments servers.", + "maxLength": 192 + }, + "location_id": { + "type": "string", + "description": "The ID of the transaction's associated location.", + "maxLength": 50, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the transaction was created, in RFC 3339 format.", + "maxLength": 32 + }, + "tenders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tender" + }, + "description": "The tenders used to pay in the transaction.", + "nullable": true + }, + "refunds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Refund" + }, + "description": "Refunds that have been applied to any tender in the transaction.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "If the transaction was created with the [Charge](api-endpoint:Transactions-Charge)\nendpoint, this value is the same as the value provided for the `reference_id`\nparameter in the request to that endpoint. Otherwise, it is not set.", + "maxLength": 40, + "nullable": true + }, + "product": { + "$ref": "#/components/schemas/TransactionProduct", + "description": "The Square product that processed the transaction.\nSee [TransactionProduct](#type-transactionproduct) for possible values", + "nullable": true + }, + "client_id": { + "type": "string", + "description": "If the transaction was created in the Square Point of Sale app, this value\nis the ID generated for the transaction by Square Point of Sale.\n\nThis ID has no relationship to the transaction's canonical `id`, which is\ngenerated by Square's backend servers. This value is generated for bookkeeping\npurposes, in case the transaction cannot immediately be completed (for example,\nif the transaction is processed in offline mode).\n\nIt is not currently possible with the Connect API to perform a transaction\nlookup by this value.", + "maxLength": 192, + "nullable": true + }, + "shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "The shipping address provided in the request, if any.", + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The order_id is an identifier for the order associated with this transaction, if any.", + "maxLength": 192, + "nullable": true + } + } + }, + "TransactionProduct": { + "type": "string", + "enum": [ + "REGISTER", + "EXTERNAL_API", + "BILLING", + "APPOINTMENTS", + "INVOICES", + "ONLINE_STORE", + "PAYROLL", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "REGISTER", + "description": "Square Point of Sale." + }, + { + "name": "EXTERNAL_API", + "description": "The Square Connect API." + }, + { + "name": "BILLING", + "description": "A Square subscription for one of multiple products." + }, + { + "name": "APPOINTMENTS", + "description": "Square Appointments." + }, + { + "name": "INVOICES", + "description": "Square Invoices." + }, + { + "name": "ONLINE_STORE", + "description": "Square Online Store." + }, + { + "name": "PAYROLL", + "description": "Square Payroll." + }, + { + "name": "OTHER", + "description": "A Square product that does not match any other value." + } + ], + "description": "Indicates the Square product used to process a transaction.", + "x-release-status": "DEPRECATED" + }, + "TransactionType": { + "type": "string", + "enum": [ + "DEBIT", + "CREDIT" + ], + "x-enum-elements": [ + { + "name": "DEBIT", + "description": "" + }, + { + "name": "CREDIT", + "description": "" + } + ], + "description": "The transaction type used in the disputed payment.", + "x-release-status": "PUBLIC" + }, + "UnlinkCustomerFromGiftCardRequest": { + "type": "object", + "description": "A request to unlink a customer from a gift card.", + "x-release-status": "PUBLIC", + "x-params-example": "?gift_card_id=gftc:71ea002277a34f8a945e284b04822edb", + "required": [ + "customer_id" + ], + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the customer to unlink from the gift card.", + "minLength": 1, + "maxLength": 191 + } + }, + "example": { + "customer_id": "GKY0FZ3V717AH8Q2D821PNT2ZW" + } + }, + "UnlinkCustomerFromGiftCardResponse": { + "type": "object", + "description": "A response that contains the unlinked `GiftCard` object. If the request resulted in errors, \nthe response contains a set of `Error` objects.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card with the ID of the unlinked customer removed from the `customer_ids` field. \nIf no other customers are linked, the `customer_ids` field is also removed." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 2500, + "currency": "USD" + }, + "created_at": "2021-03-25T05:13:01Z", + "gan": "7783320005440920", + "gan_source": "SQUARE", + "id": "gftc:71ea002277a34f8a945e284b04822edb", + "state": "ACTIVE", + "type": "DIGITAL" + } + } + }, + "UpdateBookingCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) request.", + "x-release-status": "PUBLIC", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition that contains the fields to update. Only the following fields can be updated:\n- `name`\n- `description`\n- `visibility`\n- `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed\nselections are supported.\n\nFor more information, see\n[Updatable definition fields](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields).\n\nTo enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, include the optional `version` field and specify the current version of the custom attribute definition." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "UpdateBookingCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The updated custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-11-16T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoriteShampoo", + "name": "Favorite shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-16T15:39:38Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [] + } + }, + "UpdateBookingRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "booking" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key to make this request an idempotent operation.", + "maxLength": 255, + "nullable": true + }, + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The booking to be updated. Individual attributes explicitly specified here override the corresponding values of the existing booking." + } + } + }, + "UpdateBookingResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The booking that was updated." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "booking": { + "address": { + "address_line_1": "1955 Broadway", + "address_line_2": "Suite 600", + "administrative_district_level_1": "CA", + "locality": "Oakland", + "postal_code": "94612" + }, + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "created_at": "2020-10-28T15:47:41Z", + "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + "customer_note": "I would like to sit near the window please", + "id": "zkras0xv0xwswx", + "location_id": "LEQHH0YY8B42M", + "location_type": "CUSTOMER_LOCATION", + "seller_note": "", + "start_at": "2020-11-26T13:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-10-28T15:49:25Z", + "version": 2 + }, + "errors": [] + } + }, + "UpdateBreakTypeRequest": { + "type": "object", + "description": "A request to update a `BreakType`.", + "x-release-status": "PUBLIC", + "required": [ + "break_type" + ], + "properties": { + "break_type": { + "$ref": "#/components/schemas/BreakType", + "description": "The updated `BreakType`." + } + }, + "example": { + "break_type": { + "break_name": "Lunch", + "expected_duration": "PT50M", + "is_paid": true, + "location_id": "26M7H24AZ9N6R", + "version": 1 + } + } + }, + "UpdateBreakTypeResponse": { + "type": "object", + "description": "A response to a request to update a `BreakType`. The response contains\nthe requested `BreakType` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "break_type": { + "$ref": "#/components/schemas/BreakType", + "description": "The response object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "break_type": { + "break_name": "Lunch", + "created_at": "2018-06-12T20:19:12Z", + "expected_duration": "PT50M", + "id": "Q6JSJS6D4DBCH", + "is_paid": true, + "location_id": "26M7H24AZ9N6R", + "updated_at": "2019-02-26T23:12:59Z", + "version": 2 + } + } + }, + "UpdateCatalogImageRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this UpdateCatalogImage request.\nKeys can be any valid string but must be unique for every UpdateCatalogImage request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 128 + } + }, + "example": { + "idempotency_key": "528dea59-7bfb-43c1-bd48-4a6bba7dd61f86", + "image": { + "image_data": { + "caption": "A picture of a cup of coffee", + "name": "Coffee" + }, + "type": "IMAGE" + }, + "object_id": "ND6EA5AAJEO5WL3JNNIAQA32" + } + }, + "UpdateCatalogImageResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "image": { + "$ref": "#/components/schemas/CatalogObject", + "description": "The newly updated `CatalogImage` including a Square-generated\nURL for the encapsulated image file." + } + }, + "example": { + "image": { + "id": "L52QOQN2SW3M5QTF9JOCQKNB", + "image_data": { + "caption": "A picture of a cup of coffee", + "name": "Coffee", + "url": "https://..." + }, + "type": "IMAGE" + } + } + }, + "UpdateCustomerCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents an [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?key=favoritemovie", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition that contains the fields to update. This endpoint\nsupports sparse updates, so only new or changed fields need to be included in the request.\nOnly the following fields can be updated:\n\n- `name`\n- `description`\n- `visibility`\n- `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed\nselections are supported.\n\nFor more information, see\n[Updatable definition fields](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields).\n\nTo enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) \ncontrol, include the optional `version` field and specify the current version of the custom attribute definition." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute_definition": { + "description": "Update the description as desired.", + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateCustomerCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents an [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The updated custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-04-26T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T15:39:38Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateCustomerGroupRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in a request to the\n[UpdateCustomerGroup](api-endpoint:CustomerGroups-UpdateCustomerGroup) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "group" + ], + "properties": { + "group": { + "$ref": "#/components/schemas/CustomerGroup", + "description": "The `CustomerGroup` object including all the updates you want to make." + } + }, + "example": { + "group": { + "name": "Loyal Customers" + } + } + }, + "UpdateCustomerGroupResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [UpdateCustomerGroup](api-endpoint:CustomerGroups-UpdateCustomerGroup) endpoint.\n\nEither `errors` or `group` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "group": { + "$ref": "#/components/schemas/CustomerGroup", + "description": "The successfully updated customer group." + } + }, + "example": { + "group": { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + } + } + }, + "UpdateCustomerRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in a request to the\n`UpdateCustomer` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the customer profile.\n\nThe maximum length for this value is 300 characters.", + "nullable": true + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the customer profile.\n\nThe maximum length for this value is 300 characters.", + "nullable": true + }, + "company_name": { + "type": "string", + "description": "A business name associated with the customer profile.\n\nThe maximum length for this value is 500 characters.", + "nullable": true + }, + "nickname": { + "type": "string", + "description": "A nickname for the customer profile.\n\nThe maximum length for this value is 100 characters.", + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address associated with the customer profile.\n\nThe maximum length for this value is 254 characters.", + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address associated with the customer profile. Only new or changed fields are required in the request.\n\nFor maximum length constraints, see [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).\nThe `first_name` and `last_name` fields are ignored if they are present in the request.", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number associated with the customer profile. The phone number must be valid and can contain\n9–16 digits, with an optional `+` prefix and country code. For more information, see\n[Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "An optional second ID used to associate the customer profile with an\nentity in another system.\n\nThe maximum length for this value is 100 characters.", + "nullable": true + }, + "note": { + "type": "string", + "description": "A custom note associated with the customer profile.", + "nullable": true + }, + "birthday": { + "type": "string", + "description": "The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,\nspecify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in `YYYY-MM-DD`\nformat, where `YYYY` is the specified birth year or `0000` if a birth year is not specified.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The current version of the customer profile.\n\nAs a best practice, you should include this field to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For more information, see [Update a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#update-a-customer-profile).", + "format": "int64" + }, + "tax_ids": { + "$ref": "#/components/schemas/CustomerTaxIds", + "description": "The tax ID associated with the customer profile. This field is available only for customers of sellers\nin EU countries or the United Kingdom. For more information,\nsee [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).", + "nullable": true + } + }, + "example": { + "email_address": "New.Amelia.Earhart@example.com", + "note": "updated customer note", + "phone_number": null, + "version": 2 + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.csharp", + "java": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.java", + "javascript": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.javascript", + "php": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.php", + "python": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.python", + "ruby": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.ruby" + } + }, + "UpdateCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [UpdateCustomer](api-endpoint:Customers-UpdateCustomer) or\n[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint.\n\nEither `errors` or `customer` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The updated customer." + } + }, + "example": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "New.Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "note": "updated customer note", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "updated_at": "2016-05-15T20:21:55Z", + "version": 3 + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.csharp", + "java": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.java", + "javascript": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.javascript", + "php": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.php", + "python": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.python", + "ruby": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.ruby" + } + }, + "UpdateInvoiceRequest": { + "type": "object", + "description": "Describes a `UpdateInvoice` request.", + "x-release-status": "PUBLIC", + "required": [ + "invoice" + ], + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The invoice fields to add, change, or clear. Fields can be cleared using\nnull values or the `remove` field (for individual payment requests or reminders).\nThe current invoice `version` is also required. For more information, including requirements,\nlimitations, and more examples, see [Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices)." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `UpdateInvoice` request. If you do not\nprovide `idempotency_key` (or provide an empty string as the value), the endpoint\ntreats each request as independent.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 128, + "nullable": true + }, + "fields_to_clear": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of fields to clear. Although this field is currently supported, we\nrecommend using null values or the `remove` field when possible. For examples, see\n[Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices).", + "nullable": true + } + }, + "example": { + "idempotency_key": "4ee82288-0910-499e-ab4c-5d0071dad1be", + "invoice": { + "payment_requests": [ + { + "reminders": null, + "tipping_enabled": false, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "version": 1 + } + } + }, + "UpdateInvoiceResponse": { + "type": "object", + "description": "Describes a `UpdateInvoice` response.", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The updated invoice." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "UNPAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 2 + } + } + }, + "UpdateItemModifierListsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "item_ids" + ], + "properties": { + "item_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the catalog items associated with the CatalogModifierList objects being updated." + }, + "modifier_lists_to_enable": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the CatalogModifierList objects to enable for the CatalogItem.\nAt least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified.", + "nullable": true + }, + "modifier_lists_to_disable": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the CatalogModifierList objects to disable for the CatalogItem.\nAt least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified.", + "nullable": true + } + }, + "example": { + "item_ids": [ + "H42BRLUJ5KTZTTMPVSLFAACQ", + "2JXOBJIHCWBQ4NZ3RIXQGJA6" + ], + "modifier_lists_to_disable": [ + "7WRC16CJZDVLSNDQ35PP6YAD" + ], + "modifier_lists_to_enable": [ + "H42BRLUJ5KTZTTMPVSLFAACQ", + "2JXOBJIHCWBQ4NZ3RIXQGJA6" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.csharp", + "java": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.java", + "javascript": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.javascript", + "php": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.php", + "python": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.python", + "ruby": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.ruby" + } + }, + "UpdateItemModifierListsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "updated_at": { + "type": "string", + "description": "The database [timestamp](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates) of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`." + } + }, + "example": { + "updated_at": "2016-11-16T22:25:24.878Z" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.csharp", + "java": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.java", + "javascript": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.javascript", + "php": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.php", + "python": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.python", + "ruby": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.ruby" + } + }, + "UpdateItemTaxesRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "item_ids" + ], + "properties": { + "item_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IDs for the CatalogItems associated with the CatalogTax objects being updated.\nNo more than 1,000 IDs may be provided." + }, + "taxes_to_enable": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IDs of the CatalogTax objects to enable.\nAt least one of `taxes_to_enable` or `taxes_to_disable` must be specified.", + "nullable": true + }, + "taxes_to_disable": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IDs of the CatalogTax objects to disable.\nAt least one of `taxes_to_enable` or `taxes_to_disable` must be specified.", + "nullable": true + } + }, + "example": { + "item_ids": [ + "H42BRLUJ5KTZTTMPVSLFAACQ", + "2JXOBJIHCWBQ4NZ3RIXQGJA6" + ], + "taxes_to_disable": [ + "AQCEGCEBBQONINDOHRGZISEX" + ], + "taxes_to_enable": [ + "4WRCNHCJZDVLSNDQ35PP6YAD" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.csharp", + "java": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.java", + "javascript": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.javascript", + "php": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.php", + "python": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.python", + "ruby": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.ruby" + } + }, + "UpdateItemTaxesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "updated_at": { + "type": "string", + "description": "The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`." + } + }, + "example": { + "updated_at": "2016-11-16T22:25:24.878Z" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.csharp", + "java": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.java", + "javascript": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.javascript", + "php": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.php", + "python": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.python", + "ruby": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.ruby" + } + }, + "UpdateJobRequest": { + "type": "object", + "description": "Represents an [UpdateJob](api-endpoint:Team-UpdateJob) request.", + "x-release-status": "BETA", + "required": [ + "job" + ], + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The job with the updated fields, either `title`, `is_tip_eligible`, or both. Only changed fields need\nto be included in the request. Optionally include `version` to enable optimistic concurrency control." + } + }, + "example": { + "job": { + "is_tip_eligible": true, + "title": "Cashier 1" + } + } + }, + "UpdateJobResponse": { + "type": "object", + "description": "Represents an [UpdateJob](api-endpoint:Team-UpdateJob) response. Either `job` or `errors`\nis present in the response.", + "x-release-status": "BETA", + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The updated job." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "job": { + "created_at": "2021-06-11T22:55:45Z", + "id": "1yJlHapkseYnNPETIU1B", + "is_tip_eligible": true, + "title": "Cashier 1", + "updated_at": "2021-06-13T12:55:45Z", + "version": 2 + } + } + }, + "UpdateLocationCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents an [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) request.", + "x-release-status": "BETA", + "x-params-example": "?key=bestseller", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition that contains the fields to update. This endpoint\nsupports sparse updates, so only new or changed fields need to be included in the request.\nOnly the following fields can be updated:\n- `name`\n- `description`\n- `visibility`\n- `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed\nselections are supported.\n\nFor more information, see\n[Update a location custom attribute definition](https://developer.squareup.com/docs/location-custom-attributes-api/custom-attribute-definitions#update-custom-attribute-definition).\nTo enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, specify the current version of the custom attribute definition. \nIf this is not important for your application, `version` can be set to -1." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute_definition": { + "description": "Update the description as desired.", + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateLocationCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents an [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The updated custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Update the description as desired.", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-12-02T19:34:10.181Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateLocationRequest": { + "type": "object", + "description": "The request object for the [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "location": { + "$ref": "#/components/schemas/Location", + "description": "The `Location` object with only the fields to update.", + "nullable": true + } + }, + "example": { + "location": { + "business_hours": { + "periods": [ + { + "day_of_week": "FRI", + "end_local_time": "18:00", + "start_local_time": "07:00" + }, + { + "day_of_week": "SAT", + "end_local_time": "18:00", + "start_local_time": "07:00" + }, + { + "day_of_week": "SUN", + "end_local_time": "15:00", + "start_local_time": "09:00" + } + ] + }, + "description": "Midtown Atlanta store - Open weekends" + } + } + }, + "UpdateLocationResponse": { + "type": "object", + "description": "The response object returned by the [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "location": { + "$ref": "#/components/schemas/Location", + "description": "The updated `Location` object." + } + }, + "example": { + "location": { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309" + }, + "business_hours": { + "periods": [ + { + "day_of_week": "FRI", + "end_local_time": "18:00", + "start_local_time": "07:00" + }, + { + "day_of_week": "SAT", + "end_local_time": "18:00", + "start_local_time": "07:00" + }, + { + "day_of_week": "SUN", + "end_local_time": "15:00", + "start_local_time": "09:00" + } + ] + }, + "business_name": "Jet Fuel Coffee", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ], + "coordinates": { + "latitude": 33.7889, + "longitude": -84.3841 + }, + "country": "US", + "created_at": "2022-02-19T17:58:25Z", + "currency": "USD", + "description": "Midtown Atlanta store - Open weekends", + "id": "3Z4V4WHQK64X9", + "language_code": "en-US", + "mcc": "7299", + "merchant_id": "3MYCJG5GVYQ8Q", + "name": "Midtown", + "status": "ACTIVE", + "timezone": "America/New_York", + "type": "PHYSICAL" + } + } + }, + "UpdateLocationSettingsRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "location_settings" + ], + "properties": { + "location_settings": { + "$ref": "#/components/schemas/CheckoutLocationSettings", + "description": "Describe your updates using the `location_settings` object. Make sure it contains only the fields that have changed." + } + } + }, + "UpdateLocationSettingsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred when updating the location settings." + }, + "location_settings": { + "$ref": "#/components/schemas/CheckoutLocationSettings", + "description": "The updated location settings." + } + }, + "example": { + "location_settings": { + "branding": { + "button_color": "#00b23b", + "button_shape": "ROUNDED", + "header_type": "FRAMED_LOGO" + }, + "customer_notes_enabled": false, + "location_id": "LOCATION_ID_1", + "policies": [ + { + "description": "This is my Return Policy", + "title": "Return Policy", + "uid": "POLICY_ID_1" + }, + { + "description": "Items may be returned within 30 days of purchase.", + "title": "Return Policy", + "uid": "POLICY_ID_2" + } + ], + "tipping": { + "default_percent": 20, + "default_whole_amount_money": { + "amount": 100, + "currency": "USD" + }, + "percentages": [ + 15, + 20, + 25 + ], + "smart_tipping_enabled": true, + "whole_amounts": [ + { + "amount": 1000, + "currency": "USD" + }, + { + "amount": 1500, + "currency": "USD" + }, + { + "amount": 2000, + "currency": "USD" + } + ] + }, + "updated_at": "2022-06-16T22:25:35Z" + } + } + }, + "UpdateMerchantCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) request.", + "x-release-status": "BETA", + "x-params-example": "?key=alternative_seller_name", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition that contains the fields to update. This endpoint\nsupports sparse updates, so only new or changed fields need to be included in the request.\nOnly the following fields can be updated:\n- `name`\n- `description`\n- `visibility`\n- `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed\nselections are supported.\nFor more information, see\n[Update a merchant custom attribute definition](https://developer.squareup.com/docs/merchant-custom-attributes-api/custom-attribute-definitions#update-custom-attribute-definition).\nThe version field must match the current version of the custom attribute definition to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\nIf this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute_definition": { + "description": "Update the description as desired.", + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateMerchantCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The updated custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2023-05-05T19:06:36.559Z", + "description": "Update the description as desired.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2023-05-05T19:34:10.181Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateMerchantSettingsRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "merchant_settings" + ], + "properties": { + "merchant_settings": { + "$ref": "#/components/schemas/CheckoutMerchantSettings", + "description": "Describe your updates using the `merchant_settings` object. Make sure it contains only the fields that have changed." + } + } + }, + "UpdateMerchantSettingsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred when updating the merchant settings." + }, + "merchant_settings": { + "$ref": "#/components/schemas/CheckoutMerchantSettings", + "description": "The updated merchant settings." + } + }, + "example": { + "merchant_settings": { + "merchant_id": "MERCHANT_ID", + "payment_methods": { + "afterpay_clearpay": { + "enabled": true, + "item_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + }, + "order_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + } + }, + "apple_pay": { + "enabled": false + }, + "cash_app_pay": { + "enabled": true + }, + "google_pay": { + "enabled": true + } + }, + "updated_at": "2022-06-16T22:25:35Z" + } + } + }, + "UpdateOrderCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents an update request for an order custom attribute definition.", + "x-release-status": "BETA", + "x-params-example": "?key=cover-count", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition that contains the fields to update. This endpoint supports sparse updates, \nso only new or changed fields need to be included in the request. For more information, see \n[Updatable definition fields](https://developer.squareup.com/docs/orders-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields).\n\nTo enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control, include the optional `version` field and specify the current version of the custom attribute definition." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. \nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute_definition": { + "key": "cover-count", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "idempotency_key": "IDEMPOTENCY_KEY" + } + }, + "UpdateOrderCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from updating an order custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The updated order custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-11-16T16:53:23.141Z", + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-11-16T17:44:11.436Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateOrderRequest": { + "type": "object", + "description": "Defines the fields that are included in requests to the\n[UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint.", + "x-release-status": "BETA", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects)\ncontaining only the fields to update and the version to which the update is\nbeing applied.", + "nullable": true + }, + "fields_to_clear": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete)\nfields to clear. For example, `line_items[uid].note`.\nFor more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#deleting-fields).", + "nullable": true + }, + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this update request.\n\nIf you are unsure whether a particular update was applied to an order successfully,\nyou can reattempt it with the same idempotency key without\nworrying about creating duplicate updates to the order.\nThe latest order version is returned.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 192, + "nullable": true + } + }, + "example": { + "fields_to_clear": [ + "discounts" + ], + "idempotency_key": "UNIQUE_STRING", + "order": { + "line_items": [ + { + "base_price_money": { + "amount": 200, + "currency": "USD" + }, + "name": "COOKIE", + "quantity": "2", + "uid": "cookie_uid" + } + ], + "version": 1 + } + } + }, + "UpdateOrderResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint.", + "x-release-status": "BETA", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The updated order." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "order": { + "created_at": "2019-08-23T18:26:18.243Z", + "id": "DREk7wJcyXNHqULq8JJ2iPAsluJZY", + "line_items": [ + { + "base_price_money": { + "amount": 500, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 500, + "currency": "USD" + }, + "name": "Small Coffee", + "quantity": "1", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 500, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "EuYkakhmu3ksHIds5Hiot", + "variation_total_price_money": { + "amount": 500, + "currency": "USD" + } + }, + { + "base_price_money": { + "amount": 200, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 400, + "currency": "USD" + }, + "name": "COOKIE", + "quantity": "2", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 400, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "cookie_uid", + "variation_total_price_money": { + "amount": 400, + "currency": "USD" + } + } + ], + "location_id": "MXVQSVNDGN3C8", + "net_amounts": { + "discount_money": { + "amount": 0, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 900, + "currency": "USD" + } + }, + "source": { + "name": "Cookies" + }, + "state": "OPEN", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 900, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2019-08-23T18:33:47.523Z", + "version": 2 + } + } + }, + "UpdatePaymentLinkRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "payment_link" + ], + "properties": { + "payment_link": { + "$ref": "#/components/schemas/PaymentLink", + "description": "The `payment_link` object describing the updates to apply.\nFor more information, see [Update a payment link](https://developer.squareup.com/docs/checkout-api/manage-checkout#update-a-payment-link)." + } + }, + "example": { + "payment_link": { + "checkout_options": { + "ask_for_shipping_address": true + }, + "version": 1 + } + } + }, + "UpdatePaymentLinkResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred when updating the payment link." + }, + "payment_link": { + "$ref": "#/components/schemas/PaymentLink", + "description": "The updated payment link." + } + }, + "example": { + "payment_link": { + "checkout_options": { + "ask_for_shipping_address": true + }, + "created_at": "2022-04-26T00:15:15Z", + "id": "TY4BWEDJ6AI5MBIV", + "long_url": "https://checkout.square.site/EXAMPLE", + "order_id": "Qqc8ypQGvxVwc46Cch4zHTaJqc4F", + "payment_note": "test", + "updated_at": "2022-04-26T00:18:24Z", + "url": "https://square.link/u/EXAMPLE", + "version": 2 + } + } + }, + "UpdatePaymentRequest": { + "type": "object", + "description": "Describes a request to update a payment using\n[UpdatePayment](api-endpoint:Payments-UpdatePayment).", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key" + ], + "properties": { + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The updated `Payment` object.", + "nullable": true + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `UpdatePayment` request. Keys can be any valid string\nbut must be unique for every `UpdatePayment` request.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45 + } + }, + "example": { + "idempotency_key": "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de", + "payment": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "tip_money": { + "amount": 100, + "currency": "USD" + }, + "version_token": "ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o" + } + } + }, + "UpdatePaymentResponse": { + "type": "object", + "description": "Defines the response returned by\n[UpdatePayment](api-endpoint:Payments-UpdatePayment).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The updated payment." + } + }, + "example": { + "payment": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-TcgftTEtKxJTRF1lCFJ9TA", + "square_product": "ECOMMERCE_API" + }, + "approved_money": { + "amount": 1000, + "currency": "USD" + }, + "capabilities": [ + "EDIT_AMOUNT_UP", + "EDIT_AMOUNT_DOWN", + "EDIT_TIP_AMOUNT_UP", + "EDIT_TIP_AMOUNT_DOWN" + ], + "card_details": { + "auth_result_code": "68aLBM", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T20:26:44.364Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "ON_FILE", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "AUTHORIZED" + }, + "created_at": "2021-10-13T20:26:44.191Z", + "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T20:26:44.191Z", + "id": "1QjqpBVyrI9S4H9sTGDWU9JeiWdZY", + "location_id": "L88917AVBK2S5", + "note": "Example Note", + "order_id": "nUSN9TdxpiK3SrQg3wzmf6r8LP9YY", + "receipt_number": "1Qjq", + "risk_evaluation": { + "created_at": "2021-10-13T20:26:45.271Z", + "risk_level": "NORMAL" + }, + "source_type": "CARD", + "status": "APPROVED", + "tip_money": { + "amount": 100, + "currency": "USD" + }, + "total_money": { + "amount": 1100, + "currency": "USD" + }, + "updated_at": "2021-10-13T20:26:44.364Z", + "version_token": "rDrXnqiS7fJgexccgdpzmwqTiXui1aIKCp9EchZ7trE6o" + } + } + }, + "UpdateScheduledShiftRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "scheduled_shift" + ], + "properties": { + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The scheduled shift with any updates in the `draft_shift_details` field.\nIf needed, call [ListLocations](api-endpoint:Locations-ListLocations) to get location IDs,\n[ListJobs](api-endpoint:Team-ListJobs) to get job IDs, and [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers)\nto get team member IDs and current job assignments. Updates made to `published_shift_details`\nare ignored.\n\nIf provided, the `start_at` and `end_at` timestamps must be in the time zone + offset of the\nshift location specified in `location_id`. Example for Pacific Standard Time: 2024-10-31T12:30:00-08:00\n\nTo enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for the request, provide the current version of the shift in the `version` field.\nIf the provided version doesn't match the server version, the request fails. If `version` is\nomitted, Square executes a blind write, potentially overwriting data from another publish request." + } + }, + "example": { + "scheduled_shift": { + "draft_shift_details": { + "end_at": "2019-03-25T13:18:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-03-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI" + }, + "version": 1 + } + } + }, + "UpdateScheduledShiftResponse": { + "type": "object", + "description": "Represents an [UpdateScheduledShift](api-endpoint:Labor-UpdateScheduledShift) response.\nEither `scheduled_shift` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The updated scheduled shift. To make the changes public, call \n[PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) or\n[BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "scheduled_shift": { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-03-25T13:18:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-03-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "updated_at": "2019-02-25T03:11:15-05:00", + "version": 2 + } + } + }, + "UpdateShiftRequest": { + "type": "object", + "description": "A request to update a `Shift` object.", + "x-release-status": "DEPRECATED", + "required": [ + "shift" + ], + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The updated `Shift` object." + } + }, + "example": { + "shift": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1500, + "currency": "USD" + }, + "tip_eligible": true, + "title": "Bartender" + } + } + } + }, + "UpdateShiftResponse": { + "type": "object", + "description": "The response to a request to update a `Shift`. The response contains\nthe updated `Shift` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The updated `Shift`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "shift": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "created_at": "2019-02-28T00:39:02Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "ormj0jJJZ5OZIzxrZYJI", + "end_at": "2019-01-25T13:11:00-05:00", + "id": "K0YH4CV5462JB", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-28T00:42:41Z", + "version": 2, + "wage": { + "hourly_rate": { + "amount": 1500, + "currency": "USD" + }, + "job_id": "dZtrPh5GSDGugyXGByesVp51", + "tip_eligible": true, + "title": "Bartender" + } + } + } + }, + "UpdateSubscriptionRequest": { + "type": "object", + "description": "Defines input parameters in a request to the \n[UpdateSubscription](api-endpoint:Subscriptions-UpdateSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The subscription object containing the current version, and fields to update.\nUnset fields will be left at their current server values, and JSON `null` values will\nbe treated as a request to clear the relevant data.", + "nullable": true + } + }, + "example": { + "subscription": { + "canceled_date": null, + "card_id": "{NEW CARD ID}" + } + } + }, + "UpdateSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[UpdateSubscription](api-endpoint:Subscriptions-UpdateSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The updated subscription." + } + }, + "example": { + "subscription": { + "card_id": "{NEW CARD ID}", + "charged_through_date": "2023-03-13", + "created_at": "2023-01-30T19:27:32Z", + "customer_id": "AM69AB81FT4479YH9HGWS1HZY8", + "id": "7217d8ca-1fee-4446-a9e5-8540b5d8c9bb", + "invoice_ids": [ + "inv:0-ChAPSfVYvNewckgf3x4iigN_ENMM", + "inv:0-ChBQaCCLfjcm9WEUBGxvuydJENMM" + ], + "location_id": "LPJKHYR7WFDKN", + "plan_variation_id": "XOUNEKCE6NSXQW5NTSQ73MMX", + "source": { + "name": "My Application" + }, + "start_date": "2023-01-30", + "status": "ACTIVE", + "timezone": "UTC", + "version": 3 + } + } + }, + "UpdateTeamMemberRequest": { + "type": "object", + "description": "Represents an update request for a `TeamMember` object.", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The team member fields to add, change, or clear. Fields can be cleared using a null value. To update\n`wage_setting.job_assignments`, you must provide the complete list of job assignments. If needed, call\n[ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values.", + "nullable": true + } + }, + "example": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "YSGH2WBKG94QZ", + "GA2Y9HSJ8KRYT" + ] + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "wage_setting": { + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 1200, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "pay_type": "HOURLY" + } + ] + } + } + } + }, + "UpdateTeamMemberResponse": { + "type": "object", + "description": "Represents a response from an update request containing the updated `TeamMember` object or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The successfully updated `TeamMember` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "GA2Y9HSJ8KRYT", + "YSGH2WBKG94QZ" + ] + }, + "created_at": "2021-06-11T22:55:45Z", + "email_address": "joe_doe@example.com", + "family_name": "Doe", + "given_name": "Joe", + "id": "1yJlHapkseYnNPETIU1B", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "updated_at": "2021-06-15T17:38:05Z", + "wage_setting": { + "created_at": "2021-06-11T22:55:45Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 1443, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 1200, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "1yJlHapkseYnNPETIU1B", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + } + } + }, + "UpdateTimecardRequest": { + "type": "object", + "description": "A request to update a `Timecard` object.", + "x-release-status": "PUBLIC", + "required": [ + "timecard" + ], + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The updated `Timecard` object." + } + }, + "example": { + "idempotency_key": "HIDSNG5KS478L", + "timecard": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1500, + "currency": "USD" + }, + "tip_eligible": true, + "title": "Bartender" + } + } + } + }, + "UpdateTimecardResponse": { + "type": "object", + "description": "The response to a request to update a `Timecard`. The response contains\nthe updated `Timecard` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The updated `Timecard`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "timecard": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "created_at": "2019-02-28T00:39:02Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "id": "K0YH4CV5462JB", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-28T00:42:41Z", + "version": 2, + "wage": { + "hourly_rate": { + "amount": 1500, + "currency": "USD" + }, + "job_id": "dZtrPh5GSDGugyXGByesVp51", + "tip_eligible": true, + "title": "Bartender" + } + } + } + }, + "UpdateVendorRequest": { + "type": "object", + "description": "Represents an input to a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor).", + "x-release-status": "BETA", + "required": [ + "vendor" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A client-supplied, universally unique identifier (UUID) for the\nrequest.\n\nSee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the\n[API Development 101](https://developer.squareup.com/docs/buildbasics) section for more\ninformation.", + "maxLength": 128, + "nullable": true + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The specified [Vendor](entity:Vendor) to be updated." + } + }, + "example": { + "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", + "vendor": { + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Jack's Chicken Shack", + "status": "ACTIVE", + "version": 1 + } + } + }, + "UpdateVendorResponse": { + "type": "object", + "description": "Represents an output from a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors occurred when the request fails." + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The [Vendor](entity:Vendor) that has been updated." + } + }, + "example": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "ordinal": 0, + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Jack's Chicken Shack", + "status": "ACTIVE", + "updated_at": "2022-03-16T20:21:54.859Z", + "version": 2 + } + } + }, + "UpdateWageSettingRequest": { + "type": "object", + "description": "Represents an update request for the `WageSetting` object describing a `TeamMember`.", + "x-release-status": "PUBLIC", + "required": [ + "wage_setting" + ], + "properties": { + "wage_setting": { + "$ref": "#/components/schemas/WageSetting", + "description": "The complete `WageSetting` object. For all job assignments, specify one of the following:\n- `job_id` (recommended) - If needed, call [ListJobs](api-endpoint:Team-ListJobs) to get a list of all jobs.\nRequires Square API version 2024-12-18 or later.\n- `job_title` - Use the exact, case-sensitive spelling of an existing title unless you want to create a new job.\nThis value is ignored if `job_id` is also provided." + } + }, + "example": { + "wage_setting": { + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ] + } + } + }, + "UpdateWageSettingResponse": { + "type": "object", + "description": "Represents a response from an update request containing the updated `WageSetting` object\nor error messages.", + "x-release-status": "PUBLIC", + "properties": { + "wage_setting": { + "$ref": "#/components/schemas/WageSetting", + "description": "The successfully updated `WageSetting` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "wage_setting": { + "created_at": "2019-07-10T17:26:48+00:00", + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 1443, + "currency": "USD" + }, + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "-3oZQKPKVk6gUXU_V5Qa", + "updated_at": "2020-06-11T23:12:04+00:00", + "version": 1 + } + } + }, + "UpdateWebhookSubscriptionRequest": { + "type": "object", + "description": "Updates a [Subscription](entity:WebhookSubscription).", + "x-release-status": "PUBLIC", + "properties": { + "subscription": { + "$ref": "#/components/schemas/WebhookSubscription", + "description": "The [Subscription](entity:WebhookSubscription) to update.", + "nullable": true + } + }, + "example": { + "subscription": { + "enabled": false, + "name": "Updated Example Webhook Subscription" + } + } + }, + "UpdateWebhookSubscriptionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [UpdateWebhookSubscription](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscription) endpoint.\n\nNote: If there are errors processing the request, the [Subscription](entity:WebhookSubscription) is not\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/WebhookSubscription", + "description": "The updated [Subscription](entity:WebhookSubscription)." + } + }, + "example": { + "subscription": { + "api_version": "2021-12-15", + "created_at": "2022-01-10 23:29:48 +0000 UTC", + "enabled": false, + "event_types": [ + "payment.created", + "payment.updated" + ], + "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", + "name": "Updated Example Webhook Subscription", + "notification_url": "https://example-webhook-url.com", + "updated_at": "2022-01-10 23:45:51 +0000 UTC" + } + } + }, + "UpdateWebhookSubscriptionSignatureKeyRequest": { + "type": "object", + "description": "Updates a [Subscription](entity:WebhookSubscription) by replacing the existing signature key with a new one.", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) request.", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "idempotency_key": "ed80ae6b-0654-473b-bbab-a39aee89a60d" + } + }, + "UpdateWebhookSubscriptionSignatureKeyResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) endpoint.\n\nNote: If there are errors processing the request, the [Subscription](entity:WebhookSubscription) is not\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "signature_key": { + "type": "string", + "description": "The new Square-generated signature key used to validate the origin of the webhook event.", + "readOnly": true + } + }, + "example": { + "signature_key": "1k9bIJKCeTmSQwyagtNRLg" + } + }, + "UpdateWorkweekConfigRequest": { + "type": "object", + "description": "A request to update a `WorkweekConfig` object.", + "x-release-status": "PUBLIC", + "required": [ + "workweek_config" + ], + "properties": { + "workweek_config": { + "$ref": "#/components/schemas/WorkweekConfig", + "description": "The updated `WorkweekConfig` object." + } + }, + "example": { + "workweek_config": { + "start_of_day_local_time": "10:00", + "start_of_week": "MON", + "version": 10 + } + } + }, + "UpdateWorkweekConfigResponse": { + "type": "object", + "description": "The response to a request to update a `WorkweekConfig` object. The response contains\nthe updated `WorkweekConfig` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "workweek_config": { + "$ref": "#/components/schemas/WorkweekConfig", + "description": "The response object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "workweek_config": { + "created_at": "2016-02-04T00:58:24Z", + "id": "FY4VCAQN700GM", + "start_of_day_local_time": "10:00", + "start_of_week": "MON", + "updated_at": "2019-02-28T01:04:35Z", + "version": 11 + } + } + }, + "UpsertBookingCustomAttributeRequest": { + "type": "object", + "description": "Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) request.", + "x-release-status": "PUBLIC", + "required": [ + "custom_attribute" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Value data types](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for an update operation, include this optional field and specify the current version\nof the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "UpsertBookingCustomAttributeResponse": { + "type": "object", + "description": "Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-11-16T15:50:27Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T15:50:27Z", + "value": "Spring Fresh", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [] + } + }, + "UpsertCatalogObjectRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "object" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this\nrequest among all your requests. A common way to create\na valid idempotency key is to use a Universally unique\nidentifier (UUID).\n\nIf you're unsure whether a particular request was successful,\nyou can reattempt it with the same idempotency key without\nworrying about creating duplicate objects.\n\nSee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 128 + }, + "object": { + "$ref": "#/components/schemas/CatalogObject", + "description": "A CatalogObject to be created or updated.\n\n- For updates, the object must be active (the `is_deleted` field is not `true`).\n- For creates, the object ID must start with `#`. The provided ID is replaced with a server-generated ID." + } + }, + "example": { + "idempotency_key": "af3d1afc-7212-4300-b463-0bfc5314a5ae", + "object": { + "id": "#Cocoa", + "item_data": { + "abbreviation": "Ch", + "description_html": "\u003cp\u003e\u003cstrong\u003eHot\u003c/strong\u003e Chocolate\u003c/p\u003e", + "name": "Cocoa", + "variations": [ + { + "id": "#Small", + "item_variation_data": { + "item_id": "#Cocoa", + "name": "Small", + "pricing_type": "VARIABLE_PRICING" + }, + "type": "ITEM_VARIATION" + }, + { + "id": "#Large", + "item_variation_data": { + "item_id": "#Cocoa", + "name": "Large", + "price_money": { + "amount": 400, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "type": "ITEM_VARIATION" + } + ] + }, + "type": "ITEM" + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.csharp", + "java": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.java", + "javascript": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.javascript", + "php": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.php", + "python": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.python", + "ruby": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.ruby" + } + }, + "UpsertCatalogObjectResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "catalog_object": { + "$ref": "#/components/schemas/CatalogObject", + "description": "The successfully created or updated CatalogObject." + }, + "id_mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogIdMapping" + }, + "description": "The mapping between client and server IDs for this upsert." + } + }, + "example": { + "catalog_object": { + "id": "R2TA2FOBUGCJZNIWJSOSNAI4", + "is_deleted": false, + "item_data": { + "abbreviation": "Ch", + "description": "Hot Chocolate", + "description_html": "\u003cp\u003e\u003cstrong\u003eHot\u003c/strong\u003e Chocolate\u003c/p\u003e", + "description_plaintext": "Hot Chocolate", + "name": "Cocoa", + "product_type": "REGULAR", + "variations": [ + { + "id": "QRT53UP4LITLWGOGBZCUWP63", + "is_deleted": false, + "item_variation_data": { + "item_id": "R2TA2FOBUGCJZNIWJSOSNAI4", + "name": "Small", + "ordinal": 0, + "pricing_type": "VARIABLE_PRICING", + "stockable": true + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2021-06-14T15:51:39.021Z", + "version": 1623685899021 + }, + { + "id": "NS77DKEIQ3AEQTCP727DSA7U", + "is_deleted": false, + "item_variation_data": { + "item_id": "R2TA2FOBUGCJZNIWJSOSNAI4", + "name": "Large", + "ordinal": 1, + "price_money": { + "amount": 400, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING", + "stockable": true + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2021-06-14T15:51:39.021Z", + "version": 1623685899021 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2021-06-14T15:51:39.021Z", + "version": 1623685899021 + }, + "id_mappings": [ + { + "client_object_id": "#Cocoa", + "object_id": "R2TA2FOBUGCJZNIWJSOSNAI4" + }, + { + "client_object_id": "#Small", + "object_id": "QRT53UP4LITLWGOGBZCUWP63" + }, + { + "client_object_id": "#Large", + "object_id": "NS77DKEIQ3AEQTCP727DSA7U" + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.csharp", + "java": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.java", + "javascript": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.javascript", + "php": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.php", + "python": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.python", + "ruby": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.ruby" + } + }, + "UpsertCustomerCustomAttributeRequest": { + "type": "object", + "description": "Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?customer_id=Z57QXKM2FGXEQDV42W8RBZY7BR\u0026key=favoritemovie", + "required": [ + "custom_attribute" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n\n- `value`. This value must conform to the `schema` specified by the definition. \nFor more information, see [Value data types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for an update operation, include this optional field and specify the current version\nof the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute": { + "value": "Dune" + } + } + }, + "UpsertCustomerCustomAttributeResponse": { + "type": "object", + "description": "Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-04-26T15:50:27Z", + "key": "favoritemovie", + "updated_at": "2022-04-26T15:50:27Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpsertLocationCustomAttributeRequest": { + "type": "object", + "description": "Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) request.", + "x-release-status": "BETA", + "x-params-example": "?location_id=L0TBCBTB7P8RQ\u0026key=bestseller", + "required": [ + "custom_attribute" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for an update operation, include the current version of the custom attribute.\nIf this is not important for your application, version can be set to -1." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute": { + "value": "hot cocoa" + } + } + }, + "UpsertLocationCustomAttributeResponse": { + "type": "object", + "description": "Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-01-09T19:02:58.647Z", + "key": "bestseller", + "updated_at": "2023-01-09T19:21:04.551Z", + "value": "hot cocoa", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "UpsertMerchantCustomAttributeRequest": { + "type": "object", + "description": "Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) request.", + "x-release-status": "BETA", + "x-params-example": "?merchant_id=DM7VKY8Q63GNP\u0026key=alternative_seller_name", + "required": [ + "custom_attribute" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).\n- The version field must match the current version of the custom attribute definition to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\nIf this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute": { + "value": "Ultimate Sneaker Store" + } + } + }, + "UpsertMerchantCustomAttributeResponse": { + "type": "object", + "description": "Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-05-06T19:02:58.647Z", + "key": "alternative_seller_name", + "updated_at": "2023-05-06T19:21:04.551Z", + "value": "Ultimate Sneaker Store", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpsertOrderCustomAttributeRequest": { + "type": "object", + "description": "Represents an upsert request for an order custom attribute.", + "x-release-status": "BETA", + "required": [ + "custom_attribute" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n\n- `value`. This value must conform to the `schema` specified by the definition. \nFor more information, see [Value data types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, include this optional field and specify the current version of the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. \nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute": { + "key": "table-number", + "value": "42", + "version": 1 + } + } + }, + "UpsertOrderCustomAttributeResponse": { + "type": "object", + "description": "Represents a response from upserting order custom attribute definitions.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The order custom attribute that was created or modified." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-10-06T20:41:22.673Z", + "key": "table-number", + "updated_at": "2022-10-06T20:41:22.673Z", + "value": "42", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "UpsertSnippetRequest": { + "type": "object", + "description": "Represents an `UpsertSnippet` request.", + "x-release-status": "PUBLIC", + "required": [ + "snippet" + ], + "properties": { + "snippet": { + "$ref": "#/components/schemas/Snippet", + "description": "The snippet for the site." + } + }, + "example": { + "snippet": { + "content": "\u003cscript\u003evar js = 1;\u003c/script\u003e" + } + } + }, + "UpsertSnippetResponse": { + "type": "object", + "description": "Represents an `UpsertSnippet` response. The response can include either `snippet` or `errors`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "snippet": { + "$ref": "#/components/schemas/Snippet", + "description": "The new or updated snippet." + } + }, + "example": { + "snippet": { + "content": "\u003cscript\u003evar js = 1;\u003c/script\u003e", + "created_at": "2021-03-11T25:40:09.000000Z", + "id": "snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7", + "site_id": "site_278075276488921835", + "updated_at": "2021-03-11T25:40:09.000000Z" + } + } + }, + "V1Money": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "amount": { + "type": "integer", + "description": "Amount in the lowest denominated value of this Currency. E.g. in USD\nthese are cents, in JPY they are Yen (which do not have a 'cent' concept).", + "nullable": true + }, + "currency_code": { + "$ref": "#/components/schemas/Currency", + "description": "\nSee [Currency](#type-currency) for possible values", + "nullable": true + } + } + }, + "V1Order": { + "type": "object", + "description": "V1Order", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The order's unique identifier." + }, + "buyer_email": { + "type": "string", + "description": "The email address of the order's buyer.", + "nullable": true + }, + "recipient_name": { + "type": "string", + "description": "The name of the order's buyer.", + "nullable": true + }, + "recipient_phone_number": { + "type": "string", + "description": "The phone number to use for the order's delivery.", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/V1OrderState", + "description": "Whether the tax is an ADDITIVE tax or an INCLUSIVE tax.\nSee [V1OrderState](#type-v1orderstate) for possible values", + "nullable": true + }, + "shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "The address to ship the order to.", + "nullable": true + }, + "subtotal_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The amount of all items purchased in the order, before taxes and shipping.", + "nullable": true + }, + "total_shipping_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The shipping cost for the order.", + "nullable": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The total of all taxes applied to the order.", + "nullable": true + }, + "total_price_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The total cost of the order.", + "nullable": true + }, + "total_discount_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The total of all discounts applied to the order.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the order was created, in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "description": "The time when the order was last modified, in ISO 8601 format." + }, + "expires_at": { + "type": "string", + "description": "The time when the order expires if no action is taken, in ISO 8601 format.", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The unique identifier of the payment associated with the order.", + "nullable": true + }, + "buyer_note": { + "type": "string", + "description": "A note provided by the buyer when the order was created, if any.", + "nullable": true + }, + "completed_note": { + "type": "string", + "description": "A note provided by the merchant when the order's state was set to COMPLETED, if any", + "nullable": true + }, + "refunded_note": { + "type": "string", + "description": "A note provided by the merchant when the order's state was set to REFUNDED, if any.", + "nullable": true + }, + "canceled_note": { + "type": "string", + "description": "A note provided by the merchant when the order's state was set to CANCELED, if any.", + "nullable": true + }, + "tender": { + "$ref": "#/components/schemas/V1Tender", + "description": "The tender used to pay for the order.", + "nullable": true + }, + "order_history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V1OrderHistoryEntry" + }, + "description": "The history of actions associated with the order.", + "nullable": true + }, + "promo_code": { + "type": "string", + "description": "The promo code provided by the buyer, if any.", + "nullable": true + }, + "btc_receive_address": { + "type": "string", + "description": "For Bitcoin transactions, the address that the buyer sent Bitcoin to.", + "nullable": true + }, + "btc_price_satoshi": { + "type": "number", + "description": "For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 BTC).", + "nullable": true + } + } + }, + "V1OrderHistoryEntry": { + "type": "object", + "description": "V1OrderHistoryEntry", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "properties": { + "action": { + "$ref": "#/components/schemas/V1OrderHistoryEntryAction", + "description": "The type of action performed on the order.\nSee [V1OrderHistoryEntryAction](#type-v1orderhistoryentryaction) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the action was performed, in ISO 8601 format." + } + } + }, + "V1OrderHistoryEntryAction": { + "type": "string", + "enum": [ + "ORDER_PLACED", + "DECLINED", + "PAYMENT_RECEIVED", + "CANCELED", + "COMPLETED", + "REFUNDED", + "EXPIRED" + ], + "x-enum-elements": [ + { + "name": "ORDER_PLACED", + "description": "" + }, + { + "name": "DECLINED", + "description": "" + }, + { + "name": "PAYMENT_RECEIVED", + "description": "" + }, + { + "name": "CANCELED", + "description": "" + }, + { + "name": "COMPLETED", + "description": "" + }, + { + "name": "REFUNDED", + "description": "" + }, + { + "name": "EXPIRED", + "description": "" + } + ], + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY" + }, + "V1OrderState": { + "type": "string", + "enum": [ + "PENDING", + "OPEN", + "COMPLETED", + "CANCELED", + "REFUNDED", + "REJECTED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "" + }, + { + "name": "OPEN", + "description": "" + }, + { + "name": "COMPLETED", + "description": "" + }, + { + "name": "CANCELED", + "description": "" + }, + { + "name": "REFUNDED", + "description": "" + }, + { + "name": "REJECTED", + "description": "" + } + ], + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY" + }, + "V1Tender": { + "type": "object", + "description": "A tender represents a discrete monetary exchange. Square represents this\nexchange as a money object with a specific currency and amount, where the\namount is given in the smallest denomination of the given currency.\n\nSquare POS can accept more than one form of tender for a single payment (such\nas by splitting a bill between a credit card and a gift card). The `tender`\nfield of the Payment object lists all forms of tender used for the payment.\n\nSplit tender payments behave slightly differently from single tender payments:\n\nThe receipt_url for a split tender corresponds only to the first tender listed\nin the tender field. To get the receipt URLs for the remaining tenders, use\nthe receipt_url fields of the corresponding Tender objects.\n\n*A note on gift cards**: when a customer purchases a Square gift card from a\nmerchant, the merchant receives the full amount of the gift card in the\nassociated payment.\n\nWhen that gift card is used as a tender, the balance of the gift card is\nreduced and the merchant receives no funds. A `Tender` object with a type of\n`SQUARE_GIFT_CARD` indicates a gift card was used for some or all of the\nassociated payment.", + "x-release-status": "DEPRECATED", + "properties": { + "id": { + "type": "string", + "description": "The tender's unique ID." + }, + "type": { + "$ref": "#/components/schemas/V1TenderType", + "description": "The type of tender.\nSee [V1TenderType](#type-v1tendertype) for possible values", + "nullable": true + }, + "name": { + "type": "string", + "description": "A human-readable description of the tender.", + "nullable": true + }, + "employee_id": { + "type": "string", + "description": "The ID of the employee that processed the tender.", + "nullable": true + }, + "receipt_url": { + "type": "string", + "description": "The URL of the receipt for the tender.", + "nullable": true + }, + "card_brand": { + "$ref": "#/components/schemas/V1TenderCardBrand", + "description": "The brand of credit card provided.\nSee [V1TenderCardBrand](#type-v1tendercardbrand) for possible values", + "nullable": true + }, + "pan_suffix": { + "type": "string", + "description": "The last four digits of the provided credit card's account number.", + "nullable": true + }, + "entry_method": { + "$ref": "#/components/schemas/V1TenderEntryMethod", + "description": "The tender's unique ID.\nSee [V1TenderEntryMethod](#type-v1tenderentrymethod) for possible values", + "nullable": true + }, + "payment_note": { + "type": "string", + "description": "Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER.", + "nullable": true + }, + "total_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The total amount of money provided in this form of tender.", + "nullable": true + }, + "tendered_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The amount of total_money applied to the payment.", + "nullable": true + }, + "tendered_at": { + "type": "string", + "description": "The time when the tender was created, in ISO 8601 format.", + "nullable": true + }, + "settled_at": { + "type": "string", + "description": "The time when the tender was settled, in ISO 8601 format.", + "nullable": true + }, + "change_back_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The amount of total_money returned to the buyer as change.", + "nullable": true + }, + "refunded_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The total of all refunds applied to this tender. This amount is always negative or zero.", + "nullable": true + }, + "is_exchange": { + "type": "boolean", + "description": "Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the tender represents the value of goods returned in an exchange not the actual money paid. The exchange value reduces the tender amounts needed to pay for items purchased in the exchange.", + "nullable": true + } + } + }, + "V1TenderCardBrand": { + "type": "string", + "enum": [ + "OTHER_BRAND", + "VISA", + "MASTER_CARD", + "AMERICAN_EXPRESS", + "DISCOVER", + "DISCOVER_DINERS", + "JCB", + "CHINA_UNIONPAY", + "SQUARE_GIFT_CARD" + ], + "x-enum-elements": [ + { + "name": "OTHER_BRAND", + "description": "" + }, + { + "name": "VISA", + "description": "" + }, + { + "name": "MASTER_CARD", + "description": "" + }, + { + "name": "AMERICAN_EXPRESS", + "description": "" + }, + { + "name": "DISCOVER", + "description": "" + }, + { + "name": "DISCOVER_DINERS", + "description": "" + }, + { + "name": "JCB", + "description": "" + }, + { + "name": "CHINA_UNIONPAY", + "description": "" + }, + { + "name": "SQUARE_GIFT_CARD", + "description": "" + } + ], + "description": "The brand of a credit card.", + "x-release-status": "DEPRECATED" + }, + "V1TenderEntryMethod": { + "type": "string", + "enum": [ + "MANUAL", + "SCANNED", + "SQUARE_CASH", + "SQUARE_WALLET", + "SWIPED", + "WEB_FORM", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "MANUAL", + "description": "" + }, + { + "name": "SCANNED", + "description": "" + }, + { + "name": "SQUARE_CASH", + "description": "" + }, + { + "name": "SQUARE_WALLET", + "description": "" + }, + { + "name": "SWIPED", + "description": "" + }, + { + "name": "WEB_FORM", + "description": "" + }, + { + "name": "OTHER", + "description": "" + } + ], + "x-release-status": "DEPRECATED" + }, + "V1TenderType": { + "type": "string", + "enum": [ + "CREDIT_CARD", + "CASH", + "THIRD_PARTY_CARD", + "NO_SALE", + "SQUARE_WALLET", + "SQUARE_GIFT_CARD", + "UNKNOWN", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "CREDIT_CARD", + "description": "" + }, + { + "name": "CASH", + "description": "" + }, + { + "name": "THIRD_PARTY_CARD", + "description": "" + }, + { + "name": "NO_SALE", + "description": "" + }, + { + "name": "SQUARE_WALLET", + "description": "" + }, + { + "name": "SQUARE_GIFT_CARD", + "description": "" + }, + { + "name": "UNKNOWN", + "description": "" + }, + { + "name": "OTHER", + "description": "" + } + ], + "x-release-status": "DEPRECATED" + }, + "V1UpdateOrderRequest": { + "type": "object", + "description": "V1UpdateOrderRequest", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "required": [ + "action" + ], + "properties": { + "action": { + "$ref": "#/components/schemas/V1UpdateOrderRequestAction", + "description": "The action to perform on the order (COMPLETE, CANCEL, or REFUND).\nSee [V1UpdateOrderRequestAction](#type-v1updateorderrequestaction) for possible values" + }, + "shipped_tracking_number": { + "type": "string", + "description": "The tracking number of the shipment associated with the order. Only valid if action is COMPLETE.", + "nullable": true + }, + "completed_note": { + "type": "string", + "description": "A merchant-specified note about the completion of the order. Only valid if action is COMPLETE.", + "nullable": true + }, + "refunded_note": { + "type": "string", + "description": "A merchant-specified note about the refunding of the order. Only valid if action is REFUND.", + "nullable": true + }, + "canceled_note": { + "type": "string", + "description": "A merchant-specified note about the canceling of the order. Only valid if action is CANCEL.", + "nullable": true + } + } + }, + "V1UpdateOrderRequestAction": { + "type": "string", + "enum": [ + "COMPLETE", + "CANCEL", + "REFUND" + ], + "x-enum-elements": [ + { + "name": "COMPLETE", + "description": "" + }, + { + "name": "CANCEL", + "description": "" + }, + { + "name": "REFUND", + "description": "" + } + ], + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY" + }, + "Vendor": { + "type": "object", + "description": "Represents a supplier to a seller.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "A unique Square-generated ID for the [Vendor](entity:Vendor).\nThis field is required when attempting to update a [Vendor](entity:Vendor).", + "maxLength": 100 + }, + "created_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when the\n[Vendor](entity:Vendor) was created.", + "maxLength": 34, + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when the\n[Vendor](entity:Vendor) was last updated.", + "maxLength": 34, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the [Vendor](entity:Vendor).\nThis field is required when attempting to create or update a [Vendor](entity:Vendor).", + "maxLength": 100, + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The address of the [Vendor](entity:Vendor).", + "nullable": true + }, + "contacts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VendorContact" + }, + "description": "The contacts of the [Vendor](entity:Vendor).", + "nullable": true + }, + "account_number": { + "type": "string", + "description": "The account number of the [Vendor](entity:Vendor).", + "maxLength": 100, + "nullable": true + }, + "note": { + "type": "string", + "description": "A note detailing information about the [Vendor](entity:Vendor).", + "maxLength": 4096, + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version of the [Vendor](entity:Vendor)." + }, + "status": { + "$ref": "#/components/schemas/VendorStatus", + "description": "The status of the [Vendor](entity:Vendor).\nSee [Status](#type-status) for possible values", + "nullable": true + } + } + }, + "VendorContact": { + "type": "object", + "description": "Represents a contact of a [Vendor](entity:Vendor).", + "x-release-status": "BETA", + "required": [ + "ordinal" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique Square-generated ID for the [VendorContact](entity:VendorContact).\nThis field is required when attempting to update a [VendorContact](entity:VendorContact).", + "maxLength": 100 + }, + "name": { + "type": "string", + "description": "The name of the [VendorContact](entity:VendorContact).\nThis field is required when attempting to create a [Vendor](entity:Vendor).", + "maxLength": 255, + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address of the [VendorContact](entity:VendorContact).", + "maxLength": 255, + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number of the [VendorContact](entity:VendorContact).", + "maxLength": 255, + "nullable": true + }, + "removed": { + "type": "boolean", + "description": "The state of the [VendorContact](entity:VendorContact).", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The ordinal of the [VendorContact](entity:VendorContact)." + } + } + }, + "VendorCreatedEvent": { + "type": "object", + "description": "Published when a [Vendor](entity:Vendor) is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of a seller associated with this event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of a location associated with the event, if the event is associated with the location of the seller.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"vendor.created\".`", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for this event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The RFC 3339-formatted time when the underlying event data object is created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/VendorCreatedEventData", + "description": "The data associated with this event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-03-16T01:04:37.308555597Z", + "data": { + "id": "5b041563-c3fa-4989-baaf-dec90e81de0b", + "object": { + "operation": "CREATED", + "vendor": { + "address": { + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "W43ANBJLR5UAV7WT", + "name": "Joe Burrow", + "ordinal": 0, + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T01:04:12.581Z", + "id": "BXIDSDOUIU34VY2V", + "name": "A vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T01:04:12.581Z", + "version": 1 + } + }, + "type": "vendor" + }, + "event_id": "4edd919d-ed19-492d-bcb0-1a1ef65dda1a", + "merchant_id": "ETCE****QDYP", + "type": "vendor.created" + }, + "x-webhook": { + "event": "vendor.created", + "scopes": [ + "VENDOR_READ" + ] + }, + "x-api": "#/components/x-apis/Vendors", + "x-since": "2022-03-16" + }, + "VendorCreatedEventData": { + "type": "object", + "description": "Defines the `vendor.created` event data structure.", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `vendor`", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object." + }, + "object": { + "$ref": "#/components/schemas/VendorCreatedEventObject", + "description": "An object containing the created vendor.", + "nullable": true + } + } + }, + "VendorCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "operation": { + "$ref": "#/components/schemas/VendorCreatedEventObjectOperation", + "description": "The operation on the vendor that caused the event to be published. The value is `CREATED`.\nSee [Operation](#type-operation) for possible values", + "nullable": true + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The created vendor as the result of the specified operation.", + "nullable": true + } + } + }, + "VendorCreatedEventObjectOperation": { + "type": "string", + "enum": [ + "CREATED" + ], + "x-enum-elements": [ + { + "name": "CREATED", + "description": "" + } + ], + "description": "The operation that can be performed against a vendor to cause the event to be published.", + "x-release-status": "BETA" + }, + "VendorStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "Vendor is active and can receive purchase orders." + }, + { + "name": "INACTIVE", + "description": "Vendor is inactive and cannot receive purchase orders." + } + ], + "description": "The status of the [Vendor](entity:Vendor),\nwhether a [Vendor](entity:Vendor) is active or inactive.", + "x-release-status": "BETA" + }, + "VendorUpdatedEvent": { + "type": "object", + "description": "Published when a [Vendor](entity:Vendor) is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of a seller associated with this event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of a seller location associated with this event, if the event is associated with the location.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"vendor.updated\".`", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for this webhoook event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The RFC 3339-formatted time when the underlying event data object is created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/VendorUpdatedEventData", + "description": "The data associated with this event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-03-16T01:15:35.780283073Z", + "data": { + "id": "1e8d9885-21dc-41b9-8a8f-6ccf64da5462", + "object": { + "operation": "UPDATED", + "vendor": { + "address": { + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "W43ANBJLR5UAV7WT", + "name": "Joe Burrow", + "ordinal": 0, + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T01:04:12.581Z", + "id": "BXIDSDOUIU34VY2V", + "name": "Macro Brewing", + "note": "Preferred beer supplier", + "status": "ACTIVE", + "updated_at": "2022-03-16T01:15:35.774Z", + "version": 2 + } + }, + "type": "vendor" + }, + "event_id": "1ae8cc43-bf73-48f6-a767-90bdfa197421", + "merchant_id": "ETCE****QDYP", + "type": "vendor.updated" + }, + "x-webhook": { + "event": "vendor.updated", + "scopes": [ + "VENDOR_READ" + ] + }, + "x-api": "#/components/x-apis/Vendors", + "x-since": "2022-03-16" + }, + "VendorUpdatedEventData": { + "type": "object", + "description": "Defines the `vendor.updated` event data structure.", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `vendor`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object." + }, + "object": { + "$ref": "#/components/schemas/VendorUpdatedEventObject", + "description": "An object containing updated vendor.", + "nullable": true + } + } + }, + "VendorUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "operation": { + "$ref": "#/components/schemas/VendorUpdatedEventObjectOperation", + "description": "The operation on the vendor that caused the event to be published. The value is `UPDATED`.\nSee [Operation](#type-operation) for possible values", + "nullable": true + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The updated vendor as the result of the specified operation.", + "nullable": true + } + } + }, + "VendorUpdatedEventObjectOperation": { + "type": "string", + "enum": [ + "UPDATED" + ], + "x-enum-elements": [ + { + "name": "UPDATED", + "description": "" + } + ], + "description": "The operation that can be performed against a vendor to cause the event to be published.", + "x-release-status": "BETA" + }, + "VisibilityFilter": { + "type": "string", + "enum": [ + "ALL", + "READ", + "READ_WRITE" + ], + "x-enum-elements": [ + { + "name": "ALL", + "description": "All custom attributes or custom attribute definitions." + }, + { + "name": "READ", + "description": "All custom attributes or custom attribute definitions with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`." + }, + { + "name": "READ_WRITE", + "description": "All custom attributes or custom attribute definitions with the `visibility` field set to `VISIBILITY_READ_WRITE_VALUES`." + } + ], + "description": "Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions.", + "x-release-status": "PUBLIC" + }, + "VoidTransactionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint.", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {}, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/VoidTransaction/VoidTransactionResponse.csharp", + "java": "/sdk_samples/VoidTransaction/VoidTransactionResponse.java", + "javascript": "/sdk_samples/VoidTransaction/VoidTransactionResponse.javascript", + "php": "/sdk_samples/VoidTransaction/VoidTransactionResponse.php", + "python": "/sdk_samples/VoidTransaction/VoidTransactionResponse.python", + "ruby": "/sdk_samples/VoidTransaction/VoidTransactionResponse.ruby" + } + }, + "WageSetting": { + "type": "object", + "description": "Represents information about the overtime exemption status, job assignments, and compensation\nfor a [team member](entity:TeamMember).", + "x-release-status": "PUBLIC", + "properties": { + "team_member_id": { + "type": "string", + "description": "The ID of the team member associated with the wage setting.", + "nullable": true + }, + "job_assignments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/JobAssignment" + }, + "description": "**Required** The ordered list of jobs that the team member is assigned to.\nThe first job assignment is considered the team member's primary job.", + "nullable": true + }, + "is_overtime_exempt": { + "type": "boolean", + "description": "Whether the team member is exempt from the overtime rules of the seller's country.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "**Read only** Used for resolving concurrency issues. The request fails if the version\nprovided does not match the server version at the time of the request. If not provided,\nSquare executes a blind write, potentially overwriting data from another write. For more information,\nsee [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency)." + }, + "created_at": { + "type": "string", + "description": "The timestamp when the wage setting was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the wage setting was last updated, in RFC 3339 format.", + "readOnly": true + } + } + }, + "WebhookSubscription": { + "type": "object", + "description": "Represents the details of a webhook subscription, including notification URL,\nevent types, and signature key.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A Square-generated unique ID for the subscription.", + "maxLength": 64, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of this subscription.", + "maxLength": 64, + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the subscription is enabled (`true`) or not (`false`).", + "nullable": true + }, + "event_types": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The event types associated with this subscription.", + "nullable": true + }, + "notification_url": { + "type": "string", + "description": "The URL to which webhooks are sent.", + "nullable": true + }, + "api_version": { + "type": "string", + "description": "The API version of the subscription.\nThis field is optional for `CreateWebhookSubscription`. \nThe value defaults to the API version used by the application.", + "nullable": true + }, + "signature_key": { + "type": "string", + "description": "The Square-generated signature key used to validate the origin of the webhook event.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the subscription was created, in RFC 3339 format. For example, \"2016-09-04T23:59:33.123Z\".", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the subscription was last updated, in RFC 3339 format.\nFor example, \"2016-09-04T23:59:33.123Z\".", + "readOnly": true + } + } + }, + "Weekday": { + "type": "string", + "enum": [ + "MON", + "TUE", + "WED", + "THU", + "FRI", + "SAT", + "SUN" + ], + "x-enum-elements": [ + { + "name": "MON", + "description": "Monday" + }, + { + "name": "TUE", + "description": "Tuesday" + }, + { + "name": "WED", + "description": "Wednesday" + }, + { + "name": "THU", + "description": "Thursday" + }, + { + "name": "FRI", + "description": "Friday" + }, + { + "name": "SAT", + "description": "Saturday" + }, + { + "name": "SUN", + "description": "Sunday" + } + ], + "description": "The days of the week.", + "x-release-status": "PUBLIC" + }, + "WorkweekConfig": { + "type": "object", + "description": "Sets the day of the week and hour of the day that a business starts a\nworkweek. This is used to calculate overtime pay.", + "x-release-status": "PUBLIC", + "required": [ + "start_of_week", + "start_of_day_local_time" + ], + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object." + }, + "start_of_week": { + "$ref": "#/components/schemas/Weekday", + "description": "The day of the week on which a business week starts for\ncompensation purposes.\nSee [Weekday](#type-weekday) for possible values" + }, + "start_of_day_local_time": { + "type": "string", + "description": "The local time at which a business week starts. Represented as a\nstring in `HH:MM` format (`HH:MM:SS` is also accepted, but seconds are\ntruncated).", + "minLength": 1 + }, + "version": { + "type": "integer", + "description": "Used for resolving concurrency issues. The request fails if the version\nprovided does not match the server version at the time of the request. If not provided,\nSquare executes a blind write; potentially overwriting data from another\nwrite." + }, + "created_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format; presented in UTC.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format; presented in UTC.", + "readOnly": true + } + } + } + }, + "x-apis": { + "ApplePay": { + "name": "Apple Pay", + "summary": "Apple Pay support APIs", + "description": "\nThe Apple Pay APIs provides an easy way for platform developers\nto bulk activate Web Apple Pay with Square for merchants using their platform.\n\nFor more information, see the following guides:\n- [Web Payments SDK](https://developer.squareup.com/docs/web-payments/apple-pay)\n- [In-App Payments SDK](https://developer.squareup.com/docs/in-app-payments-sdk/add-digital-wallets/apple-pay)" + }, + "BankAccounts": { + "name": "Bank Accounts", + "summary": "Get a list of a seller's bank accounts.", + "description": "\nThe Bank Accounts API allows you to get basic details about a seller's bank account, such as the\nlast few digits of the account number and the routing number. It can be paired with the Payouts API to understand the\npattern of deposits and withdrawals from a seller's bank account.\n\nFor more information, see the following guides:\n - [Bank Accounts](https://developer.squareup.com/docs/bank-accounts-api)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)\n" + }, + "BookingCustomAttributes": { + "name": "Booking Custom Attributes", + "summary": "Create and manage booking-related custom attribute definitions and custom attributes.", + "description": "\nUse the Booking Custom Attributes API to create and manage custom attributes for bookings to store properties or \nmetadata to support seller-specific customizations of and extensions to the `Booking` object. \n\nFor more information, see the following guides: \n - [Booking Custom Attributes](https://developer.squareup.com/docs/booking-custom-attributes-api/overview).\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)\n" + }, + "Bookings": { + "name": "Bookings", + "summary": "Create and manage bookings for Square sellers with the Bookings API.", + "description": "\nThe Bookings API allows you to create, retrieve, update, and cancel appointments online. When used with other Square APIs (such as the Locations API, Team API, Catalog API, and Customers API), the Bookings API lets you create online-booking applications for users to book services provided by Square sellers. \n\n\n## Why Use the Bookings API?\nThe Bookings API simplifies the scheduling process for Square sellers and their customers. By integrating with Square’s broader ecosystem, it offers a robust solution for managing appointments. Key Bookings API benefits include:\n\n\n* Comprehensive calendar control for sellers, with permissions that allow flexibility in creating bookings.\n* Streamlined buyer-level operations with secure and limited access.\n* Compatibility with Square’s Appointments subscription plans, offering additional features and functionality.\n* Custom attributes to personalize the booking experience.\n* Seamless integration with other Square APIs, such as [Customers API](https://developer.squareup.com/docs/customers-api/what-it-does), [Locations API](https://developer.squareup.com/docs/locations-api), [Team API](https://developer.squareup.com/docs/team/overview), and [Catalog API](https://developer.squareup.com/docs/catalog-api/what-it-does).\n\n\nFor more information, see the following guides:\n - [Bookings API Guide](https://developer.squareup.com/docs/bookings-api/what-it-is)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)\n" + }, + "Cards": { + "name": "Cards", + "summary": "Use the Cards API to save a credit or debit card on file.", + "description": "\nYou can use the [CreateCard](/reference/square/cards-api/create-card) endpoint to save a credit or debit card to a Square account.\nDevelopers can integrate the Cards API in their application to let Square sellers:\n\n- **Save a card that can be charged by any Square seller who uses your application.** Your application specifies the organization access token in the `CreateCard` request.\n- **Save a card that can be charged by a single Square seller.** Your application specifies the access token of the specific seller account in the `CreateCard` request.\n\nThe Cards API also supports other endpoints to manage the cards.\n\nFor more information, see the following guides:\n - [Cards](https://developer.squareup.com/docs/cards-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "CashDrawers": { + "name": "Cash Drawers", + "summary": "Get details about cash drawer shifts.", + "description": "\nCash drawer shifts track cash transactions so that the total money in the cash drawers can be reconciled for a\nspecific period of time (a cash drawer shift), for a particular device, in a particular location. The Cash Drawer Shifts API\nenables you to list and retrieve information about cash drawer shifts.\n\nFor more information, see the following guide:\n - [Cash Drawer Shifts](https://developer.squareup.com/docs/cashdrawershift-api/reporting)" + }, + "Catalog": { + "name": "Catalog", + "summary": "Programmatically catalogs a Square seller’s products for sale and services for hire.", + "description": "\nThe Catalog API allows you to programmatically catalog products or services, including items, variations, categories, discounts, taxes, modifiers, and more.\n\nFor more information, see the following guides:\n - [Catalog](https://developer.squareup.com/docs/catalog-api/what-it-does)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Checkout": { + "name": "Checkout", + "summary": "Accept payments through a pre-built, Square-hosted checkout page. No frontend required.", + "description": "\nWith the Square Checkout API, your customers can pay for a purchase through a simple, Square-hosted checkout page. It can be integrated into any payments workflow with minimal coding. \n\nYou can create and configure your checkout page through a `CreatePaymentLink` request, specifying the accepted payment methods and checkout options like tipping and custom fields. You can also configure a URL for customers to be redirected to once they complete their purchase. \n\nFirst time Square developers should utilize the payment link endpoints to create, update, retrieve, and list checkout pages. \n\nFor more information, see the following guide:\n - [Checkout](https://developer.squareup.com/docs/checkout-api-overview)" + }, + "CustomerCustomAttributes": { + "name": "Customer Custom Attributes", + "summary": "Create and manage customer-related custom attribute definitions and custom attributes.", + "description": "\nUse the Customer Custom Attributes API to create and manage custom attributes for customer profiles. Custom attributes can be used to store properties or metadata that simplify integration, synchronization, and personalization workflows. After a custom attribute definition is created in a Square seller account, the custom attribute value can be set for customer profiles in the seller's Customer Directory.\n\nFor more information, see the following guides:\n - [Customer Custom Attributes](https://developer.squareup.com/docs/customer-custom-attributes-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "CustomerGroups": { + "name": "Customer Groups", + "summary": "Create and manage customer groups to streamline and automate workflows and help personalize customer interactions.", + "description": "\nThe Customer Groups API lets you create and manage customer groups to provide targeted promotions or take other customized actions based on group membership. For example, you can create Weekly, Monthly, and Quarterly customer groups and add customers to them based on their preferences to receive marketing promotions on a weekly, monthly, and quarterly basis. You can then use the information to manage your marketing email schedule. \n\nYou can use the Customer Groups API to retrieve and manage customer groups. You can use the Customers API to add customers to and remove customers from groups and search for customers based on group membership.\n\nFor more information, see the following guide:\n - [Customer Groups](https://developer.squareup.com/docs/customer-groups-api/what-it-does)" + }, + "CustomerSegments": { + "name": "Customer Segments", + "summary": "Retrieve customer segments (also called smart groups) in a business account.", + "description": "\nThe Customer Segments API lets you retrieve information about the segments defined for a business. Square sellers can create customer segments in the Seller Dashboard or Point of Sale by defining filters for the segment. For example, a segment can include customers who have visited more than 10 times. Customers are automatically added to and removed from the segment over time based on this criterion. \n\nYou can inspect the customer's `segment_ids` property to determine which segments a customer belongs to. Then, you can use the Customer Segments API to retrieve basic details about each segment, such as the segment name and the time when it was created.\n\nFor more information, see the following guide:\n - [Customer Segments](https://developer.squareup.com/docs/customer-segments-api/what-it-does)" + }, + "Customers": { + "name": "Customers", + "summary": "Create and manage customer profiles and sync CRM systems with Square.", + "description": "\nThe Customers API enables you to create and manage customer profiles, as well as search for customers based on various criteria (including customer group membership). You can also use the API to sync contacts between your CRM system and Square.\n\nFor more information, see the following guides:\n - [Customers](https://developer.squareup.com/docs/customers-api/what-it-does)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Devices": { + "name": "Devices", + "summary": "Create device codes used to connect Square Terminal with a 3rd-party point of sale system, and get details about all connected Terminals. ", + "description": "\nFor more information, see the following guides:\n - [Devices](https://developer.squareup.com/docs/terminal-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Disputes": { + "name": "Disputes", + "summary": "Use the Disputes API to manage disputes (chargebacks).", + "description": "\nA seller has the following options to process a dispute:\n\n- Accept the dispute using the [AcceptDispute](/reference/square/disputes-api/accept-dispute) endpoint. Square returns the disputed amount from the account balance of the Square account.\n- Challenge the dispute using the [SubmitEvidence](/reference/square/disputes-api/submit-evidence) endpoint. If the payment was valid, you can contest the disputed payment.\nYou submit supporting evidence you have about the transaction, such as receipts, invoices, email correspondence, proof of delivery, or photos.\nYou upload evidence using the [CreateDisputeEvidenceFile](/reference/square/disputes-api/create-dispute-evidence-file) endpoint.\n\nThe Disputes API also supports other endpoints useful in dispute management.\n\nFor more information, see the following guides:\n - [Disputes](https://developer.squareup.com/docs/disputes-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Employees": { + "name": "Employees", + "summary": "Pull employee data into accounting and payroll systems with the Employees API.", + "description": "\nThe Employees API allows applications to retrieve a roster of employees registered in the Square Point\nof Sale system, which can be useful in payroll and account contexts.\n\nPrior to 2020-08-26, the Employees API was best used in conjunction with the Labor API, where you provide employee IDs to\nmanage shifts, breaks, and wages. After that deprecation date, the Team API should be used.\n\nFor information about migrating your code to the Team API, see [Migrate from the Square Employees API](https://developer.squareup.com/docs/team/migrate-from-v2-employees?environment=master\u0026preview=true)" + }, + "Events": { + "name": "Events", + "summary": "Search for Square API events that occur within a 28-day timeframe.", + "description": "\nIf you don't need a real-time response to data changes or need a disaster recovery or reconciliation mechanism for missed webhook events (caused by server outages, misconfigured webhook subscriptions, network errors, and other events), you can use the Events API instead of webhook subscriptions managed manually or through the Webhook Subscriptions API.\n\nBecause Square events are owned by the application and not any one seller, you cannot use OAuth access tokens with the Events API. You must use the application’s [personal access token](/docs/build-basics/access-tokens).\n\nFor more information, see:\n - [Events API](https://developer.squareup.com/docs/events-api/overview) \n" + }, + "GiftCardActivities": { + "name": "Gift Card Activities", + "summary": "Create and retrieve gift card activities.", + "description": "\nUse the Gift Card Activities API to create activities for a Square gift card (such as activating or reloading the gift card) and to track gift card activities. The Gift Card Activities API is used with the [Gift Cards API](https://developer.squareup.com/reference/square/gift-cards-api) to manage the gift card program for a Square seller.\n\nFor more information, see the following guides:\n - [Gift Card Activities](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "GiftCards": { + "name": "Gift Cards", + "summary": "Create and retrieve gift cards and manage gift cards on file.", + "description": "\n[Square Gift Cards](https://squareup.com/gift-cards) enable sellers to boost sales and attract new customers. Customers can purchase gift cards and redeem them at any of the seller's locations. Sellers can manage gift cards and track activity.\n\nUse the Gift Cards API to create and retrieve gift cards (for example, to get the gift card balance) and manage gift cards on file by linking or unlinking gift cards with customers. After creating a gift card, use the [Gift Card Activities API](https://developer.squareup.com/reference/square/gift-card-activities-api) to activate the gift card with an initial balance and manage other activities.\n\nFor more information, see the following guides:\n - [Gift Cards](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Inventory": { + "name": "Inventory", + "summary": "Programmatically manages a Square seller’s inventory of catalog items.", + "description": "\nThe Inventory API allows you to programmatically manage inventory counts and inventory changes of products or services.\n\nFor more information, see the following guides:\n - [Inventory](https://developer.squareup.com/docs/inventory-api/what-it-does)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Invoices": { + "name": "Invoices", + "summary": "Create, configure, and publish invoices for orders that were created using the Orders API.", + "description": "\n[Square Invoices](https://squareup.com/invoices) makes it easy for sellers to request and collect payments from their customers. Square notifies customers and processes invoice payments.\n\nUse the Invoices API to create and manage invoices for orders that were created using the Orders API. After you create the invoice and configure its delivery method, payment schedule, and other invoice settings, you can publish the invoice. Depending on the invoice settings, Square can send the invoice to the customer or automatically charge a card on file. Square hosts each invoice on a web page where customers can pay for it.\n\nFor more information, see the following guides:\n - [Invoices](https://developer.squareup.com/docs/invoices-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Labor": { + "name": "Labor", + "summary": "Manage timecards and schedules for team members.", + "description": "\nThe Labor API allows applications to manage time tracking and shift scheduling workflows.\n\n**Time tracking** - Create and manage timecards (shifts) to track work hours, breaks, and declared cash tips for payroll processing and labor cost calculations. The Labor API provides search capabilities to retrieve timecards by location, time period, status, and team member assignments. It can also be used to access job and wage information for team members, define break types, and configure workweek start times for overtime calculations and reporting periods.\n\n**Scheduling** - Create and manage scheduled shifts with draft and published states to coordinate team member work schedules. The Labor API supports both individual and bulk publishing of scheduled shifts and provides search capabilities to retrieve scheduled shifts by location, time period, status, and team member assignments.\n\nThe Labor API integrates closely with the Team API.\n\nFor more information, see the following guides:\n - [Labor](https://developer.squareup.com/docs/labor-api/what-it-does)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)\n" + }, + "LocationCustomAttributes": { + "name": "Location Custom Attributes", + "summary": "Create and manage location-related custom attribute definitions and custom attributes.", + "description": "\nUse the Location Custom Attributes API to create and manage custom attributes for locations. Custom attributes can be used to store properties or metadata that simplify integration, synchronization, and personalization workflows. After a custom attribute definition is created in a Square seller account, the custom attribute value can be set for locations.\n\nFor more information, see the following guides:\n - [Location Custom Attributes](https://developer.squareup.com/docs/location-custom-attributes-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Locations": { + "name": "Locations", + "summary": "Create and manage the locations of a seller's business.", + "description": "\nMany sellers use multiple locations to track where they make sales. The Locations API allows you to\ncreate and manage data about those locations, such as their addresses, names, and business hours.\n\nFor more information, see the following guides:\n - [Locations](https://developer.squareup.com/docs/locations-api)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Loyalty": { + "name": "Loyalty", + "summary": "Enroll buyers in a Square loyalty program, view program settings, manage and track loyalty activity, and create and manage promotions.", + "description": "\nSellers subscribe to [Square Loyalty](https://squareup.com/software/loyalty) to offer a loyalty program that can increase repeat visits to their business by rewarding customers.\n\nUse the Loyalty API to create loyalty accounts for buyers and enable them to earn points for purchases and redeem points for reward discounts. Also use the Loyalty API to retrieve details about the loyalty program, create and manage loyalty promotions that extend the base program, and track balance-changing events for loyalty accounts.\n\nFor more information, see the following guides:\n - [Loyalty](https://developer.squareup.com/docs/loyalty-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "MerchantCustomAttributes": { + "name": "Merchant Custom Attributes", + "summary": "Create and manage merchant-related custom attribute definitions and custom attributes.", + "description": "\nUse the Merchant Custom Attributes API to create and manage custom attributes for merchants that connect to your application. Custom attributes can be used to store properties or metadata that simplify integration, synchronization, and personalization workflows.\n\nFor more information, see the following guides:\n - [Merchant Custom Attributes](https://developer.squareup.com/docs/merchant-custom-attributes-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Merchants": { + "name": "Merchants", + "summary": "Retrieve information about an organization that sells with Square.", + "description": "\nThe Merchants API groups individual seller locations into larger organizations, allowing them to operate as a single entity. Each merchant represents one organization or business that sells with Square. Use this API to retrieve core information about the organization connecting to your application such as the merchant ID, language preferences, country, account status, and the name of the overall business.\n\nFor more information, see the following guide:\n - [Merchants](https://developer.squareup.com/docs/merchants-api)" + }, + "MobileAuthorization": { + "name": "Mobile Authorization", + "summary": "Authorize Reader SDK applications to take in-person payments.", + "description": "\n**Deprecated** - Developers should update their Reader SDK integration to use the \n[Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. \n\nThe Mobile Authorization API accepts an account credential (an OAuth token or a personal access token) and a\nlocation ID and returns an authorization code that custom mobile applications can use to initialize Square mobile\nsolutions, like Reader SDK, to accept payments using Square hardware.\n\nFor more information, see the following guide:\n - [Mobile Authorization](https://developer.squareup.com/docs/mobile-authz/what-it-does)" + }, + "OAuth": { + "name": "OAuth", + "summary": "Allow your application to gain programmatic access to Square seller accounts.", + "description": "\nApplications use the OAuth API to obtain access tokens that allow them to call Square APIs on behalf of Square sellers. Applications can request scoped permissions to limit their access to only the resources they need. The OAuth flow for obtaining an OAuth access token has three stages:\n\n**Authorization** - Your application directs the seller to the Square authorization page using an authorization URL that specifies your requested permissions. The seller signs in to Square and reviews the permissions.\n\n**Callback** - After approving the permissions, Square redirects the seller back to your application's registered redirect URL with an authorization code appended as a query parameter.\n\n**Token request** - Your application calls the `ObtainToken` endpoint with the authorization code, your application ID, and other information. Square returns an access token and refresh token.\n\nFor more information, see the following guides:\n - [OAuth](https://developer.squareup.com/docs/oauth-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "OrderCustomAttributes": { + "name": "Order Custom Attributes", + "summary": "Create and manage order-related custom attribute definitions and custom attributes.", + "description": "\nUse the Order Custom Attributes API to create and manage custom attributes for orders. Custom attributes can be used to store properties or metadata that simplify integration, synchronization, and personalization workflows. After a custom attribute definition is created in a Square seller account, the custom attribute value can be set for orders.\n\nFor more information, see the following guides:\n - [Order Custom Attributes](https://developer.squareup.com/docs/orders-custom-attributes-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Orders": { + "name": "Orders", + "summary": "Get sales data for a Square seller, itemize payments, push orders to POS, and more.", + "description": "\nThe Orders API is your one-stop shop for adding rich functionality to payments. You can itemize\npayments using custom line items or catalog objects, send orders to physical Point of Sale devices\nto be fulfilled, attach a customer to a payment, and more.\n\nIn addition, the Orders API lets you search through all of a seller's past sales and returns itemization\ndata, customer references, and other details from sales made using POS or online.\n\nIf you use the Square Orders API with a non-Square payments provider, Square charges a transaction fee. For more information, see [Orders API fee structure.](https://developer.squareup.com/docs/payments-pricing#orders-api-fee-structure)\n\nFor more information, see the following guides:\n - [Orders](https://developer.squareup.com/docs/orders-api/what-it-does)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Payments": { + "name": "Payments", + "summary": "The Payments API lets developers take and manage payments.", + "description": "\nApplications need the following input to take a payment:\n\n- The amount to charge.\n- The payment recipient. The payment goes to the account identified by the Authorization header in the API request.\n- The payment source. The source can be a payment token or card on file.\n\n You can generate a payment token using the Web Payments SDK and the In-App Payments SDK. For working code examples, see [Square Connect API Examples](https://github.com/square/connect-api-examples).\n\n A card on file is a credit card, debit card, or gift card that is associated with a customer. \n You can create a customer and add a card on file using Square APIs, the Square Seller Dashboard, or the Square Point of Sale application.\n\n For more information, see the following guides:\n - [Payments](https://developer.squareup.com/docs/payments-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Payouts": { + "name": "Payouts", + "summary": "Get a list of deposits and withdrawals from a seller's bank accounts.", + "description": "\nThe Payouts API allows you to see a complete list of payouts made to a seller's banking destination,\nwith a list of payout entries that describe the payments associated with each payout. It can be paired with the\nBank Accounts API to add detail about which bank account each payout was made to.\n\nFor more information, see the following guide:\n - [Payouts](https://developer.squareup.com/docs/payouts/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Refunds": { + "name": "Refunds", + "summary": "Manage and issue refunds for payments made to Square sellers.", + "description": "\nThe following applies to refunds:\n\n- You cannot refund more than what was originally collected.\n- The refund amount must be available in the account's Square balance. If the amount is not available, Square attempts to take money out of\n the associated bank account. Refunds are in a state of PENDING until the funds are secured.\n- If funds cannot be secured, the refund is not completed and the buyer does not receive a credit. The refund has \n a status of FAILED. Future refunds to this payment are not allowed and the buyer should be reimbursed by other means.\n- You can refund only payments with status COMPLETED. You cannot refund an APPROVED payment; however, you can cancel\n an approved payment.\n\nFor more information, see the following guides:\n - [Refunds](https://developer.squareup.com/docs/payments-api/refund-payments)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Reporting": { + "name": "Reporting", + "summary": "Deprecated - Use the Orders and Payments APIs instead.", + "description": "\nPrior to 2019/08/15, the Reporting API was the way to review multi-party payments taken with the Transactions\nAPI. The Payments API now includes an \"application fee\" parameter you can use to replace this functionality." + }, + "Sites": { + "name": "Sites", + "summary": "Get details about Square Online sites that belong to Square sellers.", + "description": "\nSquare sellers use Square Online to build eCommerce websites. The Sites API lets you get basic details about Square Online sites, such as the site ID, title, and domain. You can use the Sites API with the Snippets API to manage snippets that extend Square Online features.\n\n __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).\n\n For more information, see the following guide:\n - [Sites](https://developer.squareup.com/docs/sites-api/overview)" + }, + "Snippets": { + "name": "Snippets", + "summary": "Manage snippets for Square Online sites.", + "description": "\nThe Snippets API lets you manage snippets that add custom functionality to Square Online sites. A snippet is HTML, CSS, and JavaScript that is injected into the `head` element of all pages on a site, except for checkout pages. You can use the Snippets API to create applications that help meet the many needs of Square sellers.\n\n __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).\n\n For more information, see the following guide:\n - [Snippets](https://developer.squareup.com/docs/snippets-api/overview)" + }, + "Subscriptions": { + "name": "Subscriptions", + "summary": "Create and manage subscriptions.", + "description": "\nSubscriptions enable sellers to generate a reliable cash flow and recurring revenue to grow their businesses. Square offers the Subscriptions API for developers to embed subscription functionality in their applications. You first create a subscription plan using the Catalog API and then use the Subscriptions API to create and manage subscriptions. \n\nFor more information, see the following guides:\n - [Subscriptions](https://developer.squareup.com/docs/subscriptions/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Team": { + "name": "Team", + "summary": "Manage a roster of team members and pull employee data into accounting and payroll systems.", + "description": "\nThe Team API allows applications to manage team members and job definitions for Square sellers. \nThis includes creating and managing team member profiles, wage settings, and job data. The Team API \nsupports synchronization of team member data with accounting and payroll systems, which is useful \nfor applications that handle payroll, scheduling, and other team member-related activities. \nNote that some operations, such as setting permissions and passcodes, still need to be done directly \nthrough the Square Dashboard.\n\nThe Team API integrates closely with the Labor API.\n\nFor more information, see the following guide:\n - [Team](https://developer.squareup.com/docs/team/overview)\n - [Square Webhooks](https://developer.squareup.com/docs/webhooks-overview)\n" + }, + "Terminal": { + "name": "Terminal", + "summary": "Requests a checkout from a paired Square Terminal.", + "description": "\nThe Terminal API allows you to manage sending and receiving requests and responses from a paired Square Terminal. For a Terminal checkout, refund, or action, you can create a request, check its status, cancel the request, search for in-process requests, and get the results of the request after it is completed. In the current implementation, refunds are only supported for Interac debit cards in Canada.\n\nFor more information, see the following guides:\n - [Terminal](https://developer.squareup.com/docs/terminal-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Transactions": { + "name": "Transactions", + "summary": "Deprecated - Use the Orders and Payments APIs instead.", + "description": "\nPrior to 2019/08/15, the Transactions API was the way to take online payments. Going forward, the Payments API \nand Refunds API (together with the Orders API) replace the Transactions API. For information about migrating your code to the Payments API, see [Migrate from Transactions](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api)" + }, + "V1Webhooks": { + "name": "V1Webhooks", + "summary": "Deprecated - Use V2 Webhooks.", + "description": "\nIf you are working with V1 (deprecated) webhooks, you use the Webhooks API to subscribe to events for each seller you are interested in receiving events for.\n\nIf you are working with V2 webhooks, you do not need to use this API.\nInstead, you subscribe to events using the [Developer Dashboard](/apps) or the [Webhook Subscriptions API](/reference/square/webhook-subscriptions-api).\nLearn how to subscribe to V2 webhooks using the [dashboard](/docs/webhooks/step2subscribe) or the [API](/docs/webhooks/webhook-subscriptions-api)." + }, + "Vendors": { + "name": "Vendors", + "summary": "Manages a seller's suppliers.", + "description": "The Vendors API allows applications to create, retrieve, and update vendors as suppliers to a seller.\n\nFor more information, see the following guides:\n - [Vendors](https://developer.squareup.com/docs/vendors-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "WebhookSubscriptions": { + "name": "Webhook Subscriptions", + "summary": "Create and manage webhook subscriptions.", + "description": "\nThe Webhook Subscriptions API allows you to create, retrieve, update, and delete webhook subscriptions. Because Webhook subscriptions are owned by the application and not any one seller, you cannot use OAuth Access Tokens with the Webhook Subscriptions API. You must use the application’s [personal access token](/docs/build-basics/access-tokens).\n\nFor more information, see the following guide the following guide:\n - [Webhook Subscriptions](https://developer.squareup.com/docs/webhooks/webhook-subscriptions-api)" + } + }, + "x-categories": { + "Commerce": { + "name": "Commerce", + "summary": "Process orders, manage catalogs, track inventory, book reservations, and manage vendors. ", + "description": "", + "apis": [ + "#/components/x-apis/Orders", + "#/components/x-apis/OrderCustomAttributes", + "#/components/x-apis/Catalog", + "#/components/x-apis/Inventory", + "#/components/x-apis/Bookings", + "#/components/x-apis/Booking Custom Attributes", + "#/components/x-apis/Vendors", + "#/components/x-apis/Sites", + "#/components/x-apis/Snippets", + "#/components/x-apis/Cash Drawers" + ] + }, + "Customers": { + "name": "Customers", + "summary": "Securely manage customer data and integrate engagement features to increase repeat business and attract new customers.", + "description": "\n", + "apis": [ + "#/components/x-apis/Customers", + "#/components/x-apis/CustomerCustomAttributes", + "#/components/x-apis/CustomerGroups", + "#/components/x-apis/CustomerSegments", + "#/components/x-apis/Loyalty", + "#/components/x-apis/GiftCards", + "#/components/x-apis/GiftCardActivities" + ] + }, + "Dev Essentials": { + "name": "Dev Essentials", + "summary": "Authenticate your app, provide secure delegated access to Square account data, and manage webhook subscriptions.", + "description": "", + "apis": [ + "#/components/x-apis/OAuth", + "#/components/x-apis/WebhookSubscriptions", + "#/components/x-apis/Events" + ] + }, + "Merchants": { + "name": "Merchants", + "summary": "Manage a seller's core business information used for business, and suppliers.", + "description": "", + "apis": [ + "#/components/x-apis/Merchants", + "#/components/x-apis/MerchantCustomAttributes", + "#/components/x-apis/Locations", + "#/components/x-apis/LocationCustomAttributes" + ] + }, + "Payments": { + "name": "Payments", + "summary": "Take payments, process refunds, manage disputes, enable subscriptions, and get paid for your sales.", + "description": "\n", + "apis": [ + "#/components/x-apis/Payments", + "#/components/x-apis/Refunds", + "#/components/x-apis/Checkout", + "#/components/x-apis/Terminal", + "#/components/x-apis/Disputes", + "#/components/x-apis/Invoices", + "#/components/x-apis/Cards", + "#/components/x-apis/Subscriptions", + "#/components/x-apis/BankAccounts", + "#/components/x-apis/Payouts", + "#/components/x-apis/MobileAuthorization", + "#/components/x-apis/Devices", + "#/components/x-apis/ApplePay" + ] + }, + "Staff": { + "name": "Staff", + "summary": "Manage team members and jobs, track hours worked, and manage team schedules.", + "description": "", + "apis": [ + "#/components/x-apis/Labor", + "#/components/x-apis/Team" + ] + } + }, + "x-categories-order": [ + "Dev Essentials", + "Payments", + "Commerce", + "Customers", + "Staff", + "Merchants" + ], + "x-v1-api-mappings": { + "V1Employees": { + "V1CreateEmployee": "Employees", + "V1CreateEmployeeRole": "Employees", + "V1CreateTimecard": "Labor", + "V1DeleteTimecard": "Labor", + "V1ListCashDrawerShifts": "CashDrawers", + "V1ListEmployeeRoles": "Employees", + "V1ListEmployees": "Employees", + "V1ListTimecardEvents": "Labor", + "V1ListTimecards": "Labor", + "V1RetrieveCashDrawerShift": "CashDrawers", + "V1RetrieveEmployee": "Employees", + "V1RetrieveEmployeeRole": "Employees", + "V1RetrieveTimecard": "Labor", + "V1UpdateEmployee": "Employees", + "V1UpdateEmployeeRole": "Employees", + "V1UpdateTimecard": "Labor" + }, + "V1Items": { + "V1AdjustInventory": "Inventory", + "V1ApplyFee": "Catalog", + "V1ApplyModifierList": "Catalog", + "V1CreateCategory": "Catalog", + "V1CreateDiscount": "Catalog", + "V1CreateFee": "Catalog", + "V1CreateItem": "Catalog", + "V1CreateModifierList": "Catalog", + "V1CreateModifierOption": "Catalog", + "V1CreatePage": "Catalog", + "V1CreateVariation": "Catalog", + "V1DeleteCategory": "Catalog", + "V1DeleteDiscount": "Catalog", + "V1DeleteFee": "Catalog", + "V1DeleteItem": "Catalog", + "V1DeleteModifierList": "Catalog", + "V1DeleteModifierOption": "Catalog", + "V1DeletePage": "Catalog", + "V1DeletePageCell": "Catalog", + "V1DeleteVariation": "Catalog", + "V1ListCategories": "Catalog", + "V1ListDiscounts": "Catalog", + "V1ListFees": "Catalog", + "V1ListInventory": "Inventory", + "V1ListItems": "Catalog", + "V1ListModifierLists": "Catalog", + "V1ListPages": "Catalog", + "V1RemoveFee": "Catalog", + "V1RemoveModifierList": "Catalog", + "V1RetrieveItem": "Catalog", + "V1RetrieveModifierList": "Catalog", + "V1UpdateCategory": "Catalog", + "V1UpdateDiscount": "Catalog", + "V1UpdateFee": "Catalog", + "V1UpdateItem": "Catalog", + "V1UpdateModifierList": "Catalog", + "V1UpdateModifierOption": "Catalog", + "V1UpdatePage": "Catalog", + "V1UpdatePageCell": "Catalog", + "V1UpdateVariation": "Catalog", + "V1UploadItemImage": "Catalog" + }, + "V1Locations": { + "V1ListLocations": "Locations", + "V1RetrieveBusiness": "Merchants" + }, + "V1Transactions": { + "V1CreateRefund": "Refunds", + "V1ListBankAccounts": "BankAccounts", + "V1ListPayments": "Payments", + "V1ListRefunds": "Refunds", + "V1ListSettlements": "Payouts", + "V1RetrieveBankAccount": "BankAccounts", + "V1RetrievePayment": "Payments", + "V1RetrieveSettlement": "Payouts" + }, + "V1Webhooks": { + "V1ListWebhooks": "V1Webhooks", + "V1UpdateWebhooks": "V1Webhooks" + } + } + }, + "paths": { + "/mobile/authorization-code": { + "post": { + "tags": [ + "MobileAuthorization" + ], + "summary": "CreateMobileAuthorizationCode", + "operationId": "CreateMobileAuthorizationCode", + "description": "__Note:__ This endpoint is used by the deprecated Reader SDK. \nDevelopers should update their integration to use the [Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. \n\nGenerates code to authorize a mobile application to connect to a Square card reader.\n\nAuthorization codes are one-time-use codes and expire 60 minutes after being issued.\n\nThe `Authorization` header you provide to this endpoint must have the following format:\n\n```\nAuthorization: Bearer ACCESS_TOKEN\n```\n\nReplace `ACCESS_TOKEN` with a\n[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens).", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": {}, + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE_IN_PERSON" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMobileAuthorizationCodeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMobileAuthorizationCodeResponse" + } + } + } + } + } + } + }, + "/oauth2/revoke": { + "post": { + "tags": [ + "OAuth" + ], + "summary": "RevokeToken", + "operationId": "RevokeToken", + "description": "Revokes an access token generated with the OAuth flow.\n\nIf an account has more than one OAuth access token for your application, this\nendpoint revokes all of them, regardless of which token you specify. \n\n__Important:__ The `Authorization` header for this endpoint must have the\nfollowing format:\n\n```\nAuthorization: Client APPLICATION_SECRET\n```\n\nReplace `APPLICATION_SECRET` with the application secret on the **OAuth**\npage for your application in the Developer Dashboard.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": null + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RevokeTokenRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RevokeTokenResponse" + } + } + } + } + } + } + }, + "/oauth2/token": { + "post": { + "tags": [ + "OAuth" + ], + "summary": "ObtainToken", + "operationId": "ObtainToken", + "description": "Returns an OAuth access token and refresh token using the `authorization_code`\nor `refresh_token` grant type.\n\nWhen `grant_type` is `authorization_code`:\n- With the [code flow](https://developer.squareup.com/docs/oauth-api/overview#code-flow),\nprovide `code`, `client_id`, and `client_secret`.\n- With the [PKCE flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow),\nprovide `code`, `client_id`, and `code_verifier`. \n\nWhen `grant_type` is `refresh_token`:\n- With the code flow, provide `refresh_token`, `client_id`, and `client_secret`.\nThe response returns the same refresh token provided in the request.\n- With the PKCE flow, provide `refresh_token` and `client_id`. The response returns\na new refresh token.\n\nYou can use the `scopes` parameter to limit the set of permissions authorized by the\naccess token. You can use the `short_lived` parameter to create an access token that\nexpires in 24 hours.\n\n__Important:__ OAuth tokens should be encrypted and stored on a secure server.\nApplication clients should never interact directly with OAuth tokens.", + "x-release-status": "PUBLIC", + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ObtainTokenRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ObtainTokenResponse" + } + } + } + } + } + } + }, + "/oauth2/token/status": { + "post": { + "tags": [ + "OAuth" + ], + "summary": "RetrieveTokenStatus", + "operationId": "RetrieveTokenStatus", + "description": "Returns information about an [OAuth access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-an-oauth-access-token) or an application’s [personal access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-a-personal-access-token).\n\nAdd the access token to the Authorization header of the request.\n\n__Important:__ The `Authorization` header you provide to this endpoint must have the following format:\n\n```\nAuthorization: Bearer ACCESS_TOKEN\n```\n\nwhere `ACCESS_TOKEN` is a\n[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens).\n\nIf the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTokenStatusResponse" + } + } + } + } + } + } + }, + "/v1/{location_id}/orders": { + "get": { + "tags": [ + "V1Transactions" + ], + "summary": "V1ListOrders", + "operationId": "V1ListOrders", + "description": "Provides summary information for a merchant's online store orders.", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "deprecated": true, + "x-deprecation": {}, + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to list online store orders for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "order", + "description": "The order in which payments are listed in the response.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of payments to return in a single response. This value cannot exceed 200.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "batch_token", + "description": "A pagination cursor to retrieve the next set of results for your\noriginal query to the endpoint.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V1Order" + } + } + } + } + } + } + } + }, + "/v1/{location_id}/orders/{order_id}": { + "get": { + "tags": [ + "V1Transactions" + ], + "summary": "V1RetrieveOrder", + "operationId": "V1RetrieveOrder", + "description": "Provides comprehensive information for a single online store order, including the order's history.", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "deprecated": true, + "x-deprecation": {}, + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the order's associated location.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "order_id", + "description": "The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V1Order" + } + } + } + } + } + }, + "put": { + "tags": [ + "V1Transactions" + ], + "summary": "V1UpdateOrder", + "operationId": "V1UpdateOrder", + "description": "Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions:", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "deprecated": true, + "x-deprecation": {}, + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the order's associated location.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "order_id", + "description": "The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V1UpdateOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V1Order" + } + } + } + } + } + } + }, + "/v2/apple-pay/domains": { + "post": { + "tags": [ + "ApplePay" + ], + "summary": "RegisterDomain", + "operationId": "RegisterDomain", + "description": "Activates a domain for use with Apple Pay on the Web and Square. A validation\nis performed on this domain by Apple to ensure that it is properly set up as\nan Apple Pay enabled domain.\n\nThis endpoint provides an easy way for platform developers to bulk activate\nApple Pay on the Web with Square for merchants using their platform.\n\nNote: You will need to host a valid domain verification file on your domain to support Apple Pay. The\ncurrent version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association,\nand should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your\ndomain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding\nlong-lived caches that might not keep in sync with the correct file version.\n\nTo learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterDomainRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterDomainResponse" + } + } + } + } + } + } + }, + "/v2/bank-accounts": { + "get": { + "tags": [ + "BankAccounts" + ], + "summary": "ListBankAccounts", + "operationId": "ListBankAccounts", + "description": "Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "BANK_ACCOUNTS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "The pagination cursor returned by a previous call to this endpoint.\nUse it in the next `ListBankAccounts` request to retrieve the next set \nof results.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "Upper limit on the number of bank accounts to return in the response. \nCurrently, 1000 is the largest supported limit. You can specify a limit \nof up to 1000 bank accounts. This is also the default limit.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "Location ID. You can specify this optional filter \nto retrieve only the linked bank accounts belonging to a specific location.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBankAccountsResponse" + } + } + } + } + } + } + }, + "/v2/bank-accounts/by-v1-id/{v1_bank_account_id}": { + "get": { + "tags": [ + "BankAccounts" + ], + "summary": "GetBankAccountByV1Id", + "operationId": "GetBankAccountByV1Id", + "description": "Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank account ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "BANK_ACCOUNTS_READ" + ] + } + ], + "parameters": [ + { + "name": "v1_bank_account_id", + "description": "Connect V1 ID of the desired `BankAccount`. For more information, see \n[Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBankAccountByV1IdResponse" + } + } + } + } + } + } + }, + "/v2/bank-accounts/{bank_account_id}": { + "get": { + "tags": [ + "BankAccounts" + ], + "summary": "GetBankAccount", + "operationId": "GetBankAccount", + "description": "Returns details of a [BankAccount](entity:BankAccount)\nlinked to a Square account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "BANK_ACCOUNTS_READ" + ] + } + ], + "parameters": [ + { + "name": "bank_account_id", + "description": "Square-issued ID of the desired `BankAccount`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBankAccountResponse" + } + } + } + } + } + } + }, + "/v2/bookings": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "ListBookings", + "operationId": "ListBookings", + "description": "Retrieve a collection of bookings.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "limit", + "description": "The maximum number of results per page to return in a paged response.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "customer_id", + "description": "The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "team_member_id", + "description": "The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "start_at_min", + "description": "The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "start_at_max", + "description": "The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBookingsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Bookings" + ], + "summary": "CreateBooking", + "operationId": "CreateBooking", + "description": "Creates a booking.\n\nThe required input must include the following:\n- `Booking.location_id`\n- `Booking.start_at`\n- `Booking.AppointmentSegment.team_member_id`\n- `Booking.AppointmentSegment.service_variation_id`\n- `Booking.AppointmentSegment.service_variation_version`\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBookingRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBookingResponse" + } + } + } + } + } + } + }, + "/v2/bookings/availability/search": { + "post": { + "tags": [ + "Bookings" + ], + "summary": "SearchAvailability", + "operationId": "SearchAvailability", + "description": "Searches for availabilities for booking.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchAvailabilityRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchAvailabilityResponse" + } + } + } + } + } + } + }, + "/v2/bookings/bulk-retrieve": { + "post": { + "tags": [ + "Bookings" + ], + "summary": "BulkRetrieveBookings", + "operationId": "BulkRetrieveBookings", + "description": "Bulk-Retrieves a list of bookings by booking IDs.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveBookingsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveBookingsResponse" + } + } + } + } + } + } + }, + "/v2/bookings/business-booking-profile": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "RetrieveBusinessBookingProfile", + "operationId": "RetrieveBusinessBookingProfile", + "description": "Retrieves a seller's booking profile.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveBusinessBookingProfileResponse" + } + } + } + } + } + } + }, + "/v2/bookings/custom-attribute-definitions": { + "get": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "ListBookingCustomAttributeDefinitions", + "operationId": "ListBookingCustomAttributeDefinitions", + "description": "Get all bookings custom attribute definitions.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBookingCustomAttributeDefinitionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "CreateBookingCustomAttributeDefinition", + "operationId": "CreateBookingCustomAttributeDefinition", + "description": "Creates a bookings custom attribute definition.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBookingCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBookingCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/bookings/custom-attribute-definitions/{key}": { + "delete": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "DeleteBookingCustomAttributeDefinition", + "operationId": "DeleteBookingCustomAttributeDefinition", + "description": "Deletes a bookings custom attribute definition.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteBookingCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "RetrieveBookingCustomAttributeDefinition", + "operationId": "RetrieveBookingCustomAttributeDefinition", + "description": "Retrieves a bookings custom attribute definition.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to retrieve. If the requesting application\nis not the definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The current version of the custom attribute definition, which is used for strongly consistent\nreads to guarantee that you receive the most up-to-date data. When included in the request,\nSquare returns the specified version or a higher version if one exists. If the specified version\nis higher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveBookingCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "UpdateBookingCustomAttributeDefinition", + "operationId": "UpdateBookingCustomAttributeDefinition", + "description": "Updates a bookings custom attribute definition.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBookingCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBookingCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/bookings/custom-attributes/bulk-delete": { + "post": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "BulkDeleteBookingCustomAttributes", + "operationId": "BulkDeleteBookingCustomAttributes", + "description": "Bulk deletes bookings custom attributes.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteBookingCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteBookingCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/custom-attributes/bulk-upsert": { + "post": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "BulkUpsertBookingCustomAttributes", + "operationId": "BulkUpsertBookingCustomAttributes", + "description": "Bulk upserts bookings custom attributes.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertBookingCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertBookingCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/location-booking-profiles": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "ListLocationBookingProfiles", + "operationId": "ListLocationBookingProfiles", + "description": "Lists location booking profiles of a seller.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "limit", + "description": "The maximum number of results to return in a paged response.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLocationBookingProfilesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/location-booking-profiles/{location_id}": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "RetrieveLocationBookingProfile", + "operationId": "RetrieveLocationBookingProfile", + "description": "Retrieves a seller's location booking profile.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to retrieve the booking profile.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLocationBookingProfileResponse" + } + } + } + } + } + } + }, + "/v2/bookings/team-member-booking-profiles": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "ListTeamMemberBookingProfiles", + "operationId": "ListTeamMemberBookingProfiles", + "description": "Lists booking profiles for team members.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "bookable_only", + "description": "Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`).", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a paged response.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "Indicates whether to include only team members enabled at the given location in the returned result.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTeamMemberBookingProfilesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/team-member-booking-profiles/bulk-retrieve": { + "post": { + "tags": [ + "Bookings" + ], + "summary": "BulkRetrieveTeamMemberBookingProfiles", + "operationId": "BulkRetrieveTeamMemberBookingProfiles", + "description": "Retrieves one or more team members' booking profiles.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveTeamMemberBookingProfilesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveTeamMemberBookingProfilesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/team-member-booking-profiles/{team_member_id}": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "RetrieveTeamMemberBookingProfile", + "operationId": "RetrieveTeamMemberBookingProfile", + "description": "Retrieves a team member's booking profile.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "The ID of the team member to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTeamMemberBookingProfileResponse" + } + } + } + } + } + } + }, + "/v2/bookings/{booking_id}": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "RetrieveBooking", + "operationId": "RetrieveBooking", + "description": "Retrieves a booking.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the [Booking](entity:Booking) object representing the to-be-retrieved booking.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveBookingResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Bookings" + ], + "summary": "UpdateBooking", + "operationId": "UpdateBooking", + "description": "Updates a booking.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the [Booking](entity:Booking) object representing the to-be-updated booking.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBookingRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBookingResponse" + } + } + } + } + } + } + }, + "/v2/bookings/{booking_id}/cancel": { + "post": { + "tags": [ + "Bookings" + ], + "summary": "CancelBooking", + "operationId": "CancelBooking", + "description": "Cancels an existing booking.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the [Booking](entity:Booking) object representing the to-be-cancelled booking.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelBookingRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelBookingResponse" + } + } + } + } + } + } + }, + "/v2/bookings/{booking_id}/custom-attributes": { + "get": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "ListBookingCustomAttributes", + "operationId": "ListBookingCustomAttributes", + "description": "Lists a booking's custom attributes.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the target [booking](entity:Booking).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request. For more\ninformation, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "with_definitions", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBookingCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/{booking_id}/custom-attributes/{key}": { + "delete": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "DeleteBookingCustomAttribute", + "operationId": "DeleteBookingCustomAttribute", + "description": "Deletes a bookings custom attribute.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the target [booking](entity:Booking).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to delete. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteBookingCustomAttributeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "RetrieveBookingCustomAttribute", + "operationId": "RetrieveBookingCustomAttribute", + "description": "Retrieves a bookings custom attribute.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the target [booking](entity:Booking).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to retrieve. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "with_definition", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of\nthe custom attribute. Set this parameter to `true` to get the name and description of the custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "version", + "description": "The current version of the custom attribute, which is used for strongly consistent reads to\nguarantee that you receive the most up-to-date data. When included in the request, Square\nreturns the specified version or a higher version if one exists. If the specified version is\nhigher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveBookingCustomAttributeResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "UpsertBookingCustomAttribute", + "operationId": "UpsertBookingCustomAttribute", + "description": "Upserts a bookings custom attribute.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the target [booking](entity:Booking).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to create or update. This key must match the `key` of a\ncustom attribute definition in the Square seller account. If the requesting application is not\nthe definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertBookingCustomAttributeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertBookingCustomAttributeResponse" + } + } + } + } + } + } + }, + "/v2/cards": { + "get": { + "tags": [ + "Cards" + ], + "summary": "ListCards", + "operationId": "ListCards", + "description": "Retrieves a list of cards owned by the account making the request.\nA max of 25 cards will be returned.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for your original query.\n\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "customer_id", + "description": "Limit results to cards associated with the customer supplied.\nBy default, all cards owned by the merchant are returned.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "include_disabled", + "description": "Includes disabled cards.\nBy default, all enabled cards owned by the merchant are returned.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "reference_id", + "description": "Limit results to cards associated with the reference_id supplied.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "Sorts the returned list by when the card was created with the specified order.\nThis field defaults to ASC.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCardsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Cards" + ], + "summary": "CreateCard", + "operationId": "CreateCard", + "description": "Adds a card on file to an existing merchant.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_DECLINED_VERIFICATION_REQUIRED" + }, + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + }, + { + "error-code": "SOURCE_EXPIRED" + }, + { + "error-code": "SOURCE_USED" + }, + { + "error-code": "INVALID_CARD_DATA" + } + ] + } + }, + "/v2/cards/{card_id}": { + "get": { + "tags": [ + "Cards" + ], + "summary": "RetrieveCard", + "operationId": "RetrieveCard", + "description": "Retrieves details for a specific Card.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "card_id", + "description": "Unique ID for the desired Card.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/cards/{card_id}/disable": { + "post": { + "tags": [ + "Cards" + ], + "summary": "DisableCard", + "operationId": "DisableCard", + "description": "Disables the card, preventing any further updates or charges.\nDisabling an already disabled card is allowed but has no effect.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "card_id", + "description": "Unique ID for the desired Card.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DisableCardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/cash-drawers/shifts": { + "get": { + "tags": [ + "CashDrawers" + ], + "summary": "ListCashDrawerShifts", + "operationId": "ListCashDrawerShifts", + "description": "Provides the details for all of the cash drawer shifts for a location\nin a date range.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CASH_DRAWER_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to query for a list of cash drawer shifts.", + "schema": { + "type": "string" + }, + "in": "query", + "required": true + }, + { + "name": "sort_order", + "description": "The order in which cash drawer shifts are listed in the response,\nbased on their opened_at field. Default value: ASC", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "begin_time", + "description": "The inclusive start time of the query on opened_at, in ISO 8601 format.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "The exclusive end date of the query on opened_at, in ISO 8601 format.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "Number of cash drawer shift events in a page of results (200 by\ndefault, 1000 max).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "Opaque cursor for fetching the next page of results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCashDrawerShiftsResponse" + } + } + } + } + } + } + }, + "/v2/cash-drawers/shifts/{shift_id}": { + "get": { + "tags": [ + "CashDrawers" + ], + "summary": "RetrieveCashDrawerShift", + "operationId": "RetrieveCashDrawerShift", + "description": "Provides the summary details for a single cash drawer shift. See\n[ListCashDrawerShiftEvents](api-endpoint:CashDrawers-ListCashDrawerShiftEvents) for a list of cash drawer shift events.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CASH_DRAWER_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to retrieve cash drawer shifts from.", + "schema": { + "type": "string" + }, + "in": "query", + "required": true + }, + { + "name": "shift_id", + "description": "The shift ID.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCashDrawerShiftResponse" + } + } + } + } + } + } + }, + "/v2/cash-drawers/shifts/{shift_id}/events": { + "get": { + "tags": [ + "CashDrawers" + ], + "summary": "ListCashDrawerShiftEvents", + "operationId": "ListCashDrawerShiftEvents", + "description": "Provides a paginated list of events for a single cash drawer shift.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CASH_DRAWER_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to list cash drawer shifts for.", + "schema": { + "type": "string" + }, + "in": "query", + "required": true + }, + { + "name": "shift_id", + "description": "The shift ID.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "limit", + "description": "Number of resources to be returned in a page of results (200 by\ndefault, 1000 max).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "Opaque cursor for fetching the next page of results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCashDrawerShiftEventsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/batch-delete": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "BatchDeleteCatalogObjects", + "operationId": "BatchDeleteCatalogObjects", + "description": "Deletes a set of [CatalogItem](entity:CatalogItem)s based on the\nprovided list of target IDs and returns a set of successfully deleted IDs in\nthe response. Deletion is a cascading event such that all children of the\ntargeted object are also deleted. For example, deleting a CatalogItem will\nalso delete all of its [CatalogItemVariation](entity:CatalogItemVariation)\nchildren.\n\n`BatchDeleteCatalogObjects` succeeds even if only a portion of the targeted\nIDs can be deleted. The response will only include IDs that were\nactually deleted.\n\nTo ensure consistency, only one delete request is processed at a time per seller account.\nWhile one (batch or non-batch) delete request is being processed, other (batched and non-batched)\ndelete requests are rejected with the `429` error code.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchDeleteCatalogObjectsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchDeleteCatalogObjectsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/batch-retrieve": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "BatchRetrieveCatalogObjects", + "operationId": "BatchRetrieveCatalogObjects", + "description": "Returns a set of objects based on the provided ID.\nEach [CatalogItem](entity:CatalogItem) returned in the set includes all of its\nchild information including: all of its\n[CatalogItemVariation](entity:CatalogItemVariation) objects, references to\nits [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of\nany [CatalogTax](entity:CatalogTax) objects that apply to it.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveCatalogObjectsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveCatalogObjectsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/batch-upsert": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "BatchUpsertCatalogObjects", + "operationId": "BatchUpsertCatalogObjects", + "description": "Creates or updates up to 10,000 target objects based on the provided\nlist of objects. The target objects are grouped into batches and each batch is\ninserted/updated in an all-or-nothing manner. If an object within a batch is\nmalformed in some way, or violates a database constraint, the entire batch\ncontaining that item will be disregarded. However, other batches in the same\nrequest may still succeed. Each batch may contain up to 1,000 objects, and\nbatches will be processed in order as long as the total object count for the\nrequest (items, variations, modifier lists, discounts, and taxes) is no more\nthan 10,000.\n\nTo ensure consistency, only one update request is processed at a time per seller account.\nWhile one (batch or non-batch) update request is being processed, other (batched and non-batched)\nupdate requests are rejected with the `429` error code.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchUpsertCatalogObjectsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchUpsertCatalogObjectsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "GENERIC_DECLINE" + } + ] + } + }, + "/v2/catalog/images": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "CreateCatalogImage", + "operationId": "CreateCatalogImage", + "description": "Uploads an image file to be represented by a [CatalogImage](entity:CatalogImage) object that can be linked to an existing\n[CatalogObject](entity:CatalogObject) instance. The resulting `CatalogImage` is unattached to any `CatalogObject` if the `object_id`\nis not specified.\n\nThis `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in\nJPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "request": { + "$ref": "#/components/schemas/CreateCatalogImageRequest" + }, + "image_file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "image_file": { + "contentType": "image/jpeg" + }, + "request": { + "contentType": "application/json; charset=utf-8" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCatalogImageResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "GENERIC_DECLINE" + } + ] + } + }, + "/v2/catalog/images/{image_id}": { + "put": { + "tags": [ + "Catalog" + ], + "summary": "UpdateCatalogImage", + "operationId": "UpdateCatalogImage", + "description": "Uploads a new image file to replace the existing one in the specified [CatalogImage](entity:CatalogImage) object.\n\nThis `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in\nJPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "image_id", + "description": "The ID of the `CatalogImage` object to update the encapsulated image file.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "request": { + "$ref": "#/components/schemas/UpdateCatalogImageRequest" + }, + "image_file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "image_file": { + "contentType": "image/jpeg" + }, + "request": { + "contentType": "application/json; charset=utf-8" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCatalogImageResponse" + } + } + } + } + } + } + }, + "/v2/catalog/info": { + "get": { + "tags": [ + "Catalog" + ], + "summary": "CatalogInfo", + "operationId": "CatalogInfo", + "description": "Retrieves information about the Square Catalog API, such as batch size\nlimits that can be used by the `BatchUpsertCatalogObjects` endpoint.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatalogInfoResponse" + } + } + } + } + } + } + }, + "/v2/catalog/list": { + "get": { + "tags": [ + "Catalog" + ], + "summary": "ListCatalog", + "operationId": "ListCatalog", + "description": "Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog.\n\nThe `types` parameter is specified as a comma-separated list of the [CatalogObjectType](entity:CatalogObjectType) values,\nfor example, \"`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`\".\n\n__Important:__ ListCatalog does not return deleted catalog items. To retrieve\ndeleted catalog items, use [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects)\nand set the `include_deleted_objects` attribute value to `true`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "The pagination cursor returned in the previous response. Leave unset for an initial request.\nThe page size is currently set to be 100.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "types", + "description": "An optional case-insensitive, comma-separated list of object types to retrieve.\n\nThe valid values are defined in the [CatalogObjectType](entity:CatalogObjectType) enum, for example,\n`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,\n`MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc.\n\nIf this is unspecified, the operation returns objects of all the top level types at the version\nof the Square API used to make the request. Object types that are nested onto other object types\nare not included in the defaults.\n\nAt the current API version the default object types are:\nITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, \nPRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,\nSUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "catalog_version", + "description": "The specific version of the catalog objects to be included in the response.\nThis allows you to retrieve historical versions of objects. The specified version value is matched against\nthe [CatalogObject](entity:CatalogObject)s' `version` attribute. If not included, results will be from the\ncurrent version of the catalog.", + "schema": { + "type": "integer", + "format": "int64" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCatalogResponse" + } + } + } + } + } + } + }, + "/v2/catalog/object": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "UpsertCatalogObject", + "operationId": "UpsertCatalogObject", + "description": "Creates a new or updates the specified [CatalogObject](entity:CatalogObject).\n\nTo ensure consistency, only one update request is processed at a time per seller account.\nWhile one (batch or non-batch) update request is being processed, other (batched and non-batched)\nupdate requests are rejected with the `429` error code.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertCatalogObjectRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertCatalogObjectResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "GENERIC_DECLINE" + }, + { + "error-code": "INVALID_LOCATION" + } + ] + } + }, + "/v2/catalog/object/{object_id}": { + "delete": { + "tags": [ + "Catalog" + ], + "summary": "DeleteCatalogObject", + "operationId": "DeleteCatalogObject", + "description": "Deletes a single [CatalogObject](entity:CatalogObject) based on the\nprovided ID and returns the set of successfully deleted IDs in the response.\nDeletion is a cascading event such that all children of the targeted object\nare also deleted. For example, deleting a [CatalogItem](entity:CatalogItem)\nwill also delete all of its\n[CatalogItemVariation](entity:CatalogItemVariation) children.\n\nTo ensure consistency, only one delete request is processed at a time per seller account.\nWhile one (batch or non-batch) delete request is being processed, other (batched and non-batched)\ndelete requests are rejected with the `429` error code.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "object_id", + "description": "The ID of the catalog object to be deleted. When an object is deleted, other\nobjects in the graph that depend on that object will be deleted as well (for example, deleting a\ncatalog item will delete its catalog item variations).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCatalogObjectResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Catalog" + ], + "summary": "RetrieveCatalogObject", + "operationId": "RetrieveCatalogObject", + "description": "Returns a single [CatalogItem](entity:CatalogItem) as a\n[CatalogObject](entity:CatalogObject) based on the provided ID. The returned\nobject includes all of the relevant [CatalogItem](entity:CatalogItem)\ninformation including: [CatalogItemVariation](entity:CatalogItemVariation)\nchildren, references to its\n[CatalogModifierList](entity:CatalogModifierList) objects, and the ids of\nany [CatalogTax](entity:CatalogTax) objects that apply to it.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [ + { + "name": "object_id", + "description": "The object ID of any type of catalog objects to be retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "include_related_objects", + "description": "If `true`, the response will include additional objects that are related to the\nrequested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field\nof the response. These objects are put in the `related_objects` field. Setting this to `true` is\nhelpful when the objects are needed for immediate display to a user.\nThis process only goes one level deep. Objects referenced by the related objects will not be included. For example,\n\nif the `objects` field of the response contains a CatalogItem, its associated\nCatalogCategory objects, CatalogTax objects, CatalogImage objects and\nCatalogModifierLists will be returned in the `related_objects` field of the\nresponse. If the `objects` field of the response contains a CatalogItemVariation,\nits parent CatalogItem will be returned in the `related_objects` field of\nthe response.\n\nDefault value: `false`", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "catalog_version", + "description": "Requests objects as of a specific version of the catalog. This allows you to retrieve historical\nversions of objects. The value to retrieve a specific version of an object can be found\nin the version field of [CatalogObject](entity:CatalogObject)s. If not included, results will\nbe from the current version of the catalog.", + "schema": { + "type": "integer", + "format": "int64" + }, + "in": "query", + "required": false + }, + { + "name": "include_category_path_to_root", + "description": "Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists\nof `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category\nand ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned\nin the response payload.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCatalogObjectResponse" + } + } + } + } + } + } + }, + "/v2/catalog/search": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "SearchCatalogObjects", + "operationId": "SearchCatalogObjects", + "description": "Searches for [CatalogObject](entity:CatalogObject) of any type by matching supported search attribute values,\nexcluding custom attribute values on items or item variations, against one or more of the specified query filters.\n\nThis (`SearchCatalogObjects`) endpoint differs from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems)\nendpoint in the following aspects:\n\n- `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects.\n- `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not.\n- `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does.\n- The both endpoints have different call conventions, including the query filter formats.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCatalogObjectsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCatalogObjectsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/search-catalog-items": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "SearchCatalogItems", + "operationId": "SearchCatalogItems", + "description": "Searches for catalog items or item variations by matching supported search attribute values, including\ncustom attribute values, against one or more of the specified query filters.\n\nThis (`SearchCatalogItems`) endpoint differs from the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects)\nendpoint in the following aspects:\n\n- `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects.\n- `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not.\n- `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does.\n- The both endpoints use different call conventions, including the query filter formats.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCatalogItemsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCatalogItemsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/update-item-modifier-lists": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "UpdateItemModifierLists", + "operationId": "UpdateItemModifierLists", + "description": "Updates the [CatalogModifierList](entity:CatalogModifierList) objects\nthat apply to the targeted [CatalogItem](entity:CatalogItem) without having\nto perform an upsert on the entire item.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateItemModifierListsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateItemModifierListsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/update-item-taxes": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "UpdateItemTaxes", + "operationId": "UpdateItemTaxes", + "description": "Updates the [CatalogTax](entity:CatalogTax) objects that apply to the\ntargeted [CatalogItem](entity:CatalogItem) without having to perform an\nupsert on the entire item.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateItemTaxesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateItemTaxesResponse" + } + } + } + } + } + } + }, + "/v2/customers": { + "get": { + "tags": [ + "Customers" + ], + "summary": "ListCustomers", + "operationId": "ListCustomers", + "description": "Lists customer profiles associated with a Square account.\n\nUnder normal operating conditions, newly created or updated customer profiles become available\nfor the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated\nprofiles can take closer to one minute or longer, especially during network incidents and outages.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.\nIf the specified limit is less than 1 or greater than 100, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "sort_field", + "description": "Indicates how customers should be sorted.\n\nThe default value is `DEFAULT`.", + "schema": { + "$ref": "#/components/schemas/CustomerSortField" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "Indicates whether customers should be sorted in ascending (`ASC`) or\ndescending (`DESC`) order.\n\nThe default value is `ASC`.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "count", + "description": "Indicates whether to return the total count of customers in the `count` field of the response.\n\nThe default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCustomersResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Customers" + ], + "summary": "CreateCustomer", + "operationId": "CreateCustomer", + "description": "Creates a new customer for a business.\n\nYou must provide at least one of the following values in your request to this\nendpoint:\n\n- `given_name`\n- `family_name`\n- `company_name`\n- `email_address`\n- `phone_number`", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "INVALID_PHONE_NUMBER" + }, + { + "error-code": "INVALID_TIME" + }, + { + "error-code": "VALUE_TOO_LONG" + } + ] + } + }, + "/v2/customers/bulk-create": { + "post": { + "tags": [ + "Customers" + ], + "summary": "BulkCreateCustomers", + "operationId": "BulkCreateCustomers", + "description": "Creates multiple [customer profiles](entity:Customer) for a business.\n\nThis endpoint takes a map of individual create requests and returns a map of responses.\n\nYou must provide at least one of the following values in each create request:\n\n- `given_name`\n- `family_name`\n- `company_name`\n- `email_address`\n- `phone_number`", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateCustomersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateCustomersResponse" + } + } + } + } + } + } + }, + "/v2/customers/bulk-delete": { + "post": { + "tags": [ + "Customers" + ], + "summary": "BulkDeleteCustomers", + "operationId": "BulkDeleteCustomers", + "description": "Deletes multiple customer profiles.\n\nThe endpoint takes a list of customer IDs and returns a map of responses.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteCustomersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteCustomersResponse" + } + } + } + } + } + } + }, + "/v2/customers/bulk-retrieve": { + "post": { + "tags": [ + "Customers" + ], + "summary": "BulkRetrieveCustomers", + "operationId": "BulkRetrieveCustomers", + "description": "Retrieves multiple customer profiles.\n\nThis endpoint takes a list of customer IDs and returns a map of responses.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveCustomersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveCustomersResponse" + } + } + } + } + } + } + }, + "/v2/customers/bulk-update": { + "post": { + "tags": [ + "Customers" + ], + "summary": "BulkUpdateCustomers", + "operationId": "BulkUpdateCustomers", + "description": "Updates multiple customer profiles.\n\nThis endpoint takes a map of individual update requests and returns a map of responses.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateCustomersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateCustomersResponse" + } + } + } + } + } + } + }, + "/v2/customers/custom-attribute-definitions": { + "get": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "ListCustomerCustomAttributeDefinitions", + "operationId": "ListCustomerCustomAttributeDefinitions", + "description": "Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.\n\nWhen all response pages are retrieved, the results include all custom attribute definitions\nthat are visible to the requesting application, including those that are created by other\napplications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that\nseller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCustomerCustomAttributeDefinitionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "CreateCustomerCustomAttributeDefinition", + "operationId": "CreateCustomerCustomAttributeDefinition", + "description": "Creates a customer-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\nUse this endpoint to define a custom attribute that can be associated with customer profiles.\n\nA custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties\nfor a custom attribute. After the definition is created, you can call\n[UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) or\n[BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes)\nto set the custom attribute for customer profiles in the seller's Customer Directory.\n\nSellers can view all custom attributes in exported customer data, including those set to\n`VISIBILITY_HIDDEN`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/customers/custom-attribute-definitions/{key}": { + "delete": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "DeleteCustomerCustomAttributeDefinition", + "operationId": "DeleteCustomerCustomAttributeDefinition", + "description": "Deletes a customer-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\n\nDeleting a custom attribute definition also deletes the corresponding custom attribute from\nall customer profiles in the seller's Customer Directory.\n\nOnly the definition owner can delete a custom attribute definition.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomerCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "RetrieveCustomerCustomAttributeDefinition", + "operationId": "RetrieveCustomerCustomAttributeDefinition", + "description": "Retrieves a customer-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\n\nTo retrieve a custom attribute definition created by another application, the `visibility`\nsetting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to retrieve. If the requesting application\nis not the definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The current version of the custom attribute definition, which is used for strongly consistent\nreads to guarantee that you receive the most up-to-date data. When included in the request,\nSquare returns the specified version or a higher version if one exists. If the specified version\nis higher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCustomerCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "UpdateCustomerCustomAttributeDefinition", + "operationId": "UpdateCustomerCustomAttributeDefinition", + "description": "Updates a customer-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\n\nUse this endpoint to update the following fields: `name`, `description`, `visibility`, or the\n`schema` for a `Selection` data type.\n\nOnly the definition owner can update a custom attribute definition. Note that sellers can view\nall custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/customers/custom-attributes/bulk-upsert": { + "post": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "BulkUpsertCustomerCustomAttributes", + "operationId": "BulkUpsertCustomerCustomAttributes", + "description": "Creates or updates [custom attributes](entity:CustomAttribute) for customer profiles as a bulk operation.\n\nUse this endpoint to set the value of one or more custom attributes for one or more customer profiles.\nA custom attribute is based on a custom attribute definition in a Square seller account, which is\ncreated using the [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) endpoint.\n\nThis `BulkUpsertCustomerCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert\nrequests and returns a map of individual upsert responses. Each upsert request has a unique ID\nand provides a customer ID and custom attribute. Each upsert response is returned with the ID\nof the corresponding request.\n\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertCustomerCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertCustomerCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/customers/groups": { + "get": { + "tags": [ + "CustomerGroups" + ], + "summary": "ListCustomerGroups", + "operationId": "ListCustomerGroups", + "description": "Retrieves the list of customer groups of a business.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.\nIf the limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCustomerGroupsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "CustomerGroups" + ], + "summary": "CreateCustomerGroup", + "operationId": "CreateCustomerGroup", + "description": "Creates a new customer group for a business.\n\nThe request must include the `name` value of the group.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerGroupRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerGroupResponse" + } + } + } + } + } + } + }, + "/v2/customers/groups/{group_id}": { + "delete": { + "tags": [ + "CustomerGroups" + ], + "summary": "DeleteCustomerGroup", + "operationId": "DeleteCustomerGroup", + "description": "Deletes a customer group as identified by the `group_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "group_id", + "description": "The ID of the customer group to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomerGroupResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "CustomerGroups" + ], + "summary": "RetrieveCustomerGroup", + "operationId": "RetrieveCustomerGroup", + "description": "Retrieves a specific customer group as identified by the `group_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "group_id", + "description": "The ID of the customer group to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCustomerGroupResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "CustomerGroups" + ], + "summary": "UpdateCustomerGroup", + "operationId": "UpdateCustomerGroup", + "description": "Updates a customer group as identified by the `group_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "group_id", + "description": "The ID of the customer group to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerGroupRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerGroupResponse" + } + } + } + } + } + } + }, + "/v2/customers/search": { + "post": { + "tags": [ + "Customers" + ], + "summary": "SearchCustomers", + "operationId": "SearchCustomers", + "description": "Searches the customer profiles associated with a Square account using one or more supported query filters.\n\nCalling `SearchCustomers` without any explicit query filter returns all\ncustomer profiles ordered alphabetically based on `given_name` and\n`family_name`.\n\nUnder normal operating conditions, newly created or updated customer profiles become available\nfor the search operation in well under 30 seconds. Occasionally, propagation of the new or updated\nprofiles can take closer to one minute or longer, especially during network incidents and outages.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCustomersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCustomersResponse" + } + } + } + } + } + } + }, + "/v2/customers/segments": { + "get": { + "tags": [ + "CustomerSegments" + ], + "summary": "ListCustomerSegments", + "operationId": "ListCustomerSegments", + "description": "Retrieves the list of customer segments of a business.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by previous calls to `ListCustomerSegments`.\nThis cursor is used to retrieve the next set of query results.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.\nIf the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCustomerSegmentsResponse" + } + } + } + } + } + } + }, + "/v2/customers/segments/{segment_id}": { + "get": { + "tags": [ + "CustomerSegments" + ], + "summary": "RetrieveCustomerSegment", + "operationId": "RetrieveCustomerSegment", + "description": "Retrieves a specific customer segment as identified by the `segment_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "segment_id", + "description": "The Square-issued ID of the customer segment.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCustomerSegmentResponse" + } + } + } + } + } + } + }, + "/v2/customers/{customer_id}": { + "delete": { + "tags": [ + "Customers" + ], + "summary": "DeleteCustomer", + "operationId": "DeleteCustomer", + "description": "Deletes a customer profile from a business.\n\nTo delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The current version of the customer profile.\n\nAs a best practice, you should include this parameter to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For more information, see [Delete a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile).", + "schema": { + "type": "integer", + "format": "int64" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomerResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Customers" + ], + "summary": "RetrieveCustomer", + "operationId": "RetrieveCustomer", + "description": "Returns details for a single customer.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCustomerResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Customers" + ], + "summary": "UpdateCustomer", + "operationId": "UpdateCustomer", + "description": "Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request.\nTo add or update a field, specify the new value. To remove a field, specify `null`.\n\nTo update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "INVALID_PHONE_NUMBER" + }, + { + "error-code": "INVALID_TIME" + }, + { + "error-code": "VALUE_TOO_LONG" + } + ] + } + }, + "/v2/customers/{customer_id}/cards": { + "post": { + "tags": [ + "Customers" + ], + "summary": "CreateCustomerCard", + "operationId": "CreateCustomerCard", + "description": "Adds a card on file to an existing customer.\n\nAs with charges, calls to `CreateCustomerCard` are idempotent. Multiple\ncalls with the same card nonce return the same card record that was created\nwith the provided nonce during the _first_ call.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "replacedBy": "CreateCard", + "guideUrl": "https://developer.squareup.com/docs/customers-api/what-it-does#deprecated-createcustomercard-endpoint" + }, + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The Square ID of the customer profile the card is linked to.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerCardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerCardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_EXPIRED" + }, + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CARD_TOKEN_EXPIRED" + }, + { + "error-code": "CARD_TOKEN_USED" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "INVALID_CARD_DATA" + }, + { + "error-code": "INVALID_EXPIRATION" + }, + { + "error-code": "UNSUPPORTED_ENTRY_METHOD" + }, + { + "error-code": "VERIFY_AVS_FAILURE" + }, + { + "error-code": "VERIFY_CVV_FAILURE" + } + ] + } + }, + "/v2/customers/{customer_id}/cards/{card_id}": { + "delete": { + "tags": [ + "Customers" + ], + "summary": "DeleteCustomerCard", + "operationId": "DeleteCustomerCard", + "description": "Removes a card on file from a customer.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "replacedBy": "DisableCard", + "guideUrl": "https://developer.squareup.com/docs/customers-api/what-it-does#deprecated-deletecustomercard-endpoint" + }, + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer that the card on file belongs to.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "card_id", + "description": "The ID of the card on file to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomerCardResponse" + } + } + } + } + } + } + }, + "/v2/customers/{customer_id}/custom-attributes": { + "get": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "ListCustomerCustomAttributes", + "operationId": "ListCustomerCustomAttributes", + "description": "Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile.\n\nYou can use the `with_definitions` query parameter to also retrieve custom attribute definitions\nin the same call.\n\nWhen all response pages are retrieved, the results include all custom attributes that are\nvisible to the requesting application, including those that are owned by other applications\nand set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the target [customer profile](entity:Customer).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request. For more\ninformation, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "with_definitions", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCustomerCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/customers/{customer_id}/custom-attributes/{key}": { + "delete": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "DeleteCustomerCustomAttribute", + "operationId": "DeleteCustomerCustomAttribute", + "description": "Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile.\n\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the target [customer profile](entity:Customer).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to delete. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomerCustomAttributeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "RetrieveCustomerCustomAttribute", + "operationId": "RetrieveCustomerCustomAttribute", + "description": "Retrieves a [custom attribute](entity:CustomAttribute) associated with a customer profile.\n\nYou can use the `with_definition` query parameter to also retrieve the custom attribute definition\nin the same call.\n\nTo retrieve a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the target [customer profile](entity:Customer).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to retrieve. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "with_definition", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of\nthe custom attribute. Set this parameter to `true` to get the name and description of the custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "version", + "description": "The current version of the custom attribute, which is used for strongly consistent reads to\nguarantee that you receive the most up-to-date data. When included in the request, Square\nreturns the specified version or a higher version if one exists. If the specified version is\nhigher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCustomerCustomAttributeResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "UpsertCustomerCustomAttribute", + "operationId": "UpsertCustomerCustomAttribute", + "description": "Creates or updates a [custom attribute](entity:CustomAttribute) for a customer profile.\n\nUse this endpoint to set the value of a custom attribute for a specified customer profile.\nA custom attribute is based on a custom attribute definition in a Square seller account, which\nis created using the [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) endpoint.\n\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the target [customer profile](entity:Customer).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to create or update. This key must match the `key` of a\ncustom attribute definition in the Square seller account. If the requesting application is not\nthe definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertCustomerCustomAttributeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertCustomerCustomAttributeResponse" + } + } + } + } + } + } + }, + "/v2/customers/{customer_id}/groups/{group_id}": { + "delete": { + "tags": [ + "Customers" + ], + "summary": "RemoveGroupFromCustomer", + "operationId": "RemoveGroupFromCustomer", + "description": "Removes a group membership from a customer.\n\nThe customer is identified by the `customer_id` value\nand the customer group is identified by the `group_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer to remove from the group.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "group_id", + "description": "The ID of the customer group to remove the customer from.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoveGroupFromCustomerResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Customers" + ], + "summary": "AddGroupToCustomer", + "operationId": "AddGroupToCustomer", + "description": "Adds a group membership to a customer.\n\nThe customer is identified by the `customer_id` value\nand the customer group is identified by the `group_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer to add to a group.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "group_id", + "description": "The ID of the customer group to add the customer to.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddGroupToCustomerResponse" + } + } + } + } + } + } + }, + "/v2/devices": { + "get": { + "tags": [ + "Devices" + ], + "summary": "ListDevices", + "operationId": "ListDevices", + "description": "List devices associated with the merchant. Currently, only Terminal API\ndevices are supported.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "DEVICES_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which results are listed.\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The number of results to return in a single page.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "If present, only returns devices at the target location.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDevicesResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + } + ] + } + }, + "/v2/devices/codes": { + "get": { + "tags": [ + "Devices" + ], + "summary": "ListDeviceCodes", + "operationId": "ListDeviceCodes", + "description": "Lists all DeviceCodes associated with the merchant.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DEVICE_CREDENTIAL_MANAGEMENT" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for your original query.\n\nSee [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "If specified, only returns DeviceCodes of the specified location.\nReturns DeviceCodes of all locations if empty.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "product_type", + "description": "If specified, only returns DeviceCodes targeting the specified product type.\nReturns DeviceCodes of all product types if empty.", + "schema": { + "$ref": "#/components/schemas/ProductType" + }, + "in": "query", + "required": false + }, + { + "name": "status", + "description": "If specified, returns DeviceCodes with the specified statuses.\nReturns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty.", + "schema": { + "$ref": "#/components/schemas/DeviceCodeStatus" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDeviceCodesResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_CURSOR" + }, + { + "error-code": "BAD_REQUEST" + } + ] + }, + "post": { + "tags": [ + "Devices" + ], + "summary": "CreateDeviceCode", + "operationId": "CreateDeviceCode", + "description": "Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected\nterminal mode.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DEVICE_CREDENTIAL_MANAGEMENT" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDeviceCodeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDeviceCodeResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "IDEMPOTENCY_KEY_REUSED" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "UNAUTHORIZED" + } + ] + } + }, + "/v2/devices/codes/{id}": { + "get": { + "tags": [ + "Devices" + ], + "summary": "GetDeviceCode", + "operationId": "GetDeviceCode", + "description": "Retrieves DeviceCode with the associated ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DEVICE_CREDENTIAL_MANAGEMENT" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The unique identifier for the device code.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetDeviceCodeResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "UNAUTHORIZED" + } + ] + } + }, + "/v2/devices/{device_id}": { + "get": { + "tags": [ + "Devices" + ], + "summary": "GetDevice", + "operationId": "GetDevice", + "description": "Retrieves Device with the associated `device_id`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "DEVICES_READ" + ] + } + ], + "parameters": [ + { + "name": "device_id", + "description": "The unique ID for the desired `Device`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetDeviceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/disputes": { + "get": { + "tags": [ + "Disputes" + ], + "summary": "ListDisputes", + "operationId": "ListDisputes", + "description": "Returns a list of disputes associated with a particular account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "states", + "description": "The dispute states used to filter the result. If not specified, the endpoint returns all disputes.", + "schema": { + "$ref": "#/components/schemas/DisputeState" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "The ID of the location for which to return a list of disputes.\nIf not specified, the endpoint returns disputes associated with all locations.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDisputesResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}": { + "get": { + "tags": [ + "Disputes" + ], + "summary": "RetrieveDispute", + "operationId": "RetrieveDispute", + "description": "Returns details about a specific dispute.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_READ" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute you want more details about.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveDisputeResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/accept": { + "post": { + "tags": [ + "Disputes" + ], + "summary": "AcceptDispute", + "operationId": "AcceptDispute", + "description": "Accepts the loss on a dispute. Square returns the disputed amount to the cardholder and\nupdates the dispute state to ACCEPTED.\n\nSquare debits the disputed amount from the seller’s Square account. If the Square account\ndoes not have sufficient funds, Square debits the associated bank account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute you want to accept.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptDisputeResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/evidence": { + "get": { + "tags": [ + "Disputes" + ], + "summary": "ListDisputeEvidence", + "operationId": "ListDisputeEvidence", + "description": "Returns a list of evidence associated with a dispute.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_READ" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDisputeEvidenceResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/evidence-files": { + "post": { + "tags": [ + "Disputes" + ], + "summary": "CreateDisputeEvidenceFile", + "operationId": "CreateDisputeEvidenceFile", + "description": "Uploads a file to use as evidence in a dispute challenge. The endpoint accepts HTTP\nmultipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute for which you want to upload evidence.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "request": { + "$ref": "#/components/schemas/CreateDisputeEvidenceFileRequest" + }, + "image_file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "image_file": { + "contentType": "image/jpeg" + }, + "request": { + "contentType": "application/json; charset=utf-8" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDisputeEvidenceFileResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/evidence-text": { + "post": { + "tags": [ + "Disputes" + ], + "summary": "CreateDisputeEvidenceText", + "operationId": "CreateDisputeEvidenceText", + "description": "Uploads text to use as evidence for a dispute challenge.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute for which you want to upload evidence.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDisputeEvidenceTextRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDisputeEvidenceTextResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/evidence/{evidence_id}": { + "delete": { + "tags": [ + "Disputes" + ], + "summary": "DeleteDisputeEvidence", + "operationId": "DeleteDisputeEvidence", + "description": "Removes specified evidence from a dispute.\nSquare does not send the bank any evidence that is removed.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute from which you want to remove evidence.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "evidence_id", + "description": "The ID of the evidence you want to remove.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteDisputeEvidenceResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Disputes" + ], + "summary": "RetrieveDisputeEvidence", + "operationId": "RetrieveDisputeEvidence", + "description": "Returns the metadata for the evidence specified in the request URL path.\n\nYou must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_READ" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute from which you want to retrieve evidence metadata.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "evidence_id", + "description": "The ID of the evidence to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveDisputeEvidenceResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/submit-evidence": { + "post": { + "tags": [ + "Disputes" + ], + "summary": "SubmitEvidence", + "operationId": "SubmitEvidence", + "description": "Submits evidence to the cardholder's bank.\n\nThe evidence submitted by this endpoint includes evidence uploaded\nusing the [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) and\n[CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText) endpoints and\nevidence automatically provided by Square, when available. Evidence cannot be removed from\na dispute after submission.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute for which you want to submit evidence.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmitEvidenceResponse" + } + } + } + } + } + } + }, + "/v2/employees": { + "get": { + "tags": [ + "Employees" + ], + "summary": "ListEmployees", + "operationId": "ListEmployees", + "description": "", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2020-08-26", + "retirementDate": "2021-08-26", + "replacedBy": "SearchTeamMembers", + "guideUrl": "https://developer.squareup.com/docs/team/migrate-from-v2-employees" + }, + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "status", + "description": "Specifies the EmployeeStatus to filter the employee by.", + "schema": { + "$ref": "#/components/schemas/EmployeeStatus" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The number of employees to be returned on each page.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The token required to retrieve the specified page of results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEmployeesResponse" + } + } + } + } + } + } + }, + "/v2/employees/{id}": { + "get": { + "tags": [ + "Employees" + ], + "summary": "RetrieveEmployee", + "operationId": "RetrieveEmployee", + "description": "", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2020-08-26", + "retirementDate": "2021-08-26", + "replacedBy": "RetrieveTeamMember", + "guideUrl": "https://developer.squareup.com/docs/team/migrate-from-v2-employees" + }, + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "UUID for the employee that was requested.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveEmployeeResponse" + } + } + } + } + } + } + }, + "/v2/events": { + "post": { + "tags": [ + "Events" + ], + "summary": "SearchEvents", + "operationId": "SearchEvents", + "description": "Search for Square API events that occur within a 28-day timeframe.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchEventsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchEventsResponse" + } + } + } + } + } + } + }, + "/v2/events/disable": { + "put": { + "tags": [ + "Events" + ], + "summary": "DisableEvents", + "operationId": "DisableEvents", + "description": "Disables events to prevent them from being searchable.\nAll events are disabled by default. You must enable events to make them searchable.\nDisabling events for a specific time period prevents them from being searchable, even if you re-enable them later.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DisableEventsResponse" + } + } + } + } + } + } + }, + "/v2/events/enable": { + "put": { + "tags": [ + "Events" + ], + "summary": "EnableEvents", + "operationId": "EnableEvents", + "description": "Enables events to make them searchable. Only events that occur while in the enabled state are searchable.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EnableEventsResponse" + } + } + } + } + } + } + }, + "/v2/events/types": { + "get": { + "tags": [ + "Events" + ], + "summary": "ListEventTypes", + "operationId": "ListEventTypes", + "description": "Lists all event types that you can subscribe to as webhooks or query using the Events API.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "api_version", + "description": "The API version for which to list event types. Setting this field overrides the default version used by the application.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEventTypesResponse" + } + } + } + } + } + } + }, + "/v2/gift-cards": { + "get": { + "tags": [ + "GiftCards" + ], + "summary": "ListGiftCards", + "operationId": "ListGiftCards", + "description": "Lists all gift cards. You can specify optional filters to retrieve \na subset of the gift cards. Results are sorted by `created_at` in ascending order.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "type", + "description": "If a [type](entity:GiftCardType) is provided, the endpoint returns gift cards of the specified type.\nOtherwise, the endpoint returns gift cards of all types.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "state", + "description": "If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the specified state.\nOtherwise, the endpoint returns the gift cards of all states.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "If a limit is provided, the endpoint returns only the specified number of results per page.\nThe maximum value is 200. The default value is 30.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nIf a cursor is not provided, the endpoint returns the first page of the results. \nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "customer_id", + "description": "If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListGiftCardsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "GiftCards" + ], + "summary": "CreateGiftCard", + "operationId": "CreateGiftCard", + "description": "Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift card\nhas a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, call\n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) and create an `ACTIVATE`\nactivity with the initial balance. Alternatively, you can use [RefundPayment](api-endpoint:Refunds-RefundPayment)\nto refund a payment to the new gift card.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGiftCardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGiftCardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "TEMPORARY_ERROR" + } + ] + } + }, + "/v2/gift-cards/activities": { + "get": { + "tags": [ + "GiftCardActivities" + ], + "summary": "ListGiftCardActivities", + "operationId": "ListGiftCardActivities", + "description": "Lists gift card activities. By default, you get gift card activities for all\ngift cards in the seller's account. You can optionally specify query parameters to\nfilter the list. For example, you can get a list of gift card activities for a gift card,\nfor all gift cards in a specific region, or for activities within a time window.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "gift_card_id", + "description": "If a gift card ID is provided, the endpoint returns activities related \nto the specified gift card. Otherwise, the endpoint returns all gift card activities for \nthe seller.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "type", + "description": "If a [type](entity:GiftCardActivityType) is provided, the endpoint returns gift card activities of the specified type. \nOtherwise, the endpoint returns all types of gift card activities.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "If a location ID is provided, the endpoint returns gift card activities for the specified location. \nOtherwise, the endpoint returns gift card activities for all locations.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "begin_time", + "description": "The timestamp for the beginning of the reporting period, in RFC 3339 format.\nThis start time is inclusive. The default value is the current time minus one year.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "The timestamp for the end of the reporting period, in RFC 3339 format.\nThis end time is inclusive. The default value is the current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "If a limit is provided, the endpoint returns the specified number \nof results (or fewer) per page. The maximum value is 100. The default value is 50.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nIf a cursor is not provided, the endpoint returns the first page of the results.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which the endpoint returns the activities, based on `created_at`.\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListGiftCardActivitiesResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "GiftCardActivities" + ], + "summary": "CreateGiftCardActivity", + "operationId": "CreateGiftCardActivity", + "description": "Creates a gift card activity to manage the balance or state of a [gift card](entity:GiftCard).\nFor example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGiftCardActivityRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGiftCardActivityResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INSUFFICIENT_FUNDS" + }, + { + "error-code": "PAYMENT_LIMIT_EXCEEDED" + }, + { + "error-code": "REFUND_AMOUNT_INVALID" + }, + { + "error-code": "TEMPORARY_ERROR" + } + ] + } + }, + "/v2/gift-cards/from-gan": { + "post": { + "tags": [ + "GiftCards" + ], + "summary": "RetrieveGiftCardFromGAN", + "operationId": "RetrieveGiftCardFromGAN", + "description": "Retrieves a gift card using the gift card account number (GAN).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveGiftCardFromGANRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveGiftCardFromGANResponse" + } + } + } + } + } + } + }, + "/v2/gift-cards/from-nonce": { + "post": { + "tags": [ + "GiftCards" + ], + "summary": "RetrieveGiftCardFromNonce", + "operationId": "RetrieveGiftCardFromNonce", + "description": "Retrieves a gift card using a secure payment token that represents the gift card.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveGiftCardFromNonceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveGiftCardFromNonceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_TOKEN_EXPIRED" + }, + { + "error-code": "CARD_TOKEN_USED" + } + ] + } + }, + "/v2/gift-cards/{gift_card_id}/link-customer": { + "post": { + "tags": [ + "GiftCards" + ], + "summary": "LinkCustomerToGiftCard", + "operationId": "LinkCustomerToGiftCard", + "description": "Links a customer to a gift card, which is also referred to as adding a card on file.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "gift_card_id", + "description": "The ID of the gift card to be linked.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LinkCustomerToGiftCardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LinkCustomerToGiftCardResponse" + } + } + } + } + } + } + }, + "/v2/gift-cards/{gift_card_id}/unlink-customer": { + "post": { + "tags": [ + "GiftCards" + ], + "summary": "UnlinkCustomerFromGiftCard", + "operationId": "UnlinkCustomerFromGiftCard", + "description": "Unlinks a customer from a gift card, which is also referred to as removing a card on file.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "gift_card_id", + "description": "The ID of the gift card to be unlinked.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnlinkCustomerFromGiftCardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnlinkCustomerFromGiftCardResponse" + } + } + } + } + } + } + }, + "/v2/gift-cards/{id}": { + "get": { + "tags": [ + "GiftCards" + ], + "summary": "RetrieveGiftCard", + "operationId": "RetrieveGiftCard", + "description": "Retrieves a gift card using the gift card ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the gift card to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveGiftCardResponse" + } + } + } + } + } + } + }, + "/v2/inventory/adjustment/{adjustment_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "DeprecatedRetrieveInventoryAdjustment", + "operationId": "DeprecatedRetrieveInventoryAdjustment", + "description": "Deprecated version of [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) after the endpoint URL\nis updated to conform to the standard convention.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "RetrieveInventoryAdjustment" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "adjustment_id", + "description": "ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryAdjustmentResponse" + } + } + } + } + } + } + }, + "/v2/inventory/adjustments/{adjustment_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "RetrieveInventoryAdjustment", + "operationId": "RetrieveInventoryAdjustment", + "description": "Returns the [InventoryAdjustment](entity:InventoryAdjustment) object\nwith the provided `adjustment_id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "adjustment_id", + "description": "ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryAdjustmentResponse" + } + } + } + } + } + } + }, + "/v2/inventory/batch-change": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "DeprecatedBatchChangeInventory", + "operationId": "DeprecatedBatchChangeInventory", + "description": "Deprecated version of [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) after the endpoint URL\nis updated to conform to the standard convention.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "BatchChangeInventory" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchChangeInventoryRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchChangeInventoryResponse" + } + } + } + } + } + } + }, + "/v2/inventory/batch-retrieve-changes": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "DeprecatedBatchRetrieveInventoryChanges", + "operationId": "DeprecatedBatchRetrieveInventoryChanges", + "description": "Deprecated version of [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) after the endpoint URL\nis updated to conform to the standard convention.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "BatchRetrieveInventoryChanges" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryChangesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryChangesResponse" + } + } + } + } + } + } + }, + "/v2/inventory/batch-retrieve-counts": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "DeprecatedBatchRetrieveInventoryCounts", + "operationId": "DeprecatedBatchRetrieveInventoryCounts", + "description": "Deprecated version of [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) after the endpoint URL\nis updated to conform to the standard convention.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "BatchRetrieveInventoryCounts" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryCountsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryCountsResponse" + } + } + } + } + } + } + }, + "/v2/inventory/changes/batch-create": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "BatchChangeInventory", + "operationId": "BatchChangeInventory", + "description": "Applies adjustments and counts to the provided item quantities.\n\nOn success: returns the current calculated counts for all objects\nreferenced in the request.\nOn failure: returns a list of related errors.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchChangeInventoryRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchChangeInventoryResponse" + } + } + } + } + } + } + }, + "/v2/inventory/changes/batch-retrieve": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "BatchRetrieveInventoryChanges", + "operationId": "BatchRetrieveInventoryChanges", + "description": "Returns historical physical counts and adjustments based on the\nprovided filter criteria.\n\nResults are paginated and sorted in ascending order according their\n`occurred_at` timestamp (oldest first).\n\nBatchRetrieveInventoryChanges is a catch-all query endpoint for queries\nthat cannot be handled by other, simpler endpoints.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryChangesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryChangesResponse" + } + } + } + } + } + } + }, + "/v2/inventory/counts/batch-retrieve": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "BatchRetrieveInventoryCounts", + "operationId": "BatchRetrieveInventoryCounts", + "description": "Returns current counts for the provided\n[CatalogObject](entity:CatalogObject)s at the requested\n[Location](entity:Location)s.\n\nResults are paginated and sorted in descending order according to their\n`calculated_at` timestamp (newest first).\n\nWhen `updated_after` is specified, only counts that have changed since that\ntime (based on the server timestamp for the most recent change) are\nreturned. This allows clients to perform a \"sync\" operation, for example\nin response to receiving a Webhook notification.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryCountsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryCountsResponse" + } + } + } + } + } + } + }, + "/v2/inventory/physical-count/{physical_count_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "DeprecatedRetrieveInventoryPhysicalCount", + "operationId": "DeprecatedRetrieveInventoryPhysicalCount", + "description": "Deprecated version of [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) after the endpoint URL\nis updated to conform to the standard convention.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "RetrieveInventoryPhysicalCount" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "physical_count_id", + "description": "ID of the\n[InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryPhysicalCountResponse" + } + } + } + } + } + } + }, + "/v2/inventory/physical-counts/{physical_count_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "RetrieveInventoryPhysicalCount", + "operationId": "RetrieveInventoryPhysicalCount", + "description": "Returns the [InventoryPhysicalCount](entity:InventoryPhysicalCount)\nobject with the provided `physical_count_id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "physical_count_id", + "description": "ID of the\n[InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryPhysicalCountResponse" + } + } + } + } + } + } + }, + "/v2/inventory/transfers/{transfer_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "RetrieveInventoryTransfer", + "operationId": "RetrieveInventoryTransfer", + "description": "Returns the [InventoryTransfer](entity:InventoryTransfer) object\nwith the provided `transfer_id`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "transfer_id", + "description": "ID of the [InventoryTransfer](entity:InventoryTransfer) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryTransferResponse" + } + } + } + } + } + } + }, + "/v2/inventory/{catalog_object_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "RetrieveInventoryCount", + "operationId": "RetrieveInventoryCount", + "description": "Retrieves the current calculated stock count for a given\n[CatalogObject](entity:CatalogObject) at a given set of\n[Location](entity:Location)s. Responses are paginated and unsorted.\nFor more sophisticated queries, use a batch endpoint.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "catalog_object_id", + "description": "ID of the [CatalogObject](entity:CatalogObject) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "location_ids", + "description": "The [Location](entity:Location) IDs to look up as a comma-separated\nlist. An empty list queries all locations.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryCountResponse" + } + } + } + } + } + } + }, + "/v2/inventory/{catalog_object_id}/changes": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "RetrieveInventoryChanges", + "operationId": "RetrieveInventoryChanges", + "description": "Returns a set of physical counts and inventory adjustments for the\nprovided [CatalogObject](entity:CatalogObject) at the requested\n[Location](entity:Location)s.\n\nYou can achieve the same result by calling [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges)\nand having the `catalog_object_ids` list contain a single element of the `CatalogObject` ID.\n\nResults are paginated and sorted in descending order according to their\n`occurred_at` timestamp (newest first).\n\nThere are no limits on how far back the caller can page. This endpoint can be\nused to display recent changes for a specific item. For more\nsophisticated queries, use a batch endpoint.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "BatchRetrieveInventoryChanges" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "catalog_object_id", + "description": "ID of the [CatalogObject](entity:CatalogObject) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "location_ids", + "description": "The [Location](entity:Location) IDs to look up as a comma-separated\nlist. An empty list queries all locations.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryChangesResponse" + } + } + } + } + } + } + }, + "/v2/invoices": { + "get": { + "tags": [ + "Invoices" + ], + "summary": "ListInvoices", + "operationId": "ListInvoices", + "description": "Returns a list of invoices for a given location. The response \nis paginated. If truncated, the response includes a `cursor` that you \nuse in a subsequent request to retrieve the next set of invoices.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVOICES_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location for which to list invoices.", + "schema": { + "type": "string" + }, + "in": "query", + "required": true + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint. \nProvide this cursor to retrieve the next set of results for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of invoices to return (200 is the maximum `limit`). \nIf not provided, the server uses a default limit of 100 invoices.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListInvoicesResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Invoices" + ], + "summary": "CreateInvoice", + "operationId": "CreateInvoice", + "description": "Creates a draft [invoice](entity:Invoice) \nfor an order created using the Orders API.\n\nA draft invoice remains in your account and no action is taken. \nYou must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateInvoiceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateInvoiceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "MERCHANT_SUBSCRIPTION_NOT_FOUND" + } + ] + } + }, + "/v2/invoices/search": { + "post": { + "tags": [ + "Invoices" + ], + "summary": "SearchInvoices", + "operationId": "SearchInvoices", + "description": "Searches for invoices from a location specified in \nthe filter. You can optionally specify customers in the filter for whom to \nretrieve invoices. In the current implementation, you can only specify one location and \noptionally one customer.\n\nThe response is paginated. If truncated, the response includes a `cursor` \nthat you use in a subsequent request to retrieve the next set of invoices.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVOICES_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchInvoicesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchInvoicesResponse" + } + } + } + } + } + } + }, + "/v2/invoices/{invoice_id}": { + "delete": { + "tags": [ + "Invoices" + ], + "summary": "DeleteInvoice", + "operationId": "DeleteInvoice", + "description": "Deletes the specified invoice. When an invoice is deleted, the \nassociated order status changes to CANCELED. You can only delete a draft \ninvoice (you cannot delete a published invoice, including one that is scheduled for processing).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the invoice to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The version of the [invoice](entity:Invoice) to delete.\nIf you do not know the version, you can call [GetInvoice](api-endpoint:Invoices-GetInvoice) or \n[ListInvoices](api-endpoint:Invoices-ListInvoices).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteInvoiceResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Invoices" + ], + "summary": "GetInvoice", + "operationId": "GetInvoice", + "description": "Retrieves an invoice by invoice ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVOICES_READ" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the invoice to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetInvoiceResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Invoices" + ], + "summary": "UpdateInvoice", + "operationId": "UpdateInvoice", + "description": "Updates an invoice. This endpoint supports sparse updates, so you only need\nto specify the fields you want to change along with the required `version` field.\nSome restrictions apply to updating invoices. For example, you cannot change the\n`order_id` or `location_id` field.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the invoice to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateInvoiceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateInvoiceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_DECLINED" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "MERCHANT_SUBSCRIPTION_NOT_FOUND" + } + ] + } + }, + "/v2/invoices/{invoice_id}/attachments": { + "post": { + "tags": [ + "Invoices" + ], + "summary": "CreateInvoiceAttachment", + "operationId": "CreateInvoiceAttachment", + "description": "Uploads a file and attaches it to an invoice. This endpoint accepts HTTP multipart/form-data file uploads\nwith a JSON `request` part and a `file` part. The `file` part must be a `readable stream` that contains a file\nin a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF.\n\nInvoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added only to invoices\nin the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state.\n\n__NOTE:__ When testing in the Sandbox environment, the total file size is limited to 1 KB.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the [invoice](entity:Invoice) to attach the file to.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "request": { + "$ref": "#/components/schemas/CreateInvoiceAttachmentRequest" + }, + "image_file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "image_file": { + "contentType": "image/jpeg" + }, + "request": { + "contentType": "application/json; charset=utf-8" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateInvoiceAttachmentResponse" + } + } + } + } + } + } + }, + "/v2/invoices/{invoice_id}/attachments/{attachment_id}": { + "delete": { + "tags": [ + "Invoices" + ], + "summary": "DeleteInvoiceAttachment", + "operationId": "DeleteInvoiceAttachment", + "description": "Removes an attachment from an invoice and permanently deletes the file. Attachments can be removed only\nfrom invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the [invoice](entity:Invoice) to delete the attachment from.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "attachment_id", + "description": "The ID of the [attachment](entity:InvoiceAttachment) to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteInvoiceAttachmentResponse" + } + } + } + } + } + } + }, + "/v2/invoices/{invoice_id}/cancel": { + "post": { + "tags": [ + "Invoices" + ], + "summary": "CancelInvoice", + "operationId": "CancelInvoice", + "description": "Cancels an invoice. The seller cannot collect payments for \nthe canceled invoice.\n\nYou cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the [invoice](entity:Invoice) to cancel.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelInvoiceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelInvoiceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "VERSION_MISMATCH" + } + ] + } + }, + "/v2/invoices/{invoice_id}/publish": { + "post": { + "tags": [ + "Invoices" + ], + "summary": "PublishInvoice", + "operationId": "PublishInvoice", + "description": "Publishes the specified draft invoice. \n\nAfter an invoice is published, Square \nfollows up based on the invoice configuration. For example, Square \nsends the invoice to the customer's email address, charges the customer's card on file, or does \nnothing. Square also makes the invoice available on a Square-hosted invoice page. \n\nThe invoice `status` also changes from `DRAFT` to a status \nbased on the invoice configuration. For example, the status changes to `UNPAID` if \nSquare emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the \ninvoice amount.\n\nIn addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ`\nand `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the invoice to publish.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublishInvoiceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublishInvoiceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_DECLINED" + }, + { + "error-code": "INVALID_CARD" + } + ] + } + }, + "/v2/labor/break-types": { + "get": { + "tags": [ + "Labor" + ], + "summary": "ListBreakTypes", + "operationId": "ListBreakTypes", + "description": "Returns a paginated list of `BreakType` instances for a business.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "Filter the returned `BreakType` results to only those that are associated with the\nspecified location.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of `BreakType` results to return per page. The number can range between 1\nand 200. The default is 200.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pointer to the next page of `BreakType` results to fetch.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBreakTypesResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Labor" + ], + "summary": "CreateBreakType", + "operationId": "CreateBreakType", + "description": "Creates a new `BreakType`.\n\nA `BreakType` is a template for creating `Break` objects.\nYou must provide the following values in your request to this\nendpoint:\n\n- `location_id`\n- `break_name`\n- `expected_duration`\n- `is_paid`\n\nYou can only have three `BreakType` instances per location. If you attempt to add a fourth\n`BreakType` for a location, an `INVALID_REQUEST_ERROR` \"Exceeded limit of 3 breaks per location.\"\nis returned.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBreakTypeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBreakTypeResponse" + } + } + } + } + } + } + }, + "/v2/labor/break-types/{id}": { + "delete": { + "tags": [ + "Labor" + ], + "summary": "DeleteBreakType", + "operationId": "DeleteBreakType", + "description": "Deletes an existing `BreakType`.\n\nA `BreakType` can be deleted even if it is referenced from a `Shift`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `BreakType` being deleted.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteBreakTypeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Labor" + ], + "summary": "GetBreakType", + "operationId": "GetBreakType", + "description": "Returns a single `BreakType` specified by `id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `BreakType` being retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBreakTypeResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Labor" + ], + "summary": "UpdateBreakType", + "operationId": "UpdateBreakType", + "description": "Updates an existing `BreakType`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_WRITE", + "TIMECARDS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": " The UUID for the `BreakType` being updated.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBreakTypeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBreakTypeResponse" + } + } + } + } + } + } + }, + "/v2/labor/employee-wages": { + "get": { + "tags": [ + "Labor" + ], + "summary": "ListEmployeeWages", + "operationId": "ListEmployeeWages", + "description": "Returns a paginated list of `EmployeeWage` instances for a business.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2020-08-26", + "retirementDate": "TBD", + "replacedBy": "ListTeamMemberWages", + "guideUrl": "https://developer.squareup.com/docs/labor-api/migrate-to-teams" + }, + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "employee_id", + "description": "Filter the returned wages to only those that are associated with the specified employee.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of `EmployeeWage` results to return per page. The number can range between\n1 and 200. The default is 200.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pointer to the next page of `EmployeeWage` results to fetch.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEmployeeWagesResponse" + } + } + } + } + } + } + }, + "/v2/labor/employee-wages/{id}": { + "get": { + "tags": [ + "Labor" + ], + "summary": "GetEmployeeWage", + "operationId": "GetEmployeeWage", + "description": "Returns a single `EmployeeWage` specified by `id`.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2020-08-26", + "retirementDate": "TBD", + "replacedBy": "GetTeamMemberWage", + "guideUrl": "https://developer.squareup.com/docs/labor-api/migrate-to-teams" + }, + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `EmployeeWage` being retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetEmployeeWageResponse" + } + } + } + } + } + } + }, + "/v2/labor/scheduled-shifts": { + "post": { + "tags": [ + "Labor" + ], + "summary": "CreateScheduledShift", + "operationId": "CreateScheduledShift", + "description": "Creates a scheduled shift by providing draft shift details such as job ID,\nteam member assignment, and start and end times.\n\nThe following `draft_shift_details` fields are required:\n- `location_id`\n- `job_id`\n- `start_at`\n- `end_at`", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateScheduledShiftRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateScheduledShiftResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + } + ] + } + }, + "/v2/labor/scheduled-shifts/bulk-publish": { + "post": { + "tags": [ + "Labor" + ], + "summary": "BulkPublishScheduledShifts", + "operationId": "BulkPublishScheduledShifts", + "description": "Publishes 1 - 100 scheduled shifts. This endpoint takes a map of individual publish\nrequests and returns a map of responses. When a scheduled shift is published, Square keeps\nthe `draft_shift_details` field as is and copies it to the `published_shift_details` field.\n\nThe minimum `start_at` and maximum `end_at` timestamps of all shifts in a\n`BulkPublishScheduledShifts` request must fall within a two-week period.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkPublishScheduledShiftsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkPublishScheduledShiftsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + } + ] + } + }, + "/v2/labor/scheduled-shifts/search": { + "post": { + "tags": [ + "Labor" + ], + "summary": "SearchScheduledShifts", + "operationId": "SearchScheduledShifts", + "description": "Returns a paginated list of scheduled shifts, with optional filter and sort settings.\nBy default, results are sorted by `start_at` in ascending order.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchScheduledShiftsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchScheduledShiftsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "EXPECTED_STRING" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/labor/scheduled-shifts/{id}": { + "get": { + "tags": [ + "Labor" + ], + "summary": "RetrieveScheduledShift", + "operationId": "RetrieveScheduledShift", + "description": "Retrieves a scheduled shift by ID.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the scheduled shift to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveScheduledShiftResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + }, + "put": { + "tags": [ + "Labor" + ], + "summary": "UpdateScheduledShift", + "operationId": "UpdateScheduledShift", + "description": "Updates the draft shift details for a scheduled shift. This endpoint supports\nsparse updates, so only new, changed, or removed fields are required in the request.\nYou must publish the shift to make updates public.\n\nYou can make the following updates to `draft_shift_details`:\n- Change the `location_id`, `job_id`, `start_at`, and `end_at` fields.\n- Add, change, or clear the `team_member_id` and `notes` fields. To clear these fields,\nset the value to null.\n- Change the `is_deleted` field. To delete a scheduled shift, set `is_deleted` to true\nand then publish the shift.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the scheduled shift to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateScheduledShiftRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateScheduledShiftResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "VERSION_MISMATCH" + } + ] + } + }, + "/v2/labor/scheduled-shifts/{id}/publish": { + "post": { + "tags": [ + "Labor" + ], + "summary": "PublishScheduledShift", + "operationId": "PublishScheduledShift", + "description": "Publishes a scheduled shift. When a scheduled shift is published, Square keeps the\n`draft_shift_details` field as is and copies it to the `published_shift_details` field.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the scheduled shift to publish.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublishScheduledShiftRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublishScheduledShiftResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + } + ] + } + }, + "/v2/labor/shifts": { + "post": { + "tags": [ + "Labor" + ], + "summary": "CreateShift", + "operationId": "CreateShift", + "description": "Creates a new `Shift`.\n\nA `Shift` represents a complete workday for a single team member.\nYou must provide the following values in your request to this\nendpoint:\n\n- `location_id`\n- `team_member_id`\n- `start_at`\n\nAn attempt to create a new `Shift` can result in a `BAD_REQUEST` error when:\n- The `status` of the new `Shift` is `OPEN` and the team member has another\nshift with an `OPEN` status.\n- The `start_at` date is in the future.\n- The `start_at` or `end_at` date overlaps another shift for the same team member.\n- The `Break` instances are set in the request and a break `start_at`\nis before the `Shift.start_at`, a break `end_at` is after\nthe `Shift.end_at`, or both.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2025-05-21", + "retirementDate": "2026-05-21", + "replacedBy": "CreateTimecard", + "guideUrl": "https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes" + }, + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateShiftRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateShiftResponse" + } + } + } + } + } + } + }, + "/v2/labor/shifts/search": { + "post": { + "tags": [ + "Labor" + ], + "summary": "SearchShifts", + "operationId": "SearchShifts", + "description": "Returns a paginated list of `Shift` records for a business.\nThe list to be returned can be filtered by:\n- Location IDs\n- Team member IDs\n- Shift status (`OPEN` or `CLOSED`)\n- Shift start\n- Shift end\n- Workday details\n\nThe list can be sorted by:\n- `START_AT`\n- `END_AT`\n- `CREATED_AT`\n- `UPDATED_AT`", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2025-05-21", + "retirementDate": "2026-05-21", + "replacedBy": "SearchTimecards", + "guideUrl": "https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes" + }, + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchShiftsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchShiftsResponse" + } + } + } + } + } + } + }, + "/v2/labor/shifts/{id}": { + "delete": { + "tags": [ + "Labor" + ], + "summary": "DeleteShift", + "operationId": "DeleteShift", + "description": "Deletes a `Shift`.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2025-05-21", + "retirementDate": "2026-05-21", + "replacedBy": "DeleteTimecard", + "guideUrl": "https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes" + }, + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `Shift` being deleted.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteShiftResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Labor" + ], + "summary": "GetShift", + "operationId": "GetShift", + "description": "Returns a single `Shift` specified by `id`.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2025-05-21", + "retirementDate": "2026-05-21", + "replacedBy": "RetrieveTimecard", + "guideUrl": "https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes" + }, + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `Shift` being retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetShiftResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Labor" + ], + "summary": "UpdateShift", + "operationId": "UpdateShift", + "description": "Updates an existing `Shift`.\n\nWhen adding a `Break` to a `Shift`, any earlier `Break` instances in the `Shift` have\nthe `end_at` property set to a valid RFC-3339 datetime string.\n\nWhen closing a `Shift`, all `Break` instances in the `Shift` must be complete with `end_at`\nset on each `Break`.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2025-05-21", + "retirementDate": "2026-05-21", + "replacedBy": "UpdateTimecard", + "guideUrl": "https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes" + }, + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE", + "TIMECARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the object being updated.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateShiftRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateShiftResponse" + } + } + } + } + } + } + }, + "/v2/labor/team-member-wages": { + "get": { + "tags": [ + "Labor" + ], + "summary": "ListTeamMemberWages", + "operationId": "ListTeamMemberWages", + "description": "Returns a paginated list of `TeamMemberWage` instances for a business.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "Filter the returned wages to only those that are associated with the\nspecified team member.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of `TeamMemberWage` results to return per page. The number can range between\n1 and 200. The default is 200.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pointer to the next page of `EmployeeWage` results to fetch.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTeamMemberWagesResponse" + } + } + } + } + } + } + }, + "/v2/labor/team-member-wages/{id}": { + "get": { + "tags": [ + "Labor" + ], + "summary": "GetTeamMemberWage", + "operationId": "GetTeamMemberWage", + "description": "Returns a single `TeamMemberWage` specified by `id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `TeamMemberWage` being retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTeamMemberWageResponse" + } + } + } + } + } + } + }, + "/v2/labor/timecards": { + "post": { + "tags": [ + "Labor" + ], + "summary": "CreateTimecard", + "operationId": "CreateTimecard", + "description": "Creates a new `Timecard`.\n\nA `Timecard` represents a complete workday for a single team member.\nYou must provide the following values in your request to this\nendpoint:\n\n- `location_id`\n- `team_member_id`\n- `start_at`\n\nAn attempt to create a new `Timecard` can result in a `BAD_REQUEST` error when:\n- The `status` of the new `Timecard` is `OPEN` and the team member has another\ntimecard with an `OPEN` status.\n- The `start_at` date is in the future.\n- The `start_at` or `end_at` date overlaps another timecard for the same team member.\n- The `Break` instances are set in the request and a break `start_at`\nis before the `Timecard.start_at`, a break `end_at` is after\nthe `Timecard.end_at`, or both.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTimecardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTimecardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/labor/timecards/search": { + "post": { + "tags": [ + "Labor" + ], + "summary": "SearchTimecards", + "operationId": "SearchTimecards", + "description": "Returns a paginated list of `Timecard` records for a business.\nThe list to be returned can be filtered by:\n- Location IDs\n- Team member IDs\n- Timecard status (`OPEN` or `CLOSED`)\n- Timecard start\n- Timecard end\n- Workday details\n\nThe list can be sorted by:\n- `START_AT`\n- `END_AT`\n- `CREATED_AT`\n- `UPDATED_AT`", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTimecardsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTimecardsResponse" + } + } + } + } + } + } + }, + "/v2/labor/timecards/{id}": { + "delete": { + "tags": [ + "Labor" + ], + "summary": "DeleteTimecard", + "operationId": "DeleteTimecard", + "description": "Deletes a `Timecard`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `Timecard` being deleted.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteTimecardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + }, + "get": { + "tags": [ + "Labor" + ], + "summary": "RetrieveTimecard", + "operationId": "RetrieveTimecard", + "description": "Returns a single `Timecard` specified by `id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `Timecard` being retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTimecardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + }, + "put": { + "tags": [ + "Labor" + ], + "summary": "UpdateTimecard", + "operationId": "UpdateTimecard", + "description": "Updates an existing `Timecard`.\n\nWhen adding a `Break` to a `Timecard`, any earlier `Break` instances in the `Timecard` have\nthe `end_at` property set to a valid RFC-3339 datetime string.\n\nWhen closing a `Timecard`, all `Break` instances in the `Timecard` must be complete with `end_at`\nset on each `Break`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE", + "TIMECARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the object being updated.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTimecardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTimecardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "VERSION_MISMATCH" + } + ] + } + }, + "/v2/labor/workweek-configs": { + "get": { + "tags": [ + "Labor" + ], + "summary": "ListWorkweekConfigs", + "operationId": "ListWorkweekConfigs", + "description": "Returns a list of `WorkweekConfig` instances for a business.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "limit", + "description": "The maximum number of `WorkweekConfigs` results to return per page.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pointer to the next page of `WorkweekConfig` results to fetch.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWorkweekConfigsResponse" + } + } + } + } + } + } + }, + "/v2/labor/workweek-configs/{id}": { + "put": { + "tags": [ + "Labor" + ], + "summary": "UpdateWorkweekConfig", + "operationId": "UpdateWorkweekConfig", + "description": "Updates a `WorkweekConfig`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_WRITE", + "TIMECARDS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `WorkweekConfig` object being updated.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkweekConfigRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkweekConfigResponse" + } + } + } + } + } + } + }, + "/v2/locations": { + "get": { + "tags": [ + "Locations" + ], + "summary": "ListLocations", + "operationId": "ListLocations", + "description": "Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api),\nincluding those with an inactive status. Locations are listed alphabetically by `name`.", + "x-release-status": "PUBLIC", + "x-unitTests": [ + { + "expectedResponse": { + "headers": {}, + "statusCode": "200", + "x-allowExtraHeaders": true, + "x-arrayCheckCount": false, + "x-arrayOrderedMatching": false, + "x-bodyMatchMode": "NONE", + "x-matchResponseSchema": true + }, + "request": { + "method": "GET", + "uri": "/v2/locations" + }, + "x-testEnabled": true, + "x-testName": "ListLocations", + "x-testShouldPass": true + } + ], + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLocationsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Locations" + ], + "summary": "CreateLocation", + "operationId": "CreateLocation", + "description": "Creates a [location](https://developer.squareup.com/docs/locations-api).\nCreating new locations allows for separate configuration of receipt layouts, item prices,\nand sales reports. Developers can use locations to separate sales activity through applications\nthat integrate with Square from sales activity elsewhere in a seller's account.\nLocations created programmatically with the Locations API last forever and\nare visible to the seller for their own management. Therefore, ensure that\neach location has a sensible and unique name.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLocationRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLocationResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + } + ] + } + }, + "/v2/locations/custom-attribute-definitions": { + "get": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "ListLocationCustomAttributeDefinitions", + "operationId": "ListLocationCustomAttributeDefinitions", + "description": "Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.\nWhen all response pages are retrieved, the results include all custom attribute definitions\nthat are visible to the requesting application, including those that are created by other\napplications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "visibility_filter", + "description": "Filters the `CustomAttributeDefinition` results by their `visibility` values.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLocationCustomAttributeDefinitionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "CreateLocationCustomAttributeDefinition", + "operationId": "CreateLocationCustomAttributeDefinition", + "description": "Creates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\nUse this endpoint to define a custom attribute that can be associated with locations.\nA custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties\nfor a custom attribute. After the definition is created, you can call\n[UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) or\n[BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes)\nto set the custom attribute for locations.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLocationCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLocationCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/locations/custom-attribute-definitions/{key}": { + "delete": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "DeleteLocationCustomAttributeDefinition", + "operationId": "DeleteLocationCustomAttributeDefinition", + "description": "Deletes a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\nDeleting a custom attribute definition also deletes the corresponding custom attribute from\nall locations.\nOnly the definition owner can delete a custom attribute definition.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteLocationCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "RetrieveLocationCustomAttributeDefinition", + "operationId": "RetrieveLocationCustomAttributeDefinition", + "description": "Retrieves a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\nTo retrieve a custom attribute definition created by another application, the `visibility`\nsetting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to retrieve. If the requesting application\nis not the definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The current version of the custom attribute definition, which is used for strongly consistent\nreads to guarantee that you receive the most up-to-date data. When included in the request,\nSquare returns the specified version or a higher version if one exists. If the specified version\nis higher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLocationCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "UpdateLocationCustomAttributeDefinition", + "operationId": "UpdateLocationCustomAttributeDefinition", + "description": "Updates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\nUse this endpoint to update the following fields: `name`, `description`, `visibility`, or the\n`schema` for a `Selection` data type.\nOnly the definition owner can update a custom attribute definition.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/locations/custom-attributes/bulk-delete": { + "post": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "BulkDeleteLocationCustomAttributes", + "operationId": "BulkDeleteLocationCustomAttributes", + "description": "Deletes [custom attributes](entity:CustomAttribute) for locations as a bulk operation.\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteLocationCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteLocationCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/locations/custom-attributes/bulk-upsert": { + "post": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "BulkUpsertLocationCustomAttributes", + "operationId": "BulkUpsertLocationCustomAttributes", + "description": "Creates or updates [custom attributes](entity:CustomAttribute) for locations as a bulk operation.\nUse this endpoint to set the value of one or more custom attributes for one or more locations.\nA custom attribute is based on a custom attribute definition in a Square seller account, which is\ncreated using the [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) endpoint.\nThis `BulkUpsertLocationCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert\nrequests and returns a map of individual upsert responses. Each upsert request has a unique ID\nand provides a location ID and custom attribute. Each upsert response is returned with the ID\nof the corresponding request.\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertLocationCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertLocationCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/locations/{location_id}": { + "get": { + "tags": [ + "Locations" + ], + "summary": "RetrieveLocation", + "operationId": "RetrieveLocation", + "description": "Retrieves details of a single location. Specify \"main\"\nas the location ID to retrieve details of the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to retrieve. Specify the string\n\"main\" to return the main location.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLocationResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + }, + "put": { + "tags": [ + "Locations" + ], + "summary": "UpdateLocation", + "operationId": "UpdateLocation", + "description": "Updates a [location](https://developer.squareup.com/docs/locations-api).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + } + ] + } + }, + "/v2/locations/{location_id}/checkouts": { + "post": { + "tags": [ + "Checkout" + ], + "summary": "CreateCheckout", + "operationId": "CreateCheckout", + "description": "Links a `checkoutId` to a `checkout_page_url` that customers are\ndirected to in order to provide their payment information using a\npayment processing workflow hosted on connect.squareup.com. \n\n\nNOTE: The Checkout API has been updated with new features. \nFor more information, see [Checkout API highlights](https://developer.squareup.com/docs/checkout-api#checkout-api-highlights).", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2022-08-17", + "retirementDate": "TBD", + "replacedBy": "CreatePaymentLink", + "guideUrl": "https://developer.squareup.com/docs/migrate-from-v1/guides/v1-checkout" + }, + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE", + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the business location to associate the checkout with.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCheckoutRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCheckoutResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "AMOUNT_TOO_HIGH" + }, + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "ORDER_EXPIRED" + } + ] + } + }, + "/v2/locations/{location_id}/custom-attributes": { + "get": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "ListLocationCustomAttributes", + "operationId": "ListLocationCustomAttributes", + "description": "Lists the [custom attributes](entity:CustomAttribute) associated with a location.\nYou can use the `with_definitions` query parameter to also retrieve custom attribute definitions\nin the same call.\nWhen all response pages are retrieved, the results include all custom attributes that are\nvisible to the requesting application, including those that are owned by other applications\nand set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the target [location](entity:Location).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "visibility_filter", + "description": "Filters the `CustomAttributeDefinition` results by their `visibility` values.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request. For more\ninformation, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "with_definitions", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLocationCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/locations/{location_id}/custom-attributes/{key}": { + "delete": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "DeleteLocationCustomAttribute", + "operationId": "DeleteLocationCustomAttribute", + "description": "Deletes a [custom attribute](entity:CustomAttribute) associated with a location.\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the target [location](entity:Location).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to delete. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteLocationCustomAttributeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "RetrieveLocationCustomAttribute", + "operationId": "RetrieveLocationCustomAttribute", + "description": "Retrieves a [custom attribute](entity:CustomAttribute) associated with a location.\nYou can use the `with_definition` query parameter to also retrieve the custom attribute definition\nin the same call.\nTo retrieve a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the target [location](entity:Location).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to retrieve. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "with_definition", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of\nthe custom attribute. Set this parameter to `true` to get the name and description of the custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "version", + "description": "The current version of the custom attribute, which is used for strongly consistent reads to\nguarantee that you receive the most up-to-date data. When included in the request, Square\nreturns the specified version or a higher version if one exists. If the specified version is\nhigher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLocationCustomAttributeResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "UpsertLocationCustomAttribute", + "operationId": "UpsertLocationCustomAttribute", + "description": "Creates or updates a [custom attribute](entity:CustomAttribute) for a location.\nUse this endpoint to set the value of a custom attribute for a specified location.\nA custom attribute is based on a custom attribute definition in a Square seller account, which\nis created using the [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) endpoint.\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the target [location](entity:Location).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to create or update. This key must match the `key` of a\ncustom attribute definition in the Square seller account. If the requesting application is not\nthe definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertLocationCustomAttributeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertLocationCustomAttributeResponse" + } + } + } + } + } + } + }, + "/v2/locations/{location_id}/transactions": { + "get": { + "tags": [ + "Transactions" + ], + "summary": "ListTransactions", + "operationId": "ListTransactions", + "description": "Lists transactions for a particular location.\n\nTransactions include payment information from sales and exchanges and refund\ninformation from returns and exchanges.\n\nMax results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2019-08-15", + "retirementDate": "TBD", + "replacedBy": "SearchOrders", + "guideUrl": "https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api" + }, + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to list transactions for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "begin_time", + "description": "The beginning of the requested reporting period, in RFC 3339 format.\n\nSee [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.\n\nDefault value: The current time minus one year.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "The end of the requested reporting period, in RFC 3339 format.\n\nSee [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.\n\nDefault value: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which results are listed in the response (`ASC` for\noldest first, `DESC` for newest first).\n\nDefault value: `DESC`", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for your original query.\n\nSee [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTransactionsResponse" + } + } + } + } + } + } + }, + "/v2/locations/{location_id}/transactions/{transaction_id}": { + "get": { + "tags": [ + "Transactions" + ], + "summary": "RetrieveTransaction", + "operationId": "RetrieveTransaction", + "description": "Retrieves details for a single transaction.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2019-08-15", + "retirementDate": "TBD", + "replacedBy": "BatchRetrieveOrders", + "guideUrl": "https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api" + }, + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the transaction's associated location.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "transaction_id", + "description": "The ID of the transaction to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTransactionResponse" + } + } + } + } + } + } + }, + "/v2/locations/{location_id}/transactions/{transaction_id}/capture": { + "post": { + "tags": [ + "Transactions" + ], + "summary": "CaptureTransaction", + "operationId": "CaptureTransaction", + "description": "Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge)\nendpoint with a `delay_capture` value of `true`.\n\n\nSee [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture)\nfor more information.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2019-08-15", + "retirementDate": "TBD", + "replacedBy": "CompletePayment", + "guideUrl": "https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api" + }, + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "transaction_id", + "description": "", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CaptureTransactionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "DELAYED_TRANSACTION_CANCELED" + }, + { + "error-code": "DELAYED_TRANSACTION_EXPIRED" + } + ] + } + }, + "/v2/locations/{location_id}/transactions/{transaction_id}/void": { + "post": { + "tags": [ + "Transactions" + ], + "summary": "VoidTransaction", + "operationId": "VoidTransaction", + "description": "Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge)\nendpoint with a `delay_capture` value of `true`.\n\n\nSee [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture)\nfor more information.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2019-08-15", + "retirementDate": "TBD", + "replacedBy": "CancelPayment", + "guideUrl": "https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api" + }, + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "transaction_id", + "description": "", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VoidTransactionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "DELAYED_TRANSACTION_CAPTURED" + }, + { + "error-code": "DELAYED_TRANSACTION_EXPIRED" + } + ] + } + }, + "/v2/loyalty/accounts": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "CreateLoyaltyAccount", + "operationId": "CreateLoyaltyAccount", + "description": "Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and a `mapping` with the `phone_number` of the buyer.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyAccountRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyAccountResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_PHONE_NUMBER" + } + ] + } + }, + "/v2/loyalty/accounts/search": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "SearchLoyaltyAccounts", + "operationId": "SearchLoyaltyAccounts", + "description": "Searches for loyalty accounts in a loyalty program.\n\nYou can search for a loyalty account using the phone number or customer ID associated with the account. To return all loyalty accounts, specify an empty `query` object or omit it entirely.\n\nSearch results are sorted by `created_at` in ascending order.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyAccountsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyAccountsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/accounts/{account_id}": { + "get": { + "tags": [ + "Loyalty" + ], + "summary": "RetrieveLoyaltyAccount", + "operationId": "RetrieveLoyaltyAccount", + "description": "Retrieves a loyalty account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "account_id", + "description": "The ID of the [loyalty account](entity:LoyaltyAccount) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLoyaltyAccountResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/accounts/{account_id}/accumulate": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "AccumulateLoyaltyPoints", + "operationId": "AccumulateLoyaltyPoints", + "description": "Adds points earned from a purchase to a [loyalty account](entity:LoyaltyAccount).\n\n- If you are using the Orders API to manage orders, provide the `order_id`. Square reads the order\nto compute the points earned from both the base loyalty program and an associated\n[loyalty promotion](entity:LoyaltyPromotion). For purchases that qualify for multiple accrual\nrules, Square computes points based on the accrual rule that grants the most points.\nFor purchases that qualify for multiple promotions, Square computes points based on the most\nrecently created promotion. A purchase must first qualify for program points to be eligible for promotion points.\n\n- If you are not using the Orders API to manage orders, provide `points` with the number of points to add.\nYou must first perform a client-side computation of the points earned from the loyalty program and\nloyalty promotion. For spend-based and visit-based programs, you can call [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints)\nto compute the points earned from the base loyalty program. For information about computing points earned from a loyalty promotion, see\n[Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "account_id", + "description": "The ID of the target [loyalty account](entity:LoyaltyAccount).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccumulateLoyaltyPointsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccumulateLoyaltyPointsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/accounts/{account_id}/adjust": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "AdjustLoyaltyPoints", + "operationId": "AdjustLoyaltyPoints", + "description": "Adds points to or subtracts points from a buyer's account.\n\nUse this endpoint only when you need to manually adjust points. Otherwise, in your application flow, you call\n[AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints)\nto add points when a buyer pays for the purchase.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "account_id", + "description": "The ID of the target [loyalty account](entity:LoyaltyAccount).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdjustLoyaltyPointsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdjustLoyaltyPointsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/events/search": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "SearchLoyaltyEvents", + "operationId": "SearchLoyaltyEvents", + "description": "Searches for loyalty events.\n\nA Square loyalty program maintains a ledger of events that occur during the lifetime of a\nbuyer's loyalty account. Each change in the point balance\n(for example, points earned, points redeemed, and points expired) is\nrecorded in the ledger. Using this endpoint, you can search the ledger for events.\n\nSearch results are sorted by `created_at` in descending order.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyEventsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyEventsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/programs": { + "get": { + "tags": [ + "Loyalty" + ], + "summary": "ListLoyaltyPrograms", + "operationId": "ListLoyaltyPrograms", + "description": "Returns a list of loyalty programs in the seller's account.\nLoyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview).\n\n\nReplaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) when used with the keyword `main`.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-05-13", + "replacedBy": "RetrieveLoyaltyProgram", + "guideUrl": "https://developer.squareup.com/docs/loyalty-api/overview#migration-notes" + }, + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLoyaltyProgramsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "UNSUPPORTED_LOYALTY_REWARD_TIER" + } + ] + } + }, + "/v2/loyalty/programs/{program_id}": { + "get": { + "tags": [ + "Loyalty" + ], + "summary": "RetrieveLoyaltyProgram", + "operationId": "RetrieveLoyaltyProgram", + "description": "Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword `main`.\n\nLoyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "program_id", + "description": "The ID of the loyalty program or the keyword `main`. Either value can be used to retrieve the single loyalty program that belongs to the seller.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLoyaltyProgramResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "UNSUPPORTED_LOYALTY_REWARD_TIER" + } + ] + } + }, + "/v2/loyalty/programs/{program_id}/calculate": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "CalculateLoyaltyPoints", + "operationId": "CalculateLoyaltyPoints", + "description": "Calculates the number of points a buyer can earn from a purchase. Applications might call this endpoint\nto display the points to the buyer.\n\n- If you are using the Orders API to manage orders, provide the `order_id` and (optional) `loyalty_account_id`.\nSquare reads the order to compute the points earned from the base loyalty program and an associated\n[loyalty promotion](entity:LoyaltyPromotion).\n\n- If you are not using the Orders API to manage orders, provide `transaction_amount_money` with the\npurchase amount. Square uses this amount to calculate the points earned from the base loyalty program,\nbut not points earned from a loyalty promotion. For spend-based and visit-based programs, the `tax_mode`\nsetting of the accrual rule indicates how taxes should be treated for loyalty points accrual.\nIf the purchase qualifies for program points, call\n[ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) and perform a client-side computation\nto calculate whether the purchase also qualifies for promotion points. For more information, see\n[Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "program_id", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram), which defines the rules for accruing points.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculateLoyaltyPointsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculateLoyaltyPointsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/programs/{program_id}/promotions": { + "get": { + "tags": [ + "Loyalty" + ], + "summary": "ListLoyaltyPromotions", + "operationId": "ListLoyaltyPromotions", + "description": "Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram).\nResults are sorted by the `created_at` date in descending order (newest to oldest).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "program_id", + "description": "The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID,\ncall [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "status", + "description": "The status to filter the results by. If a status is provided, only loyalty promotions\nwith the specified status are returned. Otherwise, all loyalty promotions associated with\nthe loyalty program are returned.", + "schema": { + "$ref": "#/components/schemas/LoyaltyPromotionStatus" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response.\nThe minimum value is 1 and the maximum value is 30. The default value is 30.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLoyaltyPromotionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Loyalty" + ], + "summary": "CreateLoyaltyPromotion", + "operationId": "CreateLoyaltyPromotion", + "description": "Creates a loyalty promotion for a [loyalty program](entity:LoyaltyProgram). A loyalty promotion\nenables buyers to earn points in addition to those earned from the base loyalty program.\n\nThis endpoint sets the loyalty promotion to the `ACTIVE` or `SCHEDULED` status, depending on the\n`available_time` setting. A loyalty program can have a maximum of 10 loyalty promotions with an\n`ACTIVE` or `SCHEDULED` status.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "program_id", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram) to associate with the promotion.\nTo get the program ID, call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram)\nusing the `main` keyword.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyPromotionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyPromotionResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/programs/{program_id}/promotions/{promotion_id}": { + "get": { + "tags": [ + "Loyalty" + ], + "summary": "RetrieveLoyaltyPromotion", + "operationId": "RetrieveLoyaltyPromotion", + "description": "Retrieves a loyalty promotion.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "promotion_id", + "description": "The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "program_id", + "description": "The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID,\ncall [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLoyaltyPromotionResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/programs/{program_id}/promotions/{promotion_id}/cancel": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "CancelLoyaltyPromotion", + "operationId": "CancelLoyaltyPromotion", + "description": "Cancels a loyalty promotion. Use this endpoint to cancel an `ACTIVE` promotion earlier than the\nend date, cancel an `ACTIVE` promotion when an end date is not specified, or cancel a `SCHEDULED` promotion.\nBecause updating a promotion is not supported, you can also use this endpoint to cancel a promotion before\nyou create a new one.\n\nThis endpoint sets the loyalty promotion to the `CANCELED` state", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "promotion_id", + "description": "The ID of the [loyalty promotion](entity:LoyaltyPromotion) to cancel. You can cancel a\npromotion that has an `ACTIVE` or `SCHEDULED` status.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "program_id", + "description": "The ID of the base [loyalty program](entity:LoyaltyProgram).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelLoyaltyPromotionResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/rewards": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "CreateLoyaltyReward", + "operationId": "CreateLoyaltyReward", + "description": "Creates a loyalty reward. In the process, the endpoint does following:\n\n- Uses the `reward_tier_id` in the request to determine the number of points\nto lock for this reward.\n- If the request includes `order_id`, it adds the reward and related discount to the order.\n\nAfter a reward is created, the points are locked and\nnot available for the buyer to redeem another reward.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyRewardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyRewardResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/rewards/search": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "SearchLoyaltyRewards", + "operationId": "SearchLoyaltyRewards", + "description": "Searches for loyalty rewards. This endpoint accepts a request with no query filters and returns results for all loyalty accounts.\nIf you include a `query` object, `loyalty_account_id` is required and `status` is optional.\n\nIf you know a reward ID, use the\n[RetrieveLoyaltyReward](api-endpoint:Loyalty-RetrieveLoyaltyReward) endpoint.\n\nSearch results are sorted by `updated_at` in descending order.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyRewardsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyRewardsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/rewards/{reward_id}": { + "delete": { + "tags": [ + "Loyalty" + ], + "summary": "DeleteLoyaltyReward", + "operationId": "DeleteLoyaltyReward", + "description": "Deletes a loyalty reward by doing the following:\n\n- Returns the loyalty points back to the loyalty account.\n- If an order ID was specified when the reward was created\n(see [CreateLoyaltyReward](api-endpoint:Loyalty-CreateLoyaltyReward)),\nit updates the order by removing the reward and related\ndiscounts.\n\nYou cannot delete a reward that has reached the terminal state (REDEEMED).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "reward_id", + "description": "The ID of the [loyalty reward](entity:LoyaltyReward) to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteLoyaltyRewardResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Loyalty" + ], + "summary": "RetrieveLoyaltyReward", + "operationId": "RetrieveLoyaltyReward", + "description": "Retrieves a loyalty reward.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "reward_id", + "description": "The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLoyaltyRewardResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/rewards/{reward_id}/redeem": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "RedeemLoyaltyReward", + "operationId": "RedeemLoyaltyReward", + "description": "Redeems a loyalty reward.\n\nThe endpoint sets the reward to the `REDEEMED` terminal state.\n\nIf you are using your own order processing system (not using the\nOrders API), you call this endpoint after the buyer paid for the\npurchase.\n\nAfter the reward reaches the terminal state, it cannot be deleted.\nIn other words, points used for the reward cannot be returned\nto the account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "reward_id", + "description": "The ID of the [loyalty reward](entity:LoyaltyReward) to redeem.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RedeemLoyaltyRewardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RedeemLoyaltyRewardResponse" + } + } + } + } + } + } + }, + "/v2/merchants": { + "get": { + "tags": [ + "Merchants" + ], + "summary": "ListMerchants", + "operationId": "ListMerchants", + "description": "Provides details about the merchant associated with a given access token.\n\nThe access token used to connect your application to a Square seller is associated\nwith a single merchant. That means that `ListMerchants` returns a list\nwith a single `Merchant` object. You can specify your personal access token\nto get your own merchant information or specify an OAuth token to get the\ninformation for the merchant that granted your application access.\n\nIf you know the merchant ID, you can also use the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant)\nendpoint to retrieve the merchant information.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "The cursor generated by the previous response.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMerchantsResponse" + } + } + } + } + } + } + }, + "/v2/merchants/custom-attribute-definitions": { + "get": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "ListMerchantCustomAttributeDefinitions", + "operationId": "ListMerchantCustomAttributeDefinitions", + "description": "Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.\nWhen all response pages are retrieved, the results include all custom attribute definitions\nthat are visible to the requesting application, including those that are created by other\napplications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "visibility_filter", + "description": "Filters the `CustomAttributeDefinition` results by their `visibility` values.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMerchantCustomAttributeDefinitionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "CreateMerchantCustomAttributeDefinition", + "operationId": "CreateMerchantCustomAttributeDefinition", + "description": "Creates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\nUse this endpoint to define a custom attribute that can be associated with a merchant connecting to your application.\nA custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties\nfor a custom attribute. After the definition is created, you can call\n[UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) or\n[BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes)\nto set the custom attribute for a merchant.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMerchantCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMerchantCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/merchants/custom-attribute-definitions/{key}": { + "delete": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "DeleteMerchantCustomAttributeDefinition", + "operationId": "DeleteMerchantCustomAttributeDefinition", + "description": "Deletes a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\nDeleting a custom attribute definition also deletes the corresponding custom attribute from\nthe merchant.\nOnly the definition owner can delete a custom attribute definition.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteMerchantCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "RetrieveMerchantCustomAttributeDefinition", + "operationId": "RetrieveMerchantCustomAttributeDefinition", + "description": "Retrieves a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\nTo retrieve a custom attribute definition created by another application, the `visibility`\nsetting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to retrieve. If the requesting application\nis not the definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The current version of the custom attribute definition, which is used for strongly consistent\nreads to guarantee that you receive the most up-to-date data. When included in the request,\nSquare returns the specified version or a higher version if one exists. If the specified version\nis higher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveMerchantCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "UpdateMerchantCustomAttributeDefinition", + "operationId": "UpdateMerchantCustomAttributeDefinition", + "description": "Updates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\nUse this endpoint to update the following fields: `name`, `description`, `visibility`, or the\n`schema` for a `Selection` data type.\nOnly the definition owner can update a custom attribute definition.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMerchantCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMerchantCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/merchants/custom-attributes/bulk-delete": { + "post": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "BulkDeleteMerchantCustomAttributes", + "operationId": "BulkDeleteMerchantCustomAttributes", + "description": "Deletes [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation.\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteMerchantCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteMerchantCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/merchants/custom-attributes/bulk-upsert": { + "post": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "BulkUpsertMerchantCustomAttributes", + "operationId": "BulkUpsertMerchantCustomAttributes", + "description": "Creates or updates [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation.\nUse this endpoint to set the value of one or more custom attributes for a merchant.\nA custom attribute is based on a custom attribute definition in a Square seller account, which is\ncreated using the [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) endpoint.\nThis `BulkUpsertMerchantCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert\nrequests and returns a map of individual upsert responses. Each upsert request has a unique ID\nand provides a merchant ID and custom attribute. Each upsert response is returned with the ID\nof the corresponding request.\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertMerchantCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertMerchantCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/merchants/{merchant_id}": { + "get": { + "tags": [ + "Merchants" + ], + "summary": "RetrieveMerchant", + "operationId": "RetrieveMerchant", + "description": "Retrieves the `Merchant` object for the given `merchant_id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "merchant_id", + "description": "The ID of the merchant to retrieve. If the string \"me\" is supplied as the ID,\nthen retrieve the merchant that is currently accessible to this call.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveMerchantResponse" + } + } + } + } + } + } + }, + "/v2/merchants/{merchant_id}/custom-attributes": { + "get": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "ListMerchantCustomAttributes", + "operationId": "ListMerchantCustomAttributes", + "description": "Lists the [custom attributes](entity:CustomAttribute) associated with a merchant.\nYou can use the `with_definitions` query parameter to also retrieve custom attribute definitions\nin the same call.\nWhen all response pages are retrieved, the results include all custom attributes that are\nvisible to the requesting application, including those that are owned by other applications\nand set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "merchant_id", + "description": "The ID of the target [merchant](entity:Merchant).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "visibility_filter", + "description": "Filters the `CustomAttributeDefinition` results by their `visibility` values.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request. For more\ninformation, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "with_definitions", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMerchantCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/merchants/{merchant_id}/custom-attributes/{key}": { + "delete": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "DeleteMerchantCustomAttribute", + "operationId": "DeleteMerchantCustomAttribute", + "description": "Deletes a [custom attribute](entity:CustomAttribute) associated with a merchant.\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "merchant_id", + "description": "The ID of the target [merchant](entity:Merchant).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to delete. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteMerchantCustomAttributeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "RetrieveMerchantCustomAttribute", + "operationId": "RetrieveMerchantCustomAttribute", + "description": "Retrieves a [custom attribute](entity:CustomAttribute) associated with a merchant.\nYou can use the `with_definition` query parameter to also retrieve the custom attribute definition\nin the same call.\nTo retrieve a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "merchant_id", + "description": "The ID of the target [merchant](entity:Merchant).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to retrieve. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "with_definition", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of\nthe custom attribute. Set this parameter to `true` to get the name and description of the custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "version", + "description": "The current version of the custom attribute, which is used for strongly consistent reads to\nguarantee that you receive the most up-to-date data. When included in the request, Square\nreturns the specified version or a higher version if one exists. If the specified version is\nhigher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveMerchantCustomAttributeResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "UpsertMerchantCustomAttribute", + "operationId": "UpsertMerchantCustomAttribute", + "description": "Creates or updates a [custom attribute](entity:CustomAttribute) for a merchant.\nUse this endpoint to set the value of a custom attribute for a specified merchant.\nA custom attribute is based on a custom attribute definition in a Square seller account, which\nis created using the [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) endpoint.\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "merchant_id", + "description": "The ID of the target [merchant](entity:Merchant).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to create or update. This key must match the `key` of a\ncustom attribute definition in the Square seller account. If the requesting application is not\nthe definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertMerchantCustomAttributeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertMerchantCustomAttributeResponse" + } + } + } + } + } + } + }, + "/v2/online-checkout/location-settings/{location_id}": { + "get": { + "tags": [ + "Checkout" + ], + "summary": "RetrieveLocationSettings", + "operationId": "RetrieveLocationSettings", + "description": "Retrieves the location-level settings for a Square-hosted checkout page.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location for which to retrieve settings.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLocationSettingsResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Checkout" + ], + "summary": "UpdateLocationSettings", + "operationId": "UpdateLocationSettings", + "description": "Updates the location-level settings for a Square-hosted checkout page.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE", + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location for which to retrieve settings.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationSettingsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationSettingsResponse" + } + } + } + } + } + } + }, + "/v2/online-checkout/merchant-settings": { + "get": { + "tags": [ + "Checkout" + ], + "summary": "RetrieveMerchantSettings", + "operationId": "RetrieveMerchantSettings", + "description": "Retrieves the merchant-level settings for a Square-hosted checkout page.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENT_METHODS_READ", + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveMerchantSettingsResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Checkout" + ], + "summary": "UpdateMerchantSettings", + "operationId": "UpdateMerchantSettings", + "description": "Updates the merchant-level settings for a Square-hosted checkout page.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE", + "PAYMENT_METHODS_READ", + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMerchantSettingsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMerchantSettingsResponse" + } + } + } + } + } + } + }, + "/v2/online-checkout/payment-links": { + "get": { + "tags": [ + "Checkout" + ], + "summary": "ListPaymentLinks", + "operationId": "ListPaymentLinks", + "description": "Lists all payment links.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nIf a cursor is not provided, the endpoint returns the first page of the results.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "A limit on the number of results to return per page. The limit is advisory and\nthe implementation might return more or less results. If the supplied limit is negative, zero, or\ngreater than the maximum limit of 1000, it is ignored.\n\nDefault value: `100`", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPaymentLinksResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Checkout" + ], + "summary": "CreatePaymentLink", + "operationId": "CreatePaymentLink", + "description": "Creates a Square-hosted checkout page. Applications can share the resulting payment link with their buyer to pay for goods and services.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE", + "ORDERS_READ", + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePaymentLinkRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePaymentLinkResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_PHONE_NUMBER" + }, + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "MISSING_REQUIRED_PARAMETER" + }, + { + "error-code": "CONFLICTING_PARAMETERS" + } + ] + } + }, + "/v2/online-checkout/payment-links/{id}": { + "delete": { + "tags": [ + "Checkout" + ], + "summary": "DeletePaymentLink", + "operationId": "DeletePaymentLink", + "description": "Deletes a payment link.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ", + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the payment link to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletePaymentLinkResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Checkout" + ], + "summary": "RetrievePaymentLink", + "operationId": "RetrievePaymentLink", + "description": "Retrieves a payment link.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of link to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrievePaymentLinkResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Checkout" + ], + "summary": "UpdatePaymentLink", + "operationId": "UpdatePaymentLink", + "description": "Updates a payment link. You can update the `payment_link` fields such as\n`description`, `checkout_options`, and `pre_populated_data`.\nYou cannot update other fields such as the `order_id`, `version`, `URL`, or `timestamp` field.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE", + "ORDERS_READ", + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the payment link to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePaymentLinkRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePaymentLinkResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_PHONE_NUMBER" + }, + { + "error-code": "INVALID_EMAIL_ADDRESS" + } + ] + } + }, + "/v2/orders": { + "post": { + "tags": [ + "Orders" + ], + "summary": "CreateOrder", + "operationId": "CreateOrder", + "description": "Creates a new [order](entity:Order) that can include information about products for\npurchase and settings to apply to the purchase.\n\nTo pay for a created order, see\n[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders).\n\nYou can modify open orders using the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderResponse" + } + } + } + } + } + } + }, + "/v2/orders/batch-retrieve": { + "post": { + "tags": [ + "Orders" + ], + "summary": "BatchRetrieveOrders", + "operationId": "BatchRetrieveOrders", + "description": "Retrieves a set of [orders](entity:Order) by their IDs.\n\nIf a given order ID does not exist, the ID is ignored instead of generating an error.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveOrdersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveOrdersResponse" + } + } + } + } + } + } + }, + "/v2/orders/calculate": { + "post": { + "tags": [ + "Orders" + ], + "summary": "CalculateOrder", + "operationId": "CalculateOrder", + "description": "Enables applications to preview order pricing without creating an order.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculateOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculateOrderResponse" + } + } + } + } + } + } + }, + "/v2/orders/clone": { + "post": { + "tags": [ + "Orders" + ], + "summary": "CloneOrder", + "operationId": "CloneOrder", + "description": "Creates a new order, in the `DRAFT` state, by duplicating an existing order. The newly created order has\nonly the core fields (such as line items, taxes, and discounts) copied from the original order.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloneOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloneOrderResponse" + } + } + } + } + } + } + }, + "/v2/orders/custom-attribute-definitions": { + "get": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "ListOrderCustomAttributeDefinitions", + "operationId": "ListOrderCustomAttributeDefinitions", + "description": "Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.\n\nWhen all response pages are retrieved, the results include all custom attribute definitions\nthat are visible to the requesting application, including those that are created by other\napplications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that\nseller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "visibility_filter", + "description": "Requests that all of the custom attributes be returned, or only those that are read-only or read-write.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint. \nProvide this cursor to retrieve the next page of results for your original request. \nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory. \nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. \nThe default value is 20.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrderCustomAttributeDefinitionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "CreateOrderCustomAttributeDefinition", + "operationId": "CreateOrderCustomAttributeDefinition", + "description": "Creates an order-related custom attribute definition. Use this endpoint to\ndefine a custom attribute that can be associated with orders.\n\nAfter creating a custom attribute definition, you can set the custom attribute for orders\nin the Square seller account.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/orders/custom-attribute-definitions/{key}": { + "delete": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "DeleteOrderCustomAttributeDefinition", + "operationId": "DeleteOrderCustomAttributeDefinition", + "description": "Deletes an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\n\nOnly the definition owner can delete a custom attribute definition.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteOrderCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "RetrieveOrderCustomAttributeDefinition", + "operationId": "RetrieveOrderCustomAttributeDefinition", + "description": "Retrieves an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\n\nTo retrieve a custom attribute definition created by another application, the `visibility`\nsetting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, include this optional field and specify the current version of the custom attribute.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveOrderCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "UpdateOrderCustomAttributeDefinition", + "operationId": "UpdateOrderCustomAttributeDefinition", + "description": "Updates an order-related custom attribute definition for a Square seller account.\n\nOnly the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/orders/custom-attributes/bulk-delete": { + "post": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "BulkDeleteOrderCustomAttributes", + "operationId": "BulkDeleteOrderCustomAttributes", + "description": "Deletes order [custom attributes](entity:CustomAttribute) as a bulk operation.\n\nUse this endpoint to delete one or more custom attributes from one or more orders.\nA custom attribute is based on a custom attribute definition in a Square seller account. (To create a\ncustom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.)\n\nThis `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual delete\nrequests and returns a map of individual delete responses. Each delete request has a unique ID\nand provides an order ID and custom attribute. Each delete response is returned with the ID\nof the corresponding request.\n\nTo delete a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteOrderCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteOrderCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/orders/custom-attributes/bulk-upsert": { + "post": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "BulkUpsertOrderCustomAttributes", + "operationId": "BulkUpsertOrderCustomAttributes", + "description": "Creates or updates order [custom attributes](entity:CustomAttribute) as a bulk operation.\n\nUse this endpoint to delete one or more custom attributes from one or more orders.\nA custom attribute is based on a custom attribute definition in a Square seller account. (To create a\ncustom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.)\n\nThis `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert\nrequests and returns a map of individual upsert responses. Each upsert request has a unique ID\nand provides an order ID and custom attribute. Each upsert response is returned with the ID\nof the corresponding request.\n\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertOrderCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertOrderCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/orders/search": { + "post": { + "tags": [ + "Orders" + ], + "summary": "SearchOrders", + "operationId": "SearchOrders", + "description": "Search all orders for one or more locations. Orders include all sales,\nreturns, and exchanges regardless of how or when they entered the Square\necosystem (such as Point of Sale, Invoices, and Connect APIs).\n\n`SearchOrders` requests need to specify which locations to search and define a\n[SearchOrdersQuery](entity:SearchOrdersQuery) object that controls\nhow to sort or filter the results. Your `SearchOrdersQuery` can:\n\n Set filter criteria.\n Set the sort order.\n Determine whether to return results as complete `Order` objects or as\n[OrderEntry](entity:OrderEntry) objects.\n\nNote that details for orders processed with Square Point of Sale while in\noffline mode might not be transmitted to Square for up to 72 hours. Offline\norders have a `created_at` value that reflects the time the order was created,\nnot the time it was subsequently transmitted to Square.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchOrdersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchOrdersResponse" + } + } + } + } + } + } + }, + "/v2/orders/{order_id}": { + "get": { + "tags": [ + "Orders" + ], + "summary": "RetrieveOrder", + "operationId": "RetrieveOrder", + "description": "Retrieves an [Order](entity:Order) by ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the order to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveOrderResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Orders" + ], + "summary": "UpdateOrder", + "operationId": "UpdateOrder", + "description": "Updates an open [order](entity:Order) by adding, replacing, or deleting\nfields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated.\n\nAn `UpdateOrder` request requires the following:\n\n- The `order_id` in the endpoint path, identifying the order to update.\n- The latest `version` of the order to update.\n- The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects)\ncontaining only the fields to update and the version to which the update is\nbeing applied.\n- If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete)\nidentifying the fields to clear.\n\nTo pay for an order, see\n[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders).", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the order to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderResponse" + } + } + } + } + } + } + }, + "/v2/orders/{order_id}/custom-attributes": { + "get": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "ListOrderCustomAttributes", + "operationId": "ListOrderCustomAttributes", + "description": "Lists the [custom attributes](entity:CustomAttribute) associated with an order.\n\nYou can use the `with_definitions` query parameter to also retrieve custom attribute definitions\nin the same call.\n\nWhen all response pages are retrieved, the results include all custom attributes that are\nvisible to the requesting application, including those that are owned by other applications\nand set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the target [order](entity:Order).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "visibility_filter", + "description": "Requests that all of the custom attributes be returned, or only those that are read-only or read-write.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint. \nProvide this cursor to retrieve the next page of results for your original request. \nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory. \nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. \nThe default value is 20.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "with_definitions", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom attribute, \ninformation about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrderCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/orders/{order_id}/custom-attributes/{custom_attribute_key}": { + "delete": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "DeleteOrderCustomAttribute", + "operationId": "DeleteOrderCustomAttribute", + "description": "Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile.\n\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the target [order](entity:Order).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "custom_attribute_key", + "description": "The key of the custom attribute to delete. This key must match the key of an\nexisting custom attribute definition.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteOrderCustomAttributeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "RetrieveOrderCustomAttribute", + "operationId": "RetrieveOrderCustomAttribute", + "description": "Retrieves a [custom attribute](entity:CustomAttribute) associated with an order.\n\nYou can use the `with_definition` query parameter to also retrieve the custom attribute definition\nin the same call.\n\nTo retrieve a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\nalso known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the target [order](entity:Order).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "custom_attribute_key", + "description": "The key of the custom attribute to retrieve. This key must match the key of an\nexisting custom attribute definition.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, include this optional field and specify the current version of the custom attribute.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "with_definition", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each \ncustom attribute. Set this parameter to `true` to get the name and description of each custom attribute, \ninformation about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveOrderCustomAttributeResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "UpsertOrderCustomAttribute", + "operationId": "UpsertOrderCustomAttribute", + "description": "Creates or updates a [custom attribute](entity:CustomAttribute) for an order.\n\nUse this endpoint to set the value of a custom attribute for a specific order.\nA custom attribute is based on a custom attribute definition in a Square seller account. (To create a\ncustom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.)\n\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the target [order](entity:Order).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "custom_attribute_key", + "description": "The key of the custom attribute to create or update. This key must match the key \nof an existing custom attribute definition.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertOrderCustomAttributeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertOrderCustomAttributeResponse" + } + } + } + } + } + } + }, + "/v2/orders/{order_id}/pay": { + "post": { + "tags": [ + "Orders" + ], + "summary": "PayOrder", + "operationId": "PayOrder", + "description": "Pay for an [order](entity:Order) using one or more approved [payments](entity:Payment)\nor settle an order with a total of `0`.\n\nThe total of the `payment_ids` listed in the request must be equal to the order\ntotal. Orders with a total amount of `0` can be marked as paid by specifying an empty\narray of `payment_ids` in the request.\n\nTo be used with `PayOrder`, a payment must:\n\n- Reference the order by specifying the `order_id` when [creating the payment](api-endpoint:Payments-CreatePayment).\nAny approved payments that reference the same `order_id` not specified in the\n`payment_ids` is canceled.\n- Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture).\nUsing a delayed capture payment with `PayOrder` completes the approved payment.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE", + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the order being paid.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayOrderResponse" + } + } + } + } + } + } + }, + "/v2/payments": { + "get": { + "tags": [ + "Payments" + ], + "summary": "ListPayments", + "operationId": "ListPayments", + "description": "Retrieves a list of payments taken by the account making the request.\n\nResults are eventually consistent, and new payments or changes to payments might take several\nseconds to appear.\n\nThe maximum results per page is 100.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "begin_time", + "description": "Indicates the start of the time range to retrieve payments for, in RFC 3339 format. \nThe range is determined using the `created_at` field for each Payment.\nInclusive. Default: The current time minus one year.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The \nrange is determined using the `created_at` field for each Payment.\n\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which results are listed by `ListPaymentsRequest.sort_field`:\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "Limit results to the location supplied. By default, results are returned\nfor the default (main) location associated with the seller.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "total", + "description": "The exact amount in the `total_money` for a payment.", + "schema": { + "type": "integer", + "format": "int64" + }, + "in": "query", + "required": false + }, + { + "name": "last_4", + "description": "The last four digits of a payment card.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "card_brand", + "description": "The brand of the payment card (for example, VISA).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to be returned in a single page.\nIt is possible to receive fewer results than the specified limit on a given page.\n\nThe default value of 100 is also the maximum allowed value. If the provided value is \ngreater than 100, it is ignored and the default value is used instead.\n\nDefault: `100`", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "is_offline_payment", + "description": "Whether the payment was taken offline or not.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "offline_begin_time", + "description": "Indicates the start of the time range for which to retrieve offline payments, in RFC 3339\nformat for timestamps. The range is determined using the\n`offline_payment_details.client_created_at` field for each Payment. If set, payments without a\nvalue set in `offline_payment_details.client_created_at` will not be returned.\n\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "offline_end_time", + "description": "Indicates the end of the time range for which to retrieve offline payments, in RFC 3339\nformat for timestamps. The range is determined using the\n`offline_payment_details.client_created_at` field for each Payment. If set, payments without a\nvalue set in `offline_payment_details.client_created_at` will not be returned.\n\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "updated_at_begin_time", + "description": "Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The\nrange is determined using the `updated_at` field for each Payment.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "updated_at_end_time", + "description": "Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The\nrange is determined using the `updated_at` field for each Payment.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_field", + "description": "The field used to sort results by. The default is `CREATED_AT`.", + "schema": { + "$ref": "#/components/schemas/ListPaymentsRequestSortField" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPaymentsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Payments" + ], + "summary": "CreatePayment", + "operationId": "CreatePayment", + "description": "Creates a payment using the provided source. You can use this endpoint \nto charge a card (credit/debit card or \nSquare gift card) or record a payment that the seller received outside of Square \n(cash payment from a buyer or a payment that an external entity \nprocessed on behalf of the seller).\n\nThe endpoint creates a \n`Payment` object and returns it in the response.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePaymentRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePaymentResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "ADDRESS_VERIFICATION_FAILURE" + }, + { + "error-code": "ALLOWABLE_PIN_TRIES_EXCEEDED" + }, + { + "error-code": "APPLE_TTP_PIN_TOKEN" + }, + { + "error-code": "BAD_EXPIRATION" + }, + { + "error-code": "CARDHOLDER_INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "CARD_DECLINED_VERIFICATION_REQUIRED" + }, + { + "error-code": "CARD_EXPIRED" + }, + { + "error-code": "CARD_NOT_SUPPORTED" + }, + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CARD_TOKEN_EXPIRED" + }, + { + "error-code": "CARD_TOKEN_USED" + }, + { + "error-code": "CHIP_INSERTION_REQUIRED" + }, + { + "error-code": "CVV_FAILURE" + }, + { + "error-code": "EXPIRATION_FAILURE" + }, + { + "error-code": "GENERIC_DECLINE" + }, + { + "error-code": "GIFT_CARD_AVAILABLE_AMOUNT" + }, + { + "error-code": "INSUFFICIENT_FUNDS" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "INVALID_ACCOUNT" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "INVALID_CARD_DATA" + }, + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "INVALID_EXPIRATION" + }, + { + "error-code": "INVALID_FEES" + }, + { + "error-code": "INVALID_LOCATION" + }, + { + "error-code": "INVALID_PHONE_NUMBER" + }, + { + "error-code": "INVALID_PIN" + }, + { + "error-code": "INVALID_POSTAL_CODE" + }, + { + "error-code": "ISSUER_INSTALLMENT_ERROR" + }, + { + "error-code": "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED" + }, + { + "error-code": "PAN_FAILURE" + }, + { + "error-code": "PAYMENT_AMOUNT_MISMATCH" + }, + { + "error-code": "PAYMENT_LIMIT_EXCEEDED" + }, + { + "error-code": "TEMPORARY_ERROR" + }, + { + "error-code": "TRANSACTION_LIMIT" + }, + { + "error-code": "VOICE_FAILURE" + } + ] + } + }, + "/v2/payments/cancel": { + "post": { + "tags": [ + "Payments" + ], + "summary": "CancelPaymentByIdempotencyKey", + "operationId": "CancelPaymentByIdempotencyKey", + "description": "Cancels (voids) a payment identified by the idempotency key that is specified in the\nrequest.\n\nUse this method when the status of a `CreatePayment` request is unknown (for example, after you send a\n`CreatePayment` request, a network error occurs and you do not get a response). In this case, you can\ndirect Square to cancel the payment using this endpoint. In the request, you provide the same\nidempotency key that you provided in your `CreatePayment` request that you want to cancel. After\ncanceling the payment, you can submit your `CreatePayment` request again.\n\nNote that if no payment with the specified idempotency key is found, no action is taken and the endpoint\nreturns successfully.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelPaymentByIdempotencyKeyRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelPaymentByIdempotencyKeyResponse" + } + } + } + } + } + } + }, + "/v2/payments/{payment_id}": { + "get": { + "tags": [ + "Payments" + ], + "summary": "GetPayment", + "operationId": "GetPayment", + "description": "Retrieves details for a specific payment.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "payment_id", + "description": "A unique ID for the desired payment.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPaymentResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Payments" + ], + "summary": "UpdatePayment", + "operationId": "UpdatePayment", + "description": "Updates a payment with the APPROVED status.\nYou can update the `amount_money` and `tip_money` using this endpoint.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "payment_id", + "description": "The ID of the payment to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePaymentRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePaymentResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "AMOUNT_TOO_HIGH" + }, + { + "error-code": "CARDHOLDER_INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "CARD_DECLINED_VERIFICATION_REQUIRED" + }, + { + "error-code": "CARD_EXPIRED" + }, + { + "error-code": "CHIP_INSERTION_REQUIRED" + }, + { + "error-code": "CVV_FAILURE" + }, + { + "error-code": "GENERIC_DECLINE" + }, + { + "error-code": "INSUFFICIENT_FUNDS" + }, + { + "error-code": "INVALID_ACCOUNT" + }, + { + "error-code": "INVALID_FEES" + }, + { + "error-code": "PAN_FAILURE" + }, + { + "error-code": "PAYMENT_LIMIT_EXCEEDED" + }, + { + "error-code": "TEMPORARY_ERROR" + }, + { + "error-code": "TRANSACTION_LIMIT" + }, + { + "error-code": "VOICE_FAILURE" + } + ] + } + }, + "/v2/payments/{payment_id}/cancel": { + "post": { + "tags": [ + "Payments" + ], + "summary": "CancelPayment", + "operationId": "CancelPayment", + "description": "Cancels (voids) a payment. You can use this endpoint to cancel a payment with \nthe APPROVED `status`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "payment_id", + "description": "The ID of the payment to cancel.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelPaymentResponse" + } + } + } + } + } + } + }, + "/v2/payments/{payment_id}/complete": { + "post": { + "tags": [ + "Payments" + ], + "summary": "CompletePayment", + "operationId": "CompletePayment", + "description": "Completes (captures) a payment.\nBy default, payments are set to complete immediately after they are created.\n\nYou can use this endpoint to complete a payment with the APPROVED `status`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "payment_id", + "description": "The unique ID identifying the payment to be completed.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompletePaymentRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompletePaymentResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "VERSION_MISMATCH" + } + ] + } + }, + "/v2/payouts": { + "get": { + "tags": [ + "Payouts" + ], + "summary": "ListPayouts", + "operationId": "ListPayouts", + "description": "Retrieves a list of all payouts for the default location.\nYou can filter payouts by location ID, status, time range, and order them in ascending or descending order.\nTo call this endpoint, set `PAYOUTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location for which to list the payouts.\nBy default, payouts are returned for the default (main) location associated with the seller.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "status", + "description": "If provided, only payouts with the given status are returned.", + "schema": { + "$ref": "#/components/schemas/PayoutStatus" + }, + "in": "query", + "required": false + }, + { + "name": "begin_time", + "description": "The timestamp for the beginning of the payout creation time, in RFC 3339 format.\nInclusive. Default: The current time minus one year.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "The timestamp for the end of the payout creation time, in RFC 3339 format.\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which payouts are listed.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).\nIf request parameters change between requests, subsequent results may contain duplicates or missing records.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to be returned in a single page.\nIt is possible to receive fewer results than the specified limit on a given page.\nThe default value of 100 is also the maximum allowed value. If the provided value is\ngreater than 100, it is ignored and the default value is used instead.\nDefault: `100`", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPayoutsResponse" + } + } + } + } + } + } + }, + "/v2/payouts/{payout_id}": { + "get": { + "tags": [ + "Payouts" + ], + "summary": "GetPayout", + "operationId": "GetPayout", + "description": "Retrieves details of a specific payout identified by a payout ID.\nTo call this endpoint, set `PAYOUTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "payout_id", + "description": "The ID of the payout to retrieve the information for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPayoutResponse" + } + } + } + } + } + } + }, + "/v2/payouts/{payout_id}/payout-entries": { + "get": { + "tags": [ + "Payouts" + ], + "summary": "ListPayoutEntries", + "operationId": "ListPayoutEntries", + "description": "Retrieves a list of all payout entries for a specific payout.\nTo call this endpoint, set `PAYOUTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "payout_id", + "description": "The ID of the payout to retrieve the information for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "sort_order", + "description": "The order in which payout entries are listed.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).\nIf request parameters change between requests, subsequent results may contain duplicates or missing records.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to be returned in a single page.\nIt is possible to receive fewer results than the specified limit on a given page.\nThe default value of 100 is also the maximum allowed value. If the provided value is\ngreater than 100, it is ignored and the default value is used instead.\nDefault: `100`", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPayoutEntriesResponse" + } + } + } + } + } + } + }, + "/v2/refunds": { + "get": { + "tags": [ + "Refunds" + ], + "summary": "ListPaymentRefunds", + "operationId": "ListPaymentRefunds", + "description": "Retrieves a list of refunds for the account making the request.\n\nResults are eventually consistent, and new refunds or changes to refunds might take several\nseconds to appear.\n\nThe maximum results per page is 100.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "begin_time", + "description": "Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339 \nformat. The range is determined using the `created_at` field for each `PaymentRefund`. \n\nDefault: The current time minus one year.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339 \nformat. The range is determined using the `created_at` field for each `PaymentRefund`.\n\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which results are listed by `PaymentRefund.created_at`:\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "Limit results to the location supplied. By default, results are returned\nfor all locations associated with the seller.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "status", + "description": "If provided, only refunds with the given status are returned.\nFor a list of refund status values, see [PaymentRefund](entity:PaymentRefund).\n\nDefault: If omitted, refunds are returned regardless of their status.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "source_type", + "description": "If provided, only returns refunds whose payments have the indicated source type.\nCurrent values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`.\nFor information about these payment source types, see\n[Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).\n\nDefault: If omitted, refunds are returned regardless of the source type.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to be returned in a single page.\n\nIt is possible to receive fewer results than the specified limit on a given page.\n\nIf the supplied value is greater than 100, no more than 100 results are returned.\n\nDefault: 100", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "updated_at_begin_time", + "description": "Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339\nformat. The range is determined using the `updated_at` field for each `PaymentRefund`.\n\nDefault: If omitted, the time range starts at `begin_time`.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "updated_at_end_time", + "description": "Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339\nformat. The range is determined using the `updated_at` field for each `PaymentRefund`.\n\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_field", + "description": "The field used to sort results by. The default is `CREATED_AT`.", + "schema": { + "$ref": "#/components/schemas/ListPaymentRefundsRequestSortField" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPaymentRefundsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Refunds" + ], + "summary": "RefundPayment", + "operationId": "RefundPayment", + "description": "Refunds a payment. You can refund the entire payment amount or a\nportion of it. You can use this endpoint to refund a card payment or record a \nrefund of a cash or external payment. For more information, see\n[Refund Payment](https://developer.squareup.com/docs/payments-api/refund-payments).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RefundPaymentRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RefundPaymentResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_MISMATCH" + }, + { + "error-code": "CARD_PRESENCE_REQUIRED" + }, + { + "error-code": "CARD_TOKEN_USED" + }, + { + "error-code": "GENERIC_DECLINE" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS_FOR_REFUND" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "INVALID_CARD_DATA" + }, + { + "error-code": "INVALID_FEES" + }, + { + "error-code": "PAYMENT_NOT_REFUNDABLE" + }, + { + "error-code": "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE" + }, + { + "error-code": "REFUND_AMOUNT_INVALID" + }, + { + "error-code": "REFUND_DECLINED" + }, + { + "error-code": "REFUND_ERROR_PAYMENT_NEEDS_COMPLETION" + }, + { + "error-code": "UNSUPPORTED_CARD_BRAND" + }, + { + "error-code": "UNSUPPORTED_COUNTRY" + }, + { + "error-code": "UNSUPPORTED_CURRENCY" + }, + { + "error-code": "UNSUPPORTED_INSTRUMENT_TYPE" + }, + { + "error-code": "UNSUPPORTED_SOURCE_TYPE" + }, + { + "error-code": "VALUE_TOO_HIGH" + }, + { + "error-code": "VERSION_MISMATCH" + } + ] + } + }, + "/v2/refunds/{refund_id}": { + "get": { + "tags": [ + "Refunds" + ], + "summary": "GetPaymentRefund", + "operationId": "GetPaymentRefund", + "description": "Retrieves a specific refund using the `refund_id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "refund_id", + "description": "The unique ID for the desired `PaymentRefund`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPaymentRefundResponse" + } + } + } + } + } + } + }, + "/v2/sites": { + "get": { + "tags": [ + "Sites" + ], + "summary": "ListSites", + "operationId": "ListSites", + "description": "Lists the Square Online sites that belong to a seller. Sites are listed in descending order by the `created_at` date.\n\n\n__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ONLINE_STORE_SITE_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListSitesResponse" + } + } + } + } + } + } + }, + "/v2/sites/{site_id}/snippet": { + "delete": { + "tags": [ + "Snippets" + ], + "summary": "DeleteSnippet", + "operationId": "DeleteSnippet", + "description": "Removes your snippet from a Square Online site.\n\nYou can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller.\n\n\n__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ONLINE_STORE_SNIPPETS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "site_id", + "description": "The ID of the site that contains the snippet.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteSnippetResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Snippets" + ], + "summary": "RetrieveSnippet", + "operationId": "RetrieveSnippet", + "description": "Retrieves your snippet from a Square Online site. A site can contain snippets from multiple snippet applications, but you can retrieve only the snippet that was added by your application.\n\nYou can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller.\n\n\n__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ONLINE_STORE_SNIPPETS_READ" + ] + } + ], + "parameters": [ + { + "name": "site_id", + "description": "The ID of the site that contains the snippet.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveSnippetResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Snippets" + ], + "summary": "UpsertSnippet", + "operationId": "UpsertSnippet", + "description": "Adds a snippet to a Square Online site or updates the existing snippet on the site. \nThe snippet code is appended to the end of the `head` element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site. \n\nYou can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller.\n\n\n__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ONLINE_STORE_SNIPPETS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "site_id", + "description": "The ID of the site where you want to add or update the snippet.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertSnippetRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertSnippetResponse" + } + } + } + } + } + } + }, + "/v2/subscriptions": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "CreateSubscription", + "operationId": "CreateSubscription", + "description": "Enrolls a customer in a subscription.\n\nIf you provide a card on file in the request, Square charges the card for\nthe subscription. Otherwise, Square sends an invoice to the customer's email\naddress. The subscription starts immediately, unless the request includes\nthe optional `start_date`. Each individual subscription is associated with a particular location.\n\nFor more information, see [Create a subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ", + "PAYMENTS_WRITE", + "SUBSCRIPTIONS_WRITE", + "ITEMS_READ", + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSubscriptionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_MISSING_EMAIL" + }, + { + "error-code": "CUSTOMER_MISSING_NAME" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "INVALID_DATE" + } + ] + } + }, + "/v2/subscriptions/bulk-swap-plan": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "BulkSwapPlan", + "operationId": "BulkSwapPlan", + "description": "Schedules a plan variation change for all active subscriptions under a given plan\nvariation. For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations).", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_WRITE", + "SUBSCRIPTIONS_READ", + "ITEMS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkSwapPlanRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkSwapPlanResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + } + ] + } + }, + "/v2/subscriptions/search": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "SearchSubscriptions", + "operationId": "SearchSubscriptions", + "description": "Searches for subscriptions.\n\nResults are ordered chronologically by subscription creation date. If\nthe request specifies more than one location ID,\nthe endpoint orders the result\nby location ID, and then by creation date within each location. If no locations are given\nin the query, all locations are searched.\n\nYou can also optionally specify `customer_ids` to search by customer.\nIf left unset, all customers\nassociated with the specified locations are returned.\nIf the request specifies customer IDs, the endpoint orders results\nfirst by location, within location by customer ID, and within\ncustomer by subscription creation date.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchSubscriptionsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchSubscriptionsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CUSTOMER_NOT_FOUND" + } + ] + } + }, + "/v2/subscriptions/{subscription_id}": { + "get": { + "tags": [ + "Subscriptions" + ], + "summary": "RetrieveSubscription", + "operationId": "RetrieveSubscription", + "description": "Retrieves a specific subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_READ" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "include", + "description": "A query parameter to specify related information to be included in the response. \n\nThe supported query parameter values are: \n\n- `actions`: to include scheduled actions on the targeted subscription.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveSubscriptionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Subscriptions" + ], + "summary": "UpdateSubscription", + "operationId": "UpdateSubscription", + "description": "Updates a subscription by modifying or clearing `subscription` field values.\nTo clear a field, set its value to `null`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ", + "PAYMENTS_WRITE", + "SUBSCRIPTIONS_WRITE", + "ITEMS_READ", + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriptionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CUSTOMER_NOT_FOUND" + }, + { + "error-code": "INVALID_CARD" + } + ] + } + }, + "/v2/subscriptions/{subscription_id}/actions/{action_id}": { + "delete": { + "tags": [ + "Subscriptions" + ], + "summary": "DeleteSubscriptionAction", + "operationId": "DeleteSubscriptionAction", + "description": "Deletes a scheduled action for a subscription.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription the targeted action is to act upon.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "action_id", + "description": "The ID of the targeted action to be deleted.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteSubscriptionActionResponse" + } + } + } + } + } + } + }, + "/v2/subscriptions/{subscription_id}/billing-anchor": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "ChangeBillingAnchorDate", + "operationId": "ChangeBillingAnchorDate", + "description": "Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates)\nfor a subscription.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_WRITE", + "SUBSCRIPTIONS_READ", + "ITEMS_READ" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to update the billing anchor date.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangeBillingAnchorDateRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangeBillingAnchorDateResponse" + } + } + } + } + } + } + }, + "/v2/subscriptions/{subscription_id}/cancel": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "CancelSubscription", + "operationId": "CancelSubscription", + "description": "Schedules a `CANCEL` action to cancel an active subscription. This \nsets the `canceled_date` field to the end of the active billing period. After this date, \nthe subscription status changes from ACTIVE to CANCELED.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to cancel.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelSubscriptionResponse" + } + } + } + } + } + } + }, + "/v2/subscriptions/{subscription_id}/events": { + "get": { + "tags": [ + "Subscriptions" + ], + "summary": "ListSubscriptionEvents", + "operationId": "ListSubscriptionEvents", + "description": "Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_READ" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to retrieve the events for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "cursor", + "description": "When the total number of resulting subscription events exceeds the limit of a paged response, \nspecify the cursor returned from a preceding response here to fetch the next set of results.\nIf the cursor is unset, the response contains the last page of the results.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The upper limit on the number of subscription events to return\nin a paged response.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListSubscriptionEventsResponse" + } + } + } + } + } + } + }, + "/v2/subscriptions/{subscription_id}/pause": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "PauseSubscription", + "operationId": "PauseSubscription", + "description": "Schedules a `PAUSE` action to pause an active subscription.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ", + "PAYMENTS_WRITE", + "SUBSCRIPTIONS_WRITE", + "ITEMS_READ", + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to pause.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PauseSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PauseSubscriptionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + }, + { + "error-code": "INVALID_PAUSE_LENGTH" + }, + { + "error-code": "INVALID_DATE" + } + ] + } + }, + "/v2/subscriptions/{subscription_id}/resume": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "ResumeSubscription", + "operationId": "ResumeSubscription", + "description": "Schedules a `RESUME` action to resume a paused or a deactivated subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ", + "PAYMENTS_WRITE", + "SUBSCRIPTIONS_WRITE", + "ITEMS_READ", + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to resume.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResumeSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResumeSubscriptionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_MISSING_EMAIL" + }, + { + "error-code": "CUSTOMER_MISSING_NAME" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "INVALID_DATE" + } + ] + } + }, + "/v2/subscriptions/{subscription_id}/swap-plan": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "SwapPlan", + "operationId": "SwapPlan", + "description": "Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. \nFor more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations).", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ", + "PAYMENTS_WRITE", + "SUBSCRIPTIONS_WRITE", + "ITEMS_READ", + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to swap the subscription plan for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwapPlanRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwapPlanResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + } + ] + } + }, + "/v2/team-members": { + "post": { + "tags": [ + "Team" + ], + "summary": "CreateTeamMember", + "operationId": "CreateTeamMember", + "description": "Creates a single `TeamMember` object. The `TeamMember` object is returned on successful creates.\nYou must provide the following values in your request to this endpoint:\n- `given_name`\n- `family_name`\n\nLearn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#createteammember).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTeamMemberRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTeamMemberResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "FORBIDDEN" + } + ] + } + }, + "/v2/team-members/bulk-create": { + "post": { + "tags": [ + "Team" + ], + "summary": "BulkCreateTeamMembers", + "operationId": "BulkCreateTeamMembers", + "description": "Creates multiple `TeamMember` objects. The created `TeamMember` objects are returned on successful creates.\nThis process is non-transactional and processes as much of the request as possible. If one of the creates in\nthe request cannot be successfully processed, the request is not marked as failed, but the body of the response\ncontains explicit error information for the failed create.\n\nLearn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateTeamMembersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateTeamMembersResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "FORBIDDEN" + } + ] + } + }, + "/v2/team-members/bulk-update": { + "post": { + "tags": [ + "Team" + ], + "summary": "BulkUpdateTeamMembers", + "operationId": "BulkUpdateTeamMembers", + "description": "Updates multiple `TeamMember` objects. The updated `TeamMember` objects are returned on successful updates.\nThis process is non-transactional and processes as much of the request as possible. If one of the updates in\nthe request cannot be successfully processed, the request is not marked as failed, but the body of the response\ncontains explicit error information for the failed update.\nLearn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateTeamMembersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateTeamMembersResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "FORBIDDEN" + } + ] + } + }, + "/v2/team-members/jobs": { + "get": { + "tags": [ + "Team" + ], + "summary": "ListJobs", + "operationId": "ListJobs", + "description": "Lists jobs in a seller account. Results are sorted by title in ascending order.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "The pagination cursor returned by the previous call to this endpoint. Provide this\ncursor to retrieve the next page of results for your original request. For more information,\nsee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListJobsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Team" + ], + "summary": "CreateJob", + "operationId": "CreateJob", + "description": "Creates a job in a seller account. A job defines a title and tip eligibility. Note that\ncompensation is defined in a [job assignment](entity:JobAssignment) in a team member's wage setting.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateJobRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateJobResponse" + } + } + } + } + } + } + }, + "/v2/team-members/jobs/{job_id}": { + "get": { + "tags": [ + "Team" + ], + "summary": "RetrieveJob", + "operationId": "RetrieveJob", + "description": "Retrieves a specified job.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "job_id", + "description": "The ID of the job to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveJobResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Team" + ], + "summary": "UpdateJob", + "operationId": "UpdateJob", + "description": "Updates the title or tip eligibility of a job. Changes to the title propagate to all\n`JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to\ntip eligibility propagate to all `TeamMemberWage` objects that reference the job ID.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "job_id", + "description": "The ID of the job to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateJobRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateJobResponse" + } + } + } + } + } + } + }, + "/v2/team-members/search": { + "post": { + "tags": [ + "Team" + ], + "summary": "SearchTeamMembers", + "operationId": "SearchTeamMembers", + "description": "Returns a paginated list of `TeamMember` objects for a business. \nThe list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether\nthe team member is the Square account owner.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTeamMembersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTeamMembersResponse" + } + } + } + } + } + } + }, + "/v2/team-members/{team_member_id}": { + "get": { + "tags": [ + "Team" + ], + "summary": "RetrieveTeamMember", + "operationId": "RetrieveTeamMember", + "description": "Retrieves a `TeamMember` object for the given `TeamMember.id`.\nLearn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "The ID of the team member to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTeamMemberResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Team" + ], + "summary": "UpdateTeamMember", + "operationId": "UpdateTeamMember", + "description": "Updates a single `TeamMember` object. The `TeamMember` object is returned on successful updates.\nLearn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "The ID of the team member to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTeamMemberRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTeamMemberResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "FORBIDDEN" + } + ] + } + }, + "/v2/team-members/{team_member_id}/wage-setting": { + "get": { + "tags": [ + "Team" + ], + "summary": "RetrieveWageSetting", + "operationId": "RetrieveWageSetting", + "description": "Retrieves a `WageSetting` object for a team member specified\nby `TeamMember.id`. For more information, see\n[Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting).\n\nSquare recommends using [RetrieveTeamMember](api-endpoint:Team-RetrieveTeamMember) or [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers)\nto get this information directly from the `TeamMember.wage_setting` field.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "The ID of the team member for which to retrieve the wage setting.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveWageSettingResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Team" + ], + "summary": "UpdateWageSetting", + "operationId": "UpdateWageSetting", + "description": "Creates or updates a `WageSetting` object. The object is created if a\n`WageSetting` with the specified `team_member_id` doesn't exist. Otherwise,\nit fully replaces the `WageSetting` object for the team member.\nThe `WageSetting` is returned on a successful update. For more information, see\n[Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting).\n\nSquare recommends using [CreateTeamMember](api-endpoint:Team-CreateTeamMember) or [UpdateTeamMember](api-endpoint:Team-UpdateTeamMember)\nto manage the `TeamMember.wage_setting` field directly.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "The ID of the team member for which to update the `WageSetting` object.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWageSettingRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWageSettingResponse" + } + } + } + } + } + } + }, + "/v2/terminals/actions": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CreateTerminalAction", + "operationId": "CreateTerminalAction", + "description": "Creates a Terminal action request and sends it to the specified device.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalActionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalActionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "IDEMPOTENCY_KEY_REUSED" + }, + { + "error-code": "INVALID_LOCATION" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "UNAUTHORIZED" + } + ] + } + }, + "/v2/terminals/actions/search": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "SearchTerminalActions", + "operationId": "SearchTerminalActions", + "description": "Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalActionsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalActionsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_CURSOR" + }, + { + "error-code": "UNKNOWN_QUERY_PARAMETER" + } + ] + } + }, + "/v2/terminals/actions/{action_id}": { + "get": { + "tags": [ + "Terminal" + ], + "summary": "GetTerminalAction", + "operationId": "GetTerminalAction", + "description": "Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 days.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "action_id", + "description": "Unique ID for the desired `TerminalAction`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTerminalActionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/terminals/actions/{action_id}/cancel": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CancelTerminalAction", + "operationId": "CancelTerminalAction", + "description": "Cancels a Terminal action request if the status of the request permits it.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "action_id", + "description": "Unique ID for the desired `TerminalAction`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelTerminalActionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "TEMPORARY_ERROR" + } + ] + } + }, + "/v2/terminals/actions/{action_id}/dismiss": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "DismissTerminalAction", + "operationId": "DismissTerminalAction", + "description": "Dismisses a Terminal action request if the status and type of the request permits it.\n\nSee [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "action_id", + "description": "Unique ID for the `TerminalAction` associated with the action to be dismissed.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DismissTerminalActionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/terminals/checkouts": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CreateTerminalCheckout", + "operationId": "CreateTerminalCheckout", + "description": "Creates a Terminal checkout request and sends it to the specified device to take a payment\nfor the requested amount.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalCheckoutRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalCheckoutResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "IDEMPOTENCY_KEY_REUSED" + }, + { + "error-code": "INVALID_FEES" + }, + { + "error-code": "INVALID_LOCATION" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "UNAUTHORIZED" + } + ] + } + }, + "/v2/terminals/checkouts/search": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "SearchTerminalCheckouts", + "operationId": "SearchTerminalCheckouts", + "description": "Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalCheckoutsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalCheckoutsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_CURSOR" + }, + { + "error-code": "UNKNOWN_QUERY_PARAMETER" + } + ] + } + }, + "/v2/terminals/checkouts/{checkout_id}": { + "get": { + "tags": [ + "Terminal" + ], + "summary": "GetTerminalCheckout", + "operationId": "GetTerminalCheckout", + "description": "Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "checkout_id", + "description": "The unique ID for the desired `TerminalCheckout`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTerminalCheckoutResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/terminals/checkouts/{checkout_id}/cancel": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CancelTerminalCheckout", + "operationId": "CancelTerminalCheckout", + "description": "Cancels a Terminal checkout request if the status of the request permits it.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "checkout_id", + "description": "The unique ID for the desired `TerminalCheckout`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelTerminalCheckoutResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/terminals/checkouts/{checkout_id}/dismiss": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "DismissTerminalCheckout", + "operationId": "DismissTerminalCheckout", + "description": "Dismisses a Terminal checkout request if the status and type of the request permits it.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "checkout_id", + "description": "Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DismissTerminalCheckoutResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/terminals/refunds": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CreateTerminalRefund", + "operationId": "CreateTerminalRefund", + "description": "Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](api:Refunds).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalRefundRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalRefundResponse" + } + } + } + } + } + } + }, + "/v2/terminals/refunds/search": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "SearchTerminalRefunds", + "operationId": "SearchTerminalRefunds", + "description": "Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalRefundsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalRefundsResponse" + } + } + } + } + } + } + }, + "/v2/terminals/refunds/{terminal_refund_id}": { + "get": { + "tags": [ + "Terminal" + ], + "summary": "GetTerminalRefund", + "operationId": "GetTerminalRefund", + "description": "Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "terminal_refund_id", + "description": "The unique ID for the desired `TerminalRefund`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTerminalRefundResponse" + } + } + } + } + } + } + }, + "/v2/terminals/refunds/{terminal_refund_id}/cancel": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CancelTerminalRefund", + "operationId": "CancelTerminalRefund", + "description": "Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "terminal_refund_id", + "description": "The unique ID for the desired `TerminalRefund`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelTerminalRefundResponse" + } + } + } + } + } + } + }, + "/v2/terminals/refunds/{terminal_refund_id}/dismiss": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "DismissTerminalRefund", + "operationId": "DismissTerminalRefund", + "description": "Dismisses a Terminal refund request if the status and type of the request permits it.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "terminal_refund_id", + "description": "Unique ID for the `TerminalRefund` associated with the refund to be dismissed.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DismissTerminalRefundResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/vendors/bulk-create": { + "post": { + "tags": [ + "Vendors" + ], + "summary": "BulkCreateVendors", + "operationId": "BulkCreateVendors", + "description": "Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a seller.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateVendorsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateVendorsResponse" + } + } + } + } + } + } + }, + "/v2/vendors/bulk-retrieve": { + "post": { + "tags": [ + "Vendors" + ], + "summary": "BulkRetrieveVendors", + "operationId": "BulkRetrieveVendors", + "description": "Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveVendorsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveVendorsResponse" + } + } + } + } + } + } + }, + "/v2/vendors/bulk-update": { + "put": { + "tags": [ + "Vendors" + ], + "summary": "BulkUpdateVendors", + "operationId": "BulkUpdateVendors", + "description": "Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers to a seller.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateVendorsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateVendorsResponse" + } + } + } + } + } + } + }, + "/v2/vendors/create": { + "post": { + "tags": [ + "Vendors" + ], + "summary": "CreateVendor", + "operationId": "CreateVendor", + "description": "Creates a single [Vendor](entity:Vendor) object to represent a supplier to a seller.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateVendorRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateVendorResponse" + } + } + } + } + } + } + }, + "/v2/vendors/search": { + "post": { + "tags": [ + "Vendors" + ], + "summary": "SearchVendors", + "operationId": "SearchVendors", + "description": "Searches for vendors using a filter against supported [Vendor](entity:Vendor) properties and a supported sorter.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchVendorsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchVendorsResponse" + } + } + } + } + } + } + }, + "/v2/vendors/{vendor_id}": { + "get": { + "tags": [ + "Vendors" + ], + "summary": "RetrieveVendor", + "operationId": "RetrieveVendor", + "description": "Retrieves the vendor of a specified [Vendor](entity:Vendor) ID.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_READ" + ] + } + ], + "parameters": [ + { + "name": "vendor_id", + "description": "ID of the [Vendor](entity:Vendor) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveVendorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Vendors" + ], + "summary": "UpdateVendor", + "operationId": "UpdateVendor", + "description": "Updates an existing [Vendor](entity:Vendor) object as a supplier to a seller.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateVendorRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateVendorResponse" + } + } + } + } + } + } + }, + "/v2/webhooks/event-types": { + "get": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "ListWebhookEventTypes", + "operationId": "ListWebhookEventTypes", + "description": "Lists all webhook event types that can be subscribed to.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "api_version", + "description": "The API version for which to list event types. Setting this field overrides the default version used by the application.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWebhookEventTypesResponse" + } + } + } + } + } + } + }, + "/v2/webhooks/subscriptions": { + "get": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "ListWebhookSubscriptions", + "operationId": "ListWebhookSubscriptions", + "description": "Lists all webhook subscriptions owned by your application.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "include_disabled", + "description": "Includes disabled [Subscription](entity:WebhookSubscription)s.\nBy default, all enabled [Subscription](entity:WebhookSubscription)s are returned.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "Sorts the returned list by when the [Subscription](entity:WebhookSubscription) was created with the specified order.\nThis field defaults to ASC.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to be returned in a single page.\nIt is possible to receive fewer results than the specified limit on a given page.\nThe default value of 100 is also the maximum allowed value.\n\nDefault: 100", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWebhookSubscriptionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "CreateWebhookSubscription", + "operationId": "CreateWebhookSubscription", + "description": "Creates a webhook subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWebhookSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWebhookSubscriptionResponse" + } + } + } + } + } + } + }, + "/v2/webhooks/subscriptions/{subscription_id}": { + "delete": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "DeleteWebhookSubscription", + "operationId": "DeleteWebhookSubscription", + "description": "Deletes a webhook subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "[REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteWebhookSubscriptionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "RetrieveWebhookSubscription", + "operationId": "RetrieveWebhookSubscription", + "description": "Retrieves a webhook subscription identified by its ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "[REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveWebhookSubscriptionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "UpdateWebhookSubscription", + "operationId": "UpdateWebhookSubscription", + "description": "Updates a webhook subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "[REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWebhookSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWebhookSubscriptionResponse" + } + } + } + } + } + } + }, + "/v2/webhooks/subscriptions/{subscription_id}/signature-key": { + "post": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "UpdateWebhookSubscriptionSignatureKey", + "operationId": "UpdateWebhookSubscriptionSignatureKey", + "description": "Updates a webhook subscription by replacing the existing signature key with a new one.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "[REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWebhookSubscriptionSignatureKeyRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWebhookSubscriptionSignatureKeyResponse" + } + } + } + } + } + } + }, + "/v2/webhooks/subscriptions/{subscription_id}/test": { + "post": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "TestWebhookSubscription", + "operationId": "TestWebhookSubscription", + "description": "Tests a webhook subscription by sending a test event to the notification URL.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "[REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to test.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestWebhookSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestWebhookSubscriptionResponse" + } + } + } + } + } + } + } + }, + "x-fern-global-headers": [ + { + "header": "Square-Version", + "name": "version", + "optional": true, + "env": "VERSION", + "type": "literal\u003c\"2025-07-16\"\u003e" + } + ] +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index ce31cac6d..000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,1056 +0,0 @@ -# Change Log - -For general API and SDK changelogs, see [Square APIs and SDKs Release Notes](https://developer.squareup.com/docs/changelog/connect). - -## Version 20.0.0.20220512 (2022-05-12) - -- Dropped support for Ruby versions less than 2.7 - -## Version 19.0.0.202204020 (2022-04-20) - -- Increased range of supported Faraday versions - -## Version 17.0.0.20211215 (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.1.20211117 (2021-11-29) - -## SDKs - -- **Square Ruby SDK:** - - fix the issue to support Ruby `3.0.0`. - -## Version 16.0.0.20211117 (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.20211020 (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.20210915 (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.20210818 (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.20210721 (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.20210616 (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.20210513 (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.20210421 (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. - -## Version 9.1.1.20210317 (2021-04-01) - -## SDKs - -- **Square Ruby SDK:** - - Added support for Ruby 3.0.0. - -## Version 9.1.0.20210317 (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.20210226 (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 - SquareLegacy::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.0.20210121 (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.20201216 (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.20201118 (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. - -## Version 6.5.0.20201028 (2020-10-28T00:00) - -## Existing API updates - -- **Terminal API.** New endpoints to enable sellers in Canada refund Interac payments. - - - New endpoints: - - - [CreateTerminalRefund](https://developer.squareup.com/reference/square_2020-10-28/terminal-api/create-terminal-refund) - - [GetTerminalRefund](https://developer.squareup.com/reference/square_2020-10-28/terminal-api/get-terminal-refund) - - [CancelTerminalRefund](https://developer.squareup.com/reference/square_2020-10-28/terminal-api/cancel-terminal-refund) - - [SearchTerminalRefunds](https://developer.squareup.com/reference/square_2020-10-28/terminal-api/search-terminal-refunds) - - - New webhooks: - - - `terminal.refund.created`. Notification of a new Terminal refund request. - - `terminal.refund.updated`. Notification that a Terminal refund request state is changed. - - - New topic [Refund Interac Payments.](https://developer.squareup.com/docs/terminal-api/square-terminal-refunds). Describes how to refund Interac payments. - -- **Loyalty API (beta):** - - - [SearchLoyaltyAccounts.](https://developer.squareup.com/reference/square_2020-10-28/loyalty-api/search-loyalty-accounts) The endpoint supports a new query parameter to search by customer ID. - -- **Locations API:** - - - [Location](https://developer.squareup.com/reference/square_2020-10-28/objects/Location) object. Has a new read-only field,[full_format_logo_url](https://developer.squareup.com/reference/square_2020-10-28/objects/Location#definition__property-full_format_logo_url), which provides URL of a full-format logo image for the location. - - [Webhooks](https://developer.squareup.com/docs/webhooks-api/subscribe-to-events#locations) The Locations API now supports notifications for when a location is created and when a location is updated. - -- **Orders API:** - - - [RetrieveOrder](https://developer.squareup.com/reference/square_2020-10-28/orders-api/retrieve-order), new endpoint. For more information, see the [Retrieve Orders](https://developer.squareup.com/docs/orders-api/manage-orders#retrieve-orders) overview. - -- **Invoices API (beta):** - - [Invoice](https://developer.squareup.com/reference/square_2020-10-28/objects/Invoice) object. The [payment_requests](https://developer.squareup.com/reference/square_2020-10-28/objects/Invoice#definition__property-payment_requests) field can now contain up to 13 payment requests, with a maximum of 12 `INSTALLMENT` request types. This is a service-level change that applies to all Square API versions. For more information, see [Payment requests.](https://developer.squareup.com/docs/invoices-api/overview#payment-requests) - -## Version 6.4.0.20200923 (2020-09-23) - -## Existing API updates - -- Invoices API (beta) - - [InvoiceStatus](https://developer.squareup.com/reference/square_2020-09-23/enums/InvoiceStatus) enum. Added the `PAYMENT_PENDING` value. Previously, the Invoices API returned a `PAID` or `PARTIALLY_PAID` status for invoices in a payment pending state. Now, the Invoices API returns a `PAYMENT_PENDING` status for all invoices in a payment pending state, including those previously returned as `PAID` or `PARTIALLY_PAID`. -- Payments API - - [ListPayment](https://developer.squareup.com/reference/square_2020-09-23/payments-api/list-payments). The endpoint now supports the `limit` parameter. -- Refunds API - - [ListPaymentRefunds](https://developer.squareup.com/reference/square_2020-09-23/refunds-api/list-payment-refunds). The endpoint now supports the `limit` parameter. -- [DeviceDetails](https://developer.squareup.com/reference/square_2020-09-23/objects/DeviceDetails#definition__property-device_installation_id). The object now includes the `device_installation_id` field. - -## Documentation updates - -- [Payment status.](https://developer.squareup.com/docs/payments-api/take-payments#payment-status) Added details about the `Payment.status` changes and how the status relates to the seller receiving the funds. -- [Refund status.](https://developer.squareup.com/docs/payments-api/refund-payments#refund-status) Added details about the `PaymentRefund.status` changes and how the status relates to the cardholder receiving the funds. -- [CreateRefund errors.](https://developer.squareup.com/docs/payments-api/error-codes#createrefund-errors) Added documentation for the `REFUND_DECLINED` error code. - -## Version 6.3.0.20200826 (2020-08-26) - -## Existing API updates - -- Orders API - - [Order](https://developer.squareup.com/reference/square_2020-08-26/objects/Order) object. The `total_tip_money` field is now GA. - - [CreateOrder](https://developer.squareup.com/reference/square_2020-08-26/orders-api/create-order), [UpdateOrder](https://developer.squareup.com/reference/square_2020-08-26/orders-api/update-order), and [BatchRetrieveOrders](https://developer.squareup.com/reference/square_2020-08-26/orders-api/batch-retrieve-orders). These APIs now support merchant-scoped endpoints (for example, the `CreateOrder` endpoint `POST /v2/orders`). The location-scoped variants of these endpoints (for example, the `CreateOrder` endpoint `POST /v2/locations/{location_id}/orders`) continue to work, but these endpoints are now deprecated. You should use the merchant-scoped endpoints (you provide the location information in the request body). -- Labor API - - [Migrate from Employees to Team Members.](https://developer.squareup.com/docs/labor-api/migrate-to-teams) The Employees API is now deprecated in this release. Accordingly, update references to the `Shift.employee_id` field to the `Shift.team_member_id` field of the Labor API. -- v2 Employees API (deprecated) - - [Migrate from the Square Employees API.](https://developer.squareup.com/docs/team/migrate-from-v2-employees) The v2 Employees API is now deprecated. This topic provides information to migrate to the Team API. -- v1 Employees API (deprecated) - - [Migrate from the v1 Employees API.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-employees) The v1 Employees API is now deprecated. This topic provides information to migrate to the Team API. - -## Documentation updates - -- Point of Sale API - - [Build on iOS.](https://developer.squareup.com/docs/pos-api/build-on-ios) Corrected the Swift example code in step 7. -- Team API - - [Team API Overview.](https://developer.squareup.com/docs/team/overview) Documented the limitation related to creating a team member in the Square Sandbox. - -## All SDKs - -SDK technical reference documentation: - -- Nulls in SDK documentation example code are replaced with example values. - -## .NET SDK - -Bug fixes: - -- The `APIException.Errors` property was not set on instantiation. Behavior is now corrected to instantiate the class with an empty `Errors` list. - -## Version 6.2.0.20200812 (2020-08-12) - -## API releases - -- Subscriptions API (beta): - - For an overview, see [Square Subscriptions.](https://developer.squareup.com/docs/subscriptions/overview) - - For technical reference, see [Subscriptions API.](https://developer.squareup.com/reference/square_2020-08-12/subscriptions-api) - -## Existing API updates - -- Catalog API - - [CatalogSubscriptionPlan](https://developer.squareup.com/reference/square_2020-08-12/objects/CatalogSubscriptionPlan) (beta). This catalog type is added in support of the Subscriptions API. Subscription plans are stored as catalog object of the `SUBSCRIPTION_PLAN` type. For more information, see [Set Up and Manage a Subscription Plan.](https://developer.squareup.com/docs/subscriptions-api/setup-plan) - -## SqPaymentForm SDK updates - -- [SqPaymentForm.masterpassImageURL.](https://developer.squareup.com/docs/api/paymentform#masterpassimageurl) This function is updated to return a Secure Remote Commerce background image URL. - -## Documentation updates - -- Locations API - - [About the main location.](https://developer.squareup.com/docs/locations-api#about-the-main-location) Added clarifying information about the main location concept. -- OAuth API - - [Migrate to the Square API OAuth Flow.](https://developer.squareup.com/docs/oauth-api/migrate-to-square-oauth-flow) Added a new topic to document migration from a v1 location-scoped OAuth access token to the Square seller-scoped OAuth access token. -- Payment Form SDK - - Renamed the Add a Masterpass Button topic to [Add a Secure Remote Commerce Button.](https://developer.squareup.com/docs/payment-form/add-digital-wallets/masterpass) Updated the instructions to add a Secure Remote Commerce button to replace a legacy Masterpass button. - - [Payment form technical reference.](https://developer.squareup.com/docs/api/paymentform) Updated the reference to show code examples for adding a Secure Remote Commerce button. - -## Version 6.1.0.20200722 (2020-07-22) - -## API releases - -- Invoices API (beta): - - For an overview, see [Manage Invoices Using the Invoices API](https://developer.squareup.com/docs/invoices-api/overview). - - For technical reference, see [Invoices API](https://developer.squareup.com/reference/square_2020-07-22/invoices-api). - -## Existing API updates - -- Catalog API - - [SearchCatalogItems](https://developer.squareup.com/reference/square_2020-07-22/catalog-api/search-catalog-items). You can now call the new search endpoint to [search for catalog items or item variations](https://developer.squareup.com/docs/catalog-api/search-catalog-items), with simplified programming experiences, using one or more of the supported query filters, including the custom attribute value filter. -- Locations API - - - [Locations API Overview](https://developer.squareup.com/docs/locations-api). Introduced the "main" location concept. - - [RetrieveLocation](https://developer.squareup.com/reference/square_2020-07-22/locations-api/retrieve-location). You can now specify "main" as the location ID to retrieve the main location information. - -- Merchants API - - - [RetrieveMerchant](https://developer.squareup.com/reference/square_2020-07-22/merchants-api/retrieve-merchant) and [ListMerchants](https://developer.squareup.com/reference/square_2020-07-22/merchants-api/retrieve-merchant). These endpoints now return a new field, `main_location_id`. - -- Orders API - - - [PricingOptions](https://developer.squareup.com/reference/square_2020-07-22/objects/Order#definition__property-pricing_options). You can now enable the `auto_apply_discounts` of the options to have rule-based discounts automatically applied to an [Order](https://developer.squareup.com/reference/square_2020-07-22/objects/Order) that is pre-configured with a [pricing rule](https://developer.squareup.com/reference/square_2020-07-22/objects/CatalogPricingRule). - -- [Inventory API](https://developer.squareup.com/reference/square_2020-07-22/inventory-api) - - - Replaced 500 error on max string length exceeded with a max length error message. Max length attribute added to string type fields. - -- Terminal API (beta) - - [TerminalCheckout](https://developer.squareup.com/reference/square_2020-07-22/objects/TerminalCheckout) object. The `TerminalCheckoutCancelReason` field is renamed to `ActionCancelReason`. - -## Documentation updates - -- Catalog API - - - [Search a catalog](https://developer.squareup.com/docs/catalog-api/search-catalog). New topics added to provide actionable guides to using the existing [SearchCatalogObjects](https://developer.squareup.com/reference/square_2020-07-22/catalog-api/search-catalog-objects) endpoint, in addition to the [SearchCatalogItems](https://developer.squareup.com/reference/square_2020-07-22/catalog-api/search-catalog-items) endpoints. - -- Orders API - - [Create Orders](https://developer.squareup.com/docs/orders-api/create-orders). Updated existing content with the new pricing option for the automatic application of rule-based discounts. - -## Version 6.0.0.20200625 (2020-06-25) - -## New API release - -- Team API generally available (GA) - - For an overview, see [Team API Overview](https://developer.squareup.com/docs/team/overview). - - For technical reference, see [Team API](https://developer.squareup.com/reference/square_2020-06-25/team-api). - -## Existing API updates - -- Catalog API - - [Pricing](https://developer.squareup.com/reference/square_2020-06-25/objects/CatalogPricingRule) is now GA. It allows an application to configure catalog item pricing rules for the specified discounts to apply automatically. -- Payments API - - The [CardPaymentDetails](https://developer.squareup.com/reference/square_2020-06-25/objects/CardPaymentDetails) type now supports a new field, [refund_requires_card_presence](https://developer.squareup.com/reference/square_2020-06-25/objects/CardPaymentDetails#definition__property-refund_requires_card_presence). When set to true, the payment card must be physically present to refund a payment. - -## Version 5.3.0.20200528 (2020-05-28) - -## API releases - -- Loyalty API (beta): - - For an overview, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview?train=2020-05-28). - - For technical reference, see [Loyalty API](https://developer.squareup.com/reference/square/loyalty-api). - -## Existing API updates - -- Orders API - - - [CalculateOrder (beta)](https://developer.squareup.com/reference/square/orders-api/calculate-order) endpoint. Use the endpoint to calculate adjustments (for example, taxes and discounts) to an order for preview purposes. In response, the endpoint returns the order showing the calculated totals. You can use this endpoint with an existing order or an order that has not been created. - - The endpoint does not update an existing order. It only returns a calculated view of the order that you provided in the request. To create or update an order, use the [CreateOrder](https://developer.squareup.com/reference/square/orders-api/create-order) and [UpdateOrder](https://developer.squareup.com/reference/square/orders-api/update-order) endpoints, respectively. - - - [Order](https://developer.squareup.com/reference/square_2020-05-28/objects/Order?train=2020-05-28) type. Two fields are added in support of the Loyalty API integration. For more information, see [Deferred reward creation](https://developer.squareup.com/docs/loyalty-api/overview?train=2020-05-28#deferred-reward-creation). For an example, see [Redeem Points](https://developer.squareup.com/docs/loyalty-api/walkthrough1/redeem-points?train=2020-05-28). - - `Order.rewards` represents rewards added to an order by calling the [CreateLoyaltyReward](https://developer.squareup.com/reference/square/loyalty-api/create-loyalty-reward) endpoint. - - `Order.discount.reward_ids` indicates that a discount is the result of the specified rewards that were added to an order using the `CreateLoyaltyReward` endpoint. - -- Customers API - - - The [Search Customers](https://developer.squareup.com/reference/square/customers-api/search-customers) endpoint supports search by email address, phone number, and reference ID with the following additional query filters: - - - The [`email_address` query filter](https://developer.squareup.com/docs/customers-api/cookbook/search-customers?train=2020-05-28#search-by-email-address) (beta) supports an [exact](https://developer.squareup.com/docs/customers-api/cookbook/search-customers?train=2020-05-28#exact-search-by-email-address) or [fuzzy](https://developer.squareup.com/docs/customers-api/cookbook/search-customers?train=2020-05-28#fuzzy-search-by-email-address) search for customer profiles by their email addresses. - - - The [`phone_number` query filter](https://developer.squareup.com/docs/customers-api/cookbook/search-customers?train=2020-05-28#search-by-phone-number) (beta) supports an [exact](https://developer.squareup.com/docs/customers-api/cookbook/search-customers?train=2020-05-28#exact-search-by-phone-number) or [fuzzy](https://developer.squareup.com/docs/customers-api/cookbook/search-customers?train=2020-05-28#fuzzy-search-by-phone-number) search for customer profiles by their phone numbers. - - - The [`reference_id` query filter](https://developer.squareup.com/docs/customers-api/cookbook/search-customers?train=2020-05-28#search-by-reference-id) (beta) supports an [exact](https://developer.squareup.com/docs/customers-api/cookbook/search-customers?train=2020-05-28#exact-search-by-reference-id) or [fuzzy](https://developer.squareup.com/docs/customers-api/cookbook/search-customers?train=2020-05-28#fuzzy-search-by-reference-id) search for customer profiles by their reference IDs. - - - The [`created_at`](https://developer.squareup.com/reference/square/objects/Customer#definition__property-created_at), [`updated_at`](https://developer.squareup.com/reference/square/objects/Customer#definition__property-updated_at), and [`id`](https://developer.squareup.com/reference/square/objects/Customer#definition__property-id) attributes on the [Customer](https://developer.squareup.com/docs/S%7BSQUARE_TECH_REF%7D/objects/customers?train=2020-05-28) resource are updated to be optional. As a result, they no longer are required input parameters when you call the Square SDKs to create a `Customer` object. You might need to update the dependent SDKs to the latest version to mediate breaking your existing code. - -## Square Webhooks - -- [Square Webhooks](https://developer.squareup.com/reference/square/webhooks) (formerly v2 Webhooks). The status is changed from beta to general availability (GA). - -- [v1 Webhooks](https://developer.squareup.com/docs/webhooks-api/v1-tech-ref?train=2020-05-28). The v1 Inventory and Timecards webooks are now deprecated and replaced by [inventory.count.updated](https://developer.squareup.com/reference/square/webhooks/inventory.count.updated) and [labor.shift.updated](https://developer.squareup.com/reference/square/webhooks/inventory.count.updated). - -## Version 5.2.2.20200422 (2020-04-25) - -## Existing API updates - -- **OAuth API** - - [Obtain Token](https://developer.squareup.com/reference/square/oauth-api/revoke-token) endpoint: Removed the `scopes` property from the request body. - -## Version 5.2.1.20200422 (2020-04-22) - -## API releases - -- **Customer Segments API (beta).** `limit` field removed from **ListCustomerSegments** endpoint. - -**Note:** This release fixes a bug introduced on the [April 22, 2020](changelog/connect-logs/2020-04-22) release of the Square API. - -## Version 5.2.0.20200422 (2020-04-22) - -## API releases - -- **Terminal API.** The new Terminal API lets a custom third-party POS app integrate with the Square Terminal to send terminal checkout requests to collect payments. - - - For an overview, see [Overview](https://developer.squareup.com/docs/terminal-api/overview). - - For technical reference, see [Terminal API](https://developer.squareup.com/reference/square/terminal-api). - -- **Devices API.** The new Devices API lets a custom third-party POS app generate a code used to sign in to a Square Terminal to create a pairing that lets the POS app send terminal checkout requests. For technical reference, see [Devices API](https://developer.squareup.com/reference/square/devices-api). - -- **Customer Groups API (beta).** The new Customer Groups API (Beta) enables full CRUD management of customer groups, including the ability to list, retrieve, create, update, and delete customer groups. Previously, this functionality was only available through the Square dashboard and point-of-sale product interfaces. - - - For an overview, see [Overview](https://developer.squareup.com/docs/customer-groups-api/what-it-does) - - For technical reference, see [Customer Groups](https://developer.squareup.com/reference/square/customer-groups-api). - -- **Customer Segments API (beta).** The new Customer Segments API (Beta) lets you list and retrieve customer segment (also called smart groups) information. Coupled with the new `segment_ids` field on the customer resource, this API lets you better understand and track the customer segments to which a customer belongs. - - - For an overview, see [Overview](https://developer.squareup.com/docs/customer-segmentss-api/what-it-does) - - For technical reference, see [Customer Segments](https://developer.squareup.com/reference/square/customer-segments-api). - -- **New webhooks** v2 Webhooks (beta) now supports webhooks for the following APIs: - - - Orders API. `order.created`, `order.updated`, and `order.fulfillment.updated` - - Terminal API. `terminal.checkout.created` and `terminal.checkout.updated` - - Devices API. `device.code.paired` - - For more information, see [Subscribe to Events](webhooks-api/subscribe-to-events). - -## Existing API updates - -- **Customers API** - - - [AddGroupToCustomer](https://developer.squareup.com/reference/square/customers-api/add-group-to-customer) endpoint. Added to add customer memberships to a customer group. - - [RemoveGroupFromCustomer](https://developer.squareup.com/reference/square/customers-api/remove-group-from-customer) endpoint. Added to remove customer memberships from a customer group. - - [Customer](https://developer.squareup.com/reference/square/obects/Customer) object. Updated as follows: - - [`group_ids`](https://developer.squareup.com/reference/square/obects/Customer#definition__property-group_ids) field. Added to designate groups the customer is in. - - [`segment_ids`](https://developer.squareup.com/reference/square/obects/Customer#definition__property-segment_ids) field. Added to designate segments the customer is in. - - [`groups`](https://developer.squareup.com/reference/square/obects/Customer#definition__property-groups) field. Deprecated to be replaced by `group_ids` and `segment_ids`. It remains supported for one year from this release. - - [CustomerQuery](https://developer.squareup.com/reference/square/objects/CustomerQuery) object's `filter` parameter. Updated as follows: - - `group_ids` filter. Added to search for customers based on whether they belong to any, all, or none of the specified groups. - -- **Orders API** - - - [OrderFulfillmentPickupDetails](https://developer.squareup.com/reference/square/objects/OrderFulfillmentPickupDetails) type updated to support curbside pickup: - - `is_curbside_pickup`. This Boolean field indicates curbside pickup. - - `CurbsidePickupDetails`. This type provides supporting information for curbside pickup, including a buyer description (for example, "buyer is in a red car") and a timestamp when the buyer arrived for the pickup. - -- **OAuth API** - - - [RevokeToken](https://developer.squareup.com/reference/square/oauth-api/revoke-token) endpoint. Added a new field called [revoke_only_access_token](https://developer.squareup.com/reference/square/oauth-api/revoke-token#request__property-revoke_only_access_token). This field allows a client to revoke an access token but leave the parent authorization active. - - [ObtainToken](https://developer.squareup.com/reference/square/oauth-api/obtain-token) endpoint. Added a new field called [scopes](https://developer.squareup.com/reference/square/oauth-api/obtain-token#request__property-scopes). This field lets a client change the set of permissions for an access token when making a request to refresh the token. - -- **Catalog API** - - - [CatalogQuickAmountsSettings](https://developer.squareup.com/reference/square/objects/CatalogQuickAmountsSettings) type. Added to support predefined custom payment amounts in the Square Register checkout dialog box. - - ENUM`CatalogItemProductType`. The ENUM value `GIFT_CARD` is now deprecated. - -- **Payments API.** See [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees) for updated information about permission requirements, Square reporting of the application fee collected by an app, and how to collect fees internationally. - -## Version 5.1.0.20200325 (2020-03-25) - -## Existing API updates - -- **[Payments API](https://developer.squareup.com/reference/square/payments-api).** In support of the existing [Delayed capture]](https://developer.squareup.com/docs/payments-api/take-payments) for payments, the following fields are added to the [Payment](https://developer.squareup.com/reference/square/objects/Payment) type: - - `delay_duration`. In a [CreatePayment](https://developer.squareup.com/reference/square/payments-api/create-payment) request, you can set `autocomplete` to false to get payment approval but not charge the payment source. You can now add this field to specify a time period to complete (or cancel) the payment. For more information, see [Delay capture]](https://developer.squareup.com/docs/payments-api/take-payments). - - `delay_action`. Defines the action that Square takes on the payment when the `delay_duration` elapses. In this release, the API supports only the cancel payment action. - - `delayed_until`. Provides the date and time on Square servers when Square applies `delay_action` on the payment. - -## Version 5.0.0.20200226 (2020-02-26) - -## API releases - -- **GA release**: All SDKs have been updated to support the new Bank Accounts and CashDrawerShifts APIs. - -- **Beta release**: All SDKs have been updated to support the new Disputes API. - -## Existing API updates - -All SDKs have been updated to support the following changes: - -- **Catalog API** - - - Batch upsert catalog objects endpoint — The `batches` field is now required and the array must have at least one element. - - CatalogModifier — Two fields added: - - `ordinal` to support custom ordering in a modifier list - - `modifier_list_id` to reference the parent modifier list - - CatalogModifierList — New field added: `ordinal` to support custom ordering in a list of **CatalogModifierList** objects. - -- **Customers API changes** - - - SearchCustomers endpoint — `limit` size reduced from 1000 to 100 to improve the endpoint performance. - -- **Orders API changes** - - - CreateOrderRequest — Previously these request fields were deprecated: `line_items`, `taxes`, `discounts`. These fields are no longer available. Instead you now use the `Order` object in the request. For example, `Order.line_items`, `Order.taxes`, and `Order.discounts`. - - OrderLineItem type — There are two changes: - - The `taxes` field that was previously deprecated is no longer available. Instead, you now use the `OrderLineItem.applied_taxes` field. This also now requires that you set the `OrderLineItemTax.scope` field. - - The `discounts` field that was previously deprecated is no longer available. Instead, you now use the `OrderLineItem.applied_discounts` field. This also now requires that you set the `OrderLineItemDiscount.scope` field. - -- **Shared object updates** - - **Card object** — New fields added: `card_type`, `prepaid_type`. Currently, only the Payments API responses populate these fields. - -## Version 4.1.0.20200122 (2020-01-22) - -- New field: The **Employee** object now has an `is_owner` field. -- New enumeration: The **CardBrand** enumeration has a new `SQUARE_CAPITAL_CARD` enum value to support a Square one-time Installments payment. - -- New request body field constraint: The **Refund** Payment request now requires a payment_id. - -## Version 4.0.0-20191217 (2019-12-17) - -!!!important -Square is excited to announce the public release of customized SDKs for [Java](https://github.com/square/square-java-sdk) and [.NET](https://github.com/square/square-dotnet-sdk). For more information, see [Square SDKs](https://developer.squareup.com/docs/sdks). -!!! - -- **GA release:** SDKs updated to support new `receipt_url` and `receipt_number` fields added to the [Payment](https://developer.squareup.com/reference/square/objects/Payment) type. - -- **Beta release:** SDKs updated to support the new [CashDrawerShifts](cashdrawershift-api/reporting) API. - -- Square now follows the semantic versioning scheme for all SDKs except PHP and Node.js. This versioning scheme uses three numbers to delineate MAJOR, MINOR, and PATCH versions of our SDK. In addition, the SDK version also includes the API version so you know what Square API version the SDK is related to. For more information, see [Versioning and SDKs](https://developer.squareup.com/docs/build-basics/versioning-overview#versioning-and-sdks). -- Java, .Net, Python, and Ruby SDKs are now version 4.0.0. Java and .Net SDKs have breaking changes in version 4.0.0. Ruby and Python do not have breaking changes. - -## Version 3.20191120.0 (2019-11-20) - -!!!important -Square has begun the retirement process for Connect v1 APIs. See the [Connect v1 Retirement](https://developer.squareup.com/docs/migrate-from-v1) information page for details. -!!! - -- **GA releases:** SDKs now support the new `modify_tax_basis` field to Discounts and v2 Sandbox -- **BETA releases:** SDKs now support the Shifts API webhooks for Labor shift created, updated, deleted, CreateLocation endpoint, and the ability to customize statement description in Payments API. -- **Deprecated**: Support for v1Items API and v1Locations API is fully deprecated. - -## 3.20191023.0 (2019-10-23) - -- **GA release**: Merchants.ListMerchant is GA for all SDKs. -- **Beta release**: All SDKs support exclusion strategies for pricing rules. - -## 3.20190925.0 (2019-09-25) - -- **GA release**: All SDKs have been updated to support the new Merchants API. - -- **Beta release**: All SDKs have been updated to support the new endpoints (RetrieveLocation, UpdateLocation) added to the Locations API. - -- **Beta release**: All SDKs have been updated to support the new field (`mcc`) added to the `Location` type. - -- **GA release**: All SDKs have been updated to support the new field (`bin`) added to the `Card` type. - -- **GA release**: All SDKs have been updated to support the new `CardPaymentDetails` fields (`verification_results`, `statement_description`, and `verification_method`). - -- **GA release**: All SDKs have been updated to support the new `Payment` field, (`employee_id`). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 830654f59..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,21 +0,0 @@ -# Contributing to Square SDKs - -Thank you for your willingness to help improve the Square SDKs. Your feedback and expertise ultimately benefits everyone who builds with Square. - -If you encounter a bug while using Square SDKs, please [let us know](#bug-reporting). We'll investigate the issue and fix it as soon as possible. - -We also accept feedback in the form of a pull request (PR), and will follow up with you if we need more information. However, any code changes required will be perfomed by Square engineering, and we'll close the PR. - -## Bug report - -To report a bug: -* Go to the **[Issues](../../issues)** page. -* Click **New issue**. -* Click **Get started**. - -## Other support - -For all other support, including new feature requests, see: - -* Square developer forums: [https://developer.squareup.com/forums](https://developer.squareup.com/forums) -* Square support center: [https://squareup.com/help/us/en](https://squareup.com/help/us/en) diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 0b1f6b931..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,10 +0,0 @@ -node { - stage 'Checkout' - checkout scm - - stage 'Prepare' - bat 'bundle install' - - stage 'Test' - bat 'bundle exec rake' -} \ No newline at end of file diff --git a/LICENSE b/LICENSE index 71fb2ce0d..f5669d1d5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,10 +1,21 @@ -Copyright 2024 Square, Inc. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - https://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +MIT License + +Copyright (c) 2025 Square. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 9b4044393..000000000 --- a/README.md +++ /dev/null @@ -1,190 +0,0 @@ -![Square logo] - -# Square Ruby SDK - -[![Build](https://github.com/square/square-ruby-sdk/actions/workflows/ruby.yml/badge.svg)](https://github.com/square/square-ruby-sdk/actions/workflows/ruby.yml) -[![Gem version](https://badge.fury.io/rb/square.rb.svg?new)](https://badge.fury.io/rb/square.rb) -[![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0) - -Use this library to integrate Square payments into your app and grow your business with Square APIs including Catalog, Customers, Employees, Inventory, Labor, Locations, and Orders. - -* [Requirements](#requirements) -* [Installation](#installation) -* [Quickstart](#quickstart) -* [Usage](#usage) -* [Tests](#tests) -* [SDK Reference](#sdk-reference) -* [Deprecated APIs](#deprecated-apis) - -## Requirements - -Use of the Square Ruby SDK requires: - -* Ruby 2.7 through 3.1 - -## Installation - -For more information, see [Set Up Your Square SDK for a Ruby Project](https://developer.squareup.com/docs/sdks/ruby/setup-project). - -## Quickstart - -For more information, see [Square Ruby SDK Quickstart](https://developer.squareup.com/docs/sdks/ruby/quick-start). - -## Usage -For more information, see [Using the Square Ruby SDK](https://developer.squareup.com/docs/sdks/ruby/using-ruby-sdk). - -## Tests - -First, clone the repo locally and `cd` into the directory. - -```sh -git clone https://github.com/square/square-ruby-sdk.git -cd square-ruby-sdk -``` - -Next, make sure Bundler is installed and install the development dependencies. - -```sh -gem install bundler -bundle -``` - -Before running the tests, find a sandbox token in your [Developer Dashboard] and set a `SQUARE_SANDBOX_TOKEN` environment variable. - -```sh -export SQUARE_SANDBOX_TOKEN="YOUR SANDBOX TOKEN HERE" -``` - -And run the tests. - -```sh -rake -``` - -## 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 Custom Attributes] -* [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] -* [Vendors] - -### 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). - - -[//]: # "Link anchor definitions" -[Square Logo]: https://docs.connect.squareup.com/images/github/github-square-logo.svg -[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 -[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/doc/api/apple-pay.md b/doc/api/apple-pay.md deleted file mode 100644 index 6130fe420..000000000 --- a/doc/api/apple-pay.md +++ /dev/null @@ -1,59 +0,0 @@ -# Apple Pay - -```ruby -apple_pay_api = client.apple_pay -``` - -## 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). - -```ruby -def register_domain(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Register Domain Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Register Domain Response Hash`](../../doc/models/register-domain-response.md). - -## Example Usage - -```ruby -body = { - :domain_name => 'example.com' -} - - -result = apple_pay_api.register_domain(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/bank-accounts.md b/doc/api/bank-accounts.md deleted file mode 100644 index 940799adb..000000000 --- a/doc/api/bank-accounts.md +++ /dev/null @@ -1,120 +0,0 @@ -# Bank Accounts - -```ruby -bank_accounts_api = client.bank_accounts -``` - -## 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. - -```ruby -def list_bank_accounts(cursor: nil, - limit: nil, - location_id: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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. | -| `location_id` | `String` | Query, Optional | Location ID. You can specify this optional filter
to retrieve only the linked bank accounts belonging to a specific location. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Bank Accounts Response Hash`](../../doc/models/list-bank-accounts-response.md). - -## Example Usage - -```ruby -result = bank_accounts_api.list_bank_accounts - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Bank Account by V1 Id - -Returns details of a [BankAccount](../../doc/models/bank-account.md) identified by V1 bank account ID. - -```ruby -def get_bank_account_by_v1_id(v1_bank_account_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `v1_bank_account_id` | `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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Bank Account by V1 Id Response Hash`](../../doc/models/get-bank-account-by-v1-id-response.md). - -## Example Usage - -```ruby -v1_bank_account_id = 'v1_bank_account_id8' - - -result = bank_accounts_api.get_bank_account_by_v1_id(v1_bank_account_id: v1_bank_account_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Bank Account - -Returns details of a [BankAccount](../../doc/models/bank-account.md) -linked to a Square account. - -```ruby -def get_bank_account(bank_account_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bank_account_id` | `String` | Template, Required | Square-issued ID of the desired `BankAccount`. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Bank Account Response Hash`](../../doc/models/get-bank-account-response.md). - -## Example Usage - -```ruby -bank_account_id = 'bank_account_id0' - - -result = bank_accounts_api.get_bank_account(bank_account_id: bank_account_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/booking-custom-attributes.md b/doc/api/booking-custom-attributes.md deleted file mode 100644 index ac784d6cc..000000000 --- a/doc/api/booking-custom-attributes.md +++ /dev/null @@ -1,532 +0,0 @@ -# Booking Custom Attributes - -```ruby -booking_custom_attributes_api = client.booking_custom_attributes -``` - -## 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. - -```ruby -def list_booking_custom_attribute_definitions(limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | 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` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Booking Custom Attribute Definitions Response Hash`](../../doc/models/list-booking-custom-attribute-definitions-response.md). - -## Example Usage - -```ruby -result = booking_custom_attributes_api.list_booking_custom_attribute_definitions - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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*. - -```ruby -def create_booking_custom_attribute_definition(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Booking Custom Attribute Definition Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Booking Custom Attribute Definition Response Hash`](../../doc/models/create-booking-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -body = { - :custom_attribute_definition => {} -} - - -result = booking_custom_attributes_api.create_booking_custom_attribute_definition(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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*. - -```ruby -def delete_booking_custom_attribute_definition(key:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Booking Custom Attribute Definition Response Hash`](../../doc/models/delete-booking-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - - -result = booking_custom_attributes_api.delete_booking_custom_attribute_definition(key: key) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def retrieve_booking_custom_attribute_definition(key:, - version: nil) -``` - -## 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` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Booking Custom Attribute Definition Response Hash`](../../doc/models/retrieve-booking-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - - -result = booking_custom_attributes_api.retrieve_booking_custom_attribute_definition(key: key) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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*. - -```ruby -def update_booking_custom_attribute_definition(key:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to update. | -| `body` | [`Update Booking Custom Attribute Definition Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Booking Custom Attribute Definition Response Hash`](../../doc/models/update-booking-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - -body = { - :custom_attribute_definition => {} -} - - -result = booking_custom_attributes_api.update_booking_custom_attribute_definition( - key: key, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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*. - -```ruby -def bulk_delete_booking_custom_attributes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Delete Booking Custom Attributes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Delete Booking Custom Attributes Response Hash`](../../doc/models/bulk-delete-booking-custom-attributes-response.md). - -## Example Usage - -```ruby -body = { - :values => { - 'key0' => { - :booking_id => 'booking_id4', - :key => 'key0' - }, - 'key1' => { - :booking_id => 'booking_id4', - :key => 'key0' - } - } -} - - -result = booking_custom_attributes_api.bulk_delete_booking_custom_attributes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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*. - -```ruby -def bulk_upsert_booking_custom_attributes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Upsert Booking Custom Attributes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Upsert Booking Custom Attributes Response Hash`](../../doc/models/bulk-upsert-booking-custom-attributes-response.md). - -## Example Usage - -```ruby -body = { - :values => { - 'key0' => { - :booking_id => 'booking_id4', - :custom_attribute => {} - }, - 'key1' => { - :booking_id => 'booking_id4', - :custom_attribute => {} - } - } -} - - -result = booking_custom_attributes_api.bulk_upsert_booking_custom_attributes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def list_booking_custom_attributes(booking_id:, - limit: nil, - cursor: nil, - with_definitions: false) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `String` | Template, Required | The ID of the target [booking](entity:Booking). | -| `limit` | `Integer` | 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` | 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). | -| `with_definitions` | `TrueClass \| FalseClass` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Booking Custom Attributes Response Hash`](../../doc/models/list-booking-custom-attributes-response.md). - -## Example Usage - -```ruby -booking_id = 'booking_id4' - -with_definitions = false - - -result = booking_custom_attributes_api.list_booking_custom_attributes( - booking_id: booking_id, - with_definitions: with_definitions -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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*. - -```ruby -def delete_booking_custom_attribute(booking_id:, - key:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Booking Custom Attribute Response Hash`](../../doc/models/delete-booking-custom-attribute-response.md). - -## Example Usage - -```ruby -booking_id = 'booking_id4' - -key = 'key0' - - -result = booking_custom_attributes_api.delete_booking_custom_attribute( - booking_id: booking_id, - key: key -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def retrieve_booking_custom_attribute(booking_id:, - key:, - with_definition: false, - version: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `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. | -| `with_definition` | `TrueClass \| FalseClass` | 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` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Booking Custom Attribute Response Hash`](../../doc/models/retrieve-booking-custom-attribute-response.md). - -## Example Usage - -```ruby -booking_id = 'booking_id4' - -key = 'key0' - -with_definition = false - - -result = booking_custom_attributes_api.retrieve_booking_custom_attribute( - booking_id: booking_id, - key: key, - with_definition: with_definition -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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*. - -```ruby -def upsert_booking_custom_attribute(booking_id:, - key:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `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` | [`Upsert Booking Custom Attribute Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Upsert Booking Custom Attribute Response Hash`](../../doc/models/upsert-booking-custom-attribute-response.md). - -## Example Usage - -```ruby -booking_id = 'booking_id4' - -key = 'key0' - -body = { - :custom_attribute => {} -} - - -result = booking_custom_attributes_api.upsert_booking_custom_attribute( - booking_id: booking_id, - key: key, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/bookings.md b/doc/api/bookings.md deleted file mode 100644 index d25da43a8..000000000 --- a/doc/api/bookings.md +++ /dev/null @@ -1,547 +0,0 @@ -# Bookings - -```ruby -bookings_api = client.bookings -``` - -## 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. - -```ruby -def list_bookings(limit: nil, - cursor: nil, - customer_id: nil, - team_member_id: nil, - location_id: nil, - start_at_min: nil, - start_at_max: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | Query, Optional | The maximum number of results per page to return in a paged response. | -| `cursor` | `String` | 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. | -| `customer_id` | `String` | Query, Optional | The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. | -| `team_member_id` | `String` | Query, Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. | -| `location_id` | `String` | Query, Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. | -| `start_at_min` | `String` | Query, Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. | -| `start_at_max` | `String` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Bookings Response Hash`](../../doc/models/list-bookings-response.md). - -## Example Usage - -```ruby -result = bookings_api.list_bookings - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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*. - -```ruby -def create_booking(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Booking Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Booking Response Hash`](../../doc/models/create-booking-response.md). - -## Example Usage - -```ruby -body = { - :booking => {} -} - - -result = bookings_api.create_booking(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_availability(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Availability Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Availability Response Hash`](../../doc/models/search-availability-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :filter => { - :start_at_range => {} - } - } -} - - -result = bookings_api.search_availability(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def bulk_retrieve_bookings(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Retrieve Bookings Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Retrieve Bookings Response Hash`](../../doc/models/bulk-retrieve-bookings-response.md). - -## Example Usage - -```ruby -body = { - :booking_ids => [ - 'booking_ids8', - 'booking_ids9', - 'booking_ids0' - ] -} - - -result = bookings_api.bulk_retrieve_bookings(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Business Booking Profile - -Retrieves a seller's booking profile. - -```ruby -def retrieve_business_booking_profile -``` - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Business Booking Profile Response Hash`](../../doc/models/retrieve-business-booking-profile-response.md). - -## Example Usage - -```ruby -result = bookings_api.retrieve_business_booking_profile - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Location Booking Profiles - -Lists location booking profiles of a seller. - -```ruby -def list_location_booking_profiles(limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | Query, Optional | The maximum number of results to return in a paged response. | -| `cursor` | `String` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Location Booking Profiles Response Hash`](../../doc/models/list-location-booking-profiles-response.md). - -## Example Usage - -```ruby -result = bookings_api.list_location_booking_profiles - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Location Booking Profile - -Retrieves a seller's location booking profile. - -```ruby -def retrieve_location_booking_profile(location_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the location to retrieve the booking profile. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Location Booking Profile Response Hash`](../../doc/models/retrieve-location-booking-profile-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - - -result = bookings_api.retrieve_location_booking_profile(location_id: location_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Team Member Booking Profiles - -Lists booking profiles for team members. - -```ruby -def list_team_member_booking_profiles(bookable_only: false, - limit: nil, - cursor: nil, - location_id: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookable_only` | `TrueClass \| FalseClass` | Query, Optional | Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`).
**Default**: `false` | -| `limit` | `Integer` | Query, Optional | The maximum number of results to return in a paged response. | -| `cursor` | `String` | 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. | -| `location_id` | `String` | Query, Optional | Indicates whether to include only team members enabled at the given location in the returned result. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Team Member Booking Profiles Response Hash`](../../doc/models/list-team-member-booking-profiles-response.md). - -## Example Usage - -```ruby -bookable_only = false - - -result = bookings_api.list_team_member_booking_profiles(bookable_only: bookable_only) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Bulk Retrieve Team Member Booking Profiles - -Retrieves one or more team members' booking profiles. - -```ruby -def bulk_retrieve_team_member_booking_profiles(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Retrieve Team Member Booking Profiles Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Retrieve Team Member Booking Profiles Response Hash`](../../doc/models/bulk-retrieve-team-member-booking-profiles-response.md). - -## Example Usage - -```ruby -body = { - :team_member_ids => [ - 'team_member_ids3', - 'team_member_ids4', - 'team_member_ids5' - ] -} - - -result = bookings_api.bulk_retrieve_team_member_booking_profiles(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Team Member Booking Profile - -Retrieves a team member's booking profile. - -```ruby -def retrieve_team_member_booking_profile(team_member_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_id` | `String` | Template, Required | The ID of the team member to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Team Member Booking Profile Response Hash`](../../doc/models/retrieve-team-member-booking-profile-response.md). - -## Example Usage - -```ruby -team_member_id = 'team_member_id0' - - -result = bookings_api.retrieve_team_member_booking_profile(team_member_id: team_member_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def retrieve_booking(booking_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `String` | Template, Required | The ID of the [Booking](entity:Booking) object representing the to-be-retrieved booking. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Booking Response Hash`](../../doc/models/retrieve-booking-response.md). - -## Example Usage - -```ruby -booking_id = 'booking_id4' - - -result = bookings_api.retrieve_booking(booking_id: booking_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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*. - -```ruby -def update_booking(booking_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `String` | Template, Required | The ID of the [Booking](entity:Booking) object representing the to-be-updated booking. | -| `body` | [`Update Booking Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Booking Response Hash`](../../doc/models/update-booking-response.md). - -## Example Usage - -```ruby -booking_id = 'booking_id4' - -body = { - :booking => {} -} - - -result = bookings_api.update_booking( - booking_id: booking_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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*. - -```ruby -def cancel_booking(booking_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `String` | Template, Required | The ID of the [Booking](entity:Booking) object representing the to-be-cancelled booking. | -| `body` | [`Cancel Booking Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Cancel Booking Response Hash`](../../doc/models/cancel-booking-response.md). - -## Example Usage - -```ruby -booking_id = 'booking_id4' - -body = {} - - -result = bookings_api.cancel_booking( - booking_id: booking_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/cards.md b/doc/api/cards.md deleted file mode 100644 index 28d7810df..000000000 --- a/doc/api/cards.md +++ /dev/null @@ -1,179 +0,0 @@ -# Cards - -```ruby -cards_api = client.cards -``` - -## 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. - -```ruby -def list_cards(cursor: nil, - customer_id: nil, - include_disabled: false, - reference_id: nil, - sort_order: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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. | -| `customer_id` | `String` | Query, Optional | Limit results to cards associated with the customer supplied.
By default, all cards owned by the merchant are returned. | -| `include_disabled` | `TrueClass \| FalseClass` | Query, Optional | Includes disabled cards.
By default, all enabled cards owned by the merchant are returned.
**Default**: `false` | -| `reference_id` | `String` | Query, Optional | Limit results to cards associated with the reference_id supplied. | -| `sort_order` | [`String (Sort Order)`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Cards Response Hash`](../../doc/models/list-cards-response.md). - -## Example Usage - -```ruby -include_disabled = false - - -result = cards_api.list_cards(include_disabled: include_disabled) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Create Card - -Adds a card on file to an existing merchant. - -```ruby -def create_card(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Card Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Card Response Hash`](../../doc/models/create-card-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => '4935a656-a929-4792-b97c-8848be85c27c', - :source_id => 'cnon:uIbfJXhXETSP197M3GB', - :card => { - :cardholder_name => 'Amelia Earhart', - :billing_address => { - :address_line_1 => '500 Electric Ave', - :address_line_2 => 'Suite 600', - :locality => 'New York', - :administrative_district_level_1 => 'NY', - :postal_code => '10003', - :country => 'US' - }, - :customer_id => 'VDKXEEKPJN48QDG3BGGFAK05P8', - :reference_id => 'user-id-1' - } -} - - -result = cards_api.create_card(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Card - -Retrieves details for a specific Card. - -```ruby -def retrieve_card(card_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `card_id` | `String` | Template, Required | Unique ID for the desired Card. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Card Response Hash`](../../doc/models/retrieve-card-response.md). - -## Example Usage - -```ruby -card_id = 'card_id4' - - -result = cards_api.retrieve_card(card_id: card_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Disable Card - -Disables the card, preventing any further updates or charges. -Disabling an already disabled card is allowed but has no effect. - -```ruby -def disable_card(card_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `card_id` | `String` | Template, Required | Unique ID for the desired Card. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Disable Card Response Hash`](../../doc/models/disable-card-response.md). - -## Example Usage - -```ruby -card_id = 'card_id4' - - -result = cards_api.disable_card(card_id: card_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/cash-drawers.md b/doc/api/cash-drawers.md deleted file mode 100644 index c0bda6af3..000000000 --- a/doc/api/cash-drawers.md +++ /dev/null @@ -1,148 +0,0 @@ -# Cash Drawers - -```ruby -cash_drawers_api = client.cash_drawers -``` - -## 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. - -```ruby -def list_cash_drawer_shifts(location_id:, - sort_order: nil, - begin_time: nil, - end_time: nil, - limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Query, Required | The ID of the location to query for a list of cash drawer shifts. | -| `sort_order` | [`String (Sort Order)`](../../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 | -| `begin_time` | `String` | Query, Optional | The inclusive start time of the query on opened_at, in ISO 8601 format. | -| `end_time` | `String` | Query, Optional | The exclusive end date of the query on opened_at, in ISO 8601 format. | -| `limit` | `Integer` | Query, Optional | Number of cash drawer shift events in a page of results (200 by
default, 1000 max). | -| `cursor` | `String` | Query, Optional | Opaque cursor for fetching the next page of results. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Cash Drawer Shifts Response Hash`](../../doc/models/list-cash-drawer-shifts-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - - -result = cash_drawers_api.list_cash_drawer_shifts(location_id: location_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def retrieve_cash_drawer_shift(location_id:, - shift_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Query, Required | The ID of the location to retrieve cash drawer shifts from. | -| `shift_id` | `String` | Template, Required | The shift ID. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Cash Drawer Shift Response Hash`](../../doc/models/retrieve-cash-drawer-shift-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -shift_id = 'shift_id0' - - -result = cash_drawers_api.retrieve_cash_drawer_shift( - location_id: location_id, - shift_id: shift_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Cash Drawer Shift Events - -Provides a paginated list of events for a single cash drawer shift. - -```ruby -def list_cash_drawer_shift_events(location_id:, - shift_id:, - limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Query, Required | The ID of the location to list cash drawer shifts for. | -| `shift_id` | `String` | Template, Required | The shift ID. | -| `limit` | `Integer` | Query, Optional | Number of resources to be returned in a page of results (200 by
default, 1000 max). | -| `cursor` | `String` | Query, Optional | Opaque cursor for fetching the next page of results. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Cash Drawer Shift Events Response Hash`](../../doc/models/list-cash-drawer-shift-events-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -shift_id = 'shift_id0' - - -result = cash_drawers_api.list_cash_drawer_shift_events( - location_id: location_id, - shift_id: shift_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/catalog.md b/doc/api/catalog.md deleted file mode 100644 index eadf8e09f..000000000 --- a/doc/api/catalog.md +++ /dev/null @@ -1,845 +0,0 @@ -# Catalog - -```ruby -catalog_api = client.catalog -``` - -## 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. - -```ruby -def batch_delete_catalog_objects(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Batch Delete Catalog Objects Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Batch Delete Catalog Objects Response Hash`](../../doc/models/batch-delete-catalog-objects-response.md). - -## Example Usage - -```ruby -body = { - :object_ids => [ - 'W62UWFY35CWMYGVWK6TWJDNI', - 'AA27W3M2GGTF3H6AVPNB77CK' - ] -} - - -result = catalog_api.batch_delete_catalog_objects(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def batch_retrieve_catalog_objects(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Batch Retrieve Catalog Objects Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Batch Retrieve Catalog Objects Response Hash`](../../doc/models/batch-retrieve-catalog-objects-response.md). - -## Example Usage - -```ruby -body = { - :object_ids => [ - 'W62UWFY35CWMYGVWK6TWJDNI', - 'AA27W3M2GGTF3H6AVPNB77CK' - ], - :include_related_objects => true -} - - -result = catalog_api.batch_retrieve_catalog_objects(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def batch_upsert_catalog_objects(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Batch Upsert Catalog Objects Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Batch Upsert Catalog Objects Response Hash`](../../doc/models/batch-upsert-catalog-objects-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => '789ff020-f723-43a9-b4b5-43b5dc1fa3dc', - :batches => [ - { - :objects => [ - { - :type => 'ITEM', - :id => '#Tea', - :present_at_all_locations => true, - :item_data => { - :name => 'Tea', - :tax_ids => [ - '#SalesTax' - ], - :variations => [ - { - :type => 'ITEM_VARIATION', - :id => '#Tea_Mug', - :present_at_all_locations => true, - :item_variation_data => { - :item_id => '#Tea', - :name => 'Mug', - :pricing_type => 'FIXED_PRICING', - :price_money => { - :amount => 150, - :currency => 'USD' - } - } - } - ], - :categories => [ - { - :id => '#Beverages' - } - ], - :description_html => '

Hot Leaf Juice

' - } - }, - { - :type => 'ITEM', - :id => '#Coffee', - :present_at_all_locations => true, - :item_data => { - :name => 'Coffee', - :tax_ids => [ - '#SalesTax' - ], - :variations => [ - { - :type => 'ITEM_VARIATION', - :id => '#Coffee_Regular', - :present_at_all_locations => true, - :item_variation_data => { - :item_id => '#Coffee', - :name => 'Regular', - :pricing_type => 'FIXED_PRICING', - :price_money => { - :amount => 250, - :currency => 'USD' - } - } - }, - { - :type => 'ITEM_VARIATION', - :id => '#Coffee_Large', - :present_at_all_locations => true, - :item_variation_data => { - :item_id => '#Coffee', - :name => 'Large', - :pricing_type => 'FIXED_PRICING', - :price_money => { - :amount => 350, - :currency => 'USD' - } - } - } - ], - :categories => [ - { - :id => '#Beverages' - } - ], - :description_html => '

Hot Bean Juice

' - } - }, - { - :type => 'CATEGORY', - :id => '#Beverages', - :present_at_all_locations => true, - :category_data => { - :name => 'Beverages' - } - }, - { - :type => 'TAX', - :id => '#SalesTax', - :present_at_all_locations => true, - :tax_data => { - :name => 'Sales Tax', - :calculation_phase => 'TAX_SUBTOTAL_PHASE', - :inclusion_type => 'ADDITIVE', - :percentage => '5.0', - :applies_to_custom_amounts => true, - :enabled => true - } - } - ] - } - ] -} - - -result = catalog_api.batch_upsert_catalog_objects(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_catalog_image(request: nil, - image_file: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `request` | [`Create Catalog Image Request Hash`](../../doc/models/create-catalog-image-request.md) | Form (JSON-Encoded), Optional | - | -| `image_file` | `File \| UploadIO` | Form, Optional | - | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Catalog Image Response Hash`](../../doc/models/create-catalog-image-response.md). - -## Example Usage - -```ruby -request = { - :idempotency_key => '528dea59-7bfb-43c1-bd48-4a6bba7dd61f86', - :image => { - :type => 'IMAGE', - :id => '#TEMP_ID', - :image_data => { - :caption => 'A picture of a cup of coffee' - } - }, - :object_id => 'ND6EA5AAJEO5WL3JNNIAQA32' -} - - -result = catalog_api.create_catalog_image(request: request) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def update_catalog_image(image_id:, - request: nil, - image_file: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `image_id` | `String` | Template, Required | The ID of the `CatalogImage` object to update the encapsulated image file. | -| `request` | [`Update Catalog Image Request Hash`](../../doc/models/update-catalog-image-request.md) | Form (JSON-Encoded), Optional | - | -| `image_file` | `File \| UploadIO` | Form, Optional | - | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Catalog Image Response Hash`](../../doc/models/update-catalog-image-response.md). - -## Example Usage - -```ruby -image_id = 'image_id4' - -request = { - :idempotency_key => '528dea59-7bfb-43c1-bd48-4a6bba7dd61f86' -} - - -result = catalog_api.update_catalog_image( - image_id: image_id, - request: request -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Catalog Info - -Retrieves information about the Square Catalog API, such as batch size -limits that can be used by the `BatchUpsertCatalogObjects` endpoint. - -```ruby -def catalog_info -``` - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Catalog Info Response Hash`](../../doc/models/catalog-info-response.md). - -## Example Usage - -```ruby -result = catalog_api.catalog_info - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def list_catalog(cursor: nil, - types: nil, - catalog_version: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | 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. | -| `catalog_version` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Catalog Response Hash`](../../doc/models/list-catalog-response.md). - -## Example Usage - -```ruby -result = catalog_api.list_catalog - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def upsert_catalog_object(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Upsert Catalog Object Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Upsert Catalog Object Response Hash`](../../doc/models/upsert-catalog-object-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => 'af3d1afc-7212-4300-b463-0bfc5314a5ae', - :object => { - :type => 'ITEM', - :id => '#Cocoa', - :item_data => { - :name => 'Cocoa', - :abbreviation => 'Ch', - :variations => [ - { - :type => 'ITEM_VARIATION', - :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', - :pricing_type => 'FIXED_PRICING', - :price_money => { - :amount => 400, - :currency => 'USD' - } - } - } - ], - :description_html => '

Hot Chocolate

' - } - } -} - - -result = catalog_api.upsert_catalog_object(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def delete_catalog_object(object_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `object_id` | `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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Catalog Object Response Hash`](../../doc/models/delete-catalog-object-response.md). - -## Example Usage - -```ruby -object_id = 'object_id8' - - -result = catalog_api.delete_catalog_object(object_id: object_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def retrieve_catalog_object(object_id:, - include_related_objects: false, - catalog_version: nil, - include_category_path_to_root: false) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `object_id` | `String` | Template, Required | The object ID of any type of catalog objects to be retrieved. | -| `include_related_objects` | `TrueClass \| FalseClass` | 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` | -| `catalog_version` | `Integer` | 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. | -| `include_category_path_to_root` | `TrueClass \| FalseClass` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Catalog Object Response Hash`](../../doc/models/retrieve-catalog-object-response.md). - -## Example Usage - -```ruby -object_id = 'object_id8' - -include_related_objects = false - -include_category_path_to_root = false - - -result = catalog_api.retrieve_catalog_object( - object_id: object_id, - include_related_objects: include_related_objects, - include_category_path_to_root: include_category_path_to_root -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_catalog_objects(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Catalog Objects Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Catalog Objects Response Hash`](../../doc/models/search-catalog-objects-response.md). - -## Example Usage - -```ruby -body = { - :object_types => [ - 'ITEM' - ], - :query => { - :prefix_query => { - :attribute_name => 'name', - :attribute_prefix => 'tea' - } - }, - :limit => 100 -} - - -result = catalog_api.search_catalog_objects(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_catalog_items(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Catalog Items Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Catalog Items Response Hash`](../../doc/models/search-catalog-items-response.md). - -## Example Usage - -```ruby -body = { - :text_filter => 'red', - :category_ids => [ - 'WINE_CATEGORY_ID' - ], - :stock_levels => [ - 'OUT', - 'LOW' - ], - :enabled_location_ids => [ - 'ATL_LOCATION_ID' - ], - :limit => 100, - :sort_order => 'ASC', - :product_types => [ - 'REGULAR' - ], - :custom_attribute_filters => [ - { - :custom_attribute_definition_id => 'VEGAN_DEFINITION_ID', - :bool_filter => true - }, - { - :custom_attribute_definition_id => 'BRAND_DEFINITION_ID', - :string_filter => 'Dark Horse' - }, - { - :key => 'VINTAGE', - :number_filter => { - :min => '2017', - :max => '2018' - } - }, - { - :custom_attribute_definition_id => 'VARIETAL_DEFINITION_ID' - } - ] -} - - -result = catalog_api.search_catalog_items(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def update_item_modifier_lists(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Update Item Modifier Lists Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Item Modifier Lists Response Hash`](../../doc/models/update-item-modifier-lists-response.md). - -## Example Usage - -```ruby -body = { - :item_ids => [ - 'H42BRLUJ5KTZTTMPVSLFAACQ', - '2JXOBJIHCWBQ4NZ3RIXQGJA6' - ], - :modifier_lists_to_enable => [ - 'H42BRLUJ5KTZTTMPVSLFAACQ', - '2JXOBJIHCWBQ4NZ3RIXQGJA6' - ], - :modifier_lists_to_disable => [ - '7WRC16CJZDVLSNDQ35PP6YAD' - ] -} - - -result = catalog_api.update_item_modifier_lists(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def update_item_taxes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Update Item Taxes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Item Taxes Response Hash`](../../doc/models/update-item-taxes-response.md). - -## Example Usage - -```ruby -body = { - :item_ids => [ - 'H42BRLUJ5KTZTTMPVSLFAACQ', - '2JXOBJIHCWBQ4NZ3RIXQGJA6' - ], - :taxes_to_enable => [ - '4WRCNHCJZDVLSNDQ35PP6YAD' - ], - :taxes_to_disable => [ - 'AQCEGCEBBQONINDOHRGZISEX' - ] -} - - -result = catalog_api.update_item_taxes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/checkout.md b/doc/api/checkout.md deleted file mode 100644 index 11821a3ec..000000000 --- a/doc/api/checkout.md +++ /dev/null @@ -1,493 +0,0 @@ -# Checkout - -```ruby -checkout_api = client.checkout -``` - -## 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). - -```ruby -def create_checkout(location_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the business location to associate the checkout with. | -| `body` | [`Create Checkout Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Checkout Response Hash`](../../doc/models/create-checkout-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -body = { - :idempotency_key => '86ae1696-b1e3-4328-af6d-f1e04d947ad6', - :order => { - :order => { - :location_id => 'location_id', - :reference_id => 'reference_id', - :customer_id => 'customer_id', - :line_items => [ - { - :quantity => '2', - :name => 'Printed T Shirt', - :applied_taxes => [ - { - :tax_uid => '38ze1696-z1e3-5628-af6d-f1e04d947fg3' - } - ], - :applied_discounts => [ - { - :discount_uid => '56ae1696-z1e3-9328-af6d-f1e04d947gd4' - } - ], - :base_price_money => { - :amount => 1500, - :currency => 'USD' - } - }, - { - :quantity => '1', - :name => 'Slim Jeans', - :base_price_money => { - :amount => 2500, - :currency => 'USD' - } - }, - { - :quantity => '3', - :name => 'Woven Sweater', - :base_price_money => { - :amount => 3500, - :currency => 'USD' - } - } - ], - :taxes => [ - { - :uid => '38ze1696-z1e3-5628-af6d-f1e04d947fg3', - :type => 'INCLUSIVE', - :percentage => '7.75', - :scope => 'LINE_ITEM' - } - ], - :discounts => [ - { - :uid => '56ae1696-z1e3-9328-af6d-f1e04d947gd4', - :type => 'FIXED_AMOUNT', - :amount_money => { - :amount => 100, - :currency => 'USD' - }, - :scope => 'LINE_ITEM' - } - ] - }, - :idempotency_key => '12ae1696-z1e3-4328-af6d-f1e04d947gd4' - }, - :ask_for_shipping_address => true, - :merchant_support_email => 'merchant+support@website.com', - :pre_populate_buyer_email => 'example@email.com', - :pre_populate_shipping_address => { - :address_line_1 => '1455 Market St.', - :address_line_2 => 'Suite 600', - :locality => 'San Francisco', - :administrative_district_level_1 => 'CA', - :postal_code => '94103', - :country => 'US', - :first_name => 'Jane', - :last_name => 'Doe' - }, - :redirect_url => 'https://merchant.website.com/order-confirm', - :additional_recipients => [ - { - :location_id => '057P5VYJ4A5X1', - :description => 'Application fees', - :amount_money => { - :amount => 60, - :currency => 'USD' - } - } - ] -} - - -result = checkout_api.create_checkout( - location_id: location_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Location Settings - -Retrieves the location-level settings for a Square-hosted checkout page. - -```ruby -def retrieve_location_settings(location_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the location for which to retrieve settings. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Location Settings Response Hash`](../../doc/models/retrieve-location-settings-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - - -result = checkout_api.retrieve_location_settings(location_id: location_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Location Settings - -Updates the location-level settings for a Square-hosted checkout page. - -```ruby -def update_location_settings(location_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the location for which to retrieve settings. | -| `body` | [`Update Location Settings Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Location Settings Response Hash`](../../doc/models/update-location-settings-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -body = { - :location_settings => {} -} - - -result = checkout_api.update_location_settings( - location_id: location_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Merchant Settings - -Retrieves the merchant-level settings for a Square-hosted checkout page. - -```ruby -def retrieve_merchant_settings -``` - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Merchant Settings Response Hash`](../../doc/models/retrieve-merchant-settings-response.md). - -## Example Usage - -```ruby -result = checkout_api.retrieve_merchant_settings - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Merchant Settings - -Updates the merchant-level settings for a Square-hosted checkout page. - -```ruby -def update_merchant_settings(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Update Merchant Settings Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Merchant Settings Response Hash`](../../doc/models/update-merchant-settings-response.md). - -## Example Usage - -```ruby -body = { - :merchant_settings => {} -} - - -result = checkout_api.update_merchant_settings(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Payment Links - -Lists all payment links. - -```ruby -def list_payment_links(cursor: nil, - limit: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Payment Links Response Hash`](../../doc/models/list-payment-links-response.md). - -## Example Usage - -```ruby -result = checkout_api.list_payment_links - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_payment_link(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Payment Link Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Payment Link Response Hash`](../../doc/models/create-payment-link-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => 'cd9e25dc-d9f2-4430-aedb-61605070e95f', - :quick_pay => { - :name => 'Auto Detailing', - :price_money => { - :amount => 10000, - :currency => 'USD' - }, - :location_id => 'A9Y43N9ABXZBP' - } -} - - -result = checkout_api.create_payment_link(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Delete Payment Link - -Deletes a payment link. - -```ruby -def delete_payment_link(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the payment link to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Payment Link Response Hash`](../../doc/models/delete-payment-link-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = checkout_api.delete_payment_link(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Payment Link - -Retrieves a payment link. - -```ruby -def retrieve_payment_link(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of link to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Payment Link Response Hash`](../../doc/models/retrieve-payment-link-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = checkout_api.retrieve_payment_link(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def update_payment_link(id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the payment link to update. | -| `body` | [`Update Payment Link Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Payment Link Response Hash`](../../doc/models/update-payment-link-response.md). - -## Example Usage - -```ruby -id = 'id0' - -body = { - :payment_link => { - :version => 1, - :checkout_options => { - :ask_for_shipping_address => true - } - } -} - - -result = checkout_api.update_payment_link( - id: id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/customer-custom-attributes.md b/doc/api/customer-custom-attributes.md deleted file mode 100644 index 03d8e5fe0..000000000 --- a/doc/api/customer-custom-attributes.md +++ /dev/null @@ -1,509 +0,0 @@ -# Customer Custom Attributes - -```ruby -customer_custom_attributes_api = client.customer_custom_attributes -``` - -## 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`. - -```ruby -def list_customer_custom_attribute_definitions(limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | 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` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Customer Custom Attribute Definitions Response Hash`](../../doc/models/list-customer-custom-attribute-definitions-response.md). - -## Example Usage - -```ruby -result = customer_custom_attributes_api.list_customer_custom_attribute_definitions - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def create_customer_custom_attribute_definition(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Customer Custom Attribute Definition Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Customer Custom Attribute Definition Response Hash`](../../doc/models/create-customer-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -body = { - :custom_attribute_definition => { - :key => 'favoritemovie', - :name => 'Favorite Movie', - :description => 'The favorite movie of the customer.', - :visibility => 'VISIBILITY_HIDDEN' - } -} - - -result = customer_custom_attributes_api.create_customer_custom_attribute_definition(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def delete_customer_custom_attribute_definition(key:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Customer Custom Attribute Definition Response Hash`](../../doc/models/delete-customer-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - - -result = customer_custom_attributes_api.delete_customer_custom_attribute_definition(key: key) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def retrieve_customer_custom_attribute_definition(key:, - version: nil) -``` - -## 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` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Customer Custom Attribute Definition Response Hash`](../../doc/models/retrieve-customer-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - - -result = customer_custom_attributes_api.retrieve_customer_custom_attribute_definition(key: key) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def update_customer_custom_attribute_definition(key:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to update. | -| `body` | [`Update Customer Custom Attribute Definition Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Customer Custom Attribute Definition Response Hash`](../../doc/models/update-customer-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - -body = { - :custom_attribute_definition => { - :description => 'Update the description as desired.', - :visibility => 'VISIBILITY_READ_ONLY' - } -} - - -result = customer_custom_attributes_api.update_customer_custom_attribute_definition( - key: key, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def bulk_upsert_customer_custom_attributes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Upsert Customer Custom Attributes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Upsert Customer Custom Attributes Response Hash`](../../doc/models/bulk-upsert-customer-custom-attributes-response.md). - -## Example Usage - -```ruby -body = { - :values => { - 'key0' => { - :customer_id => 'customer_id8', - :custom_attribute => {} - }, - 'key1' => { - :customer_id => 'customer_id8', - :custom_attribute => {} - } - } -} - - -result = customer_custom_attributes_api.bulk_upsert_customer_custom_attributes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def list_customer_custom_attributes(customer_id:, - limit: nil, - cursor: nil, - with_definitions: false) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Template, Required | The ID of the target [customer profile](entity:Customer). | -| `limit` | `Integer` | 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` | 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). | -| `with_definitions` | `TrueClass \| FalseClass` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Customer Custom Attributes Response Hash`](../../doc/models/list-customer-custom-attributes-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - -with_definitions = false - - -result = customer_custom_attributes_api.list_customer_custom_attributes( - customer_id: customer_id, - with_definitions: with_definitions -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def delete_customer_custom_attribute(customer_id:, - key:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Customer Custom Attribute Response Hash`](../../doc/models/delete-customer-custom-attribute-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - -key = 'key0' - - -result = customer_custom_attributes_api.delete_customer_custom_attribute( - customer_id: customer_id, - key: key -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def retrieve_customer_custom_attribute(customer_id:, - key:, - with_definition: false, - version: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `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. | -| `with_definition` | `TrueClass \| FalseClass` | 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` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Customer Custom Attribute Response Hash`](../../doc/models/retrieve-customer-custom-attribute-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - -key = 'key0' - -with_definition = false - - -result = customer_custom_attributes_api.retrieve_customer_custom_attribute( - customer_id: customer_id, - key: key, - with_definition: with_definition -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def upsert_customer_custom_attribute(customer_id:, - key:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `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` | [`Upsert Customer Custom Attribute Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Upsert Customer Custom Attribute Response Hash`](../../doc/models/upsert-customer-custom-attribute-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - -key = 'key0' - -body = { - :custom_attribute => {} -} - - -result = customer_custom_attributes_api.upsert_customer_custom_attribute( - customer_id: customer_id, - key: key, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/customer-groups.md b/doc/api/customer-groups.md deleted file mode 100644 index e2a83e3a4..000000000 --- a/doc/api/customer-groups.md +++ /dev/null @@ -1,204 +0,0 @@ -# Customer Groups - -```ruby -customer_groups_api = client.customer_groups -``` - -## 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. - -```ruby -def list_customer_groups(cursor: nil, - limit: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Customer Groups Response Hash`](../../doc/models/list-customer-groups-response.md). - -## Example Usage - -```ruby -result = customer_groups_api.list_customer_groups - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Create Customer Group - -Creates a new customer group for a business. - -The request must include the `name` value of the group. - -```ruby -def create_customer_group(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Customer Group Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Customer Group Response Hash`](../../doc/models/create-customer-group-response.md). - -## Example Usage - -```ruby -body = { - :group => { - :name => 'Loyal Customers' - } -} - - -result = customer_groups_api.create_customer_group(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Delete Customer Group - -Deletes a customer group as identified by the `group_id` value. - -```ruby -def delete_customer_group(group_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `group_id` | `String` | Template, Required | The ID of the customer group to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Customer Group Response Hash`](../../doc/models/delete-customer-group-response.md). - -## Example Usage - -```ruby -group_id = 'group_id0' - - -result = customer_groups_api.delete_customer_group(group_id: group_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Customer Group - -Retrieves a specific customer group as identified by the `group_id` value. - -```ruby -def retrieve_customer_group(group_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `group_id` | `String` | Template, Required | The ID of the customer group to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Customer Group Response Hash`](../../doc/models/retrieve-customer-group-response.md). - -## Example Usage - -```ruby -group_id = 'group_id0' - - -result = customer_groups_api.retrieve_customer_group(group_id: group_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Customer Group - -Updates a customer group as identified by the `group_id` value. - -```ruby -def update_customer_group(group_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `group_id` | `String` | Template, Required | The ID of the customer group to update. | -| `body` | [`Update Customer Group Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Customer Group Response Hash`](../../doc/models/update-customer-group-response.md). - -## Example Usage - -```ruby -group_id = 'group_id0' - -body = { - :group => { - :name => 'Loyal Customers' - } -} - - -result = customer_groups_api.update_customer_group( - group_id: group_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/customer-segments.md b/doc/api/customer-segments.md deleted file mode 100644 index f94ba0563..000000000 --- a/doc/api/customer-segments.md +++ /dev/null @@ -1,82 +0,0 @@ -# Customer Segments - -```ruby -customer_segments_api = client.customer_segments -``` - -## 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. - -```ruby -def list_customer_segments(cursor: nil, - limit: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Customer Segments Response Hash`](../../doc/models/list-customer-segments-response.md). - -## Example Usage - -```ruby -result = customer_segments_api.list_customer_segments - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Customer Segment - -Retrieves a specific customer segment as identified by the `segment_id` value. - -```ruby -def retrieve_customer_segment(segment_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `segment_id` | `String` | Template, Required | The Square-issued ID of the customer segment. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Customer Segment Response Hash`](../../doc/models/retrieve-customer-segment-response.md). - -## Example Usage - -```ruby -segment_id = 'segment_id4' - - -result = customer_segments_api.retrieve_customer_segment(segment_id: segment_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/customers.md b/doc/api/customers.md deleted file mode 100644 index d456b3754..000000000 --- a/doc/api/customers.md +++ /dev/null @@ -1,728 +0,0 @@ -# Customers - -```ruby -customers_api = client.customers -``` - -## 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. - -```ruby -def list_customers(cursor: nil, - limit: nil, - sort_field: nil, - sort_order: nil, - count: false) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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). | -| `sort_field` | [`String (Customer Sort Field)`](../../doc/models/customer-sort-field.md) | Query, Optional | Indicates how customers should be sorted.

The default value is `DEFAULT`. | -| `sort_order` | [`String (Sort Order)`](../../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` | `TrueClass \| FalseClass` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Customers Response Hash`](../../doc/models/list-customers-response.md). - -## Example Usage - -```ruby -count = false - - -result = customers_api.list_customers(count: count) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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` - -```ruby -def create_customer(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Customer Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Customer Response Hash`](../../doc/models/create-customer-response.md). - -## Example Usage - -```ruby -body = { - :given_name => 'Amelia', - :family_name => 'Earhart', - :email_address => 'Amelia.Earhart@example.com', - :address => { - :address_line_1 => '500 Electric Ave', - :address_line_2 => 'Suite 600', - :locality => 'New York', - :administrative_district_level_1 => 'NY', - :postal_code => '10003', - :country => 'US' - }, - :phone_number => '+1-212-555-4240', - :reference_id => 'YOUR_REFERENCE_ID', - :note => 'a customer' -} - - -result = customers_api.create_customer(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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` - -```ruby -def bulk_create_customers(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Create Customers Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Create Customers Response Hash`](../../doc/models/bulk-create-customers-response.md). - -## Example Usage - -```ruby -body = { - :customers => { - '8bb76c4f-e35d-4c5b-90de-1194cd9179f0' => { - :given_name => 'Amelia', - :family_name => 'Earhart', - :email_address => 'Amelia.Earhart@example.com', - :address => { - :address_line_1 => '500 Electric Ave', - :address_line_2 => 'Suite 600', - :locality => 'New York', - :administrative_district_level_1 => 'NY', - :postal_code => '10003', - :country => 'US' - }, - :phone_number => '+1-212-555-4240', - :reference_id => 'YOUR_REFERENCE_ID', - :note => 'a customer' - }, - 'd1689f23-b25d-4932-b2f0-aed00f5e2029' => { - :given_name => 'Marie', - :family_name => 'Curie', - :email_address => 'Marie.Curie@example.com', - :address => { - :address_line_1 => '500 Electric Ave', - :address_line_2 => 'Suite 601', - :locality => 'New York', - :administrative_district_level_1 => 'NY', - :postal_code => '10003', - :country => 'US' - }, - :phone_number => '+1-212-444-4240', - :reference_id => 'YOUR_REFERENCE_ID', - :note => 'another customer' - } - } -} - - -result = customers_api.bulk_create_customers(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Bulk Delete Customers - -Deletes multiple customer profiles. - -The endpoint takes a list of customer IDs and returns a map of responses. - -```ruby -def bulk_delete_customers(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Delete Customers Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Delete Customers Response Hash`](../../doc/models/bulk-delete-customers-response.md). - -## Example Usage - -```ruby -body = { - :customer_ids => [ - '8DDA5NZVBZFGAX0V3HPF81HHE0', - 'N18CPRVXR5214XPBBA6BZQWF3C', - '2GYD7WNXF7BJZW1PMGNXZ3Y8M8' - ] -} - - -result = customers_api.bulk_delete_customers(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Bulk Retrieve Customers - -Retrieves multiple customer profiles. - -This endpoint takes a list of customer IDs and returns a map of responses. - -```ruby -def bulk_retrieve_customers(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Retrieve Customers Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Retrieve Customers Response Hash`](../../doc/models/bulk-retrieve-customers-response.md). - -## Example Usage - -```ruby -body = { - :customer_ids => [ - '8DDA5NZVBZFGAX0V3HPF81HHE0', - 'N18CPRVXR5214XPBBA6BZQWF3C', - '2GYD7WNXF7BJZW1PMGNXZ3Y8M8' - ] -} - - -result = customers_api.bulk_retrieve_customers(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def bulk_update_customers(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Update Customers Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Update Customers Response Hash`](../../doc/models/bulk-update-customers-response.md). - -## Example Usage - -```ruby -body = { - :customers => { - '8DDA5NZVBZFGAX0V3HPF81HHE0' => { - :email_address => 'New.Amelia.Earhart@example.com', - :phone_number => 'phone_number2', - :note => 'updated customer note', - :version => 2 - }, - 'N18CPRVXR5214XPBBA6BZQWF3C' => { - :given_name => 'Marie', - :family_name => 'Curie', - :version => 0 - } - } -} - - -result = customers_api.bulk_update_customers(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_customers(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Customers Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Customers Response Hash`](../../doc/models/search-customers-response.md). - -## Example Usage - -```ruby -body = { - :limit => 2, - :query => { - :filter => { - :creation_source => { - :values => [ - 'THIRD_PARTY' - ], - :rule => 'INCLUDE' - }, - :created_at => { - :start_at => '2018-01-01T00:00:00-00:00', - :end_at => '2018-02-01T00:00:00-00:00' - }, - :email_address => { - :fuzzy => 'example.com' - }, - :group_ids => { - :all => [ - '545AXB44B4XXWMVQ4W8SBT3HHF' - ] - } - }, - :sort => { - :field => 'CREATED_AT', - :order => 'ASC' - } - } -} - - -result = customers_api.search_customers(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def delete_customer(customer_id:, - version: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Template, Required | The ID of the customer to delete. | -| `version` | `Integer` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Customer Response Hash`](../../doc/models/delete-customer-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - - -result = customers_api.delete_customer(customer_id: customer_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Customer - -Returns details for a single customer. - -```ruby -def retrieve_customer(customer_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Template, Required | The ID of the customer to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Customer Response Hash`](../../doc/models/retrieve-customer-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - - -result = customers_api.retrieve_customer(customer_id: customer_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def update_customer(customer_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Template, Required | The ID of the customer to update. | -| `body` | [`Update Customer Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Customer Response Hash`](../../doc/models/update-customer-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - -body = { - :email_address => 'New.Amelia.Earhart@example.com', - :phone_number => 'phone_number2', - :note => 'updated customer note', - :version => 2 -} - - -result = customers_api.update_customer( - customer_id: customer_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_customer_card(customer_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Template, Required | The Square ID of the customer profile the card is linked to. | -| `body` | [`Create Customer Card Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Customer Card Response Hash`](../../doc/models/create-customer-card-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - -body = { - :card_nonce => 'YOUR_CARD_NONCE', - :billing_address => { - :address_line_1 => '500 Electric Ave', - :address_line_2 => 'Suite 600', - :locality => 'New York', - :administrative_district_level_1 => 'NY', - :postal_code => '10003', - :country => 'US' - }, - :cardholder_name => 'Amelia Earhart' -} - - -result = customers_api.create_customer_card( - customer_id: customer_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Delete Customer Card - -**This endpoint is deprecated.** - -Removes a card on file from a customer. - -```ruby -def delete_customer_card(customer_id:, - card_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Template, Required | The ID of the customer that the card on file belongs to. | -| `card_id` | `String` | Template, Required | The ID of the card on file to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Customer Card Response Hash`](../../doc/models/delete-customer-card-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - -card_id = 'card_id4' - - -result = customers_api.delete_customer_card( - customer_id: customer_id, - card_id: card_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def remove_group_from_customer(customer_id:, - group_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Template, Required | The ID of the customer to remove from the group. | -| `group_id` | `String` | Template, Required | The ID of the customer group to remove the customer from. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Remove Group From Customer Response Hash`](../../doc/models/remove-group-from-customer-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - -group_id = 'group_id0' - - -result = customers_api.remove_group_from_customer( - customer_id: customer_id, - group_id: group_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def add_group_to_customer(customer_id:, - group_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Template, Required | The ID of the customer to add to a group. | -| `group_id` | `String` | Template, Required | The ID of the customer group to add the customer to. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Add Group to Customer Response Hash`](../../doc/models/add-group-to-customer-response.md). - -## Example Usage - -```ruby -customer_id = 'customer_id8' - -group_id = 'group_id0' - - -result = customers_api.add_group_to_customer( - customer_id: customer_id, - group_id: group_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/devices.md b/doc/api/devices.md deleted file mode 100644 index 6eec49d5b..000000000 --- a/doc/api/devices.md +++ /dev/null @@ -1,203 +0,0 @@ -# Devices - -```ruby -devices_api = client.devices -``` - -## 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. - -```ruby -def list_devices(cursor: nil, - sort_order: nil, - limit: nil, - location_id: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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. | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Query, Optional | The order in which results are listed.

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | -| `limit` | `Integer` | Query, Optional | The number of results to return in a single page. | -| `location_id` | `String` | Query, Optional | If present, only returns devices at the target location. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Devices Response Hash`](../../doc/models/list-devices-response.md). - -## Example Usage - -```ruby -result = devices_api.list_devices - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Device Codes - -Lists all DeviceCodes associated with the merchant. - -```ruby -def list_device_codes(cursor: nil, - location_id: nil, - product_type: nil, - status: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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. | -| `location_id` | `String` | Query, Optional | If specified, only returns DeviceCodes of the specified location.
Returns DeviceCodes of all locations if empty. | -| `product_type` | [`String (Product Type)`](../../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 (Device Code Status)`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Device Codes Response Hash`](../../doc/models/list-device-codes-response.md). - -## Example Usage - -```ruby -result = devices_api.list_device_codes - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Create Device Code - -Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected -terminal mode. - -```ruby -def create_device_code(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Device Code Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Device Code Response Hash`](../../doc/models/create-device-code-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => '01bb00a6-0c86-4770-94ed-f5fca973cd56', - :device_code => { - :product_type => 'TERMINAL_API', - :name => 'Counter 1', - :location_id => 'B5E4484SHHNYH' - } -} - - -result = devices_api.create_device_code(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Device Code - -Retrieves DeviceCode with the associated ID. - -```ruby -def get_device_code(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The unique identifier for the device code. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Device Code Response Hash`](../../doc/models/get-device-code-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = devices_api.get_device_code(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Device - -Retrieves Device with the associated `device_id`. - -```ruby -def get_device(device_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `device_id` | `String` | Template, Required | The unique ID for the desired `Device`. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Device Response Hash`](../../doc/models/get-device-response.md). - -## Example Usage - -```ruby -device_id = 'device_id6' - - -result = devices_api.get_device(device_id: device_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/disputes.md b/doc/api/disputes.md deleted file mode 100644 index 334712892..000000000 --- a/doc/api/disputes.md +++ /dev/null @@ -1,374 +0,0 @@ -# Disputes - -```ruby -disputes_api = client.disputes -``` - -## 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. - -```ruby -def list_disputes(cursor: nil, - states: nil, - location_id: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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 (Dispute State)`](../../doc/models/dispute-state.md) | Query, Optional | The dispute states used to filter the result. If not specified, the endpoint returns all disputes. | -| `location_id` | `String` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Disputes Response Hash`](../../doc/models/list-disputes-response.md). - -## Example Usage - -```ruby -result = disputes_api.list_disputes - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Dispute - -Returns details about a specific dispute. - -```ruby -def retrieve_dispute(dispute_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dispute_id` | `String` | Template, Required | The ID of the dispute you want more details about. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Dispute Response Hash`](../../doc/models/retrieve-dispute-response.md). - -## Example Usage - -```ruby -dispute_id = 'dispute_id2' - - -result = disputes_api.retrieve_dispute(dispute_id: dispute_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def accept_dispute(dispute_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dispute_id` | `String` | Template, Required | The ID of the dispute you want to accept. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Accept Dispute Response Hash`](../../doc/models/accept-dispute-response.md). - -## Example Usage - -```ruby -dispute_id = 'dispute_id2' - - -result = disputes_api.accept_dispute(dispute_id: dispute_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Dispute Evidence - -Returns a list of evidence associated with a dispute. - -```ruby -def list_dispute_evidence(dispute_id:, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dispute_id` | `String` | Template, Required | The ID of the dispute. | -| `cursor` | `String` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Dispute Evidence Response Hash`](../../doc/models/list-dispute-evidence-response.md). - -## Example Usage - -```ruby -dispute_id = 'dispute_id2' - - -result = disputes_api.list_dispute_evidence(dispute_id: dispute_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_dispute_evidence_file(dispute_id:, - request: nil, - image_file: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dispute_id` | `String` | Template, Required | The ID of the dispute for which you want to upload evidence. | -| `request` | [`Create Dispute Evidence File Request Hash`](../../doc/models/create-dispute-evidence-file-request.md) | Form (JSON-Encoded), Optional | Defines the parameters for a `CreateDisputeEvidenceFile` request. | -| `image_file` | `File \| UploadIO` | Form, Optional | - | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Dispute Evidence File Response Hash`](../../doc/models/create-dispute-evidence-file-response.md). - -## Example Usage - -```ruby -dispute_id = 'dispute_id2' - - -result = disputes_api.create_dispute_evidence_file(dispute_id: dispute_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Create Dispute Evidence Text - -Uploads text to use as evidence for a dispute challenge. - -```ruby -def create_dispute_evidence_text(dispute_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dispute_id` | `String` | Template, Required | The ID of the dispute for which you want to upload evidence. | -| `body` | [`Create Dispute Evidence Text Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Dispute Evidence Text Response Hash`](../../doc/models/create-dispute-evidence-text-response.md). - -## Example Usage - -```ruby -dispute_id = 'dispute_id2' - -body = { - :idempotency_key => 'ed3ee3933d946f1514d505d173c82648', - :evidence_text => '1Z8888888888888888', - :evidence_type => 'TRACKING_NUMBER' -} - - -result = disputes_api.create_dispute_evidence_text( - dispute_id: dispute_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Delete Dispute Evidence - -Removes specified evidence from a dispute. -Square does not send the bank any evidence that is removed. - -```ruby -def delete_dispute_evidence(dispute_id:, - evidence_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dispute_id` | `String` | Template, Required | The ID of the dispute from which you want to remove evidence. | -| `evidence_id` | `String` | Template, Required | The ID of the evidence you want to remove. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Dispute Evidence Response Hash`](../../doc/models/delete-dispute-evidence-response.md). - -## Example Usage - -```ruby -dispute_id = 'dispute_id2' - -evidence_id = 'evidence_id2' - - -result = disputes_api.delete_dispute_evidence( - dispute_id: dispute_id, - evidence_id: evidence_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def retrieve_dispute_evidence(dispute_id:, - evidence_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dispute_id` | `String` | Template, Required | The ID of the dispute from which you want to retrieve evidence metadata. | -| `evidence_id` | `String` | Template, Required | The ID of the evidence to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Dispute Evidence Response Hash`](../../doc/models/retrieve-dispute-evidence-response.md). - -## Example Usage - -```ruby -dispute_id = 'dispute_id2' - -evidence_id = 'evidence_id2' - - -result = disputes_api.retrieve_dispute_evidence( - dispute_id: dispute_id, - evidence_id: evidence_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def submit_evidence(dispute_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dispute_id` | `String` | Template, Required | The ID of the dispute for which you want to submit evidence. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Submit Evidence Response Hash`](../../doc/models/submit-evidence-response.md). - -## Example Usage - -```ruby -dispute_id = 'dispute_id2' - - -result = disputes_api.submit_evidence(dispute_id: dispute_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/employees.md b/doc/api/employees.md deleted file mode 100644 index 45b70d40d..000000000 --- a/doc/api/employees.md +++ /dev/null @@ -1,86 +0,0 @@ -# Employees - -```ruby -employees_api = client.employees -``` - -## 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.** - -```ruby -def list_employees(location_id: nil, - status: nil, - limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Query, Optional | - | -| `status` | [`String (Employee Status)`](../../doc/models/employee-status.md) | Query, Optional | Specifies the EmployeeStatus to filter the employee by. | -| `limit` | `Integer` | Query, Optional | The number of employees to be returned on each page. | -| `cursor` | `String` | Query, Optional | The token required to retrieve the specified page of results. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Employees Response Hash`](../../doc/models/list-employees-response.md). - -## Example Usage - -```ruby -result = employees_api.list_employees - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Employee - -**This endpoint is deprecated.** - -```ruby -def retrieve_employee(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | UUID for the employee that was requested. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Employee Response Hash`](../../doc/models/retrieve-employee-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = employees_api.retrieve_employee(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/events.md b/doc/api/events.md deleted file mode 100644 index 8ba3e43da..000000000 --- a/doc/api/events.md +++ /dev/null @@ -1,134 +0,0 @@ -# Events - -```ruby -events_api = client.events -``` - -## 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. - -```ruby -def search_events(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Events Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Events Response Hash`](../../doc/models/search-events-response.md). - -## Example Usage - -```ruby -body = {} - - -result = events_api.search_events(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def disable_events -``` - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Disable Events Response Hash`](../../doc/models/disable-events-response.md). - -## Example Usage - -```ruby -result = events_api.disable_events - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Enable Events - -Enables events to make them searchable. Only events that occur while in the enabled state are searchable. - -```ruby -def enable_events -``` - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Enable Events Response Hash`](../../doc/models/enable-events-response.md). - -## Example Usage - -```ruby -result = events_api.enable_events - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Event Types - -Lists all event types that you can subscribe to as webhooks or query using the Events API. - -```ruby -def list_event_types(api_version: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `api_version` | `String` | Query, Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Event Types Response Hash`](../../doc/models/list-event-types-response.md). - -## Example Usage - -```ruby -result = events_api.list_event_types - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/gift-card-activities.md b/doc/api/gift-card-activities.md deleted file mode 100644 index 377738974..000000000 --- a/doc/api/gift-card-activities.md +++ /dev/null @@ -1,109 +0,0 @@ -# Gift Card Activities - -```ruby -gift_card_activities_api = client.gift_card_activities -``` - -## 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. - -```ruby -def list_gift_card_activities(gift_card_id: nil, - type: nil, - location_id: nil, - begin_time: nil, - end_time: nil, - limit: nil, - cursor: nil, - sort_order: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `gift_card_id` | `String` | 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` | 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. | -| `location_id` | `String` | 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. | -| `begin_time` | `String` | 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. | -| `end_time` | `String` | 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` | `Integer` | 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` | 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). | -| `sort_order` | `String` | Query, Optional | The order in which the endpoint returns the activities, based on `created_at`.

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Gift Card Activities Response Hash`](../../doc/models/list-gift-card-activities-response.md). - -## Example Usage - -```ruby -result = gift_card_activities_api.list_gift_card_activities - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_gift_card_activity(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Gift Card Activity Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Gift Card Activity Response Hash`](../../doc/models/create-gift-card-activity-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => 'U16kfr-kA70er-q4Rsym-7U7NnY', - :gift_card_activity => { - :type => 'ACTIVATE', - :location_id => '81FN9BNFZTKS4', - :gift_card_id => 'gftc:6d55a72470d940c6ba09c0ab8ad08d20', - :activate_activity_details => { - :order_id => 'jJNGHm4gLI6XkFbwtiSLqK72KkAZY', - :line_item_uid => 'eIWl7X0nMuO9Ewbh0ChIx' - } - } -} - - -result = gift_card_activities_api.create_gift_card_activity(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/gift-cards.md b/doc/api/gift-cards.md deleted file mode 100644 index ce113800b..000000000 --- a/doc/api/gift-cards.md +++ /dev/null @@ -1,296 +0,0 @@ -# Gift Cards - -```ruby -gift_cards_api = client.gift_cards -``` - -## 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. - -```ruby -def list_gift_cards(type: nil, - state: nil, - limit: nil, - cursor: nil, - customer_id: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | `String` | 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` | 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` | `Integer` | 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` | 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). | -| `customer_id` | `String` | Query, Optional | If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Gift Cards Response Hash`](../../doc/models/list-gift-cards-response.md). - -## Example Usage - -```ruby -result = gift_cards_api.list_gift_cards - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_gift_card(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Gift Card Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Gift Card Response Hash`](../../doc/models/create-gift-card-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => 'NC9Tm69EjbjtConu', - :location_id => '81FN9BNFZTKS4', - :gift_card => { - :type => 'DIGITAL' - } -} - - -result = gift_cards_api.create_gift_card(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Gift Card From GAN - -Retrieves a gift card using the gift card account number (GAN). - -```ruby -def retrieve_gift_card_from_gan(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Retrieve Gift Card From GAN Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Gift Card From GAN Response Hash`](../../doc/models/retrieve-gift-card-from-gan-response.md). - -## Example Usage - -```ruby -body = { - :gan => '7783320001001635' -} - - -result = gift_cards_api.retrieve_gift_card_from_gan(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Gift Card From Nonce - -Retrieves a gift card using a secure payment token that represents the gift card. - -```ruby -def retrieve_gift_card_from_nonce(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Retrieve Gift Card From Nonce Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Gift Card From Nonce Response Hash`](../../doc/models/retrieve-gift-card-from-nonce-response.md). - -## Example Usage - -```ruby -body = { - :nonce => 'cnon:7783322135245171' -} - - -result = gift_cards_api.retrieve_gift_card_from_nonce(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Link Customer to Gift Card - -Links a customer to a gift card, which is also referred to as adding a card on file. - -```ruby -def link_customer_to_gift_card(gift_card_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `gift_card_id` | `String` | Template, Required | The ID of the gift card to be linked. | -| `body` | [`Link Customer to Gift Card Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Link Customer to Gift Card Response Hash`](../../doc/models/link-customer-to-gift-card-response.md). - -## Example Usage - -```ruby -gift_card_id = 'gift_card_id8' - -body = { - :customer_id => 'GKY0FZ3V717AH8Q2D821PNT2ZW' -} - - -result = gift_cards_api.link_customer_to_gift_card( - gift_card_id: gift_card_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Unlink Customer From Gift Card - -Unlinks a customer from a gift card, which is also referred to as removing a card on file. - -```ruby -def unlink_customer_from_gift_card(gift_card_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `gift_card_id` | `String` | Template, Required | The ID of the gift card to be unlinked. | -| `body` | [`Unlink Customer From Gift Card Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Unlink Customer From Gift Card Response Hash`](../../doc/models/unlink-customer-from-gift-card-response.md). - -## Example Usage - -```ruby -gift_card_id = 'gift_card_id8' - -body = { - :customer_id => 'GKY0FZ3V717AH8Q2D821PNT2ZW' -} - - -result = gift_cards_api.unlink_customer_from_gift_card( - gift_card_id: gift_card_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Gift Card - -Retrieves a gift card using the gift card ID. - -```ruby -def retrieve_gift_card(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the gift card to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Gift Card Response Hash`](../../doc/models/retrieve-gift-card-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = gift_cards_api.retrieve_gift_card(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/inventory.md b/doc/api/inventory.md deleted file mode 100644 index 27cd50836..000000000 --- a/doc/api/inventory.md +++ /dev/null @@ -1,612 +0,0 @@ -# Inventory - -```ruby -inventory_api = client.inventory -``` - -## 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. - -```ruby -def deprecated_retrieve_inventory_adjustment(adjustment_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `adjustment_id` | `String` | Template, Required | ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Inventory Adjustment Response Hash`](../../doc/models/retrieve-inventory-adjustment-response.md). - -## Example Usage - -```ruby -adjustment_id = 'adjustment_id0' - - -result = inventory_api.deprecated_retrieve_inventory_adjustment(adjustment_id: adjustment_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Inventory Adjustment - -Returns the [InventoryAdjustment](../../doc/models/inventory-adjustment.md) object -with the provided `adjustment_id`. - -```ruby -def retrieve_inventory_adjustment(adjustment_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `adjustment_id` | `String` | Template, Required | ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Inventory Adjustment Response Hash`](../../doc/models/retrieve-inventory-adjustment-response.md). - -## Example Usage - -```ruby -adjustment_id = 'adjustment_id0' - - -result = inventory_api.retrieve_inventory_adjustment(adjustment_id: adjustment_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def deprecated_batch_change_inventory(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Batch Change Inventory Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Batch Change Inventory Response Hash`](../../doc/models/batch-change-inventory-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe', - :changes => [ - { - :type => 'PHYSICAL_COUNT', - :physical_count => { - :reference_id => '1536bfbf-efed-48bf-b17d-a197141b2a92', - :catalog_object_id => 'W62UWFY35CWMYGVWK6TWJDNI', - :state => 'IN_STOCK', - :location_id => 'C6W5YS5QM06F5', - :quantity => '53', - :team_member_id => 'LRK57NSQ5X7PUD05', - :occurred_at => '2016-11-16T22:25:24.878Z' - } - } - ], - :ignore_unchanged_counts => true -} - - -result = inventory_api.deprecated_batch_change_inventory(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def deprecated_batch_retrieve_inventory_changes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Batch Retrieve Inventory Changes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Batch Retrieve Inventory Changes Response Hash`](../../doc/models/batch-retrieve-inventory-changes-response.md). - -## Example Usage - -```ruby -body = { - :catalog_object_ids => [ - 'W62UWFY35CWMYGVWK6TWJDNI' - ], - :location_ids => [ - 'C6W5YS5QM06F5' - ], - :types => [ - 'PHYSICAL_COUNT' - ], - :states => [ - 'IN_STOCK' - ], - :updated_after => '2016-11-01T00:00:00.000Z', - :updated_before => '2016-12-01T00:00:00.000Z' -} - - -result = inventory_api.deprecated_batch_retrieve_inventory_changes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def deprecated_batch_retrieve_inventory_counts(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Batch Retrieve Inventory Counts Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Batch Retrieve Inventory Counts Response Hash`](../../doc/models/batch-retrieve-inventory-counts-response.md). - -## Example Usage - -```ruby -body = { - :catalog_object_ids => [ - 'W62UWFY35CWMYGVWK6TWJDNI' - ], - :location_ids => [ - '59TNP9SA8VGDA' - ], - :updated_after => '2016-11-16T00:00:00.000Z' -} - - -result = inventory_api.deprecated_batch_retrieve_inventory_counts(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def batch_change_inventory(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Batch Change Inventory Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Batch Change Inventory Response Hash`](../../doc/models/batch-change-inventory-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe', - :changes => [ - { - :type => 'PHYSICAL_COUNT', - :physical_count => { - :reference_id => '1536bfbf-efed-48bf-b17d-a197141b2a92', - :catalog_object_id => 'W62UWFY35CWMYGVWK6TWJDNI', - :state => 'IN_STOCK', - :location_id => 'C6W5YS5QM06F5', - :quantity => '53', - :team_member_id => 'LRK57NSQ5X7PUD05', - :occurred_at => '2016-11-16T22:25:24.878Z' - } - } - ], - :ignore_unchanged_counts => true -} - - -result = inventory_api.batch_change_inventory(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def batch_retrieve_inventory_changes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Batch Retrieve Inventory Changes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Batch Retrieve Inventory Changes Response Hash`](../../doc/models/batch-retrieve-inventory-changes-response.md). - -## Example Usage - -```ruby -body = { - :catalog_object_ids => [ - 'W62UWFY35CWMYGVWK6TWJDNI' - ], - :location_ids => [ - 'C6W5YS5QM06F5' - ], - :types => [ - 'PHYSICAL_COUNT' - ], - :states => [ - 'IN_STOCK' - ], - :updated_after => '2016-11-01T00:00:00.000Z', - :updated_before => '2016-12-01T00:00:00.000Z' -} - - -result = inventory_api.batch_retrieve_inventory_changes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def batch_retrieve_inventory_counts(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Batch Retrieve Inventory Counts Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Batch Retrieve Inventory Counts Response Hash`](../../doc/models/batch-retrieve-inventory-counts-response.md). - -## Example Usage - -```ruby -body = { - :catalog_object_ids => [ - 'W62UWFY35CWMYGVWK6TWJDNI' - ], - :location_ids => [ - '59TNP9SA8VGDA' - ], - :updated_after => '2016-11-16T00:00:00.000Z' -} - - -result = inventory_api.batch_retrieve_inventory_counts(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def deprecated_retrieve_inventory_physical_count(physical_count_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `physical_count_id` | `String` | Template, Required | ID of the
[InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Inventory Physical Count Response Hash`](../../doc/models/retrieve-inventory-physical-count-response.md). - -## Example Usage - -```ruby -physical_count_id = 'physical_count_id2' - - -result = inventory_api.deprecated_retrieve_inventory_physical_count(physical_count_id: physical_count_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Inventory Physical Count - -Returns the [InventoryPhysicalCount](../../doc/models/inventory-physical-count.md) -object with the provided `physical_count_id`. - -```ruby -def retrieve_inventory_physical_count(physical_count_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `physical_count_id` | `String` | Template, Required | ID of the
[InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Inventory Physical Count Response Hash`](../../doc/models/retrieve-inventory-physical-count-response.md). - -## Example Usage - -```ruby -physical_count_id = 'physical_count_id2' - - -result = inventory_api.retrieve_inventory_physical_count(physical_count_id: physical_count_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Inventory Transfer - -Returns the [InventoryTransfer](../../doc/models/inventory-transfer.md) object -with the provided `transfer_id`. - -```ruby -def retrieve_inventory_transfer(transfer_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `transfer_id` | `String` | Template, Required | ID of the [InventoryTransfer](entity:InventoryTransfer) to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Inventory Transfer Response Hash`](../../doc/models/retrieve-inventory-transfer-response.md). - -## Example Usage - -```ruby -transfer_id = 'transfer_id6' - - -result = inventory_api.retrieve_inventory_transfer(transfer_id: transfer_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def retrieve_inventory_count(catalog_object_id:, - location_ids: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `catalog_object_id` | `String` | Template, Required | ID of the [CatalogObject](entity:CatalogObject) to retrieve. | -| `location_ids` | `String` | Query, Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | -| `cursor` | `String` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Inventory Count Response Hash`](../../doc/models/retrieve-inventory-count-response.md). - -## Example Usage - -```ruby -catalog_object_id = 'catalog_object_id6' - - -result = inventory_api.retrieve_inventory_count(catalog_object_id: catalog_object_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def retrieve_inventory_changes(catalog_object_id:, - location_ids: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `catalog_object_id` | `String` | Template, Required | ID of the [CatalogObject](entity:CatalogObject) to retrieve. | -| `location_ids` | `String` | Query, Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | -| `cursor` | `String` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Inventory Changes Response Hash`](../../doc/models/retrieve-inventory-changes-response.md). - -## Example Usage - -```ruby -catalog_object_id = 'catalog_object_id6' - - -result = inventory_api.retrieve_inventory_changes(catalog_object_id: catalog_object_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/invoices.md b/doc/api/invoices.md deleted file mode 100644 index ef395fd8f..000000000 --- a/doc/api/invoices.md +++ /dev/null @@ -1,533 +0,0 @@ -# Invoices - -```ruby -invoices_api = client.invoices -``` - -## 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. - -```ruby -def list_invoices(location_id:, - cursor: nil, - limit: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Query, Required | The ID of the location for which to list invoices. | -| `cursor` | `String` | 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` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Invoices Response Hash`](../../doc/models/list-invoices-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - - -result = invoices_api.list_invoices(location_id: location_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def create_invoice(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Invoice Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Invoice Response Hash`](../../doc/models/create-invoice-response.md). - -## Example Usage - -```ruby -body = { - :invoice => { - :location_id => 'ES0RJRZYEC39A', - :order_id => 'CAISENgvlJ6jLWAzERDzjyHVybY', - :primary_recipient => { - :customer_id => 'JDKYHBWT1D4F8MFH63DBMEN8Y4' - }, - :payment_requests => [ - { - :request_type => 'BALANCE', - :due_date => '2030-01-24', - :tipping_enabled => true, - :automatic_payment_source => 'NONE', - :reminders => [ - { - :relative_scheduled_days => -1, - :message => 'Your invoice is due tomorrow' - } - ] - } - ], - :delivery_method => 'EMAIL', - :invoice_number => 'inv-100', - :title => 'Event Planning Services', - :description => 'We appreciate your business!', - :scheduled_at => '2030-01-13T10:00:00Z', - :accepted_payment_methods => { - :card => true, - :square_gift_card => false, - :bank_account => false, - :buy_now_pay_later => false, - :cash_app_pay => false - }, - :custom_fields => [ - { - :label => 'Event Reference Number', - :value => 'Ref. #1234', - :placement => 'ABOVE_LINE_ITEMS' - }, - { - :label => 'Terms of Service', - :value => 'The terms of service are...', - :placement => 'BELOW_LINE_ITEMS' - } - ], - :sale_or_service_date => '2030-01-24', - :store_payment_method_enabled => false - }, - :idempotency_key => 'ce3748f9-5fc1-4762-aa12-aae5e843f1f4' -} - - -result = invoices_api.create_invoice(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_invoices(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Invoices Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Invoices Response Hash`](../../doc/models/search-invoices-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :filter => { - :location_ids => [ - 'ES0RJRZYEC39A' - ], - :customer_ids => [ - 'JDKYHBWT1D4F8MFH63DBMEN8Y4' - ] - }, - :sort => { - :field => 'INVOICE_SORT_DATE', - :order => 'DESC' - } - } -} - - -result = invoices_api.search_invoices(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def delete_invoice(invoice_id:, - version: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice_id` | `String` | Template, Required | The ID of the invoice to delete. | -| `version` | `Integer` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Invoice Response Hash`](../../doc/models/delete-invoice-response.md). - -## Example Usage - -```ruby -invoice_id = 'invoice_id0' - - -result = invoices_api.delete_invoice(invoice_id: invoice_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Invoice - -Retrieves an invoice by invoice ID. - -```ruby -def get_invoice(invoice_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice_id` | `String` | Template, Required | The ID of the invoice to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Invoice Response Hash`](../../doc/models/get-invoice-response.md). - -## Example Usage - -```ruby -invoice_id = 'invoice_id0' - - -result = invoices_api.get_invoice(invoice_id: invoice_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def update_invoice(invoice_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice_id` | `String` | Template, Required | The ID of the invoice to update. | -| `body` | [`Update Invoice Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Invoice Response Hash`](../../doc/models/update-invoice-response.md). - -## Example Usage - -```ruby -invoice_id = 'invoice_id0' - -body = { - :invoice => { - :version => 1, - :payment_requests => [ - { - :uid => '2da7964f-f3d2-4f43-81e8-5aa220bf3355', - :tipping_enabled => false, - :reminders => [ - {}, - {}, - {} - ] - } - ] - }, - :idempotency_key => '4ee82288-0910-499e-ab4c-5d0071dad1be' -} - - -result = invoices_api.update_invoice( - invoice_id: invoice_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_invoice_attachment(invoice_id:, - request: nil, - image_file: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice_id` | `String` | Template, Required | The ID of the [invoice](entity:Invoice) to attach the file to. | -| `request` | [`Create Invoice Attachment Request Hash`](../../doc/models/create-invoice-attachment-request.md) | Form (JSON-Encoded), Optional | Represents a [CreateInvoiceAttachment](../../doc/api/invoices.md#create-invoice-attachment) request. | -| `image_file` | `File \| UploadIO` | Form, Optional | - | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Invoice Attachment Response Hash`](../../doc/models/create-invoice-attachment-response.md). - -## Example Usage - -```ruby -invoice_id = 'invoice_id0' - -request = { - :idempotency_key => 'ae5e84f9-4742-4fc1-ba12-a3ce3748f1c3', - :description => 'Service contract' -} - - -result = invoices_api.create_invoice_attachment( - invoice_id: invoice_id, - request: request -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def delete_invoice_attachment(invoice_id:, - attachment_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice_id` | `String` | Template, Required | The ID of the [invoice](entity:Invoice) to delete the attachment from. | -| `attachment_id` | `String` | Template, Required | The ID of the [attachment](entity:InvoiceAttachment) to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Invoice Attachment Response Hash`](../../doc/models/delete-invoice-attachment-response.md). - -## Example Usage - -```ruby -invoice_id = 'invoice_id0' - -attachment_id = 'attachment_id6' - - -result = invoices_api.delete_invoice_attachment( - invoice_id: invoice_id, - attachment_id: attachment_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def cancel_invoice(invoice_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice_id` | `String` | Template, Required | The ID of the [invoice](entity:Invoice) to cancel. | -| `body` | [`Cancel Invoice Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Cancel Invoice Response Hash`](../../doc/models/cancel-invoice-response.md). - -## Example Usage - -```ruby -invoice_id = 'invoice_id0' - -body = { - :version => 0 -} - - -result = invoices_api.cancel_invoice( - invoice_id: invoice_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def publish_invoice(invoice_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice_id` | `String` | Template, Required | The ID of the invoice to publish. | -| `body` | [`Publish Invoice Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Publish Invoice Response Hash`](../../doc/models/publish-invoice-response.md). - -## Example Usage - -```ruby -invoice_id = 'invoice_id0' - -body = { - :version => 1, - :idempotency_key => '32da42d0-1997-41b0-826b-f09464fc2c2e' -} - - -result = invoices_api.publish_invoice( - invoice_id: invoice_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/labor.md b/doc/api/labor.md deleted file mode 100644 index 693d49768..000000000 --- a/doc/api/labor.md +++ /dev/null @@ -1,751 +0,0 @@ -# Labor - -```ruby -labor_api = client.labor -``` - -## 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. - -```ruby -def list_break_types(location_id: nil, - limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Query, Optional | Filter the returned `BreakType` results to only those that are associated with the
specified location. | -| `limit` | `Integer` | 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` | Query, Optional | A pointer to the next page of `BreakType` results to fetch. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Break Types Response Hash`](../../doc/models/list-break-types-response.md). - -## Example Usage - -```ruby -result = labor_api.list_break_types - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_break_type(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Break Type Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Break Type Response Hash`](../../doc/models/create-break-type-response.md). - -## Example Usage - -```ruby -body = { - :break_type => { - :location_id => 'CGJN03P1D08GF', - :break_name => 'Lunch Break', - :expected_duration => 'PT30M', - :is_paid => true - }, - :idempotency_key => 'PAD3NG5KSN2GL' -} - - -result = labor_api.create_break_type(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Delete Break Type - -Deletes an existing `BreakType`. - -A `BreakType` can be deleted even if it is referenced from a `Shift`. - -```ruby -def delete_break_type(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The UUID for the `BreakType` being deleted. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Break Type Response Hash`](../../doc/models/delete-break-type-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = labor_api.delete_break_type(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Break Type - -Returns a single `BreakType` specified by `id`. - -```ruby -def get_break_type(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The UUID for the `BreakType` being retrieved. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Break Type Response Hash`](../../doc/models/get-break-type-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = labor_api.get_break_type(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Break Type - -Updates an existing `BreakType`. - -```ruby -def update_break_type(id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The UUID for the `BreakType` being updated. | -| `body` | [`Update Break Type Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Break Type Response Hash`](../../doc/models/update-break-type-response.md). - -## Example Usage - -```ruby -id = 'id0' - -body = { - :break_type => { - :location_id => '26M7H24AZ9N6R', - :break_name => 'Lunch', - :expected_duration => 'PT50M', - :is_paid => true, - :version => 1 - } -} - - -result = labor_api.update_break_type( - id: id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Employee Wages - -**This endpoint is deprecated.** - -Returns a paginated list of `EmployeeWage` instances for a business. - -```ruby -def list_employee_wages(employee_id: nil, - limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `employee_id` | `String` | Query, Optional | Filter the returned wages to only those that are associated with the specified employee. | -| `limit` | `Integer` | 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` | Query, Optional | A pointer to the next page of `EmployeeWage` results to fetch. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Employee Wages Response Hash`](../../doc/models/list-employee-wages-response.md). - -## Example Usage - -```ruby -result = labor_api.list_employee_wages - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Employee Wage - -**This endpoint is deprecated.** - -Returns a single `EmployeeWage` specified by `id`. - -```ruby -def get_employee_wage(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The UUID for the `EmployeeWage` being retrieved. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Employee Wage Response Hash`](../../doc/models/get-employee-wage-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = labor_api.get_employee_wage(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_shift(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Shift Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Shift Response Hash`](../../doc/models/create-shift-response.md). - -## Example Usage - -```ruby -body = { - :shift => { - :location_id => 'PAA1RJZZKXBFG', - :start_at => '2019-01-25T03:11:00-05:00', - :end_at => '2019-01-25T13:11:00-05:00', - :wage => { - :title => 'Barista', - :hourly_rate => { - :amount => 1100, - :currency => 'USD' - }, - :tip_eligible => true - }, - :breaks => [ - { - :start_at => '2019-01-25T06:11:00-05:00', - :break_type_id => 'REGS1EQR1TPZ5', - :name => 'Tea Break', - :expected_duration => 'PT5M', - :is_paid => true, - :end_at => '2019-01-25T06:16:00-05:00' - } - ], - :team_member_id => 'ormj0jJJZ5OZIzxrZYJI', - :declared_cash_tip_money => { - :amount => 500, - :currency => 'USD' - } - }, - :idempotency_key => 'HIDSNG5KS478L' -} - - -result = labor_api.create_shift(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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` - -```ruby -def search_shifts(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Shifts Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Shifts Response Hash`](../../doc/models/search-shifts-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :filter => { - :workday => { - :date_range => { - :start_date => '2019-01-20', - :end_date => '2019-02-03' - }, - :match_shifts_by => 'START_AT', - :default_timezone => 'America/Los_Angeles' - } - } - }, - :limit => 100 -} - - -result = labor_api.search_shifts(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Delete Shift - -Deletes a `Shift`. - -```ruby -def delete_shift(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The UUID for the `Shift` being deleted. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Shift Response Hash`](../../doc/models/delete-shift-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = labor_api.delete_shift(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Shift - -Returns a single `Shift` specified by `id`. - -```ruby -def get_shift(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The UUID for the `Shift` being retrieved. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Shift Response Hash`](../../doc/models/get-shift-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = labor_api.get_shift(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def update_shift(id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The ID of the object being updated. | -| `body` | [`Update Shift Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Shift Response Hash`](../../doc/models/update-shift-response.md). - -## Example Usage - -```ruby -id = 'id0' - -body = { - :shift => { - :location_id => 'PAA1RJZZKXBFG', - :start_at => '2019-01-25T03:11:00-05:00', - :end_at => '2019-01-25T13:11:00-05:00', - :wage => { - :title => 'Bartender', - :hourly_rate => { - :amount => 1500, - :currency => 'USD' - }, - :tip_eligible => true - }, - :breaks => [ - { - :start_at => '2019-01-25T06:11:00-05:00', - :break_type_id => 'REGS1EQR1TPZ5', - :name => 'Tea Break', - :expected_duration => 'PT5M', - :is_paid => true, - :id => 'X7GAQYVVRRG6P', - :end_at => '2019-01-25T06:16:00-05:00' - } - ], - :version => 1, - :team_member_id => 'ormj0jJJZ5OZIzxrZYJI', - :declared_cash_tip_money => { - :amount => 500, - :currency => 'USD' - } - } -} - - -result = labor_api.update_shift( - id: id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Team Member Wages - -Returns a paginated list of `TeamMemberWage` instances for a business. - -```ruby -def list_team_member_wages(team_member_id: nil, - limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_id` | `String` | Query, Optional | Filter the returned wages to only those that are associated with the
specified team member. | -| `limit` | `Integer` | 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` | Query, Optional | A pointer to the next page of `EmployeeWage` results to fetch. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Team Member Wages Response Hash`](../../doc/models/list-team-member-wages-response.md). - -## Example Usage - -```ruby -result = labor_api.list_team_member_wages - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Team Member Wage - -Returns a single `TeamMemberWage` specified by `id`. - -```ruby -def get_team_member_wage(id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The UUID for the `TeamMemberWage` being retrieved. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Team Member Wage Response Hash`](../../doc/models/get-team-member-wage-response.md). - -## Example Usage - -```ruby -id = 'id0' - - -result = labor_api.get_team_member_wage(id: id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Workweek Configs - -Returns a list of `WorkweekConfig` instances for a business. - -```ruby -def list_workweek_configs(limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | Query, Optional | The maximum number of `WorkweekConfigs` results to return per page. | -| `cursor` | `String` | Query, Optional | A pointer to the next page of `WorkweekConfig` results to fetch. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Workweek Configs Response Hash`](../../doc/models/list-workweek-configs-response.md). - -## Example Usage - -```ruby -result = labor_api.list_workweek_configs - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Workweek Config - -Updates a `WorkweekConfig`. - -```ruby -def update_workweek_config(id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Template, Required | The UUID for the `WorkweekConfig` object being updated. | -| `body` | [`Update Workweek Config Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Workweek Config Response Hash`](../../doc/models/update-workweek-config-response.md). - -## Example Usage - -```ruby -id = 'id0' - -body = { - :workweek_config => { - :start_of_week => 'MON', - :start_of_day_local_time => '10:00', - :version => 10 - } -} - - -result = labor_api.update_workweek_config( - id: id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/location-custom-attributes.md b/doc/api/location-custom-attributes.md deleted file mode 100644 index 475af476d..000000000 --- a/doc/api/location-custom-attributes.md +++ /dev/null @@ -1,529 +0,0 @@ -# Location Custom Attributes - -```ruby -location_custom_attributes_api = client.location_custom_attributes -``` - -## 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`. - -```ruby -def list_location_custom_attribute_definitions(visibility_filter: nil, - limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibility_filter` | [`String (Visibility Filter)`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | -| `limit` | `Integer` | 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` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Location Custom Attribute Definitions Response Hash`](../../doc/models/list-location-custom-attribute-definitions-response.md). - -## Example Usage - -```ruby -result = location_custom_attributes_api.list_location_custom_attribute_definitions - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_location_custom_attribute_definition(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Location Custom Attribute Definition Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Location Custom Attribute Definition Response Hash`](../../doc/models/create-location-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -body = { - :custom_attribute_definition => { - :key => 'bestseller', - :name => 'Bestseller', - :description => 'Bestselling item at location', - :visibility => 'VISIBILITY_READ_WRITE_VALUES' - } -} - - -result = location_custom_attributes_api.create_location_custom_attribute_definition(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def delete_location_custom_attribute_definition(key:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Location Custom Attribute Definition Response Hash`](../../doc/models/delete-location-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - - -result = location_custom_attributes_api.delete_location_custom_attribute_definition(key: key) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def retrieve_location_custom_attribute_definition(key:, - version: nil) -``` - -## 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` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Location Custom Attribute Definition Response Hash`](../../doc/models/retrieve-location-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - - -result = location_custom_attributes_api.retrieve_location_custom_attribute_definition(key: key) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def update_location_custom_attribute_definition(key:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to update. | -| `body` | [`Update Location Custom Attribute Definition Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Location Custom Attribute Definition Response Hash`](../../doc/models/update-location-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - -body = { - :custom_attribute_definition => { - :description => 'Update the description as desired.', - :visibility => 'VISIBILITY_READ_ONLY' - } -} - - -result = location_custom_attributes_api.update_location_custom_attribute_definition( - key: key, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def bulk_delete_location_custom_attributes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Delete Location Custom Attributes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Delete Location Custom Attributes Response Hash`](../../doc/models/bulk-delete-location-custom-attributes-response.md). - -## Example Usage - -```ruby -body = { - :values => { - 'id1' => {}, - 'id2' => {}, - 'id3' => {} - } -} - - -result = location_custom_attributes_api.bulk_delete_location_custom_attributes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def bulk_upsert_location_custom_attributes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Upsert Location Custom Attributes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Upsert Location Custom Attributes Response Hash`](../../doc/models/bulk-upsert-location-custom-attributes-response.md). - -## Example Usage - -```ruby -body = { - :values => { - 'key0' => { - :location_id => 'location_id4', - :custom_attribute => {} - }, - 'key1' => { - :location_id => 'location_id4', - :custom_attribute => {} - } - } -} - - -result = location_custom_attributes_api.bulk_upsert_location_custom_attributes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def list_location_custom_attributes(location_id:, - visibility_filter: nil, - limit: nil, - cursor: nil, - with_definitions: false) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the target [location](entity:Location). | -| `visibility_filter` | [`String (Visibility Filter)`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | -| `limit` | `Integer` | 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` | 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). | -| `with_definitions` | `TrueClass \| FalseClass` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Location Custom Attributes Response Hash`](../../doc/models/list-location-custom-attributes-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -with_definitions = false - - -result = location_custom_attributes_api.list_location_custom_attributes( - location_id: location_id, - with_definitions: with_definitions -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def delete_location_custom_attribute(location_id:, - key:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Location Custom Attribute Response Hash`](../../doc/models/delete-location-custom-attribute-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -key = 'key0' - - -result = location_custom_attributes_api.delete_location_custom_attribute( - location_id: location_id, - key: key -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def retrieve_location_custom_attribute(location_id:, - key:, - with_definition: false, - version: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `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. | -| `with_definition` | `TrueClass \| FalseClass` | 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` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Location Custom Attribute Response Hash`](../../doc/models/retrieve-location-custom-attribute-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -key = 'key0' - -with_definition = false - - -result = location_custom_attributes_api.retrieve_location_custom_attribute( - location_id: location_id, - key: key, - with_definition: with_definition -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def upsert_location_custom_attribute(location_id:, - key:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `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` | [`Upsert Location Custom Attribute Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Upsert Location Custom Attribute Response Hash`](../../doc/models/upsert-location-custom-attribute-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -key = 'key0' - -body = { - :custom_attribute => {} -} - - -result = location_custom_attributes_api.upsert_location_custom_attribute( - location_id: location_id, - key: key, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/locations.md b/doc/api/locations.md deleted file mode 100644 index 35a00e730..000000000 --- a/doc/api/locations.md +++ /dev/null @@ -1,193 +0,0 @@ -# Locations - -```ruby -locations_api = client.locations -``` - -## 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`. - -```ruby -def list_locations -``` - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Locations Response Hash`](../../doc/models/list-locations-response.md). - -## Example Usage - -```ruby -result = locations_api.list_locations - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_location(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Location Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Location Response Hash`](../../doc/models/create-location-response.md). - -## Example Usage - -```ruby -body = { - :location => { - :name => 'Midtown', - :address => { - :address_line_1 => '1234 Peachtree St. NE', - :locality => 'Atlanta', - :administrative_district_level_1 => 'GA', - :postal_code => '30309' - }, - :description => 'Midtown Atlanta store' - } -} - - -result = locations_api.create_location(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def retrieve_location(location_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the location to retrieve. Specify the string
"main" to return the main location. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Location Response Hash`](../../doc/models/retrieve-location-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - - -result = locations_api.retrieve_location(location_id: location_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Location - -Updates a [location](https://developer.squareup.com/docs/locations-api). - -```ruby -def update_location(location_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the location to update. | -| `body` | [`Update Location Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Location Response Hash`](../../doc/models/update-location-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -body = { - :location => { - :business_hours => { - :periods => [ - { - :day_of_week => 'FRI', - :start_local_time => '07:00', - :end_local_time => '18:00' - }, - { - :day_of_week => 'SAT', - :start_local_time => '07:00', - :end_local_time => '18:00' - }, - { - :day_of_week => 'SUN', - :start_local_time => '09:00', - :end_local_time => '15:00' - } - ] - }, - :description => 'Midtown Atlanta store - Open weekends' - } -} - - -result = locations_api.update_location( - location_id: location_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/loyalty.md b/doc/api/loyalty.md deleted file mode 100644 index 34f1c3ba4..000000000 --- a/doc/api/loyalty.md +++ /dev/null @@ -1,863 +0,0 @@ -# Loyalty - -```ruby -loyalty_api = client.loyalty -``` - -## 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. - -```ruby -def create_loyalty_account(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Loyalty Account Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Loyalty Account Response Hash`](../../doc/models/create-loyalty-account-response.md). - -## Example Usage - -```ruby -body = { - :loyalty_account => { - :program_id => 'd619f755-2d17-41f3-990d-c04ecedd64dd', - :mapping => { - :phone_number => '+14155551234' - } - }, - :idempotency_key => 'ec78c477-b1c3-4899-a209-a4e71337c996' -} - - -result = loyalty_api.create_loyalty_account(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_loyalty_accounts(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Loyalty Accounts Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Loyalty Accounts Response Hash`](../../doc/models/search-loyalty-accounts-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :mappings => [ - { - :phone_number => '+14155551234' - } - ] - }, - :limit => 10 -} - - -result = loyalty_api.search_loyalty_accounts(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Loyalty Account - -Retrieves a loyalty account. - -```ruby -def retrieve_loyalty_account(account_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `account_id` | `String` | Template, Required | The ID of the [loyalty account](entity:LoyaltyAccount) to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Loyalty Account Response Hash`](../../doc/models/retrieve-loyalty-account-response.md). - -## Example Usage - -```ruby -account_id = 'account_id2' - - -result = loyalty_api.retrieve_loyalty_account(account_id: account_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def accumulate_loyalty_points(account_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `account_id` | `String` | Template, Required | The ID of the target [loyalty account](entity:LoyaltyAccount). | -| `body` | [`Accumulate Loyalty Points Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Accumulate Loyalty Points Response Hash`](../../doc/models/accumulate-loyalty-points-response.md). - -## Example Usage - -```ruby -account_id = 'account_id2' - -body = { - :accumulate_points => { - :order_id => 'RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY' - }, - :idempotency_key => '58b90739-c3e8-4b11-85f7-e636d48d72cb', - :location_id => 'P034NEENMD09F' -} - - -result = loyalty_api.accumulate_loyalty_points( - account_id: account_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def adjust_loyalty_points(account_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `account_id` | `String` | Template, Required | The ID of the target [loyalty account](entity:LoyaltyAccount). | -| `body` | [`Adjust Loyalty Points Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Adjust Loyalty Points Response Hash`](../../doc/models/adjust-loyalty-points-response.md). - -## Example Usage - -```ruby -account_id = 'account_id2' - -body = { - :idempotency_key => 'bc29a517-3dc9-450e-aa76-fae39ee849d1', - :adjust_points => { - :points => 10, - :reason => 'Complimentary points' - } -} - - -result = loyalty_api.adjust_loyalty_points( - account_id: account_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_loyalty_events(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Loyalty Events Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Loyalty Events Response Hash`](../../doc/models/search-loyalty-events-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :filter => { - :order_filter => { - :order_id => 'PyATxhYLfsMqpVkcKJITPydgEYfZY' - } - } - }, - :limit => 30 -} - - -result = loyalty_api.search_loyalty_events(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def list_loyalty_programs -``` - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Loyalty Programs Response Hash`](../../doc/models/list-loyalty-programs-response.md). - -## Example Usage - -```ruby -result = loyalty_api.list_loyalty_programs - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def retrieve_loyalty_program(program_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `program_id` | `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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Loyalty Program Response Hash`](../../doc/models/retrieve-loyalty-program-response.md). - -## Example Usage - -```ruby -program_id = 'program_id0' - - -result = loyalty_api.retrieve_loyalty_program(program_id: program_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def calculate_loyalty_points(program_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `program_id` | `String` | Template, Required | The ID of the [loyalty program](entity:LoyaltyProgram), which defines the rules for accruing points. | -| `body` | [`Calculate Loyalty Points Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Calculate Loyalty Points Response Hash`](../../doc/models/calculate-loyalty-points-response.md). - -## Example Usage - -```ruby -program_id = 'program_id0' - -body = { - :order_id => 'RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY', - :loyalty_account_id => '79b807d2-d786-46a9-933b-918028d7a8c5' -} - - -result = loyalty_api.calculate_loyalty_points( - program_id: program_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def list_loyalty_promotions(program_id:, - status: nil, - cursor: nil, - limit: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `program_id` | `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 (Loyalty Promotion Status)`](../../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` | 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` | `Integer` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Loyalty Promotions Response Hash`](../../doc/models/list-loyalty-promotions-response.md). - -## Example Usage - -```ruby -program_id = 'program_id0' - - -result = loyalty_api.list_loyalty_promotions(program_id: program_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_loyalty_promotion(program_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `program_id` | `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` | [`Create Loyalty Promotion Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Loyalty Promotion Response Hash`](../../doc/models/create-loyalty-promotion-response.md). - -## Example Usage - -```ruby -program_id = 'program_id0' - -body = { - :loyalty_promotion => { - :name => 'Tuesday Happy Hour Promo', - :incentive => { - :type => 'POINTS_MULTIPLIER', - :points_multiplier_data => { - :multiplier => '3.0' - } - }, - :available_time => { - :time_periods => [ - 'BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT' - ] - }, - :trigger_limit => { - :times => 1, - :interval => 'DAY' - }, - :minimum_spend_amount_money => { - :amount => 2000, - :currency => 'USD' - }, - :qualifying_category_ids => [ - 'XTQPYLR3IIU9C44VRCB3XD12' - ] - }, - :idempotency_key => 'ec78c477-b1c3-4899-a209-a4e71337c996' -} - - -result = loyalty_api.create_loyalty_promotion( - program_id: program_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Loyalty Promotion - -Retrieves a loyalty promotion. - -```ruby -def retrieve_loyalty_promotion(promotion_id:, - program_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `promotion_id` | `String` | Template, Required | The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve. | -| `program_id` | `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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Loyalty Promotion Response Hash`](../../doc/models/retrieve-loyalty-promotion-response.md). - -## Example Usage - -```ruby -promotion_id = 'promotion_id0' - -program_id = 'program_id0' - - -result = loyalty_api.retrieve_loyalty_promotion( - promotion_id: promotion_id, - program_id: program_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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 - -```ruby -def cancel_loyalty_promotion(promotion_id:, - program_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `promotion_id` | `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. | -| `program_id` | `String` | Template, Required | The ID of the base [loyalty program](entity:LoyaltyProgram). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Cancel Loyalty Promotion Response Hash`](../../doc/models/cancel-loyalty-promotion-response.md). - -## Example Usage - -```ruby -promotion_id = 'promotion_id0' - -program_id = 'program_id0' - - -result = loyalty_api.cancel_loyalty_promotion( - promotion_id: promotion_id, - program_id: program_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_loyalty_reward(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Loyalty Reward Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Loyalty Reward Response Hash`](../../doc/models/create-loyalty-reward-response.md). - -## Example Usage - -```ruby -body = { - :reward => { - :loyalty_account_id => '5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd', - :reward_tier_id => 'e1b39225-9da5-43d1-a5db-782cdd8ad94f', - :order_id => 'RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY' - }, - :idempotency_key => '18c2e5ea-a620-4b1f-ad60-7b167285e451' -} - - -result = loyalty_api.create_loyalty_reward(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_loyalty_rewards(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Loyalty Rewards Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Loyalty Rewards Response Hash`](../../doc/models/search-loyalty-rewards-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :loyalty_account_id => '5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd' - }, - :limit => 10 -} - - -result = loyalty_api.search_loyalty_rewards(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def delete_loyalty_reward(reward_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `reward_id` | `String` | Template, Required | The ID of the [loyalty reward](entity:LoyaltyReward) to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Loyalty Reward Response Hash`](../../doc/models/delete-loyalty-reward-response.md). - -## Example Usage - -```ruby -reward_id = 'reward_id4' - - -result = loyalty_api.delete_loyalty_reward(reward_id: reward_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Loyalty Reward - -Retrieves a loyalty reward. - -```ruby -def retrieve_loyalty_reward(reward_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `reward_id` | `String` | Template, Required | The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Loyalty Reward Response Hash`](../../doc/models/retrieve-loyalty-reward-response.md). - -## Example Usage - -```ruby -reward_id = 'reward_id4' - - -result = loyalty_api.retrieve_loyalty_reward(reward_id: reward_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def redeem_loyalty_reward(reward_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `reward_id` | `String` | Template, Required | The ID of the [loyalty reward](entity:LoyaltyReward) to redeem. | -| `body` | [`Redeem Loyalty Reward Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Redeem Loyalty Reward Response Hash`](../../doc/models/redeem-loyalty-reward-response.md). - -## Example Usage - -```ruby -reward_id = 'reward_id4' - -body = { - :idempotency_key => '98adc7f7-6963-473b-b29c-f3c9cdd7d994', - :location_id => 'P034NEENMD09F' -} - - -result = loyalty_api.redeem_loyalty_reward( - reward_id: reward_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/merchant-custom-attributes.md b/doc/api/merchant-custom-attributes.md deleted file mode 100644 index 8b8e456ae..000000000 --- a/doc/api/merchant-custom-attributes.md +++ /dev/null @@ -1,528 +0,0 @@ -# Merchant Custom Attributes - -```ruby -merchant_custom_attributes_api = client.merchant_custom_attributes -``` - -## 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`. - -```ruby -def list_merchant_custom_attribute_definitions(visibility_filter: nil, - limit: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibility_filter` | [`String (Visibility Filter)`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | -| `limit` | `Integer` | 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` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Merchant Custom Attribute Definitions Response Hash`](../../doc/models/list-merchant-custom-attribute-definitions-response.md). - -## Example Usage - -```ruby -result = merchant_custom_attributes_api.list_merchant_custom_attribute_definitions - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_merchant_custom_attribute_definition(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Merchant Custom Attribute Definition Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Merchant Custom Attribute Definition Response Hash`](../../doc/models/create-merchant-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -body = { - :custom_attribute_definition => { - :key => 'alternative_seller_name', - :name => 'Alternative Merchant Name', - :description => 'This is the other name this merchant goes by.', - :visibility => 'VISIBILITY_READ_ONLY' - } -} - - -result = merchant_custom_attributes_api.create_merchant_custom_attribute_definition(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def delete_merchant_custom_attribute_definition(key:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Merchant Custom Attribute Definition Response Hash`](../../doc/models/delete-merchant-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - - -result = merchant_custom_attributes_api.delete_merchant_custom_attribute_definition(key: key) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def retrieve_merchant_custom_attribute_definition(key:, - version: nil) -``` - -## 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` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Merchant Custom Attribute Definition Response Hash`](../../doc/models/retrieve-merchant-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - - -result = merchant_custom_attributes_api.retrieve_merchant_custom_attribute_definition(key: key) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def update_merchant_custom_attribute_definition(key:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to update. | -| `body` | [`Update Merchant Custom Attribute Definition Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Merchant Custom Attribute Definition Response Hash`](../../doc/models/update-merchant-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - -body = { - :custom_attribute_definition => { - :description => 'Update the description as desired.', - :visibility => 'VISIBILITY_READ_ONLY' - } -} - - -result = merchant_custom_attributes_api.update_merchant_custom_attribute_definition( - key: key, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def bulk_delete_merchant_custom_attributes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Delete Merchant Custom Attributes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Delete Merchant Custom Attributes Response Hash`](../../doc/models/bulk-delete-merchant-custom-attributes-response.md). - -## Example Usage - -```ruby -body = { - :values => { - 'id1' => {}, - 'id2' => {} - } -} - - -result = merchant_custom_attributes_api.bulk_delete_merchant_custom_attributes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def bulk_upsert_merchant_custom_attributes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Upsert Merchant Custom Attributes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Upsert Merchant Custom Attributes Response Hash`](../../doc/models/bulk-upsert-merchant-custom-attributes-response.md). - -## Example Usage - -```ruby -body = { - :values => { - 'key0' => { - :merchant_id => 'merchant_id0', - :custom_attribute => {} - }, - 'key1' => { - :merchant_id => 'merchant_id0', - :custom_attribute => {} - } - } -} - - -result = merchant_custom_attributes_api.bulk_upsert_merchant_custom_attributes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def list_merchant_custom_attributes(merchant_id:, - visibility_filter: nil, - limit: nil, - cursor: nil, - with_definitions: false) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchant_id` | `String` | Template, Required | The ID of the target [merchant](entity:Merchant). | -| `visibility_filter` | [`String (Visibility Filter)`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | -| `limit` | `Integer` | 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` | 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). | -| `with_definitions` | `TrueClass \| FalseClass` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Merchant Custom Attributes Response Hash`](../../doc/models/list-merchant-custom-attributes-response.md). - -## Example Usage - -```ruby -merchant_id = 'merchant_id0' - -with_definitions = false - - -result = merchant_custom_attributes_api.list_merchant_custom_attributes( - merchant_id: merchant_id, - with_definitions: with_definitions -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def delete_merchant_custom_attribute(merchant_id:, - key:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchant_id` | `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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Merchant Custom Attribute Response Hash`](../../doc/models/delete-merchant-custom-attribute-response.md). - -## Example Usage - -```ruby -merchant_id = 'merchant_id0' - -key = 'key0' - - -result = merchant_custom_attributes_api.delete_merchant_custom_attribute( - merchant_id: merchant_id, - key: key -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def retrieve_merchant_custom_attribute(merchant_id:, - key:, - with_definition: false, - version: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchant_id` | `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. | -| `with_definition` | `TrueClass \| FalseClass` | 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` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Merchant Custom Attribute Response Hash`](../../doc/models/retrieve-merchant-custom-attribute-response.md). - -## Example Usage - -```ruby -merchant_id = 'merchant_id0' - -key = 'key0' - -with_definition = false - - -result = merchant_custom_attributes_api.retrieve_merchant_custom_attribute( - merchant_id: merchant_id, - key: key, - with_definition: with_definition -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def upsert_merchant_custom_attribute(merchant_id:, - key:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchant_id` | `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` | [`Upsert Merchant Custom Attribute Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Upsert Merchant Custom Attribute Response Hash`](../../doc/models/upsert-merchant-custom-attribute-response.md). - -## Example Usage - -```ruby -merchant_id = 'merchant_id0' - -key = 'key0' - -body = { - :custom_attribute => {} -} - - -result = merchant_custom_attributes_api.upsert_merchant_custom_attribute( - merchant_id: merchant_id, - key: key, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/merchants.md b/doc/api/merchants.md deleted file mode 100644 index 26a7fa6d0..000000000 --- a/doc/api/merchants.md +++ /dev/null @@ -1,89 +0,0 @@ -# Merchants - -```ruby -merchants_api = client.merchants -``` - -## 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. - -```ruby -def list_merchants(cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `Integer` | Query, Optional | The cursor generated by the previous response. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Merchants Response Hash`](../../doc/models/list-merchants-response.md). - -## Example Usage - -```ruby -result = merchants_api.list_merchants - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Merchant - -Retrieves the `Merchant` object for the given `merchant_id`. - -```ruby -def retrieve_merchant(merchant_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchant_id` | `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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Merchant Response Hash`](../../doc/models/retrieve-merchant-response.md). - -## Example Usage - -```ruby -merchant_id = 'merchant_id0' - - -result = merchants_api.retrieve_merchant(merchant_id: merchant_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/mobile-authorization.md b/doc/api/mobile-authorization.md deleted file mode 100644 index b5ea847a7..000000000 --- a/doc/api/mobile-authorization.md +++ /dev/null @@ -1,57 +0,0 @@ -# Mobile Authorization - -```ruby -mobile_authorization_api = client.mobile_authorization -``` - -## 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). - -```ruby -def create_mobile_authorization_code(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Mobile Authorization Code Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Mobile Authorization Code Response Hash`](../../doc/models/create-mobile-authorization-code-response.md). - -## Example Usage - -```ruby -body = { - :location_id => 'YOUR_LOCATION_ID' -} - - -result = mobile_authorization_api.create_mobile_authorization_code(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/o-auth.md b/doc/api/o-auth.md deleted file mode 100644 index ce8d66f29..000000000 --- a/doc/api/o-auth.md +++ /dev/null @@ -1,170 +0,0 @@ -# O Auth - -```ruby -o_auth_api = client.o_auth -``` - -## 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. - -```ruby -def revoke_token(body:, - authorization:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Revoke Token Request Hash`](../../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 | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Revoke Token Response Hash`](../../doc/models/revoke-token-response.md). - -## Example Usage - -```ruby -body = { - :client_id => 'CLIENT_ID', - :access_token => 'ACCESS_TOKEN' -} - -authorization = 'Client CLIENT_SECRET' - - -result = o_auth_api.revoke_token( - body: body, - authorization: authorization -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def obtain_token(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Obtain Token Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Obtain Token Response Hash`](../../doc/models/obtain-token-response.md). - -## Example Usage - -```ruby -body = { - :client_id => 'APPLICATION_ID', - :grant_type => 'authorization_code', - :client_secret => 'APPLICATION_SECRET', - :code => 'CODE_FROM_AUTHORIZE' -} - - -result = o_auth_api.obtain_token(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def retrieve_token_status -``` - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Token Status Response Hash`](../../doc/models/retrieve-token-status-response.md). - -## Example Usage - -```ruby -result = o_auth_api.retrieve_token_status - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/order-custom-attributes.md b/doc/api/order-custom-attributes.md deleted file mode 100644 index 63d5a552e..000000000 --- a/doc/api/order-custom-attributes.md +++ /dev/null @@ -1,560 +0,0 @@ -# Order Custom Attributes - -```ruby -order_custom_attributes_api = client.order_custom_attributes -``` - -## 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`. - -```ruby -def list_order_custom_attribute_definitions(visibility_filter: nil, - cursor: nil, - limit: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibility_filter` | [`String (Visibility Filter)`](../../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` | 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` | `Integer` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Order Custom Attribute Definitions Response Hash`](../../doc/models/list-order-custom-attribute-definitions-response.md). - -## Example Usage - -```ruby -result = order_custom_attributes_api.list_order_custom_attribute_definitions - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_order_custom_attribute_definition(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Order Custom Attribute Definition Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Order Custom Attribute Definition Response Hash`](../../doc/models/create-order-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -body = { - :custom_attribute_definition => { - :key => 'cover-count', - :name => 'Cover count', - :description => 'The number of people seated at a table', - :visibility => 'VISIBILITY_READ_WRITE_VALUES' - }, - :idempotency_key => 'IDEMPOTENCY_KEY' -} - - -result = order_custom_attributes_api.create_order_custom_attribute_definition(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def delete_order_custom_attribute_definition(key:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Order Custom Attribute Definition Response Hash`](../../doc/models/delete-order-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - - -result = order_custom_attributes_api.delete_order_custom_attribute_definition(key: key) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def retrieve_order_custom_attribute_definition(key:, - version: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to retrieve. | -| `version` | `Integer` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Order Custom Attribute Definition Response Hash`](../../doc/models/retrieve-order-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - - -result = order_custom_attributes_api.retrieve_order_custom_attribute_definition(key: key) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def update_order_custom_attribute_definition(key:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | Template, Required | The key of the custom attribute definition to update. | -| `body` | [`Update Order Custom Attribute Definition Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Order Custom Attribute Definition Response Hash`](../../doc/models/update-order-custom-attribute-definition-response.md). - -## Example Usage - -```ruby -key = 'key0' - -body = { - :custom_attribute_definition => { - :key => 'cover-count', - :visibility => 'VISIBILITY_READ_ONLY', - :version => 1 - }, - :idempotency_key => 'IDEMPOTENCY_KEY' -} - - -result = order_custom_attributes_api.update_order_custom_attribute_definition( - key: key, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def bulk_delete_order_custom_attributes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Delete Order Custom Attributes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Delete Order Custom Attributes Response Hash`](../../doc/models/bulk-delete-order-custom-attributes-response.md). - -## Example Usage - -```ruby -body = { - :values => { - 'cover-count' => { - :order_id => '7BbXGEIWNldxAzrtGf9GPVZTwZ4F' - }, - 'table-number' => { - :order_id => '7BbXGEIWNldxAzrtGf9GPVZTwZ4F' - } - } -} - - -result = order_custom_attributes_api.bulk_delete_order_custom_attributes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def bulk_upsert_order_custom_attributes(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Upsert Order Custom Attributes Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Upsert Order Custom Attributes Response Hash`](../../doc/models/bulk-upsert-order-custom-attributes-response.md). - -## Example Usage - -```ruby -body = { - :values => { - 'key0' => { - :custom_attribute => {}, - :order_id => 'order_id4' - }, - 'key1' => { - :custom_attribute => {}, - :order_id => 'order_id4' - } - } -} - - -result = order_custom_attributes_api.bulk_upsert_order_custom_attributes(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def list_order_custom_attributes(order_id:, - visibility_filter: nil, - cursor: nil, - limit: nil, - with_definitions: false) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Template, Required | The ID of the target [order](entity:Order). | -| `visibility_filter` | [`String (Visibility Filter)`](../../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` | 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` | `Integer` | 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). | -| `with_definitions` | `TrueClass \| FalseClass` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Order Custom Attributes Response Hash`](../../doc/models/list-order-custom-attributes-response.md). - -## Example Usage - -```ruby -order_id = 'order_id6' - -with_definitions = false - - -result = order_custom_attributes_api.list_order_custom_attributes( - order_id: order_id, - with_definitions: with_definitions -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def delete_order_custom_attribute(order_id:, - custom_attribute_key:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Template, Required | The ID of the target [order](entity:Order). | -| `custom_attribute_key` | `String` | Template, Required | The key of the custom attribute to delete. This key must match the key of an
existing custom attribute definition. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Order Custom Attribute Response Hash`](../../doc/models/delete-order-custom-attribute-response.md). - -## Example Usage - -```ruby -order_id = 'order_id6' - -custom_attribute_key = 'custom_attribute_key2' - - -result = order_custom_attributes_api.delete_order_custom_attribute( - order_id: order_id, - custom_attribute_key: custom_attribute_key -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def retrieve_order_custom_attribute(order_id:, - custom_attribute_key:, - version: nil, - with_definition: false) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Template, Required | The ID of the target [order](entity:Order). | -| `custom_attribute_key` | `String` | Template, Required | The key of the custom attribute to retrieve. This key must match the key of an
existing custom attribute definition. | -| `version` | `Integer` | 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. | -| `with_definition` | `TrueClass \| FalseClass` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Order Custom Attribute Response Hash`](../../doc/models/retrieve-order-custom-attribute-response.md). - -## Example Usage - -```ruby -order_id = 'order_id6' - -custom_attribute_key = 'custom_attribute_key2' - -with_definition = false - - -result = order_custom_attributes_api.retrieve_order_custom_attribute( - order_id: order_id, - custom_attribute_key: custom_attribute_key, - with_definition: with_definition -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def upsert_order_custom_attribute(order_id:, - custom_attribute_key:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Template, Required | The ID of the target [order](entity:Order). | -| `custom_attribute_key` | `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` | [`Upsert Order Custom Attribute Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Upsert Order Custom Attribute Response Hash`](../../doc/models/upsert-order-custom-attribute-response.md). - -## Example Usage - -```ruby -order_id = 'order_id6' - -custom_attribute_key = 'custom_attribute_key2' - -body = { - :custom_attribute => {} -} - - -result = order_custom_attributes_api.upsert_order_custom_attribute( - order_id: order_id, - custom_attribute_key: custom_attribute_key, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/orders.md b/doc/api/orders.md deleted file mode 100644 index 3d4cbfb6e..000000000 --- a/doc/api/orders.md +++ /dev/null @@ -1,490 +0,0 @@ -# Orders - -```ruby -orders_api = client.orders -``` - -## 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. - -```ruby -def create_order(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Order Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Order Response Hash`](../../doc/models/create-order-response.md). - -## Example Usage - -```ruby -body = { - :order => { - :location_id => '057P5VYJ4A5X1', - :reference_id => 'my-order-001', - :line_items => [ - { - :quantity => '1', - :name => 'New York Strip Steak', - :base_price_money => { - :amount => 1599, - :currency => 'USD' - } - }, - { - :quantity => '2', - :catalog_object_id => 'BEMYCSMIJL46OCDV4KYIKXIB', - :modifiers => [ - { - :catalog_object_id => 'CHQX7Y4KY6N5KINJKZCFURPZ' - } - ], - :applied_discounts => [ - { - :discount_uid => 'one-dollar-off' - } - ] - } - ], - :taxes => [ - { - :uid => 'state-sales-tax', - :name => 'State Sales Tax', - :percentage => '9', - :scope => 'ORDER' - } - ], - :discounts => [ - { - :uid => 'labor-day-sale', - :name => 'Labor Day Sale', - :percentage => '5', - :scope => 'ORDER' - }, - { - :uid => 'membership-discount', - :catalog_object_id => 'DB7L55ZH2BGWI4H23ULIWOQ7', - :scope => 'ORDER' - }, - { - :uid => 'one-dollar-off', - :name => 'Sale - $1.00 off', - :amount_money => { - :amount => 100, - :currency => 'USD' - }, - :scope => 'LINE_ITEM' - } - ] - }, - :idempotency_key => '8193148c-9586-11e6-99f9-28cfe92138cf' -} - - -result = orders_api.create_order(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def batch_retrieve_orders(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Batch Retrieve Orders Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Batch Retrieve Orders Response Hash`](../../doc/models/batch-retrieve-orders-response.md). - -## Example Usage - -```ruby -body = { - :order_ids => [ - 'CAISEM82RcpmcFBM0TfOyiHV3es', - 'CAISENgvlJ6jLWAzERDzjyHVybY' - ], - :location_id => '057P5VYJ4A5X1' -} - - -result = orders_api.batch_retrieve_orders(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Calculate Order - -Enables applications to preview order pricing without creating an order. - -```ruby -def calculate_order(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Calculate Order Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Calculate Order Response Hash`](../../doc/models/calculate-order-response.md). - -## Example Usage - -```ruby -body = { - :order => { - :location_id => 'D7AVYMEAPJ3A3', - :line_items => [ - { - :quantity => '1', - :name => 'Item 1', - :base_price_money => { - :amount => 500, - :currency => 'USD' - } - }, - { - :quantity => '2', - :name => 'Item 2', - :base_price_money => { - :amount => 300, - :currency => 'USD' - } - } - ], - :discounts => [ - { - :name => '50% Off', - :percentage => '50', - :scope => 'ORDER' - } - ] - } -} - - -result = orders_api.calculate_order(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def clone_order(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Clone Order Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Clone Order Response Hash`](../../doc/models/clone-order-response.md). - -## Example Usage - -```ruby -body = { - :order_id => 'ZAISEM52YcpmcWAzERDOyiWS123', - :version => 3, - :idempotency_key => 'UNIQUE_STRING' -} - - -result = orders_api.clone_order(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_orders(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Orders Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Orders Response Hash`](../../doc/models/search-orders-response.md). - -## Example Usage - -```ruby -body = { - :location_ids => [ - '057P5VYJ4A5X1', - '18YC4JDH91E1H' - ], - :query => { - :filter => { - :state_filter => { - :states => [ - 'COMPLETED' - ] - }, - :date_time_filter => { - :closed_at => { - :start_at => '2018-03-03T20:00:00+00:00', - :end_at => '2019-03-04T21:54:45+00:00' - } - } - }, - :sort => { - :sort_field => 'CLOSED_AT', - :sort_order => 'DESC' - } - }, - :limit => 3, - :return_entries => true -} - - -result = orders_api.search_orders(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Order - -Retrieves an [Order](../../doc/models/order.md) by ID. - -```ruby -def retrieve_order(order_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Template, Required | The ID of the order to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Order Response Hash`](../../doc/models/retrieve-order-response.md). - -## Example Usage - -```ruby -order_id = 'order_id6' - - -result = orders_api.retrieve_order(order_id: order_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def update_order(order_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Template, Required | The ID of the order to update. | -| `body` | [`Update Order Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Order Response Hash`](../../doc/models/update-order-response.md). - -## Example Usage - -```ruby -order_id = 'order_id6' - -body = {} - - -result = orders_api.update_order( - order_id: order_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def pay_order(order_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Template, Required | The ID of the order being paid. | -| `body` | [`Pay Order Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Pay Order Response Hash`](../../doc/models/pay-order-response.md). - -## Example Usage - -```ruby -order_id = 'order_id6' - -body = { - :idempotency_key => 'c043a359-7ad9-4136-82a9-c3f1d66dcbff', - :payment_ids => [ - 'EnZdNAlWCmfh6Mt5FMNST1o7taB', - '0LRiVlbXVwe8ozu4KbZxd12mvaB' - ] -} - - -result = orders_api.pay_order( - order_id: order_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/payments.md b/doc/api/payments.md deleted file mode 100644 index 67ad46a39..000000000 --- a/doc/api/payments.md +++ /dev/null @@ -1,358 +0,0 @@ -# Payments - -```ruby -payments_api = client.payments -``` - -## 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. - -```ruby -def list_payments(begin_time: nil, - end_time: nil, - sort_order: nil, - cursor: nil, - location_id: nil, - total: nil, - last_4: nil, - card_brand: nil, - limit: nil, - is_offline_payment: false, - offline_begin_time: nil, - offline_end_time: nil, - updated_at_begin_time: nil, - updated_at_end_time: nil, - sort_field: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `begin_time` | `String` | 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. | -| `end_time` | `String` | 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. | -| `sort_order` | `String` | Query, Optional | The order in which results are listed by `ListPaymentsRequest.sort_field`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | -| `cursor` | `String` | 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). | -| `location_id` | `String` | Query, Optional | Limit results to the location supplied. By default, results are returned
for the default (main) location associated with the seller. | -| `total` | `Integer` | Query, Optional | The exact amount in the `total_money` for a payment. | -| `last_4` | `String` | Query, Optional | The last four digits of a payment card. | -| `card_brand` | `String` | Query, Optional | The brand of the payment card (for example, VISA). | -| `limit` | `Integer` | 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` | -| `is_offline_payment` | `TrueClass \| FalseClass` | Query, Optional | Whether the payment was taken offline or not.
**Default**: `false` | -| `offline_begin_time` | `String` | 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. | -| `offline_end_time` | `String` | 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. | -| `updated_at_begin_time` | `String` | 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. | -| `updated_at_end_time` | `String` | 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. | -| `sort_field` | [`String (Payment Sort Field)`](../../doc/models/payment-sort-field.md) | Query, Optional | The field used to sort results by. The default is `CREATED_AT`. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Payments Response Hash`](../../doc/models/list-payments-response.md). - -## Example Usage - -```ruby -is_offline_payment = false - - -result = payments_api.list_payments(is_offline_payment: is_offline_payment) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_payment(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Payment Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Payment Response Hash`](../../doc/models/create-payment-response.md). - -## Example Usage - -```ruby -body = { - :source_id => 'ccof:GaJGNaZa8x4OgDJn4GB', - :idempotency_key => '7b0f3ec5-086a-4871-8f13-3c81b3875218', - :amount_money => { - :amount => 1000, - :currency => 'USD' - }, - :app_fee_money => { - :amount => 10, - :currency => 'USD' - }, - :autocomplete => true, - :customer_id => 'W92WH6P11H4Z77CTET0RNTGFW8', - :location_id => 'L88917AVBK2S5', - :reference_id => '123456', - :note => 'Brief description' -} - - -result = payments_api.create_payment(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def cancel_payment_by_idempotency_key(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Cancel Payment by Idempotency Key Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Cancel Payment by Idempotency Key Response Hash`](../../doc/models/cancel-payment-by-idempotency-key-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => 'a7e36d40-d24b-11e8-b568-0800200c9a66' -} - - -result = payments_api.cancel_payment_by_idempotency_key(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Payment - -Retrieves details for a specific payment. - -```ruby -def get_payment(payment_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Template, Required | A unique ID for the desired payment. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Payment Response Hash`](../../doc/models/get-payment-response.md). - -## Example Usage - -```ruby -payment_id = 'payment_id0' - - -result = payments_api.get_payment(payment_id: payment_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Payment - -Updates a payment with the APPROVED status. -You can update the `amount_money` and `tip_money` using this endpoint. - -```ruby -def update_payment(payment_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Template, Required | The ID of the payment to update. | -| `body` | [`Update Payment Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Payment Response Hash`](../../doc/models/update-payment-response.md). - -## Example Usage - -```ruby -payment_id = 'payment_id0' - -body = { - :idempotency_key => '956f8b13-e4ec-45d6-85e8-d1d95ef0c5de', - :payment => { - :amount_money => { - :amount => 1000, - :currency => 'USD' - }, - :tip_money => { - :amount => 100, - :currency => 'USD' - }, - :version_token => 'ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o' - } -} - - -result = payments_api.update_payment( - payment_id: payment_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Cancel Payment - -Cancels (voids) a payment. You can use this endpoint to cancel a payment with -the APPROVED `status`. - -```ruby -def cancel_payment(payment_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Template, Required | The ID of the payment to cancel. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Cancel Payment Response Hash`](../../doc/models/cancel-payment-response.md). - -## Example Usage - -```ruby -payment_id = 'payment_id0' - - -result = payments_api.cancel_payment(payment_id: payment_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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`. - -```ruby -def complete_payment(payment_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Template, Required | The unique ID identifying the payment to be completed. | -| `body` | [`Complete Payment Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Complete Payment Response Hash`](../../doc/models/complete-payment-response.md). - -## Example Usage - -```ruby -payment_id = 'payment_id0' - -body = {} - - -result = payments_api.complete_payment( - payment_id: payment_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/payouts.md b/doc/api/payouts.md deleted file mode 100644 index 131dde2e3..000000000 --- a/doc/api/payouts.md +++ /dev/null @@ -1,137 +0,0 @@ -# Payouts - -```ruby -payouts_api = client.payouts -``` - -## 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. - -```ruby -def list_payouts(location_id: nil, - status: nil, - begin_time: nil, - end_time: nil, - sort_order: nil, - cursor: nil, - limit: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | 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 (Payout Status)`](../../doc/models/payout-status.md) | Query, Optional | If provided, only payouts with the given status are returned. | -| `begin_time` | `String` | Query, Optional | The timestamp for the beginning of the payout creation time, in RFC 3339 format.
Inclusive. Default: The current time minus one year. | -| `end_time` | `String` | Query, Optional | The timestamp for the end of the payout creation time, in RFC 3339 format.
Default: The current time. | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payouts are listed. | -| `cursor` | `String` | 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` | `Integer` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Payouts Response Hash`](../../doc/models/list-payouts-response.md). - -## Example Usage - -```ruby -result = payouts_api.list_payouts - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Payout - -Retrieves details of a specific payout identified by a payout ID. -To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - -```ruby -def get_payout(payout_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `payout_id` | `String` | Template, Required | The ID of the payout to retrieve the information for. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Payout Response Hash`](../../doc/models/get-payout-response.md). - -## Example Usage - -```ruby -payout_id = 'payout_id6' - - -result = payouts_api.get_payout(payout_id: payout_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def list_payout_entries(payout_id:, - sort_order: nil, - cursor: nil, - limit: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `payout_id` | `String` | Template, Required | The ID of the payout to retrieve the information for. | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payout entries are listed. | -| `cursor` | `String` | 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` | `Integer` | 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` | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Payout Entries Response Hash`](../../doc/models/list-payout-entries-response.md). - -## Example Usage - -```ruby -payout_id = 'payout_id6' - - -result = payouts_api.list_payout_entries(payout_id: payout_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/refunds.md b/doc/api/refunds.md deleted file mode 100644 index b75e8e034..000000000 --- a/doc/api/refunds.md +++ /dev/null @@ -1,155 +0,0 @@ -# Refunds - -```ruby -refunds_api = client.refunds -``` - -## 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. - -```ruby -def list_payment_refunds(begin_time: nil, - end_time: nil, - sort_order: nil, - cursor: nil, - location_id: nil, - status: nil, - source_type: nil, - limit: nil, - updated_at_begin_time: nil, - updated_at_end_time: nil, - sort_field: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `begin_time` | `String` | 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. | -| `end_time` | `String` | 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. | -| `sort_order` | `String` | Query, Optional | The order in which results are listed by `PaymentRefund.created_at`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | -| `cursor` | `String` | 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). | -| `location_id` | `String` | Query, Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the seller. | -| `status` | `String` | 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. | -| `source_type` | `String` | 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` | `Integer` | 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 | -| `updated_at_begin_time` | `string` | Query, Optional | Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339
format. The range is determined using the `updated_at` field for each `PaymentRefund`.

Default: if omitted, the time range starts at `begin_time`. | -| `updated_at_end_time` | `string` | Query, Optional | Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339
format. The range is determined using the `updated_at` field for each `PaymentRefund`.

Default: The current time. | -| `sort_field` | `string` | Query, Optional | The field used to sort results by. The default is `CREATED_AT`.
Current values include `CREATED_AT` and `UPDATED_AT`.
| - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Payment Refunds Response Hash`](../../doc/models/list-payment-refunds-response.md). - -## Example Usage - -```ruby -result = refunds_api.list_payment_refunds - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def refund_payment(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Refund Payment Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Refund Payment Response Hash`](../../doc/models/refund-payment-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => '9b7f2dcf-49da-4411-b23e-a2d6af21333a', - :amount_money => { - :amount => 1000, - :currency => 'USD' - }, - :app_fee_money => { - :amount => 10, - :currency => 'USD' - }, - :payment_id => 'R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY', - :reason => 'Example' -} - - -result = refunds_api.refund_payment(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Payment Refund - -Retrieves a specific refund using the `refund_id`. - -```ruby -def get_payment_refund(refund_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `refund_id` | `String` | Template, Required | The unique ID for the desired `PaymentRefund`. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Payment Refund Response Hash`](../../doc/models/get-payment-refund-response.md). - -## Example Usage - -```ruby -refund_id = 'refund_id4' - - -result = refunds_api.get_payment_refund(refund_id: refund_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/sites.md b/doc/api/sites.md deleted file mode 100644 index 19635f74a..000000000 --- a/doc/api/sites.md +++ /dev/null @@ -1,37 +0,0 @@ -# Sites - -```ruby -sites_api = client.sites -``` - -## 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). - -```ruby -def list_sites -``` - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Sites Response Hash`](../../doc/models/list-sites-response.md). - -## Example Usage - -```ruby -result = sites_api.list_sites - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/snippets.md b/doc/api/snippets.md deleted file mode 100644 index 283e81dd0..000000000 --- a/doc/api/snippets.md +++ /dev/null @@ -1,142 +0,0 @@ -# Snippets - -```ruby -snippets_api = client.snippets -``` - -## 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). - -```ruby -def delete_snippet(site_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `site_id` | `String` | Template, Required | The ID of the site that contains the snippet. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Snippet Response Hash`](../../doc/models/delete-snippet-response.md). - -## Example Usage - -```ruby -site_id = 'site_id6' - - -result = snippets_api.delete_snippet(site_id: site_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def retrieve_snippet(site_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `site_id` | `String` | Template, Required | The ID of the site that contains the snippet. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Snippet Response Hash`](../../doc/models/retrieve-snippet-response.md). - -## Example Usage - -```ruby -site_id = 'site_id6' - - -result = snippets_api.retrieve_snippet(site_id: site_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def upsert_snippet(site_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `site_id` | `String` | Template, Required | The ID of the site where you want to add or update the snippet. | -| `body` | [`Upsert Snippet Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Upsert Snippet Response Hash`](../../doc/models/upsert-snippet-response.md). - -## Example Usage - -```ruby -site_id = 'site_id6' - -body = { - :snippet => { - :content => '' - } -} - - -result = snippets_api.upsert_snippet( - site_id: site_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/subscriptions.md b/doc/api/subscriptions.md deleted file mode 100644 index bc7c0b96c..000000000 --- a/doc/api/subscriptions.md +++ /dev/null @@ -1,557 +0,0 @@ -# Subscriptions - -```ruby -subscriptions_api = client.subscriptions -``` - -## 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). - -```ruby -def create_subscription(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Subscription Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Subscription Response Hash`](../../doc/models/create-subscription-response.md). - -## Example Usage - -```ruby -body = { - :location_id => 'S8GWD5R9QB376', - :customer_id => 'CHFGVKYY8RSV93M5KCYTG4PN0G', - :idempotency_key => '8193148c-9586-11e6-99f9-28cfe92138cf', - :plan_variation_id => '6JHXF3B2CW3YKHDV4XEM674H', - :start_date => '2023-06-20', - :card_id => 'ccof:qy5x8hHGYsgLrp4Q4GB', - :timezone => 'America/Los_Angeles', - :source => { - :name => 'My Application' - }, - :phases => [ - { - :ordinal => 0, - :order_template_id => 'U2NaowWxzXwpsZU697x7ZHOAnCNZY' - } - ] -} - - -result = subscriptions_api.create_subscription(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def bulk_swap_plan(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Swap Plan Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Swap Plan Response Hash`](../../doc/models/bulk-swap-plan-response.md). - -## Example Usage - -```ruby -body = { - :new_plan_variation_id => 'FQ7CDXXWSLUJRPM3GFJSJGZ7', - :old_plan_variation_id => '6JHXF3B2CW3YKHDV4XEM674H', - :location_id => 'S8GWD5R9QB376' -} - - -result = subscriptions_api.bulk_swap_plan(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_subscriptions(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Subscriptions Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Subscriptions Response Hash`](../../doc/models/search-subscriptions-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :filter => { - :customer_ids => [ - 'CHFGVKYY8RSV93M5KCYTG4PN0G' - ], - :location_ids => [ - 'S8GWD5R9QB376' - ], - :source_names => [ - 'My App' - ] - } - } -} - - -result = subscriptions_api.search_subscriptions(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Subscription - -Retrieves a specific subscription. - -```ruby -def retrieve_subscription(subscription_id:, - include: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | The ID of the subscription to retrieve. | -| `include` | `String` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Subscription Response Hash`](../../doc/models/retrieve-subscription-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - - -result = subscriptions_api.retrieve_subscription(subscription_id: subscription_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Subscription - -Updates a subscription by modifying or clearing `subscription` field values. -To clear a field, set its value to `null`. - -```ruby -def update_subscription(subscription_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | The ID of the subscription to update. | -| `body` | [`Update Subscription Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Subscription Response Hash`](../../doc/models/update-subscription-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - -body = { - :subscription => { - :canceled_date => 'canceled_date6', - :card_id => '{NEW CARD ID}' - } -} - - -result = subscriptions_api.update_subscription( - subscription_id: subscription_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Delete Subscription Action - -Deletes a scheduled action for a subscription. - -```ruby -def delete_subscription_action(subscription_id:, - action_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | The ID of the subscription the targeted action is to act upon. | -| `action_id` | `String` | Template, Required | The ID of the targeted action to be deleted. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Subscription Action Response Hash`](../../doc/models/delete-subscription-action-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - -action_id = 'action_id6' - - -result = subscriptions_api.delete_subscription_action( - subscription_id: subscription_id, - action_id: action_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Change Billing Anchor Date - -Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates) -for a subscription. - -```ruby -def change_billing_anchor_date(subscription_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | The ID of the subscription to update the billing anchor date. | -| `body` | [`Change Billing Anchor Date Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Change Billing Anchor Date Response Hash`](../../doc/models/change-billing-anchor-date-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - -body = { - :monthly_billing_anchor_date => 1 -} - - -result = subscriptions_api.change_billing_anchor_date( - subscription_id: subscription_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def cancel_subscription(subscription_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | The ID of the subscription to cancel. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Cancel Subscription Response Hash`](../../doc/models/cancel-subscription-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - - -result = subscriptions_api.cancel_subscription(subscription_id: subscription_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Subscription Events - -Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. - -```ruby -def list_subscription_events(subscription_id:, - cursor: nil, - limit: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | The ID of the subscription to retrieve the events for. | -| `cursor` | `String` | 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` | `Integer` | Query, Optional | The upper limit on the number of subscription events to return
in a paged response. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Subscription Events Response Hash`](../../doc/models/list-subscription-events-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - - -result = subscriptions_api.list_subscription_events(subscription_id: subscription_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Pause Subscription - -Schedules a `PAUSE` action to pause an active subscription. - -```ruby -def pause_subscription(subscription_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | The ID of the subscription to pause. | -| `body` | [`Pause Subscription Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Pause Subscription Response Hash`](../../doc/models/pause-subscription-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - -body = {} - - -result = subscriptions_api.pause_subscription( - subscription_id: subscription_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Resume Subscription - -Schedules a `RESUME` action to resume a paused or a deactivated subscription. - -```ruby -def resume_subscription(subscription_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | The ID of the subscription to resume. | -| `body` | [`Resume Subscription Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Resume Subscription Response Hash`](../../doc/models/resume-subscription-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - -body = {} - - -result = subscriptions_api.resume_subscription( - subscription_id: subscription_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def swap_plan(subscription_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | The ID of the subscription to swap the subscription plan for. | -| `body` | [`Swap Plan Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Swap Plan Response Hash`](../../doc/models/swap-plan-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - -body = { - :new_plan_variation_id => 'FQ7CDXXWSLUJRPM3GFJSJGZ7', - :phases => [ - { - :ordinal => 0, - :order_template_id => 'uhhnjH9osVv3shUADwaC0b3hNxQZY' - } - ] -} - - -result = subscriptions_api.swap_plan( - subscription_id: subscription_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/team.md b/doc/api/team.md deleted file mode 100644 index 42d28975d..000000000 --- a/doc/api/team.md +++ /dev/null @@ -1,648 +0,0 @@ -# Team - -```ruby -team_api = client.team -``` - -## 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). - -```ruby -def create_team_member(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Team Member Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Team Member Response Hash`](../../doc/models/create-team-member-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => 'idempotency-key-0', - :team_member => { - :reference_id => 'reference_id_1', - :status => 'ACTIVE', - :given_name => 'Joe', - :family_name => 'Doe', - :email_address => 'joe_doe@gmail.com', - :phone_number => '+14159283333', - :assigned_locations => { - :assignment_type => 'EXPLICIT_LOCATIONS', - :location_ids => [ - 'YSGH2WBKG94QZ', - 'GA2Y9HSJ8KRYT' - ] - }, - :wage_setting => { - :job_assignments => [ - { - :pay_type => 'SALARY', - :annual_rate => { - :amount => 3000000, - :currency => 'USD' - }, - :weekly_hours => 40, - :job_id => 'FjS8x95cqHiMenw4f1NAUH4P' - }, - { - :pay_type => 'HOURLY', - :hourly_rate => { - :amount => 2000, - :currency => 'USD' - }, - :job_id => 'VDNpRv8da51NU8qZFC5zDWpF' - } - ], - :is_overtime_exempt => true - } - } -} - - -result = team_api.create_team_member(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def bulk_create_team_members(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Create Team Members Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Create Team Members Response Hash`](../../doc/models/bulk-create-team-members-response.md). - -## Example Usage - -```ruby -body = { - :team_members => { - 'idempotency-key-1' => { - :team_member => { - :reference_id => 'reference_id_1', - :given_name => 'Joe', - :family_name => 'Doe', - :email_address => 'joe_doe@gmail.com', - :phone_number => '+14159283333', - :assigned_locations => { - :assignment_type => 'EXPLICIT_LOCATIONS', - :location_ids => [ - 'YSGH2WBKG94QZ', - 'GA2Y9HSJ8KRYT' - ] - } - } - }, - 'idempotency-key-2' => { - :team_member => { - :reference_id => 'reference_id_2', - :given_name => 'Jane', - :family_name => 'Smith', - :email_address => 'jane_smith@gmail.com', - :phone_number => '+14159223334', - :assigned_locations => { - :assignment_type => 'ALL_CURRENT_AND_FUTURE_LOCATIONS' - } - } - } - } -} - - -result = team_api.bulk_create_team_members(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def bulk_update_team_members(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Update Team Members Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Update Team Members Response Hash`](../../doc/models/bulk-update-team-members-response.md). - -## Example Usage - -```ruby -body = { - :team_members => { - 'AFMwA08kR-MIF-3Vs0OE' => { - :team_member => { - :reference_id => 'reference_id_2', - :status => 'ACTIVE', - :given_name => 'Jane', - :family_name => 'Smith', - :email_address => 'jane_smith@gmail.com', - :phone_number => '+14159223334', - :assigned_locations => { - :assignment_type => 'ALL_CURRENT_AND_FUTURE_LOCATIONS' - } - } - }, - 'fpgteZNMaf0qOK-a4t6P' => { - :team_member => { - :reference_id => 'reference_id_1', - :status => 'ACTIVE', - :given_name => 'Joe', - :family_name => 'Doe', - :email_address => 'joe_doe@gmail.com', - :phone_number => '+14159283333', - :assigned_locations => { - :assignment_type => 'EXPLICIT_LOCATIONS', - :location_ids => [ - 'YSGH2WBKG94QZ', - 'GA2Y9HSJ8KRYT' - ] - } - } - } - } -} - - -result = team_api.bulk_update_team_members(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Jobs - -Lists jobs in a seller account. Results are sorted by title in ascending order. - -```ruby -def list_jobs(cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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). | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Jobs Response Hash`](../../doc/models/list-jobs-response.md). - -## Example Usage - -```ruby -result = team_api.list_jobs - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def create_job(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Job Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Job Response Hash`](../../doc/models/create-job-response.md). - -## Example Usage - -```ruby -body = { - :job => { - :title => 'Cashier', - :is_tip_eligible => true - }, - :idempotency_key => 'idempotency-key-0' -} - - -result = team_api.create_job(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Job - -Retrieves a specified job. - -```ruby -def retrieve_job(job_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `job_id` | `String` | Template, Required | The ID of the job to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Job Response Hash`](../../doc/models/retrieve-job-response.md). - -## Example Usage - -```ruby -job_id = 'job_id2' - - -result = team_api.retrieve_job(job_id: job_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def update_job(job_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `job_id` | `String` | Template, Required | The ID of the job to update. | -| `body` | [`Update Job Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Job Response Hash`](../../doc/models/update-job-response.md). - -## Example Usage - -```ruby -job_id = 'job_id2' - -body = { - :job => { - :title => 'Cashier 1', - :is_tip_eligible => true - } -} - - -result = team_api.update_job( - job_id: job_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_team_members(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Team Members Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Team Members Response Hash`](../../doc/models/search-team-members-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :filter => { - :location_ids => [ - '0G5P3VGACMMQZ' - ], - :status => 'ACTIVE' - } - }, - :limit => 10 -} - - -result = team_api.search_team_members(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def retrieve_team_member(team_member_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_id` | `String` | Template, Required | The ID of the team member to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Team Member Response Hash`](../../doc/models/retrieve-team-member-response.md). - -## Example Usage - -```ruby -team_member_id = 'team_member_id0' - - -result = team_api.retrieve_team_member(team_member_id: team_member_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def update_team_member(team_member_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_id` | `String` | Template, Required | The ID of the team member to update. | -| `body` | [`Update Team Member Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Team Member Response Hash`](../../doc/models/update-team-member-response.md). - -## Example Usage - -```ruby -team_member_id = 'team_member_id0' - -body = { - :team_member => { - :reference_id => 'reference_id_1', - :status => 'ACTIVE', - :given_name => 'Joe', - :family_name => 'Doe', - :email_address => 'joe_doe@gmail.com', - :phone_number => '+14159283333', - :assigned_locations => { - :assignment_type => 'EXPLICIT_LOCATIONS', - :location_ids => [ - 'YSGH2WBKG94QZ', - 'GA2Y9HSJ8KRYT' - ] - } - } -} - - -result = team_api.update_team_member( - team_member_id: team_member_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def retrieve_wage_setting(team_member_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_id` | `String` | Template, Required | The ID of the team member for which to retrieve the wage setting. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Wage Setting Response Hash`](../../doc/models/retrieve-wage-setting-response.md). - -## Example Usage - -```ruby -team_member_id = 'team_member_id0' - - -result = team_api.retrieve_wage_setting(team_member_id: team_member_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def update_wage_setting(team_member_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_id` | `String` | Template, Required | The ID of the team member for which to update the `WageSetting` object. | -| `body` | [`Update Wage Setting Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Wage Setting Response Hash`](../../doc/models/update-wage-setting-response.md). - -## Example Usage - -```ruby -team_member_id = 'team_member_id0' - -body = { - :wage_setting => { - :job_assignments => [ - { - :pay_type => 'SALARY', - :job_title => 'Manager', - :annual_rate => { - :amount => 3000000, - :currency => 'USD' - }, - :weekly_hours => 40 - }, - { - :pay_type => 'HOURLY', - :job_title => 'Cashier', - :hourly_rate => { - :amount => 2000, - :currency => 'USD' - } - } - ], - :is_overtime_exempt => true - } -} - - -result = team_api.update_wage_setting( - team_member_id: team_member_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/terminal.md b/doc/api/terminal.md deleted file mode 100644 index fc5a3100e..000000000 --- a/doc/api/terminal.md +++ /dev/null @@ -1,602 +0,0 @@ -# Terminal - -```ruby -terminal_api = client.terminal -``` - -## 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. - -```ruby -def create_terminal_action(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Terminal Action Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Terminal Action Response Hash`](../../doc/models/create-terminal-action-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => 'thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e', - :action => { - :device_id => '{{DEVICE_ID}}', - :deadline_duration => 'PT5M', - :type => 'SAVE_CARD', - :save_card_options => { - :customer_id => '{{CUSTOMER_ID}}', - :reference_id => 'user-id-1' - } - } -} - - -result = terminal_api.create_terminal_action(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_terminal_actions(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Terminal Actions Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Terminal Actions Response Hash`](../../doc/models/search-terminal-actions-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :filter => { - :created_at => { - :start_at => '2022-04-01T00:00:00.000Z' - } - }, - :sort => { - :sort_order => 'DESC' - } - }, - :limit => 2 -} - - -result = terminal_api.search_terminal_actions(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Terminal Action - -Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 days. - -```ruby -def get_terminal_action(action_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `action_id` | `String` | Template, Required | Unique ID for the desired `TerminalAction`. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Terminal Action Response Hash`](../../doc/models/get-terminal-action-response.md). - -## Example Usage - -```ruby -action_id = 'action_id6' - - -result = terminal_api.get_terminal_action(action_id: action_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Cancel Terminal Action - -Cancels a Terminal action request if the status of the request permits it. - -```ruby -def cancel_terminal_action(action_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `action_id` | `String` | Template, Required | Unique ID for the desired `TerminalAction`. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Cancel Terminal Action Response Hash`](../../doc/models/cancel-terminal-action-response.md). - -## Example Usage - -```ruby -action_id = 'action_id6' - - -result = terminal_api.cancel_terminal_action(action_id: action_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def dismiss_terminal_action(action_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `action_id` | `String` | Template, Required | Unique ID for the `TerminalAction` associated with the action to be dismissed. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Dismiss Terminal Action Response Hash`](../../doc/models/dismiss-terminal-action-response.md). - -## Example Usage - -```ruby -action_id = 'action_id6' - - -result = terminal_api.dismiss_terminal_action(action_id: action_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Create Terminal Checkout - -Creates a Terminal checkout request and sends it to the specified device to take a payment -for the requested amount. - -```ruby -def create_terminal_checkout(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Terminal Checkout Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Terminal Checkout Response Hash`](../../doc/models/create-terminal-checkout-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => '28a0c3bc-7839-11ea-bc55-0242ac130003', - :checkout => { - :amount_money => { - :amount => 2610, - :currency => 'USD' - }, - :device_options => { - :device_id => 'dbb5d83a-7838-11ea-bc55-0242ac130003' - }, - :reference_id => 'id11572', - :note => 'A brief note' - } -} - - -result = terminal_api.create_terminal_checkout(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_terminal_checkouts(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Terminal Checkouts Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Terminal Checkouts Response Hash`](../../doc/models/search-terminal-checkouts-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :filter => { - :status => 'COMPLETED' - } - }, - :limit => 2 -} - - -result = terminal_api.search_terminal_checkouts(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Terminal Checkout - -Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days. - -```ruby -def get_terminal_checkout(checkout_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `checkout_id` | `String` | Template, Required | The unique ID for the desired `TerminalCheckout`. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Terminal Checkout Response Hash`](../../doc/models/get-terminal-checkout-response.md). - -## Example Usage - -```ruby -checkout_id = 'checkout_id8' - - -result = terminal_api.get_terminal_checkout(checkout_id: checkout_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Cancel Terminal Checkout - -Cancels a Terminal checkout request if the status of the request permits it. - -```ruby -def cancel_terminal_checkout(checkout_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `checkout_id` | `String` | Template, Required | The unique ID for the desired `TerminalCheckout`. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Cancel Terminal Checkout Response Hash`](../../doc/models/cancel-terminal-checkout-response.md). - -## Example Usage - -```ruby -checkout_id = 'checkout_id8' - - -result = terminal_api.cancel_terminal_checkout(checkout_id: checkout_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Dismiss Terminal Checkout - -Dismisses a Terminal checkout request if the status and type of the request permits it. - -```ruby -def dismiss_terminal_checkout(checkout_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `checkout_id` | `String` | Template, Required | Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Dismiss Terminal Checkout Response Hash`](../../doc/models/dismiss-terminal-checkout-response.md). - -## Example Usage - -```ruby -checkout_id = 'checkout_id8' - - -result = terminal_api.dismiss_terminal_checkout(checkout_id: checkout_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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). - -```ruby -def create_terminal_refund(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Terminal Refund Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Terminal Refund Response Hash`](../../doc/models/create-terminal-refund-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => '402a640b-b26f-401f-b406-46f839590c04', - :refund => { - :payment_id => '5O5OvgkcNUhl7JBuINflcjKqUzXZY', - :amount_money => { - :amount => 111, - :currency => 'CAD' - }, - :reason => 'Returning items', - :device_id => 'f72dfb8e-4d65-4e56-aade-ec3fb8d33291' - } -} - - -result = terminal_api.create_terminal_refund(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def search_terminal_refunds(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Terminal Refunds Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Terminal Refunds Response Hash`](../../doc/models/search-terminal-refunds-response.md). - -## Example Usage - -```ruby -body = { - :query => { - :filter => { - :status => 'COMPLETED' - } - }, - :limit => 1 -} - - -result = terminal_api.search_terminal_refunds(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Get Terminal Refund - -Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days. - -```ruby -def get_terminal_refund(terminal_refund_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `terminal_refund_id` | `String` | Template, Required | The unique ID for the desired `TerminalRefund`. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Get Terminal Refund Response Hash`](../../doc/models/get-terminal-refund-response.md). - -## Example Usage - -```ruby -terminal_refund_id = 'terminal_refund_id0' - - -result = terminal_api.get_terminal_refund(terminal_refund_id: terminal_refund_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Cancel Terminal Refund - -Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. - -```ruby -def cancel_terminal_refund(terminal_refund_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `terminal_refund_id` | `String` | Template, Required | The unique ID for the desired `TerminalRefund`. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Cancel Terminal Refund Response Hash`](../../doc/models/cancel-terminal-refund-response.md). - -## Example Usage - -```ruby -terminal_refund_id = 'terminal_refund_id0' - - -result = terminal_api.cancel_terminal_refund(terminal_refund_id: terminal_refund_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Dismiss Terminal Refund - -Dismisses a Terminal refund request if the status and type of the request permits it. - -```ruby -def dismiss_terminal_refund(terminal_refund_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `terminal_refund_id` | `String` | Template, Required | Unique ID for the `TerminalRefund` associated with the refund to be dismissed. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Dismiss Terminal Refund Response Hash`](../../doc/models/dismiss-terminal-refund-response.md). - -## Example Usage - -```ruby -terminal_refund_id = 'terminal_refund_id0' - - -result = terminal_api.dismiss_terminal_refund(terminal_refund_id: terminal_refund_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/transactions.md b/doc/api/transactions.md deleted file mode 100644 index 7bd9d6c5b..000000000 --- a/doc/api/transactions.md +++ /dev/null @@ -1,203 +0,0 @@ -# Transactions - -```ruby -transactions_api = client.transactions -``` - -## 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 - -```ruby -def list_transactions(location_id:, - begin_time: nil, - end_time: nil, - sort_order: nil, - cursor: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the location to list transactions for. | -| `begin_time` | `String` | 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. | -| `end_time` | `String` | 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. | -| `sort_order` | [`String (Sort Order)`](../../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` | 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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Transactions Response Hash`](../../doc/models/list-transactions-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - - -result = transactions_api.list_transactions(location_id: location_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Transaction - -**This endpoint is deprecated.** - -Retrieves details for a single transaction. - -```ruby -def retrieve_transaction(location_id:, - transaction_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the transaction's associated location. | -| `transaction_id` | `String` | Template, Required | The ID of the transaction to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Transaction Response Hash`](../../doc/models/retrieve-transaction-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -transaction_id = 'transaction_id8' - - -result = transactions_api.retrieve_transaction( - location_id: location_id, - transaction_id: transaction_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def capture_transaction(location_id:, - transaction_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | - | -| `transaction_id` | `String` | Template, Required | - | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Capture Transaction Response Hash`](../../doc/models/capture-transaction-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -transaction_id = 'transaction_id8' - - -result = transactions_api.capture_transaction( - location_id: location_id, - transaction_id: transaction_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# 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. - -```ruby -def void_transaction(location_id:, - transaction_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | - | -| `transaction_id` | `String` | Template, Required | - | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Void Transaction Response Hash`](../../doc/models/void-transaction-response.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -transaction_id = 'transaction_id8' - - -result = transactions_api.void_transaction( - location_id: location_id, - transaction_id: transaction_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/v1-transactions.md b/doc/api/v1-transactions.md deleted file mode 100644 index 00ef7260a..000000000 --- a/doc/api/v1-transactions.md +++ /dev/null @@ -1,151 +0,0 @@ -# V1 Transactions - -```ruby -v1_transactions_api = client.v1_transactions -``` - -## 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. - -```ruby -def v1_list_orders(location_id:, - order: nil, - limit: nil, - batch_token: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the location to list online store orders for. | -| `order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payments are listed in the response. | -| `limit` | `Integer` | Query, Optional | The maximum number of payments to return in a single response. This value cannot exceed 200. | -| `batch_token` | `String` | Query, Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Array`](../../doc/models/v1-order.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - - -result = v1_transactions_api.v1_list_orders(location_id: location_id) - -if result.success? - puts result.data -elsif result.error? - warn result.data -end -``` - - -# V1 Retrieve Order - -**This endpoint is deprecated.** - -Provides comprehensive information for a single online store order, including the order's history. - -```ruby -def v1_retrieve_order(location_id:, - order_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the order's associated location. | -| `order_id` | `String` | Template, Required | The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`V1 Order Hash`](../../doc/models/v1-order.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -order_id = 'order_id6' - - -result = v1_transactions_api.v1_retrieve_order( - location_id: location_id, - order_id: order_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.data -end -``` - - -# 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: - -```ruby -def v1_update_order(location_id:, - order_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Template, Required | The ID of the order's associated location. | -| `order_id` | `String` | Template, Required | The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint | -| `body` | [`V1 Update Order Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`V1 Order Hash`](../../doc/models/v1-order.md). - -## Example Usage - -```ruby -location_id = 'location_id4' - -order_id = 'order_id6' - -body = { - :action => 'REFUND' -} - - -result = v1_transactions_api.v1_update_order( - location_id: location_id, - order_id: order_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.data -end -``` - diff --git a/doc/api/vendors.md b/doc/api/vendors.md deleted file mode 100644 index 29e40818b..000000000 --- a/doc/api/vendors.md +++ /dev/null @@ -1,293 +0,0 @@ -# Vendors - -```ruby -vendors_api = client.vendors -``` - -## 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. - -```ruby -def bulk_create_vendors(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Create Vendors Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Create Vendors Response Hash`](../../doc/models/bulk-create-vendors-response.md). - -## Example Usage - -```ruby -body = { - :vendors => { - 'key0' => {}, - 'key1' => {} - } -} - - -result = vendors_api.bulk_create_vendors(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Bulk Retrieve Vendors - -Retrieves one or more vendors of specified [Vendor](../../doc/models/vendor.md) IDs. - -```ruby -def bulk_retrieve_vendors(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Retrieve Vendors Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Retrieve Vendors Response Hash`](../../doc/models/bulk-retrieve-vendors-response.md). - -## Example Usage - -```ruby -body = { - :vendor_ids => [ - 'INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4' - ] -} - - -result = vendors_api.bulk_retrieve_vendors(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Bulk Update Vendors - -Updates one or more of existing [Vendor](../../doc/models/vendor.md) objects as suppliers to a seller. - -```ruby -def bulk_update_vendors(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Bulk Update Vendors Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Update Vendors Response Hash`](../../doc/models/bulk-update-vendors-response.md). - -## Example Usage - -```ruby -body = { - :vendors => { - 'key0' => { - :vendor => {} - }, - 'key1' => { - :vendor => {} - } - } -} - - -result = vendors_api.bulk_update_vendors(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Create Vendor - -Creates a single [Vendor](../../doc/models/vendor.md) object to represent a supplier to a seller. - -```ruby -def create_vendor(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Vendor Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Vendor Response Hash`](../../doc/models/create-vendor-response.md). - -## Example Usage - -```ruby -body = { - :idempotency_key => 'idempotency_key2' -} - - -result = vendors_api.create_vendor(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Search Vendors - -Searches for vendors using a filter against supported [Vendor](../../doc/models/vendor.md) properties and a supported sorter. - -```ruby -def search_vendors(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Search Vendors Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Search Vendors Response Hash`](../../doc/models/search-vendors-response.md). - -## Example Usage - -```ruby -body = {} - - -result = vendors_api.search_vendors(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Vendor - -Retrieves the vendor of a specified [Vendor](../../doc/models/vendor.md) ID. - -```ruby -def retrieve_vendor(vendor_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `vendor_id` | `String` | Template, Required | ID of the [Vendor](entity:Vendor) to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Vendor Response Hash`](../../doc/models/retrieve-vendor-response.md). - -## Example Usage - -```ruby -vendor_id = 'vendor_id8' - - -result = vendors_api.retrieve_vendor(vendor_id: vendor_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Vendor - -Updates an existing [Vendor](../../doc/models/vendor.md) object as a supplier to a seller. - -```ruby -def update_vendor(body:, - vendor_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Update Vendor Request Hash`](../../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. | -| `vendor_id` | `String` | Template, Required | - | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Vendor Response Hash`](../../doc/models/update-vendor-response.md). - -## Example Usage - -```ruby -body = { - :vendor => { - :id => 'INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4', - :name => 'Jack\'s Chicken Shack', - :version => 1, - :status => 'ACTIVE' - }, - :idempotency_key => '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe' -} - -vendor_id = 'vendor_id8' - - -result = vendors_api.update_vendor( - body: body, - vendor_id: vendor_id -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/api/webhook-subscriptions.md b/doc/api/webhook-subscriptions.md deleted file mode 100644 index 86c107058..000000000 --- a/doc/api/webhook-subscriptions.md +++ /dev/null @@ -1,337 +0,0 @@ -# Webhook Subscriptions - -```ruby -webhook_subscriptions_api = client.webhook_subscriptions -``` - -## 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. - -```ruby -def list_webhook_event_types(api_version: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `api_version` | `String` | Query, Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Webhook Event Types Response Hash`](../../doc/models/list-webhook-event-types-response.md). - -## Example Usage - -```ruby -result = webhook_subscriptions_api.list_webhook_event_types - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# List Webhook Subscriptions - -Lists all webhook subscriptions owned by your application. - -```ruby -def list_webhook_subscriptions(cursor: nil, - include_disabled: false, - sort_order: nil, - limit: nil) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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). | -| `include_disabled` | `TrueClass \| FalseClass` | Query, Optional | Includes disabled [Subscription](entity:WebhookSubscription)s.
By default, all enabled [Subscription](entity:WebhookSubscription)s are returned.
**Default**: `false` | -| `sort_order` | [`String (Sort Order)`](../../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` | `Integer` | 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 | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`List Webhook Subscriptions Response Hash`](../../doc/models/list-webhook-subscriptions-response.md). - -## Example Usage - -```ruby -include_disabled = false - - -result = webhook_subscriptions_api.list_webhook_subscriptions(include_disabled: include_disabled) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Create Webhook Subscription - -Creates a webhook subscription. - -```ruby -def create_webhook_subscription(body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`Create Webhook Subscription Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Create Webhook Subscription Response Hash`](../../doc/models/create-webhook-subscription-response.md). - -## Example Usage - -```ruby -body = { - :subscription => { - :name => 'Example Webhook Subscription', - :event_types => [ - 'payment.created', - 'payment.updated' - ], - :notification_url => 'https://example-webhook-url.com', - :api_version => '2021-12-15' - }, - :idempotency_key => '63f84c6c-2200-4c99-846c-2670a1311fbf' -} - - -result = webhook_subscriptions_api.create_webhook_subscription(body: body) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Delete Webhook Subscription - -Deletes a webhook subscription. - -```ruby -def delete_webhook_subscription(subscription_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to delete. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Delete Webhook Subscription Response Hash`](../../doc/models/delete-webhook-subscription-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - - -result = webhook_subscriptions_api.delete_webhook_subscription(subscription_id: subscription_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Retrieve Webhook Subscription - -Retrieves a webhook subscription identified by its ID. - -```ruby -def retrieve_webhook_subscription(subscription_id:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to retrieve. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Retrieve Webhook Subscription Response Hash`](../../doc/models/retrieve-webhook-subscription-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - - -result = webhook_subscriptions_api.retrieve_webhook_subscription(subscription_id: subscription_id) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Webhook Subscription - -Updates a webhook subscription. - -```ruby -def update_webhook_subscription(subscription_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. | -| `body` | [`Update Webhook Subscription Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Webhook Subscription Response Hash`](../../doc/models/update-webhook-subscription-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - -body = { - :subscription => { - :name => 'Updated Example Webhook Subscription', - :enabled => false - } -} - - -result = webhook_subscriptions_api.update_webhook_subscription( - subscription_id: subscription_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Update Webhook Subscription Signature Key - -Updates a webhook subscription by replacing the existing signature key with a new one. - -```ruby -def update_webhook_subscription_signature_key(subscription_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. | -| `body` | [`Update Webhook Subscription Signature Key Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Update Webhook Subscription Signature Key Response Hash`](../../doc/models/update-webhook-subscription-signature-key-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - -body = { - :idempotency_key => 'ed80ae6b-0654-473b-bbab-a39aee89a60d' -} - - -result = webhook_subscriptions_api.update_webhook_subscription_signature_key( - subscription_id: subscription_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - - -# Test Webhook Subscription - -Tests a webhook subscription by sending a test event to the notification URL. - -```ruby -def test_webhook_subscription(subscription_id:, - body:) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_id` | `String` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to test. | -| `body` | [`Test Webhook Subscription Request Hash`](../../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. | - -## Response Type - -This method returns a `ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Test Webhook Subscription Response Hash`](../../doc/models/test-webhook-subscription-response.md). - -## Example Usage - -```ruby -subscription_id = 'subscription_id0' - -body = { - :event_type => 'payment.created' -} - - -result = webhook_subscriptions_api.test_webhook_subscription( - subscription_id: subscription_id, - body: body -) - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - diff --git a/doc/auth/oauth-2-bearer-token.md b/doc/auth/oauth-2-bearer-token.md deleted file mode 100644 index c8a9472c1..000000000 --- a/doc/auth/oauth-2-bearer-token.md +++ /dev/null @@ -1,25 +0,0 @@ -# OAuth 2 Bearer token - -Documentation for accessing and setting credentials for global. - -## Auth Credentials - -| Name | Type | Description | Getter | -| ----------- | -------- | --------------------------------------------------- | -------------- | -| AccessToken | `String` | The OAuth 2.0 Access Token to use for API requests. | `access_token` | - -**Note:** Auth credentials can be set using named parameter for any of the above credentials (e.g. `access_token`) in the client initialization. - -## Usage Example - -### Client Initialization - -You must provide credentials in the client as shown in the following code snippet. - -```ruby -client = SquareLegacy::Client.new( - bearer_auth_credentials: BearerAuthCredentials.new( - access_token: 'AccessToken' - ) -) -``` diff --git a/doc/client.md b/doc/client.md deleted file mode 100644 index b946b908f..000000000 --- a/doc/client.md +++ /dev/null @@ -1,123 +0,0 @@ -# Client Class Documentation - -The following parameters are configurable for the API Client: - -| Parameter | Type | Description | -| ------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `square_version` | `String` | Square Connect API versions
_Default_: `'2025-07-16'` | -| `custom_url` | `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`** | -| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests | -| `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests | -| `timeout` | `Float` | The value to use for connection timeout.
**Default: 60** | -| `max_retries` | `Integer` | The number of times to retry an endpoint call if it fails.
**Default: 0** | -| `retry_interval` | `Float` | Pause in seconds between retries.
**Default: 1** | -| `backoff_factor` | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff.
**Default: 2** | -| `retry_statuses` | `Array` | A list of HTTP statuses to retry.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | -| `retry_methods` | `Array` | A list of HTTP methods to retry.
**Default: %i[get put]** | -| `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. | -| `user_agent_detail` | `string` | User agent detail, to be appended with user-agent header. | -| `additional_headers` | `String` | Additional headers to add to each API request | -| `bearer_auth_credentials` | [`BearerAuthCredentials`](auth/oauth-2-bearer-token.md) | The credential object for OAuth 2 Bearer token | - -The API client can be initialized as follows: - -```ruby -client = SquareLegacy::Client.new( - square_version: '2025-06-18', - bearer_auth_credentials: BearerAuthCredentials.new( - access_token: 'AccessToken' - ), - environment: 'production', - custom_url: 'https://connect.squareup.com' -) -``` - -API calls return an `ApiResponse` object that includes the following fields: - -| Field | Description | -| --------------- | ------------------------------------------ | -| `status_code` | Status code of the HTTP response | -| `reason_phrase` | Reason phrase of the HTTP response | -| `headers` | Headers of the HTTP response as a Hash | -| `raw_body` | The body of the HTTP response as a String | -| `request` | HTTP request info | -| `errors` | Errors, if they exist | -| `cursor` | Cursor, if it exists | -| `body` | The deserialized body of the HTTP response | -| `data` | Data portion of returned body | - -## Make Calls with the API Client - -```ruby -require 'square_legacy' -include Square - -client = SquareLegacy::Client.new( - square_version: '2025-06-18', - bearer_auth_credentials: BearerAuthCredentials.new( - access_token: 'AccessToken' - ), - environment: 'production', - custom_url: 'https://connect.squareup.com' -) - -result = client.locations.list_locations - -if result.success? - puts result.data -elsif result.error? - warn result.errors -end -``` - -## 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 | -| -------------------------- | -------------------------------- | -| mobile_authorization | Gets MobileAuthorizationApi | -| o_auth | Gets OAuthApi | -| v1_transactions | Gets V1TransactionsApi | -| apple_pay | Gets ApplePayApi | -| bank_accounts | Gets BankAccountsApi | -| bookings | Gets BookingsApi | -| booking_custom_attributes | Gets BookingCustomAttributesApi | -| cards | Gets CardsApi | -| cash_drawers | Gets CashDrawersApi | -| catalog | Gets CatalogApi | -| customers | Gets CustomersApi | -| customer_custom_attributes | Gets CustomerCustomAttributesApi | -| customer_groups | Gets CustomerGroupsApi | -| customer_segments | Gets CustomerSegmentsApi | -| devices | Gets DevicesApi | -| disputes | Gets DisputesApi | -| employees | Gets EmployeesApi | -| events | Gets EventsApi | -| gift_cards | Gets GiftCardsApi | -| gift_card_activities | Gets GiftCardActivitiesApi | -| inventory | Gets InventoryApi | -| invoices | Gets InvoicesApi | -| labor | Gets LaborApi | -| locations | Gets LocationsApi | -| location_custom_attributes | Gets LocationCustomAttributesApi | -| checkout | Gets CheckoutApi | -| transactions | Gets TransactionsApi | -| loyalty | Gets LoyaltyApi | -| merchants | Gets MerchantsApi | -| merchant_custom_attributes | Gets MerchantCustomAttributesApi | -| orders | Gets OrdersApi | -| order_custom_attributes | 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 | -| webhook_subscriptions | Gets WebhookSubscriptionsApi | diff --git a/doc/http-request.md b/doc/http-request.md deleted file mode 100644 index cb611109e..000000000 --- a/doc/http-request.md +++ /dev/null @@ -1,15 +0,0 @@ - -# HttpRequest - -Represents a single Http Request. - -## Properties - -| Name | Type | Tag | Description | -| --- | --- | --- | --- | -| http_method | HttpMethodEnum | | The HTTP method of the request. | -| query_url | String | | The endpoint URL for the API request. | -| headers | Hash | Optional | Request headers. | -| parameters | Hash | Optional | Request body. | -| context | Hash | Optional | Request context for passing meta information about the request. | - diff --git a/doc/http-response.md b/doc/http-response.md deleted file mode 100644 index 69ab50dbb..000000000 --- a/doc/http-response.md +++ /dev/null @@ -1,15 +0,0 @@ - -# HttpResponse - -Http response received. - -## Properties - -| Name | Type | Description | -| --- | --- | --- | -| status_code | Integer | The status code returned by the server. | -| reason_phrase | String | The reason phrase returned by the server. | -| headers | Hash | Response headers. | -| raw_body | String | Response body. | -| request | [`HttpRequest`](http-request.md) | The request that resulted in this response. | - diff --git a/doc/models/accept-dispute-response.md b/doc/models/accept-dispute-response.md deleted file mode 100644 index 29f42f6c1..000000000 --- a/doc/models/accept-dispute-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Accept Dispute Response - -Defines the fields in an `AcceptDispute` response. - -## Structure - -`Accept Dispute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `dispute` | [`Dispute Hash`](../../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/doc/models/accepted-payment-methods.md b/doc/models/accepted-payment-methods.md deleted file mode 100644 index 612e618dd..000000000 --- a/doc/models/accepted-payment-methods.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Accepted Payment Methods - -## Structure - -`Accepted Payment Methods` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `apple_pay` | `TrueClass \| FalseClass` | Optional | Whether Apple Pay is accepted at checkout. | -| `google_pay` | `TrueClass \| FalseClass` | Optional | Whether Google Pay is accepted at checkout. | -| `cash_app_pay` | `TrueClass \| FalseClass` | Optional | Whether Cash App Pay is accepted at checkout. | -| `afterpay_clearpay` | `TrueClass \| FalseClass` | 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/doc/models/accumulate-loyalty-points-request.md b/doc/models/accumulate-loyalty-points-request.md deleted file mode 100644 index 4bcb3e22f..000000000 --- a/doc/models/accumulate-loyalty-points-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Accumulate Loyalty Points Request - -Represents an [AccumulateLoyaltyPoints](../../doc/api/loyalty.md#accumulate-loyalty-points) request. - -## Structure - -`Accumulate Loyalty Points Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `accumulate_points` | [`Loyalty Event Accumulate Points Hash`](../../doc/models/loyalty-event-accumulate-points.md) | Required | Provides metadata when the event `type` is `ACCUMULATE_POINTS`. | -| `idempotency_key` | `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` | -| `location_id` | `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/doc/models/accumulate-loyalty-points-response.md b/doc/models/accumulate-loyalty-points-response.md deleted file mode 100644 index 80c5466cf..000000000 --- a/doc/models/accumulate-loyalty-points-response.md +++ /dev/null @@ -1,99 +0,0 @@ - -# Accumulate Loyalty Points Response - -Represents an [AccumulateLoyaltyPoints](../../doc/api/loyalty.md#accumulate-loyalty-points) response. - -## Structure - -`Accumulate Loyalty Points Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `event` | [`Loyalty Event Hash`](../../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` | [`Array`](../../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/doc/models/ach-details.md b/doc/models/ach-details.md deleted file mode 100644 index 71c69a98c..000000000 --- a/doc/models/ach-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# ACH Details - -ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. - -## Structure - -`ACH Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `routing_number` | `String` | Optional | The routing number for the bank account.
**Constraints**: *Maximum Length*: `50` | -| `account_number_suffix` | `String` | Optional | The last few digits of the bank account number.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4` | -| `account_type` | `String` | 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/doc/models/action-cancel-reason.md b/doc/models/action-cancel-reason.md deleted file mode 100644 index d624da634..000000000 --- a/doc/models/action-cancel-reason.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Action Cancel Reason - -## Enumeration - -`Action Cancel Reason` - -## 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/doc/models/activity-type.md b/doc/models/activity-type.md deleted file mode 100644 index f32173d66..000000000 --- a/doc/models/activity-type.md +++ /dev/null @@ -1,70 +0,0 @@ - -# Activity Type - -## Enumeration - -`Activity Type` - -## 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/doc/models/add-group-to-customer-response.md b/doc/models/add-group-to-customer-response.md deleted file mode 100644 index d63adab9f..000000000 --- a/doc/models/add-group-to-customer-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 - -`Add Group to Customer Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/additional-recipient.md b/doc/models/additional-recipient.md deleted file mode 100644 index 3b70208a4..000000000 --- a/doc/models/additional-recipient.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Additional Recipient - -Represents an additional recipient (other than the merchant) receiving a portion of this tender. - -## Structure - -`Additional Recipient` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `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` | Optional | The description of the additional recipient.
**Constraints**: *Maximum Length*: `100` | -| `amount_money` | [`Money Hash`](../../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. | -| `receivable_id` | `String` | 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/doc/models/address.md b/doc/models/address.md deleted file mode 100644 index 385d809dc..000000000 --- a/doc/models/address.md +++ /dev/null @@ -1,41 +0,0 @@ - -# 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 | -| --- | --- | --- | --- | -| `address_line_1` | `String` | 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). | -| `address_line_2` | `String` | Optional | The second line of the address, if any. | -| `address_line_3` | `String` | Optional | The third line of the address, if any. | -| `locality` | `String` | 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` | Optional | A civil region within the address's `locality`, if any. | -| `sublocality_2` | `String` | Optional | A civil region within the address's `sublocality`, if any. | -| `sublocality_3` | `String` | Optional | A civil region within the address's `sublocality_2`, if any. | -| `administrative_district_level_1` | `String` | 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). | -| `administrative_district_level_2` | `String` | Optional | A civil entity within the address's `administrative_district_level_1`.
In the US, this is the county. | -| `administrative_district_level_3` | `String` | Optional | A civil entity within the address's `administrative_district_level_2`,
if any. | -| `postal_code` | `String` | 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 (Country)`](../../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). | -| `first_name` | `String` | Optional | Optional first name when it's representing recipient. | -| `last_name` | `String` | 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/doc/models/adjust-loyalty-points-request.md b/doc/models/adjust-loyalty-points-request.md deleted file mode 100644 index e6222cc26..000000000 --- a/doc/models/adjust-loyalty-points-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Adjust Loyalty Points Request - -Represents an [AdjustLoyaltyPoints](../../doc/api/loyalty.md#adjust-loyalty-points) request. - -## Structure - -`Adjust Loyalty Points Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `adjust_points` | [`Loyalty Event Adjust Points Hash`](../../doc/models/loyalty-event-adjust-points.md) | Required | Provides metadata when the event `type` is `ADJUST_POINTS`. | -| `allow_negative_balance` | `TrueClass \| FalseClass` | 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/doc/models/adjust-loyalty-points-response.md b/doc/models/adjust-loyalty-points-response.md deleted file mode 100644 index 89d6059f9..000000000 --- a/doc/models/adjust-loyalty-points-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Adjust Loyalty Points Response - -Represents an [AdjustLoyaltyPoints](../../doc/api/loyalty.md#adjust-loyalty-points) request. - -## Structure - -`Adjust Loyalty Points Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `event` | [`Loyalty Event Hash`](../../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/doc/models/afterpay-details.md b/doc/models/afterpay-details.md deleted file mode 100644 index 31d00be17..000000000 --- a/doc/models/afterpay-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Afterpay Details - -Additional details about Afterpay payments. - -## Structure - -`Afterpay Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `email_address` | `String` | Optional | Email address on the buyer's Afterpay account.
**Constraints**: *Maximum Length*: `255` | - -## Example (as JSON) - -```json -{ - "email_address": "email_address2" -} -``` - diff --git a/doc/models/application-details-external-square-product.md b/doc/models/application-details-external-square-product.md deleted file mode 100644 index 2422f67f1..000000000 --- a/doc/models/application-details-external-square-product.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Application Details External Square Product - -A list of products to return to external callers. - -## Enumeration - -`Application Details External Square Product` - -## Fields - -| Name | -| --- | -| `APPOINTMENTS` | -| `ECOMMERCE_API` | -| `INVOICES` | -| `ONLINE_STORE` | -| `OTHER` | -| `RESTAURANTS` | -| `RETAIL` | -| `SQUARE_POS` | -| `TERMINAL_API` | -| `VIRTUAL_TERMINAL` | - diff --git a/doc/models/application-details.md b/doc/models/application-details.md deleted file mode 100644 index 348160af8..000000000 --- a/doc/models/application-details.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Application Details - -Details about the application that took the payment. - -## Structure - -`Application Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `square_product` | [`String (Application Details External Square Product)`](../../doc/models/application-details-external-square-product.md) | Optional | A list of products to return to external callers. | -| `application_id` | `String` | 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/doc/models/application-type.md b/doc/models/application-type.md deleted file mode 100644 index 250d635db..000000000 --- a/doc/models/application-type.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Application Type - -## Enumeration - -`Application Type` - -## Fields - -| Name | -| --- | -| `TERMINAL_API` | - diff --git a/doc/models/appointment-segment.md b/doc/models/appointment-segment.md deleted file mode 100644 index 4319b8f26..000000000 --- a/doc/models/appointment-segment.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Appointment Segment - -Defines an appointment segment of a booking. - -## Structure - -`Appointment Segment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `duration_minutes` | `Integer` | Optional | The time span in minutes of an appointment segment.
**Constraints**: `<= 1500` | -| `service_variation_id` | `String` | Optional | The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.
**Constraints**: *Maximum Length*: `36` | -| `team_member_id` | `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` | -| `service_variation_version` | `Integer` | Optional | The current version of the item variation representing the service booked in this segment. | -| `intermission_minutes` | `Integer` | Optional | Time between the end of this segment and the beginning of the subsequent segment. | -| `any_team_member` | `TrueClass \| FalseClass` | Optional | Whether the customer accepts any team member, instead of a specific one, to serve this segment. | -| `resource_ids` | `Array` | 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/doc/models/archived-state.md b/doc/models/archived-state.md deleted file mode 100644 index b3e6bda81..000000000 --- a/doc/models/archived-state.md +++ /dev/null @@ -1,19 +0,0 @@ - -# 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 - -`Archived State` - -## 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/doc/models/availability.md b/doc/models/availability.md deleted file mode 100644 index a30732614..000000000 --- a/doc/models/availability.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Availability - -Defines an appointment slot that encapsulates the appointment segments, location and starting time available for booking. - -## Structure - -`Availability` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `start_at` | `String` | Optional | The RFC 3339 timestamp specifying the beginning time of the slot available for booking. | -| `location_id` | `String` | Optional | The ID of the location available for booking.
**Constraints**: *Maximum Length*: `32` | -| `appointment_segments` | [`Array`](../../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/doc/models/bank-account-payment-details.md b/doc/models/bank-account-payment-details.md deleted file mode 100644 index 03bcd942e..000000000 --- a/doc/models/bank-account-payment-details.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Bank Account Payment Details - -Additional details about BANK_ACCOUNT type payments. - -## Structure - -`Bank Account Payment Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `bank_name` | `String` | Optional | The name of the bank associated with the bank account.
**Constraints**: *Maximum Length*: `100` | -| `transfer_type` | `String` | Optional | The type of the bank transfer. The type can be `ACH` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | -| `account_ownership_type` | `String` | 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` | 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` | Optional | The two-letter ISO code representing the country the bank account is located in.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2` | -| `statement_description` | `String` | Optional | The statement description as sent to the bank.
**Constraints**: *Maximum Length*: `1000` | -| `ach_details` | [`ACH Details Hash`](../../doc/models/ach-details.md) | Optional | ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. | -| `errors` | [`Array`](../../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/doc/models/bank-account-status.md b/doc/models/bank-account-status.md deleted file mode 100644 index 21958a80e..000000000 --- a/doc/models/bank-account-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Bank Account Status - -Indicates the current verification status of a `BankAccount` object. - -## Enumeration - -`Bank Account Status` - -## 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/doc/models/bank-account-type.md b/doc/models/bank-account-type.md deleted file mode 100644 index ef7f380f3..000000000 --- a/doc/models/bank-account-type.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Bank Account Type - -Indicates the financial purpose of the bank account. - -## Enumeration - -`Bank Account Type` - -## 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/doc/models/bank-account.md b/doc/models/bank-account.md deleted file mode 100644 index 440adde4d..000000000 --- a/doc/models/bank-account.md +++ /dev/null @@ -1,55 +0,0 @@ - -# 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 - -`Bank Account` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Required | The unique, Square-issued identifier for the bank account.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30` | -| `account_number_suffix` | `String` | Required | The last few digits of the account number.
**Constraints**: *Minimum Length*: `1` | -| `country` | [`String (Country)`](../../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 (Currency)`](../../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). | -| `account_type` | [`String (Bank Account Type)`](../../doc/models/bank-account-type.md) | Required | Indicates the financial purpose of the bank account. | -| `holder_name` | `String` | Required | Name of the account holder. This name must match the name
on the targeted bank account record.
**Constraints**: *Minimum Length*: `1` | -| `primary_bank_identification_number` | `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` | -| `secondary_bank_identification_number` | `String` | 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` | -| `debit_mandate_reference_id` | `String` | Optional | Reference identifier that will be displayed to UK bank account owners
when collecting direct debit authorization. Only required for UK bank accounts. | -| `reference_id` | `String` | 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). | -| `location_id` | `String` | Optional | The location to which the bank account belongs. | -| `status` | [`String (Bank Account Status)`](../../doc/models/bank-account-status.md) | Required | Indicates the current verification status of a `BankAccount` object. | -| `creditable` | `TrueClass \| FalseClass` | Required | Indicates whether it is possible for Square to send money to this bank account. | -| `debitable` | `TrueClass \| FalseClass` | Required | Indicates whether it is possible for Square to take money from this
bank account. | -| `fingerprint` | `String` | 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` | `Integer` | Optional | The current version of the `BankAccount`. | -| `bank_name` | `String` | 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/doc/models/batch-change-inventory-request.md b/doc/models/batch-change-inventory-request.md deleted file mode 100644 index 0427594d8..000000000 --- a/doc/models/batch-change-inventory-request.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Batch Change Inventory Request - -## Structure - -`Batch Change Inventory Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | [`Array`](../../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. | -| `ignore_unchanged_counts` | `TrueClass \| FalseClass` | 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/doc/models/batch-change-inventory-response.md b/doc/models/batch-change-inventory-response.md deleted file mode 100644 index f5e406e45..000000000 --- a/doc/models/batch-change-inventory-response.md +++ /dev/null @@ -1,72 +0,0 @@ - -# Batch Change Inventory Response - -## Structure - -`Batch Change Inventory Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `counts` | [`Array`](../../doc/models/inventory-count.md) | Optional | The current counts for all objects referenced in the request. | -| `changes` | [`Array`](../../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/doc/models/batch-delete-catalog-objects-request.md b/doc/models/batch-delete-catalog-objects-request.md deleted file mode 100644 index fbc2a3cdf..000000000 --- a/doc/models/batch-delete-catalog-objects-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Batch Delete Catalog Objects Request - -## Structure - -`Batch Delete Catalog Objects Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `object_ids` | `Array` | 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/doc/models/batch-delete-catalog-objects-response.md b/doc/models/batch-delete-catalog-objects-response.md deleted file mode 100644 index 982388bc0..000000000 --- a/doc/models/batch-delete-catalog-objects-response.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Batch Delete Catalog Objects Response - -## Structure - -`Batch Delete Catalog Objects Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `deleted_object_ids` | `Array` | Optional | The IDs of all CatalogObjects deleted by this request. | -| `deleted_at` | `String` | 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/doc/models/batch-retrieve-catalog-objects-request.md b/doc/models/batch-retrieve-catalog-objects-request.md deleted file mode 100644 index 4366309e5..000000000 --- a/doc/models/batch-retrieve-catalog-objects-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Batch Retrieve Catalog Objects Request - -## Structure - -`Batch Retrieve Catalog Objects Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `object_ids` | `Array` | Required | The IDs of the CatalogObjects to be retrieved. | -| `include_related_objects` | `TrueClass \| FalseClass` | 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` | -| `catalog_version` | `Integer` | 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. | -| `include_deleted_objects` | `TrueClass \| FalseClass` | Optional | Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`. | -| `include_category_path_to_root` | `TrueClass \| FalseClass` | 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/doc/models/batch-retrieve-catalog-objects-response.md b/doc/models/batch-retrieve-catalog-objects-response.md deleted file mode 100644 index 782172138..000000000 --- a/doc/models/batch-retrieve-catalog-objects-response.md +++ /dev/null @@ -1,276 +0,0 @@ - -# Batch Retrieve Catalog Objects Response - -## Structure - -`Batch Retrieve Catalog Objects Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `objects` | [`Array`](../../doc/models/catalog-object.md) | Optional | A list of [CatalogObject](entity:CatalogObject)s returned. | -| `related_objects` | [`Array`](../../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/doc/models/batch-retrieve-inventory-changes-request.md b/doc/models/batch-retrieve-inventory-changes-request.md deleted file mode 100644 index b94ba4ad6..000000000 --- a/doc/models/batch-retrieve-inventory-changes-request.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Batch Retrieve Inventory Changes Request - -## Structure - -`Batch Retrieve Inventory Changes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `catalog_object_ids` | `Array` | Optional | The filter to return results by `CatalogObject` ID.
The filter is only applicable when set. The default value is null. | -| `location_ids` | `Array` | Optional | The filter to return results by `Location` ID.
The filter is only applicable when set. The default value is null. | -| `types` | [`Array`](../../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` | [`Array`](../../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. | -| `updated_after` | `String` | 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`). | -| `updated_before` | `String` | 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` | 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` | `Integer` | 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/doc/models/batch-retrieve-inventory-changes-response.md b/doc/models/batch-retrieve-inventory-changes-response.md deleted file mode 100644 index 1b771f7fd..000000000 --- a/doc/models/batch-retrieve-inventory-changes-response.md +++ /dev/null @@ -1,73 +0,0 @@ - -# Batch Retrieve Inventory Changes Response - -## Structure - -`Batch Retrieve Inventory Changes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `changes` | [`Array`](../../doc/models/inventory-change.md) | Optional | The current calculated inventory changes for the requested objects
and locations. | -| `cursor` | `String` | 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/doc/models/batch-retrieve-inventory-counts-request.md b/doc/models/batch-retrieve-inventory-counts-request.md deleted file mode 100644 index ae59037d0..000000000 --- a/doc/models/batch-retrieve-inventory-counts-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Batch Retrieve Inventory Counts Request - -## Structure - -`Batch Retrieve Inventory Counts Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `catalog_object_ids` | `Array` | Optional | The filter to return results by `CatalogObject` ID.
The filter is applicable only when set. The default is null. | -| `location_ids` | `Array` | Optional | The filter to return results by `Location` ID.
This filter is applicable only when set. The default is null. | -| `updated_after` | `String` | 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` | 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` | [`Array`](../../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` | `Integer` | 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/doc/models/batch-retrieve-inventory-counts-response.md b/doc/models/batch-retrieve-inventory-counts-response.md deleted file mode 100644 index 30534740e..000000000 --- a/doc/models/batch-retrieve-inventory-counts-response.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Batch Retrieve Inventory Counts Response - -## Structure - -`Batch Retrieve Inventory Counts Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `counts` | [`Array`](../../doc/models/inventory-count.md) | Optional | The current calculated inventory counts for the requested objects
and locations. | -| `cursor` | `String` | 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/doc/models/batch-retrieve-orders-request.md b/doc/models/batch-retrieve-orders-request.md deleted file mode 100644 index 2d711a4da..000000000 --- a/doc/models/batch-retrieve-orders-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Batch Retrieve Orders Request - -Defines the fields that are included in requests to the -`BatchRetrieveOrders` endpoint. - -## Structure - -`Batch Retrieve Orders Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | 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. | -| `order_ids` | `Array` | 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/doc/models/batch-retrieve-orders-response.md b/doc/models/batch-retrieve-orders-response.md deleted file mode 100644 index 1745a3731..000000000 --- a/doc/models/batch-retrieve-orders-response.md +++ /dev/null @@ -1,121 +0,0 @@ - -# Batch Retrieve Orders Response - -Defines the fields that are included in the response body of -a request to the `BatchRetrieveOrders` endpoint. - -## Structure - -`Batch Retrieve Orders Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `orders` | [`Array`](../../doc/models/order.md) | Optional | The requested orders. This will omit any requested orders that do not exist. | -| `errors` | [`Array`](../../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/doc/models/batch-upsert-catalog-objects-request.md b/doc/models/batch-upsert-catalog-objects-request.md deleted file mode 100644 index 52b5c803f..000000000 --- a/doc/models/batch-upsert-catalog-objects-request.md +++ /dev/null @@ -1,261 +0,0 @@ - -# Batch Upsert Catalog Objects Request - -## Structure - -`Batch Upsert Catalog Objects Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | [`Array`](../../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/doc/models/batch-upsert-catalog-objects-response.md b/doc/models/batch-upsert-catalog-objects-response.md deleted file mode 100644 index d2d54cdf5..000000000 --- a/doc/models/batch-upsert-catalog-objects-response.md +++ /dev/null @@ -1,340 +0,0 @@ - -# Batch Upsert Catalog Objects Response - -## Structure - -`Batch Upsert Catalog Objects Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `objects` | [`Array`](../../doc/models/catalog-object.md) | Optional | The created successfully created CatalogObjects. | -| `updated_at` | `String` | 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". | -| `id_mappings` | [`Array`](../../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/doc/models/booking-booking-source.md b/doc/models/booking-booking-source.md deleted file mode 100644 index ad779401c..000000000 --- a/doc/models/booking-booking-source.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Booking Booking Source - -Supported sources a booking was created from. - -## Enumeration - -`Booking Booking Source` - -## 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/doc/models/booking-creator-details-creator-type.md b/doc/models/booking-creator-details-creator-type.md deleted file mode 100644 index c36af2b28..000000000 --- a/doc/models/booking-creator-details-creator-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Booking Creator Details Creator Type - -Supported types of a booking creator. - -## Enumeration - -`Booking Creator Details Creator Type` - -## Fields - -| Name | Description | -| --- | --- | -| `TEAM_MEMBER` | The creator is of the seller type. | -| `CUSTOMER` | The creator is of the buyer type. | - diff --git a/doc/models/booking-creator-details.md b/doc/models/booking-creator-details.md deleted file mode 100644 index 9d4f405ba..000000000 --- a/doc/models/booking-creator-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Booking Creator Details - -Information about a booking creator. - -## Structure - -`Booking Creator Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `creator_type` | [`String (Booking Creator Details Creator Type)`](../../doc/models/booking-creator-details-creator-type.md) | Optional | Supported types of a booking creator. | -| `team_member_id` | `String` | 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` | -| `customer_id` | `String` | 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/doc/models/booking-custom-attribute-delete-request.md b/doc/models/booking-custom-attribute-delete-request.md deleted file mode 100644 index f61aaf159..000000000 --- a/doc/models/booking-custom-attribute-delete-request.md +++ /dev/null @@ -1,26 +0,0 @@ - -# 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 - -`Booking Custom Attribute Delete Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `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/doc/models/booking-custom-attribute-delete-response.md b/doc/models/booking-custom-attribute-delete-response.md deleted file mode 100644 index 59984db65..000000000 --- a/doc/models/booking-custom-attribute-delete-response.md +++ /dev/null @@ -1,25 +0,0 @@ - -# 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 - -`Booking Custom Attribute Delete Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `String` | Optional | The ID of the [booking](entity:Booking) associated with the custom attribute. | -| `errors` | [`Array`](../../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/doc/models/booking-custom-attribute-upsert-request.md b/doc/models/booking-custom-attribute-upsert-request.md deleted file mode 100644 index a10d3e4c2..000000000 --- a/doc/models/booking-custom-attribute-upsert-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# 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 - -`Booking Custom Attribute Upsert Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `String` | Required | The ID of the target [booking](entity:Booking).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `idempotency_key` | `String` | 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/doc/models/booking-custom-attribute-upsert-response.md b/doc/models/booking-custom-attribute-upsert-response.md deleted file mode 100644 index 98d509896..000000000 --- a/doc/models/booking-custom-attribute-upsert-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# 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 - -`Booking Custom Attribute Upsert Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_id` | `String` | Optional | The ID of the [booking](entity:Booking) associated with the custom attribute. | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `errors` | [`Array`](../../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/doc/models/booking-status.md b/doc/models/booking-status.md deleted file mode 100644 index 56297d8b6..000000000 --- a/doc/models/booking-status.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Booking Status - -Supported booking statuses. - -## Enumeration - -`Booking Status` - -## 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/doc/models/booking.md b/doc/models/booking.md deleted file mode 100644 index c8b561157..000000000 --- a/doc/models/booking.md +++ /dev/null @@ -1,44 +0,0 @@ - -# 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` | Optional | A unique ID of this object representing a booking.
**Constraints**: *Maximum Length*: `36` | -| `version` | `Integer` | Optional | The revision number for the booking used for optimistic concurrency. | -| `status` | [`String (Booking Status)`](../../doc/models/booking-status.md) | Optional | Supported booking statuses. | -| `created_at` | `String` | Optional | The RFC 3339 timestamp specifying the creation time of this booking. | -| `updated_at` | `String` | Optional | The RFC 3339 timestamp specifying the most recent update time of this booking. | -| `start_at` | `String` | Optional | The RFC 3339 timestamp specifying the starting time of this booking. | -| `location_id` | `String` | 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` | -| `customer_id` | `String` | Optional | The ID of the [Customer](entity:Customer) object representing the customer receiving the booked service.
**Constraints**: *Maximum Length*: `192` | -| `customer_note` | `String` | 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` | -| `seller_note` | `String` | 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` | -| `appointment_segments` | [`Array`](../../doc/models/appointment-segment.md) | Optional | A list of appointment segments for this booking. | -| `transition_time_minutes` | `Integer` | Optional | Additional time at the end of a booking.
Applications should not make this field visible to customers of a seller. | -| `all_day` | `TrueClass \| FalseClass` | Optional | Whether the booking is of a full business day. | -| `location_type` | [`String (Business Appointment Settings Booking Location Type)`](../../doc/models/business-appointment-settings-booking-location-type.md) | Optional | Supported types of location where service is provided. | -| `creator_details` | [`Booking Creator Details Hash`](../../doc/models/booking-creator-details.md) | Optional | Information about a booking creator. | -| `source` | [`String (Booking Booking Source)`](../../doc/models/booking-booking-source.md) | Optional | Supported sources a booking was created from. | -| `address` | [`Address Hash`](../../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/doc/models/break-type.md b/doc/models/break-type.md deleted file mode 100644 index 01fdc1e34..000000000 --- a/doc/models/break-type.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Break Type - -A defined break template that sets an expectation for possible `Break` -instances on a `Shift`. - -## Structure - -`Break Type` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The UUID for this object.
**Constraints**: *Maximum Length*: `255` | -| `location_id` | `String` | Required | The ID of the business location this type of break applies to.
**Constraints**: *Minimum Length*: `1` | -| `break_name` | `String` | Required | A human-readable name for this type of break. The name is displayed to
employees in Square products.
**Constraints**: *Minimum Length*: `1` | -| `expected_duration` | `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` | -| `is_paid` | `TrueClass \| FalseClass` | Required | Whether this break counts towards time worked for compensation
purposes. | -| `version` | `Integer` | 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. | -| `created_at` | `String` | Optional | A read-only timestamp in RFC 3339 format. | -| `updated_at` | `String` | 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/doc/models/break.md b/doc/models/break.md deleted file mode 100644 index 5cad61716..000000000 --- a/doc/models/break.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Break - -A record of an employee's break during a shift. - -## Structure - -`Break` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The UUID for this object. | -| `start_at` | `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` | -| `end_at` | `String` | Optional | RFC 3339; follows the same timezone information as `Shift`. Precision up to
the minute is respected; seconds are truncated. | -| `break_type_id` | `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` | -| `expected_duration` | `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` | -| `is_paid` | `TrueClass \| FalseClass` | 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/doc/models/bulk-create-customer-data.md b/doc/models/bulk-create-customer-data.md deleted file mode 100644 index 94018394f..000000000 --- a/doc/models/bulk-create-customer-data.md +++ /dev/null @@ -1,38 +0,0 @@ - -# 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 - -`Bulk Create Customer Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `given_name` | `String` | Optional | The given name (that is, the first name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | -| `family_name` | `String` | Optional | The family name (that is, the last name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | -| `company_name` | `String` | Optional | A business name associated with the customer profile.
**Constraints**: *Maximum Length*: `500` | -| `nickname` | `String` | Optional | A nickname for the customer profile.
**Constraints**: *Maximum Length*: `100` | -| `email_address` | `String` | Optional | The email address associated with the customer profile.
**Constraints**: *Maximum Length*: `254` | -| `address` | [`Address Hash`](../../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). | -| `phone_number` | `String` | 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). | -| `reference_id` | `String` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.
**Constraints**: *Maximum Length*: `100` | -| `note` | `String` | Optional | A custom note associated with the customer profile. | -| `birthday` | `String` | 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. | -| `tax_ids` | [`Customer Tax Ids Hash`](../../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/doc/models/bulk-create-customers-request.md b/doc/models/bulk-create-customers-request.md deleted file mode 100644 index bcae74744..000000000 --- a/doc/models/bulk-create-customers-request.md +++ /dev/null @@ -1,61 +0,0 @@ - -# 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 - -`Bulk Create Customers Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customers` | [`Hash String Bulk Create Customer Data Hash`](../../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/doc/models/bulk-create-customers-response.md b/doc/models/bulk-create-customers-response.md deleted file mode 100644 index 8050d0089..000000000 --- a/doc/models/bulk-create-customers-response.md +++ /dev/null @@ -1,150 +0,0 @@ - -# Bulk Create Customers Response - -Defines the fields included in the response body from the -[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) endpoint. - -## Structure - -`Bulk Create Customers Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `responses` | [`Hash String Create Customer Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-create-team-members-request.md b/doc/models/bulk-create-team-members-request.md deleted file mode 100644 index 6e962818c..000000000 --- a/doc/models/bulk-create-team-members-request.md +++ /dev/null @@ -1,60 +0,0 @@ - -# Bulk Create Team Members Request - -Represents a bulk create request for `TeamMember` objects. - -## Structure - -`Bulk Create Team Members Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_members` | [`Hash String Create Team Member Request Hash`](../../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/doc/models/bulk-create-team-members-response.md b/doc/models/bulk-create-team-members-response.md deleted file mode 100644 index 382183c58..000000000 --- a/doc/models/bulk-create-team-members-response.md +++ /dev/null @@ -1,95 +0,0 @@ - -# Bulk Create Team Members Response - -Represents a response from a bulk create request containing the created `TeamMember` objects or error messages. - -## Structure - -`Bulk Create Team Members Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_members` | [`Hash String Create Team Member Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-create-vendors-request.md b/doc/models/bulk-create-vendors-request.md deleted file mode 100644 index cf22b60d3..000000000 --- a/doc/models/bulk-create-vendors-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Bulk Create Vendors Request - -Represents an input to a call to [BulkCreateVendors](../../doc/api/vendors.md#bulk-create-vendors). - -## Structure - -`Bulk Create Vendors Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `vendors` | [`Hash String Vendor Hash`](../../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/doc/models/bulk-create-vendors-response.md b/doc/models/bulk-create-vendors-response.md deleted file mode 100644 index 95bdc59f9..000000000 --- a/doc/models/bulk-create-vendors-response.md +++ /dev/null @@ -1,80 +0,0 @@ - -# Bulk Create Vendors Response - -Represents an output from a call to [BulkCreateVendors](../../doc/api/vendors.md#bulk-create-vendors). - -## Structure - -`Bulk Create Vendors Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `responses` | [`Hash String Create Vendor Response Hash`](../../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/doc/models/bulk-delete-booking-custom-attributes-request.md b/doc/models/bulk-delete-booking-custom-attributes-request.md deleted file mode 100644 index d435da147..000000000 --- a/doc/models/bulk-delete-booking-custom-attributes-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Bulk Delete Booking Custom Attributes Request - -Represents a [BulkDeleteBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) request. - -## Structure - -`Bulk Delete Booking Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Booking Custom Attribute Delete Request Hash`](../../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/doc/models/bulk-delete-booking-custom-attributes-response.md b/doc/models/bulk-delete-booking-custom-attributes-response.md deleted file mode 100644 index ff64d5ffa..000000000 --- a/doc/models/bulk-delete-booking-custom-attributes-response.md +++ /dev/null @@ -1,39 +0,0 @@ - -# 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 - -`Bulk Delete Booking Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Booking Custom Attribute Delete Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-delete-customers-request.md b/doc/models/bulk-delete-customers-request.md deleted file mode 100644 index 14fe122a5..000000000 --- a/doc/models/bulk-delete-customers-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# 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 - -`Bulk Delete Customers Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_ids` | `Array` | Required | The IDs of the [customer profiles](entity:Customer) to delete. | - -## Example (as JSON) - -```json -{ - "customer_ids": [ - "8DDA5NZVBZFGAX0V3HPF81HHE0", - "N18CPRVXR5214XPBBA6BZQWF3C", - "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" - ] -} -``` - diff --git a/doc/models/bulk-delete-customers-response.md b/doc/models/bulk-delete-customers-response.md deleted file mode 100644 index 4a80743dd..000000000 --- a/doc/models/bulk-delete-customers-response.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Bulk Delete Customers Response - -Defines the fields included in the response body from the -[BulkDeleteCustomers](../../doc/api/customers.md#bulk-delete-customers) endpoint. - -## Structure - -`Bulk Delete Customers Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `responses` | [`Hash String Delete Customer Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md b/doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md deleted file mode 100644 index 1f52b2959..000000000 --- a/doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# 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 - -`Bulk Delete Location Custom Attributes Request Location Custom Attribute Delete Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | 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/doc/models/bulk-delete-location-custom-attributes-request.md b/doc/models/bulk-delete-location-custom-attributes-request.md deleted file mode 100644 index 0139a3514..000000000 --- a/doc/models/bulk-delete-location-custom-attributes-request.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Bulk Delete Location Custom Attributes Request - -Represents a [BulkDeleteLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-delete-location-custom-attributes) request. - -## Structure - -`Bulk Delete Location Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Delete Location Custom Attributes Request Location Custom Attribute Delete Request Hash`](../../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/doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md b/doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md deleted file mode 100644 index 27d0b154e..000000000 --- a/doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md +++ /dev/null @@ -1,26 +0,0 @@ - -# 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 - -`Bulk Delete Location Custom Attributes Response Location Custom Attribute Delete Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Optional | The ID of the location associated with the custom attribute. | -| `errors` | [`Array`](../../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/doc/models/bulk-delete-location-custom-attributes-response.md b/doc/models/bulk-delete-location-custom-attributes-response.md deleted file mode 100644 index 068c9579c..000000000 --- a/doc/models/bulk-delete-location-custom-attributes-response.md +++ /dev/null @@ -1,46 +0,0 @@ - -# 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 - -`Bulk Delete Location Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Delete Location Custom Attributes Response Location Custom Attribute Delete Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md b/doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md deleted file mode 100644 index 60661448c..000000000 --- a/doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# 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 - -`Bulk Delete Merchant Custom Attributes Request Merchant Custom Attribute Delete Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | 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/doc/models/bulk-delete-merchant-custom-attributes-request.md b/doc/models/bulk-delete-merchant-custom-attributes-request.md deleted file mode 100644 index 3c66fef49..000000000 --- a/doc/models/bulk-delete-merchant-custom-attributes-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Bulk Delete Merchant Custom Attributes Request - -Represents a [BulkDeleteMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) request. - -## Structure - -`Bulk Delete Merchant Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Delete Merchant Custom Attributes Request Merchant Custom Attribute Delete Request Hash`](../../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/doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md b/doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md deleted file mode 100644 index 28bd9c485..000000000 --- a/doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md +++ /dev/null @@ -1,25 +0,0 @@ - -# 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 - -`Bulk Delete Merchant Custom Attributes Response Merchant Custom Attribute Delete Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/bulk-delete-merchant-custom-attributes-response.md b/doc/models/bulk-delete-merchant-custom-attributes-response.md deleted file mode 100644 index 8b7649c41..000000000 --- a/doc/models/bulk-delete-merchant-custom-attributes-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# 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 - -`Bulk Delete Merchant Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Delete Merchant Custom Attributes Response Merchant Custom Attribute Delete Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md b/doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md deleted file mode 100644 index f4e8aca08..000000000 --- a/doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Bulk Delete Order Custom Attributes Request Delete Custom Attribute - -Represents one delete within the bulk operation. - -## Structure - -`Bulk Delete Order Custom Attributes Request Delete Custom Attribute` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | 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}$` | -| `order_id` | `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/doc/models/bulk-delete-order-custom-attributes-request.md b/doc/models/bulk-delete-order-custom-attributes-request.md deleted file mode 100644 index 231f961cc..000000000 --- a/doc/models/bulk-delete-order-custom-attributes-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Bulk Delete Order Custom Attributes Request - -Represents a bulk delete request for one or more order custom attributes. - -## Structure - -`Bulk Delete Order Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Delete Order Custom Attributes Request Delete Custom Attribute Hash`](../../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/doc/models/bulk-delete-order-custom-attributes-response.md b/doc/models/bulk-delete-order-custom-attributes-response.md deleted file mode 100644 index 0f52dac6d..000000000 --- a/doc/models/bulk-delete-order-custom-attributes-response.md +++ /dev/null @@ -1,65 +0,0 @@ - -# Bulk Delete Order Custom Attributes Response - -Represents a response from deleting one or more order custom attributes. - -## Structure - -`Bulk Delete Order Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `values` | [`Hash String Delete Order Custom Attribute Response Hash`](../../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/doc/models/bulk-retrieve-bookings-request.md b/doc/models/bulk-retrieve-bookings-request.md deleted file mode 100644 index 8e178d781..000000000 --- a/doc/models/bulk-retrieve-bookings-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Bulk Retrieve Bookings Request - -Request payload for bulk retrieval of bookings. - -## Structure - -`Bulk Retrieve Bookings Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking_ids` | `Array` | 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/doc/models/bulk-retrieve-bookings-response.md b/doc/models/bulk-retrieve-bookings-response.md deleted file mode 100644 index bbd65ff42..000000000 --- a/doc/models/bulk-retrieve-bookings-response.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Bulk Retrieve Bookings Response - -Response payload for bulk retrieval of bookings. - -## Structure - -`Bulk Retrieve Bookings Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookings` | [`Hash String Retrieve Booking Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-retrieve-customers-request.md b/doc/models/bulk-retrieve-customers-request.md deleted file mode 100644 index 47af41fd8..000000000 --- a/doc/models/bulk-retrieve-customers-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# 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 - -`Bulk Retrieve Customers Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_ids` | `Array` | Required | The IDs of the [customer profiles](entity:Customer) to retrieve. | - -## Example (as JSON) - -```json -{ - "customer_ids": [ - "8DDA5NZVBZFGAX0V3HPF81HHE0", - "N18CPRVXR5214XPBBA6BZQWF3C", - "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" - ] -} -``` - diff --git a/doc/models/bulk-retrieve-customers-response.md b/doc/models/bulk-retrieve-customers-response.md deleted file mode 100644 index 7fd72038f..000000000 --- a/doc/models/bulk-retrieve-customers-response.md +++ /dev/null @@ -1,142 +0,0 @@ - -# Bulk Retrieve Customers Response - -Defines the fields included in the response body from the -[BulkRetrieveCustomers](../../doc/api/customers.md#bulk-retrieve-customers) endpoint. - -## Structure - -`Bulk Retrieve Customers Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `responses` | [`Hash String Retrieve Customer Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-retrieve-team-member-booking-profiles-request.md b/doc/models/bulk-retrieve-team-member-booking-profiles-request.md deleted file mode 100644 index a3bc51ae4..000000000 --- a/doc/models/bulk-retrieve-team-member-booking-profiles-request.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Bulk Retrieve Team Member Booking Profiles Request - -Request payload for the [BulkRetrieveTeamMemberBookingProfiles](../../doc/api/bookings.md#bulk-retrieve-team-member-booking-profiles) endpoint. - -## Structure - -`Bulk Retrieve Team Member Booking Profiles Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_ids` | `Array` | 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/doc/models/bulk-retrieve-team-member-booking-profiles-response.md b/doc/models/bulk-retrieve-team-member-booking-profiles-response.md deleted file mode 100644 index 65142c627..000000000 --- a/doc/models/bulk-retrieve-team-member-booking-profiles-response.md +++ /dev/null @@ -1,59 +0,0 @@ - -# Bulk Retrieve Team Member Booking Profiles Response - -Response payload for the [BulkRetrieveTeamMemberBookingProfiles](../../doc/api/bookings.md#bulk-retrieve-team-member-booking-profiles) endpoint. - -## Structure - -`Bulk Retrieve Team Member Booking Profiles Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_booking_profiles` | [`Hash String Retrieve Team Member Booking Profile Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-retrieve-vendors-request.md b/doc/models/bulk-retrieve-vendors-request.md deleted file mode 100644 index 24b0f6e98..000000000 --- a/doc/models/bulk-retrieve-vendors-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Bulk Retrieve Vendors Request - -Represents an input to a call to [BulkRetrieveVendors](../../doc/api/vendors.md#bulk-retrieve-vendors). - -## Structure - -`Bulk Retrieve Vendors Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `vendor_ids` | `Array` | Optional | IDs of the [Vendor](entity:Vendor) objects to retrieve. | - -## Example (as JSON) - -```json -{ - "vendor_ids": [ - "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4" - ] -} -``` - diff --git a/doc/models/bulk-retrieve-vendors-response.md b/doc/models/bulk-retrieve-vendors-response.md deleted file mode 100644 index 999e72e3a..000000000 --- a/doc/models/bulk-retrieve-vendors-response.md +++ /dev/null @@ -1,109 +0,0 @@ - -# Bulk Retrieve Vendors Response - -Represents an output from a call to [BulkRetrieveVendors](../../doc/api/vendors.md#bulk-retrieve-vendors). - -## Structure - -`Bulk Retrieve Vendors Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `responses` | [`Hash String Retrieve Vendor Response Hash`](../../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/doc/models/bulk-swap-plan-request.md b/doc/models/bulk-swap-plan-request.md deleted file mode 100644 index fe781425e..000000000 --- a/doc/models/bulk-swap-plan-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Bulk Swap Plan Request - -Defines input parameters in a call to the -[BulkSwapPlan](../../doc/api/subscriptions.md#bulk-swap-plan) endpoint. - -## Structure - -`Bulk Swap Plan Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `new_plan_variation_id` | `String` | Required | The ID of the new subscription plan variation.

This field is required.
**Constraints**: *Minimum Length*: `1` | -| `old_plan_variation_id` | `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` | -| `location_id` | `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/doc/models/bulk-swap-plan-response.md b/doc/models/bulk-swap-plan-response.md deleted file mode 100644 index b920a8e98..000000000 --- a/doc/models/bulk-swap-plan-response.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Bulk Swap Plan Response - -Defines output parameters in a response of the -[BulkSwapPlan](../../doc/api/subscriptions.md#bulk-swap-plan) endpoint. - -## Structure - -`Bulk Swap Plan Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered during the request. | -| `affected_subscriptions` | `Integer` | 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/doc/models/bulk-update-customer-data.md b/doc/models/bulk-update-customer-data.md deleted file mode 100644 index a578d2257..000000000 --- a/doc/models/bulk-update-customer-data.md +++ /dev/null @@ -1,39 +0,0 @@ - -# 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 - -`Bulk Update Customer Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `given_name` | `String` | Optional | The given name (that is, the first name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | -| `family_name` | `String` | Optional | The family name (that is, the last name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | -| `company_name` | `String` | Optional | A business name associated with the customer profile.
**Constraints**: *Maximum Length*: `500` | -| `nickname` | `String` | Optional | A nickname for the customer profile.
**Constraints**: *Maximum Length*: `100` | -| `email_address` | `String` | Optional | The email address associated with the customer profile.
**Constraints**: *Maximum Length*: `254` | -| `address` | [`Address Hash`](../../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). | -| `phone_number` | `String` | 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). | -| `reference_id` | `String` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.
**Constraints**: *Maximum Length*: `100` | -| `note` | `String` | Optional | An custom note associates with the customer profile. | -| `birthday` | `String` | 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. | -| `tax_ids` | [`Customer Tax Ids Hash`](../../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` | `Integer` | 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/doc/models/bulk-update-customers-request.md b/doc/models/bulk-update-customers-request.md deleted file mode 100644 index 69e9d18f6..000000000 --- a/doc/models/bulk-update-customers-request.md +++ /dev/null @@ -1,43 +0,0 @@ - -# 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 - -`Bulk Update Customers Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customers` | [`Hash String Bulk Update Customer Data Hash`](../../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/doc/models/bulk-update-customers-response.md b/doc/models/bulk-update-customers-response.md deleted file mode 100644 index 4d6a43fde..000000000 --- a/doc/models/bulk-update-customers-response.md +++ /dev/null @@ -1,135 +0,0 @@ - -# Bulk Update Customers Response - -Defines the fields included in the response body from the -[BulkUpdateCustomers](../../doc/api/customers.md#bulk-update-customers) endpoint. - -## Structure - -`Bulk Update Customers Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `responses` | [`Hash String Update Customer Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-update-team-members-request.md b/doc/models/bulk-update-team-members-request.md deleted file mode 100644 index 0329f5ec9..000000000 --- a/doc/models/bulk-update-team-members-request.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Bulk Update Team Members Request - -Represents a bulk update request for `TeamMember` objects. - -## Structure - -`Bulk Update Team Members Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_members` | [`Hash String Update Team Member Request Hash`](../../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/doc/models/bulk-update-team-members-response.md b/doc/models/bulk-update-team-members-response.md deleted file mode 100644 index 6f6420ff0..000000000 --- a/doc/models/bulk-update-team-members-response.md +++ /dev/null @@ -1,99 +0,0 @@ - -# Bulk Update Team Members Response - -Represents a response from a bulk update request containing the updated `TeamMember` objects or error messages. - -## Structure - -`Bulk Update Team Members Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_members` | [`Hash String Update Team Member Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-update-vendors-request.md b/doc/models/bulk-update-vendors-request.md deleted file mode 100644 index 22f2146b6..000000000 --- a/doc/models/bulk-update-vendors-request.md +++ /dev/null @@ -1,72 +0,0 @@ - -# Bulk Update Vendors Request - -Represents an input to a call to [BulkUpdateVendors](../../doc/api/vendors.md#bulk-update-vendors). - -## Structure - -`Bulk Update Vendors Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `vendors` | [`Hash String Update Vendor Request Hash`](../../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/doc/models/bulk-update-vendors-response.md b/doc/models/bulk-update-vendors-response.md deleted file mode 100644 index 6011cc6b2..000000000 --- a/doc/models/bulk-update-vendors-response.md +++ /dev/null @@ -1,139 +0,0 @@ - -# Bulk Update Vendors Response - -Represents an output from a call to [BulkUpdateVendors](../../doc/api/vendors.md#bulk-update-vendors). - -## Structure - -`Bulk Update Vendors Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | -| `responses` | [`Hash String Update Vendor Response Hash`](../../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/doc/models/bulk-upsert-booking-custom-attributes-request.md b/doc/models/bulk-upsert-booking-custom-attributes-request.md deleted file mode 100644 index ef0c91ddf..000000000 --- a/doc/models/bulk-upsert-booking-custom-attributes-request.md +++ /dev/null @@ -1,70 +0,0 @@ - -# Bulk Upsert Booking Custom Attributes Request - -Represents a [BulkUpsertBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) request. - -## Structure - -`Bulk Upsert Booking Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Booking Custom Attribute Upsert Request Hash`](../../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/doc/models/bulk-upsert-booking-custom-attributes-response.md b/doc/models/bulk-upsert-booking-custom-attributes-response.md deleted file mode 100644 index fe21fa637..000000000 --- a/doc/models/bulk-upsert-booking-custom-attributes-response.md +++ /dev/null @@ -1,142 +0,0 @@ - -# 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 - -`Bulk Upsert Booking Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Booking Custom Attribute Upsert Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md b/doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md deleted file mode 100644 index d648d66dc..000000000 --- a/doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# 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 - -`Bulk Upsert Customer Custom Attributes Request Customer Custom Attribute Upsert Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Required | The ID of the target [customer profile](entity:Customer).
**Constraints**: *Minimum Length*: `1` | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `idempotency_key` | `String` | 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/doc/models/bulk-upsert-customer-custom-attributes-request.md b/doc/models/bulk-upsert-customer-custom-attributes-request.md deleted file mode 100644 index e5aa2eacb..000000000 --- a/doc/models/bulk-upsert-customer-custom-attributes-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Bulk Upsert Customer Custom Attributes Request - -Represents a [BulkUpsertCustomerCustomAttributes](../../doc/api/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) request. - -## Structure - -`Bulk Upsert Customer Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Upsert Customer Custom Attributes Request Customer Custom Attribute Upsert Request Hash`](../../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/doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md b/doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md deleted file mode 100644 index 3897a492f..000000000 --- a/doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# 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 - -`Bulk Upsert Customer Custom Attributes Response Customer Custom Attribute Upsert Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Optional | The ID of the customer profile associated with the custom attribute. | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `errors` | [`Array`](../../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/doc/models/bulk-upsert-customer-custom-attributes-response.md b/doc/models/bulk-upsert-customer-custom-attributes-response.md deleted file mode 100644 index 03afae0ec..000000000 --- a/doc/models/bulk-upsert-customer-custom-attributes-response.md +++ /dev/null @@ -1,154 +0,0 @@ - -# 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 - -`Bulk Upsert Customer Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Upsert Customer Custom Attributes Response Customer Custom Attribute Upsert Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md b/doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md deleted file mode 100644 index 1dc45b539..000000000 --- a/doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# 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 - -`Bulk Upsert Location Custom Attributes Request Location Custom Attribute Upsert Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Required | The ID of the target [location](entity:Location).
**Constraints**: *Minimum Length*: `1` | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `idempotency_key` | `String` | 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/doc/models/bulk-upsert-location-custom-attributes-request.md b/doc/models/bulk-upsert-location-custom-attributes-request.md deleted file mode 100644 index 042aeb3c9..000000000 --- a/doc/models/bulk-upsert-location-custom-attributes-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Bulk Upsert Location Custom Attributes Request - -Represents a [BulkUpsertLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-upsert-location-custom-attributes) request. - -## Structure - -`Bulk Upsert Location Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Upsert Location Custom Attributes Request Location Custom Attribute Upsert Request Hash`](../../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/doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md b/doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md deleted file mode 100644 index 7dddcae88..000000000 --- a/doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md +++ /dev/null @@ -1,58 +0,0 @@ - -# 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 - -`Bulk Upsert Location Custom Attributes Response Location Custom Attribute Upsert Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Optional | The ID of the location associated with the custom attribute. | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `errors` | [`Array`](../../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/doc/models/bulk-upsert-location-custom-attributes-response.md b/doc/models/bulk-upsert-location-custom-attributes-response.md deleted file mode 100644 index e2a8e1aac..000000000 --- a/doc/models/bulk-upsert-location-custom-attributes-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# 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 - -`Bulk Upsert Location Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Upsert Location Custom Attributes Response Location Custom Attribute Upsert Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md b/doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md deleted file mode 100644 index 22298fdf7..000000000 --- a/doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# 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 - -`Bulk Upsert Merchant Custom Attributes Request Merchant Custom Attribute Upsert Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchant_id` | `String` | Required | The ID of the target [merchant](entity:Merchant).
**Constraints**: *Minimum Length*: `1` | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `idempotency_key` | `String` | 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/doc/models/bulk-upsert-merchant-custom-attributes-request.md b/doc/models/bulk-upsert-merchant-custom-attributes-request.md deleted file mode 100644 index 19ac4c925..000000000 --- a/doc/models/bulk-upsert-merchant-custom-attributes-request.md +++ /dev/null @@ -1,93 +0,0 @@ - -# Bulk Upsert Merchant Custom Attributes Request - -Represents a [BulkUpsertMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) request. - -## Structure - -`Bulk Upsert Merchant Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Upsert Merchant Custom Attributes Request Merchant Custom Attribute Upsert Request Hash`](../../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/doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md b/doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md deleted file mode 100644 index 8be011205..000000000 --- a/doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# 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 - -`Bulk Upsert Merchant Custom Attributes Response Merchant Custom Attribute Upsert Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchant_id` | `String` | Optional | The ID of the merchant associated with the custom attribute. | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `errors` | [`Array`](../../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/doc/models/bulk-upsert-merchant-custom-attributes-response.md b/doc/models/bulk-upsert-merchant-custom-attributes-response.md deleted file mode 100644 index 3b6afef4d..000000000 --- a/doc/models/bulk-upsert-merchant-custom-attributes-response.md +++ /dev/null @@ -1,106 +0,0 @@ - -# 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 - -`Bulk Upsert Merchant Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Upsert Merchant Custom Attributes Response Merchant Custom Attribute Upsert Response Hash`](../../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` | [`Array`](../../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/doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md b/doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md deleted file mode 100644 index 3224e8eed..000000000 --- a/doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Bulk Upsert Order Custom Attributes Request Upsert Custom Attribute - -Represents one upsert within the bulk operation. - -## Structure - -`Bulk Upsert Order Custom Attributes Request Upsert Custom Attribute` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `idempotency_key` | `String` | 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` | -| `order_id` | `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/doc/models/bulk-upsert-order-custom-attributes-request.md b/doc/models/bulk-upsert-order-custom-attributes-request.md deleted file mode 100644 index f6bbeb0d7..000000000 --- a/doc/models/bulk-upsert-order-custom-attributes-request.md +++ /dev/null @@ -1,93 +0,0 @@ - -# Bulk Upsert Order Custom Attributes Request - -Represents a bulk upsert request for one or more order custom attributes. - -## Structure - -`Bulk Upsert Order Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Hash String Bulk Upsert Order Custom Attributes Request Upsert Custom Attribute Hash`](../../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/doc/models/bulk-upsert-order-custom-attributes-response.md b/doc/models/bulk-upsert-order-custom-attributes-response.md deleted file mode 100644 index 2f5f3d577..000000000 --- a/doc/models/bulk-upsert-order-custom-attributes-response.md +++ /dev/null @@ -1,74 +0,0 @@ - -# Bulk Upsert Order Custom Attributes Response - -Represents a response from a bulk upsert of order custom attributes. - -## Structure - -`Bulk Upsert Order Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `values` | [`Hash String Upsert Order Custom Attribute Response Hash`](../../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/doc/models/business-appointment-settings-alignment-time.md b/doc/models/business-appointment-settings-alignment-time.md deleted file mode 100644 index 9ee24637a..000000000 --- a/doc/models/business-appointment-settings-alignment-time.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Business Appointment Settings Alignment Time - -Time units of a service duration for bookings. - -## Enumeration - -`Business Appointment Settings Alignment Time` - -## 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/doc/models/business-appointment-settings-booking-location-type.md b/doc/models/business-appointment-settings-booking-location-type.md deleted file mode 100644 index de3363340..000000000 --- a/doc/models/business-appointment-settings-booking-location-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Business Appointment Settings Booking Location Type - -Supported types of location where service is provided. - -## Enumeration - -`Business Appointment Settings Booking Location Type` - -## 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/doc/models/business-appointment-settings-cancellation-policy.md b/doc/models/business-appointment-settings-cancellation-policy.md deleted file mode 100644 index bf7e6c56a..000000000 --- a/doc/models/business-appointment-settings-cancellation-policy.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Business Appointment Settings Cancellation Policy - -The category of the seller’s cancellation policy. - -## Enumeration - -`Business Appointment Settings Cancellation Policy` - -## 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/doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md b/doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md deleted file mode 100644 index 00a76bc2a..000000000 --- a/doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Business Appointment Settings Max Appointments Per Day Limit Type - -Types of daily appointment limits. - -## Enumeration - -`Business Appointment Settings Max Appointments Per Day Limit Type` - -## 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/doc/models/business-appointment-settings.md b/doc/models/business-appointment-settings.md deleted file mode 100644 index 1bea8ab64..000000000 --- a/doc/models/business-appointment-settings.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Business Appointment Settings - -The service appointment settings, including where and how the service is provided. - -## Structure - -`Business Appointment Settings` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_types` | [`Array`](../../doc/models/business-appointment-settings-booking-location-type.md) | Optional | Types of the location allowed for bookings.
See [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) for possible values | -| `alignment_time` | [`String (Business Appointment Settings Alignment Time)`](../../doc/models/business-appointment-settings-alignment-time.md) | Optional | Time units of a service duration for bookings. | -| `min_booking_lead_time_seconds` | `Integer` | 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. | -| `max_booking_lead_time_seconds` | `Integer` | 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. | -| `any_team_member_booking_enabled` | `TrueClass \| FalseClass` | Optional | Indicates whether a customer can choose from all available time slots and have a staff member assigned
automatically (`true`) or not (`false`). | -| `multiple_service_booking_enabled` | `TrueClass \| FalseClass` | Optional | Indicates whether a customer can book multiple services in a single online booking. | -| `max_appointments_per_day_limit_type` | [`String (Business Appointment Settings Max Appointments Per Day Limit Type)`](../../doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md) | Optional | Types of daily appointment limits. | -| `max_appointments_per_day_limit` | `Integer` | Optional | The maximum number of daily appointments per team member or per location. | -| `cancellation_window_seconds` | `Integer` | Optional | The cut-off time in seconds for allowing clients to cancel or reschedule an appointment. | -| `cancellation_fee_money` | [`Money Hash`](../../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. | -| `cancellation_policy` | [`String (Business Appointment Settings Cancellation Policy)`](../../doc/models/business-appointment-settings-cancellation-policy.md) | Optional | The category of the seller’s cancellation policy. | -| `cancellation_policy_text` | `String` | Optional | The free-form text of the seller's cancellation policy.
**Constraints**: *Maximum Length*: `65536` | -| `skip_booking_flow_staff_selection` | `TrueClass \| FalseClass` | 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/doc/models/business-booking-profile-booking-policy.md b/doc/models/business-booking-profile-booking-policy.md deleted file mode 100644 index 54cec5ce6..000000000 --- a/doc/models/business-booking-profile-booking-policy.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Business Booking Profile Booking Policy - -Policies for accepting bookings. - -## Enumeration - -`Business Booking Profile Booking Policy` - -## 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/doc/models/business-booking-profile-customer-timezone-choice.md b/doc/models/business-booking-profile-customer-timezone-choice.md deleted file mode 100644 index fa5550ce3..000000000 --- a/doc/models/business-booking-profile-customer-timezone-choice.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Business Booking Profile Customer Timezone Choice - -Choices of customer-facing time zone used for bookings. - -## Enumeration - -`Business Booking Profile Customer Timezone Choice` - -## 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/doc/models/business-booking-profile.md b/doc/models/business-booking-profile.md deleted file mode 100644 index c2a3971d6..000000000 --- a/doc/models/business-booking-profile.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Business Booking Profile - -A seller's business booking profile, including booking policy, appointment settings, etc. - -## Structure - -`Business Booking Profile` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `seller_id` | `String` | Optional | The ID of the seller, obtainable using the Merchants API.
**Constraints**: *Maximum Length*: `32` | -| `created_at` | `String` | Optional | The RFC 3339 timestamp specifying the booking's creation time. | -| `booking_enabled` | `TrueClass \| FalseClass` | Optional | Indicates whether the seller is open for booking. | -| `customer_timezone_choice` | [`String (Business Booking Profile Customer Timezone Choice)`](../../doc/models/business-booking-profile-customer-timezone-choice.md) | Optional | Choices of customer-facing time zone used for bookings. | -| `booking_policy` | [`String (Business Booking Profile Booking Policy)`](../../doc/models/business-booking-profile-booking-policy.md) | Optional | Policies for accepting bookings. | -| `allow_user_cancel` | `TrueClass \| FalseClass` | Optional | Indicates whether customers can cancel or reschedule their own bookings (`true`) or not (`false`). | -| `business_appointment_settings` | [`Business Appointment Settings Hash`](../../doc/models/business-appointment-settings.md) | Optional | The service appointment settings, including where and how the service is provided. | -| `support_seller_level_writes` | `TrueClass \| FalseClass` | 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/doc/models/business-hours-period.md b/doc/models/business-hours-period.md deleted file mode 100644 index 0cd8380a5..000000000 --- a/doc/models/business-hours-period.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Business Hours Period - -Represents a period of time during which a business location is open. - -## Structure - -`Business Hours Period` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `day_of_week` | [`String (Day of Week)`](../../doc/models/day-of-week.md) | Optional | Indicates the specific day of the week. | -| `start_local_time` | `String` | 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. | -| `end_local_time` | `String` | 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/doc/models/business-hours.md b/doc/models/business-hours.md deleted file mode 100644 index 71535aaa4..000000000 --- a/doc/models/business-hours.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Business Hours - -The hours of operation for a location. - -## Structure - -`Business Hours` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `periods` | [`Array`](../../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/doc/models/buy-now-pay-later-details.md b/doc/models/buy-now-pay-later-details.md deleted file mode 100644 index 6b8442ccb..000000000 --- a/doc/models/buy-now-pay-later-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Buy Now Pay Later Details - -Additional details about a Buy Now Pay Later payment type. - -## Structure - -`Buy Now Pay Later Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `brand` | `String` | Optional | The brand used for the Buy Now Pay Later payment.
The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | -| `afterpay_details` | [`Afterpay Details Hash`](../../doc/models/afterpay-details.md) | Optional | Additional details about Afterpay payments. | -| `clearpay_details` | [`Clearpay Details Hash`](../../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/doc/models/calculate-loyalty-points-request.md b/doc/models/calculate-loyalty-points-request.md deleted file mode 100644 index c68ae5a14..000000000 --- a/doc/models/calculate-loyalty-points-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Calculate Loyalty Points Request - -Represents a [CalculateLoyaltyPoints](../../doc/api/loyalty.md#calculate-loyalty-points) request. - -## Structure - -`Calculate Loyalty Points Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | 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`. | -| `transaction_amount_money` | [`Money Hash`](../../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. | -| `loyalty_account_id` | `String` | 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/doc/models/calculate-loyalty-points-response.md b/doc/models/calculate-loyalty-points-response.md deleted file mode 100644 index 3c7231271..000000000 --- a/doc/models/calculate-loyalty-points-response.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Calculate Loyalty Points Response - -Represents a [CalculateLoyaltyPoints](../../doc/api/loyalty.md#calculate-loyalty-points) response. - -## Structure - -`Calculate Loyalty Points Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `points` | `Integer` | Optional | The number of points that the buyer can earn from the base loyalty program. | -| `promotion_points` | `Integer` | 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/doc/models/calculate-order-request.md b/doc/models/calculate-order-request.md deleted file mode 100644 index dae5250ac..000000000 --- a/doc/models/calculate-order-request.md +++ /dev/null @@ -1,98 +0,0 @@ - -# Calculate Order Request - -## Structure - -`Calculate Order Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order` | [`Order Hash`](../../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. | -| `proposed_rewards` | [`Array`](../../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/doc/models/calculate-order-response.md b/doc/models/calculate-order-response.md deleted file mode 100644 index 9bff2cfad..000000000 --- a/doc/models/calculate-order-response.md +++ /dev/null @@ -1,231 +0,0 @@ - -# Calculate Order Response - -## Structure - -`Calculate Order Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order` | [`Order Hash`](../../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` | [`Array`](../../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/doc/models/cancel-booking-request.md b/doc/models/cancel-booking-request.md deleted file mode 100644 index ff94131dc..000000000 --- a/doc/models/cancel-booking-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Cancel Booking Request - -## Structure - -`Cancel Booking Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | Optional | A unique key to make this request an idempotent operation.
**Constraints**: *Maximum Length*: `255` | -| `booking_version` | `Integer` | 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/doc/models/cancel-booking-response.md b/doc/models/cancel-booking-response.md deleted file mode 100644 index e52cd9f5a..000000000 --- a/doc/models/cancel-booking-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Cancel Booking Response - -## Structure - -`Cancel Booking Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking` | [`Booking Hash`](../../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` | [`Array`](../../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/doc/models/cancel-invoice-request.md b/doc/models/cancel-invoice-request.md deleted file mode 100644 index b324380fe..000000000 --- a/doc/models/cancel-invoice-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Cancel Invoice Request - -Describes a `CancelInvoice` request. - -## Structure - -`Cancel Invoice Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `Integer` | 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/doc/models/cancel-invoice-response.md b/doc/models/cancel-invoice-response.md deleted file mode 100644 index 20478fc73..000000000 --- a/doc/models/cancel-invoice-response.md +++ /dev/null @@ -1,112 +0,0 @@ - -# Cancel Invoice Response - -The response returned by the `CancelInvoice` request. - -## Structure - -`Cancel Invoice Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice` | [`Invoice Hash`](../../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` | [`Array`](../../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/doc/models/cancel-loyalty-promotion-response.md b/doc/models/cancel-loyalty-promotion-response.md deleted file mode 100644 index 9556ddd4c..000000000 --- a/doc/models/cancel-loyalty-promotion-response.md +++ /dev/null @@ -1,81 +0,0 @@ - -# 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 - -`Cancel Loyalty Promotion Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `loyalty_promotion` | [`Loyalty Promotion Hash`](../../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/doc/models/cancel-payment-by-idempotency-key-request.md b/doc/models/cancel-payment-by-idempotency-key-request.md deleted file mode 100644 index 6644b050b..000000000 --- a/doc/models/cancel-payment-by-idempotency-key-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# 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 - -`Cancel Payment by Idempotency Key Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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/doc/models/cancel-payment-by-idempotency-key-response.md b/doc/models/cancel-payment-by-idempotency-key-response.md deleted file mode 100644 index 08c06694f..000000000 --- a/doc/models/cancel-payment-by-idempotency-key-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# 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 - -`Cancel Payment by Idempotency Key Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/cancel-payment-response.md b/doc/models/cancel-payment-response.md deleted file mode 100644 index 414841d1d..000000000 --- a/doc/models/cancel-payment-response.md +++ /dev/null @@ -1,98 +0,0 @@ - -# Cancel Payment Response - -Defines the response returned by [CancelPayment](../../doc/api/payments.md#cancel-payment). - -## Structure - -`Cancel Payment Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `payment` | [`Payment Hash`](../../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/doc/models/cancel-subscription-response.md b/doc/models/cancel-subscription-response.md deleted file mode 100644 index 48ffe9baa..000000000 --- a/doc/models/cancel-subscription-response.md +++ /dev/null @@ -1,146 +0,0 @@ - -# Cancel Subscription Response - -Defines output parameters in a response from the -[CancelSubscription](../../doc/api/subscriptions.md#cancel-subscription) endpoint. - -## Structure - -`Cancel Subscription Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered during the request. | -| `subscription` | [`Subscription Hash`](../../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` | [`Array`](../../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/doc/models/cancel-terminal-action-response.md b/doc/models/cancel-terminal-action-response.md deleted file mode 100644 index 30e17a65c..000000000 --- a/doc/models/cancel-terminal-action-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Cancel Terminal Action Response - -## Structure - -`Cancel Terminal Action Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `action` | [`Terminal Action Hash`](../../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/doc/models/cancel-terminal-checkout-response.md b/doc/models/cancel-terminal-checkout-response.md deleted file mode 100644 index f6fcd2eed..000000000 --- a/doc/models/cancel-terminal-checkout-response.md +++ /dev/null @@ -1,79 +0,0 @@ - -# Cancel Terminal Checkout Response - -## Structure - -`Cancel Terminal Checkout Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `checkout` | [`Terminal Checkout Hash`](../../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/doc/models/cancel-terminal-refund-response.md b/doc/models/cancel-terminal-refund-response.md deleted file mode 100644 index c3d0667e4..000000000 --- a/doc/models/cancel-terminal-refund-response.md +++ /dev/null @@ -1,69 +0,0 @@ - -# Cancel Terminal Refund Response - -## Structure - -`Cancel Terminal Refund Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `refund` | [`Terminal Refund Hash`](../../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/doc/models/capture-transaction-response.md b/doc/models/capture-transaction-response.md deleted file mode 100644 index a8b846826..000000000 --- a/doc/models/capture-transaction-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 - -`Capture Transaction Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/card-brand.md b/doc/models/card-brand.md deleted file mode 100644 index cf4c0851e..000000000 --- a/doc/models/card-brand.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Card Brand - -Indicates a card's brand, such as `VISA` or `MASTERCARD`. - -## Enumeration - -`Card Brand` - -## 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/doc/models/card-co-brand.md b/doc/models/card-co-brand.md deleted file mode 100644 index 7ba9ce2f9..000000000 --- a/doc/models/card-co-brand.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Card Co Brand - -Indicates the brand for a co-branded card. - -## Enumeration - -`Card Co Brand` - -## Fields - -| Name | -| --- | -| `UNKNOWN` | -| `AFTERPAY` | -| `CLEARPAY` | - diff --git a/doc/models/card-payment-details.md b/doc/models/card-payment-details.md deleted file mode 100644 index 511d86874..000000000 --- a/doc/models/card-payment-details.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Card Payment Details - -Reflects the current status of a card payment. Contains only non-confidential information. - -## Structure - -`Card Payment Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `status` | `String` | Optional | The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or
FAILED.
**Constraints**: *Maximum Length*: `50` | -| `card` | [`Card Hash`](../../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. | -| `entry_method` | `String` | 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` | -| `cvv_status` | `String` | 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` | -| `avs_status` | `String` | 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` | -| `auth_result_code` | `String` | Optional | The status code returned by the card issuer that describes the payment's
authorization status.
**Constraints**: *Maximum Length*: `10` | -| `application_identifier` | `String` | Optional | For EMV payments, the application ID identifies the EMV application used for the payment.
**Constraints**: *Maximum Length*: `32` | -| `application_name` | `String` | Optional | For EMV payments, the human-readable name of the EMV application used for the payment.
**Constraints**: *Maximum Length*: `16` | -| `application_cryptogram` | `String` | Optional | For EMV payments, the cryptogram generated for the payment.
**Constraints**: *Maximum Length*: `16` | -| `verification_method` | `String` | 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` | -| `verification_results` | `String` | Optional | For EMV payments, the results of the cardholder verification. The result can be
`SUCCESS`, `FAILURE`, or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | -| `statement_description` | `String` | 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` | -| `device_details` | [`Device Details Hash`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. | -| `card_payment_timeline` | [`Card Payment Timeline Hash`](../../doc/models/card-payment-timeline.md) | Optional | The timeline for card payments. | -| `refund_requires_card_presence` | `TrueClass \| FalseClass` | Optional | Whether the card must be physically present for the payment to
be refunded. If set to `true`, the card must be present. | -| `errors` | [`Array`](../../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/doc/models/card-payment-timeline.md b/doc/models/card-payment-timeline.md deleted file mode 100644 index 9aa01bb46..000000000 --- a/doc/models/card-payment-timeline.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Card Payment Timeline - -The timeline for card payments. - -## Structure - -`Card Payment Timeline` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `authorized_at` | `String` | Optional | The timestamp when the payment was authorized, in RFC 3339 format. | -| `captured_at` | `String` | Optional | The timestamp when the payment was captured, in RFC 3339 format. | -| `voided_at` | `String` | 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/doc/models/card-prepaid-type.md b/doc/models/card-prepaid-type.md deleted file mode 100644 index 888d4b03b..000000000 --- a/doc/models/card-prepaid-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Card Prepaid Type - -Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. - -## Enumeration - -`Card Prepaid Type` - -## Fields - -| Name | -| --- | -| `UNKNOWN_PREPAID_TYPE` | -| `NOT_PREPAID` | -| `PREPAID` | - diff --git a/doc/models/card-type.md b/doc/models/card-type.md deleted file mode 100644 index 3ec545c3c..000000000 --- a/doc/models/card-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Card Type - -Indicates a card's type, such as `CREDIT` or `DEBIT`. - -## Enumeration - -`Card Type` - -## Fields - -| Name | -| --- | -| `UNKNOWN_CARD_TYPE` | -| `CREDIT` | -| `DEBIT` | - diff --git a/doc/models/card.md b/doc/models/card.md deleted file mode 100644 index 96e08392d..000000000 --- a/doc/models/card.md +++ /dev/null @@ -1,44 +0,0 @@ - -# 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` | Optional | Unique ID for this card. Generated by Square.
**Constraints**: *Maximum Length*: `64` | -| `card_brand` | [`String (Card Brand)`](../../doc/models/card-brand.md) | Optional | Indicates a card's brand, such as `VISA` or `MASTERCARD`. | -| `last_4` | `String` | Optional | The last 4 digits of the card number.
**Constraints**: *Maximum Length*: `4` | -| `exp_month` | `Integer` | Optional | The expiration month of the associated card as an integer between 1 and 12. | -| `exp_year` | `Integer` | Optional | The four-digit year of the card's expiration date. | -| `cardholder_name` | `String` | Optional | The name of the cardholder.
**Constraints**: *Maximum Length*: `96` | -| `billing_address` | [`Address Hash`](../../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` | 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` | -| `customer_id` | `String` | Optional | **Required** The ID of a customer created using the Customers API to be associated with the card. | -| `merchant_id` | `String` | Optional | The ID of the merchant associated with the card. | -| `reference_id` | `String` | 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` | `TrueClass \| FalseClass` | Optional | Indicates whether or not a card can be used for payments. | -| `card_type` | [`String (Card Type)`](../../doc/models/card-type.md) | Optional | Indicates a card's type, such as `CREDIT` or `DEBIT`. | -| `prepaid_type` | [`String (Card Prepaid Type)`](../../doc/models/card-prepaid-type.md) | Optional | Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. | -| `bin` | `String` | 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` | `Integer` | 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. | -| `card_co_brand` | [`String (Card Co Brand)`](../../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/doc/models/cash-app-details.md b/doc/models/cash-app-details.md deleted file mode 100644 index ba8bf9b62..000000000 --- a/doc/models/cash-app-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Cash App Details - -Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. - -## Structure - -`Cash App Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `buyer_full_name` | `String` | Optional | The name of the Cash App account holder.
**Constraints**: *Maximum Length*: `255` | -| `buyer_country_code` | `String` | 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` | -| `buyer_cashtag` | `String` | 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/doc/models/cash-drawer-device.md b/doc/models/cash-drawer-device.md deleted file mode 100644 index 52ca38111..000000000 --- a/doc/models/cash-drawer-device.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Cash Drawer Device - -## Structure - -`Cash Drawer Device` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The device Square-issued ID | -| `name` | `String` | Optional | The device merchant-specified name. | - -## Example (as JSON) - -```json -{ - "id": "id2", - "name": "name2" -} -``` - diff --git a/doc/models/cash-drawer-event-type.md b/doc/models/cash-drawer-event-type.md deleted file mode 100644 index 9d67b71f4..000000000 --- a/doc/models/cash-drawer-event-type.md +++ /dev/null @@ -1,25 +0,0 @@ - -# 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 - -`Cash Drawer Event Type` - -## 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/doc/models/cash-drawer-shift-event.md b/doc/models/cash-drawer-shift-event.md deleted file mode 100644 index 38bfea9af..000000000 --- a/doc/models/cash-drawer-shift-event.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Cash Drawer Shift Event - -## Structure - -`Cash Drawer Shift Event` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The unique ID of the event. | -| `event_type` | [`String (Cash Drawer Event Type)`](../../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. | -| `event_money` | [`Money Hash`](../../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. | -| `created_at` | `String` | Optional | The event time in RFC 3339 format. | -| `description` | `String` | Optional | An optional description of the event, entered by the employee that
created the event. | -| `team_member_id` | `String` | 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/doc/models/cash-drawer-shift-state.md b/doc/models/cash-drawer-shift-state.md deleted file mode 100644 index 8e2a4e474..000000000 --- a/doc/models/cash-drawer-shift-state.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Cash Drawer Shift State - -The current state of a cash drawer shift. - -## Enumeration - -`Cash Drawer Shift State` - -## 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/doc/models/cash-drawer-shift-summary.md b/doc/models/cash-drawer-shift-summary.md deleted file mode 100644 index e458cc79a..000000000 --- a/doc/models/cash-drawer-shift-summary.md +++ /dev/null @@ -1,41 +0,0 @@ - -# 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 - -`Cash Drawer Shift Summary` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The shift unique ID. | -| `state` | [`String (Cash Drawer Shift State)`](../../doc/models/cash-drawer-shift-state.md) | Optional | The current state of a cash drawer shift. | -| `opened_at` | `String` | Optional | The shift start time in ISO 8601 format. | -| `ended_at` | `String` | Optional | The shift end time in ISO 8601 format. | -| `closed_at` | `String` | Optional | The shift close time in ISO 8601 format. | -| `description` | `String` | Optional | An employee free-text description of a cash drawer shift. | -| `opened_cash_money` | [`Money Hash`](../../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. | -| `expected_cash_money` | [`Money Hash`](../../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. | -| `closed_cash_money` | [`Money Hash`](../../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. | -| `created_at` | `String` | Optional | The shift start time in RFC 3339 format. | -| `updated_at` | `String` | Optional | The shift updated at time in RFC 3339 format. | -| `location_id` | `String` | 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/doc/models/cash-drawer-shift.md b/doc/models/cash-drawer-shift.md deleted file mode 100644 index 3cd85005d..000000000 --- a/doc/models/cash-drawer-shift.md +++ /dev/null @@ -1,50 +0,0 @@ - -# 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 - -`Cash Drawer Shift` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The shift unique ID. | -| `state` | [`String (Cash Drawer Shift State)`](../../doc/models/cash-drawer-shift-state.md) | Optional | The current state of a cash drawer shift. | -| `opened_at` | `String` | Optional | The time when the shift began, in ISO 8601 format. | -| `ended_at` | `String` | Optional | The time when the shift ended, in ISO 8601 format. | -| `closed_at` | `String` | Optional | The time when the shift was closed, in ISO 8601 format. | -| `description` | `String` | Optional | The free-form text description of a cash drawer by an employee. | -| `opened_cash_money` | [`Money Hash`](../../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. | -| `cash_payment_money` | [`Money Hash`](../../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. | -| `cash_refunds_money` | [`Money Hash`](../../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. | -| `cash_paid_in_money` | [`Money Hash`](../../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. | -| `cash_paid_out_money` | [`Money Hash`](../../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. | -| `expected_cash_money` | [`Money Hash`](../../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. | -| `closed_cash_money` | [`Money Hash`](../../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` | [`Cash Drawer Device Hash`](../../doc/models/cash-drawer-device.md) | Optional | - | -| `created_at` | `String` | Optional | The shift start time in RFC 3339 format. | -| `updated_at` | `String` | Optional | The shift updated at time in RFC 3339 format. | -| `location_id` | `String` | Optional | The ID of the location the cash drawer shift belongs to. | -| `team_member_ids` | `Array` | 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. | -| `opening_team_member_id` | `String` | Optional | The ID of the team member that started the cash drawer shift. | -| `ending_team_member_id` | `String` | Optional | The ID of the team member that ended the cash drawer shift. | -| `closing_team_member_id` | `String` | 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/doc/models/cash-payment-details.md b/doc/models/cash-payment-details.md deleted file mode 100644 index 275651241..000000000 --- a/doc/models/cash-payment-details.md +++ /dev/null @@ -1,32 +0,0 @@ - -# 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 - -`Cash Payment Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `buyer_supplied_money` | [`Money Hash`](../../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. | -| `change_back_money` | [`Money Hash`](../../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/doc/models/catalog-availability-period.md b/doc/models/catalog-availability-period.md deleted file mode 100644 index 68c56467b..000000000 --- a/doc/models/catalog-availability-period.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Availability Period - -Represents a time period of availability. - -## Structure - -`Catalog Availability Period` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `start_local_time` | `String` | 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. | -| `end_local_time` | `String` | 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. | -| `day_of_week` | [`String (Day of Week)`](../../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/doc/models/catalog-category-type.md b/doc/models/catalog-category-type.md deleted file mode 100644 index ca2639f3f..000000000 --- a/doc/models/catalog-category-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Catalog Category Type - -Indicates the type of a category. - -## Enumeration - -`Catalog Category Type` - -## 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/doc/models/catalog-category.md b/doc/models/catalog-category.md deleted file mode 100644 index 7afc33358..000000000 --- a/doc/models/catalog-category.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Catalog Category - -A category to which a `CatalogItem` instance belongs. - -## Structure - -`Catalog Category` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | 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` | -| `image_ids` | `Array` | 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. | -| `category_type` | [`String (Catalog Category Type)`](../../doc/models/catalog-category-type.md) | Optional | Indicates the type of a category. | -| `parent_category` | [`Catalog Object Category Hash`](../../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. | -| `is_top_level` | `TrueClass \| FalseClass` | Optional | Indicates whether a category is a top level category, which does not have any parent_category. | -| `channels` | `Array` | Optional | A list of IDs representing channels, such as a Square Online site, where the category can be made visible. | -| `availability_period_ids` | `Array` | Optional | The IDs of the `CatalogAvailabilityPeriod` objects associated with the category. | -| `online_visibility` | `TrueClass \| FalseClass` | Optional | Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square Online sites. | -| `root_category` | `String` | Optional | The top-level category in a category hierarchy. | -| `ecom_seo_data` | [`Catalog Ecom Seo Data Hash`](../../doc/models/catalog-ecom-seo-data.md) | Optional | SEO data for for a seller's Square Online store. | -| `path_to_root` | [`Array`](../../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/doc/models/catalog-custom-attribute-definition-app-visibility.md b/doc/models/catalog-custom-attribute-definition-app-visibility.md deleted file mode 100644 index 4f21e9351..000000000 --- a/doc/models/catalog-custom-attribute-definition-app-visibility.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Catalog Custom Attribute Definition App Visibility - -Defines the visibility of a custom attribute to applications other than their -creating application. - -## Enumeration - -`Catalog Custom Attribute Definition App Visibility` - -## 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/doc/models/catalog-custom-attribute-definition-number-config.md b/doc/models/catalog-custom-attribute-definition-number-config.md deleted file mode 100644 index 263e16ca1..000000000 --- a/doc/models/catalog-custom-attribute-definition-number-config.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Catalog Custom Attribute Definition Number Config - -## Structure - -`Catalog Custom Attribute Definition Number Config` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `precision` | `Integer` | 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/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md b/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md deleted file mode 100644 index 2839042cf..000000000 --- a/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog Custom Attribute Definition Selection Config Custom Attribute Selection - -A named selection for this `SELECTION`-type custom attribute definition. - -## Structure - -`Catalog Custom Attribute Definition Selection Config Custom Attribute Selection` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | 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/doc/models/catalog-custom-attribute-definition-selection-config.md b/doc/models/catalog-custom-attribute-definition-selection-config.md deleted file mode 100644 index 3ba6b5d64..000000000 --- a/doc/models/catalog-custom-attribute-definition-selection-config.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Catalog Custom Attribute Definition Selection Config - -Configuration associated with `SELECTION`-type custom attribute definitions. - -## Structure - -`Catalog Custom Attribute Definition Selection Config` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `max_allowed_selections` | `Integer` | 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` | -| `allowed_selections` | [`Array`](../../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/doc/models/catalog-custom-attribute-definition-seller-visibility.md b/doc/models/catalog-custom-attribute-definition-seller-visibility.md deleted file mode 100644 index ac6cdfeb5..000000000 --- a/doc/models/catalog-custom-attribute-definition-seller-visibility.md +++ /dev/null @@ -1,18 +0,0 @@ - -# 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 - -`Catalog Custom Attribute Definition Seller Visibility` - -## 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/doc/models/catalog-custom-attribute-definition-string-config.md b/doc/models/catalog-custom-attribute-definition-string-config.md deleted file mode 100644 index d75460e1f..000000000 --- a/doc/models/catalog-custom-attribute-definition-string-config.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Catalog Custom Attribute Definition String Config - -Configuration associated with Custom Attribute Definitions of type `STRING`. - -## Structure - -`Catalog Custom Attribute Definition String Config` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `enforce_uniqueness` | `TrueClass \| FalseClass` | 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/doc/models/catalog-custom-attribute-definition-type.md b/doc/models/catalog-custom-attribute-definition-type.md deleted file mode 100644 index cf4d56ab1..000000000 --- a/doc/models/catalog-custom-attribute-definition-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Catalog Custom Attribute Definition Type - -Defines the possible types for a custom attribute. - -## Enumeration - -`Catalog Custom Attribute Definition Type` - -## 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/doc/models/catalog-custom-attribute-definition.md b/doc/models/catalog-custom-attribute-definition.md deleted file mode 100644 index 04e04ca21..000000000 --- a/doc/models/catalog-custom-attribute-definition.md +++ /dev/null @@ -1,54 +0,0 @@ - -# 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 - -`Catalog Custom Attribute Definition` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | [`String (Catalog Custom Attribute Definition Type)`](../../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` | 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` | -| `source_application` | [`Source Application Hash`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | -| `allowed_object_types` | [`Array`](../../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 | -| `seller_visibility` | [`String (Catalog Custom Attribute Definition Seller Visibility)`](../../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). | -| `app_visibility` | [`String (Catalog Custom Attribute Definition App Visibility)`](../../doc/models/catalog-custom-attribute-definition-app-visibility.md) | Optional | Defines the visibility of a custom attribute to applications other than their
creating application. | -| `string_config` | [`Catalog Custom Attribute Definition String Config Hash`](../../doc/models/catalog-custom-attribute-definition-string-config.md) | Optional | Configuration associated with Custom Attribute Definitions of type `STRING`. | -| `number_config` | [`Catalog Custom Attribute Definition Number Config Hash`](../../doc/models/catalog-custom-attribute-definition-number-config.md) | Optional | - | -| `selection_config` | [`Catalog Custom Attribute Definition Selection Config Hash`](../../doc/models/catalog-custom-attribute-definition-selection-config.md) | Optional | Configuration associated with `SELECTION`-type custom attribute definitions. | -| `custom_attribute_usage_count` | `Integer` | 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` | 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/doc/models/catalog-custom-attribute-value.md b/doc/models/catalog-custom-attribute-value.md deleted file mode 100644 index 9e68496b4..000000000 --- a/doc/models/catalog-custom-attribute-value.md +++ /dev/null @@ -1,36 +0,0 @@ - -# 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 - -`Catalog Custom Attribute Value` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | Optional | The name of the custom attribute. | -| `string_value` | `String` | Optional | The string value of the custom attribute. Populated if `type` = `STRING`. | -| `custom_attribute_definition_id` | `String` | Optional | The id of the [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) this value belongs to. | -| `type` | [`String (Catalog Custom Attribute Definition Type)`](../../doc/models/catalog-custom-attribute-definition-type.md) | Optional | Defines the possible types for a custom attribute. | -| `number_value` | `String` | Optional | Populated if `type` = `NUMBER`. Contains a string
representation of a decimal number, using a `.` as the decimal separator. | -| `boolean_value` | `TrueClass \| FalseClass` | Optional | A `true` or `false` value. Populated if `type` = `BOOLEAN`. | -| `selection_uid_values` | `Array` | Optional | One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`. | -| `key` | `String` | 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/doc/models/catalog-discount-modify-tax-basis.md b/doc/models/catalog-discount-modify-tax-basis.md deleted file mode 100644 index 9113e42b3..000000000 --- a/doc/models/catalog-discount-modify-tax-basis.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Catalog Discount Modify Tax Basis - -## Enumeration - -`Catalog Discount Modify Tax Basis` - -## 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/doc/models/catalog-discount-type.md b/doc/models/catalog-discount-type.md deleted file mode 100644 index 44010f266..000000000 --- a/doc/models/catalog-discount-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Catalog Discount Type - -How to apply a CatalogDiscount to a CatalogItem. - -## Enumeration - -`Catalog Discount Type` - -## 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/doc/models/catalog-discount.md b/doc/models/catalog-discount.md deleted file mode 100644 index 8cbe622b3..000000000 --- a/doc/models/catalog-discount.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Catalog Discount - -A discount applicable to items. - -## Structure - -`Catalog Discount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | 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` | -| `discount_type` | [`String (Catalog Discount Type)`](../../doc/models/catalog-discount-type.md) | Optional | How to apply a CatalogDiscount to a CatalogItem. | -| `percentage` | `String` | 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. | -| `amount_money` | [`Money Hash`](../../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. | -| `pin_required` | `TrueClass \| FalseClass` | 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. | -| `label_color` | `String` | Optional | The color of the discount display label in the Square Point of Sale app. This must be a valid hex color code. | -| `modify_tax_basis` | [`String (Catalog Discount Modify Tax Basis)`](../../doc/models/catalog-discount-modify-tax-basis.md) | Optional | - | -| `maximum_amount_money` | [`Money Hash`](../../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/doc/models/catalog-ecom-seo-data.md b/doc/models/catalog-ecom-seo-data.md deleted file mode 100644 index a2633b2b4..000000000 --- a/doc/models/catalog-ecom-seo-data.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Ecom Seo Data - -SEO data for for a seller's Square Online store. - -## Structure - -`Catalog Ecom Seo Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `page_title` | `String` | Optional | The SEO title used for the Square Online store. | -| `page_description` | `String` | Optional | The SEO description used for the Square Online store. | -| `permalink` | `String` | 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/doc/models/catalog-id-mapping.md b/doc/models/catalog-id-mapping.md deleted file mode 100644 index 23b18f1a6..000000000 --- a/doc/models/catalog-id-mapping.md +++ /dev/null @@ -1,35 +0,0 @@ - -# 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 - -`Catalog Id Mapping` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `client_object_id` | `String` | Optional | The client-supplied temporary `#`-prefixed ID for a new `CatalogObject`. | -| `object_id` | `String` | 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/doc/models/catalog-image.md b/doc/models/catalog-image.md deleted file mode 100644 index f4d78a206..000000000 --- a/doc/models/catalog-image.md +++ /dev/null @@ -1,34 +0,0 @@ - -# 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 - -`Catalog Image` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | 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` | 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` | 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). | -| `photo_studio_order_id` | `String` | 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/doc/models/catalog-info-response-limits.md b/doc/models/catalog-info-response-limits.md deleted file mode 100644 index 0fd451139..000000000 --- a/doc/models/catalog-info-response-limits.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Catalog Info Response Limits - -## Structure - -`Catalog Info Response Limits` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `batch_upsert_max_objects_per_batch` | `Integer` | Optional | The maximum number of objects that may appear within a single batch in a
`/v2/catalog/batch-upsert` request. | -| `batch_upsert_max_total_objects` | `Integer` | Optional | The maximum number of objects that may appear across all batches in a
`/v2/catalog/batch-upsert` request. | -| `batch_retrieve_max_object_ids` | `Integer` | Optional | The maximum number of object IDs that may appear in a `/v2/catalog/batch-retrieve`
request. | -| `search_max_page_limit` | `Integer` | Optional | The maximum number of results that may be returned in a page of a
`/v2/catalog/search` response. | -| `batch_delete_max_object_ids` | `Integer` | Optional | The maximum number of object IDs that may be included in a single
`/v2/catalog/batch-delete` request. | -| `update_item_taxes_max_item_ids` | `Integer` | Optional | The maximum number of item IDs that may be included in a single
`/v2/catalog/update-item-taxes` request. | -| `update_item_taxes_max_taxes_to_enable` | `Integer` | Optional | The maximum number of tax IDs to be enabled that may be included in a single
`/v2/catalog/update-item-taxes` request. | -| `update_item_taxes_max_taxes_to_disable` | `Integer` | Optional | The maximum number of tax IDs to be disabled that may be included in a single
`/v2/catalog/update-item-taxes` request. | -| `update_item_modifier_lists_max_item_ids` | `Integer` | Optional | The maximum number of item IDs that may be included in a single
`/v2/catalog/update-item-modifier-lists` request. | -| `update_item_modifier_lists_max_modifier_lists_to_enable` | `Integer` | 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. | -| `update_item_modifier_lists_max_modifier_lists_to_disable` | `Integer` | 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/doc/models/catalog-info-response.md b/doc/models/catalog-info-response.md deleted file mode 100644 index 958a75402..000000000 --- a/doc/models/catalog-info-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Catalog Info Response - -## Structure - -`Catalog Info Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `limits` | [`Catalog Info Response Limits Hash`](../../doc/models/catalog-info-response-limits.md) | Optional | - | -| `standard_unit_description_group` | [`Standard Unit Description Group Hash`](../../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/doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md b/doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md deleted file mode 100644 index 0166e8ea4..000000000 --- a/doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md +++ /dev/null @@ -1,21 +0,0 @@ - -# 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 - -`Catalog Item Food and Beverage Details Dietary Preference Standard Dietary Preference` - -## Fields - -| Name | -| --- | -| `DAIRY_FREE` | -| `GLUTEN_FREE` | -| `HALAL` | -| `KOSHER` | -| `NUT_FREE` | -| `VEGAN` | -| `VEGETARIAN` | - diff --git a/doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md b/doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md deleted file mode 100644 index c5d4a6107..000000000 --- a/doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# 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 - -`Catalog Item Food and Beverage Details Dietary Preference Type` - -## Fields - -| Name | Description | -| --- | --- | -| `STANDARD` | A standard value from a pre-determined list. | -| `CUSTOM` | A user-defined custom value. | - diff --git a/doc/models/catalog-item-food-and-beverage-details-dietary-preference.md b/doc/models/catalog-item-food-and-beverage-details-dietary-preference.md deleted file mode 100644 index d88ad003b..000000000 --- a/doc/models/catalog-item-food-and-beverage-details-dietary-preference.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Item Food and Beverage Details Dietary Preference - -Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its ingredients. - -## Structure - -`Catalog Item Food and Beverage Details Dietary Preference` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | [`String (Catalog Item Food and Beverage Details Dietary Preference Type)`](../../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. | -| `standard_name` | [`String (Catalog Item Food and Beverage Details Dietary Preference Standard Dietary Preference)`](../../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. | -| `custom_name` | `String` | 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/doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md b/doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md deleted file mode 100644 index 8e98c61c9..000000000 --- a/doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Catalog Item Food and Beverage Details Ingredient Standard Ingredient - -Standard ingredients for food and beverage items that are recommended on item creation. - -## Enumeration - -`Catalog Item Food and Beverage Details Ingredient Standard Ingredient` - -## Fields - -| Name | -| --- | -| `CELERY` | -| `CRUSTACEANS` | -| `EGGS` | -| `FISH` | -| `GLUTEN` | -| `LUPIN` | -| `MILK` | -| `MOLLUSCS` | -| `MUSTARD` | -| `PEANUTS` | -| `SESAME` | -| `SOY` | -| `SULPHITES` | -| `TREE_NUTS` | - diff --git a/doc/models/catalog-item-food-and-beverage-details-ingredient.md b/doc/models/catalog-item-food-and-beverage-details-ingredient.md deleted file mode 100644 index f761883f5..000000000 --- a/doc/models/catalog-item-food-and-beverage-details-ingredient.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Item Food and Beverage Details Ingredient - -Describes the ingredient used in a `FOOD_AND_BEV` item. - -## Structure - -`Catalog Item Food and Beverage Details Ingredient` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | [`String (Catalog Item Food and Beverage Details Dietary Preference Type)`](../../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. | -| `standard_name` | [`String (Catalog Item Food and Beverage Details Ingredient Standard Ingredient)`](../../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. | -| `custom_name` | `String` | 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/doc/models/catalog-item-food-and-beverage-details.md b/doc/models/catalog-item-food-and-beverage-details.md deleted file mode 100644 index 22427fb92..000000000 --- a/doc/models/catalog-item-food-and-beverage-details.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Catalog Item Food and Beverage Details - -The food and beverage-specific details of a `FOOD_AND_BEV` item. - -## Structure - -`Catalog Item Food and Beverage Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `calorie_count` | `Integer` | Optional | The calorie count (in the unit of kcal) for the `FOOD_AND_BEV` type of items. | -| `dietary_preferences` | [`Array`](../../doc/models/catalog-item-food-and-beverage-details-dietary-preference.md) | Optional | The dietary preferences for the `FOOD_AND_BEV` item. | -| `ingredients` | [`Array`](../../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/doc/models/catalog-item-modifier-list-info.md b/doc/models/catalog-item-modifier-list-info.md deleted file mode 100644 index e7a12470f..000000000 --- a/doc/models/catalog-item-modifier-list-info.md +++ /dev/null @@ -1,43 +0,0 @@ - -# 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 - -`Catalog Item Modifier List Info` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `modifier_list_id` | `String` | Required | The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`.
**Constraints**: *Minimum Length*: `1` | -| `modifier_overrides` | [`Array`](../../doc/models/catalog-modifier-override.md) | Optional | A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is enabled by default. | -| `min_selected_modifiers` | `Integer` | 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` | -| `max_selected_modifiers` | `Integer` | 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` | `TrueClass \| FalseClass` | Optional | If `true`, enable this `CatalogModifierList`. The default value is `true`. | -| `ordinal` | `Integer` | 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/doc/models/catalog-item-option-for-item.md b/doc/models/catalog-item-option-for-item.md deleted file mode 100644 index 7ba82d418..000000000 --- a/doc/models/catalog-item-option-for-item.md +++ /dev/null @@ -1,24 +0,0 @@ - -# 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 - -`Catalog Item Option for Item` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `item_option_id` | `String` | 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/doc/models/catalog-item-option-value-for-item-variation.md b/doc/models/catalog-item-option-value-for-item-variation.md deleted file mode 100644 index cb14dc8c1..000000000 --- a/doc/models/catalog-item-option-value-for-item-variation.md +++ /dev/null @@ -1,28 +0,0 @@ - -# 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 - -`Catalog Item Option Value for Item Variation` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `item_option_id` | `String` | Optional | The unique id of an item option. | -| `item_option_value_id` | `String` | 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/doc/models/catalog-item-option-value.md b/doc/models/catalog-item-option-value.md deleted file mode 100644 index 8f4b12fa4..000000000 --- a/doc/models/catalog-item-option-value.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Catalog Item Option Value - -An enumerated value that can link a -`CatalogItemVariation` to an item option as one of -its item option values. - -## Structure - -`Catalog Item Option Value` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `item_option_id` | `String` | Optional | Unique ID of the associated item option. | -| `name` | `String` | Optional | Name of this item option value. This is a searchable attribute for use in applicable query filters. | -| `description` | `String` | Optional | A human-readable description for the option value. This is a searchable attribute for use in applicable query filters. | -| `color` | `String` | 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` | `Integer` | 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/doc/models/catalog-item-option.md b/doc/models/catalog-item-option.md deleted file mode 100644 index 84022a5b7..000000000 --- a/doc/models/catalog-item-option.md +++ /dev/null @@ -1,104 +0,0 @@ - -# Catalog Item Option - -A group of variations for a `CatalogItem`. - -## Structure - -`Catalog Item Option` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | 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. | -| `display_name` | `String` | Optional | The item option's display name for the customer. This is a searchable attribute for use in applicable query filters. | -| `description` | `String` | 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. | -| `show_colors` | `TrueClass \| FalseClass` | Optional | If true, display colors for entries in `values` when present. | -| `values` | [`Array`](../../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/doc/models/catalog-item-product-type.md b/doc/models/catalog-item-product-type.md deleted file mode 100644 index 0a85df5ed..000000000 --- a/doc/models/catalog-item-product-type.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Catalog Item Product Type - -The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. - -## Enumeration - -`Catalog Item Product Type` - -## 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/doc/models/catalog-item-variation.md b/doc/models/catalog-item-variation.md deleted file mode 100644 index 05965406f..000000000 --- a/doc/models/catalog-item-variation.md +++ /dev/null @@ -1,56 +0,0 @@ - -# 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 - -`Catalog Item Variation` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `item_id` | `String` | Optional | The ID of the `CatalogItem` associated with this item variation. | -| `name` | `String` | 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` | Optional | The item variation's SKU, if any. This is a searchable attribute for use in applicable query filters. | -| `upc` | `String` | 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` | `Integer` | 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. | -| `pricing_type` | [`String (Catalog Pricing Type)`](../../doc/models/catalog-pricing-type.md) | Optional | Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. | -| `price_money` | [`Money Hash`](../../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. | -| `location_overrides` | [`Array`](../../doc/models/item-variation-location-overrides.md) | Optional | Per-location price and inventory overrides. | -| `track_inventory` | `TrueClass \| FalseClass` | Optional | If `true`, inventory tracking is active for the variation. | -| `inventory_alert_type` | [`String (Inventory Alert Type)`](../../doc/models/inventory-alert-type.md) | Optional | Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. | -| `inventory_alert_threshold` | `Integer` | 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. | -| `user_data` | `String` | Optional | Arbitrary user metadata to associate with the item variation. This attribute value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | -| `service_duration` | `Integer` | 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). | -| `available_for_booking` | `TrueClass \| FalseClass` | Optional | If the `CatalogItem` that owns this item variation is of type
`APPOINTMENTS_SERVICE`, a bool representing whether this service is available for booking. | -| `item_option_values` | [`Array`](../../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. | -| `measurement_unit_id` | `String` | 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` | `TrueClass \| FalseClass` | 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` | `TrueClass \| FalseClass` | 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. | -| `image_ids` | `Array` | Optional | The IDs of images associated with this `CatalogItemVariation` instance.
These images will be shown to customers in Square Online Store. | -| `team_member_ids` | `Array` | Optional | Tokens of employees that can perform the service represented by this variation. Only valid for
variations of type `APPOINTMENTS_SERVICE`. | -| `stockable_conversion` | [`Catalog Stock Conversion Hash`](../../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/doc/models/catalog-item.md b/doc/models/catalog-item.md deleted file mode 100644 index 038b89940..000000000 --- a/doc/models/catalog-item.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Catalog Item - -A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` type, also referred to as an item, in the catalog. - -## Structure - -`Catalog Item` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | 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` | 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` | 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` | -| `label_color` | `String` | Optional | The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code. | -| `is_taxable` | `TrueClass \| FalseClass` | Optional | Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. | -| `available_online` | `TrueClass \| FalseClass` | Optional | If `true`, the item can be added to shipping orders from the merchant's online store. | -| `available_for_pickup` | `TrueClass \| FalseClass` | Optional | If `true`, the item can be added to pickup orders from the merchant's online store. | -| `available_electronically` | `TrueClass \| FalseClass` | Optional | If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. | -| `category_id` | `String` | Optional | The ID of the item's category, if any. Deprecated since 2023-12-13. Use `CatalogItem.categories`, instead. | -| `tax_ids` | `Array` | 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`. | -| `modifier_list_info` | [`Array`](../../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` | [`Array`](../../doc/models/catalog-object.md) | Optional | A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must have
at least one variation. | -| `product_type` | [`String (Catalog Item Product Type)`](../../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. | -| `skip_modifier_screen` | `TrueClass \| FalseClass` | 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. | -| `item_options` | [`Array`](../../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. | -| `image_ids` | `Array` | 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. | -| `sort_name` | `String` | 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` | [`Array`](../../doc/models/catalog-object-category.md) | Optional | The list of categories. | -| `description_html` | `String` | 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` | -| `description_plaintext` | `String` | Optional | A server-generated plaintext version of the `description_html` field, without formatting tags.
**Constraints**: *Maximum Length*: `65535` | -| `channels` | `Array` | Optional | A list of IDs representing channels, such as a Square Online site, where the item can be made visible or available. | -| `is_archived` | `TrueClass \| FalseClass` | Optional | Indicates whether this item is archived (`true`) or not (`false`). | -| `ecom_seo_data` | [`Catalog Ecom Seo Data Hash`](../../doc/models/catalog-ecom-seo-data.md) | Optional | SEO data for for a seller's Square Online store. | -| `food_and_beverage_details` | [`Catalog Item Food and Beverage Details Hash`](../../doc/models/catalog-item-food-and-beverage-details.md) | Optional | The food and beverage-specific details of a `FOOD_AND_BEV` item. | -| `reporting_category` | [`Catalog Object Category Hash`](../../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/doc/models/catalog-measurement-unit.md b/doc/models/catalog-measurement-unit.md deleted file mode 100644 index 6b888cd50..000000000 --- a/doc/models/catalog-measurement-unit.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Catalog Measurement Unit - -Represents the unit used to measure a `CatalogItemVariation` and -specifies the precision for decimal quantities. - -## Structure - -`Catalog Measurement Unit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `measurement_unit` | [`Measurement Unit Hash`](../../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` | `Integer` | 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/doc/models/catalog-modifier-list-modifier-type.md b/doc/models/catalog-modifier-list-modifier-type.md deleted file mode 100644 index ab4f6bb18..000000000 --- a/doc/models/catalog-modifier-list-modifier-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Catalog Modifier List Modifier Type - -Defines the type of `CatalogModifierList`. - -## Enumeration - -`Catalog Modifier List Modifier Type` - -## 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/doc/models/catalog-modifier-list-selection-type.md b/doc/models/catalog-modifier-list-selection-type.md deleted file mode 100644 index 7646aad23..000000000 --- a/doc/models/catalog-modifier-list-selection-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Catalog Modifier List Selection Type - -Indicates whether a CatalogModifierList supports multiple selections. - -## Enumeration - -`Catalog Modifier List Selection Type` - -## 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/doc/models/catalog-modifier-list.md b/doc/models/catalog-modifier-list.md deleted file mode 100644 index 8d26bee88..000000000 --- a/doc/models/catalog-modifier-list.md +++ /dev/null @@ -1,93 +0,0 @@ - -# 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 - -`Catalog Modifier List` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | 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` | `Integer` | Optional | The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances. | -| `selection_type` | [`String (Catalog Modifier List Selection Type)`](../../doc/models/catalog-modifier-list-selection-type.md) | Optional | Indicates whether a CatalogModifierList supports multiple selections. | -| `modifiers` | [`Array`](../../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>}}
}
``` | -| `image_ids` | `Array` | 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. | -| `modifier_type` | [`String (Catalog Modifier List Modifier Type)`](../../doc/models/catalog-modifier-list-modifier-type.md) | Optional | Defines the type of `CatalogModifierList`. | -| `max_length` | `Integer` | 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`. | -| `text_required` | `TrueClass \| FalseClass` | 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`. | -| `internal_name` | `String` | 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/doc/models/catalog-modifier-override.md b/doc/models/catalog-modifier-override.md deleted file mode 100644 index c8cb91a60..000000000 --- a/doc/models/catalog-modifier-override.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog Modifier Override - -Options to control how to override the default behavior of the specified modifier. - -## Structure - -`Catalog Modifier Override` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `modifier_id` | `String` | Required | The ID of the `CatalogModifier` whose default behavior is being overridden.
**Constraints**: *Minimum Length*: `1` | -| `on_by_default` | `TrueClass \| FalseClass` | 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/doc/models/catalog-modifier.md b/doc/models/catalog-modifier.md deleted file mode 100644 index 7bc993aec..000000000 --- a/doc/models/catalog-modifier.md +++ /dev/null @@ -1,71 +0,0 @@ - -# 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 - -`Catalog Modifier` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | 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` | -| `price_money` | [`Money Hash`](../../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` | `Integer` | Optional | Determines where this `CatalogModifier` appears in the `CatalogModifierList`. | -| `modifier_list_id` | `String` | Optional | The ID of the `CatalogModifierList` associated with this modifier. | -| `location_overrides` | [`Array`](../../doc/models/modifier-location-overrides.md) | Optional | Location-specific price overrides. | -| `image_id` | `String` | 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/doc/models/catalog-object-batch.md b/doc/models/catalog-object-batch.md deleted file mode 100644 index 7b5c806c1..000000000 --- a/doc/models/catalog-object-batch.md +++ /dev/null @@ -1,113 +0,0 @@ - -# Catalog Object Batch - -A batch of catalog objects. - -## Structure - -`Catalog Object Batch` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `objects` | [`Array`](../../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/doc/models/catalog-object-category.md b/doc/models/catalog-object-category.md deleted file mode 100644 index fb478d323..000000000 --- a/doc/models/catalog-object-category.md +++ /dev/null @@ -1,27 +0,0 @@ - -# 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 - -`Catalog Object Category` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The ID of the object's category. | -| `ordinal` | `Integer` | Optional | The order of the object within the context of the category. | - -## Example (as JSON) - -```json -{ - "id": "id4", - "ordinal": 8 -} -``` - diff --git a/doc/models/catalog-object-reference.md b/doc/models/catalog-object-reference.md deleted file mode 100644 index 99019e0a4..000000000 --- a/doc/models/catalog-object-reference.md +++ /dev/null @@ -1,27 +0,0 @@ - -# 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 - -`Catalog Object Reference` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `object_id` | `String` | Optional | The ID of the referenced object. | -| `catalog_version` | `Integer` | Optional | The version of the object. | - -## Example (as JSON) - -```json -{ - "object_id": "object_id0", - "catalog_version": 84 -} -``` - diff --git a/doc/models/catalog-object-type.md b/doc/models/catalog-object-type.md deleted file mode 100644 index 24035df52..000000000 --- a/doc/models/catalog-object-type.md +++ /dev/null @@ -1,34 +0,0 @@ - -# 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 - -`Catalog Object Type` - -## 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/doc/models/catalog-object.md b/doc/models/catalog-object.md deleted file mode 100644 index 0b107c837..000000000 --- a/doc/models/catalog-object.md +++ /dev/null @@ -1,153 +0,0 @@ - -# 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 - -`Catalog Object` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | [`String (Catalog Object Type)`](../../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` | -| `updated_at` | `String` | 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` | `Integer` | 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. | -| `is_deleted` | `TrueClass \| FalseClass` | 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. | -| `custom_attribute_values` | [`Hash String Catalog Custom Attribute Value Hash`](../../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.). | -| `catalog_v1_ids` | [`Array`](../../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. | -| `present_at_all_locations` | `TrueClass \| FalseClass` | 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`. | -| `present_at_location_ids` | `Array` | 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. | -| `absent_at_location_ids` | `Array` | 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. | -| `item_data` | [`Catalog Item Hash`](../../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. | -| `category_data` | [`Catalog Category Hash`](../../doc/models/catalog-category.md) | Optional | A category to which a `CatalogItem` instance belongs. | -| `item_variation_data` | [`Catalog Item Variation Hash`](../../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. | -| `tax_data` | [`Catalog Tax Hash`](../../doc/models/catalog-tax.md) | Optional | A tax applicable to an item. | -| `discount_data` | [`Catalog Discount Hash`](../../doc/models/catalog-discount.md) | Optional | A discount applicable to items. | -| `modifier_list_data` | [`Catalog Modifier List Hash`](../../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`. | -| `modifier_data` | [`Catalog Modifier Hash`](../../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. | -| `time_period_data` | [`Catalog Time Period Hash`](../../doc/models/catalog-time-period.md) | Optional | Represents a time period - either a single period or a repeating period. | -| `product_set_data` | [`Catalog Product Set Hash`](../../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. | -| `pricing_rule_data` | [`Catalog Pricing Rule Hash`](../../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. | -| `image_data` | [`Catalog Image Hash`](../../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. | -| `measurement_unit_data` | [`Catalog Measurement Unit Hash`](../../doc/models/catalog-measurement-unit.md) | Optional | Represents the unit used to measure a `CatalogItemVariation` and
specifies the precision for decimal quantities. | -| `subscription_plan_data` | [`Catalog Subscription Plan Hash`](../../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). | -| `item_option_data` | [`Catalog Item Option Hash`](../../doc/models/catalog-item-option.md) | Optional | A group of variations for a `CatalogItem`. | -| `item_option_value_data` | [`Catalog Item Option Value Hash`](../../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. | -| `custom_attribute_definition_data` | [`Catalog Custom Attribute Definition Hash`](../../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) | -| `quick_amounts_settings_data` | [`Catalog Quick Amounts Settings Hash`](../../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. | -| `subscription_plan_variation_data` | [`Catalog Subscription Plan Variation Hash`](../../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). | -| `availability_period_data` | [`Catalog Availability Period Hash`](../../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/doc/models/catalog-pricing-rule.md b/doc/models/catalog-pricing-rule.md deleted file mode 100644 index e8ef46e80..000000000 --- a/doc/models/catalog-pricing-rule.md +++ /dev/null @@ -1,42 +0,0 @@ - -# 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 - -`Catalog Pricing Rule` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | Optional | User-defined name for the pricing rule. For example, "Buy one get one
free" or "10% off". | -| `time_period_ids` | `Array` | 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. | -| `discount_id` | `String` | Optional | Unique ID for the `CatalogDiscount` to take off
the price of all matched items. | -| `match_products_id` | `String` | 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. | -| `apply_products_id` | `String` | 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. | -| `exclude_products_id` | `String` | 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. | -| `valid_from_date` | `String` | Optional | Represents the date the Pricing Rule is valid from. Represented in RFC 3339 full-date format (YYYY-MM-DD). | -| `valid_from_local_time` | `String` | 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. | -| `valid_until_date` | `String` | Optional | Represents the date the Pricing Rule is valid until. Represented in RFC 3339 full-date format (YYYY-MM-DD). | -| `valid_until_local_time` | `String` | 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. | -| `exclude_strategy` | [`String (Exclude Strategy)`](../../doc/models/exclude-strategy.md) | Optional | Indicates which products matched by a CatalogPricingRule
will be excluded if the pricing rule uses an exclude set. | -| `minimum_order_subtotal_money` | [`Money Hash`](../../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. | -| `customer_group_ids_any` | `Array` | 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/doc/models/catalog-pricing-type.md b/doc/models/catalog-pricing-type.md deleted file mode 100644 index bbd9755c4..000000000 --- a/doc/models/catalog-pricing-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Catalog Pricing Type - -Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. - -## Enumeration - -`Catalog Pricing Type` - -## 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/doc/models/catalog-product-set.md b/doc/models/catalog-product-set.md deleted file mode 100644 index e1f431bcc..000000000 --- a/doc/models/catalog-product-set.md +++ /dev/null @@ -1,41 +0,0 @@ - -# 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 - -`Catalog Product Set` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | Optional | User-defined name for the product set. For example, "Clearance Items"
or "Winter Sale Items". | -| `product_ids_any` | `Array` | 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. | -| `product_ids_all` | `Array` | 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. | -| `quantity_exact` | `Integer` | 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`. | -| `quantity_min` | `Integer` | 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. | -| `quantity_max` | `Integer` | Optional | If set, the pricing rule will apply to a maximum of this many items from
`products_any` or `products_all`. | -| `all_products` | `TrueClass \| FalseClass` | 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/doc/models/catalog-query-exact.md b/doc/models/catalog-query-exact.md deleted file mode 100644 index 4f6464db8..000000000 --- a/doc/models/catalog-query-exact.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog Query Exact - -The query filter to return the search result by exact match of the specified attribute name and value. - -## Structure - -`Catalog Query Exact` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `attribute_name` | `String` | Required | The name of the attribute to be searched. Matching of the attribute name is exact.
**Constraints**: *Minimum Length*: `1` | -| `attribute_value` | `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/doc/models/catalog-query-item-variations-for-item-option-values.md b/doc/models/catalog-query-item-variations-for-item-option-values.md deleted file mode 100644 index d41023f66..000000000 --- a/doc/models/catalog-query-item-variations-for-item-option-values.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Query Item Variations for Item Option Values - -The query filter to return the item variations containing the specified item option value IDs. - -## Structure - -`Catalog Query Item Variations for Item Option Values` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `item_option_value_ids` | `Array` | 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/doc/models/catalog-query-items-for-item-options.md b/doc/models/catalog-query-items-for-item-options.md deleted file mode 100644 index 93c00da94..000000000 --- a/doc/models/catalog-query-items-for-item-options.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Catalog Query Items for Item Options - -The query filter to return the items containing the specified item option IDs. - -## Structure - -`Catalog Query Items for Item Options` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `item_option_ids` | `Array` | 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/doc/models/catalog-query-items-for-modifier-list.md b/doc/models/catalog-query-items-for-modifier-list.md deleted file mode 100644 index 3aa1b1b63..000000000 --- a/doc/models/catalog-query-items-for-modifier-list.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Query Items for Modifier List - -The query filter to return the items containing the specified modifier list IDs. - -## Structure - -`Catalog Query Items for Modifier List` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `modifier_list_ids` | `Array` | 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/doc/models/catalog-query-items-for-tax.md b/doc/models/catalog-query-items-for-tax.md deleted file mode 100644 index a91e092ce..000000000 --- a/doc/models/catalog-query-items-for-tax.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Catalog Query Items for Tax - -The query filter to return the items containing the specified tax IDs. - -## Structure - -`Catalog Query Items for Tax` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `tax_ids` | `Array` | 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/doc/models/catalog-query-prefix.md b/doc/models/catalog-query-prefix.md deleted file mode 100644 index 8accca353..000000000 --- a/doc/models/catalog-query-prefix.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog Query Prefix - -The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. - -## Structure - -`Catalog Query Prefix` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `attribute_name` | `String` | Required | The name of the attribute to be searched.
**Constraints**: *Minimum Length*: `1` | -| `attribute_prefix` | `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/doc/models/catalog-query-range.md b/doc/models/catalog-query-range.md deleted file mode 100644 index 7f158fdc8..000000000 --- a/doc/models/catalog-query-range.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Query Range - -The query filter to return the search result whose named attribute values fall between the specified range. - -## Structure - -`Catalog Query Range` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `attribute_name` | `String` | Required | The name of the attribute to be searched.
**Constraints**: *Minimum Length*: `1` | -| `attribute_min_value` | `Integer` | Optional | The desired minimum value for the search attribute (inclusive). | -| `attribute_max_value` | `Integer` | 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/doc/models/catalog-query-set.md b/doc/models/catalog-query-set.md deleted file mode 100644 index b6e8e2fce..000000000 --- a/doc/models/catalog-query-set.md +++ /dev/null @@ -1,28 +0,0 @@ - -# 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 - -`Catalog Query Set` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `attribute_name` | `String` | Required | The name of the attribute to be searched. Matching of the attribute name is exact.
**Constraints**: *Minimum Length*: `1` | -| `attribute_values` | `Array` | 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/doc/models/catalog-query-sorted-attribute.md b/doc/models/catalog-query-sorted-attribute.md deleted file mode 100644 index 821a78c9d..000000000 --- a/doc/models/catalog-query-sorted-attribute.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Catalog Query Sorted Attribute - -The query expression to specify the key to sort search results. - -## Structure - -`Catalog Query Sorted Attribute` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `attribute_name` | `String` | Required | The attribute whose value is used as the sort key.
**Constraints**: *Minimum Length*: `1` | -| `initial_attribute_value` | `String` | 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). | -| `sort_order` | [`String (Sort Order)`](../../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/doc/models/catalog-query-text.md b/doc/models/catalog-query-text.md deleted file mode 100644 index 34ac8ef28..000000000 --- a/doc/models/catalog-query-text.md +++ /dev/null @@ -1,25 +0,0 @@ - -# 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 - -`Catalog Query Text` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `keywords` | `Array` | 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/doc/models/catalog-query.md b/doc/models/catalog-query.md deleted file mode 100644 index dede731fa..000000000 --- a/doc/models/catalog-query.md +++ /dev/null @@ -1,82 +0,0 @@ - -# 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 - -`Catalog Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `sorted_attribute_query` | [`Catalog Query Sorted Attribute Hash`](../../doc/models/catalog-query-sorted-attribute.md) | Optional | The query expression to specify the key to sort search results. | -| `exact_query` | [`Catalog Query Exact Hash`](../../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. | -| `set_query` | [`Catalog Query Set Hash`](../../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`. | -| `prefix_query` | [`Catalog Query Prefix Hash`](../../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. | -| `range_query` | [`Catalog Query Range Hash`](../../doc/models/catalog-query-range.md) | Optional | The query filter to return the search result whose named attribute values fall between the specified range. | -| `text_query` | [`Catalog Query Text Hash`](../../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. | -| `items_for_tax_query` | [`Catalog Query Items for Tax Hash`](../../doc/models/catalog-query-items-for-tax.md) | Optional | The query filter to return the items containing the specified tax IDs. | -| `items_for_modifier_list_query` | [`Catalog Query Items for Modifier List Hash`](../../doc/models/catalog-query-items-for-modifier-list.md) | Optional | The query filter to return the items containing the specified modifier list IDs. | -| `items_for_item_options_query` | [`Catalog Query Items for Item Options Hash`](../../doc/models/catalog-query-items-for-item-options.md) | Optional | The query filter to return the items containing the specified item option IDs. | -| `item_variations_for_item_option_values_query` | [`Catalog Query Item Variations for Item Option Values Hash`](../../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/doc/models/catalog-quick-amount-type.md b/doc/models/catalog-quick-amount-type.md deleted file mode 100644 index c6ab892cb..000000000 --- a/doc/models/catalog-quick-amount-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Catalog Quick Amount Type - -Determines the type of a specific Quick Amount. - -## Enumeration - -`Catalog Quick Amount Type` - -## 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/doc/models/catalog-quick-amount.md b/doc/models/catalog-quick-amount.md deleted file mode 100644 index d0eec699d..000000000 --- a/doc/models/catalog-quick-amount.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Catalog Quick Amount - -Represents a Quick Amount in the Catalog. - -## Structure - -`Catalog Quick Amount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | [`String (Catalog Quick Amount Type)`](../../doc/models/catalog-quick-amount-type.md) | Required | Determines the type of a specific Quick Amount. | -| `amount` | [`Money Hash`](../../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` | `Integer` | 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` | `Integer` | 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/doc/models/catalog-quick-amounts-settings-option.md b/doc/models/catalog-quick-amounts-settings-option.md deleted file mode 100644 index c932bf22d..000000000 --- a/doc/models/catalog-quick-amounts-settings-option.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Catalog Quick Amounts Settings Option - -Determines a seller's option on Quick Amounts feature. - -## Enumeration - -`Catalog Quick Amounts Settings Option` - -## 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/doc/models/catalog-quick-amounts-settings.md b/doc/models/catalog-quick-amounts-settings.md deleted file mode 100644 index 670d20c04..000000000 --- a/doc/models/catalog-quick-amounts-settings.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Catalog Quick Amounts Settings - -A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. - -## Structure - -`Catalog Quick Amounts Settings` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `option` | [`String (Catalog Quick Amounts Settings Option)`](../../doc/models/catalog-quick-amounts-settings-option.md) | Required | Determines a seller's option on Quick Amounts feature. | -| `eligible_for_auto_amounts` | `TrueClass \| FalseClass` | Optional | Represents location's eligibility for auto amounts
The boolean should be consistent with whether there are AUTO amounts in the `amounts`. | -| `amounts` | [`Array`](../../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/doc/models/catalog-stock-conversion.md b/doc/models/catalog-stock-conversion.md deleted file mode 100644 index 017bd0b87..000000000 --- a/doc/models/catalog-stock-conversion.md +++ /dev/null @@ -1,29 +0,0 @@ - -# 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 - -`Catalog Stock Conversion` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `stockable_item_variation_id` | `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` | -| `stockable_quantity` | `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` | -| `nonstockable_quantity` | `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/doc/models/catalog-subscription-plan-variation.md b/doc/models/catalog-subscription-plan-variation.md deleted file mode 100644 index 1084c11c8..000000000 --- a/doc/models/catalog-subscription-plan-variation.md +++ /dev/null @@ -1,56 +0,0 @@ - -# 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 - -`Catalog Subscription Plan Variation` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | Required | The name of the plan variation. | -| `phases` | [`Array`](../../doc/models/subscription-phase.md) | Required | A list containing each [SubscriptionPhase](entity:SubscriptionPhase) for this plan variation. | -| `subscription_plan_id` | `String` | Optional | The id of the subscription plan, if there is one. | -| `monthly_billing_anchor_date` | `Integer` | Optional | The day of the month the billing period starts.
**Constraints**: `>= 1`, `<= 31` | -| `can_prorate` | `TrueClass \| FalseClass` | Optional | Whether bills for this plan variation can be split for proration. | -| `successor_plan_variation_id` | `String` | 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/doc/models/catalog-subscription-plan.md b/doc/models/catalog-subscription-plan.md deleted file mode 100644 index 29bff85c6..000000000 --- a/doc/models/catalog-subscription-plan.md +++ /dev/null @@ -1,194 +0,0 @@ - -# 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 - -`Catalog Subscription Plan` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | Required | The name of the plan. | -| `phases` | [`Array`](../../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 | -| `subscription_plan_variations` | [`Array`](../../doc/models/catalog-object.md) | Optional | The list of subscription plan variations available for this product | -| `eligible_item_ids` | `Array` | Optional | The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's variations. | -| `eligible_category_ids` | `Array` | Optional | The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's variations. | -| `all_items` | `TrueClass \| FalseClass` | 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/doc/models/catalog-tax.md b/doc/models/catalog-tax.md deleted file mode 100644 index a25a0b1fa..000000000 --- a/doc/models/catalog-tax.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Catalog Tax - -A tax applicable to an item. - -## Structure - -`Catalog Tax` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | 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` | -| `calculation_phase` | [`String (Tax Calculation Phase)`](../../doc/models/tax-calculation-phase.md) | Optional | When to calculate the taxes due on a cart. | -| `inclusion_type` | [`String (Tax Inclusion Type)`](../../doc/models/tax-inclusion-type.md) | Optional | Whether to the tax amount should be additional to or included in the CatalogItem price. | -| `percentage` | `String` | 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. | -| `applies_to_custom_amounts` | `TrueClass \| FalseClass` | 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` | `TrueClass \| FalseClass` | Optional | A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of Sale app or not (`false`). | -| `applies_to_product_set_id` | `String` | 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/doc/models/catalog-time-period.md b/doc/models/catalog-time-period.md deleted file mode 100644 index baf3055a8..000000000 --- a/doc/models/catalog-time-period.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Catalog Time Period - -Represents a time period - either a single period or a repeating period. - -## Structure - -`Catalog Time Period` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `event` | `String` | 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/doc/models/catalog-v1-id.md b/doc/models/catalog-v1-id.md deleted file mode 100644 index 6a8af3d29..000000000 --- a/doc/models/catalog-v1-id.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Catalog V1 Id - -A Square API V1 identifier of an item, including the object ID and its associated location ID. - -## Structure - -`Catalog V1 Id` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `catalog_v1_id` | `String` | Optional | The ID for an object used in the Square API V1, if the object ID differs from the Square API V2 object ID. | -| `location_id` | `String` | 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/doc/models/category-path-to-root-node.md b/doc/models/category-path-to-root-node.md deleted file mode 100644 index 680681514..000000000 --- a/doc/models/category-path-to-root-node.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Category Path to Root Node - -A node in the path from a retrieved category to its root node. - -## Structure - -`Category Path to Root Node` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `category_id` | `String` | Optional | The category's ID. | -| `category_name` | `String` | Optional | The category's name. | - -## Example (as JSON) - -```json -{ - "category_id": "category_id0", - "category_name": "category_name0" -} -``` - diff --git a/doc/models/change-billing-anchor-date-request.md b/doc/models/change-billing-anchor-date-request.md deleted file mode 100644 index a7d93ab2b..000000000 --- a/doc/models/change-billing-anchor-date-request.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Change Billing Anchor Date Request - -Defines input parameters in a request to the -[ChangeBillingAnchorDate](../../doc/api/subscriptions.md#change-billing-anchor-date) endpoint. - -## Structure - -`Change Billing Anchor Date Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `monthly_billing_anchor_date` | `Integer` | Optional | The anchor day for the billing cycle.
**Constraints**: `>= 1`, `<= 31` | -| `effective_date` | `String` | 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/doc/models/change-billing-anchor-date-response.md b/doc/models/change-billing-anchor-date-response.md deleted file mode 100644 index 739583983..000000000 --- a/doc/models/change-billing-anchor-date-response.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Change Billing Anchor Date Response - -Defines output parameters in a request to the -[ChangeBillingAnchorDate](../../doc/api/subscriptions.md#change-billing-anchor-date) endpoint. - -## Structure - -`Change Billing Anchor Date Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered during the request. | -| `subscription` | [`Subscription Hash`](../../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` | [`Array`](../../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/doc/models/change-timing.md b/doc/models/change-timing.md deleted file mode 100644 index 1c55f966e..000000000 --- a/doc/models/change-timing.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Change Timing - -Supported timings when a pending change, as an action, takes place to a subscription. - -## Enumeration - -`Change Timing` - -## 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/doc/models/charge-request-additional-recipient.md b/doc/models/charge-request-additional-recipient.md deleted file mode 100644 index edc0f242a..000000000 --- a/doc/models/charge-request-additional-recipient.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 - -`Charge Request Additional Recipient` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `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` | -| `amount_money` | [`Money Hash`](../../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/doc/models/charge-request.md b/doc/models/charge-request.md deleted file mode 100644 index 7b02d725d..000000000 --- a/doc/models/charge-request.md +++ /dev/null @@ -1,73 +0,0 @@ - -# 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 - -`Charge Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `amount_money` | [`Money Hash`](../../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. | -| `card_nonce` | `String` | 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` | -| `customer_card_id` | `String` | 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` | -| `delay_capture` | `TrueClass \| FalseClass` | 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` | -| `reference_id` | `String` | 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` | Optional | An optional note to associate with the transaction.

This value cannot exceed 60 characters.
**Constraints**: *Maximum Length*: `60` | -| `customer_id` | `String` | 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` | -| `billing_address` | [`Address Hash`](../../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). | -| `shipping_address` | [`Address Hash`](../../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). | -| `buyer_email_address` | `String` | 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. | -| `order_id` | `String` | 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` | -| `additional_recipients` | [`Array`](../../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. | -| `verification_token` | `String` | 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/doc/models/charge-response.md b/doc/models/charge-response.md deleted file mode 100644 index 509da902d..000000000 --- a/doc/models/charge-response.md +++ /dev/null @@ -1,187 +0,0 @@ - -# 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 - -`Charge Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `transaction` | [`Transaction Hash`](../../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/doc/models/checkout-location-settings-branding-button-shape.md b/doc/models/checkout-location-settings-branding-button-shape.md deleted file mode 100644 index 9fdf539c3..000000000 --- a/doc/models/checkout-location-settings-branding-button-shape.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Checkout Location Settings Branding Button Shape - -## Enumeration - -`Checkout Location Settings Branding Button Shape` - -## Fields - -| Name | -| --- | -| `SQUARED` | -| `ROUNDED` | -| `PILL` | - diff --git a/doc/models/checkout-location-settings-branding-header-type.md b/doc/models/checkout-location-settings-branding-header-type.md deleted file mode 100644 index fe288e95f..000000000 --- a/doc/models/checkout-location-settings-branding-header-type.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Checkout Location Settings Branding Header Type - -## Enumeration - -`Checkout Location Settings Branding Header Type` - -## Fields - -| Name | -| --- | -| `BUSINESS_NAME` | -| `FRAMED_LOGO` | -| `FULL_WIDTH_LOGO` | - diff --git a/doc/models/checkout-location-settings-branding.md b/doc/models/checkout-location-settings-branding.md deleted file mode 100644 index 8b4046247..000000000 --- a/doc/models/checkout-location-settings-branding.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Checkout Location Settings Branding - -## Structure - -`Checkout Location Settings Branding` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `header_type` | [`String (Checkout Location Settings Branding Header Type)`](../../doc/models/checkout-location-settings-branding-header-type.md) | Optional | - | -| `button_color` | `String` | Optional | The HTML-supported hex color for the button on the checkout page (for example, "#FFFFFF").
**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7` | -| `button_shape` | [`String (Checkout Location Settings Branding Button Shape)`](../../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/doc/models/checkout-location-settings-coupons.md b/doc/models/checkout-location-settings-coupons.md deleted file mode 100644 index ae45d0a12..000000000 --- a/doc/models/checkout-location-settings-coupons.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Checkout Location Settings Coupons - -## Structure - -`Checkout Location Settings Coupons` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `enabled` | `TrueClass \| FalseClass` | Optional | Indicates whether coupons are enabled for this location. | - -## Example (as JSON) - -```json -{ - "enabled": false -} -``` - diff --git a/doc/models/checkout-location-settings-policy.md b/doc/models/checkout-location-settings-policy.md deleted file mode 100644 index 85cdc9bb1..000000000 --- a/doc/models/checkout-location-settings-policy.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Checkout Location Settings Policy - -## Structure - -`Checkout Location Settings Policy` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | 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` | 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` | Optional | The description of the policy.
**Constraints**: *Maximum Length*: `4096` | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "title": "title6", - "description": "description0" -} -``` - diff --git a/doc/models/checkout-location-settings-tipping.md b/doc/models/checkout-location-settings-tipping.md deleted file mode 100644 index a137891de..000000000 --- a/doc/models/checkout-location-settings-tipping.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Checkout Location Settings Tipping - -## Structure - -`Checkout Location Settings Tipping` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `percentages` | `Array` | 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. | -| `smart_tipping_enabled` | `TrueClass \| FalseClass` | 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. | -| `default_percent` | `Integer` | 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. | -| `smart_tips` | [`Array`](../../doc/models/money.md) | Optional | Show the Smart Tip Amounts for this location. | -| `default_smart_tip` | [`Money Hash`](../../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/doc/models/checkout-location-settings.md b/doc/models/checkout-location-settings.md deleted file mode 100644 index 8ae0f5539..000000000 --- a/doc/models/checkout-location-settings.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Checkout Location Settings - -## Structure - -`Checkout Location Settings` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Optional | The ID of the location that these settings apply to. | -| `customer_notes_enabled` | `TrueClass \| FalseClass` | Optional | Indicates whether customers are allowed to leave notes at checkout. | -| `policies` | [`Array`](../../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` | [`Checkout Location Settings Branding Hash`](../../doc/models/checkout-location-settings-branding.md) | Optional | - | -| `tipping` | [`Checkout Location Settings Tipping Hash`](../../doc/models/checkout-location-settings-tipping.md) | Optional | - | -| `coupons` | [`Checkout Location Settings Coupons Hash`](../../doc/models/checkout-location-settings-coupons.md) | Optional | - | -| `updated_at` | `String` | 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/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md b/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md deleted file mode 100644 index e25dd6d4d..000000000 --- a/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range - -A range of purchase price that qualifies. - -## Structure - -`Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `min` | [`Money Hash`](../../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 Hash`](../../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/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md b/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md deleted file mode 100644 index 0c9905d77..000000000 --- a/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Checkout Merchant Settings Payment Methods Afterpay Clearpay - -The settings allowed for AfterpayClearpay. - -## Structure - -`Checkout Merchant Settings Payment Methods Afterpay Clearpay` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_eligibility_range` | [`Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range Hash`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md) | Optional | A range of purchase price that qualifies. | -| `item_eligibility_range` | [`Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range Hash`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md) | Optional | A range of purchase price that qualifies. | -| `enabled` | `TrueClass \| FalseClass` | 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/doc/models/checkout-merchant-settings-payment-methods-payment-method.md b/doc/models/checkout-merchant-settings-payment-methods-payment-method.md deleted file mode 100644 index e1cfa5644..000000000 --- a/doc/models/checkout-merchant-settings-payment-methods-payment-method.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Checkout Merchant Settings Payment Methods Payment Method - -The settings allowed for a payment method. - -## Structure - -`Checkout Merchant Settings Payment Methods Payment Method` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `enabled` | `TrueClass \| FalseClass` | Optional | Indicates whether the payment method is enabled for the account. | - -## Example (as JSON) - -```json -{ - "enabled": false -} -``` - diff --git a/doc/models/checkout-merchant-settings-payment-methods.md b/doc/models/checkout-merchant-settings-payment-methods.md deleted file mode 100644 index ee5e43a13..000000000 --- a/doc/models/checkout-merchant-settings-payment-methods.md +++ /dev/null @@ -1,55 +0,0 @@ - -# Checkout Merchant Settings Payment Methods - -## Structure - -`Checkout Merchant Settings Payment Methods` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `apple_pay` | [`Checkout Merchant Settings Payment Methods Payment Method Hash`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | -| `google_pay` | [`Checkout Merchant Settings Payment Methods Payment Method Hash`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | -| `cash_app` | [`Checkout Merchant Settings Payment Methods Payment Method Hash`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | -| `afterpay_clearpay` | [`Checkout Merchant Settings Payment Methods Afterpay Clearpay Hash`](../../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/doc/models/checkout-merchant-settings.md b/doc/models/checkout-merchant-settings.md deleted file mode 100644 index 8c6566693..000000000 --- a/doc/models/checkout-merchant-settings.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Checkout Merchant Settings - -## Structure - -`Checkout Merchant Settings` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_methods` | [`Checkout Merchant Settings Payment Methods Hash`](../../doc/models/checkout-merchant-settings-payment-methods.md) | Optional | - | -| `updated_at` | `String` | 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/doc/models/checkout-options-payment-type.md b/doc/models/checkout-options-payment-type.md deleted file mode 100644 index a19e00a9b..000000000 --- a/doc/models/checkout-options-payment-type.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Checkout Options Payment Type - -## Enumeration - -`Checkout Options Payment Type` - -## 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/doc/models/checkout-options.md b/doc/models/checkout-options.md deleted file mode 100644 index e78a9fff6..000000000 --- a/doc/models/checkout-options.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Checkout Options - -## Structure - -`Checkout Options` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `allow_tipping` | `TrueClass \| FalseClass` | Optional | Indicates whether the payment allows tipping. | -| `custom_fields` | [`Array`](../../doc/models/custom-field.md) | Optional | The custom fields requesting information from the buyer. | -| `subscription_plan_id` | `String` | 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` | -| `redirect_url` | `String` | Optional | The confirmation page URL to redirect the buyer to after Square processes the payment.
**Constraints**: *Maximum Length*: `2048` | -| `merchant_support_email` | `String` | Optional | The email address that buyers can use to contact the seller.
**Constraints**: *Maximum Length*: `256` | -| `ask_for_shipping_address` | `TrueClass \| FalseClass` | Optional | Indicates whether to include the address fields in the payment form. | -| `accepted_payment_methods` | [`Accepted Payment Methods Hash`](../../doc/models/accepted-payment-methods.md) | Optional | - | -| `app_fee_money` | [`Money Hash`](../../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. | -| `shipping_fee` | [`Shipping Fee Hash`](../../doc/models/shipping-fee.md) | Optional | - | -| `enable_coupon` | `TrueClass \| FalseClass` | Optional | Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing coupon in the payment form. | -| `enable_loyalty` | `TrueClass \| FalseClass` | 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/doc/models/checkout.md b/doc/models/checkout.md deleted file mode 100644 index 52884d469..000000000 --- a/doc/models/checkout.md +++ /dev/null @@ -1,37 +0,0 @@ - -# 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` | Optional | ID generated by Square Checkout when a new checkout is requested. | -| `checkout_page_url` | `String` | Optional | The URL that the buyer's browser should be redirected to after the
checkout is completed. | -| `ask_for_shipping_address` | `TrueClass \| FalseClass` | 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`. | -| `merchant_support_email` | `String` | 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. | -| `pre_populate_buyer_email` | `String` | 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. | -| `pre_populate_shipping_address` | [`Address Hash`](../../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). | -| `redirect_url` | `String` | 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 Hash`](../../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. | -| `created_at` | `String` | Optional | The time when the checkout was created, in RFC 3339 format. | -| `additional_recipients` | [`Array`](../../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/doc/models/clearpay-details.md b/doc/models/clearpay-details.md deleted file mode 100644 index f8dc5105f..000000000 --- a/doc/models/clearpay-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Clearpay Details - -Additional details about Clearpay payments. - -## Structure - -`Clearpay Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `email_address` | `String` | Optional | Email address on the buyer's Clearpay account.
**Constraints**: *Maximum Length*: `255` | - -## Example (as JSON) - -```json -{ - "email_address": "email_address6" -} -``` - diff --git a/doc/models/clone-order-request.md b/doc/models/clone-order-request.md deleted file mode 100644 index 5221ac7a9..000000000 --- a/doc/models/clone-order-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Clone Order Request - -Defines the fields that are included in requests to the -[CloneOrder](../../doc/api/orders.md#clone-order) endpoint. - -## Structure - -`Clone Order Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Required | The ID of the order to clone. | -| `version` | `Integer` | 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. | -| `idempotency_key` | `String` | 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/doc/models/clone-order-response.md b/doc/models/clone-order-response.md deleted file mode 100644 index 9406aeedd..000000000 --- a/doc/models/clone-order-response.md +++ /dev/null @@ -1,333 +0,0 @@ - -# 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 - -`Clone Order Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order` | [`Order Hash`](../../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` | [`Array`](../../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/doc/models/collected-data.md b/doc/models/collected-data.md deleted file mode 100644 index 8edbbbd60..000000000 --- a/doc/models/collected-data.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Collected Data - -## Structure - -`Collected Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `input_text` | `String` | Optional | The buyer's input text. | - -## Example (as JSON) - -```json -{ - "input_text": "input_text8" -} -``` - diff --git a/doc/models/complete-payment-request.md b/doc/models/complete-payment-request.md deleted file mode 100644 index 1a1c8ca03..000000000 --- a/doc/models/complete-payment-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# 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 - -`Complete Payment Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version_token` | `String` | 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/doc/models/complete-payment-response.md b/doc/models/complete-payment-response.md deleted file mode 100644 index e549a06ba..000000000 --- a/doc/models/complete-payment-response.md +++ /dev/null @@ -1,107 +0,0 @@ - -# Complete Payment Response - -Defines the response returned by[CompletePayment](../../doc/api/payments.md#complete-payment). - -## Structure - -`Complete Payment Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `payment` | [`Payment Hash`](../../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/doc/models/component-component-type.md b/doc/models/component-component-type.md deleted file mode 100644 index 5534bb337..000000000 --- a/doc/models/component-component-type.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Component Component Type - -An enum for ComponentType. - -## Enumeration - -`Component Component Type` - -## Fields - -| Name | -| --- | -| `APPLICATION` | -| `CARD_READER` | -| `BATTERY` | -| `WIFI` | -| `ETHERNET` | -| `PRINTER` | - diff --git a/doc/models/component.md b/doc/models/component.md deleted file mode 100644 index 37e0f6038..000000000 --- a/doc/models/component.md +++ /dev/null @@ -1,54 +0,0 @@ - -# Component - -The wrapper object for the component entries of a given component type. - -## Structure - -`Component` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | [`String (Component Component Type)`](../../doc/models/component-component-type.md) | Required | An enum for ComponentType. | -| `application_details` | [`Device Component Details Application Details Hash`](../../doc/models/device-component-details-application-details.md) | Optional | - | -| `card_reader_details` | [`Device Component Details Card Reader Details Hash`](../../doc/models/device-component-details-card-reader-details.md) | Optional | - | -| `battery_details` | [`Device Component Details Battery Details Hash`](../../doc/models/device-component-details-battery-details.md) | Optional | - | -| `wifi_details` | [`Device Component Details Wi Fi Details Hash`](../../doc/models/device-component-details-wi-fi-details.md) | Optional | - | -| `ethernet_details` | [`Device Component Details Ethernet Details Hash`](../../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/doc/models/confirmation-decision.md b/doc/models/confirmation-decision.md deleted file mode 100644 index 26cca3c75..000000000 --- a/doc/models/confirmation-decision.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Confirmation Decision - -## Structure - -`Confirmation Decision` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `has_agreed` | `TrueClass \| FalseClass` | Optional | The buyer's decision to the displayed terms. | - -## Example (as JSON) - -```json -{ - "has_agreed": false -} -``` - diff --git a/doc/models/confirmation-options.md b/doc/models/confirmation-options.md deleted file mode 100644 index b9438d0ac..000000000 --- a/doc/models/confirmation-options.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Confirmation Options - -## Structure - -`Confirmation Options` - -## 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` | -| `agree_button_text` | `String` | Required | The button text to display indicating the customer agrees to the displayed terms.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | -| `disagree_button_text` | `String` | Optional | The button text to display indicating the customer does not agree to the displayed terms.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | -| `decision` | [`Confirmation Decision Hash`](../../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/doc/models/coordinates.md b/doc/models/coordinates.md deleted file mode 100644 index 3f0ccb82e..000000000 --- a/doc/models/coordinates.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Coordinates - -Latitude and longitude coordinates. - -## Structure - -`Coordinates` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `latitude` | `Float` | Optional | The latitude of the coordinate expressed in degrees. | -| `longitude` | `Float` | Optional | The longitude of the coordinate expressed in degrees. | - -## Example (as JSON) - -```json -{ - "latitude": 200.94, - "longitude": 52.86 -} -``` - diff --git a/doc/models/country.md b/doc/models/country.md deleted file mode 100644 index 39422596f..000000000 --- a/doc/models/country.md +++ /dev/null @@ -1,265 +0,0 @@ - -# 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/doc/models/create-booking-custom-attribute-definition-request.md b/doc/models/create-booking-custom-attribute-definition-request.md deleted file mode 100644 index 7548c4f22..000000000 --- a/doc/models/create-booking-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Booking Custom Attribute Definition Request - -Represents a [CreateBookingCustomAttributeDefinition](../../doc/api/booking-custom-attributes.md#create-booking-custom-attribute-definition) request. - -## Structure - -`Create Booking Custom Attribute Definition Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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. | -| `idempotency_key` | `String` | 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/doc/models/create-booking-custom-attribute-definition-response.md b/doc/models/create-booking-custom-attribute-definition-response.md deleted file mode 100644 index 303745386..000000000 --- a/doc/models/create-booking-custom-attribute-definition-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# 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 - -`Create Booking Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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` | [`Array`](../../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/doc/models/create-booking-request.md b/doc/models/create-booking-request.md deleted file mode 100644 index 0ba8944c5..000000000 --- a/doc/models/create-booking-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Create Booking Request - -## Structure - -`Create Booking Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | Optional | A unique key to make this request an idempotent operation.
**Constraints**: *Maximum Length*: `255` | -| `booking` | [`Booking Hash`](../../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/doc/models/create-booking-response.md b/doc/models/create-booking-response.md deleted file mode 100644 index 37893a315..000000000 --- a/doc/models/create-booking-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Create Booking Response - -## Structure - -`Create Booking Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking` | [`Booking Hash`](../../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` | [`Array`](../../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/doc/models/create-break-type-request.md b/doc/models/create-break-type-request.md deleted file mode 100644 index 8145bcd25..000000000 --- a/doc/models/create-break-type-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Break Type Request - -A request to create a new `BreakType`. - -## Structure - -`Create Break Type Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | Optional | A unique string value to ensure the idempotency of the operation.
**Constraints**: *Maximum Length*: `128` | -| `break_type` | [`Break Type Hash`](../../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/doc/models/create-break-type-response.md b/doc/models/create-break-type-response.md deleted file mode 100644 index 61b3c24f3..000000000 --- a/doc/models/create-break-type-response.md +++ /dev/null @@ -1,55 +0,0 @@ - -# 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 - -`Create Break Type Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `break_type` | [`Break Type Hash`](../../doc/models/break-type.md) | Optional | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | -| `errors` | [`Array`](../../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/doc/models/create-card-request.md b/doc/models/create-card-request.md deleted file mode 100644 index d0ebb6281..000000000 --- a/doc/models/create-card-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# 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 - -`Create Card Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `source_id` | `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` | -| `verification_token` | `String` | 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 Hash`](../../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/doc/models/create-card-response.md b/doc/models/create-card-response.md deleted file mode 100644 index 9799e1af3..000000000 --- a/doc/models/create-card-response.md +++ /dev/null @@ -1,72 +0,0 @@ - -# 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 - -`Create Card Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors resulting from the request. | -| `card` | [`Card Hash`](../../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/doc/models/create-catalog-image-request.md b/doc/models/create-catalog-image-request.md deleted file mode 100644 index 33a3cb3e3..000000000 --- a/doc/models/create-catalog-image-request.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Create Catalog Image Request - -## Structure - -`Create Catalog Image Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `object_id` | `String` | 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` | [`Catalog Object Hash`](../../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. | -| `is_primary` | `TrueClass \| FalseClass` | 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/doc/models/create-catalog-image-response.md b/doc/models/create-catalog-image-response.md deleted file mode 100644 index ecfa5be32..000000000 --- a/doc/models/create-catalog-image-response.md +++ /dev/null @@ -1,70 +0,0 @@ - -# Create Catalog Image Response - -## Structure - -`Create Catalog Image Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `image` | [`Catalog Object Hash`](../../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/doc/models/create-checkout-request.md b/doc/models/create-checkout-request.md deleted file mode 100644 index 3ec7f560a..000000000 --- a/doc/models/create-checkout-request.md +++ /dev/null @@ -1,179 +0,0 @@ - -# Create Checkout Request - -Defines the parameters that can be included in the body of -a request to the `CreateCheckout` endpoint. - -## Structure - -`Create Checkout Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | [`Create Order Request Hash`](../../doc/models/create-order-request.md) | Required | - | -| `ask_for_shipping_address` | `TrueClass \| FalseClass` | 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`. | -| `merchant_support_email` | `String` | 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` | -| `pre_populate_buyer_email` | `String` | 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` | -| `pre_populate_shipping_address` | [`Address Hash`](../../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). | -| `redirect_url` | `String` | 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` | -| `additional_recipients` | [`Array`](../../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` | 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/doc/models/create-checkout-response.md b/doc/models/create-checkout-response.md deleted file mode 100644 index 00ba7e0f2..000000000 --- a/doc/models/create-checkout-response.md +++ /dev/null @@ -1,172 +0,0 @@ - -# Create Checkout Response - -Defines the fields that are included in the response body of -a request to the `CreateCheckout` endpoint. - -## Structure - -`Create Checkout Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `checkout` | [`Checkout Hash`](../../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` | [`Array`](../../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/doc/models/create-customer-card-request.md b/doc/models/create-customer-card-request.md deleted file mode 100644 index 346ca14b4..000000000 --- a/doc/models/create-customer-card-request.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Create Customer Card Request - -Defines the fields that are included in the request body of a request -to the `CreateCustomerCard` endpoint. - -## Structure - -`Create Customer Card Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `card_nonce` | `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. | -| `billing_address` | [`Address Hash`](../../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). | -| `cardholder_name` | `String` | Optional | The full name printed on the credit card. | -| `verification_token` | `String` | 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/doc/models/create-customer-card-response.md b/doc/models/create-customer-card-response.md deleted file mode 100644 index 33806d32d..000000000 --- a/doc/models/create-customer-card-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# 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 - -`Create Customer Card Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `card` | [`Card Hash`](../../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/doc/models/create-customer-custom-attribute-definition-request.md b/doc/models/create-customer-custom-attribute-definition-request.md deleted file mode 100644 index 5cfeefd0a..000000000 --- a/doc/models/create-customer-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Customer Custom Attribute Definition Request - -Represents a [CreateCustomerCustomAttributeDefinition](../../doc/api/customer-custom-attributes.md#create-customer-custom-attribute-definition) request. - -## Structure - -`Create Customer Custom Attribute Definition Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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. | -| `idempotency_key` | `String` | 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/doc/models/create-customer-custom-attribute-definition-response.md b/doc/models/create-customer-custom-attribute-definition-response.md deleted file mode 100644 index 7b8887ec7..000000000 --- a/doc/models/create-customer-custom-attribute-definition-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# 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 - -`Create Customer Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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` | [`Array`](../../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/doc/models/create-customer-group-request.md b/doc/models/create-customer-group-request.md deleted file mode 100644 index 81310c862..000000000 --- a/doc/models/create-customer-group-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 - -`Create Customer Group Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | Optional | The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). | -| `group` | [`Customer Group Hash`](../../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/doc/models/create-customer-group-response.md b/doc/models/create-customer-group-response.md deleted file mode 100644 index 0a1e67b9e..000000000 --- a/doc/models/create-customer-group-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# 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 - -`Create Customer Group Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `group` | [`Customer Group Hash`](../../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/doc/models/create-customer-request.md b/doc/models/create-customer-request.md deleted file mode 100644 index 509c4c531..000000000 --- a/doc/models/create-customer-request.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Create Customer Request - -Defines the body parameters that can be included in a request to the -`CreateCustomer` endpoint. - -## Structure - -`Create Customer Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | Optional | The idempotency key for the request. For more information, see
[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). | -| `given_name` | `String` | Optional | The given name (that is, the first name) associated with the customer profile.

The maximum length for this value is 300 characters. | -| `family_name` | `String` | Optional | The family name (that is, the last name) associated with the customer profile.

The maximum length for this value is 300 characters. | -| `company_name` | `String` | Optional | A business name associated with the customer profile.

The maximum length for this value is 500 characters. | -| `nickname` | `String` | Optional | A nickname for the customer profile.

The maximum length for this value is 100 characters. | -| `email_address` | `String` | Optional | The email address associated with the customer profile.

The maximum length for this value is 254 characters. | -| `address` | [`Address Hash`](../../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). | -| `phone_number` | `String` | 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). | -| `reference_id` | `String` | 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` | Optional | A custom note associated with the customer profile. | -| `birthday` | `String` | 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. | -| `tax_ids` | [`Customer Tax Ids Hash`](../../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/doc/models/create-customer-response.md b/doc/models/create-customer-response.md deleted file mode 100644 index 252a0cade..000000000 --- a/doc/models/create-customer-response.md +++ /dev/null @@ -1,68 +0,0 @@ - -# 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 - -`Create Customer Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `customer` | [`Customer Hash`](../../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/doc/models/create-device-code-request.md b/doc/models/create-device-code-request.md deleted file mode 100644 index 5d62fc90d..000000000 --- a/doc/models/create-device-code-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Create Device Code Request - -## Structure - -`Create Device Code Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `device_code` | [`Device Code Hash`](../../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/doc/models/create-device-code-response.md b/doc/models/create-device-code-response.md deleted file mode 100644 index b5ebafc1e..000000000 --- a/doc/models/create-device-code-response.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Create Device Code Response - -## Structure - -`Create Device Code Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `device_code` | [`Device Code Hash`](../../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/doc/models/create-dispute-evidence-file-request.md b/doc/models/create-dispute-evidence-file-request.md deleted file mode 100644 index 5e8ed47a4..000000000 --- a/doc/models/create-dispute-evidence-file-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Create Dispute Evidence File Request - -Defines the parameters for a `CreateDisputeEvidenceFile` request. - -## Structure - -`Create Dispute Evidence File Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `evidence_type` | [`String (Dispute Evidence Type)`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | -| `content_type` | `String` | 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/doc/models/create-dispute-evidence-file-response.md b/doc/models/create-dispute-evidence-file-response.md deleted file mode 100644 index 86f9bdee9..000000000 --- a/doc/models/create-dispute-evidence-file-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Create Dispute Evidence File Response - -Defines the fields in a `CreateDisputeEvidenceFile` response. - -## Structure - -`Create Dispute Evidence File Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `evidence` | [`Dispute Evidence Hash`](../../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/doc/models/create-dispute-evidence-text-request.md b/doc/models/create-dispute-evidence-text-request.md deleted file mode 100644 index a466042db..000000000 --- a/doc/models/create-dispute-evidence-text-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Create Dispute Evidence Text Request - -Defines the parameters for a `CreateDisputeEvidenceText` request. - -## Structure - -`Create Dispute Evidence Text Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `evidence_type` | [`String (Dispute Evidence Type)`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | -| `evidence_text` | `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/doc/models/create-dispute-evidence-text-response.md b/doc/models/create-dispute-evidence-text-response.md deleted file mode 100644 index 8e983b4e0..000000000 --- a/doc/models/create-dispute-evidence-text-response.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Create Dispute Evidence Text Response - -Defines the fields in a `CreateDisputeEvidenceText` response. - -## Structure - -`Create Dispute Evidence Text Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `evidence` | [`Dispute Evidence Hash`](../../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/doc/models/create-gift-card-activity-request.md b/doc/models/create-gift-card-activity-request.md deleted file mode 100644 index 312f340cf..000000000 --- a/doc/models/create-gift-card-activity-request.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create Gift Card Activity Request - -A request to create a gift card activity. - -## Structure - -`Create Gift Card Activity Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | Required | A unique string that identifies the `CreateGiftCardActivity` request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | -| `gift_card_activity` | [`Gift Card Activity Hash`](../../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/doc/models/create-gift-card-activity-response.md b/doc/models/create-gift-card-activity-response.md deleted file mode 100644 index 4010ee3a2..000000000 --- a/doc/models/create-gift-card-activity-response.md +++ /dev/null @@ -1,58 +0,0 @@ - -# 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 - -`Create Gift Card Activity Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `gift_card_activity` | [`Gift Card Activity Hash`](../../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/doc/models/create-gift-card-request.md b/doc/models/create-gift-card-request.md deleted file mode 100644 index 5894c4643..000000000 --- a/doc/models/create-gift-card-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Create Gift Card Request - -Represents a [CreateGiftCard](../../doc/api/gift-cards.md#create-gift-card) request. - -## Structure - -`Create Gift Card Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `location_id` | `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` | -| `gift_card` | [`Gift Card Hash`](../../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/doc/models/create-gift-card-response.md b/doc/models/create-gift-card-response.md deleted file mode 100644 index 399833417..000000000 --- a/doc/models/create-gift-card-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# 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 - -`Create Gift Card Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `gift_card` | [`Gift Card Hash`](../../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/doc/models/create-invoice-attachment-request.md b/doc/models/create-invoice-attachment-request.md deleted file mode 100644 index 9f9a0f637..000000000 --- a/doc/models/create-invoice-attachment-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Create Invoice Attachment Request - -Represents a [CreateInvoiceAttachment](../../doc/api/invoices.md#create-invoice-attachment) request. - -## Structure - -`Create Invoice Attachment Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | 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` | 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/doc/models/create-invoice-attachment-response.md b/doc/models/create-invoice-attachment-response.md deleted file mode 100644 index 030dcdc08..000000000 --- a/doc/models/create-invoice-attachment-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Create Invoice Attachment Response - -Represents a [CreateInvoiceAttachment](../../doc/api/invoices.md#create-invoice-attachment) response. - -## Structure - -`Create Invoice Attachment Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `attachment` | [`Invoice Attachment Hash`](../../doc/models/invoice-attachment.md) | Optional | Represents a file attached to an [invoice](../../doc/models/invoice.md). | -| `errors` | [`Array`](../../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/doc/models/create-invoice-request.md b/doc/models/create-invoice-request.md deleted file mode 100644 index 530742a98..000000000 --- a/doc/models/create-invoice-request.md +++ /dev/null @@ -1,83 +0,0 @@ - -# Create Invoice Request - -Describes a `CreateInvoice` request. - -## Structure - -`Create Invoice Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice` | [`Invoice Hash`](../../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). | -| `idempotency_key` | `String` | 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/doc/models/create-invoice-response.md b/doc/models/create-invoice-response.md deleted file mode 100644 index 54fcd7f9a..000000000 --- a/doc/models/create-invoice-response.md +++ /dev/null @@ -1,106 +0,0 @@ - -# Create Invoice Response - -The response returned by the `CreateInvoice` request. - -## Structure - -`Create Invoice Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice` | [`Invoice Hash`](../../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` | [`Array`](../../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/doc/models/create-job-request.md b/doc/models/create-job-request.md deleted file mode 100644 index 51a0a1c68..000000000 --- a/doc/models/create-job-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Create Job Request - -Represents a [CreateJob](../../doc/api/team.md#create-job) request. - -## Structure - -`Create Job Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `job` | [`Job Hash`](../../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. | -| `idempotency_key` | `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/doc/models/create-job-response.md b/doc/models/create-job-response.md deleted file mode 100644 index 0bc30f1f2..000000000 --- a/doc/models/create-job-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create Job Response - -Represents a [CreateJob](../../doc/api/team.md#create-job) response. Either `job` or `errors` -is present in the response. - -## Structure - -`Create Job Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `job` | [`Job Hash`](../../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` | [`Array`](../../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/doc/models/create-location-custom-attribute-definition-request.md b/doc/models/create-location-custom-attribute-definition-request.md deleted file mode 100644 index deff5352f..000000000 --- a/doc/models/create-location-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Location Custom Attribute Definition Request - -Represents a [CreateLocationCustomAttributeDefinition](../../doc/api/location-custom-attributes.md#create-location-custom-attribute-definition) request. - -## Structure - -`Create Location Custom Attribute Definition Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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. | -| `idempotency_key` | `String` | 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/doc/models/create-location-custom-attribute-definition-response.md b/doc/models/create-location-custom-attribute-definition-response.md deleted file mode 100644 index c0d444b12..000000000 --- a/doc/models/create-location-custom-attribute-definition-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# 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 - -`Create Location Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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` | [`Array`](../../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/doc/models/create-location-request.md b/doc/models/create-location-request.md deleted file mode 100644 index 55f241827..000000000 --- a/doc/models/create-location-request.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create Location Request - -The request object for the [CreateLocation](../../doc/api/locations.md#create-location) endpoint. - -## Structure - -`Create Location Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location` | [`Location Hash`](../../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/doc/models/create-location-response.md b/doc/models/create-location-response.md deleted file mode 100644 index 65516560a..000000000 --- a/doc/models/create-location-response.md +++ /dev/null @@ -1,74 +0,0 @@ - -# Create Location Response - -The response object returned by the [CreateLocation](../../doc/api/locations.md#create-location) endpoint. - -## Structure - -`Create Location Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about [errors](https://developer.squareup.com/docs/build-basics/handling-errors) encountered during the request. | -| `location` | [`Location Hash`](../../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/doc/models/create-loyalty-account-request.md b/doc/models/create-loyalty-account-request.md deleted file mode 100644 index 5ce078a61..000000000 --- a/doc/models/create-loyalty-account-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Create Loyalty Account Request - -A request to create a new loyalty account. - -## Structure - -`Create Loyalty Account Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_account` | [`Loyalty Account Hash`](../../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). | -| `idempotency_key` | `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/doc/models/create-loyalty-account-response.md b/doc/models/create-loyalty-account-response.md deleted file mode 100644 index 2d650f05b..000000000 --- a/doc/models/create-loyalty-account-response.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Create Loyalty Account Response - -A response that includes loyalty account created. - -## Structure - -`Create Loyalty Account Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `loyalty_account` | [`Loyalty Account Hash`](../../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/doc/models/create-loyalty-promotion-request.md b/doc/models/create-loyalty-promotion-request.md deleted file mode 100644 index 750cce885..000000000 --- a/doc/models/create-loyalty-promotion-request.md +++ /dev/null @@ -1,59 +0,0 @@ - -# Create Loyalty Promotion Request - -Represents a [CreateLoyaltyPromotion](../../doc/api/loyalty.md#create-loyalty-promotion) request. - -## Structure - -`Create Loyalty Promotion Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_promotion` | [`Loyalty Promotion Hash`](../../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. | -| `idempotency_key` | `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/doc/models/create-loyalty-promotion-response.md b/doc/models/create-loyalty-promotion-response.md deleted file mode 100644 index fc8f34811..000000000 --- a/doc/models/create-loyalty-promotion-response.md +++ /dev/null @@ -1,75 +0,0 @@ - -# 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 - -`Create Loyalty Promotion Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `loyalty_promotion` | [`Loyalty Promotion Hash`](../../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/doc/models/create-loyalty-reward-request.md b/doc/models/create-loyalty-reward-request.md deleted file mode 100644 index cad40a62a..000000000 --- a/doc/models/create-loyalty-reward-request.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Create Loyalty Reward Request - -A request to create a loyalty reward. - -## Structure - -`Create Loyalty Reward Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `reward` | [`Loyalty Reward Hash`](../../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). | -| `idempotency_key` | `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/doc/models/create-loyalty-reward-response.md b/doc/models/create-loyalty-reward-response.md deleted file mode 100644 index c38f3f872..000000000 --- a/doc/models/create-loyalty-reward-response.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Create Loyalty Reward Response - -A response that includes the loyalty reward created. - -## Structure - -`Create Loyalty Reward Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `reward` | [`Loyalty Reward Hash`](../../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/doc/models/create-merchant-custom-attribute-definition-request.md b/doc/models/create-merchant-custom-attribute-definition-request.md deleted file mode 100644 index de77f8717..000000000 --- a/doc/models/create-merchant-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Merchant Custom Attribute Definition Request - -Represents a [CreateMerchantCustomAttributeDefinition](../../doc/api/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) request. - -## Structure - -`Create Merchant Custom Attribute Definition Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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. | -| `idempotency_key` | `String` | 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/doc/models/create-merchant-custom-attribute-definition-response.md b/doc/models/create-merchant-custom-attribute-definition-response.md deleted file mode 100644 index ce99fc68e..000000000 --- a/doc/models/create-merchant-custom-attribute-definition-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# 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 - -`Create Merchant Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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` | [`Array`](../../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/doc/models/create-mobile-authorization-code-request.md b/doc/models/create-mobile-authorization-code-request.md deleted file mode 100644 index e23b71510..000000000 --- a/doc/models/create-mobile-authorization-code-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Create Mobile Authorization Code Request - -Defines the body parameters that can be provided in a request to the -`CreateMobileAuthorizationCode` endpoint. - -## Structure - -`Create Mobile Authorization Code Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | 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/doc/models/create-mobile-authorization-code-response.md b/doc/models/create-mobile-authorization-code-response.md deleted file mode 100644 index 73f8d6234..000000000 --- a/doc/models/create-mobile-authorization-code-response.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Create Mobile Authorization Code Response - -Defines the fields that are included in the response body of -a request to the `CreateMobileAuthorizationCode` endpoint. - -## Structure - -`Create Mobile Authorization Code Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `authorization_code` | `String` | Optional | The generated authorization code that connects a mobile application instance
to a Square account.
**Constraints**: *Maximum Length*: `191` | -| `expires_at` | `String` | 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` | [`Array`](../../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/doc/models/create-order-custom-attribute-definition-request.md b/doc/models/create-order-custom-attribute-definition-request.md deleted file mode 100644 index dc46146a9..000000000 --- a/doc/models/create-order-custom-attribute-definition-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Order Custom Attribute Definition Request - -Represents a create request for an order custom attribute definition. - -## Structure - -`Create Order Custom Attribute Definition Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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. | -| `idempotency_key` | `String` | 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/doc/models/create-order-custom-attribute-definition-response.md b/doc/models/create-order-custom-attribute-definition-response.md deleted file mode 100644 index 3d3c927ed..000000000 --- a/doc/models/create-order-custom-attribute-definition-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Create Order Custom Attribute Definition Response - -Represents a response from creating an order custom attribute definition. - -## Structure - -`Create Order Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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` | [`Array`](../../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/doc/models/create-order-request.md b/doc/models/create-order-request.md deleted file mode 100644 index 87728aaf3..000000000 --- a/doc/models/create-order-request.md +++ /dev/null @@ -1,121 +0,0 @@ - -# Create Order Request - -## Structure - -`Create Order Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order` | [`Order Hash`](../../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. | -| `idempotency_key` | `String` | 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/doc/models/create-order-response.md b/doc/models/create-order-response.md deleted file mode 100644 index 4845c8782..000000000 --- a/doc/models/create-order-response.md +++ /dev/null @@ -1,329 +0,0 @@ - -# 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 - -`Create Order Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order` | [`Order Hash`](../../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` | [`Array`](../../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/doc/models/create-payment-link-request.md b/doc/models/create-payment-link-request.md deleted file mode 100644 index b964d90cd..000000000 --- a/doc/models/create-payment-link-request.md +++ /dev/null @@ -1,83 +0,0 @@ - -# Create Payment Link Request - -## Structure - -`Create Payment Link Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | 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` | 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` | -| `quick_pay` | [`Quick Pay Hash`](../../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 Hash`](../../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. | -| `checkout_options` | [`Checkout Options Hash`](../../doc/models/checkout-options.md) | Optional | - | -| `pre_populated_data` | [`Pre Populated Data Hash`](../../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). | -| `payment_note` | `String` | 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/doc/models/create-payment-link-response.md b/doc/models/create-payment-link-response.md deleted file mode 100644 index 2173d0020..000000000 --- a/doc/models/create-payment-link-response.md +++ /dev/null @@ -1,266 +0,0 @@ - -# Create Payment Link Response - -## Structure - -`Create Payment Link Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `payment_link` | [`Payment Link Hash`](../../doc/models/payment-link.md) | Optional | - | -| `related_resources` | [`Payment Link Related Resources Hash`](../../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/doc/models/create-payment-request.md b/doc/models/create-payment-request.md deleted file mode 100644 index e5f50e5fa..000000000 --- a/doc/models/create-payment-request.md +++ /dev/null @@ -1,68 +0,0 @@ - -# Create Payment Request - -Describes a request to create a payment using -[CreatePayment](../../doc/api/payments.md#create-payment). - -## Structure - -`Create Payment Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `source_id` | `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` | -| `idempotency_key` | `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` | -| `amount_money` | [`Money Hash`](../../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. | -| `tip_money` | [`Money Hash`](../../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. | -| `app_fee_money` | [`Money Hash`](../../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. | -| `delay_duration` | `String` | 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. | -| `delay_action` | `String` | 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` | `TrueClass \| FalseClass` | 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 | -| `order_id` | `String` | Optional | Associates a previously created order with this payment. | -| `customer_id` | `String` | 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. | -| `location_id` | `String` | 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. | -| `team_member_id` | `String` | Optional | An optional [TeamMember](entity:TeamMember) ID to associate with
this payment. | -| `reference_id` | `String` | 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` | -| `verification_token` | `String` | 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). | -| `accept_partial_authorization` | `TrueClass \| FalseClass` | 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 | -| `buyer_email_address` | `String` | Optional | The buyer's email address.
**Constraints**: *Maximum Length*: `255` | -| `buyer_phone_number` | `String` | 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. | -| `billing_address` | [`Address Hash`](../../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). | -| `shipping_address` | [`Address Hash`](../../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` | Optional | An optional note to be entered by the developer when creating a payment.
**Constraints**: *Maximum Length*: `500` | -| `statement_description_identifier` | `String` | 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` | -| `cash_details` | [`Cash Payment Details Hash`](../../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). | -| `external_details` | [`External Payment Details Hash`](../../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). | -| `customer_details` | [`Customer Details Hash`](../../doc/models/customer-details.md) | Optional | Details about the customer making the payment. | -| `offline_payment_details` | [`Offline Payment Details Hash`](../../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/doc/models/create-payment-response.md b/doc/models/create-payment-response.md deleted file mode 100644 index 132547cd5..000000000 --- a/doc/models/create-payment-response.md +++ /dev/null @@ -1,114 +0,0 @@ - -# 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 - -`Create Payment Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `payment` | [`Payment Hash`](../../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/doc/models/create-refund-request.md b/doc/models/create-refund-request.md deleted file mode 100644 index d61db9463..000000000 --- a/doc/models/create-refund-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# 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 - -`Create Refund Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `tender_id` | `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` | Optional | A description of the reason for the refund.

Default value: `Refund via API`
**Constraints**: *Maximum Length*: `192` | -| `amount_money` | [`Money Hash`](../../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/doc/models/create-refund-response.md b/doc/models/create-refund-response.md deleted file mode 100644 index ba158078e..000000000 --- a/doc/models/create-refund-response.md +++ /dev/null @@ -1,68 +0,0 @@ - -# 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 - -`Create Refund Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `refund` | [`Refund Hash`](../../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/doc/models/create-shift-request.md b/doc/models/create-shift-request.md deleted file mode 100644 index 8cbd32cd9..000000000 --- a/doc/models/create-shift-request.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Create Shift Request - -Represents a request to create a `Shift`. - -## Structure - -`Create Shift Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | Optional | A unique string value to ensure the idempotency of the operation.
**Constraints**: *Maximum Length*: `128` | -| `shift` | [`Shift Hash`](../../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/doc/models/create-shift-response.md b/doc/models/create-shift-response.md deleted file mode 100644 index 920f18689..000000000 --- a/doc/models/create-shift-response.md +++ /dev/null @@ -1,82 +0,0 @@ - -# 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 - -`Create Shift Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `shift` | [`Shift Hash`](../../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` | [`Array`](../../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/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md deleted file mode 100644 index 8822828a3..000000000 --- a/doc/models/create-subscription-request.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Create Subscription Request - -Defines input parameters in a request to the -[CreateSubscription](../../doc/api/subscriptions.md#create-subscription) endpoint. - -## Structure - -`Create Subscription Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | 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). | -| `location_id` | `String` | Required | The ID of the location the subscription is associated with.
**Constraints**: *Minimum Length*: `1` | -| `plan_variation_id` | `String` | 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. | -| `customer_id` | `String` | Required | The ID of the [customer](entity:Customer) subscribing to the subscription plan variation.
**Constraints**: *Minimum Length*: `1` | -| `start_date` | `String` | Optional | The `YYYY-MM-DD`-formatted date to start the subscription.
If it is unspecified, the subscription starts immediately. | -| `canceled_date` | `String` | 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. | -| `tax_percentage` | `String` | 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` | -| `price_override_money` | [`Money Hash`](../../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. | -| `card_id` | `String` | 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` | 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` | [`Subscription Source Hash`](../../doc/models/subscription-source.md) | Optional | The origination details of the subscription. | -| `monthly_billing_anchor_date` | `Integer` | Optional | The day-of-the-month to change the billing date to.
**Constraints**: `>= 1`, `<= 31` | -| `phases` | [`Array`](../../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/doc/models/create-subscription-response.md b/doc/models/create-subscription-response.md deleted file mode 100644 index 3aca1a2a6..000000000 --- a/doc/models/create-subscription-response.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Create Subscription Response - -Defines output parameters in a response from the -[CreateSubscription](../../doc/api/subscriptions.md#create-subscription) endpoint. - -## Structure - -`Create Subscription Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered during the request. | -| `subscription` | [`Subscription Hash`](../../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/doc/models/create-team-member-request.md b/doc/models/create-team-member-request.md deleted file mode 100644 index cb620d49e..000000000 --- a/doc/models/create-team-member-request.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Create Team Member Request - -Represents a create request for a `TeamMember` object. - -## Structure - -`Create Team Member Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | 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. | -| `team_member` | [`Team Member Hash`](../../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/doc/models/create-team-member-response.md b/doc/models/create-team-member-response.md deleted file mode 100644 index 7e5c7d23a..000000000 --- a/doc/models/create-team-member-response.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Create Team Member Response - -Represents a response from a create request containing the created `TeamMember` object or error messages. - -## Structure - -`Create Team Member Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member` | [`Team Member Hash`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | -| `errors` | [`Array`](../../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/doc/models/create-terminal-action-request.md b/doc/models/create-terminal-action-request.md deleted file mode 100644 index 3feff2260..000000000 --- a/doc/models/create-terminal-action-request.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Create Terminal Action Request - -## Structure - -`Create Terminal Action Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | [`Terminal Action Hash`](../../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/doc/models/create-terminal-action-response.md b/doc/models/create-terminal-action-response.md deleted file mode 100644 index 5ba9b0308..000000000 --- a/doc/models/create-terminal-action-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Create Terminal Action Response - -## Structure - -`Create Terminal Action Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `action` | [`Terminal Action Hash`](../../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/doc/models/create-terminal-checkout-request.md b/doc/models/create-terminal-checkout-request.md deleted file mode 100644 index eb5989c1a..000000000 --- a/doc/models/create-terminal-checkout-request.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Create Terminal Checkout Request - -## Structure - -`Create Terminal Checkout Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | [`Terminal Checkout Hash`](../../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/doc/models/create-terminal-checkout-response.md b/doc/models/create-terminal-checkout-response.md deleted file mode 100644 index 0393131e5..000000000 --- a/doc/models/create-terminal-checkout-response.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Create Terminal Checkout Response - -## Structure - -`Create Terminal Checkout Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `checkout` | [`Terminal Checkout Hash`](../../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/doc/models/create-terminal-refund-request.md b/doc/models/create-terminal-refund-request.md deleted file mode 100644 index 67af542a9..000000000 --- a/doc/models/create-terminal-refund-request.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Create Terminal Refund Request - -## Structure - -`Create Terminal Refund Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | [`Terminal Refund Hash`](../../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/doc/models/create-terminal-refund-response.md b/doc/models/create-terminal-refund-response.md deleted file mode 100644 index a25eb8d57..000000000 --- a/doc/models/create-terminal-refund-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Create Terminal Refund Response - -## Structure - -`Create Terminal Refund Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `refund` | [`Terminal Refund Hash`](../../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/doc/models/create-vendor-request.md b/doc/models/create-vendor-request.md deleted file mode 100644 index a9587ba47..000000000 --- a/doc/models/create-vendor-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Create Vendor Request - -Represents an input to a call to [CreateVendor](../../doc/api/vendors.md#create-vendor). - -## Structure - -`Create Vendor Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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 Hash`](../../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/doc/models/create-vendor-response.md b/doc/models/create-vendor-response.md deleted file mode 100644 index 3d3215bbf..000000000 --- a/doc/models/create-vendor-response.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Create Vendor Response - -Represents an output from a call to [CreateVendor](../../doc/api/vendors.md#create-vendor). - -## Structure - -`Create Vendor Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | -| `vendor` | [`Vendor Hash`](../../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/doc/models/create-webhook-subscription-request.md b/doc/models/create-webhook-subscription-request.md deleted file mode 100644 index b694311eb..000000000 --- a/doc/models/create-webhook-subscription-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Create Webhook Subscription Request - -Creates a [Subscription](../../doc/models/webhook-subscription.md). - -## Structure - -`Create Webhook Subscription Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `String` | Optional | A unique string that identifies the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) request.
**Constraints**: *Maximum Length*: `45` | -| `subscription` | [`Webhook Subscription Hash`](../../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/doc/models/create-webhook-subscription-response.md b/doc/models/create-webhook-subscription-response.md deleted file mode 100644 index 919f44759..000000000 --- a/doc/models/create-webhook-subscription-response.md +++ /dev/null @@ -1,49 +0,0 @@ - -# 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 - -`Create Webhook Subscription Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `subscription` | [`Webhook Subscription Hash`](../../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/doc/models/currency.md b/doc/models/currency.md deleted file mode 100644 index 3667d5fe5..000000000 --- a/doc/models/currency.md +++ /dev/null @@ -1,198 +0,0 @@ - -# 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/doc/models/custom-attribute-definition-visibility.md b/doc/models/custom-attribute-definition-visibility.md deleted file mode 100644 index 3c53ada9c..000000000 --- a/doc/models/custom-attribute-definition-visibility.md +++ /dev/null @@ -1,20 +0,0 @@ - -# 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 - -`Custom Attribute Definition Visibility` - -## 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/doc/models/custom-attribute-definition.md b/doc/models/custom-attribute-definition.md deleted file mode 100644 index ed2c59cc1..000000000 --- a/doc/models/custom-attribute-definition.md +++ /dev/null @@ -1,38 +0,0 @@ - -# 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 - -`Custom Attribute Definition` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | 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` | `Hash` | 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` | 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` | 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 (Custom Attribute Definition Visibility)`](../../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` | `Integer` | 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). | -| `updated_at` | `String` | Optional | The timestamp that indicates when the custom attribute definition was created or most recently updated,
in RFC 3339 format. | -| `created_at` | `String` | 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/doc/models/custom-attribute-filter.md b/doc/models/custom-attribute-filter.md deleted file mode 100644 index d3c98142e..000000000 --- a/doc/models/custom-attribute-filter.md +++ /dev/null @@ -1,41 +0,0 @@ - -# 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 - -`Custom Attribute Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition_id` | `String` | 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` | 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. | -| `string_filter` | `String` | 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. | -| `number_filter` | [`Range Hash`](../../doc/models/range.md) | Optional | The range of a number value between the specified lower and upper bounds. | -| `selection_uids_filter` | `Array` | 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. | -| `bool_filter` | `TrueClass \| FalseClass` | 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/doc/models/custom-attribute.md b/doc/models/custom-attribute.md deleted file mode 100644 index 90a46b13d..000000000 --- a/doc/models/custom-attribute.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Custom Attribute - -A custom attribute value. Each custom attribute value has a corresponding -`CustomAttributeDefinition` object. - -## Structure - -`Custom Attribute` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `key` | `String` | 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` | `Object` | 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` | `Integer` | 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 (Custom Attribute Definition Visibility)`](../../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` | [`Custom Attribute Definition Hash`](../../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. | -| `updated_at` | `String` | Optional | The timestamp that indicates when the custom attribute was created or was most recently
updated, in RFC 3339 format. | -| `created_at` | `String` | 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/doc/models/custom-field.md b/doc/models/custom-field.md deleted file mode 100644 index 9cfce2549..000000000 --- a/doc/models/custom-field.md +++ /dev/null @@ -1,25 +0,0 @@ - -# 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 - -`Custom Field` - -## 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/doc/models/customer-address-filter.md b/doc/models/customer-address-filter.md deleted file mode 100644 index f0089def7..000000000 --- a/doc/models/customer-address-filter.md +++ /dev/null @@ -1,29 +0,0 @@ - -# 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 - -`Customer Address Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `postal_code` | [`Customer Text Filter Hash`](../../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 (Country)`](../../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/doc/models/customer-creation-source-filter.md b/doc/models/customer-creation-source-filter.md deleted file mode 100644 index 2691d6dd4..000000000 --- a/doc/models/customer-creation-source-filter.md +++ /dev/null @@ -1,32 +0,0 @@ - -# 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 - -`Customer Creation Source Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `values` | [`Array`](../../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 (Customer Inclusion Exclusion)`](../../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/doc/models/customer-creation-source.md b/doc/models/customer-creation-source.md deleted file mode 100644 index 3a7116649..000000000 --- a/doc/models/customer-creation-source.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Customer Creation Source - -Indicates the method used to create the customer profile. - -## Enumeration - -`Customer Creation Source` - -## 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/doc/models/customer-custom-attribute-filter-value.md b/doc/models/customer-custom-attribute-filter-value.md deleted file mode 100644 index f0f4a1379..000000000 --- a/doc/models/customer-custom-attribute-filter-value.md +++ /dev/null @@ -1,58 +0,0 @@ - -# 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 - -`Customer Custom Attribute Filter Value` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `email` | [`Customer Text Filter Hash`](../../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` | [`Customer Text Filter Hash`](../../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` | [`Customer Text Filter Hash`](../../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` | [`Filter Value Hash`](../../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` | [`Time Range Hash`](../../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` | [`Float Number Range Hash`](../../doc/models/float-number-range.md) | Optional | Specifies a decimal number range. | -| `boolean` | `TrueClass \| FalseClass` | Optional | A filter for a query based on the value of a `Boolean`-type custom attribute. | -| `address` | [`Customer Address Filter Hash`](../../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/doc/models/customer-custom-attribute-filter.md b/doc/models/customer-custom-attribute-filter.md deleted file mode 100644 index 85cd027e5..000000000 --- a/doc/models/customer-custom-attribute-filter.md +++ /dev/null @@ -1,60 +0,0 @@ - -# 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 - -`Customer Custom Attribute Filter` - -## 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` | [`Customer Custom Attribute Filter Value Hash`](../../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). | -| `updated_at` | [`Time Range Hash`](../../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/doc/models/customer-custom-attribute-filters.md b/doc/models/customer-custom-attribute-filters.md deleted file mode 100644 index c8babcaf4..000000000 --- a/doc/models/customer-custom-attribute-filters.md +++ /dev/null @@ -1,63 +0,0 @@ - -# 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 - -`Customer Custom Attribute Filters` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filters` | [`Array`](../../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/doc/models/customer-details.md b/doc/models/customer-details.md deleted file mode 100644 index 6738e6622..000000000 --- a/doc/models/customer-details.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Customer Details - -Details about the customer making the payment. - -## Structure - -`Customer Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_initiated` | `TrueClass \| FalseClass` | Optional | Indicates whether the customer initiated the payment. | -| `seller_keyed_in` | `TrueClass \| FalseClass` | 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/doc/models/customer-filter.md b/doc/models/customer-filter.md deleted file mode 100644 index b403fa610..000000000 --- a/doc/models/customer-filter.md +++ /dev/null @@ -1,55 +0,0 @@ - -# 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 - -`Customer Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `creation_source` | [`Customer Creation Source Filter Hash`](../../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. | -| `created_at` | [`Time Range Hash`](../../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. | -| `updated_at` | [`Time Range Hash`](../../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. | -| `email_address` | [`Customer Text Filter Hash`](../../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_number` | [`Customer Text Filter Hash`](../../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. | -| `reference_id` | [`Customer Text Filter Hash`](../../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. | -| `group_ids` | [`Filter Value Hash`](../../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. | -| `custom_attribute` | [`Customer Custom Attribute Filters Hash`](../../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). | -| `segment_ids` | [`Filter Value Hash`](../../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/doc/models/customer-group.md b/doc/models/customer-group.md deleted file mode 100644 index c6e1a6b03..000000000 --- a/doc/models/customer-group.md +++ /dev/null @@ -1,32 +0,0 @@ - -# 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 - -`Customer Group` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | A unique Square-generated ID for the customer group.
**Constraints**: *Maximum Length*: `255` | -| `name` | `String` | Required | The name of the customer group. | -| `created_at` | `String` | Optional | The timestamp when the customer group was created, in RFC 3339 format. | -| `updated_at` | `String` | 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/doc/models/customer-inclusion-exclusion.md b/doc/models/customer-inclusion-exclusion.md deleted file mode 100644 index eaa909b94..000000000 --- a/doc/models/customer-inclusion-exclusion.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Customer Inclusion Exclusion - -Indicates whether customers should be included in, or excluded from, -the result set when they match the filtering criteria. - -## Enumeration - -`Customer Inclusion Exclusion` - -## 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/doc/models/customer-preferences.md b/doc/models/customer-preferences.md deleted file mode 100644 index c5acf36bf..000000000 --- a/doc/models/customer-preferences.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Customer Preferences - -Represents communication preferences for the customer profile. - -## Structure - -`Customer Preferences` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `email_unsubscribed` | `TrueClass \| FalseClass` | 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/doc/models/customer-query.md b/doc/models/customer-query.md deleted file mode 100644 index e9aa172f4..000000000 --- a/doc/models/customer-query.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Customer Query - -Represents filtering and sorting criteria for a [SearchCustomers](../../doc/api/customers.md#search-customers) request. - -## Structure - -`Customer Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filter` | [`Customer Filter Hash`](../../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` | [`Customer Sort Hash`](../../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/doc/models/customer-segment.md b/doc/models/customer-segment.md deleted file mode 100644 index 0c170b95c..000000000 --- a/doc/models/customer-segment.md +++ /dev/null @@ -1,32 +0,0 @@ - -# 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 - -`Customer Segment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | A unique Square-generated ID for the segment.
**Constraints**: *Maximum Length*: `255` | -| `name` | `String` | Required | The name of the segment. | -| `created_at` | `String` | Optional | The timestamp when the segment was created, in RFC 3339 format. | -| `updated_at` | `String` | 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/doc/models/customer-sort-field.md b/doc/models/customer-sort-field.md deleted file mode 100644 index 4b527a6c5..000000000 --- a/doc/models/customer-sort-field.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Customer Sort Field - -Specifies customer attributes as the sort key to customer profiles returned from a search. - -## Enumeration - -`Customer Sort Field` - -## 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/doc/models/customer-sort.md b/doc/models/customer-sort.md deleted file mode 100644 index 67310dbe1..000000000 --- a/doc/models/customer-sort.md +++ /dev/null @@ -1,26 +0,0 @@ - -# 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 - -`Customer Sort` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `field` | [`String (Customer Sort Field)`](../../doc/models/customer-sort-field.md) | Optional | Specifies customer attributes as the sort key to customer profiles returned from a search. | -| `order` | [`String (Sort Order)`](../../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/doc/models/customer-tax-ids.md b/doc/models/customer-tax-ids.md deleted file mode 100644 index c58c87478..000000000 --- a/doc/models/customer-tax-ids.md +++ /dev/null @@ -1,24 +0,0 @@ - -# 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 - -`Customer Tax Ids` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `eu_vat` | `String` | 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/doc/models/customer-text-filter.md b/doc/models/customer-text-filter.md deleted file mode 100644 index 904213c99..000000000 --- a/doc/models/customer-text-filter.md +++ /dev/null @@ -1,27 +0,0 @@ - -# 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 - -`Customer Text Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `exact` | `String` | Optional | Use the exact filter to select customers whose attributes match exactly the specified query. | -| `fuzzy` | `String` | 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/doc/models/customer.md b/doc/models/customer.md deleted file mode 100644 index 796245131..000000000 --- a/doc/models/customer.md +++ /dev/null @@ -1,54 +0,0 @@ - -# Customer - -Represents a Square customer profile in the Customer Directory of a Square seller. - -## Structure - -`Customer` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | 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. | -| `created_at` | `String` | Optional | The timestamp when the customer profile was created, in RFC 3339 format. | -| `updated_at` | `String` | Optional | The timestamp when the customer profile was last updated, in RFC 3339 format. | -| `cards` | [`Array`](../../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). | -| `given_name` | `String` | Optional | The given name (that is, the first name) associated with the customer profile. | -| `family_name` | `String` | Optional | The family name (that is, the last name) associated with the customer profile. | -| `nickname` | `String` | Optional | A nickname for the customer profile. | -| `company_name` | `String` | Optional | A business name associated with the customer profile. | -| `email_address` | `String` | Optional | The email address associated with the customer profile. | -| `address` | [`Address Hash`](../../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). | -| `phone_number` | `String` | Optional | The phone number associated with the customer profile. | -| `birthday` | `String` | 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). | -| `reference_id` | `String` | Optional | An optional second ID used to associate the customer profile with an
entity in another system. | -| `note` | `String` | Optional | A custom note associated with the customer profile. | -| `preferences` | [`Customer Preferences Hash`](../../doc/models/customer-preferences.md) | Optional | Represents communication preferences for the customer profile. | -| `creation_source` | [`String (Customer Creation Source)`](../../doc/models/customer-creation-source.md) | Optional | Indicates the method used to create the customer profile. | -| `group_ids` | `Array` | Optional | The IDs of [customer groups](entity:CustomerGroup) the customer belongs to. | -| `segment_ids` | `Array` | Optional | The IDs of [customer segments](entity:CustomerSegment) the customer belongs to. | -| `version` | `Integer` | 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. | -| `tax_ids` | [`Customer Tax Ids Hash`](../../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/doc/models/data-collection-options-input-type.md b/doc/models/data-collection-options-input-type.md deleted file mode 100644 index 030e09e42..000000000 --- a/doc/models/data-collection-options-input-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Data Collection Options Input Type - -Describes the input type of the data. - -## Enumeration - -`Data Collection Options Input Type` - -## 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/doc/models/data-collection-options.md b/doc/models/data-collection-options.md deleted file mode 100644 index 4df8aa397..000000000 --- a/doc/models/data-collection-options.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Data Collection Options - -## Structure - -`Data Collection Options` - -## 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` | -| `input_type` | [`String (Data Collection Options Input Type)`](../../doc/models/data-collection-options-input-type.md) | Required | Describes the input type of the data. | -| `collected_data` | [`Collected Data Hash`](../../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/doc/models/date-range.md b/doc/models/date-range.md deleted file mode 100644 index a6f4df5f0..000000000 --- a/doc/models/date-range.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Date Range - -A range defined by two dates. Used for filtering a query for Connect v2 -objects that have date properties. - -## Structure - -`Date Range` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `start_date` | `String` | 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). | -| `end_date` | `String` | 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/doc/models/day-of-week.md b/doc/models/day-of-week.md deleted file mode 100644 index f7b0a410b..000000000 --- a/doc/models/day-of-week.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Day of Week - -Indicates the specific day of the week. - -## Enumeration - -`Day of Week` - -## Fields - -| Name | Description | -| --- | --- | -| `SUN` | Sunday | -| `MON` | Monday | -| `TUE` | Tuesday | -| `WED` | Wednesday | -| `THU` | Thursday | -| `FRI` | Friday | -| `SAT` | Saturday | - diff --git a/doc/models/delete-booking-custom-attribute-definition-response.md b/doc/models/delete-booking-custom-attribute-definition-response.md deleted file mode 100644 index bdbfa35b9..000000000 --- a/doc/models/delete-booking-custom-attribute-definition-response.md +++ /dev/null @@ -1,24 +0,0 @@ - -# 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 - -`Delete Booking Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | - -## Example (as JSON) - -```json -{ - "errors": [] -} -``` - diff --git a/doc/models/delete-booking-custom-attribute-response.md b/doc/models/delete-booking-custom-attribute-response.md deleted file mode 100644 index 40b5c6c05..000000000 --- a/doc/models/delete-booking-custom-attribute-response.md +++ /dev/null @@ -1,24 +0,0 @@ - -# 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 - -`Delete Booking Custom Attribute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | - -## Example (as JSON) - -```json -{ - "errors": [] -} -``` - diff --git a/doc/models/delete-break-type-response.md b/doc/models/delete-break-type-response.md deleted file mode 100644 index cab4af8d6..000000000 --- a/doc/models/delete-break-type-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 - -`Delete Break Type Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-catalog-object-response.md b/doc/models/delete-catalog-object-response.md deleted file mode 100644 index 59add7b39..000000000 --- a/doc/models/delete-catalog-object-response.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Delete Catalog Object Response - -## Structure - -`Delete Catalog Object Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `deleted_object_ids` | `Array` | 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. | -| `deleted_at` | `String` | 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/doc/models/delete-customer-card-response.md b/doc/models/delete-customer-card-response.md deleted file mode 100644 index 0c0afab3d..000000000 --- a/doc/models/delete-customer-card-response.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Delete Customer Card Response - -Defines the fields that are included in the response body of -a request to the `DeleteCustomerCard` endpoint. - -## Structure - -`Delete Customer Card Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-customer-custom-attribute-definition-response.md b/doc/models/delete-customer-custom-attribute-definition-response.md deleted file mode 100644 index bbc32e988..000000000 --- a/doc/models/delete-customer-custom-attribute-definition-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Delete Customer Custom Attribute Definition Response - -Represents a response from a delete request containing error messages if there are any. - -## Structure - -`Delete Customer Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-customer-custom-attribute-response.md b/doc/models/delete-customer-custom-attribute-response.md deleted file mode 100644 index eb6d74a43..000000000 --- a/doc/models/delete-customer-custom-attribute-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# 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 - -`Delete Customer Custom Attribute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-customer-group-response.md b/doc/models/delete-customer-group-response.md deleted file mode 100644 index 8ef28d90a..000000000 --- a/doc/models/delete-customer-group-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# 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 - -`Delete Customer Group Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-customer-request.md b/doc/models/delete-customer-request.md deleted file mode 100644 index a096a5274..000000000 --- a/doc/models/delete-customer-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Delete Customer Request - -Defines the fields that are included in a request to the `DeleteCustomer` -endpoint. - -## Structure - -`Delete Customer Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `Integer` | 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/doc/models/delete-customer-response.md b/doc/models/delete-customer-response.md deleted file mode 100644 index a7b3252e4..000000000 --- a/doc/models/delete-customer-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Delete Customer Response - -Defines the fields that are included in the response body of -a request to the `DeleteCustomer` endpoint. - -## Structure - -`Delete Customer Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-dispute-evidence-response.md b/doc/models/delete-dispute-evidence-response.md deleted file mode 100644 index 34366d4a9..000000000 --- a/doc/models/delete-dispute-evidence-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Delete Dispute Evidence Response - -Defines the fields in a `DeleteDisputeEvidence` response. - -## Structure - -`Delete Dispute Evidence Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-invoice-attachment-response.md b/doc/models/delete-invoice-attachment-response.md deleted file mode 100644 index 7f6e47de9..000000000 --- a/doc/models/delete-invoice-attachment-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Delete Invoice Attachment Response - -Represents a [DeleteInvoiceAttachment](../../doc/api/invoices.md#delete-invoice-attachment) response. - -## Structure - -`Delete Invoice Attachment Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-invoice-request.md b/doc/models/delete-invoice-request.md deleted file mode 100644 index ecc9d853f..000000000 --- a/doc/models/delete-invoice-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Delete Invoice Request - -Describes a `DeleteInvoice` request. - -## Structure - -`Delete Invoice Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `Integer` | 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/doc/models/delete-invoice-response.md b/doc/models/delete-invoice-response.md deleted file mode 100644 index 8e6587fd5..000000000 --- a/doc/models/delete-invoice-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Delete Invoice Response - -Describes a `DeleteInvoice` response. - -## Structure - -`Delete Invoice Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-location-custom-attribute-definition-response.md b/doc/models/delete-location-custom-attribute-definition-response.md deleted file mode 100644 index 9972d5bb0..000000000 --- a/doc/models/delete-location-custom-attribute-definition-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Delete Location Custom Attribute Definition Response - -Represents a response from a delete request containing error messages if there are any. - -## Structure - -`Delete Location Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-location-custom-attribute-response.md b/doc/models/delete-location-custom-attribute-response.md deleted file mode 100644 index f206e22b3..000000000 --- a/doc/models/delete-location-custom-attribute-response.md +++ /dev/null @@ -1,37 +0,0 @@ - -# 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 - -`Delete Location Custom Attribute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-loyalty-reward-response.md b/doc/models/delete-loyalty-reward-response.md deleted file mode 100644 index 3b7eb2f06..000000000 --- a/doc/models/delete-loyalty-reward-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Delete Loyalty Reward Response - -A response returned by the API call. - -## Structure - -`Delete Loyalty Reward Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-merchant-custom-attribute-definition-response.md b/doc/models/delete-merchant-custom-attribute-definition-response.md deleted file mode 100644 index a8cd57454..000000000 --- a/doc/models/delete-merchant-custom-attribute-definition-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Delete Merchant Custom Attribute Definition Response - -Represents a response from a delete request containing error messages if there are any. - -## Structure - -`Delete Merchant Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-merchant-custom-attribute-response.md b/doc/models/delete-merchant-custom-attribute-response.md deleted file mode 100644 index 4fd3799e2..000000000 --- a/doc/models/delete-merchant-custom-attribute-response.md +++ /dev/null @@ -1,37 +0,0 @@ - -# 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 - -`Delete Merchant Custom Attribute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-order-custom-attribute-definition-response.md b/doc/models/delete-order-custom-attribute-definition-response.md deleted file mode 100644 index 32c3bfcdf..000000000 --- a/doc/models/delete-order-custom-attribute-definition-response.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Delete Order Custom Attribute Definition Response - -Represents a response from deleting an order custom attribute definition. - -## Structure - -`Delete Order Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-order-custom-attribute-response.md b/doc/models/delete-order-custom-attribute-response.md deleted file mode 100644 index 33362e754..000000000 --- a/doc/models/delete-order-custom-attribute-response.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Delete Order Custom Attribute Response - -Represents a response from deleting an order custom attribute. - -## Structure - -`Delete Order Custom Attribute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-payment-link-response.md b/doc/models/delete-payment-link-response.md deleted file mode 100644 index 1e2533d1d..000000000 --- a/doc/models/delete-payment-link-response.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Delete Payment Link Response - -## Structure - -`Delete Payment Link Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | - | -| `id` | `String` | Optional | The ID of the link that is deleted. | -| `cancelled_order_id` | `String` | 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/doc/models/delete-shift-response.md b/doc/models/delete-shift-response.md deleted file mode 100644 index 4d70b9103..000000000 --- a/doc/models/delete-shift-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 - -`Delete Shift Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-snippet-response.md b/doc/models/delete-snippet-response.md deleted file mode 100644 index 61439f546..000000000 --- a/doc/models/delete-snippet-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Delete Snippet Response - -Represents a `DeleteSnippet` response. - -## Structure - -`Delete Snippet Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/delete-subscription-action-response.md b/doc/models/delete-subscription-action-response.md deleted file mode 100644 index 7ed4fcf98..000000000 --- a/doc/models/delete-subscription-action-response.md +++ /dev/null @@ -1,62 +0,0 @@ - -# Delete Subscription Action Response - -Defines output parameters in a response of the [DeleteSubscriptionAction](../../doc/api/subscriptions.md#delete-subscription-action) -endpoint. - -## Structure - -`Delete Subscription Action Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered during the request. | -| `subscription` | [`Subscription Hash`](../../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/doc/models/delete-webhook-subscription-response.md b/doc/models/delete-webhook-subscription-response.md deleted file mode 100644 index d4e6ade6d..000000000 --- a/doc/models/delete-webhook-subscription-response.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 - -`Delete Webhook Subscription Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/deprecated-create-dispute-evidence-file-request.md b/doc/models/deprecated-create-dispute-evidence-file-request.md deleted file mode 100644 index 27eb2007c..000000000 --- a/doc/models/deprecated-create-dispute-evidence-file-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Deprecated Create Dispute Evidence File Request - -Defines the parameters for a `DeprecatedCreateDisputeEvidenceFile` request. - -## Structure - -`Deprecated Create Dispute Evidence File Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `evidence_type` | [`String (Dispute Evidence Type)`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | -| `content_type` | `String` | 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/doc/models/deprecated-create-dispute-evidence-file-response.md b/doc/models/deprecated-create-dispute-evidence-file-response.md deleted file mode 100644 index ab7e147e5..000000000 --- a/doc/models/deprecated-create-dispute-evidence-file-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Deprecated Create Dispute Evidence File Response - -Defines the fields in a `DeprecatedCreateDisputeEvidenceFile` response. - -## Structure - -`Deprecated Create Dispute Evidence File Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `evidence` | [`Dispute Evidence Hash`](../../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/doc/models/deprecated-create-dispute-evidence-text-request.md b/doc/models/deprecated-create-dispute-evidence-text-request.md deleted file mode 100644 index 1487077b5..000000000 --- a/doc/models/deprecated-create-dispute-evidence-text-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Deprecated Create Dispute Evidence Text Request - -Defines the parameters for a `DeprecatedCreateDisputeEvidenceText` request. - -## Structure - -`Deprecated Create Dispute Evidence Text Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `evidence_type` | [`String (Dispute Evidence Type)`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | -| `evidence_text` | `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/doc/models/deprecated-create-dispute-evidence-text-response.md b/doc/models/deprecated-create-dispute-evidence-text-response.md deleted file mode 100644 index e6deb1639..000000000 --- a/doc/models/deprecated-create-dispute-evidence-text-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Deprecated Create Dispute Evidence Text Response - -Defines the fields in a `DeprecatedCreateDisputeEvidenceText` response. - -## Structure - -`Deprecated Create Dispute Evidence Text Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `evidence` | [`Dispute Evidence Hash`](../../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/doc/models/destination-details-card-refund-details.md b/doc/models/destination-details-card-refund-details.md deleted file mode 100644 index 85b5c3d63..000000000 --- a/doc/models/destination-details-card-refund-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Destination Details Card Refund Details - -## Structure - -`Destination Details Card Refund Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `card` | [`Card Hash`](../../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. | -| `entry_method` | `String` | 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` | -| `auth_result_code` | `String` | 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/doc/models/destination-details-cash-refund-details.md b/doc/models/destination-details-cash-refund-details.md deleted file mode 100644 index acee7f115..000000000 --- a/doc/models/destination-details-cash-refund-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Destination Details Cash Refund Details - -Stores details about a cash refund. Contains only non-confidential information. - -## Structure - -`Destination Details Cash Refund Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `seller_supplied_money` | [`Money Hash`](../../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. | -| `change_back_money` | [`Money Hash`](../../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/doc/models/destination-details-external-refund-details.md b/doc/models/destination-details-external-refund-details.md deleted file mode 100644 index 6e07b3e4f..000000000 --- a/doc/models/destination-details-external-refund-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Destination Details External Refund Details - -Stores details about an external refund. Contains only non-confidential information. - -## Structure - -`Destination Details External Refund Details` - -## 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` | -| `source_id` | `String` | 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/doc/models/destination-details.md b/doc/models/destination-details.md deleted file mode 100644 index e8bd924bb..000000000 --- a/doc/models/destination-details.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Destination Details - -Details about a refund's destination. - -## Structure - -`Destination Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `card_details` | [`Destination Details Card Refund Details Hash`](../../doc/models/destination-details-card-refund-details.md) | Optional | - | -| `cash_details` | [`Destination Details Cash Refund Details Hash`](../../doc/models/destination-details-cash-refund-details.md) | Optional | Stores details about a cash refund. Contains only non-confidential information. | -| `external_details` | [`Destination Details External Refund Details Hash`](../../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/doc/models/destination-type.md b/doc/models/destination-type.md deleted file mode 100644 index e8d8cbc2b..000000000 --- a/doc/models/destination-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Destination Type - -List of possible destinations against which a payout can be made. - -## Enumeration - -`Destination Type` - -## 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/doc/models/destination.md b/doc/models/destination.md deleted file mode 100644 index 0628e070b..000000000 --- a/doc/models/destination.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Destination - -Information about the destination against which the payout was made. - -## Structure - -`Destination` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | [`String (Destination Type)`](../../doc/models/destination-type.md) | Optional | List of possible destinations against which a payout can be made. | -| `id` | `String` | 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/doc/models/device-attributes-device-type.md b/doc/models/device-attributes-device-type.md deleted file mode 100644 index 14d88ed37..000000000 --- a/doc/models/device-attributes-device-type.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Device Attributes Device Type - -An enum identifier of the device type. - -## Enumeration - -`Device Attributes Device Type` - -## Fields - -| Name | -| --- | -| `TERMINAL` | - diff --git a/doc/models/device-attributes.md b/doc/models/device-attributes.md deleted file mode 100644 index ce141e991..000000000 --- a/doc/models/device-attributes.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Device Attributes - -## Structure - -`Device Attributes` - -## 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` | Optional | The specific model of the device. | -| `name` | `String` | Optional | A seller-specified name for the device. | -| `manufacturers_id` | `String` | Optional | The manufacturer-supplied identifier for the device (where available). In many cases,
this identifier will be a serial number. | -| `updated_at` | `String` | 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` | Optional | The current version of software installed on the device. | -| `merchant_token` | `String` | 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/doc/models/device-checkout-options.md b/doc/models/device-checkout-options.md deleted file mode 100644 index 282965571..000000000 --- a/doc/models/device-checkout-options.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Device Checkout Options - -## Structure - -`Device Checkout Options` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `device_id` | `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. | -| `skip_receipt_screen` | `TrueClass \| FalseClass` | Optional | Instructs the device to skip the receipt screen. Defaults to false. | -| `collect_signature` | `TrueClass \| FalseClass` | Optional | Indicates that signature collection is desired during checkout. Defaults to false. | -| `tip_settings` | [`Tip Settings Hash`](../../doc/models/tip-settings.md) | Optional | - | -| `show_itemized_cart` | `TrueClass \| FalseClass` | 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/doc/models/device-code-status.md b/doc/models/device-code-status.md deleted file mode 100644 index 0b4170485..000000000 --- a/doc/models/device-code-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Device Code Status - -DeviceCode.Status enum. - -## Enumeration - -`Device Code Status` - -## 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/doc/models/device-code.md b/doc/models/device-code.md deleted file mode 100644 index 53f6667bf..000000000 --- a/doc/models/device-code.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Device Code - -## Structure - -`Device Code` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The unique id for this device code. | -| `name` | `String` | Optional | An optional user-defined name for the device code.
**Constraints**: *Maximum Length*: `128` | -| `code` | `String` | Optional | The unique code that can be used to login. | -| `device_id` | `String` | Optional | The unique id of the device that used this code. Populated when the device is paired up. | -| `product_type` | `String` | Required, Constant | **Default**: `'TERMINAL_API'` | -| `location_id` | `String` | Optional | The location assigned to this code.
**Constraints**: *Maximum Length*: `50` | -| `status` | [`String (Device Code Status)`](../../doc/models/device-code-status.md) | Optional | DeviceCode.Status enum. | -| `pair_by` | `String` | Optional | When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format. | -| `created_at` | `String` | Optional | When this DeviceCode was created. Timestamp in RFC 3339 format. | -| `status_changed_at` | `String` | Optional | When this DeviceCode's status was last changed. Timestamp in RFC 3339 format. | -| `paired_at` | `String` | 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/doc/models/device-component-details-application-details.md b/doc/models/device-component-details-application-details.md deleted file mode 100644 index f42e2687e..000000000 --- a/doc/models/device-component-details-application-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Device Component Details Application Details - -## Structure - -`Device Component Details Application Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `application_type` | [`String (Application Type)`](../../doc/models/application-type.md) | Optional | - | -| `version` | `String` | Optional | The version of the application. | -| `session_location` | `String` | Optional | The location_id of the session for the application. | -| `device_code_id` | `String` | 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/doc/models/device-component-details-battery-details.md b/doc/models/device-component-details-battery-details.md deleted file mode 100644 index 14375a0f5..000000000 --- a/doc/models/device-component-details-battery-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Device Component Details Battery Details - -## Structure - -`Device Component Details Battery Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `visible_percent` | `Integer` | Optional | The battery charge percentage as displayed on the device. | -| `external_power` | [`String (Device Component Details External Power)`](../../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/doc/models/device-component-details-card-reader-details.md b/doc/models/device-component-details-card-reader-details.md deleted file mode 100644 index 527507ea2..000000000 --- a/doc/models/device-component-details-card-reader-details.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Device Component Details Card Reader Details - -## Structure - -`Device Component Details Card Reader Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `String` | Optional | The version of the card reader. | - -## Example (as JSON) - -```json -{ - "version": "version8" -} -``` - diff --git a/doc/models/device-component-details-ethernet-details.md b/doc/models/device-component-details-ethernet-details.md deleted file mode 100644 index 99820c33c..000000000 --- a/doc/models/device-component-details-ethernet-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Device Component Details Ethernet Details - -## Structure - -`Device Component Details Ethernet Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `active` | `TrueClass \| FalseClass` | Optional | A boolean to represent whether the Ethernet interface is currently active. | -| `ip_address_v4` | `String` | 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/doc/models/device-component-details-external-power.md b/doc/models/device-component-details-external-power.md deleted file mode 100644 index 12ef093f4..000000000 --- a/doc/models/device-component-details-external-power.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Device Component Details External Power - -An enum for ExternalPower. - -## Enumeration - -`Device Component Details External Power` - -## 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/doc/models/device-component-details-measurement.md b/doc/models/device-component-details-measurement.md deleted file mode 100644 index a366ac409..000000000 --- a/doc/models/device-component-details-measurement.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Device Component Details Measurement - -A value qualified by unit of measure. - -## Structure - -`Device Component Details Measurement` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `value` | `Integer` | Optional | - | - -## Example (as JSON) - -```json -{ - "value": 132 -} -``` - diff --git a/doc/models/device-component-details-network-interface-details.md b/doc/models/device-component-details-network-interface-details.md deleted file mode 100644 index 753a60bb9..000000000 --- a/doc/models/device-component-details-network-interface-details.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Device Component Details Network Interface Details - -## Structure - -`Device Component Details Network Interface Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ip_address_v4` | `String` | Optional | The string representation of the device’s IPv4 address. | - -## Example (as JSON) - -```json -{ - "ip_address_v4": "ip_address_v46" -} -``` - diff --git a/doc/models/device-component-details-wi-fi-details.md b/doc/models/device-component-details-wi-fi-details.md deleted file mode 100644 index b23255660..000000000 --- a/doc/models/device-component-details-wi-fi-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Device Component Details Wi Fi Details - -## Structure - -`Device Component Details Wi Fi Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `active` | `TrueClass \| FalseClass` | Optional | A boolean to represent whether the WiFI interface is currently active. | -| `ssid` | `String` | Optional | The name of the connected WIFI network. | -| `ip_address_v4` | `String` | Optional | The string representation of the device’s IPv4 address. | -| `secure_connection` | `String` | Optional | The security protocol for a secure connection (e.g. WPA2). None provided if the connection
is unsecured. | -| `signal_strength` | [`Device Component Details Measurement Hash`](../../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/doc/models/device-details.md b/doc/models/device-details.md deleted file mode 100644 index edd56bf53..000000000 --- a/doc/models/device-details.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Device Details - -Details about the device that took the payment. - -## Structure - -`Device Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `device_id` | `String` | Optional | The Square-issued ID of the device.
**Constraints**: *Maximum Length*: `255` | -| `device_installation_id` | `String` | Optional | The Square-issued installation ID for the device.
**Constraints**: *Maximum Length*: `255` | -| `device_name` | `String` | 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/doc/models/device-metadata.md b/doc/models/device-metadata.md deleted file mode 100644 index 6e25a8bfa..000000000 --- a/doc/models/device-metadata.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Device Metadata - -## Structure - -`Device Metadata` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `battery_percentage` | `String` | Optional | The Terminal’s remaining battery percentage, between 1-100. | -| `charging_state` | `String` | Optional | The current charging state of the Terminal.
Options: `CHARGING`, `NOT_CHARGING` | -| `location_id` | `String` | Optional | The ID of the Square seller business location associated with the Terminal. | -| `merchant_id` | `String` | Optional | The ID of the Square merchant account that is currently signed-in to the Terminal. | -| `network_connection_type` | `String` | Optional | The Terminal’s current network connection type.
Options: `WIFI`, `ETHERNET` | -| `payment_region` | `String` | Optional | The country in which the Terminal is authorized to take payments. | -| `serial_number` | `String` | Optional | The unique identifier assigned to the Terminal, which can be found on the lower back
of the device. | -| `os_version` | `String` | Optional | The current version of the Terminal’s operating system. | -| `app_version` | `String` | Optional | The current version of the application running on the Terminal. | -| `wifi_network_name` | `String` | Optional | The name of the Wi-Fi network to which the Terminal is connected. | -| `wifi_network_strength` | `String` | Optional | The signal strength of the Wi-FI network connection.
Options: `POOR`, `FAIR`, `GOOD`, `EXCELLENT` | -| `ip_address` | `String` | 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/doc/models/device-status-category.md b/doc/models/device-status-category.md deleted file mode 100644 index 36154bf8a..000000000 --- a/doc/models/device-status-category.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Device Status Category - -## Enumeration - -`Device Status Category` - -## Fields - -| Name | -| --- | -| `AVAILABLE` | -| `NEEDS_ATTENTION` | -| `OFFLINE` | - diff --git a/doc/models/device-status.md b/doc/models/device-status.md deleted file mode 100644 index c4ab739f6..000000000 --- a/doc/models/device-status.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Device Status - -## Structure - -`Device Status` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `category` | [`String (Device Status Category)`](../../doc/models/device-status-category.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "category": "NEEDS_ATTENTION" -} -``` - diff --git a/doc/models/device.md b/doc/models/device.md deleted file mode 100644 index 6ea679612..000000000 --- a/doc/models/device.md +++ /dev/null @@ -1,125 +0,0 @@ - -# Device - -## Structure - -`Device` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | 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` | [`Device Attributes Hash`](../../doc/models/device-attributes.md) | Required | - | -| `components` | [`Array`](../../doc/models/component.md) | Optional | A list of components applicable to the device. | -| `status` | [`Device Status Hash`](../../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/doc/models/digital-wallet-details.md b/doc/models/digital-wallet-details.md deleted file mode 100644 index c506685a7..000000000 --- a/doc/models/digital-wallet-details.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Digital Wallet Details - -Additional details about `WALLET` type payments. Contains only non-confidential information. - -## Structure - -`Digital Wallet Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `status` | `String` | Optional | The status of the `WALLET` payment. The status can be `AUTHORIZED`, `CAPTURED`, `VOIDED`, or
`FAILED`.
**Constraints**: *Maximum Length*: `50` | -| `brand` | `String` | 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` | -| `cash_app_details` | [`Cash App Details Hash`](../../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/doc/models/disable-card-response.md b/doc/models/disable-card-response.md deleted file mode 100644 index 9aff0f091..000000000 --- a/doc/models/disable-card-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# 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 - -`Disable Card Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `card` | [`Card Hash`](../../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/doc/models/disable-events-response.md b/doc/models/disable-events-response.md deleted file mode 100644 index b7064820b..000000000 --- a/doc/models/disable-events-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# 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 - -`Disable Events Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/dismiss-terminal-action-response.md b/doc/models/dismiss-terminal-action-response.md deleted file mode 100644 index dbd9d77b0..000000000 --- a/doc/models/dismiss-terminal-action-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# Dismiss Terminal Action Response - -## Structure - -`Dismiss Terminal Action Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `action` | [`Terminal Action Hash`](../../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/doc/models/dismiss-terminal-checkout-response.md b/doc/models/dismiss-terminal-checkout-response.md deleted file mode 100644 index 689e73b40..000000000 --- a/doc/models/dismiss-terminal-checkout-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Dismiss Terminal Checkout Response - -## Structure - -`Dismiss Terminal Checkout Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `checkout` | [`Terminal Checkout Hash`](../../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/doc/models/dismiss-terminal-refund-response.md b/doc/models/dismiss-terminal-refund-response.md deleted file mode 100644 index 0e14b25c5..000000000 --- a/doc/models/dismiss-terminal-refund-response.md +++ /dev/null @@ -1,92 +0,0 @@ - -# Dismiss Terminal Refund Response - -## Structure - -`Dismiss Terminal Refund Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `refund` | [`Terminal Refund Hash`](../../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/doc/models/dispute-evidence-file.md b/doc/models/dispute-evidence-file.md deleted file mode 100644 index f752c8026..000000000 --- a/doc/models/dispute-evidence-file.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Dispute Evidence File - -A file to be uploaded as dispute evidence. - -## Structure - -`Dispute Evidence File` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filename` | `String` | Optional | The file name including the file extension. For example: "receipt.tiff".
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `filetype` | `String` | 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/doc/models/dispute-evidence-type.md b/doc/models/dispute-evidence-type.md deleted file mode 100644 index d205f18bc..000000000 --- a/doc/models/dispute-evidence-type.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Dispute Evidence Type - -The type of the dispute evidence. - -## Enumeration - -`Dispute Evidence Type` - -## 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/doc/models/dispute-evidence.md b/doc/models/dispute-evidence.md deleted file mode 100644 index 39925292b..000000000 --- a/doc/models/dispute-evidence.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Dispute Evidence - -## Structure - -`Dispute Evidence` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `evidence_id` | `String` | Optional | The Square-generated ID of the evidence.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `id` | `String` | Optional | The Square-generated ID of the evidence.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `dispute_id` | `String` | Optional | The ID of the dispute the evidence is associated with.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `evidence_file` | [`Dispute Evidence File Hash`](../../doc/models/dispute-evidence-file.md) | Optional | A file to be uploaded as dispute evidence. | -| `evidence_text` | `String` | Optional | Raw text
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500` | -| `uploaded_at` | `String` | Optional | The time when the evidence was uploaded, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `evidence_type` | [`String (Dispute Evidence Type)`](../../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/doc/models/dispute-reason.md b/doc/models/dispute-reason.md deleted file mode 100644 index 3c75770c8..000000000 --- a/doc/models/dispute-reason.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Dispute Reason - -The list of possible reasons why a cardholder might initiate a -dispute with their bank. - -## Enumeration - -`Dispute Reason` - -## 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/doc/models/dispute-state.md b/doc/models/dispute-state.md deleted file mode 100644 index e306937f6..000000000 --- a/doc/models/dispute-state.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Dispute State - -The list of possible dispute states. - -## Enumeration - -`Dispute State` - -## 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/doc/models/dispute.md b/doc/models/dispute.md deleted file mode 100644 index 6d7988335..000000000 --- a/doc/models/dispute.md +++ /dev/null @@ -1,45 +0,0 @@ - -# 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 | -| --- | --- | --- | --- | -| `dispute_id` | `String` | Optional | The unique ID for this `Dispute`, generated by Square.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `id` | `String` | Optional | The unique ID for this `Dispute`, generated by Square.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `amount_money` | [`Money Hash`](../../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 (Dispute Reason)`](../../doc/models/dispute-reason.md) | Optional | The list of possible reasons why a cardholder might initiate a
dispute with their bank. | -| `state` | [`String (Dispute State)`](../../doc/models/dispute-state.md) | Optional | The list of possible dispute states. | -| `due_at` | `String` | 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` | -| `disputed_payment` | [`Disputed Payment Hash`](../../doc/models/disputed-payment.md) | Optional | The payment the cardholder disputed. | -| `evidence_ids` | `Array` | Optional | The IDs of the evidence associated with the dispute. | -| `card_brand` | [`String (Card Brand)`](../../doc/models/card-brand.md) | Optional | Indicates a card's brand, such as `VISA` or `MASTERCARD`. | -| `created_at` | `String` | Optional | The timestamp when the dispute was created, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `updated_at` | `String` | Optional | The timestamp when the dispute was last updated, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `brand_dispute_id` | `String` | Optional | The ID of the dispute in the card brand system, generated by the card brand.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `reported_date` | `String` | Optional | The timestamp when the dispute was reported, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `reported_at` | `String` | Optional | The timestamp when the dispute was reported, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | -| `version` | `Integer` | Optional | The current version of the `Dispute`. | -| `location_id` | `String` | 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/doc/models/disputed-payment.md b/doc/models/disputed-payment.md deleted file mode 100644 index 0ae5c43a3..000000000 --- a/doc/models/disputed-payment.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Disputed Payment - -The payment the cardholder disputed. - -## Structure - -`Disputed Payment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | 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/doc/models/ecom-visibility.md b/doc/models/ecom-visibility.md deleted file mode 100644 index 9d507e97e..000000000 --- a/doc/models/ecom-visibility.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Ecom Visibility - -Determines item visibility in Ecom (Online Store) and Online Checkout. - -## Enumeration - -`Ecom Visibility` - -## 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/doc/models/employee-status.md b/doc/models/employee-status.md deleted file mode 100644 index baa1df4fb..000000000 --- a/doc/models/employee-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Employee Status - -The status of the Employee being retrieved. - -DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). - -## Enumeration - -`Employee Status` - -## 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/doc/models/employee-wage.md b/doc/models/employee-wage.md deleted file mode 100644 index 2ca0f2f25..000000000 --- a/doc/models/employee-wage.md +++ /dev/null @@ -1,32 +0,0 @@ - -# 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 - -`Employee Wage` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The UUID for this object. | -| `employee_id` | `String` | Optional | The `Employee` that this wage is assigned to. | -| `title` | `String` | Optional | The job title that this wage relates to. | -| `hourly_rate` | [`Money Hash`](../../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/doc/models/employee.md b/doc/models/employee.md deleted file mode 100644 index 423731c33..000000000 --- a/doc/models/employee.md +++ /dev/null @@ -1,38 +0,0 @@ - -# 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` | Optional | UUID for this object. | -| `first_name` | `String` | Optional | The employee's first name. | -| `last_name` | `String` | Optional | The employee's last name. | -| `email` | `String` | Optional | The employee's email address | -| `phone_number` | `String` | Optional | The employee's phone number in E.164 format, i.e. "+12125554250" | -| `location_ids` | `Array` | Optional | A list of location IDs where this employee has access to. | -| `status` | [`String (Employee Status)`](../../doc/models/employee-status.md) | Optional | The status of the Employee being retrieved.

DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). | -| `is_owner` | `TrueClass \| FalseClass` | 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. | -| `created_at` | `String` | Optional | A read-only timestamp in RFC 3339 format. | -| `updated_at` | `String` | 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/doc/models/enable-events-response.md b/doc/models/enable-events-response.md deleted file mode 100644 index f0e4d6105..000000000 --- a/doc/models/enable-events-response.md +++ /dev/null @@ -1,34 +0,0 @@ - -# 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 - -`Enable Events Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/error-category.md b/doc/models/error-category.md deleted file mode 100644 index 39fab5acd..000000000 --- a/doc/models/error-category.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Error Category - -Indicates which high-level category of error has occurred during a -request to the Connect API. - -## Enumeration - -`Error Category` - -## 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/doc/models/error-code.md b/doc/models/error-code.md deleted file mode 100644 index 67a01bde1..000000000 --- a/doc/models/error-code.md +++ /dev/null @@ -1,165 +0,0 @@ - -# Error Code - -Indicates the specific error that occurred during a request to a -Square API. - -## Enumeration - -`Error Code` - -## 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/doc/models/error.md b/doc/models/error.md deleted file mode 100644 index 94b3cb7eb..000000000 --- a/doc/models/error.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 (Error Category)`](../../doc/models/error-category.md) | Required | Indicates which high-level category of error has occurred during a
request to the Connect API. | -| `code` | [`String (Error Code)`](../../doc/models/error-code.md) | Required | Indicates the specific error that occurred during a request to a
Square API. | -| `detail` | `String` | Optional | A human-readable description of the error for debugging purposes. | -| `field` | `String` | 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/doc/models/event-data.md b/doc/models/event-data.md deleted file mode 100644 index c64984602..000000000 --- a/doc/models/event-data.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Event Data - -## Structure - -`Event Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | `String` | Optional | The name of the affected object’s type. | -| `id` | `String` | Optional | The ID of the affected object. | -| `deleted` | `TrueClass \| FalseClass` | Optional | This is true if the affected object has been deleted; otherwise, it's absent. | -| `object` | `Hash` | 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/doc/models/event-metadata.md b/doc/models/event-metadata.md deleted file mode 100644 index 9055b9a69..000000000 --- a/doc/models/event-metadata.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Event Metadata - -Contains metadata about a particular [Event](../../doc/models/event.md). - -## Structure - -`Event Metadata` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `event_id` | `String` | Optional | A unique ID for the event. | -| `api_version` | `String` | 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/doc/models/event-type-metadata.md b/doc/models/event-type-metadata.md deleted file mode 100644 index c4fd0a1ad..000000000 --- a/doc/models/event-type-metadata.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Event Type Metadata - -Contains the metadata of a webhook event type. - -## Structure - -`Event Type Metadata` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `event_type` | `String` | Optional | The event type. | -| `api_version_introduced` | `String` | Optional | The API version at which the event type was introduced. | -| `release_status` | `String` | 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/doc/models/event.md b/doc/models/event.md deleted file mode 100644 index 8642ab9a9..000000000 --- a/doc/models/event.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Event - -## Structure - -`Event` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `merchant_id` | `String` | Optional | The ID of the target merchant associated with the event. | -| `location_id` | `String` | Optional | The ID of the target location associated with the event. | -| `type` | `String` | Optional | The type of event this represents. | -| `event_id` | `String` | Optional | A unique ID for the event. | -| `created_at` | `String` | Optional | Timestamp of when the event was created, in RFC 3339 format. | -| `data` | [`Event Data Hash`](../../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/doc/models/exclude-strategy.md b/doc/models/exclude-strategy.md deleted file mode 100644 index 4eb7ab3a2..000000000 --- a/doc/models/exclude-strategy.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Exclude Strategy - -Indicates which products matched by a CatalogPricingRule -will be excluded if the pricing rule uses an exclude set. - -## Enumeration - -`Exclude Strategy` - -## 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/doc/models/external-payment-details.md b/doc/models/external-payment-details.md deleted file mode 100644 index 525a21e21..000000000 --- a/doc/models/external-payment-details.md +++ /dev/null @@ -1,34 +0,0 @@ - -# 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 - -`External Payment Details` - -## 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` | -| `source_id` | `String` | Optional | An ID to associate the payment to its originating source.
**Constraints**: *Maximum Length*: `255` | -| `source_fee_money` | [`Money Hash`](../../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/doc/models/filter-value.md b/doc/models/filter-value.md deleted file mode 100644 index b15e7d48b..000000000 --- a/doc/models/filter-value.md +++ /dev/null @@ -1,42 +0,0 @@ - -# 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 - -`Filter Value` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `all` | `Array` | Optional | A list of terms that must be present on the field of the resource. | -| `any` | `Array` | Optional | A list of terms where at least one of them must be present on the
field of the resource. | -| `none` | `Array` | 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/doc/models/float-number-range.md b/doc/models/float-number-range.md deleted file mode 100644 index aef1a9bba..000000000 --- a/doc/models/float-number-range.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Float Number Range - -Specifies a decimal number range. - -## Structure - -`Float Number Range` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `start_at` | `String` | Optional | A decimal value indicating where the range starts. | -| `end_at` | `String` | Optional | A decimal value indicating where the range ends. | - -## Example (as JSON) - -```json -{ - "start_at": "start_at0", - "end_at": "end_at2" -} -``` - diff --git a/doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md b/doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md deleted file mode 100644 index 0b6015364..000000000 --- a/doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Fulfillment Delivery Details Order Fulfillment Delivery Details Schedule Type - -The schedule type of the delivery fulfillment. - -## Enumeration - -`Fulfillment Delivery Details Order Fulfillment Delivery Details Schedule Type` - -## 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/doc/models/fulfillment-delivery-details.md b/doc/models/fulfillment-delivery-details.md deleted file mode 100644 index 438b19043..000000000 --- a/doc/models/fulfillment-delivery-details.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Fulfillment Delivery Details - -Describes delivery details of an order fulfillment. - -## Structure - -`Fulfillment Delivery Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `recipient` | [`Fulfillment Recipient Hash`](../../doc/models/fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | -| `schedule_type` | [`String (Fulfillment Delivery Details Order Fulfillment Delivery Details Schedule Type)`](../../doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md) | Optional | The schedule type of the delivery fulfillment. | -| `placed_at` | `String` | 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". | -| `deliver_at` | `String` | 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"). | -| `prep_time_duration` | `String` | Optional | The duration of time it takes to prepare and deliver this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | -| `delivery_window_duration` | `String` | 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` | 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` | -| `completed_at` | `String` | 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"). | -| `in_progress_at` | `String` | 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"). | -| `rejected_at` | `String` | 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"). | -| `ready_at` | `String` | 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"). | -| `delivered_at` | `String` | 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"). | -| `canceled_at` | `String` | 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"). | -| `cancel_reason` | `String` | Optional | The delivery cancellation reason. Max length: 100 characters.
**Constraints**: *Maximum Length*: `100` | -| `courier_pickup_at` | `String` | 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"). | -| `courier_pickup_window_duration` | `String` | 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"). | -| `is_no_contact_delivery` | `TrueClass \| FalseClass` | Optional | Whether the delivery is preferred to be no contact. | -| `dropoff_notes` | `String` | Optional | A note to provide additional instructions about how to deliver the order.
**Constraints**: *Maximum Length*: `550` | -| `courier_provider_name` | `String` | Optional | The name of the courier provider.
**Constraints**: *Maximum Length*: `255` | -| `courier_support_phone_number` | `String` | Optional | The support phone number of the courier.
**Constraints**: *Maximum Length*: `17` | -| `square_delivery_id` | `String` | Optional | The identifier for the delivery created by Square.
**Constraints**: *Maximum Length*: `50` | -| `external_delivery_id` | `String` | Optional | The identifier for the delivery created by the third-party courier service.
**Constraints**: *Maximum Length*: `50` | -| `managed_delivery` | `TrueClass \| FalseClass` | 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/doc/models/fulfillment-fulfillment-entry.md b/doc/models/fulfillment-fulfillment-entry.md deleted file mode 100644 index 014d68abd..000000000 --- a/doc/models/fulfillment-fulfillment-entry.md +++ /dev/null @@ -1,34 +0,0 @@ - -# 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 - -`Fulfillment Fulfillment Entry` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the fulfillment entry only within this order.
**Constraints**: *Maximum Length*: `60` | -| `line_item_uid` | `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` | `Hash[String, String]` | 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/doc/models/fulfillment-fulfillment-line-item-application.md b/doc/models/fulfillment-fulfillment-line-item-application.md deleted file mode 100644 index 03b0c4aaa..000000000 --- a/doc/models/fulfillment-fulfillment-line-item-application.md +++ /dev/null @@ -1,17 +0,0 @@ - -# 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 - -`Fulfillment Fulfillment Line Item Application` - -## Fields - -| Name | Description | -| --- | --- | -| `ALL` | If `ALL`, `entries` must be unset. | -| `ENTRY_LIST` | If `ENTRY_LIST`, supply a list of `entries`. | - diff --git a/doc/models/fulfillment-pickup-details-curbside-pickup-details.md b/doc/models/fulfillment-pickup-details-curbside-pickup-details.md deleted file mode 100644 index 6f3408ed9..000000000 --- a/doc/models/fulfillment-pickup-details-curbside-pickup-details.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Fulfillment Pickup Details Curbside Pickup Details - -Specific details for curbside pickup. - -## Structure - -`Fulfillment Pickup Details Curbside Pickup Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `curbside_details` | `String` | Optional | Specific details for curbside pickup, such as parking number and vehicle model.
**Constraints**: *Maximum Length*: `250` | -| `buyer_arrived_at` | `String` | 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/doc/models/fulfillment-pickup-details-schedule-type.md b/doc/models/fulfillment-pickup-details-schedule-type.md deleted file mode 100644 index 986c3ba2b..000000000 --- a/doc/models/fulfillment-pickup-details-schedule-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Fulfillment Pickup Details Schedule Type - -The schedule type of the pickup fulfillment. - -## Enumeration - -`Fulfillment Pickup Details Schedule Type` - -## 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/doc/models/fulfillment-pickup-details.md b/doc/models/fulfillment-pickup-details.md deleted file mode 100644 index 8305ae190..000000000 --- a/doc/models/fulfillment-pickup-details.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Fulfillment Pickup Details - -Contains details necessary to fulfill a pickup order. - -## Structure - -`Fulfillment Pickup Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `recipient` | [`Fulfillment Recipient Hash`](../../doc/models/fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | -| `expires_at` | `String` | 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. | -| `auto_complete_duration` | `String` | 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. | -| `schedule_type` | [`String (Fulfillment Pickup Details Schedule Type)`](../../doc/models/fulfillment-pickup-details-schedule-type.md) | Optional | The schedule type of the pickup fulfillment. | -| `pickup_at` | `String` | 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. | -| `pickup_window_duration` | `String` | 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. | -| `prep_time_duration` | `String` | Optional | The duration of time it takes to prepare this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | -| `note` | `String` | 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` | -| `placed_at` | `String` | 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"). | -| `accepted_at` | `String` | 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"). | -| `rejected_at` | `String` | 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"). | -| `ready_at` | `String` | 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"). | -| `expired_at` | `String` | 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"). | -| `picked_up_at` | `String` | 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"). | -| `canceled_at` | `String` | 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"). | -| `cancel_reason` | `String` | Optional | A description of why the pickup was canceled. The maximum length: 100 characters.
**Constraints**: *Maximum Length*: `100` | -| `is_curbside_pickup` | `TrueClass \| FalseClass` | Optional | If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. | -| `curbside_pickup_details` | [`Fulfillment Pickup Details Curbside Pickup Details Hash`](../../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/doc/models/fulfillment-recipient.md b/doc/models/fulfillment-recipient.md deleted file mode 100644 index 9528f331d..000000000 --- a/doc/models/fulfillment-recipient.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Fulfillment Recipient - -Information about the fulfillment recipient. - -## Structure - -`Fulfillment Recipient` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | 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` | -| `display_name` | `String` | 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` | -| `email_address` | `String` | 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` | -| `phone_number` | `String` | 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 Hash`](../../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/doc/models/fulfillment-shipment-details.md b/doc/models/fulfillment-shipment-details.md deleted file mode 100644 index e318e2e62..000000000 --- a/doc/models/fulfillment-shipment-details.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Fulfillment Shipment Details - -Contains the details necessary to fulfill a shipment order. - -## Structure - -`Fulfillment Shipment Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `recipient` | [`Fulfillment Recipient Hash`](../../doc/models/fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | -| `carrier` | `String` | Optional | The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).
**Constraints**: *Maximum Length*: `50` | -| `shipping_note` | `String` | Optional | A note with additional information for the shipping carrier.
**Constraints**: *Maximum Length*: `500` | -| `shipping_type` | `String` | Optional | A description of the type of shipping product purchased from the carrier
(such as First Class, Priority, or Express).
**Constraints**: *Maximum Length*: `50` | -| `tracking_number` | `String` | Optional | The reference number provided by the carrier to track the shipment's progress.
**Constraints**: *Maximum Length*: `100` | -| `tracking_url` | `String` | Optional | A link to the tracking webpage on the carrier's website.
**Constraints**: *Maximum Length*: `2000` | -| `placed_at` | `String` | 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"). | -| `in_progress_at` | `String` | 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"). | -| `packaged_at` | `String` | 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"). | -| `expected_shipped_at` | `String` | 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"). | -| `shipped_at` | `String` | 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"). | -| `canceled_at` | `String` | 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"). | -| `cancel_reason` | `String` | Optional | A description of why the shipment was canceled.
**Constraints**: *Maximum Length*: `100` | -| `failed_at` | `String` | 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"). | -| `failure_reason` | `String` | 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/doc/models/fulfillment-state.md b/doc/models/fulfillment-state.md deleted file mode 100644 index c227acd64..000000000 --- a/doc/models/fulfillment-state.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Fulfillment State - -The current state of this fulfillment. - -## Enumeration - -`Fulfillment State` - -## 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/doc/models/fulfillment-type.md b/doc/models/fulfillment-type.md deleted file mode 100644 index 83d54068e..000000000 --- a/doc/models/fulfillment-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Fulfillment Type - -The type of fulfillment. - -## Enumeration - -`Fulfillment Type` - -## 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/doc/models/fulfillment.md b/doc/models/fulfillment.md deleted file mode 100644 index ef9b55716..000000000 --- a/doc/models/fulfillment.md +++ /dev/null @@ -1,48 +0,0 @@ - -# 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` | Optional | A unique ID that identifies the fulfillment only within this order.
**Constraints**: *Maximum Length*: `60` | -| `type` | [`String (Fulfillment Type)`](../../doc/models/fulfillment-type.md) | Optional | The type of fulfillment. | -| `state` | [`String (Fulfillment State)`](../../doc/models/fulfillment-state.md) | Optional | The current state of this fulfillment. | -| `line_item_application` | [`String (Fulfillment Fulfillment Line Item Application)`](../../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` | [`Array`](../../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` | `Hash[String, String]` | 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). | -| `pickup_details` | [`Fulfillment Pickup Details Hash`](../../doc/models/fulfillment-pickup-details.md) | Optional | Contains details necessary to fulfill a pickup order. | -| `shipment_details` | [`Fulfillment Shipment Details Hash`](../../doc/models/fulfillment-shipment-details.md) | Optional | Contains the details necessary to fulfill a shipment order. | -| `delivery_details` | [`Fulfillment Delivery Details Hash`](../../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/doc/models/get-bank-account-by-v1-id-response.md b/doc/models/get-bank-account-by-v1-id-response.md deleted file mode 100644 index 8c5fd73f1..000000000 --- a/doc/models/get-bank-account-by-v1-id-response.md +++ /dev/null @@ -1,62 +0,0 @@ - -# Get Bank Account by V1 Id Response - -Response object returned by GetBankAccountByV1Id. - -## Structure - -`Get Bank Account by V1 Id Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `bank_account` | [`Bank Account Hash`](../../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/doc/models/get-bank-account-response.md b/doc/models/get-bank-account-response.md deleted file mode 100644 index 46550acf0..000000000 --- a/doc/models/get-bank-account-response.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Get Bank Account Response - -Response object returned by `GetBankAccount`. - -## Structure - -`Get Bank Account Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `bank_account` | [`Bank Account Hash`](../../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/doc/models/get-break-type-response.md b/doc/models/get-break-type-response.md deleted file mode 100644 index 878b3867b..000000000 --- a/doc/models/get-break-type-response.md +++ /dev/null @@ -1,49 +0,0 @@ - -# 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 - -`Get Break Type Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `break_type` | [`Break Type Hash`](../../doc/models/break-type.md) | Optional | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | -| `errors` | [`Array`](../../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/doc/models/get-device-code-response.md b/doc/models/get-device-code-response.md deleted file mode 100644 index dbd5b32db..000000000 --- a/doc/models/get-device-code-response.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Get Device Code Response - -## Structure - -`Get Device Code Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `device_code` | [`Device Code Hash`](../../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/doc/models/get-device-response.md b/doc/models/get-device-response.md deleted file mode 100644 index 25ac3ea46..000000000 --- a/doc/models/get-device-response.md +++ /dev/null @@ -1,191 +0,0 @@ - -# Get Device Response - -## Structure - -`Get Device Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `device` | [`Device Hash`](../../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/doc/models/get-employee-wage-response.md b/doc/models/get-employee-wage-response.md deleted file mode 100644 index ac1ce0842..000000000 --- a/doc/models/get-employee-wage-response.md +++ /dev/null @@ -1,54 +0,0 @@ - -# 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 - -`Get Employee Wage Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `employee_wage` | [`Employee Wage Hash`](../../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` | [`Array`](../../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/doc/models/get-invoice-response.md b/doc/models/get-invoice-response.md deleted file mode 100644 index 85ca6d25a..000000000 --- a/doc/models/get-invoice-response.md +++ /dev/null @@ -1,106 +0,0 @@ - -# Get Invoice Response - -Describes a `GetInvoice` response. - -## Structure - -`Get Invoice Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice` | [`Invoice Hash`](../../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` | [`Array`](../../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/doc/models/get-payment-refund-response.md b/doc/models/get-payment-refund-response.md deleted file mode 100644 index bba7dea0f..000000000 --- a/doc/models/get-payment-refund-response.md +++ /dev/null @@ -1,100 +0,0 @@ - -# 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 - -`Get Payment Refund Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `refund` | [`Payment Refund Hash`](../../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/doc/models/get-payment-response.md b/doc/models/get-payment-response.md deleted file mode 100644 index 67e1df820..000000000 --- a/doc/models/get-payment-response.md +++ /dev/null @@ -1,101 +0,0 @@ - -# Get Payment Response - -Defines the response returned by [GetPayment](../../doc/api/payments.md#get-payment). - -## Structure - -`Get Payment Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `payment` | [`Payment Hash`](../../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/doc/models/get-payout-response.md b/doc/models/get-payout-response.md deleted file mode 100644 index 7920543af..000000000 --- a/doc/models/get-payout-response.md +++ /dev/null @@ -1,54 +0,0 @@ - -# Get Payout Response - -## Structure - -`Get Payout Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payout` | [`Payout Hash`](../../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` | [`Array`](../../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/doc/models/get-shift-response.md b/doc/models/get-shift-response.md deleted file mode 100644 index 0fd2c92fa..000000000 --- a/doc/models/get-shift-response.md +++ /dev/null @@ -1,82 +0,0 @@ - -# 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 - -`Get Shift Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `shift` | [`Shift Hash`](../../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` | [`Array`](../../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/doc/models/get-team-member-wage-response.md b/doc/models/get-team-member-wage-response.md deleted file mode 100644 index 0bca5bea0..000000000 --- a/doc/models/get-team-member-wage-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# 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 - -`Get Team Member Wage Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_wage` | [`Team Member Wage Hash`](../../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` | [`Array`](../../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/doc/models/get-terminal-action-response.md b/doc/models/get-terminal-action-response.md deleted file mode 100644 index 8047e8912..000000000 --- a/doc/models/get-terminal-action-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Get Terminal Action Response - -## Structure - -`Get Terminal Action Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `action` | [`Terminal Action Hash`](../../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/doc/models/get-terminal-checkout-response.md b/doc/models/get-terminal-checkout-response.md deleted file mode 100644 index b1a46f361..000000000 --- a/doc/models/get-terminal-checkout-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Get Terminal Checkout Response - -## Structure - -`Get Terminal Checkout Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `checkout` | [`Terminal Checkout Hash`](../../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/doc/models/get-terminal-refund-response.md b/doc/models/get-terminal-refund-response.md deleted file mode 100644 index a076feecb..000000000 --- a/doc/models/get-terminal-refund-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Get Terminal Refund Response - -## Structure - -`Get Terminal Refund Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `refund` | [`Terminal Refund Hash`](../../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/doc/models/gift-card-activity-activate.md b/doc/models/gift-card-activity-activate.md deleted file mode 100644 index 676a81f50..000000000 --- a/doc/models/gift-card-activity-activate.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Gift Card Activity Activate - -Represents details about an `ACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Activate` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `amount_money` | [`Money Hash`](../../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. | -| `order_id` | `String` | 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. | -| `line_item_uid` | `String` | 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. | -| `reference_id` | `String` | 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. | -| `buyer_payment_instrument_ids` | `Array` | 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/doc/models/gift-card-activity-adjust-decrement-reason.md b/doc/models/gift-card-activity-adjust-decrement-reason.md deleted file mode 100644 index 6255913c3..000000000 --- a/doc/models/gift-card-activity-adjust-decrement-reason.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Gift Card Activity Adjust Decrement Reason - -Indicates the reason for deducting money from a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`Gift Card Activity Adjust Decrement Reason` - -## 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/doc/models/gift-card-activity-adjust-decrement.md b/doc/models/gift-card-activity-adjust-decrement.md deleted file mode 100644 index 914c846c5..000000000 --- a/doc/models/gift-card-activity-adjust-decrement.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Gift Card Activity Adjust Decrement - -Represents details about an `ADJUST_DECREMENT` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Adjust Decrement` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `amount_money` | [`Money Hash`](../../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 (Gift Card Activity Adjust Decrement Reason)`](../../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/doc/models/gift-card-activity-adjust-increment-reason.md b/doc/models/gift-card-activity-adjust-increment-reason.md deleted file mode 100644 index 8d1793afa..000000000 --- a/doc/models/gift-card-activity-adjust-increment-reason.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Gift Card Activity Adjust Increment Reason - -Indicates the reason for adding money to a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`Gift Card Activity Adjust Increment Reason` - -## 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/doc/models/gift-card-activity-adjust-increment.md b/doc/models/gift-card-activity-adjust-increment.md deleted file mode 100644 index a9960308c..000000000 --- a/doc/models/gift-card-activity-adjust-increment.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Gift Card Activity Adjust Increment - -Represents details about an `ADJUST_INCREMENT` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Adjust Increment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `amount_money` | [`Money Hash`](../../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 (Gift Card Activity Adjust Increment Reason)`](../../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/doc/models/gift-card-activity-block-reason.md b/doc/models/gift-card-activity-block-reason.md deleted file mode 100644 index e779b29bf..000000000 --- a/doc/models/gift-card-activity-block-reason.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Gift Card Activity Block Reason - -Indicates the reason for blocking a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`Gift Card Activity Block Reason` - -## Fields - -| Name | Description | -| --- | --- | -| `CHARGEBACK_BLOCK` | The gift card is blocked because the buyer initiated a chargeback on the gift card purchase. | - diff --git a/doc/models/gift-card-activity-block.md b/doc/models/gift-card-activity-block.md deleted file mode 100644 index 802790ecc..000000000 --- a/doc/models/gift-card-activity-block.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Gift Card Activity Block - -Represents details about a `BLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Block` - -## 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/doc/models/gift-card-activity-clear-balance-reason.md b/doc/models/gift-card-activity-clear-balance-reason.md deleted file mode 100644 index cebe54864..000000000 --- a/doc/models/gift-card-activity-clear-balance-reason.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Gift Card Activity Clear Balance Reason - -Indicates the reason for clearing the balance of a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`Gift Card Activity Clear Balance Reason` - -## 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/doc/models/gift-card-activity-clear-balance.md b/doc/models/gift-card-activity-clear-balance.md deleted file mode 100644 index 211d76d2f..000000000 --- a/doc/models/gift-card-activity-clear-balance.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Gift Card Activity Clear Balance - -Represents details about a `CLEAR_BALANCE` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Clear Balance` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `reason` | [`String (Gift Card Activity Clear Balance Reason)`](../../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/doc/models/gift-card-activity-deactivate-reason.md b/doc/models/gift-card-activity-deactivate-reason.md deleted file mode 100644 index 244b6c34f..000000000 --- a/doc/models/gift-card-activity-deactivate-reason.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Gift Card Activity Deactivate Reason - -Indicates the reason for deactivating a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`Gift Card Activity Deactivate Reason` - -## 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/doc/models/gift-card-activity-deactivate.md b/doc/models/gift-card-activity-deactivate.md deleted file mode 100644 index d8aeb089c..000000000 --- a/doc/models/gift-card-activity-deactivate.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Gift Card Activity Deactivate - -Represents details about a `DEACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Deactivate` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `reason` | [`String (Gift Card Activity Deactivate Reason)`](../../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/doc/models/gift-card-activity-import-reversal.md b/doc/models/gift-card-activity-import-reversal.md deleted file mode 100644 index 9d257d201..000000000 --- a/doc/models/gift-card-activity-import-reversal.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Gift Card Activity Import Reversal - -Represents details about an `IMPORT_REVERSAL` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Import Reversal` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `amount_money` | [`Money Hash`](../../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/doc/models/gift-card-activity-import.md b/doc/models/gift-card-activity-import.md deleted file mode 100644 index 14066a73f..000000000 --- a/doc/models/gift-card-activity-import.md +++ /dev/null @@ -1,28 +0,0 @@ - -# 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 - -`Gift Card Activity Import` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `amount_money` | [`Money Hash`](../../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/doc/models/gift-card-activity-load.md b/doc/models/gift-card-activity-load.md deleted file mode 100644 index 68d16f932..000000000 --- a/doc/models/gift-card-activity-load.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Gift Card Activity Load - -Represents details about a `LOAD` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Load` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `amount_money` | [`Money Hash`](../../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. | -| `order_id` | `String` | 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. | -| `line_item_uid` | `String` | 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. | -| `reference_id` | `String` | 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. | -| `buyer_payment_instrument_ids` | `Array` | 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/doc/models/gift-card-activity-redeem-status.md b/doc/models/gift-card-activity-redeem-status.md deleted file mode 100644 index 40355f395..000000000 --- a/doc/models/gift-card-activity-redeem-status.md +++ /dev/null @@ -1,19 +0,0 @@ - -# 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 - -`Gift Card Activity Redeem Status` - -## 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/doc/models/gift-card-activity-redeem.md b/doc/models/gift-card-activity-redeem.md deleted file mode 100644 index 36149bbdb..000000000 --- a/doc/models/gift-card-activity-redeem.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Gift Card Activity Redeem - -Represents details about a `REDEEM` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Redeem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `amount_money` | [`Money Hash`](../../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. | -| `payment_id` | `String` | Optional | The ID of the payment that represents the gift card redemption. Square populates this field
if the payment was processed by Square. | -| `reference_id` | `String` | 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 (Gift Card Activity Redeem Status)`](../../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/doc/models/gift-card-activity-refund.md b/doc/models/gift-card-activity-refund.md deleted file mode 100644 index c23bb8ba0..000000000 --- a/doc/models/gift-card-activity-refund.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Gift Card Activity Refund - -Represents details about a `REFUND` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Refund` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `redeem_activity_id` | `String` | 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. | -| `amount_money` | [`Money Hash`](../../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. | -| `reference_id` | `String` | Optional | A client-specified ID that associates the gift card activity with an entity in another system. | -| `payment_id` | `String` | 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/doc/models/gift-card-activity-transfer-balance-from.md b/doc/models/gift-card-activity-transfer-balance-from.md deleted file mode 100644 index 1dec7d066..000000000 --- a/doc/models/gift-card-activity-transfer-balance-from.md +++ /dev/null @@ -1,28 +0,0 @@ - -# 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 - -`Gift Card Activity Transfer Balance From` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `transfer_to_gift_card_id` | `String` | Required | The ID of the gift card to which the specified amount was transferred. | -| `amount_money` | [`Money Hash`](../../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/doc/models/gift-card-activity-transfer-balance-to.md b/doc/models/gift-card-activity-transfer-balance-to.md deleted file mode 100644 index 3905da621..000000000 --- a/doc/models/gift-card-activity-transfer-balance-to.md +++ /dev/null @@ -1,28 +0,0 @@ - -# 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 - -`Gift Card Activity Transfer Balance To` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `transfer_from_gift_card_id` | `String` | Required | The ID of the gift card from which the specified amount was transferred. | -| `amount_money` | [`Money Hash`](../../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/doc/models/gift-card-activity-type.md b/doc/models/gift-card-activity-type.md deleted file mode 100644 index 4d8205755..000000000 --- a/doc/models/gift-card-activity-type.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Gift Card Activity Type - -Indicates the type of [gift card activity](../../doc/models/gift-card-activity.md). - -## Enumeration - -`Gift Card Activity Type` - -## 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/doc/models/gift-card-activity-unblock-reason.md b/doc/models/gift-card-activity-unblock-reason.md deleted file mode 100644 index 60d38eaa9..000000000 --- a/doc/models/gift-card-activity-unblock-reason.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Gift Card Activity Unblock Reason - -Indicates the reason for unblocking a [gift card](../../doc/models/gift-card.md). - -## Enumeration - -`Gift Card Activity Unblock Reason` - -## Fields - -| Name | Description | -| --- | --- | -| `CHARGEBACK_UNBLOCK` | The gift card is unblocked because a chargeback was ruled in favor of the seller. | - diff --git a/doc/models/gift-card-activity-unblock.md b/doc/models/gift-card-activity-unblock.md deleted file mode 100644 index f625ef0c1..000000000 --- a/doc/models/gift-card-activity-unblock.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Gift Card Activity Unblock - -Represents details about an `UNBLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). - -## Structure - -`Gift Card Activity Unblock` - -## 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/doc/models/gift-card-activity-unlinked-activity-refund.md b/doc/models/gift-card-activity-unlinked-activity-refund.md deleted file mode 100644 index 4fb8c6ac1..000000000 --- a/doc/models/gift-card-activity-unlinked-activity-refund.md +++ /dev/null @@ -1,30 +0,0 @@ - -# 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 - -`Gift Card Activity Unlinked Activity Refund` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `amount_money` | [`Money Hash`](../../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. | -| `reference_id` | `String` | Optional | A client-specified ID that associates the gift card activity with an entity in another system. | -| `payment_id` | `String` | 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/doc/models/gift-card-activity.md b/doc/models/gift-card-activity.md deleted file mode 100644 index b0fc19413..000000000 --- a/doc/models/gift-card-activity.md +++ /dev/null @@ -1,55 +0,0 @@ - -# 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 - -`Gift Card Activity` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The Square-assigned ID of the gift card activity. | -| `type` | [`String (Gift Card Activity Type)`](../../doc/models/gift-card-activity-type.md) | Required | Indicates the type of [gift card activity](../../doc/models/gift-card-activity.md). | -| `location_id` | `String` | Required | The ID of the [business location](entity:Location) where the activity occurred. | -| `created_at` | `String` | Optional | The timestamp when the gift card activity was created, in RFC 3339 format. | -| `gift_card_id` | `String` | Optional | The gift card ID. When creating a gift card activity, `gift_card_id` is not required if
`gift_card_gan` is specified. | -| `gift_card_gan` | `String` | 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. | -| `gift_card_balance_money` | [`Money Hash`](../../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. | -| `load_activity_details` | [`Gift Card Activity Load Hash`](../../doc/models/gift-card-activity-load.md) | Optional | Represents details about a `LOAD` [gift card activity type](../../doc/models/gift-card-activity-type.md). | -| `activate_activity_details` | [`Gift Card Activity Activate Hash`](../../doc/models/gift-card-activity-activate.md) | Optional | Represents details about an `ACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). | -| `redeem_activity_details` | [`Gift Card Activity Redeem Hash`](../../doc/models/gift-card-activity-redeem.md) | Optional | Represents details about a `REDEEM` [gift card activity type](../../doc/models/gift-card-activity-type.md). | -| `clear_balance_activity_details` | [`Gift Card Activity Clear Balance Hash`](../../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). | -| `deactivate_activity_details` | [`Gift Card Activity Deactivate Hash`](../../doc/models/gift-card-activity-deactivate.md) | Optional | Represents details about a `DEACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). | -| `adjust_increment_activity_details` | [`Gift Card Activity Adjust Increment Hash`](../../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). | -| `adjust_decrement_activity_details` | [`Gift Card Activity Adjust Decrement Hash`](../../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). | -| `refund_activity_details` | [`Gift Card Activity Refund Hash`](../../doc/models/gift-card-activity-refund.md) | Optional | Represents details about a `REFUND` [gift card activity type](../../doc/models/gift-card-activity-type.md). | -| `unlinked_activity_refund_activity_details` | [`Gift Card Activity Unlinked Activity Refund Hash`](../../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). | -| `import_activity_details` | [`Gift Card Activity Import Hash`](../../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`. | -| `block_activity_details` | [`Gift Card Activity Block Hash`](../../doc/models/gift-card-activity-block.md) | Optional | Represents details about a `BLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). | -| `unblock_activity_details` | [`Gift Card Activity Unblock Hash`](../../doc/models/gift-card-activity-unblock.md) | Optional | Represents details about an `UNBLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). | -| `import_reversal_activity_details` | [`Gift Card Activity Import Reversal Hash`](../../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). | -| `transfer_balance_to_activity_details` | [`Gift Card Activity Transfer Balance To Hash`](../../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). | -| `transfer_balance_from_activity_details` | [`Gift Card Activity Transfer Balance From Hash`](../../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/doc/models/gift-card-gan-source.md b/doc/models/gift-card-gan-source.md deleted file mode 100644 index 25b48b6d9..000000000 --- a/doc/models/gift-card-gan-source.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Gift Card GAN Source - -Indicates the source that generated the gift card -account number (GAN). - -## Enumeration - -`Gift Card GAN Source` - -## 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/doc/models/gift-card-status.md b/doc/models/gift-card-status.md deleted file mode 100644 index 7c02afe1a..000000000 --- a/doc/models/gift-card-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Gift Card Status - -Indicates the gift card state. - -## Enumeration - -`Gift Card Status` - -## 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/doc/models/gift-card-type.md b/doc/models/gift-card-type.md deleted file mode 100644 index 7913227b4..000000000 --- a/doc/models/gift-card-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Gift Card Type - -Indicates the gift card type. - -## Enumeration - -`Gift Card Type` - -## Fields - -| Name | Description | -| --- | --- | -| `PHYSICAL` | A plastic gift card. | -| `DIGITAL` | A digital gift card. | - diff --git a/doc/models/gift-card.md b/doc/models/gift-card.md deleted file mode 100644 index 2bae52e25..000000000 --- a/doc/models/gift-card.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Gift Card - -Represents a Square gift card. - -## Structure - -`Gift Card` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The Square-assigned ID of the gift card. | -| `type` | [`String (Gift Card Type)`](../../doc/models/gift-card-type.md) | Required | Indicates the gift card type. | -| `gan_source` | [`String (Gift Card GAN Source)`](../../doc/models/gift-card-gan-source.md) | Optional | Indicates the source that generated the gift card
account number (GAN). | -| `state` | [`String (Gift Card Status)`](../../doc/models/gift-card-status.md) | Optional | Indicates the gift card state. | -| `balance_money` | [`Money Hash`](../../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` | Optional | The gift card account number (GAN). Buyers can use the GAN to make purchases or check
the gift card balance. | -| `created_at` | `String` | 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. | -| `customer_ids` | `Array` | 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/doc/models/inventory-adjustment-group.md b/doc/models/inventory-adjustment-group.md deleted file mode 100644 index cd4813139..000000000 --- a/doc/models/inventory-adjustment-group.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Inventory Adjustment Group - -## Structure - -`Inventory Adjustment Group` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | A unique ID generated by Square for the
`InventoryAdjustmentGroup`.
**Constraints**: *Maximum Length*: `100` | -| `root_adjustment_id` | `String` | Optional | The inventory adjustment of the composed variation.
**Constraints**: *Maximum Length*: `100` | -| `from_state` | [`String (Inventory State)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | -| `to_state` | [`String (Inventory State)`](../../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/doc/models/inventory-adjustment.md b/doc/models/inventory-adjustment.md deleted file mode 100644 index 1ffb74cd1..000000000 --- a/doc/models/inventory-adjustment.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Inventory Adjustment - -Represents a change in state or quantity of product inventory at a -particular time and location. - -## Structure - -`Inventory Adjustment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | A unique ID generated by Square for the
`InventoryAdjustment`.
**Constraints**: *Maximum Length*: `100` | -| `reference_id` | `String` | Optional | An optional ID provided by the application to tie the
`InventoryAdjustment` to an external
system.
**Constraints**: *Maximum Length*: `255` | -| `from_state` | [`String (Inventory State)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | -| `to_state` | [`String (Inventory State)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | -| `location_id` | `String` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items is being tracked.
**Constraints**: *Maximum Length*: `100` | -| `catalog_object_id` | `String` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | -| `catalog_object_type` | `String` | 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` | 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` | -| `total_price_money` | [`Money Hash`](../../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. | -| `occurred_at` | `String` | 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` | -| `created_at` | `String` | Optional | An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received.
**Constraints**: *Maximum Length*: `34` | -| `source` | [`Source Application Hash`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | -| `employee_id` | `String` | Optional | The Square-generated ID of the [Employee](entity:Employee) responsible for the
inventory adjustment.
**Constraints**: *Maximum Length*: `100` | -| `team_member_id` | `String` | Optional | The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the
inventory adjustment.
**Constraints**: *Maximum Length*: `100` | -| `transaction_id` | `String` | 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` | -| `refund_id` | `String` | 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` | -| `purchase_order_id` | `String` | 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` | -| `goods_receipt_id` | `String` | 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` | -| `adjustment_group` | [`Inventory Adjustment Group Hash`](../../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/doc/models/inventory-alert-type.md b/doc/models/inventory-alert-type.md deleted file mode 100644 index 9e350ec97..000000000 --- a/doc/models/inventory-alert-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Inventory Alert Type - -Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. - -## Enumeration - -`Inventory Alert Type` - -## 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/doc/models/inventory-change-type.md b/doc/models/inventory-change-type.md deleted file mode 100644 index 02933da71..000000000 --- a/doc/models/inventory-change-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Inventory Change Type - -Indicates how the inventory change was applied to a tracked product quantity. - -## Enumeration - -`Inventory Change Type` - -## 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/doc/models/inventory-change.md b/doc/models/inventory-change.md deleted file mode 100644 index aed8bff93..000000000 --- a/doc/models/inventory-change.md +++ /dev/null @@ -1,64 +0,0 @@ - -# 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 - -`Inventory Change` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | [`String (Inventory Change Type)`](../../doc/models/inventory-change-type.md) | Optional | Indicates how the inventory change was applied to a tracked product quantity. | -| `physical_count` | [`Inventory Physical Count Hash`](../../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` | [`Inventory Adjustment Hash`](../../doc/models/inventory-adjustment.md) | Optional | Represents a change in state or quantity of product inventory at a
particular time and location. | -| `transfer` | [`Inventory Transfer Hash`](../../doc/models/inventory-transfer.md) | Optional | Represents the transfer of a quantity of product inventory at a
particular time from one location to another. | -| `measurement_unit` | [`Catalog Measurement Unit Hash`](../../doc/models/catalog-measurement-unit.md) | Optional | Represents the unit used to measure a `CatalogItemVariation` and
specifies the precision for decimal quantities. | -| `measurement_unit_id` | `String` | 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/doc/models/inventory-count.md b/doc/models/inventory-count.md deleted file mode 100644 index 167a954f1..000000000 --- a/doc/models/inventory-count.md +++ /dev/null @@ -1,35 +0,0 @@ - -# 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 - -`Inventory Count` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `catalog_object_id` | `String` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | -| `catalog_object_type` | `String` | 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 (Inventory State)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | -| `location_id` | `String` | 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` | 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` | -| `calculated_at` | `String` | 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` | -| `is_estimated` | `TrueClass \| FalseClass` | 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/doc/models/inventory-physical-count.md b/doc/models/inventory-physical-count.md deleted file mode 100644 index 55de882df..000000000 --- a/doc/models/inventory-physical-count.md +++ /dev/null @@ -1,41 +0,0 @@ - -# 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 - -`Inventory Physical Count` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | A unique Square-generated ID for the
[InventoryPhysicalCount](entity:InventoryPhysicalCount).
**Constraints**: *Maximum Length*: `100` | -| `reference_id` | `String` | Optional | An optional ID provided by the application to tie the
[InventoryPhysicalCount](entity:InventoryPhysicalCount) to an external
system.
**Constraints**: *Maximum Length*: `255` | -| `catalog_object_id` | `String` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | -| `catalog_object_type` | `String` | 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 (Inventory State)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | -| `location_id` | `String` | 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` | 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` | [`Source Application Hash`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | -| `employee_id` | `String` | Optional | The Square-generated ID of the [Employee](entity:Employee) responsible for the
physical count.
**Constraints**: *Maximum Length*: `100` | -| `team_member_id` | `String` | Optional | The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the
physical count.
**Constraints**: *Maximum Length*: `100` | -| `occurred_at` | `String` | 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` | -| `created_at` | `String` | 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/doc/models/inventory-state.md b/doc/models/inventory-state.md deleted file mode 100644 index 08e710d21..000000000 --- a/doc/models/inventory-state.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Inventory State - -Indicates the state of a tracked item quantity in the lifecycle of goods. - -## Enumeration - -`Inventory State` - -## 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/doc/models/inventory-transfer.md b/doc/models/inventory-transfer.md deleted file mode 100644 index 38fee9925..000000000 --- a/doc/models/inventory-transfer.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Inventory Transfer - -Represents the transfer of a quantity of product inventory at a -particular time from one location to another. - -## Structure - -`Inventory Transfer` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | A unique ID generated by Square for the
`InventoryTransfer`.
**Constraints**: *Maximum Length*: `100` | -| `reference_id` | `String` | Optional | An optional ID provided by the application to tie the
`InventoryTransfer` to an external system.
**Constraints**: *Maximum Length*: `255` | -| `state` | [`String (Inventory State)`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | -| `from_location_id` | `String` | 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` | -| `to_location_id` | `String` | 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` | -| `catalog_object_id` | `String` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | -| `catalog_object_type` | `String` | 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` | 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` | -| `occurred_at` | `String` | 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` | -| `created_at` | `String` | Optional | An RFC 3339-formatted timestamp that indicates when Square
received the transfer request.
**Constraints**: *Maximum Length*: `34` | -| `source` | [`Source Application Hash`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | -| `employee_id` | `String` | Optional | The Square-generated ID of the [Employee](entity:Employee) responsible for the
inventory transfer.
**Constraints**: *Maximum Length*: `100` | -| `team_member_id` | `String` | 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/doc/models/invoice-accepted-payment-methods.md b/doc/models/invoice-accepted-payment-methods.md deleted file mode 100644 index 48dd12aa6..000000000 --- a/doc/models/invoice-accepted-payment-methods.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 - -`Invoice Accepted Payment Methods` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `card` | `TrueClass \| FalseClass` | Optional | Indicates whether credit card or debit card payments are accepted. The default value is `false`. | -| `square_gift_card` | `TrueClass \| FalseClass` | Optional | Indicates whether Square gift card payments are accepted. The default value is `false`. | -| `bank_account` | `TrueClass \| FalseClass` | Optional | Indicates whether ACH bank transfer payments are accepted. The default value is `false`. | -| `buy_now_pay_later` | `TrueClass \| FalseClass` | 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). | -| `cash_app_pay` | `TrueClass \| FalseClass` | 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/doc/models/invoice-attachment.md b/doc/models/invoice-attachment.md deleted file mode 100644 index c03d439de..000000000 --- a/doc/models/invoice-attachment.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Invoice Attachment - -Represents a file attached to an [invoice](../../doc/models/invoice.md). - -## Structure - -`Invoice Attachment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The Square-assigned ID of the attachment. | -| `filename` | `String` | Optional | The file name of the attachment, which is displayed on the invoice. | -| `description` | `String` | Optional | The description of the attachment, which is displayed on the invoice.
This field maps to the seller-defined **Message** field. | -| `filesize` | `Integer` | Optional | The file size of the attachment in bytes. | -| `hash` | `String` | Optional | The MD5 hash that was generated from the file contents. | -| `mime_type` | `String` | 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. | -| `uploaded_at` | `String` | 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/doc/models/invoice-automatic-payment-source.md b/doc/models/invoice-automatic-payment-source.md deleted file mode 100644 index 1c066fb9f..000000000 --- a/doc/models/invoice-automatic-payment-source.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Invoice Automatic Payment Source - -Indicates the automatic payment method for an [invoice payment request](../../doc/models/invoice-payment-request.md). - -## Enumeration - -`Invoice Automatic Payment Source` - -## 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/doc/models/invoice-custom-field-placement.md b/doc/models/invoice-custom-field-placement.md deleted file mode 100644 index 3cbc8c78a..000000000 --- a/doc/models/invoice-custom-field-placement.md +++ /dev/null @@ -1,17 +0,0 @@ - -# 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 - -`Invoice Custom Field Placement` - -## 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/doc/models/invoice-custom-field.md b/doc/models/invoice-custom-field.md deleted file mode 100644 index d4ce6271e..000000000 --- a/doc/models/invoice-custom-field.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 - -`Invoice Custom Field` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `label` | `String` | Optional | The label or title of the custom field. This field is required for a custom field.
**Constraints**: *Maximum Length*: `30` | -| `value` | `String` | Optional | The text of the custom field. If omitted, only the label is rendered.
**Constraints**: *Maximum Length*: `2000` | -| `placement` | [`String (Invoice Custom Field Placement)`](../../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/doc/models/invoice-delivery-method.md b/doc/models/invoice-delivery-method.md deleted file mode 100644 index de8b5a47f..000000000 --- a/doc/models/invoice-delivery-method.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Invoice Delivery Method - -Indicates how Square delivers the [invoice](../../doc/models/invoice.md) to the customer. - -## Enumeration - -`Invoice Delivery Method` - -## 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/doc/models/invoice-filter.md b/doc/models/invoice-filter.md deleted file mode 100644 index 6f6b34984..000000000 --- a/doc/models/invoice-filter.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Invoice Filter - -Describes query filters to apply. - -## Structure - -`Invoice Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_ids` | `Array` | Required | Limits the search to the specified locations. A location is required.
In the current implementation, only one location can be specified. | -| `customer_ids` | `Array` | 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/doc/models/invoice-payment-reminder-status.md b/doc/models/invoice-payment-reminder-status.md deleted file mode 100644 index d8344706a..000000000 --- a/doc/models/invoice-payment-reminder-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Invoice Payment Reminder Status - -The status of a payment request reminder. - -## Enumeration - -`Invoice Payment Reminder Status` - -## 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/doc/models/invoice-payment-reminder.md b/doc/models/invoice-payment-reminder.md deleted file mode 100644 index 35a2fed9f..000000000 --- a/doc/models/invoice-payment-reminder.md +++ /dev/null @@ -1,33 +0,0 @@ - -# 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 - -`Invoice Payment Reminder` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A Square-assigned ID that uniquely identifies the reminder within the
`InvoicePaymentRequest`. | -| `relative_scheduled_days` | `Integer` | 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` | Optional | The reminder message.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1000` | -| `status` | [`String (Invoice Payment Reminder Status)`](../../doc/models/invoice-payment-reminder-status.md) | Optional | The status of a payment request reminder. | -| `sent_at` | `String` | 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/doc/models/invoice-payment-request.md b/doc/models/invoice-payment-request.md deleted file mode 100644 index cf4b51282..000000000 --- a/doc/models/invoice-payment-request.md +++ /dev/null @@ -1,47 +0,0 @@ - -# 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 - -`Invoice Payment Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | The Square-generated ID of the payment request in an [invoice](entity:Invoice).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | -| `request_method` | [`String (Invoice Request Method)`](../../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. | -| `request_type` | [`String (Invoice Request Type)`](../../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). | -| `due_date` | `String` | 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). | -| `fixed_amount_requested_money` | [`Money Hash`](../../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. | -| `percentage_requested` | `String` | 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. | -| `tipping_enabled` | `TrueClass \| FalseClass` | 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`. | -| `automatic_payment_source` | [`String (Invoice Automatic Payment Source)`](../../doc/models/invoice-automatic-payment-source.md) | Optional | Indicates the automatic payment method for an [invoice payment request](../../doc/models/invoice-payment-request.md). | -| `card_id` | `String` | 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` | [`Array`](../../doc/models/invoice-payment-reminder.md) | Optional | A list of one or more reminders to send for the payment request. | -| `computed_amount_money` | [`Money Hash`](../../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. | -| `total_completed_amount_money` | [`Money Hash`](../../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. | -| `rounding_adjustment_included_money` | [`Money Hash`](../../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/doc/models/invoice-query.md b/doc/models/invoice-query.md deleted file mode 100644 index 23626b88b..000000000 --- a/doc/models/invoice-query.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Invoice Query - -Describes query criteria for searching invoices. - -## Structure - -`Invoice Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filter` | [`Invoice Filter Hash`](../../doc/models/invoice-filter.md) | Required | Describes query filters to apply. | -| `sort` | [`Invoice Sort Hash`](../../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/doc/models/invoice-recipient-tax-ids.md b/doc/models/invoice-recipient-tax-ids.md deleted file mode 100644 index 60841a031..000000000 --- a/doc/models/invoice-recipient-tax-ids.md +++ /dev/null @@ -1,25 +0,0 @@ - -# 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 - -`Invoice Recipient Tax Ids` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `eu_vat` | `String` | Optional | The EU VAT identification number for the invoice recipient. For example, `IE3426675K`. | - -## Example (as JSON) - -```json -{ - "eu_vat": "eu_vat8" -} -``` - diff --git a/doc/models/invoice-recipient.md b/doc/models/invoice-recipient.md deleted file mode 100644 index f5b5dbf9c..000000000 --- a/doc/models/invoice-recipient.md +++ /dev/null @@ -1,45 +0,0 @@ - -# 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 - -`Invoice Recipient` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | 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` | -| `given_name` | `String` | Optional | The recipient's given (that is, first) name. | -| `family_name` | `String` | Optional | The recipient's family (that is, last) name. | -| `email_address` | `String` | Optional | The recipient's email address. | -| `address` | [`Address Hash`](../../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). | -| `phone_number` | `String` | Optional | The recipient's phone number. | -| `company_name` | `String` | Optional | The name of the recipient's company. | -| `tax_ids` | [`Invoice Recipient Tax Ids Hash`](../../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/doc/models/invoice-request-method.md b/doc/models/invoice-request-method.md deleted file mode 100644 index b78a864d3..000000000 --- a/doc/models/invoice-request-method.md +++ /dev/null @@ -1,24 +0,0 @@ - -# 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 - -`Invoice Request Method` - -## 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/doc/models/invoice-request-type.md b/doc/models/invoice-request-type.md deleted file mode 100644 index 8c43ef0df..000000000 --- a/doc/models/invoice-request-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# 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 - -`Invoice Request Type` - -## 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/doc/models/invoice-sort-field.md b/doc/models/invoice-sort-field.md deleted file mode 100644 index 4e72f6876..000000000 --- a/doc/models/invoice-sort-field.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Invoice Sort Field - -The field to use for sorting. - -## Enumeration - -`Invoice Sort Field` - -## 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/doc/models/invoice-sort.md b/doc/models/invoice-sort.md deleted file mode 100644 index 48dca7b41..000000000 --- a/doc/models/invoice-sort.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Invoice Sort - -Identifies the sort field and sort order. - -## Structure - -`Invoice Sort` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `field` | `String` | Required, Constant | The field to use for sorting.
**Default**: `'INVOICE_SORT_DATE'` | -| `order` | [`String (Sort Order)`](../../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/doc/models/invoice-status.md b/doc/models/invoice-status.md deleted file mode 100644 index d1908a646..000000000 --- a/doc/models/invoice-status.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Invoice Status - -Indicates the status of an invoice. - -## Enumeration - -`Invoice Status` - -## 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/doc/models/invoice.md b/doc/models/invoice.md deleted file mode 100644 index e4c75af46..000000000 --- a/doc/models/invoice.md +++ /dev/null @@ -1,63 +0,0 @@ - -# 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` | Optional | The Square-assigned ID of the invoice. | -| `version` | `Integer` | Optional | The Square-assigned version number, which is incremented each time an update is committed to the invoice. | -| `location_id` | `String` | 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` | -| `order_id` | `String` | 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` | -| `primary_recipient` | [`Invoice Recipient Hash`](../../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. | -| `payment_requests` | [`Array`](../../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). | -| `delivery_method` | [`String (Invoice Delivery Method)`](../../doc/models/invoice-delivery-method.md) | Optional | Indicates how Square delivers the [invoice](../../doc/models/invoice.md) to the customer. | -| `invoice_number` | `String` | 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` | Optional | The title of the invoice, which is displayed on the invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | -| `description` | `String` | Optional | The description of the invoice, which is displayed on the invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `65536` | -| `scheduled_at` | `String` | 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. | -| `public_url` | `String` | 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. | -| `next_payment_amount_money` | [`Money Hash`](../../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 (Invoice Status)`](../../doc/models/invoice-status.md) | Optional | Indicates the status of an invoice. | -| `timezone` | `String` | 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). | -| `created_at` | `String` | Optional | The timestamp when the invoice was created, in RFC 3339 format. | -| `updated_at` | `String` | Optional | The timestamp when the invoice was last updated, in RFC 3339 format. | -| `accepted_payment_methods` | [`Invoice Accepted Payment Methods Hash`](../../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. | -| `custom_fields` | [`Array`](../../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 | -| `subscription_id` | `String` | Optional | The ID of the [subscription](entity:Subscription) associated with the invoice.
This field is present only on subscription billing invoices. | -| `sale_or_service_date` | `String` | 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. | -| `payment_conditions` | `String` | 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` | -| `store_payment_method_enabled` | `TrueClass \| FalseClass` | 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` | [`Array`](../../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/doc/models/item-variation-location-overrides.md b/doc/models/item-variation-location-overrides.md deleted file mode 100644 index 3532b2ed2..000000000 --- a/doc/models/item-variation-location-overrides.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Item Variation Location Overrides - -Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`. - -## Structure - -`Item Variation Location Overrides` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Optional | The ID of the `Location`. This can include locations that are deactivated. | -| `price_money` | [`Money Hash`](../../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. | -| `pricing_type` | [`String (Catalog Pricing Type)`](../../doc/models/catalog-pricing-type.md) | Optional | Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. | -| `track_inventory` | `TrueClass \| FalseClass` | Optional | If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`. | -| `inventory_alert_type` | [`String (Inventory Alert Type)`](../../doc/models/inventory-alert-type.md) | Optional | Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. | -| `inventory_alert_threshold` | `Integer` | 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. | -| `sold_out` | `TrueClass \| FalseClass` | 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`. | -| `sold_out_valid_until` | `String` | 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/doc/models/job-assignment-pay-type.md b/doc/models/job-assignment-pay-type.md deleted file mode 100644 index 905b79a82..000000000 --- a/doc/models/job-assignment-pay-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Job Assignment Pay Type - -Enumerates the possible pay types that a job can be assigned. - -## Enumeration - -`Job Assignment Pay Type` - -## 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/doc/models/job-assignment.md b/doc/models/job-assignment.md deleted file mode 100644 index e88233033..000000000 --- a/doc/models/job-assignment.md +++ /dev/null @@ -1,40 +0,0 @@ - -# 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 - -`Job Assignment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `job_title` | `String` | Optional | The title of the job. | -| `pay_type` | [`String (Job Assignment Pay Type)`](../../doc/models/job-assignment-pay-type.md) | Required | Enumerates the possible pay types that a job can be assigned. | -| `hourly_rate` | [`Money Hash`](../../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. | -| `annual_rate` | [`Money Hash`](../../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. | -| `weekly_hours` | `Integer` | Optional | The planned hours per week for the job. Set if the job `PayType` is `SALARY`. | -| `job_id` | `String` | 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/doc/models/job.md b/doc/models/job.md deleted file mode 100644 index 849b6bcae..000000000 --- a/doc/models/job.md +++ /dev/null @@ -1,34 +0,0 @@ - -# 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` | 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` | Optional | The title of the job.
**Constraints**: *Maximum Length*: `150` | -| `is_tip_eligible` | `TrueClass \| FalseClass` | Optional | Indicates whether team members can earn tips for the job. | -| `created_at` | `String` | Optional | The timestamp when the job was created, in RFC 3339 format. | -| `updated_at` | `String` | Optional | The timestamp when the job was last updated, in RFC 3339 format. | -| `version` | `Integer` | 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/doc/models/link-customer-to-gift-card-request.md b/doc/models/link-customer-to-gift-card-request.md deleted file mode 100644 index bb5ac2617..000000000 --- a/doc/models/link-customer-to-gift-card-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Link Customer to Gift Card Request - -A request to link a customer to a gift card. - -## Structure - -`Link Customer to Gift Card Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `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/doc/models/link-customer-to-gift-card-response.md b/doc/models/link-customer-to-gift-card-response.md deleted file mode 100644 index 174af1abf..000000000 --- a/doc/models/link-customer-to-gift-card-response.md +++ /dev/null @@ -1,47 +0,0 @@ - -# 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 - -`Link Customer to Gift Card Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `gift_card` | [`Gift Card Hash`](../../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/doc/models/list-bank-accounts-request.md b/doc/models/list-bank-accounts-request.md deleted file mode 100644 index 05c18192f..000000000 --- a/doc/models/list-bank-accounts-request.md +++ /dev/null @@ -1,28 +0,0 @@ - -# List Bank Accounts Request - -Request object for fetching all `BankAccount` -objects linked to a account. - -## Structure - -`List Bank Accounts Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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. | -| `location_id` | `String` | 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/doc/models/list-bank-accounts-response.md b/doc/models/list-bank-accounts-response.md deleted file mode 100644 index 1f3fc1aa8..000000000 --- a/doc/models/list-bank-accounts-response.md +++ /dev/null @@ -1,73 +0,0 @@ - -# List Bank Accounts Response - -Response object returned by ListBankAccounts. - -## Structure - -`List Bank Accounts Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `bank_accounts` | [`Array`](../../doc/models/bank-account.md) | Optional | List of BankAccounts associated with this account. | -| `cursor` | `String` | 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/doc/models/list-booking-custom-attribute-definitions-request.md b/doc/models/list-booking-custom-attribute-definitions-request.md deleted file mode 100644 index faa0ffb3a..000000000 --- a/doc/models/list-booking-custom-attribute-definitions-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Booking Custom Attribute Definitions Request - -Represents a [ListBookingCustomAttributeDefinitions](../../doc/api/booking-custom-attributes.md#list-booking-custom-attribute-definitions) request. - -## Structure - -`List Booking Custom Attribute Definitions Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | 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` | 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/doc/models/list-booking-custom-attribute-definitions-response.md b/doc/models/list-booking-custom-attribute-definitions-response.md deleted file mode 100644 index dc65ec679..000000000 --- a/doc/models/list-booking-custom-attribute-definitions-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# 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 - -`List Booking Custom Attribute Definitions Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definitions` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/list-booking-custom-attributes-request.md b/doc/models/list-booking-custom-attributes-request.md deleted file mode 100644 index de35923b8..000000000 --- a/doc/models/list-booking-custom-attributes-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Booking Custom Attributes Request - -Represents a [ListBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#list-booking-custom-attributes) request. - -## Structure - -`List Booking Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | 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` | 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). | -| `with_definitions` | `TrueClass \| FalseClass` | 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/doc/models/list-booking-custom-attributes-response.md b/doc/models/list-booking-custom-attributes-response.md deleted file mode 100644 index e15d24d75..000000000 --- a/doc/models/list-booking-custom-attributes-response.md +++ /dev/null @@ -1,81 +0,0 @@ - -# 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 - -`List Booking Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attributes` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/list-bookings-request.md b/doc/models/list-bookings-request.md deleted file mode 100644 index 780dd8259..000000000 --- a/doc/models/list-bookings-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# List Bookings Request - -## Structure - -`List Bookings Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | Optional | The maximum number of results per page to return in a paged response.
**Constraints**: `>= 1`, `<= 10000` | -| `cursor` | `String` | 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` | -| `customer_id` | `String` | 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` | -| `team_member_id` | `String` | Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved.
**Constraints**: *Maximum Length*: `32` | -| `location_id` | `String` | Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved.
**Constraints**: *Maximum Length*: `32` | -| `start_at_min` | `String` | Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. | -| `start_at_max` | `String` | 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/doc/models/list-bookings-response.md b/doc/models/list-bookings-response.md deleted file mode 100644 index 21e399e08..000000000 --- a/doc/models/list-bookings-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# List Bookings Response - -## Structure - -`List Bookings Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookings` | [`Array`](../../doc/models/booking.md) | Optional | The list of targeted bookings. | -| `cursor` | `String` | 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` | [`Array`](../../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/doc/models/list-break-types-request.md b/doc/models/list-break-types-request.md deleted file mode 100644 index e6e390341..000000000 --- a/doc/models/list-break-types-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Break Types Request - -A request for a filtered set of `BreakType` objects. - -## Structure - -`List Break Types Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Optional | Filter the returned `BreakType` results to only those that are associated with the
specified location. | -| `limit` | `Integer` | 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` | 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/doc/models/list-break-types-response.md b/doc/models/list-break-types-response.md deleted file mode 100644 index 821f5fa0c..000000000 --- a/doc/models/list-break-types-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# 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 - -`List Break Types Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `break_types` | [`Array`](../../doc/models/break-type.md) | Optional | A page of `BreakType` results. | -| `cursor` | `String` | Optional | The value supplied in the subsequent request to fetch the next page
of `BreakType` results. | -| `errors` | [`Array`](../../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/doc/models/list-cards-request.md b/doc/models/list-cards-request.md deleted file mode 100644 index 9d83588a6..000000000 --- a/doc/models/list-cards-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# List Cards Request - -Retrieves details for a specific Card. Accessible via -HTTP requests at GET https://connect.squareup.com/v2/cards - -## Structure - -`List Cards Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | -| `customer_id` | `String` | Optional | Limit results to cards associated with the customer supplied.
By default, all cards owned by the merchant are returned. | -| `include_disabled` | `TrueClass \| FalseClass` | Optional | Includes disabled cards.
By default, all enabled cards owned by the merchant are returned. | -| `reference_id` | `String` | Optional | Limit results to cards associated with the reference_id supplied. | -| `sort_order` | [`String (Sort Order)`](../../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/doc/models/list-cards-response.md b/doc/models/list-cards-response.md deleted file mode 100644 index f6abbfcf3..000000000 --- a/doc/models/list-cards-response.md +++ /dev/null @@ -1,64 +0,0 @@ - -# 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 - -`List Cards Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `cards` | [`Array`](../../doc/models/card.md) | Optional | The requested list of `Card`s. | -| `cursor` | `String` | 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/doc/models/list-cash-drawer-shift-events-request.md b/doc/models/list-cash-drawer-shift-events-request.md deleted file mode 100644 index e988daa3a..000000000 --- a/doc/models/list-cash-drawer-shift-events-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Cash Drawer Shift Events Request - -## Structure - -`List Cash Drawer Shift Events Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Required | The ID of the location to list cash drawer shifts for.
**Constraints**: *Minimum Length*: `1` | -| `limit` | `Integer` | Optional | Number of resources to be returned in a page of results (200 by
default, 1000 max).
**Constraints**: `<= 1000` | -| `cursor` | `String` | 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/doc/models/list-cash-drawer-shift-events-response.md b/doc/models/list-cash-drawer-shift-events-response.md deleted file mode 100644 index 973cd71b5..000000000 --- a/doc/models/list-cash-drawer-shift-events-response.md +++ /dev/null @@ -1,99 +0,0 @@ - -# List Cash Drawer Shift Events Response - -## Structure - -`List Cash Drawer Shift Events Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | Optional | Opaque cursor for fetching the next page. Cursor is not present in
the last page of results. | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `cash_drawer_shift_events` | [`Array`](../../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/doc/models/list-cash-drawer-shifts-request.md b/doc/models/list-cash-drawer-shifts-request.md deleted file mode 100644 index 60c514d48..000000000 --- a/doc/models/list-cash-drawer-shifts-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# List Cash Drawer Shifts Request - -## Structure - -`List Cash Drawer Shifts Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Required | The ID of the location to query for a list of cash drawer shifts.
**Constraints**: *Minimum Length*: `1` | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `begin_time` | `String` | Optional | The inclusive start time of the query on opened_at, in ISO 8601 format. | -| `end_time` | `String` | Optional | The exclusive end date of the query on opened_at, in ISO 8601 format. | -| `limit` | `Integer` | Optional | Number of cash drawer shift events in a page of results (200 by
default, 1000 max).
**Constraints**: `<= 1000` | -| `cursor` | `String` | 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/doc/models/list-cash-drawer-shifts-response.md b/doc/models/list-cash-drawer-shifts-response.md deleted file mode 100644 index d02f4311f..000000000 --- a/doc/models/list-cash-drawer-shifts-response.md +++ /dev/null @@ -1,59 +0,0 @@ - -# List Cash Drawer Shifts Response - -## Structure - -`List Cash Drawer Shifts Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | Optional | Opaque cursor for fetching the next page of results. Cursor is not
present in the last page of results. | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `cash_drawer_shifts` | [`Array`](../../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/doc/models/list-catalog-request.md b/doc/models/list-catalog-request.md deleted file mode 100644 index 9f66d5d55..000000000 --- a/doc/models/list-catalog-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Catalog Request - -## Structure - -`List Catalog Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | 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. | -| `catalog_version` | `Integer` | 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/doc/models/list-catalog-response.md b/doc/models/list-catalog-response.md deleted file mode 100644 index ce17efdb7..000000000 --- a/doc/models/list-catalog-response.md +++ /dev/null @@ -1,119 +0,0 @@ - -# List Catalog Response - -## Structure - -`List Catalog Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `cursor` | `String` | 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` | [`Array`](../../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/doc/models/list-customer-custom-attribute-definitions-request.md b/doc/models/list-customer-custom-attribute-definitions-request.md deleted file mode 100644 index 065d21dfb..000000000 --- a/doc/models/list-customer-custom-attribute-definitions-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Customer Custom Attribute Definitions Request - -Represents a [ListCustomerCustomAttributeDefinitions](../../doc/api/customer-custom-attributes.md#list-customer-custom-attribute-definitions) request. - -## Structure - -`List Customer Custom Attribute Definitions Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | 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` | 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/doc/models/list-customer-custom-attribute-definitions-response.md b/doc/models/list-customer-custom-attribute-definitions-response.md deleted file mode 100644 index 3ad41d83d..000000000 --- a/doc/models/list-customer-custom-attribute-definitions-response.md +++ /dev/null @@ -1,69 +0,0 @@ - -# 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 - -`List Customer Custom Attribute Definitions Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definitions` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/list-customer-custom-attributes-request.md b/doc/models/list-customer-custom-attributes-request.md deleted file mode 100644 index 554eaf89e..000000000 --- a/doc/models/list-customer-custom-attributes-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Customer Custom Attributes Request - -Represents a [ListCustomerCustomAttributes](../../doc/api/customer-custom-attributes.md#list-customer-custom-attributes) request. - -## Structure - -`List Customer Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | 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` | 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). | -| `with_definitions` | `TrueClass \| FalseClass` | 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/doc/models/list-customer-custom-attributes-response.md b/doc/models/list-customer-custom-attributes-response.md deleted file mode 100644 index bed4ebdba..000000000 --- a/doc/models/list-customer-custom-attributes-response.md +++ /dev/null @@ -1,106 +0,0 @@ - -# 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 - -`List Customer Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attributes` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/list-customer-groups-request.md b/doc/models/list-customer-groups-request.md deleted file mode 100644 index 8a7f1c1fd..000000000 --- a/doc/models/list-customer-groups-request.md +++ /dev/null @@ -1,26 +0,0 @@ - -# 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 - -`List Customer Groups Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/list-customer-groups-response.md b/doc/models/list-customer-groups-response.md deleted file mode 100644 index 1a7b957c6..000000000 --- a/doc/models/list-customer-groups-response.md +++ /dev/null @@ -1,62 +0,0 @@ - -# 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 - -`List Customer Groups Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `groups` | [`Array`](../../doc/models/customer-group.md) | Optional | A list of customer groups belonging to the current seller. | -| `cursor` | `String` | 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/doc/models/list-customer-segments-request.md b/doc/models/list-customer-segments-request.md deleted file mode 100644 index 8efaf1cfe..000000000 --- a/doc/models/list-customer-segments-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Customer Segments Request - -Defines the valid parameters for requests to the `ListCustomerSegments` endpoint. - -## Structure - -`List Customer Segments Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/list-customer-segments-response.md b/doc/models/list-customer-segments-response.md deleted file mode 100644 index a243c40c9..000000000 --- a/doc/models/list-customer-segments-response.md +++ /dev/null @@ -1,73 +0,0 @@ - -# 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 - -`List Customer Segments Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `segments` | [`Array`](../../doc/models/customer-segment.md) | Optional | The list of customer segments belonging to the associated Square account. | -| `cursor` | `String` | 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/doc/models/list-customers-request.md b/doc/models/list-customers-request.md deleted file mode 100644 index 7958db473..000000000 --- a/doc/models/list-customers-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# List Customers Request - -Defines the query parameters that can be included in a request to the -`ListCustomers` endpoint. - -## Structure - -`List Customers Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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` | -| `sort_field` | [`String (Customer Sort Field)`](../../doc/models/customer-sort-field.md) | Optional | Specifies customer attributes as the sort key to customer profiles returned from a search. | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `count` | `TrueClass \| FalseClass` | 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/doc/models/list-customers-response.md b/doc/models/list-customers-response.md deleted file mode 100644 index e078a9259..000000000 --- a/doc/models/list-customers-response.md +++ /dev/null @@ -1,98 +0,0 @@ - -# 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 - -`List Customers Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `customers` | [`Array`](../../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` | 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` | `Integer` | 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/doc/models/list-device-codes-request.md b/doc/models/list-device-codes-request.md deleted file mode 100644 index 0f74f2e9c..000000000 --- a/doc/models/list-device-codes-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# List Device Codes Request - -## Structure - -`List Device Codes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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. | -| `location_id` | `String` | Optional | If specified, only returns DeviceCodes of the specified location.
Returns DeviceCodes of all locations if empty. | -| `product_type` | [`String (Product Type)`](../../doc/models/product-type.md) | Optional | - | -| `status` | [`Array`](../../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/doc/models/list-device-codes-response.md b/doc/models/list-device-codes-response.md deleted file mode 100644 index 9e5393fa7..000000000 --- a/doc/models/list-device-codes-response.md +++ /dev/null @@ -1,69 +0,0 @@ - -# List Device Codes Response - -## Structure - -`List Device Codes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `device_codes` | [`Array`](../../doc/models/device-code.md) | Optional | The queried DeviceCode. | -| `cursor` | `String` | 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/doc/models/list-devices-request.md b/doc/models/list-devices-request.md deleted file mode 100644 index 4bd8abf23..000000000 --- a/doc/models/list-devices-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Devices Request - -## Structure - -`List Devices Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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. | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `limit` | `Integer` | Optional | The number of results to return in a single page.
**Constraints**: `>= 1`, `<= 100` | -| `location_id` | `String` | 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/doc/models/list-devices-response.md b/doc/models/list-devices-response.md deleted file mode 100644 index 9697839bd..000000000 --- a/doc/models/list-devices-response.md +++ /dev/null @@ -1,368 +0,0 @@ - -# List Devices Response - -## Structure - -`List Devices Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors that occurred during the request. | -| `devices` | [`Array`](../../doc/models/device.md) | Optional | The requested list of `Device` objects. | -| `cursor` | `String` | 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/doc/models/list-dispute-evidence-request.md b/doc/models/list-dispute-evidence-request.md deleted file mode 100644 index fc61e1292..000000000 --- a/doc/models/list-dispute-evidence-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Dispute Evidence Request - -Defines the parameters for a `ListDisputeEvidence` request. - -## Structure - -`List Dispute Evidence Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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/doc/models/list-dispute-evidence-response.md b/doc/models/list-dispute-evidence-response.md deleted file mode 100644 index f47bb2acb..000000000 --- a/doc/models/list-dispute-evidence-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# List Dispute Evidence Response - -Defines the fields in a `ListDisputeEvidence` response. - -## Structure - -`List Dispute Evidence Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `evidence` | [`Array`](../../doc/models/dispute-evidence.md) | Optional | The list of evidence previously uploaded to the specified dispute. | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `cursor` | `String` | 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/doc/models/list-disputes-request.md b/doc/models/list-disputes-request.md deleted file mode 100644 index 04703b9b9..000000000 --- a/doc/models/list-disputes-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# List Disputes Request - -Defines the request parameters for the `ListDisputes` endpoint. - -## Structure - -`List Disputes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | [`Array`](../../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 | -| `location_id` | `String` | 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/doc/models/list-disputes-response.md b/doc/models/list-disputes-response.md deleted file mode 100644 index 2e1dd516e..000000000 --- a/doc/models/list-disputes-response.md +++ /dev/null @@ -1,77 +0,0 @@ - -# List Disputes Response - -Defines fields in a `ListDisputes` response. - -## Structure - -`List Disputes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `disputes` | [`Array`](../../doc/models/dispute.md) | Optional | The list of disputes. | -| `cursor` | `String` | 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/doc/models/list-employee-wages-request.md b/doc/models/list-employee-wages-request.md deleted file mode 100644 index fc8c890b7..000000000 --- a/doc/models/list-employee-wages-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Employee Wages Request - -A request for a set of `EmployeeWage` objects. - -## Structure - -`List Employee Wages Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `employee_id` | `String` | Optional | Filter the returned wages to only those that are associated with the specified employee. | -| `limit` | `Integer` | 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` | 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/doc/models/list-employee-wages-response.md b/doc/models/list-employee-wages-response.md deleted file mode 100644 index 30ab30176..000000000 --- a/doc/models/list-employee-wages-response.md +++ /dev/null @@ -1,72 +0,0 @@ - -# List Employee Wages Response - -The response to a request for a set of `EmployeeWage` objects. The response contains -a set of `EmployeeWage` objects. - -## Structure - -`List Employee Wages Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `employee_wages` | [`Array`](../../doc/models/employee-wage.md) | Optional | A page of `EmployeeWage` results. | -| `cursor` | `String` | Optional | The value supplied in the subsequent request to fetch the next page
of `EmployeeWage` results. | -| `errors` | [`Array`](../../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/doc/models/list-employees-request.md b/doc/models/list-employees-request.md deleted file mode 100644 index 6f0a0b536..000000000 --- a/doc/models/list-employees-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Employees Request - -## Structure - -`List Employees Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Optional | - | -| `status` | [`String (Employee Status)`](../../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` | `Integer` | Optional | The number of employees to be returned on each page. | -| `cursor` | `String` | 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/doc/models/list-employees-response.md b/doc/models/list-employees-response.md deleted file mode 100644 index bdfb0af20..000000000 --- a/doc/models/list-employees-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# List Employees Response - -## Structure - -`List Employees Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `employees` | [`Array`](../../doc/models/employee.md) | Optional | - | -| `cursor` | `String` | Optional | The token to be used to retrieve the next page of results. | -| `errors` | [`Array`](../../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/doc/models/list-event-types-request.md b/doc/models/list-event-types-request.md deleted file mode 100644 index da6150008..000000000 --- a/doc/models/list-event-types-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Event Types Request - -Lists all event types that can be subscribed to. - -## Structure - -`List Event Types Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `api_version` | `String` | 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/doc/models/list-event-types-response.md b/doc/models/list-event-types-response.md deleted file mode 100644 index c7a299694..000000000 --- a/doc/models/list-event-types-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# 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 - -`List Event Types Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `event_types` | `Array` | Optional | The list of event types. | -| `metadata` | [`Array`](../../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/doc/models/list-gift-card-activities-request.md b/doc/models/list-gift-card-activities-request.md deleted file mode 100644 index 365ed60ce..000000000 --- a/doc/models/list-gift-card-activities-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# 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 - -`List Gift Card Activities Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `gift_card_id` | `String` | 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` | 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. | -| `location_id` | `String` | 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. | -| `begin_time` | `String` | 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. | -| `end_time` | `String` | 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` | `Integer` | 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` | 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). | -| `sort_order` | `String` | 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/doc/models/list-gift-card-activities-response.md b/doc/models/list-gift-card-activities-response.md deleted file mode 100644 index 82b17c3af..000000000 --- a/doc/models/list-gift-card-activities-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# 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 - -`List Gift Card Activities Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `gift_card_activities` | [`Array`](../../doc/models/gift-card-activity.md) | Optional | The requested gift card activities or an empty object if none are found. | -| `cursor` | `String` | 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/doc/models/list-gift-cards-request.md b/doc/models/list-gift-cards-request.md deleted file mode 100644 index c1ad0dc2a..000000000 --- a/doc/models/list-gift-cards-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# List Gift Cards Request - -A request to list gift cards. You can optionally specify a filter to retrieve a subset of -gift cards. - -## Structure - -`List Gift Cards Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | `String` | 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` | 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` | `Integer` | 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` | 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). | -| `customer_id` | `String` | 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/doc/models/list-gift-cards-response.md b/doc/models/list-gift-cards-response.md deleted file mode 100644 index 9bb34121d..000000000 --- a/doc/models/list-gift-cards-response.md +++ /dev/null @@ -1,72 +0,0 @@ - -# 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 - -`List Gift Cards Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `gift_cards` | [`Array`](../../doc/models/gift-card.md) | Optional | The requested gift cards or an empty object if none are found. | -| `cursor` | `String` | 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/doc/models/list-invoices-request.md b/doc/models/list-invoices-request.md deleted file mode 100644 index aa1fd51da..000000000 --- a/doc/models/list-invoices-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Invoices Request - -Describes a `ListInvoice` request. - -## Structure - -`List Invoices Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Required | The ID of the location for which to list invoices.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/list-invoices-response.md b/doc/models/list-invoices-response.md deleted file mode 100644 index 5dbcbde59..000000000 --- a/doc/models/list-invoices-response.md +++ /dev/null @@ -1,196 +0,0 @@ - -# List Invoices Response - -Describes a `ListInvoice` response. - -## Structure - -`List Invoices Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoices` | [`Array`](../../doc/models/invoice.md) | Optional | The invoices retrieved. | -| `cursor` | `String` | 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` | [`Array`](../../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/doc/models/list-jobs-request.md b/doc/models/list-jobs-request.md deleted file mode 100644 index 45b6b0e78..000000000 --- a/doc/models/list-jobs-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Jobs Request - -Represents a [ListJobs](../../doc/api/team.md#list-jobs) request. - -## Structure - -`List Jobs Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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/doc/models/list-jobs-response.md b/doc/models/list-jobs-response.md deleted file mode 100644 index ae57cbab1..000000000 --- a/doc/models/list-jobs-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# 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 - -`List Jobs Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `jobs` | [`Array`](../../doc/models/job.md) | Optional | The retrieved jobs. A single paged response contains up to 100 jobs. | -| `cursor` | `String` | 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` | [`Array`](../../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/doc/models/list-location-booking-profiles-request.md b/doc/models/list-location-booking-profiles-request.md deleted file mode 100644 index 02ca3cc7d..000000000 --- a/doc/models/list-location-booking-profiles-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Location Booking Profiles Request - -## Structure - -`List Location Booking Profiles Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | Optional | The maximum number of results to return in a paged response.
**Constraints**: `>= 1`, `<= 100` | -| `cursor` | `String` | 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/doc/models/list-location-booking-profiles-response.md b/doc/models/list-location-booking-profiles-response.md deleted file mode 100644 index 039a74c87..000000000 --- a/doc/models/list-location-booking-profiles-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# List Location Booking Profiles Response - -## Structure - -`List Location Booking Profiles Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_booking_profiles` | [`Array`](../../doc/models/location-booking-profile.md) | Optional | The list of a seller's location booking profiles. | -| `cursor` | `String` | 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` | [`Array`](../../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/doc/models/list-location-custom-attribute-definitions-request.md b/doc/models/list-location-custom-attribute-definitions-request.md deleted file mode 100644 index a67439a47..000000000 --- a/doc/models/list-location-custom-attribute-definitions-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Location Custom Attribute Definitions Request - -Represents a [ListLocationCustomAttributeDefinitions](../../doc/api/location-custom-attributes.md#list-location-custom-attribute-definitions) request. - -## Structure - -`List Location Custom Attribute Definitions Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibility_filter` | [`String (Visibility Filter)`](../../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` | `Integer` | 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` | 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/doc/models/list-location-custom-attribute-definitions-response.md b/doc/models/list-location-custom-attribute-definitions-response.md deleted file mode 100644 index b9e0b00c2..000000000 --- a/doc/models/list-location-custom-attribute-definitions-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# 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 - -`List Location Custom Attribute Definitions Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definitions` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/list-location-custom-attributes-request.md b/doc/models/list-location-custom-attributes-request.md deleted file mode 100644 index 6566291f1..000000000 --- a/doc/models/list-location-custom-attributes-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# List Location Custom Attributes Request - -Represents a [ListLocationCustomAttributes](../../doc/api/location-custom-attributes.md#list-location-custom-attributes) request. - -## Structure - -`List Location Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibility_filter` | [`String (Visibility Filter)`](../../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` | `Integer` | 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` | 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). | -| `with_definitions` | `TrueClass \| FalseClass` | 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/doc/models/list-location-custom-attributes-response.md b/doc/models/list-location-custom-attributes-response.md deleted file mode 100644 index 30afb2c65..000000000 --- a/doc/models/list-location-custom-attributes-response.md +++ /dev/null @@ -1,81 +0,0 @@ - -# 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 - -`List Location Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attributes` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/list-locations-response.md b/doc/models/list-locations-response.md deleted file mode 100644 index 7602026e3..000000000 --- a/doc/models/list-locations-response.md +++ /dev/null @@ -1,99 +0,0 @@ - -# 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 - -`List Locations Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `locations` | [`Array`](../../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/doc/models/list-loyalty-programs-response.md b/doc/models/list-loyalty-programs-response.md deleted file mode 100644 index 333bf90ea..000000000 --- a/doc/models/list-loyalty-programs-response.md +++ /dev/null @@ -1,110 +0,0 @@ - -# List Loyalty Programs Response - -A response that contains all loyalty programs. - -## Structure - -`List Loyalty Programs Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `programs` | [`Array`](../../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/doc/models/list-loyalty-promotions-request.md b/doc/models/list-loyalty-promotions-request.md deleted file mode 100644 index 97d786860..000000000 --- a/doc/models/list-loyalty-promotions-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Loyalty Promotions Request - -Represents a [ListLoyaltyPromotions](../../doc/api/loyalty.md#list-loyalty-promotions) request. - -## Structure - -`List Loyalty Promotions Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `status` | [`String (Loyalty Promotion Status)`](../../doc/models/loyalty-promotion-status.md) | Optional | Indicates the status of a [loyalty promotion](../../doc/models/loyalty-promotion.md). | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/list-loyalty-promotions-response.md b/doc/models/list-loyalty-promotions-response.md deleted file mode 100644 index 04e1c59e8..000000000 --- a/doc/models/list-loyalty-promotions-response.md +++ /dev/null @@ -1,124 +0,0 @@ - -# 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 - -`List Loyalty Promotions Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `loyalty_promotions` | [`Array`](../../doc/models/loyalty-promotion.md) | Optional | The retrieved loyalty promotions. | -| `cursor` | `String` | 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/doc/models/list-merchant-custom-attribute-definitions-request.md b/doc/models/list-merchant-custom-attribute-definitions-request.md deleted file mode 100644 index 87337da05..000000000 --- a/doc/models/list-merchant-custom-attribute-definitions-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Merchant Custom Attribute Definitions Request - -Represents a [ListMerchantCustomAttributeDefinitions](../../doc/api/merchant-custom-attributes.md#list-merchant-custom-attribute-definitions) request. - -## Structure - -`List Merchant Custom Attribute Definitions Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibility_filter` | [`String (Visibility Filter)`](../../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` | `Integer` | 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` | 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/doc/models/list-merchant-custom-attribute-definitions-response.md b/doc/models/list-merchant-custom-attribute-definitions-response.md deleted file mode 100644 index 357009014..000000000 --- a/doc/models/list-merchant-custom-attribute-definitions-response.md +++ /dev/null @@ -1,69 +0,0 @@ - -# 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 - -`List Merchant Custom Attribute Definitions Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definitions` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/list-merchant-custom-attributes-request.md b/doc/models/list-merchant-custom-attributes-request.md deleted file mode 100644 index 7b0d6f221..000000000 --- a/doc/models/list-merchant-custom-attributes-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# List Merchant Custom Attributes Request - -Represents a [ListMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#list-merchant-custom-attributes) request. - -## Structure - -`List Merchant Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibility_filter` | [`String (Visibility Filter)`](../../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` | `Integer` | 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` | 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). | -| `with_definitions` | `TrueClass \| FalseClass` | 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/doc/models/list-merchant-custom-attributes-response.md b/doc/models/list-merchant-custom-attributes-response.md deleted file mode 100644 index 8cee15a05..000000000 --- a/doc/models/list-merchant-custom-attributes-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# 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 - -`List Merchant Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attributes` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/list-merchants-request.md b/doc/models/list-merchants-request.md deleted file mode 100644 index 93c9d80cd..000000000 --- a/doc/models/list-merchants-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Merchants Request - -Request object for the [ListMerchant](../../doc/api/merchants.md#list-merchants) endpoint. - -## Structure - -`List Merchants Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `Integer` | Optional | The cursor generated by the previous response. | - -## Example (as JSON) - -```json -{ - "cursor": 106 -} -``` - diff --git a/doc/models/list-merchants-response.md b/doc/models/list-merchants-response.md deleted file mode 100644 index 44d068c89..000000000 --- a/doc/models/list-merchants-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# List Merchants Response - -The response object returned by the [ListMerchant](../../doc/api/merchants.md#list-merchants) endpoint. - -## Structure - -`List Merchants Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `merchant` | [`Array`](../../doc/models/merchant.md) | Optional | The requested `Merchant` entities. | -| `cursor` | `Integer` | 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/doc/models/list-order-custom-attribute-definitions-request.md b/doc/models/list-order-custom-attribute-definitions-request.md deleted file mode 100644 index a73ea15f0..000000000 --- a/doc/models/list-order-custom-attribute-definitions-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Order Custom Attribute Definitions Request - -Represents a list request for order custom attribute definitions. - -## Structure - -`List Order Custom Attribute Definitions Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibility_filter` | [`String (Visibility Filter)`](../../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` | 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` | `Integer` | 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/doc/models/list-order-custom-attribute-definitions-response.md b/doc/models/list-order-custom-attribute-definitions-response.md deleted file mode 100644 index 63dd93917..000000000 --- a/doc/models/list-order-custom-attribute-definitions-response.md +++ /dev/null @@ -1,80 +0,0 @@ - -# List Order Custom Attribute Definitions Response - -Represents a response from listing order custom attribute definitions. - -## Structure - -`List Order Custom Attribute Definitions Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definitions` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/list-order-custom-attributes-request.md b/doc/models/list-order-custom-attributes-request.md deleted file mode 100644 index ef9939afe..000000000 --- a/doc/models/list-order-custom-attributes-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# List Order Custom Attributes Request - -Represents a list request for order custom attributes. - -## Structure - -`List Order Custom Attributes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `visibility_filter` | [`String (Visibility Filter)`](../../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` | 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` | `Integer` | 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` | -| `with_definitions` | `TrueClass \| FalseClass` | 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/doc/models/list-order-custom-attributes-response.md b/doc/models/list-order-custom-attributes-response.md deleted file mode 100644 index be2a15261..000000000 --- a/doc/models/list-order-custom-attributes-response.md +++ /dev/null @@ -1,79 +0,0 @@ - -# List Order Custom Attributes Response - -Represents a response from listing order custom attributes. - -## Structure - -`List Order Custom Attributes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attributes` | [`Array`](../../doc/models/custom-attribute.md) | Optional | The retrieved custom attributes. If no custom attribute are found, Square returns an empty object (`{}`). | -| `cursor` | `String` | 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` | [`Array`](../../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/doc/models/list-payment-links-request.md b/doc/models/list-payment-links-request.md deleted file mode 100644 index b4580f488..000000000 --- a/doc/models/list-payment-links-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Payment Links Request - -## Structure - -`List Payment Links Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/list-payment-links-response.md b/doc/models/list-payment-links-response.md deleted file mode 100644 index e3fe458a3..000000000 --- a/doc/models/list-payment-links-response.md +++ /dev/null @@ -1,102 +0,0 @@ - -# List Payment Links Response - -## Structure - -`List Payment Links Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | -| `payment_links` | [`Array`](../../doc/models/payment-link.md) | Optional | The list of payment links. | -| `cursor` | `String` | 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/doc/models/list-payment-refunds-request.md b/doc/models/list-payment-refunds-request.md deleted file mode 100644 index e641adc64..000000000 --- a/doc/models/list-payment-refunds-request.md +++ /dev/null @@ -1,40 +0,0 @@ - -# 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 - -`List Payment Refunds Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `begin_time` | `String` | 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. | -| `end_time` | `String` | 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. | -| `sort_order` | `String` | Optional | The order in which results are listed by `PaymentRefund.created_at`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | -| `cursor` | `String` | 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). | -| `location_id` | `String` | Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the seller. | -| `status` | `String` | 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. | -| `source_type` | `String` | 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` | `Integer` | 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 | -| `updated_at_begin_time` | `String` | Optional | Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339
format. The range is determined using the `updated_at` field for each `PaymentRefund`.

Default: if omitted, the time range starts at `begin_time`. | -| `updated_at_end_time` | `String` | Optional | Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339
format. The range is determined using the `updated_at` field for each `PaymentRefund`.

Default: The current time. | -| `sort_field` | `String` | Optional | The field used to sort results by. The default is `CREATED_AT`.
Current values include `CREATED_AT` and `UPDATED_AT`.
| - -## 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/doc/models/list-payment-refunds-response.md b/doc/models/list-payment-refunds-response.md deleted file mode 100644 index 8839cbbef..000000000 --- a/doc/models/list-payment-refunds-response.md +++ /dev/null @@ -1,97 +0,0 @@ - -# 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 - -`List Payment Refunds Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `refunds` | [`Array`](../../doc/models/payment-refund.md) | Optional | The list of requested refunds. | -| `cursor` | `String` | 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/doc/models/list-payments-request.md b/doc/models/list-payments-request.md deleted file mode 100644 index 7e38da1b0..000000000 --- a/doc/models/list-payments-request.md +++ /dev/null @@ -1,44 +0,0 @@ - -# 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 - -`List Payments Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `begin_time` | `String` | 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. | -| `end_time` | `String` | 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. | -| `sort_order` | `String` | Optional | The order in which results are listed by `ListPaymentsRequest.sort_field`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | -| `cursor` | `String` | 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). | -| `location_id` | `String` | Optional | Limit results to the location supplied. By default, results are returned
for the default (main) location associated with the seller. | -| `total` | `Integer` | Optional | The exact amount in the `total_money` for a payment. | -| `last_4` | `String` | Optional | The last four digits of a payment card. | -| `card_brand` | `String` | Optional | The brand of the payment card (for example, VISA). | -| `limit` | `Integer` | 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` | -| `is_offline_payment` | `TrueClass \| FalseClass` | Optional | Whether the payment was taken offline or not. | -| `offline_begin_time` | `String` | 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. | -| `offline_end_time` | `String` | 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. | -| `updated_at_begin_time` | `String` | 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. | -| `updated_at_end_time` | `String` | 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. | -| `sort_field` | [`String (Payment Sort Field)`](../../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/doc/models/list-payments-response.md b/doc/models/list-payments-response.md deleted file mode 100644 index 496390fc7..000000000 --- a/doc/models/list-payments-response.md +++ /dev/null @@ -1,105 +0,0 @@ - -# List Payments Response - -Defines the response returned by [ListPayments](../../doc/api/payments.md#list-payments). - -## Structure - -`List Payments Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `payments` | [`Array`](../../doc/models/payment.md) | Optional | The requested list of payments. | -| `cursor` | `String` | 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/doc/models/list-payout-entries-request.md b/doc/models/list-payout-entries-request.md deleted file mode 100644 index e532c70be..000000000 --- a/doc/models/list-payout-entries-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Payout Entries Request - -## Structure - -`List Payout Entries Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/list-payout-entries-response.md b/doc/models/list-payout-entries-response.md deleted file mode 100644 index be711d150..000000000 --- a/doc/models/list-payout-entries-response.md +++ /dev/null @@ -1,84 +0,0 @@ - -# List Payout Entries Response - -The response to retrieve payout records entries. - -## Structure - -`List Payout Entries Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payout_entries` | [`Array`](../../doc/models/payout-entry.md) | Optional | The requested list of payout entries, ordered with the given or default sort order. | -| `cursor` | `String` | 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` | [`Array`](../../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/doc/models/list-payouts-request.md b/doc/models/list-payouts-request.md deleted file mode 100644 index d01c31baf..000000000 --- a/doc/models/list-payouts-request.md +++ /dev/null @@ -1,33 +0,0 @@ - -# List Payouts Request - -A request to retrieve payout records. - -## Structure - -`List Payouts Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | 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 (Payout Status)`](../../doc/models/payout-status.md) | Optional | Payout status types | -| `begin_time` | `String` | Optional | The timestamp for the beginning of the payout creation time, in RFC 3339 format.
Inclusive. Default: The current time minus one year. | -| `end_time` | `String` | Optional | The timestamp for the end of the payout creation time, in RFC 3339 format.
Default: The current time. | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/list-payouts-response.md b/doc/models/list-payouts-response.md deleted file mode 100644 index a0f3eabad..000000000 --- a/doc/models/list-payouts-response.md +++ /dev/null @@ -1,97 +0,0 @@ - -# List Payouts Response - -The response to retrieve payout records entries. - -## Structure - -`List Payouts Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payouts` | [`Array`](../../doc/models/payout.md) | Optional | The requested list of payouts. | -| `cursor` | `String` | 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` | [`Array`](../../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/doc/models/list-refunds-request.md b/doc/models/list-refunds-request.md deleted file mode 100644 index 67db42a86..000000000 --- a/doc/models/list-refunds-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# 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 - -`List Refunds Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `begin_time` | `String` | 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. | -| `end_time` | `String` | 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. | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `cursor` | `String` | 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/doc/models/list-refunds-response.md b/doc/models/list-refunds-response.md deleted file mode 100644 index f3df1a98a..000000000 --- a/doc/models/list-refunds-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# 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 - -`List Refunds Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `refunds` | [`Array`](../../doc/models/refund.md) | Optional | An array of refunds that match your query. | -| `cursor` | `String` | 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/doc/models/list-sites-response.md b/doc/models/list-sites-response.md deleted file mode 100644 index 7a869c9e2..000000000 --- a/doc/models/list-sites-response.md +++ /dev/null @@ -1,49 +0,0 @@ - -# List Sites Response - -Represents a `ListSites` response. The response can include either `sites` or `errors`. - -## Structure - -`List Sites Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `sites` | [`Array`](../../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/doc/models/list-subscription-events-request.md b/doc/models/list-subscription-events-request.md deleted file mode 100644 index efdd0f641..000000000 --- a/doc/models/list-subscription-events-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Subscription Events Request - -Defines input parameters in a request to the -[ListSubscriptionEvents](../../doc/api/subscriptions.md#list-subscription-events) -endpoint. - -## Structure - -`List Subscription Events Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/list-subscription-events-response.md b/doc/models/list-subscription-events-response.md deleted file mode 100644 index 27de53848..000000000 --- a/doc/models/list-subscription-events-response.md +++ /dev/null @@ -1,169 +0,0 @@ - -# List Subscription Events Response - -Defines output parameters in a response from the -[ListSubscriptionEvents](../../doc/api/subscriptions.md#list-subscription-events). - -## Structure - -`List Subscription Events Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered during the request. | -| `subscription_events` | [`Array`](../../doc/models/subscription-event.md) | Optional | The retrieved subscription events. | -| `cursor` | `String` | 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/doc/models/list-team-member-booking-profiles-request.md b/doc/models/list-team-member-booking-profiles-request.md deleted file mode 100644 index a8c88307c..000000000 --- a/doc/models/list-team-member-booking-profiles-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Team Member Booking Profiles Request - -## Structure - -`List Team Member Booking Profiles Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `bookable_only` | `TrueClass \| FalseClass` | Optional | Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). | -| `limit` | `Integer` | Optional | The maximum number of results to return in a paged response.
**Constraints**: `>= 1`, `<= 100` | -| `cursor` | `String` | 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` | -| `location_id` | `String` | 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/doc/models/list-team-member-booking-profiles-response.md b/doc/models/list-team-member-booking-profiles-response.md deleted file mode 100644 index fad0cde89..000000000 --- a/doc/models/list-team-member-booking-profiles-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# List Team Member Booking Profiles Response - -## Structure - -`List Team Member Booking Profiles Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_booking_profiles` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/list-team-member-wages-request.md b/doc/models/list-team-member-wages-request.md deleted file mode 100644 index eac636eb8..000000000 --- a/doc/models/list-team-member-wages-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# List Team Member Wages Request - -A request for a set of `TeamMemberWage` objects. - -## Structure - -`List Team Member Wages Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_id` | `String` | Optional | Filter the returned wages to only those that are associated with the
specified team member. | -| `limit` | `Integer` | 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` | 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/doc/models/list-team-member-wages-response.md b/doc/models/list-team-member-wages-response.md deleted file mode 100644 index f471d39b8..000000000 --- a/doc/models/list-team-member-wages-response.md +++ /dev/null @@ -1,86 +0,0 @@ - -# 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 - -`List Team Member Wages Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_wages` | [`Array`](../../doc/models/team-member-wage.md) | Optional | A page of `TeamMemberWage` results. | -| `cursor` | `String` | Optional | The value supplied in the subsequent request to fetch the next page
of `TeamMemberWage` results. | -| `errors` | [`Array`](../../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/doc/models/list-transactions-request.md b/doc/models/list-transactions-request.md deleted file mode 100644 index f1206907f..000000000 --- a/doc/models/list-transactions-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# 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 - -`List Transactions Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `begin_time` | `String` | 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. | -| `end_time` | `String` | 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. | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `cursor` | `String` | 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/doc/models/list-transactions-response.md b/doc/models/list-transactions-response.md deleted file mode 100644 index cf3293677..000000000 --- a/doc/models/list-transactions-response.md +++ /dev/null @@ -1,111 +0,0 @@ - -# 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 - -`List Transactions Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `transactions` | [`Array`](../../doc/models/transaction.md) | Optional | An array of transactions that match your query. | -| `cursor` | `String` | 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/doc/models/list-webhook-event-types-request.md b/doc/models/list-webhook-event-types-request.md deleted file mode 100644 index 13942985d..000000000 --- a/doc/models/list-webhook-event-types-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# List Webhook Event Types Request - -Lists all webhook event types that can be subscribed to. - -## Structure - -`List Webhook Event Types Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `api_version` | `String` | 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/doc/models/list-webhook-event-types-response.md b/doc/models/list-webhook-event-types-response.md deleted file mode 100644 index b08362fc8..000000000 --- a/doc/models/list-webhook-event-types-response.md +++ /dev/null @@ -1,46 +0,0 @@ - -# 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 - -`List Webhook Event Types Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `event_types` | `Array` | Optional | The list of event types. | -| `metadata` | [`Array`](../../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/doc/models/list-webhook-subscriptions-request.md b/doc/models/list-webhook-subscriptions-request.md deleted file mode 100644 index f0094087f..000000000 --- a/doc/models/list-webhook-subscriptions-request.md +++ /dev/null @@ -1,29 +0,0 @@ - -# List Webhook Subscriptions Request - -Lists all [Subscription](../../doc/models/webhook-subscription.md)s owned by your application. - -## Structure - -`List Webhook Subscriptions Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | -| `include_disabled` | `TrueClass \| FalseClass` | Optional | Includes disabled [Subscription](entity:WebhookSubscription)s.
By default, all enabled [Subscription](entity:WebhookSubscription)s are returned. | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `limit` | `Integer` | 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/doc/models/list-webhook-subscriptions-response.md b/doc/models/list-webhook-subscriptions-response.md deleted file mode 100644 index 9589fa893..000000000 --- a/doc/models/list-webhook-subscriptions-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# 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 - -`List Webhook Subscriptions Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `subscriptions` | [`Array`](../../doc/models/webhook-subscription.md) | Optional | The requested list of [Subscription](entity:WebhookSubscription)s. | -| `cursor` | `String` | 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/doc/models/list-workweek-configs-request.md b/doc/models/list-workweek-configs-request.md deleted file mode 100644 index 5a8c42605..000000000 --- a/doc/models/list-workweek-configs-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# List Workweek Configs Request - -A request for a set of `WorkweekConfig` objects. - -## Structure - -`List Workweek Configs Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `limit` | `Integer` | Optional | The maximum number of `WorkweekConfigs` results to return per page. | -| `cursor` | `String` | Optional | A pointer to the next page of `WorkweekConfig` results to fetch. | - -## Example (as JSON) - -```json -{ - "limit": 98, - "cursor": "cursor0" -} -``` - diff --git a/doc/models/list-workweek-configs-response.md b/doc/models/list-workweek-configs-response.md deleted file mode 100644 index 63860404d..000000000 --- a/doc/models/list-workweek-configs-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# 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 - -`List Workweek Configs Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `workweek_configs` | [`Array`](../../doc/models/workweek-config.md) | Optional | A page of `WorkweekConfig` results. | -| `cursor` | `String` | Optional | The value supplied in the subsequent request to fetch the next page of
`WorkweekConfig` results. | -| `errors` | [`Array`](../../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/doc/models/location-booking-profile.md b/doc/models/location-booking-profile.md deleted file mode 100644 index 7f7c2ecb4..000000000 --- a/doc/models/location-booking-profile.md +++ /dev/null @@ -1,27 +0,0 @@ - -# 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 - -`Location Booking Profile` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Optional | The ID of the [location](entity:Location). | -| `booking_site_url` | `String` | Optional | Url for the online booking site for this location. | -| `online_booking_enabled` | `TrueClass \| FalseClass` | 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/doc/models/location-capability.md b/doc/models/location-capability.md deleted file mode 100644 index 45f426566..000000000 --- a/doc/models/location-capability.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Location Capability - -The capabilities a location might have. - -## Enumeration - -`Location Capability` - -## 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/doc/models/location-status.md b/doc/models/location-status.md deleted file mode 100644 index 02db59cbf..000000000 --- a/doc/models/location-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Location Status - -A location's status. - -## Enumeration - -`Location Status` - -## 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/doc/models/location-type.md b/doc/models/location-type.md deleted file mode 100644 index ecab781de..000000000 --- a/doc/models/location-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Location Type - -A location's type. - -## Enumeration - -`Location Type` - -## 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/doc/models/location.md b/doc/models/location.md deleted file mode 100644 index 9a0769390..000000000 --- a/doc/models/location.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Location - -Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). - -## Structure - -`Location` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | A short generated string of letters and numbers that uniquely identifies this location instance.
**Constraints**: *Maximum Length*: `32` | -| `name` | `String` | 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 Hash`](../../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` | 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` | [`Array`](../../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 (Location Status)`](../../doc/models/location-status.md) | Optional | A location's status. | -| `created_at` | `String` | 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` | -| `merchant_id` | `String` | Optional | The ID of the merchant that owns the location.
**Constraints**: *Maximum Length*: `32` | -| `country` | [`String (Country)`](../../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). | -| `language_code` | `String` | 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 (Currency)`](../../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). | -| `phone_number` | `String` | Optional | The phone number of the location. For example, `+1 855-700-6000`.
**Constraints**: *Maximum Length*: `17` | -| `business_name` | `String` | 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 (Location Type)`](../../doc/models/location-type.md) | Optional | A location's type. | -| `website_url` | `String` | Optional | The website URL of the location. For example, `https://squareup.com`.
**Constraints**: *Maximum Length*: `255` | -| `business_hours` | [`Business Hours Hash`](../../doc/models/business-hours.md) | Optional | The hours of operation for a location. | -| `business_email` | `String` | 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` | Optional | The description of the location. For example, `Main Street location`.
**Constraints**: *Maximum Length*: `1024` | -| `twitter_username` | `String` | Optional | The Twitter username of the location without the '@' symbol. For example, `Square`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `15` | -| `instagram_username` | `String` | Optional | The Instagram username of the location without the '@' symbol. For example, `square`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30` | -| `facebook_url` | `String` | 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 Hash`](../../doc/models/coordinates.md) | Optional | Latitude and longitude coordinates. | -| `logo_url` | `String` | 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` | -| `pos_background_url` | `String` | Optional | The URL of the Point of Sale background image for the location.
**Constraints**: *Maximum Length*: `255` | -| `mcc` | `String` | 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` | -| `full_format_logo_url` | `String` | 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. | -| `tax_ids` | [`Tax Ids Hash`](../../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/doc/models/loyalty-account-expiring-point-deadline.md b/doc/models/loyalty-account-expiring-point-deadline.md deleted file mode 100644 index b71ea4de2..000000000 --- a/doc/models/loyalty-account-expiring-point-deadline.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Loyalty Account Expiring Point Deadline - -Represents a set of points for a loyalty account that are scheduled to expire on a specific date. - -## Structure - -`Loyalty Account Expiring Point Deadline` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `points` | `Integer` | Required | The number of points scheduled to expire at the `expires_at` timestamp. | -| `expires_at` | `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/doc/models/loyalty-account-mapping-type.md b/doc/models/loyalty-account-mapping-type.md deleted file mode 100644 index b4cb656de..000000000 --- a/doc/models/loyalty-account-mapping-type.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Loyalty Account Mapping Type - -The type of mapping. - -## Enumeration - -`Loyalty Account Mapping Type` - -## Fields - -| Name | Description | -| --- | --- | -| `PHONE` | The loyalty account is mapped by phone. | - diff --git a/doc/models/loyalty-account-mapping.md b/doc/models/loyalty-account-mapping.md deleted file mode 100644 index 2185d6d76..000000000 --- a/doc/models/loyalty-account-mapping.md +++ /dev/null @@ -1,30 +0,0 @@ - -# 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 - -`Loyalty Account Mapping` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The Square-assigned ID of the mapping.
**Constraints**: *Maximum Length*: `36` | -| `created_at` | `String` | Optional | The timestamp when the mapping was created, in RFC 3339 format. | -| `phone_number` | `String` | 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/doc/models/loyalty-account.md b/doc/models/loyalty-account.md deleted file mode 100644 index 71958ac61..000000000 --- a/doc/models/loyalty-account.md +++ /dev/null @@ -1,38 +0,0 @@ - -# 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 - -`Loyalty Account` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The Square-assigned ID of the loyalty account.
**Constraints**: *Maximum Length*: `36` | -| `program_id` | `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` | `Integer` | 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. | -| `lifetime_points` | `Integer` | Optional | The total points accrued during the lifetime of the account. | -| `customer_id` | `String` | Optional | The Square-assigned ID of the [customer](entity:Customer) that is associated with the account. | -| `enrolled_at` | `String` | 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. | -| `created_at` | `String` | Optional | The timestamp when the loyalty account was created, in RFC 3339 format. | -| `updated_at` | `String` | Optional | The timestamp when the loyalty account was last updated, in RFC 3339 format. | -| `mapping` | [`Loyalty Account Mapping Hash`](../../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). | -| `expiring_point_deadlines` | [`Array`](../../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/doc/models/loyalty-event-accumulate-points.md b/doc/models/loyalty-event-accumulate-points.md deleted file mode 100644 index a0bb9876b..000000000 --- a/doc/models/loyalty-event-accumulate-points.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Accumulate Points - -Provides metadata when the event `type` is `ACCUMULATE_POINTS`. - -## Structure - -`Loyalty Event Accumulate Points` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_program_id` | `String` | Optional | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | -| `points` | `Integer` | Optional | The number of points accumulated by the event.
**Constraints**: `>= 1` | -| `order_id` | `String` | 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/doc/models/loyalty-event-accumulate-promotion-points.md b/doc/models/loyalty-event-accumulate-promotion-points.md deleted file mode 100644 index a3169e35a..000000000 --- a/doc/models/loyalty-event-accumulate-promotion-points.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Loyalty Event Accumulate Promotion Points - -Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. - -## Structure - -`Loyalty Event Accumulate Promotion Points` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_program_id` | `String` | Optional | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | -| `loyalty_promotion_id` | `String` | Optional | The Square-assigned ID of the [loyalty promotion](entity:LoyaltyPromotion).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | -| `points` | `Integer` | Required | The number of points earned by the event. | -| `order_id` | `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/doc/models/loyalty-event-adjust-points.md b/doc/models/loyalty-event-adjust-points.md deleted file mode 100644 index d33bbb774..000000000 --- a/doc/models/loyalty-event-adjust-points.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Adjust Points - -Provides metadata when the event `type` is `ADJUST_POINTS`. - -## Structure - -`Loyalty Event Adjust Points` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_program_id` | `String` | Optional | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | -| `points` | `Integer` | Required | The number of points added or removed. | -| `reason` | `String` | 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/doc/models/loyalty-event-create-reward.md b/doc/models/loyalty-event-create-reward.md deleted file mode 100644 index 825a829cb..000000000 --- a/doc/models/loyalty-event-create-reward.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Create Reward - -Provides metadata when the event `type` is `CREATE_REWARD`. - -## Structure - -`Loyalty Event Create Reward` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_program_id` | `String` | Required | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `reward_id` | `String` | 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` | `Integer` | 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/doc/models/loyalty-event-date-time-filter.md b/doc/models/loyalty-event-date-time-filter.md deleted file mode 100644 index f4c31f29a..000000000 --- a/doc/models/loyalty-event-date-time-filter.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Loyalty Event Date Time Filter - -Filter events by date time range. - -## Structure - -`Loyalty Event Date Time Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `created_at` | [`Time Range Hash`](../../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/doc/models/loyalty-event-delete-reward.md b/doc/models/loyalty-event-delete-reward.md deleted file mode 100644 index 1d24cbb02..000000000 --- a/doc/models/loyalty-event-delete-reward.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Delete Reward - -Provides metadata when the event `type` is `DELETE_REWARD`. - -## Structure - -`Loyalty Event Delete Reward` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_program_id` | `String` | Required | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `reward_id` | `String` | 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` | `Integer` | 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/doc/models/loyalty-event-expire-points.md b/doc/models/loyalty-event-expire-points.md deleted file mode 100644 index 2d95e0b58..000000000 --- a/doc/models/loyalty-event-expire-points.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Loyalty Event Expire Points - -Provides metadata when the event `type` is `EXPIRE_POINTS`. - -## Structure - -`Loyalty Event Expire Points` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_program_id` | `String` | Required | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `points` | `Integer` | Required | The number of points expired. | - -## Example (as JSON) - -```json -{ - "loyalty_program_id": "loyalty_program_id8", - "points": 84 -} -``` - diff --git a/doc/models/loyalty-event-filter.md b/doc/models/loyalty-event-filter.md deleted file mode 100644 index f5d6ff31e..000000000 --- a/doc/models/loyalty-event-filter.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Loyalty Event Filter - -The filtering criteria. If the request specifies multiple filters, -the endpoint uses a logical AND to evaluate them. - -## Structure - -`Loyalty Event Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_account_filter` | [`Loyalty Event Loyalty Account Filter Hash`](../../doc/models/loyalty-event-loyalty-account-filter.md) | Optional | Filter events by loyalty account. | -| `type_filter` | [`Loyalty Event Type Filter Hash`](../../doc/models/loyalty-event-type-filter.md) | Optional | Filter events by event type. | -| `date_time_filter` | [`Loyalty Event Date Time Filter Hash`](../../doc/models/loyalty-event-date-time-filter.md) | Optional | Filter events by date time range. | -| `location_filter` | [`Loyalty Event Location Filter Hash`](../../doc/models/loyalty-event-location-filter.md) | Optional | Filter events by location. | -| `order_filter` | [`Loyalty Event Order Filter Hash`](../../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/doc/models/loyalty-event-location-filter.md b/doc/models/loyalty-event-location-filter.md deleted file mode 100644 index 2c0482c1a..000000000 --- a/doc/models/loyalty-event-location-filter.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Location Filter - -Filter events by location. - -## Structure - -`Loyalty Event Location Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_ids` | `Array` | 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/doc/models/loyalty-event-loyalty-account-filter.md b/doc/models/loyalty-event-loyalty-account-filter.md deleted file mode 100644 index 89c7d0adc..000000000 --- a/doc/models/loyalty-event-loyalty-account-filter.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Event Loyalty Account Filter - -Filter events by loyalty account. - -## Structure - -`Loyalty Event Loyalty Account Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_account_id` | `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/doc/models/loyalty-event-order-filter.md b/doc/models/loyalty-event-order-filter.md deleted file mode 100644 index eaac15c37..000000000 --- a/doc/models/loyalty-event-order-filter.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Event Order Filter - -Filter events by the order associated with the event. - -## Structure - -`Loyalty Event Order Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `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/doc/models/loyalty-event-other.md b/doc/models/loyalty-event-other.md deleted file mode 100644 index cbc26a61f..000000000 --- a/doc/models/loyalty-event-other.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Loyalty Event Other - -Provides metadata when the event `type` is `OTHER`. - -## Structure - -`Loyalty Event Other` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_program_id` | `String` | Required | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `points` | `Integer` | Required | The number of points added or removed. | - -## Example (as JSON) - -```json -{ - "loyalty_program_id": "loyalty_program_id4", - "points": 94 -} -``` - diff --git a/doc/models/loyalty-event-query.md b/doc/models/loyalty-event-query.md deleted file mode 100644 index 5170da394..000000000 --- a/doc/models/loyalty-event-query.md +++ /dev/null @@ -1,50 +0,0 @@ - -# Loyalty Event Query - -Represents a query used to search for loyalty events. - -## Structure - -`Loyalty Event Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filter` | [`Loyalty Event Filter Hash`](../../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/doc/models/loyalty-event-redeem-reward.md b/doc/models/loyalty-event-redeem-reward.md deleted file mode 100644 index 66b2e0162..000000000 --- a/doc/models/loyalty-event-redeem-reward.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Redeem Reward - -Provides metadata when the event `type` is `REDEEM_REWARD`. - -## Structure - -`Loyalty Event Redeem Reward` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_program_id` | `String` | Required | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `reward_id` | `String` | 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` | -| `order_id` | `String` | 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/doc/models/loyalty-event-source.md b/doc/models/loyalty-event-source.md deleted file mode 100644 index 26d221065..000000000 --- a/doc/models/loyalty-event-source.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Loyalty Event Source - -Defines whether the event was generated by the Square Point of Sale. - -## Enumeration - -`Loyalty Event Source` - -## 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/doc/models/loyalty-event-type-filter.md b/doc/models/loyalty-event-type-filter.md deleted file mode 100644 index 9025d4f37..000000000 --- a/doc/models/loyalty-event-type-filter.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Loyalty Event Type Filter - -Filter events by event type. - -## Structure - -`Loyalty Event Type Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `types` | [`Array`](../../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/doc/models/loyalty-event-type.md b/doc/models/loyalty-event-type.md deleted file mode 100644 index a7a9e3848..000000000 --- a/doc/models/loyalty-event-type.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Loyalty Event Type - -The type of the loyalty event. - -## Enumeration - -`Loyalty Event Type` - -## 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/doc/models/loyalty-event.md b/doc/models/loyalty-event.md deleted file mode 100644 index 66160181a..000000000 --- a/doc/models/loyalty-event.md +++ /dev/null @@ -1,66 +0,0 @@ - -# 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 - -`Loyalty Event` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Required | The Square-assigned ID of the loyalty event.
**Constraints**: *Minimum Length*: `1` | -| `type` | [`String (Loyalty Event Type)`](../../doc/models/loyalty-event-type.md) | Required | The type of the loyalty event. | -| `created_at` | `String` | Required | The timestamp when the event was created, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1` | -| `accumulate_points` | [`Loyalty Event Accumulate Points Hash`](../../doc/models/loyalty-event-accumulate-points.md) | Optional | Provides metadata when the event `type` is `ACCUMULATE_POINTS`. | -| `create_reward` | [`Loyalty Event Create Reward Hash`](../../doc/models/loyalty-event-create-reward.md) | Optional | Provides metadata when the event `type` is `CREATE_REWARD`. | -| `redeem_reward` | [`Loyalty Event Redeem Reward Hash`](../../doc/models/loyalty-event-redeem-reward.md) | Optional | Provides metadata when the event `type` is `REDEEM_REWARD`. | -| `delete_reward` | [`Loyalty Event Delete Reward Hash`](../../doc/models/loyalty-event-delete-reward.md) | Optional | Provides metadata when the event `type` is `DELETE_REWARD`. | -| `adjust_points` | [`Loyalty Event Adjust Points Hash`](../../doc/models/loyalty-event-adjust-points.md) | Optional | Provides metadata when the event `type` is `ADJUST_POINTS`. | -| `loyalty_account_id` | `String` | Required | The ID of the [loyalty account](entity:LoyaltyAccount) associated with the event.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `location_id` | `String` | Optional | The ID of the [location](entity:Location) where the event occurred. | -| `source` | [`String (Loyalty Event Source)`](../../doc/models/loyalty-event-source.md) | Required | Defines whether the event was generated by the Square Point of Sale. | -| `expire_points` | [`Loyalty Event Expire Points Hash`](../../doc/models/loyalty-event-expire-points.md) | Optional | Provides metadata when the event `type` is `EXPIRE_POINTS`. | -| `other_event` | [`Loyalty Event Other Hash`](../../doc/models/loyalty-event-other.md) | Optional | Provides metadata when the event `type` is `OTHER`. | -| `accumulate_promotion_points` | [`Loyalty Event Accumulate Promotion Points Hash`](../../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/doc/models/loyalty-program-accrual-rule-category-data.md b/doc/models/loyalty-program-accrual-rule-category-data.md deleted file mode 100644 index b055a1880..000000000 --- a/doc/models/loyalty-program-accrual-rule-category-data.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Program Accrual Rule Category Data - -Represents additional data for rules with the `CATEGORY` accrual type. - -## Structure - -`Loyalty Program Accrual Rule Category Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `category_id` | `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/doc/models/loyalty-program-accrual-rule-item-variation-data.md b/doc/models/loyalty-program-accrual-rule-item-variation-data.md deleted file mode 100644 index fb539c26c..000000000 --- a/doc/models/loyalty-program-accrual-rule-item-variation-data.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Program Accrual Rule Item Variation Data - -Represents additional data for rules with the `ITEM_VARIATION` accrual type. - -## Structure - -`Loyalty Program Accrual Rule Item Variation Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `item_variation_id` | `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/doc/models/loyalty-program-accrual-rule-spend-data.md b/doc/models/loyalty-program-accrual-rule-spend-data.md deleted file mode 100644 index 0584669da..000000000 --- a/doc/models/loyalty-program-accrual-rule-spend-data.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Loyalty Program Accrual Rule Spend Data - -Represents additional data for rules with the `SPEND` accrual type. - -## Structure - -`Loyalty Program Accrual Rule Spend Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `amount_money` | [`Money Hash`](../../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. | -| `excluded_category_ids` | `Array` | 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. | -| `excluded_item_variation_ids` | `Array` | 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. | -| `tax_mode` | [`String (Loyalty Program Accrual Rule Tax Mode)`](../../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/doc/models/loyalty-program-accrual-rule-tax-mode.md b/doc/models/loyalty-program-accrual-rule-tax-mode.md deleted file mode 100644 index 1064c7628..000000000 --- a/doc/models/loyalty-program-accrual-rule-tax-mode.md +++ /dev/null @@ -1,17 +0,0 @@ - -# 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 - -`Loyalty Program Accrual Rule Tax Mode` - -## 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/doc/models/loyalty-program-accrual-rule-type.md b/doc/models/loyalty-program-accrual-rule-type.md deleted file mode 100644 index a69878e73..000000000 --- a/doc/models/loyalty-program-accrual-rule-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Loyalty Program Accrual Rule Type - -The type of the accrual rule that defines how buyers can earn points. - -## Enumeration - -`Loyalty Program Accrual Rule Type` - -## 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/doc/models/loyalty-program-accrual-rule-visit-data.md b/doc/models/loyalty-program-accrual-rule-visit-data.md deleted file mode 100644 index bff45c90b..000000000 --- a/doc/models/loyalty-program-accrual-rule-visit-data.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Loyalty Program Accrual Rule Visit Data - -Represents additional data for rules with the `VISIT` accrual type. - -## Structure - -`Loyalty Program Accrual Rule Visit Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `minimum_amount_money` | [`Money Hash`](../../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. | -| `tax_mode` | [`String (Loyalty Program Accrual Rule Tax Mode)`](../../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/doc/models/loyalty-program-accrual-rule.md b/doc/models/loyalty-program-accrual-rule.md deleted file mode 100644 index 0d3f58293..000000000 --- a/doc/models/loyalty-program-accrual-rule.md +++ /dev/null @@ -1,56 +0,0 @@ - -# 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 - -`Loyalty Program Accrual Rule` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `accrual_type` | [`String (Loyalty Program Accrual Rule Type)`](../../doc/models/loyalty-program-accrual-rule-type.md) | Required | The type of the accrual rule that defines how buyers can earn points. | -| `points` | `Integer` | Optional | The number of points that
buyers earn based on the `accrual_type`.
**Constraints**: `>= 1` | -| `visit_data` | [`Loyalty Program Accrual Rule Visit Data Hash`](../../doc/models/loyalty-program-accrual-rule-visit-data.md) | Optional | Represents additional data for rules with the `VISIT` accrual type. | -| `spend_data` | [`Loyalty Program Accrual Rule Spend Data Hash`](../../doc/models/loyalty-program-accrual-rule-spend-data.md) | Optional | Represents additional data for rules with the `SPEND` accrual type. | -| `item_variation_data` | [`Loyalty Program Accrual Rule Item Variation Data Hash`](../../doc/models/loyalty-program-accrual-rule-item-variation-data.md) | Optional | Represents additional data for rules with the `ITEM_VARIATION` accrual type. | -| `category_data` | [`Loyalty Program Accrual Rule Category Data Hash`](../../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/doc/models/loyalty-program-expiration-policy.md b/doc/models/loyalty-program-expiration-policy.md deleted file mode 100644 index 6a83b0f7b..000000000 --- a/doc/models/loyalty-program-expiration-policy.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Loyalty Program Expiration Policy - -Describes when the loyalty program expires. - -## Structure - -`Loyalty Program Expiration Policy` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `expiration_duration` | `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/doc/models/loyalty-program-reward-definition-scope.md b/doc/models/loyalty-program-reward-definition-scope.md deleted file mode 100644 index c5cb6d540..000000000 --- a/doc/models/loyalty-program-reward-definition-scope.md +++ /dev/null @@ -1,19 +0,0 @@ - -# 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 - -`Loyalty Program Reward Definition Scope` - -## 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/doc/models/loyalty-program-reward-definition-type.md b/doc/models/loyalty-program-reward-definition-type.md deleted file mode 100644 index e68995419..000000000 --- a/doc/models/loyalty-program-reward-definition-type.md +++ /dev/null @@ -1,18 +0,0 @@ - -# 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 - -`Loyalty Program Reward Definition Type` - -## Fields - -| Name | Description | -| --- | --- | -| `FIXED_AMOUNT` | The fixed amount discounted. | -| `FIXED_PERCENTAGE` | The fixed percentage discounted. | - diff --git a/doc/models/loyalty-program-reward-definition.md b/doc/models/loyalty-program-reward-definition.md deleted file mode 100644 index 9ca164b7c..000000000 --- a/doc/models/loyalty-program-reward-definition.md +++ /dev/null @@ -1,43 +0,0 @@ - -# 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 - -`Loyalty Program Reward Definition` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `scope` | [`String (Loyalty Program Reward Definition Scope)`](../../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). | -| `discount_type` | [`String (Loyalty Program Reward Definition Type)`](../../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). | -| `percentage_discount` | `String` | 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. | -| `catalog_object_ids` | `Array` | 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. | -| `fixed_discount_money` | [`Money Hash`](../../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. | -| `max_discount_money` | [`Money Hash`](../../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/doc/models/loyalty-program-reward-tier.md b/doc/models/loyalty-program-reward-tier.md deleted file mode 100644 index a338bd571..000000000 --- a/doc/models/loyalty-program-reward-tier.md +++ /dev/null @@ -1,51 +0,0 @@ - -# 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 - -`Loyalty Program Reward Tier` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The Square-assigned ID of the reward tier.
**Constraints**: *Maximum Length*: `36` | -| `points` | `Integer` | Required | The points exchanged for the reward tier.
**Constraints**: `>= 1` | -| `name` | `String` | Optional | The name of the reward tier. | -| `definition` | [`Loyalty Program Reward Definition Hash`](../../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). | -| `created_at` | `String` | Optional | The timestamp when the reward tier was created, in RFC 3339 format. | -| `pricing_rule_reference` | [`Catalog Object Reference Hash`](../../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/doc/models/loyalty-program-status.md b/doc/models/loyalty-program-status.md deleted file mode 100644 index 4e573e6d7..000000000 --- a/doc/models/loyalty-program-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Loyalty Program Status - -Indicates whether the program is currently active. - -## Enumeration - -`Loyalty Program Status` - -## 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/doc/models/loyalty-program-terminology.md b/doc/models/loyalty-program-terminology.md deleted file mode 100644 index 1818dc36f..000000000 --- a/doc/models/loyalty-program-terminology.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Loyalty Program Terminology - -Represents the naming used for loyalty points. - -## Structure - -`Loyalty Program Terminology` - -## 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/doc/models/loyalty-program.md b/doc/models/loyalty-program.md deleted file mode 100644 index 9a00b2cd9..000000000 --- a/doc/models/loyalty-program.md +++ /dev/null @@ -1,95 +0,0 @@ - -# 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 - -`Loyalty Program` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | 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 (Loyalty Program Status)`](../../doc/models/loyalty-program-status.md) | Optional | Indicates whether the program is currently active. | -| `reward_tiers` | [`Array`](../../doc/models/loyalty-program-reward-tier.md) | Optional | The list of rewards for buyers, sorted by ascending points. | -| `expiration_policy` | [`Loyalty Program Expiration Policy Hash`](../../doc/models/loyalty-program-expiration-policy.md) | Optional | Describes when the loyalty program expires. | -| `terminology` | [`Loyalty Program Terminology Hash`](../../doc/models/loyalty-program-terminology.md) | Optional | Represents the naming used for loyalty points. | -| `location_ids` | `Array` | Optional | The [locations](entity:Location) at which the program is active. | -| `created_at` | `String` | Optional | The timestamp when the program was created, in RFC 3339 format. | -| `updated_at` | `String` | Optional | The timestamp when the reward was last updated, in RFC 3339 format. | -| `accrual_rules` | [`Array`](../../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/doc/models/loyalty-promotion-available-time-data.md b/doc/models/loyalty-promotion-available-time-data.md deleted file mode 100644 index e5b757fa0..000000000 --- a/doc/models/loyalty-promotion-available-time-data.md +++ /dev/null @@ -1,32 +0,0 @@ - -# 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 - -`Loyalty Promotion Available Time Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `start_date` | `String` | Optional | The date that the promotion starts, in `YYYY-MM-DD` format. Square populates this field
based on the provided `time_periods`. | -| `end_date` | `String` | 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. | -| `time_periods` | `Array` | 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/doc/models/loyalty-promotion-incentive-points-addition-data.md b/doc/models/loyalty-promotion-incentive-points-addition-data.md deleted file mode 100644 index 4e1c66d11..000000000 --- a/doc/models/loyalty-promotion-incentive-points-addition-data.md +++ /dev/null @@ -1,23 +0,0 @@ - -# 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 - -`Loyalty Promotion Incentive Points Addition Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `points_addition` | `Integer` | 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/doc/models/loyalty-promotion-incentive-points-multiplier-data.md b/doc/models/loyalty-promotion-incentive-points-multiplier-data.md deleted file mode 100644 index 5648a5754..000000000 --- a/doc/models/loyalty-promotion-incentive-points-multiplier-data.md +++ /dev/null @@ -1,25 +0,0 @@ - -# 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 - -`Loyalty Promotion Incentive Points Multiplier Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `points_multiplier` | `Integer` | 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` | 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/doc/models/loyalty-promotion-incentive-type.md b/doc/models/loyalty-promotion-incentive-type.md deleted file mode 100644 index 4e1ce9e9b..000000000 --- a/doc/models/loyalty-promotion-incentive-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# 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 - -`Loyalty Promotion Incentive Type` - -## 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/doc/models/loyalty-promotion-incentive.md b/doc/models/loyalty-promotion-incentive.md deleted file mode 100644 index b8275ee1e..000000000 --- a/doc/models/loyalty-promotion-incentive.md +++ /dev/null @@ -1,34 +0,0 @@ - -# 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 - -`Loyalty Promotion Incentive` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `type` | [`String (Loyalty Promotion Incentive Type)`](../../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. | -| `points_multiplier_data` | [`Loyalty Promotion Incentive Points Multiplier Data Hash`](../../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). | -| `points_addition_data` | [`Loyalty Promotion Incentive Points Addition Data Hash`](../../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/doc/models/loyalty-promotion-status.md b/doc/models/loyalty-promotion-status.md deleted file mode 100644 index 48baa319b..000000000 --- a/doc/models/loyalty-promotion-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Loyalty Promotion Status - -Indicates the status of a [loyalty promotion](../../doc/models/loyalty-promotion.md). - -## Enumeration - -`Loyalty Promotion Status` - -## 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/doc/models/loyalty-promotion-trigger-limit-interval.md b/doc/models/loyalty-promotion-trigger-limit-interval.md deleted file mode 100644 index 98e5c8718..000000000 --- a/doc/models/loyalty-promotion-trigger-limit-interval.md +++ /dev/null @@ -1,17 +0,0 @@ - -# 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 - -`Loyalty Promotion Trigger Limit Interval` - -## 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/doc/models/loyalty-promotion-trigger-limit.md b/doc/models/loyalty-promotion-trigger-limit.md deleted file mode 100644 index ba2cf702a..000000000 --- a/doc/models/loyalty-promotion-trigger-limit.md +++ /dev/null @@ -1,29 +0,0 @@ - -# 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 - -`Loyalty Promotion Trigger Limit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `times` | `Integer` | Required | The maximum number of times a buyer can trigger the promotion during the specified `interval`.
**Constraints**: `>= 1`, `<= 30` | -| `interval` | [`String (Loyalty Promotion Trigger Limit Interval)`](../../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/doc/models/loyalty-promotion.md b/doc/models/loyalty-promotion.md deleted file mode 100644 index 3d5ab6e63..000000000 --- a/doc/models/loyalty-promotion.md +++ /dev/null @@ -1,63 +0,0 @@ - -# 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 - -`Loyalty Promotion` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | 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` | [`Loyalty Promotion Incentive Hash`](../../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. | -| `available_time` | [`Loyalty Promotion Available Time Data Hash`](../../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). | -| `trigger_limit` | [`Loyalty Promotion Trigger Limit Hash`](../../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 (Loyalty Promotion Status)`](../../doc/models/loyalty-promotion-status.md) | Optional | Indicates the status of a [loyalty promotion](../../doc/models/loyalty-promotion.md). | -| `created_at` | `String` | Optional | The timestamp of when the promotion was created, in RFC 3339 format. | -| `canceled_at` | `String` | Optional | The timestamp of when the promotion was canceled, in RFC 3339 format. | -| `updated_at` | `String` | Optional | The timestamp when the promotion was last updated, in RFC 3339 format. | -| `loyalty_program_id` | `String` | Optional | The ID of the [loyalty program](entity:LoyaltyProgram) associated with the promotion. | -| `minimum_spend_amount_money` | [`Money Hash`](../../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. | -| `qualifying_item_variation_ids` | `Array` | 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. | -| `qualifying_category_ids` | `Array` | 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/doc/models/loyalty-reward-status.md b/doc/models/loyalty-reward-status.md deleted file mode 100644 index 4375a6ec7..000000000 --- a/doc/models/loyalty-reward-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Loyalty Reward Status - -The status of the loyalty reward. - -## Enumeration - -`Loyalty Reward Status` - -## Fields - -| Name | Description | -| --- | --- | -| `ISSUED` | The reward is issued. | -| `REDEEMED` | The reward is redeemed. | -| `DELETED` | The reward is deleted. | - diff --git a/doc/models/loyalty-reward.md b/doc/models/loyalty-reward.md deleted file mode 100644 index aee536321..000000000 --- a/doc/models/loyalty-reward.md +++ /dev/null @@ -1,38 +0,0 @@ - -# 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 - -`Loyalty Reward` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The Square-assigned ID of the loyalty reward.
**Constraints**: *Maximum Length*: `36` | -| `status` | [`String (Loyalty Reward Status)`](../../doc/models/loyalty-reward-status.md) | Optional | The status of the loyalty reward. | -| `loyalty_account_id` | `String` | Required | The Square-assigned ID of the [loyalty account](entity:LoyaltyAccount) to which the reward belongs.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `reward_tier_id` | `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` | `Integer` | Optional | The number of loyalty points used for the reward.
**Constraints**: `>= 1` | -| `order_id` | `String` | Optional | The Square-assigned ID of the [order](entity:Order) to which the reward is attached. | -| `created_at` | `String` | Optional | The timestamp when the reward was created, in RFC 3339 format. | -| `updated_at` | `String` | Optional | The timestamp when the reward was last updated, in RFC 3339 format. | -| `redeemed_at` | `String` | 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/doc/models/measurement-unit-area.md b/doc/models/measurement-unit-area.md deleted file mode 100644 index a981d8252..000000000 --- a/doc/models/measurement-unit-area.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Measurement Unit Area - -Unit of area used to measure a quantity. - -## Enumeration - -`Measurement Unit Area` - -## 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/doc/models/measurement-unit-custom.md b/doc/models/measurement-unit-custom.md deleted file mode 100644 index 3f03e1a48..000000000 --- a/doc/models/measurement-unit-custom.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Measurement Unit Custom - -The information needed to define a custom unit, provided by the seller. - -## Structure - -`Measurement Unit Custom` - -## 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/doc/models/measurement-unit-generic.md b/doc/models/measurement-unit-generic.md deleted file mode 100644 index a6c3ee253..000000000 --- a/doc/models/measurement-unit-generic.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Measurement Unit Generic - -## Enumeration - -`Measurement Unit Generic` - -## Fields - -| Name | Description | -| --- | --- | -| `UNIT` | The generic unit. | - diff --git a/doc/models/measurement-unit-length.md b/doc/models/measurement-unit-length.md deleted file mode 100644 index 8160953e7..000000000 --- a/doc/models/measurement-unit-length.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Measurement Unit Length - -The unit of length used to measure a quantity. - -## Enumeration - -`Measurement Unit Length` - -## 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/doc/models/measurement-unit-time.md b/doc/models/measurement-unit-time.md deleted file mode 100644 index b65d45bba..000000000 --- a/doc/models/measurement-unit-time.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Measurement Unit Time - -Unit of time used to measure a quantity (a duration). - -## Enumeration - -`Measurement Unit Time` - -## 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/doc/models/measurement-unit-unit-type.md b/doc/models/measurement-unit-unit-type.md deleted file mode 100644 index 58e260f4b..000000000 --- a/doc/models/measurement-unit-unit-type.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Measurement Unit Unit Type - -Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. - -## Enumeration - -`Measurement Unit Unit Type` - -## 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/doc/models/measurement-unit-volume.md b/doc/models/measurement-unit-volume.md deleted file mode 100644 index 59a0028fc..000000000 --- a/doc/models/measurement-unit-volume.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Measurement Unit Volume - -The unit of volume used to measure a quantity. - -## Enumeration - -`Measurement Unit Volume` - -## 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/doc/models/measurement-unit-weight.md b/doc/models/measurement-unit-weight.md deleted file mode 100644 index 88de6af8d..000000000 --- a/doc/models/measurement-unit-weight.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Measurement Unit Weight - -Unit of weight used to measure a quantity. - -## Enumeration - -`Measurement Unit Weight` - -## 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/doc/models/measurement-unit.md b/doc/models/measurement-unit.md deleted file mode 100644 index dab8c2d8d..000000000 --- a/doc/models/measurement-unit.md +++ /dev/null @@ -1,39 +0,0 @@ - -# 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 - -`Measurement Unit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_unit` | [`Measurement Unit Custom Hash`](../../doc/models/measurement-unit-custom.md) | Optional | The information needed to define a custom unit, provided by the seller. | -| `area_unit` | [`String (Measurement Unit Area)`](../../doc/models/measurement-unit-area.md) | Optional | Unit of area used to measure a quantity. | -| `length_unit` | [`String (Measurement Unit Length)`](../../doc/models/measurement-unit-length.md) | Optional | The unit of length used to measure a quantity. | -| `volume_unit` | [`String (Measurement Unit Volume)`](../../doc/models/measurement-unit-volume.md) | Optional | The unit of volume used to measure a quantity. | -| `weight_unit` | [`String (Measurement Unit Weight)`](../../doc/models/measurement-unit-weight.md) | Optional | Unit of weight used to measure a quantity. | -| `generic_unit` | [`String (Measurement Unit Generic)`](../../doc/models/measurement-unit-generic.md) | Optional | - | -| `time_unit` | [`String (Measurement Unit Time)`](../../doc/models/measurement-unit-time.md) | Optional | Unit of time used to measure a quantity (a duration). | -| `type` | [`String (Measurement Unit Unit Type)`](../../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/doc/models/merchant-status.md b/doc/models/merchant-status.md deleted file mode 100644 index 9e1b4c3b2..000000000 --- a/doc/models/merchant-status.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Merchant Status - -## Enumeration - -`Merchant Status` - -## 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/doc/models/merchant.md b/doc/models/merchant.md deleted file mode 100644 index eb084a924..000000000 --- a/doc/models/merchant.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Merchant - -Represents a business that sells with Square. - -## Structure - -`Merchant` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The Square-issued ID of the merchant. | -| `business_name` | `String` | Optional | The name of the merchant's overall business. | -| `country` | [`String (Country)`](../../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). | -| `language_code` | `String` | 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 (Currency)`](../../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 (Merchant Status)`](../../doc/models/merchant-status.md) | Optional | - | -| `main_location_id` | `String` | Optional | The ID of the [main `Location`](https://developer.squareup.com/docs/locations-api#about-the-main-location) for this merchant. | -| `created_at` | `String` | 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/doc/models/modifier-location-overrides.md b/doc/models/modifier-location-overrides.md deleted file mode 100644 index da09933ed..000000000 --- a/doc/models/modifier-location-overrides.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Modifier Location Overrides - -Location-specific overrides for specified properties of a `CatalogModifier` object. - -## Structure - -`Modifier Location Overrides` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `String` | Optional | The ID of the `Location` object representing the location. This can include a deactivated location. | -| `price_money` | [`Money Hash`](../../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. | -| `sold_out` | `TrueClass \| FalseClass` | 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/doc/models/money.md b/doc/models/money.md deleted file mode 100644 index 231f00ba2..000000000 --- a/doc/models/money.md +++ /dev/null @@ -1,30 +0,0 @@ - -# 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` | `Integer` | 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 (Currency)`](../../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/doc/models/obtain-token-request.md b/doc/models/obtain-token-request.md deleted file mode 100644 index 3c5db9a1a..000000000 --- a/doc/models/obtain-token-request.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Obtain Token Request - -## Structure - -`Obtain Token Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `client_id` | `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` | -| `client_secret` | `String` | 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` | 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` | -| `redirect_uri` | `String` | 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` | -| `grant_type` | `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` | -| `refresh_token` | `String` | 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` | -| `migration_token` | `String` | 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` | `Array` | 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. | -| `short_lived` | `TrueClass \| FalseClass` | 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. | -| `code_verifier` | `String` | 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/doc/models/obtain-token-response.md b/doc/models/obtain-token-response.md deleted file mode 100644 index 1f174faf3..000000000 --- a/doc/models/obtain-token-response.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Obtain Token Response - -## Structure - -`Obtain Token Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `access_token` | `String` | 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` | -| `token_type` | `String` | Optional | This value is always _bearer_.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10` | -| `expires_at` | `String` | 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` | -| `merchant_id` | `String` | Optional | The ID of the authorizing merchant's business.
**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `191` | -| `subscription_id` | `String` | 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. | -| `plan_id` | `String` | 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. | -| `id_token` | `String` | Optional | The OpenID token belonging to this person. This token is only present if the
OPENID scope is included in the authorization request. | -| `refresh_token` | `String` | 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` | -| `short_lived` | `TrueClass \| FalseClass` | 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` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `refresh_token_expires_at` | `String` | 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/doc/models/offline-payment-details.md b/doc/models/offline-payment-details.md deleted file mode 100644 index b5bb5388c..000000000 --- a/doc/models/offline-payment-details.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Offline Payment Details - -Details specific to offline payments. - -## Structure - -`Offline Payment Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `client_created_at` | `String` | 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/doc/models/order-created-object.md b/doc/models/order-created-object.md deleted file mode 100644 index 43de8183e..000000000 --- a/doc/models/order-created-object.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Created Object - -## Structure - -`Order Created Object` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_created` | [`Order Created Hash`](../../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/doc/models/order-created.md b/doc/models/order-created.md deleted file mode 100644 index 96b05ecab..000000000 --- a/doc/models/order-created.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Order Created - -## Structure - -`Order Created` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Optional | The order's unique ID. | -| `version` | `Integer` | 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) | -| `location_id` | `String` | Optional | The ID of the seller location that this order is associated with. | -| `state` | [`String (Order State)`](../../doc/models/order-state.md) | Optional | The state of the order. | -| `created_at` | `String` | 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/doc/models/order-entry.md b/doc/models/order-entry.md deleted file mode 100644 index 760d885e3..000000000 --- a/doc/models/order-entry.md +++ /dev/null @@ -1,28 +0,0 @@ - -# 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 - -`Order Entry` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Optional | The ID of the order. | -| `version` | `Integer` | 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) | -| `location_id` | `String` | 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/doc/models/order-fulfillment-delivery-details-schedule-type.md b/doc/models/order-fulfillment-delivery-details-schedule-type.md deleted file mode 100644 index 9bd1f0c42..000000000 --- a/doc/models/order-fulfillment-delivery-details-schedule-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Order Fulfillment Delivery Details Schedule Type - -The schedule type of the delivery fulfillment. - -## Enumeration - -`Order Fulfillment Delivery Details Schedule Type` - -## 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/doc/models/order-fulfillment-delivery-details.md b/doc/models/order-fulfillment-delivery-details.md deleted file mode 100644 index b7da4d325..000000000 --- a/doc/models/order-fulfillment-delivery-details.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Order Fulfillment Delivery Details - -Describes delivery details of an order fulfillment. - -## Structure - -`Order Fulfillment Delivery Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `recipient` | [`Order Fulfillment Recipient Hash`](../../doc/models/order-fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | -| `schedule_type` | [`String (Order Fulfillment Delivery Details Schedule Type)`](../../doc/models/order-fulfillment-delivery-details-schedule-type.md) | Optional | The schedule type of the delivery fulfillment. | -| `placed_at` | `String` | 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". | -| `deliver_at` | `String` | 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"). | -| `prep_time_duration` | `String` | Optional | The duration of time it takes to prepare and deliver this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | -| `delivery_window_duration` | `String` | 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` | 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` | -| `completed_at` | `String` | 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"). | -| `in_progress_at` | `String` | 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"). | -| `rejected_at` | `String` | 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"). | -| `ready_at` | `String` | 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"). | -| `delivered_at` | `String` | 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"). | -| `canceled_at` | `String` | 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"). | -| `cancel_reason` | `String` | Optional | The delivery cancellation reason. Max length: 100 characters.
**Constraints**: *Maximum Length*: `100` | -| `courier_pickup_at` | `String` | 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"). | -| `courier_pickup_window_duration` | `String` | 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"). | -| `is_no_contact_delivery` | `TrueClass \| FalseClass` | Optional | Whether the delivery is preferred to be no contact. | -| `dropoff_notes` | `String` | Optional | A note to provide additional instructions about how to deliver the order.
**Constraints**: *Maximum Length*: `550` | -| `courier_provider_name` | `String` | Optional | The name of the courier provider.
**Constraints**: *Maximum Length*: `255` | -| `courier_support_phone_number` | `String` | Optional | The support phone number of the courier.
**Constraints**: *Maximum Length*: `17` | -| `square_delivery_id` | `String` | Optional | The identifier for the delivery created by Square.
**Constraints**: *Maximum Length*: `50` | -| `external_delivery_id` | `String` | Optional | The identifier for the delivery created by the third-party courier service.
**Constraints**: *Maximum Length*: `50` | -| `managed_delivery` | `TrueClass \| FalseClass` | 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/doc/models/order-fulfillment-fulfillment-entry.md b/doc/models/order-fulfillment-fulfillment-entry.md deleted file mode 100644 index e9f356157..000000000 --- a/doc/models/order-fulfillment-fulfillment-entry.md +++ /dev/null @@ -1,35 +0,0 @@ - -# 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 - -`Order Fulfillment Fulfillment Entry` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the fulfillment entry only within this order.
**Constraints**: *Maximum Length*: `60` | -| `line_item_uid` | `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` | `Hash[String, String]` | 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/doc/models/order-fulfillment-fulfillment-line-item-application.md b/doc/models/order-fulfillment-fulfillment-line-item-application.md deleted file mode 100644 index faebb7959..000000000 --- a/doc/models/order-fulfillment-fulfillment-line-item-application.md +++ /dev/null @@ -1,17 +0,0 @@ - -# 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 - -`Order Fulfillment Fulfillment Line Item Application` - -## Fields - -| Name | Description | -| --- | --- | -| `ALL` | If `ALL`, `entries` must be unset. | -| `ENTRY_LIST` | If `ENTRY_LIST`, supply a list of `entries`. | - diff --git a/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md b/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md deleted file mode 100644 index 674532db2..000000000 --- a/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Order Fulfillment Pickup Details Curbside Pickup Details - -Specific details for curbside pickup. - -## Structure - -`Order Fulfillment Pickup Details Curbside Pickup Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `curbside_details` | `String` | Optional | Specific details for curbside pickup, such as parking number and vehicle model.
**Constraints**: *Maximum Length*: `250` | -| `buyer_arrived_at` | `String` | 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/doc/models/order-fulfillment-pickup-details-schedule-type.md b/doc/models/order-fulfillment-pickup-details-schedule-type.md deleted file mode 100644 index 1c1b9548b..000000000 --- a/doc/models/order-fulfillment-pickup-details-schedule-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Order Fulfillment Pickup Details Schedule Type - -The schedule type of the pickup fulfillment. - -## Enumeration - -`Order Fulfillment Pickup Details Schedule Type` - -## 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/doc/models/order-fulfillment-pickup-details.md b/doc/models/order-fulfillment-pickup-details.md deleted file mode 100644 index d2e4b0034..000000000 --- a/doc/models/order-fulfillment-pickup-details.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Order Fulfillment Pickup Details - -Contains details necessary to fulfill a pickup order. - -## Structure - -`Order Fulfillment Pickup Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `recipient` | [`Order Fulfillment Recipient Hash`](../../doc/models/order-fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | -| `expires_at` | `String` | 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. | -| `auto_complete_duration` | `String` | 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. | -| `schedule_type` | [`String (Order Fulfillment Pickup Details Schedule Type)`](../../doc/models/order-fulfillment-pickup-details-schedule-type.md) | Optional | The schedule type of the pickup fulfillment. | -| `pickup_at` | `String` | 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. | -| `pickup_window_duration` | `String` | 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. | -| `prep_time_duration` | `String` | Optional | The duration of time it takes to prepare this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | -| `note` | `String` | 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` | -| `placed_at` | `String` | 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"). | -| `accepted_at` | `String` | 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"). | -| `rejected_at` | `String` | 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"). | -| `ready_at` | `String` | 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"). | -| `expired_at` | `String` | 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"). | -| `picked_up_at` | `String` | 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"). | -| `canceled_at` | `String` | 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"). | -| `cancel_reason` | `String` | Optional | A description of why the pickup was canceled. The maximum length: 100 characters.
**Constraints**: *Maximum Length*: `100` | -| `is_curbside_pickup` | `TrueClass \| FalseClass` | Optional | If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. | -| `curbside_pickup_details` | [`Order Fulfillment Pickup Details Curbside Pickup Details Hash`](../../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/doc/models/order-fulfillment-recipient.md b/doc/models/order-fulfillment-recipient.md deleted file mode 100644 index d4b85d077..000000000 --- a/doc/models/order-fulfillment-recipient.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Order Fulfillment Recipient - -Information about the fulfillment recipient. - -## Structure - -`Order Fulfillment Recipient` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | 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` | -| `display_name` | `String` | 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` | -| `email_address` | `String` | 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` | -| `phone_number` | `String` | 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 Hash`](../../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/doc/models/order-fulfillment-shipment-details.md b/doc/models/order-fulfillment-shipment-details.md deleted file mode 100644 index be74c8c91..000000000 --- a/doc/models/order-fulfillment-shipment-details.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Order Fulfillment Shipment Details - -Contains the details necessary to fulfill a shipment order. - -## Structure - -`Order Fulfillment Shipment Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `recipient` | [`Order Fulfillment Recipient Hash`](../../doc/models/order-fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | -| `carrier` | `String` | Optional | The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).
**Constraints**: *Maximum Length*: `50` | -| `shipping_note` | `String` | Optional | A note with additional information for the shipping carrier.
**Constraints**: *Maximum Length*: `500` | -| `shipping_type` | `String` | Optional | A description of the type of shipping product purchased from the carrier
(such as First Class, Priority, or Express).
**Constraints**: *Maximum Length*: `50` | -| `tracking_number` | `String` | Optional | The reference number provided by the carrier to track the shipment's progress.
**Constraints**: *Maximum Length*: `100` | -| `tracking_url` | `String` | Optional | A link to the tracking webpage on the carrier's website.
**Constraints**: *Maximum Length*: `2000` | -| `placed_at` | `String` | 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"). | -| `in_progress_at` | `String` | 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"). | -| `packaged_at` | `String` | 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"). | -| `expected_shipped_at` | `String` | 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"). | -| `shipped_at` | `String` | 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"). | -| `canceled_at` | `String` | 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"). | -| `cancel_reason` | `String` | Optional | A description of why the shipment was canceled.
**Constraints**: *Maximum Length*: `100` | -| `failed_at` | `String` | 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"). | -| `failure_reason` | `String` | 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/doc/models/order-fulfillment-state.md b/doc/models/order-fulfillment-state.md deleted file mode 100644 index 28248f773..000000000 --- a/doc/models/order-fulfillment-state.md +++ /dev/null @@ -1,20 +0,0 @@ - -# Order Fulfillment State - -The current state of this fulfillment. - -## Enumeration - -`Order Fulfillment State` - -## 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/doc/models/order-fulfillment-type.md b/doc/models/order-fulfillment-type.md deleted file mode 100644 index 18504350a..000000000 --- a/doc/models/order-fulfillment-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Fulfillment Type - -The type of fulfillment. - -## Enumeration - -`Order Fulfillment Type` - -## 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/doc/models/order-fulfillment-updated-object.md b/doc/models/order-fulfillment-updated-object.md deleted file mode 100644 index 7c4ce963e..000000000 --- a/doc/models/order-fulfillment-updated-object.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Fulfillment Updated Object - -## Structure - -`Order Fulfillment Updated Object` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_fulfillment_updated` | [`Order Fulfillment Updated Hash`](../../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/doc/models/order-fulfillment-updated-update.md b/doc/models/order-fulfillment-updated-update.md deleted file mode 100644 index f573b262e..000000000 --- a/doc/models/order-fulfillment-updated-update.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Fulfillment Updated Update - -Information about fulfillment updates. - -## Structure - -`Order Fulfillment Updated Update` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `fulfillment_uid` | `String` | Optional | A unique ID that identifies the fulfillment only within this order. | -| `old_state` | [`String (Fulfillment State)`](../../doc/models/fulfillment-state.md) | Optional | The current state of this fulfillment. | -| `new_state` | [`String (Fulfillment State)`](../../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/doc/models/order-fulfillment-updated.md b/doc/models/order-fulfillment-updated.md deleted file mode 100644 index 9486f896b..000000000 --- a/doc/models/order-fulfillment-updated.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Order Fulfillment Updated - -## Structure - -`Order Fulfillment Updated` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Optional | The order's unique ID. | -| `version` | `Integer` | 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) | -| `location_id` | `String` | Optional | The ID of the seller location that this order is associated with. | -| `state` | [`String (Order State)`](../../doc/models/order-state.md) | Optional | The state of the order. | -| `created_at` | `String` | Optional | The timestamp for when the order was created, in RFC 3339 format. | -| `updated_at` | `String` | Optional | The timestamp for when the order was last updated, in RFC 3339 format. | -| `fulfillment_update` | [`Array`](../../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/doc/models/order-fulfillment.md b/doc/models/order-fulfillment.md deleted file mode 100644 index 93c0cab1a..000000000 --- a/doc/models/order-fulfillment.md +++ /dev/null @@ -1,68 +0,0 @@ - -# 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 - -`Order Fulfillment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the fulfillment only within this order.
**Constraints**: *Maximum Length*: `60` | -| `type` | [`String (Order Fulfillment Type)`](../../doc/models/order-fulfillment-type.md) | Optional | The type of fulfillment. | -| `state` | [`String (Order Fulfillment State)`](../../doc/models/order-fulfillment-state.md) | Optional | The current state of this fulfillment. | -| `line_item_application` | [`String (Order Fulfillment Fulfillment Line Item Application)`](../../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` | [`Array`](../../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` | `Hash[String, String]` | 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). | -| `pickup_details` | [`Order Fulfillment Pickup Details Hash`](../../doc/models/order-fulfillment-pickup-details.md) | Optional | Contains details necessary to fulfill a pickup order. | -| `shipment_details` | [`Order Fulfillment Shipment Details Hash`](../../doc/models/order-fulfillment-shipment-details.md) | Optional | Contains the details necessary to fulfill a shipment order. | -| `delivery_details` | [`Order Fulfillment Delivery Details Hash`](../../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/doc/models/order-line-item-applied-discount.md b/doc/models/order-line-item-applied-discount.md deleted file mode 100644 index 066816928..000000000 --- a/doc/models/order-line-item-applied-discount.md +++ /dev/null @@ -1,35 +0,0 @@ - -# 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 - -`Order Line Item Applied Discount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the applied discount only within this order.
**Constraints**: *Maximum Length*: `60` | -| `discount_uid` | `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` | -| `applied_money` | [`Money Hash`](../../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/doc/models/order-line-item-applied-service-charge.md b/doc/models/order-line-item-applied-service-charge.md deleted file mode 100644 index d9fc1ee8c..000000000 --- a/doc/models/order-line-item-applied-service-charge.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Order Line Item Applied Service Charge - -## Structure - -`Order Line Item Applied Service Charge` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the applied service charge only within this order.
**Constraints**: *Maximum Length*: `60` | -| `service_charge_uid` | `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` | -| `applied_money` | [`Money Hash`](../../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/doc/models/order-line-item-applied-tax.md b/doc/models/order-line-item-applied-tax.md deleted file mode 100644 index 24966d603..000000000 --- a/doc/models/order-line-item-applied-tax.md +++ /dev/null @@ -1,35 +0,0 @@ - -# 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 - -`Order Line Item Applied Tax` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the applied tax only within this order.
**Constraints**: *Maximum Length*: `60` | -| `tax_uid` | `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` | -| `applied_money` | [`Money Hash`](../../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/doc/models/order-line-item-discount-scope.md b/doc/models/order-line-item-discount-scope.md deleted file mode 100644 index ff0283288..000000000 --- a/doc/models/order-line-item-discount-scope.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Line Item Discount Scope - -Indicates whether this is a line-item or order-level discount. - -## Enumeration - -`Order Line Item Discount Scope` - -## 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/doc/models/order-line-item-discount-type.md b/doc/models/order-line-item-discount-type.md deleted file mode 100644 index 11d520163..000000000 --- a/doc/models/order-line-item-discount-type.md +++ /dev/null @@ -1,19 +0,0 @@ - -# Order Line Item Discount Type - -Indicates how the discount is applied to the associated line item or order. - -## Enumeration - -`Order Line Item Discount Type` - -## 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/doc/models/order-line-item-discount.md b/doc/models/order-line-item-discount.md deleted file mode 100644 index 0333f7990..000000000 --- a/doc/models/order-line-item-discount.md +++ /dev/null @@ -1,43 +0,0 @@ - -# 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 - -`Order Line Item Discount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the discount only within this order.
**Constraints**: *Maximum Length*: `60` | -| `catalog_object_id` | `String` | Optional | The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount).
**Constraints**: *Maximum Length*: `192` | -| `catalog_version` | `Integer` | Optional | The version of the catalog object that this discount references. | -| `name` | `String` | Optional | The discount's name.
**Constraints**: *Maximum Length*: `255` | -| `type` | [`String (Order Line Item Discount Type)`](../../doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. | -| `percentage` | `String` | 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` | -| `amount_money` | [`Money Hash`](../../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. | -| `applied_money` | [`Money Hash`](../../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` | `Hash[String, String]` | 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 (Order Line Item Discount Scope)`](../../doc/models/order-line-item-discount-scope.md) | Optional | Indicates whether this is a line-item or order-level discount. | -| `reward_ids` | `Array` | 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. | -| `pricing_rule_id` | `String` | 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/doc/models/order-line-item-item-type.md b/doc/models/order-line-item-item-type.md deleted file mode 100644 index 883a3c2dd..000000000 --- a/doc/models/order-line-item-item-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Line Item Item Type - -Represents the line item type. - -## Enumeration - -`Order Line Item Item Type` - -## 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/doc/models/order-line-item-modifier.md b/doc/models/order-line-item-modifier.md deleted file mode 100644 index 0bb961a0d..000000000 --- a/doc/models/order-line-item-modifier.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Order Line Item Modifier - -A [CatalogModifier](../../doc/models/catalog-modifier.md). - -## Structure - -`Order Line Item Modifier` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the modifier only within this order.
**Constraints**: *Maximum Length*: `60` | -| `catalog_object_id` | `String` | Optional | The catalog object ID referencing [CatalogModifier](entity:CatalogModifier).
**Constraints**: *Maximum Length*: `192` | -| `catalog_version` | `Integer` | Optional | The version of the catalog object that this modifier references. | -| `name` | `String` | Optional | The name of the item modifier.
**Constraints**: *Maximum Length*: `255` | -| `quantity` | `String` | 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. | -| `base_price_money` | [`Money Hash`](../../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. | -| `total_price_money` | [`Money Hash`](../../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` | `Hash[String, String]` | 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/doc/models/order-line-item-pricing-blocklists-blocked-discount.md b/doc/models/order-line-item-pricing-blocklists-blocked-discount.md deleted file mode 100644 index 4b0bf49f7..000000000 --- a/doc/models/order-line-item-pricing-blocklists-blocked-discount.md +++ /dev/null @@ -1,28 +0,0 @@ - -# 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 - -`Order Line Item Pricing Blocklists Blocked Discount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID of the `BlockedDiscount` within the order.
**Constraints**: *Maximum Length*: `60` | -| `discount_uid` | `String` | 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` | -| `discount_catalog_object_id` | `String` | 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/doc/models/order-line-item-pricing-blocklists-blocked-tax.md b/doc/models/order-line-item-pricing-blocklists-blocked-tax.md deleted file mode 100644 index bd43dd205..000000000 --- a/doc/models/order-line-item-pricing-blocklists-blocked-tax.md +++ /dev/null @@ -1,28 +0,0 @@ - -# 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 - -`Order Line Item Pricing Blocklists Blocked Tax` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID of the `BlockedTax` within the order.
**Constraints**: *Maximum Length*: `60` | -| `tax_uid` | `String` | 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` | -| `tax_catalog_object_id` | `String` | 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/doc/models/order-line-item-pricing-blocklists.md b/doc/models/order-line-item-pricing-blocklists.md deleted file mode 100644 index 0a3be37d1..000000000 --- a/doc/models/order-line-item-pricing-blocklists.md +++ /dev/null @@ -1,54 +0,0 @@ - -# 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 - -`Order Line Item Pricing Blocklists` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `blocked_discounts` | [`Array`](../../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). | -| `blocked_taxes` | [`Array`](../../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/doc/models/order-line-item-tax-scope.md b/doc/models/order-line-item-tax-scope.md deleted file mode 100644 index c9c6a2054..000000000 --- a/doc/models/order-line-item-tax-scope.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Line Item Tax Scope - -Indicates whether this is a line-item or order-level tax. - -## Enumeration - -`Order Line Item Tax Scope` - -## 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/doc/models/order-line-item-tax-type.md b/doc/models/order-line-item-tax-type.md deleted file mode 100644 index 1c23f29eb..000000000 --- a/doc/models/order-line-item-tax-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Order Line Item Tax Type - -Indicates how the tax is applied to the associated line item or order. - -## Enumeration - -`Order Line Item Tax Type` - -## 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/doc/models/order-line-item-tax.md b/doc/models/order-line-item-tax.md deleted file mode 100644 index a6bbb7b03..000000000 --- a/doc/models/order-line-item-tax.md +++ /dev/null @@ -1,40 +0,0 @@ - -# 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 - -`Order Line Item Tax` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the tax only within this order.
**Constraints**: *Maximum Length*: `60` | -| `catalog_object_id` | `String` | Optional | The catalog object ID referencing [CatalogTax](entity:CatalogTax).
**Constraints**: *Maximum Length*: `192` | -| `catalog_version` | `Integer` | Optional | The version of the catalog object that this tax references. | -| `name` | `String` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | -| `type` | [`String (Order Line Item Tax Type)`](../../doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | -| `percentage` | `String` | 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` | `Hash[String, String]` | 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). | -| `applied_money` | [`Money Hash`](../../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 (Order Line Item Tax Scope)`](../../doc/models/order-line-item-tax-scope.md) | Optional | Indicates whether this is a line-item or order-level tax. | -| `auto_applied` | `TrueClass \| FalseClass` | 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/doc/models/order-line-item.md b/doc/models/order-line-item.md deleted file mode 100644 index 545a6cb36..000000000 --- a/doc/models/order-line-item.md +++ /dev/null @@ -1,64 +0,0 @@ - -# 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 - -`Order Line Item` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the line item only within this order.
**Constraints**: *Maximum Length*: `60` | -| `name` | `String` | 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` | -| `quantity_unit` | [`Order Quantity Unit Hash`](../../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` | Optional | An optional note associated with the line item.
**Constraints**: *Maximum Length*: `2000` | -| `catalog_object_id` | `String` | Optional | The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this line item.
**Constraints**: *Maximum Length*: `192` | -| `catalog_version` | `Integer` | Optional | The version of the catalog object that this line item references. | -| `variation_name` | `String` | Optional | The name of the variation applied to this line item.
**Constraints**: *Maximum Length*: `400` | -| `item_type` | [`String (Order Line Item Item Type)`](../../doc/models/order-line-item-item-type.md) | Optional | Represents the line item type. | -| `metadata` | `Hash[String, String]` | 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` | [`Array`](../../doc/models/order-line-item-modifier.md) | Optional | The [CatalogModifier](entity:CatalogModifier)s applied to this line item. | -| `applied_taxes` | [`Array`](../../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. | -| `applied_discounts` | [`Array`](../../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. | -| `applied_service_charges` | [`Array`](../../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. | -| `base_price_money` | [`Money Hash`](../../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. | -| `variation_total_price_money` | [`Money Hash`](../../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. | -| `gross_sales_money` | [`Money Hash`](../../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. | -| `total_tax_money` | [`Money Hash`](../../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. | -| `total_discount_money` | [`Money Hash`](../../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. | -| `total_money` | [`Money Hash`](../../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. | -| `pricing_blocklists` | [`Order Line Item Pricing Blocklists Hash`](../../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). | -| `total_service_charge_money` | [`Money Hash`](../../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/doc/models/order-money-amounts.md b/doc/models/order-money-amounts.md deleted file mode 100644 index acd0cf585..000000000 --- a/doc/models/order-money-amounts.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Order Money Amounts - -A collection of various money amounts. - -## Structure - -`Order Money Amounts` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `total_money` | [`Money Hash`](../../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. | -| `tax_money` | [`Money Hash`](../../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. | -| `discount_money` | [`Money Hash`](../../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. | -| `tip_money` | [`Money Hash`](../../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. | -| `service_charge_money` | [`Money Hash`](../../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/doc/models/order-pricing-options.md b/doc/models/order-pricing-options.md deleted file mode 100644 index 160f07d2b..000000000 --- a/doc/models/order-pricing-options.md +++ /dev/null @@ -1,27 +0,0 @@ - -# 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 - -`Order Pricing Options` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `auto_apply_discounts` | `TrueClass \| FalseClass` | Optional | The option to determine whether pricing rule-based
discounts are automatically applied to an order. | -| `auto_apply_taxes` | `TrueClass \| FalseClass` | 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/doc/models/order-quantity-unit.md b/doc/models/order-quantity-unit.md deleted file mode 100644 index f04a41f85..000000000 --- a/doc/models/order-quantity-unit.md +++ /dev/null @@ -1,39 +0,0 @@ - -# 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 - -`Order Quantity Unit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `measurement_unit` | [`Measurement Unit Hash`](../../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` | `Integer` | 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. | -| `catalog_object_id` | `String` | Optional | The catalog object ID referencing the
[CatalogMeasurementUnit](entity:CatalogMeasurementUnit).

This field is set when this is a catalog-backed measurement unit. | -| `catalog_version` | `Integer` | 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/doc/models/order-return-discount.md b/doc/models/order-return-discount.md deleted file mode 100644 index 7477a08f9..000000000 --- a/doc/models/order-return-discount.md +++ /dev/null @@ -1,41 +0,0 @@ - -# 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 - -`Order Return Discount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the returned discount only within this order.
**Constraints**: *Maximum Length*: `60` | -| `source_discount_uid` | `String` | Optional | The discount `uid` from the order that contains the original application of this discount.
**Constraints**: *Maximum Length*: `60` | -| `catalog_object_id` | `String` | Optional | The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount).
**Constraints**: *Maximum Length*: `192` | -| `catalog_version` | `Integer` | Optional | The version of the catalog object that this discount references. | -| `name` | `String` | Optional | The discount's name.
**Constraints**: *Maximum Length*: `255` | -| `type` | [`String (Order Line Item Discount Type)`](../../doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. | -| `percentage` | `String` | 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` | -| `amount_money` | [`Money Hash`](../../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. | -| `applied_money` | [`Money Hash`](../../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 (Order Line Item Discount Scope)`](../../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/doc/models/order-return-line-item-modifier.md b/doc/models/order-return-line-item-modifier.md deleted file mode 100644 index 2da8fa372..000000000 --- a/doc/models/order-return-line-item-modifier.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Order Return Line Item Modifier - -A line item modifier being returned. - -## Structure - -`Order Return Line Item Modifier` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the return modifier only within this order.
**Constraints**: *Maximum Length*: `60` | -| `source_modifier_uid` | `String` | Optional | The modifier `uid` from the order's line item that contains the
original sale of this line item modifier.
**Constraints**: *Maximum Length*: `60` | -| `catalog_object_id` | `String` | Optional | The catalog object ID referencing [CatalogModifier](entity:CatalogModifier).
**Constraints**: *Maximum Length*: `192` | -| `catalog_version` | `Integer` | Optional | The version of the catalog object that this line item modifier references. | -| `name` | `String` | Optional | The name of the item modifier.
**Constraints**: *Maximum Length*: `255` | -| `base_price_money` | [`Money Hash`](../../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. | -| `total_price_money` | [`Money Hash`](../../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` | 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/doc/models/order-return-line-item.md b/doc/models/order-return-line-item.md deleted file mode 100644 index 4b8a37b1d..000000000 --- a/doc/models/order-return-line-item.md +++ /dev/null @@ -1,62 +0,0 @@ - -# Order Return Line Item - -The line item being returned in an order. - -## Structure - -`Order Return Line Item` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID for this return line-item entry.
**Constraints**: *Maximum Length*: `60` | -| `source_line_item_uid` | `String` | Optional | The `uid` of the line item in the original sale order.
**Constraints**: *Maximum Length*: `60` | -| `name` | `String` | 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` | -| `quantity_unit` | [`Order Quantity Unit Hash`](../../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` | Optional | The note of the return line item.
**Constraints**: *Maximum Length*: `2000` | -| `catalog_object_id` | `String` | Optional | The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this return line item.
**Constraints**: *Maximum Length*: `192` | -| `catalog_version` | `Integer` | Optional | The version of the catalog object that this line item references. | -| `variation_name` | `String` | Optional | The name of the variation applied to this return line item.
**Constraints**: *Maximum Length*: `400` | -| `item_type` | [`String (Order Line Item Item Type)`](../../doc/models/order-line-item-item-type.md) | Optional | Represents the line item type. | -| `return_modifiers` | [`Array`](../../doc/models/order-return-line-item-modifier.md) | Optional | The [CatalogModifier](entity:CatalogModifier)s applied to this line item. | -| `applied_taxes` | [`Array`](../../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. | -| `applied_discounts` | [`Array`](../../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. | -| `base_price_money` | [`Money Hash`](../../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. | -| `variation_total_price_money` | [`Money Hash`](../../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. | -| `gross_return_money` | [`Money Hash`](../../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. | -| `total_tax_money` | [`Money Hash`](../../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. | -| `total_discount_money` | [`Money Hash`](../../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. | -| `total_money` | [`Money Hash`](../../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. | -| `applied_service_charges` | [`Array`](../../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. | -| `total_service_charge_money` | [`Money Hash`](../../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/doc/models/order-return-service-charge.md b/doc/models/order-return-service-charge.md deleted file mode 100644 index e7f496144..000000000 --- a/doc/models/order-return-service-charge.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Order Return Service Charge - -Represents the service charge applied to the original order. - -## Structure - -`Order Return Service Charge` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the return service charge only within this order.
**Constraints**: *Maximum Length*: `60` | -| `source_service_charge_uid` | `String` | 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` | Optional | The name of the service charge.
**Constraints**: *Maximum Length*: `255` | -| `catalog_object_id` | `String` | Optional | The catalog object ID of the associated [OrderServiceCharge](entity:OrderServiceCharge).
**Constraints**: *Maximum Length*: `192` | -| `catalog_version` | `Integer` | Optional | The version of the catalog object that this service charge references. | -| `percentage` | `String` | 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` | -| `amount_money` | [`Money Hash`](../../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. | -| `applied_money` | [`Money Hash`](../../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. | -| `total_money` | [`Money Hash`](../../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. | -| `total_tax_money` | [`Money Hash`](../../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. | -| `calculation_phase` | [`String (Order Service Charge Calculation Phase)`](../../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` | `TrueClass \| FalseClass` | Optional | Indicates whether the surcharge can be taxed. Service charges
calculated in the `TOTAL_PHASE` cannot be marked as taxable. | -| `applied_taxes` | [`Array`](../../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. | -| `treatment_type` | [`String (Order Service Charge Treatment Type)`](../../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 (Order Service Charge Scope)`](../../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/doc/models/order-return-tax.md b/doc/models/order-return-tax.md deleted file mode 100644 index 179f1e8c2..000000000 --- a/doc/models/order-return-tax.md +++ /dev/null @@ -1,39 +0,0 @@ - -# 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 - -`Order Return Tax` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the returned tax only within this order.
**Constraints**: *Maximum Length*: `60` | -| `source_tax_uid` | `String` | Optional | The tax `uid` from the order that contains the original tax charge.
**Constraints**: *Maximum Length*: `60` | -| `catalog_object_id` | `String` | Optional | The catalog object ID referencing [CatalogTax](entity:CatalogTax).
**Constraints**: *Maximum Length*: `192` | -| `catalog_version` | `Integer` | Optional | The version of the catalog object that this tax references. | -| `name` | `String` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | -| `type` | [`String (Order Line Item Tax Type)`](../../doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | -| `percentage` | `String` | 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` | -| `applied_money` | [`Money Hash`](../../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 (Order Line Item Tax Scope)`](../../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/doc/models/order-return-tip.md b/doc/models/order-return-tip.md deleted file mode 100644 index 44352b9bc..000000000 --- a/doc/models/order-return-tip.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Order Return Tip - -A tip being returned. - -## Structure - -`Order Return Tip` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the tip only within this order.
**Constraints**: *Maximum Length*: `60` | -| `applied_money` | [`Money Hash`](../../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. | -| `source_tender_uid` | `String` | Optional | The tender `uid` from the order that contains the original application of this tip.
**Constraints**: *Maximum Length*: `192` | -| `source_tender_id` | `String` | 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/doc/models/order-return.md b/doc/models/order-return.md deleted file mode 100644 index 688988595..000000000 --- a/doc/models/order-return.md +++ /dev/null @@ -1,95 +0,0 @@ - -# Order Return - -The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order. - -## Structure - -`Order Return` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the return only within this order.
**Constraints**: *Maximum Length*: `60` | -| `source_order_id` | `String` | Optional | An order that contains the original sale of these return line items. This is unset
for unlinked returns. | -| `return_line_items` | [`Array`](../../doc/models/order-return-line-item.md) | Optional | A collection of line items that are being returned. | -| `return_service_charges` | [`Array`](../../doc/models/order-return-service-charge.md) | Optional | A collection of service charges that are being returned. | -| `return_taxes` | [`Array`](../../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. | -| `return_discounts` | [`Array`](../../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. | -| `return_tips` | [`Array`](../../doc/models/order-return-tip.md) | Optional | A collection of references to tips being returned for an order. | -| `rounding_adjustment` | [`Order Rounding Adjustment Hash`](../../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. | -| `return_amounts` | [`Order Money Amounts Hash`](../../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/doc/models/order-reward.md b/doc/models/order-reward.md deleted file mode 100644 index 4c0fa76b1..000000000 --- a/doc/models/order-reward.md +++ /dev/null @@ -1,26 +0,0 @@ - -# 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 - -`Order Reward` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Required | The identifier of the reward.
**Constraints**: *Minimum Length*: `1` | -| `reward_tier_id` | `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/doc/models/order-rounding-adjustment.md b/doc/models/order-rounding-adjustment.md deleted file mode 100644 index fe808a1bd..000000000 --- a/doc/models/order-rounding-adjustment.md +++ /dev/null @@ -1,31 +0,0 @@ - -# 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 - -`Order Rounding Adjustment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the rounding adjustment only within this order.
**Constraints**: *Maximum Length*: `60` | -| `name` | `String` | Optional | The name of the rounding adjustment from the original sale order. | -| `amount_money` | [`Money Hash`](../../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/doc/models/order-service-charge-calculation-phase.md b/doc/models/order-service-charge-calculation-phase.md deleted file mode 100644 index 02814bfbb..000000000 --- a/doc/models/order-service-charge-calculation-phase.md +++ /dev/null @@ -1,21 +0,0 @@ - -# 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 - -`Order Service Charge Calculation Phase` - -## 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/doc/models/order-service-charge-scope.md b/doc/models/order-service-charge-scope.md deleted file mode 100644 index ab60f5e1e..000000000 --- a/doc/models/order-service-charge-scope.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Order Service Charge Scope - -Indicates whether this is a line-item or order-level apportioned -service charge. - -## Enumeration - -`Order Service Charge Scope` - -## 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/doc/models/order-service-charge-treatment-type.md b/doc/models/order-service-charge-treatment-type.md deleted file mode 100644 index adcd8bd9a..000000000 --- a/doc/models/order-service-charge-treatment-type.md +++ /dev/null @@ -1,17 +0,0 @@ - -# 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 - -`Order Service Charge Treatment Type` - -## Fields - -| Name | -| --- | -| `LINE_ITEM_TREATMENT` | -| `APPORTIONED_TREATMENT` | - diff --git a/doc/models/order-service-charge-type.md b/doc/models/order-service-charge-type.md deleted file mode 100644 index 27d80525e..000000000 --- a/doc/models/order-service-charge-type.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Order Service Charge Type - -## Enumeration - -`Order Service Charge Type` - -## Fields - -| Name | -| --- | -| `AUTO_GRATUITY` | -| `CUSTOM` | - diff --git a/doc/models/order-service-charge.md b/doc/models/order-service-charge.md deleted file mode 100644 index feb30065d..000000000 --- a/doc/models/order-service-charge.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Order Service Charge - -Represents a service charge applied to an order. - -## Structure - -`Order Service Charge` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | A unique ID that identifies the service charge only within this order.
**Constraints**: *Maximum Length*: `60` | -| `name` | `String` | Optional | The name of the service charge.
**Constraints**: *Maximum Length*: `512` | -| `catalog_object_id` | `String` | Optional | The catalog object ID referencing the service charge [CatalogObject](entity:CatalogObject).
**Constraints**: *Maximum Length*: `192` | -| `catalog_version` | `Integer` | Optional | The version of the catalog object that this service charge references. | -| `percentage` | `String` | 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` | -| `amount_money` | [`Money Hash`](../../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. | -| `applied_money` | [`Money Hash`](../../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. | -| `total_money` | [`Money Hash`](../../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. | -| `total_tax_money` | [`Money Hash`](../../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. | -| `calculation_phase` | [`String (Order Service Charge Calculation Phase)`](../../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` | `TrueClass \| FalseClass` | 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. | -| `applied_taxes` | [`Array`](../../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` | `Hash[String, String]` | 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 (Order Service Charge Type)`](../../doc/models/order-service-charge-type.md) | Optional | - | -| `treatment_type` | [`String (Order Service Charge Treatment Type)`](../../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 (Order Service Charge Scope)`](../../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/doc/models/order-source.md b/doc/models/order-source.md deleted file mode 100644 index 2716e4e3d..000000000 --- a/doc/models/order-source.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Order Source - -Represents the origination details of an order. - -## Structure - -`Order Source` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `String` | 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/doc/models/order-state.md b/doc/models/order-state.md deleted file mode 100644 index feb37082d..000000000 --- a/doc/models/order-state.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Order State - -The state of the order. - -## Enumeration - -`Order State` - -## 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/doc/models/order-updated-object.md b/doc/models/order-updated-object.md deleted file mode 100644 index 96f45fc0b..000000000 --- a/doc/models/order-updated-object.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Order Updated Object - -## Structure - -`Order Updated Object` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_updated` | [`Order Updated Hash`](../../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/doc/models/order-updated.md b/doc/models/order-updated.md deleted file mode 100644 index 6ffd3e8c9..000000000 --- a/doc/models/order-updated.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Order Updated - -## Structure - -`Order Updated` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_id` | `String` | Optional | The order's unique ID. | -| `version` | `Integer` | 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) | -| `location_id` | `String` | Optional | The ID of the seller location that this order is associated with. | -| `state` | [`String (Order State)`](../../doc/models/order-state.md) | Optional | The state of the order. | -| `created_at` | `String` | Optional | The timestamp for when the order was created, in RFC 3339 format. | -| `updated_at` | `String` | 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/doc/models/order.md b/doc/models/order.md deleted file mode 100644 index eb10bcafd..000000000 --- a/doc/models/order.md +++ /dev/null @@ -1,88 +0,0 @@ - -# 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` | Optional | The order's unique ID. | -| `location_id` | `String` | Required | The ID of the seller location that this order is associated with.
**Constraints**: *Minimum Length*: `1` | -| `reference_id` | `String` | Optional | A client-specified ID to associate an entity in another system
with this order.
**Constraints**: *Maximum Length*: `40` | -| `source` | [`Order Source Hash`](../../doc/models/order-source.md) | Optional | Represents the origination details of an order. | -| `customer_id` | `String` | 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` | -| `line_items` | [`Array`](../../doc/models/order-line-item.md) | Optional | The line items included in the order. | -| `taxes` | [`Array`](../../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` | [`Array`](../../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. | -| `service_charges` | [`Array`](../../doc/models/order-service-charge.md) | Optional | A list of service charges applied to the order. | -| `fulfillments` | [`Array`](../../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` | [`Array`](../../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. | -| `return_amounts` | [`Order Money Amounts Hash`](../../doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | -| `net_amounts` | [`Order Money Amounts Hash`](../../doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | -| `rounding_adjustment` | [`Order Rounding Adjustment Hash`](../../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` | [`Array`](../../doc/models/tender.md) | Optional | The tenders that were used to pay for the order. | -| `refunds` | [`Array`](../../doc/models/refund.md) | Optional | The refunds that are part of this order. | -| `metadata` | `Hash[String, String]` | 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). | -| `created_at` | `String` | Optional | The timestamp for when the order was created, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | -| `updated_at` | `String` | 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"). | -| `closed_at` | `String` | 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 (Order State)`](../../doc/models/order-state.md) | Optional | The state of the order. | -| `version` | `Integer` | 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). | -| `total_money` | [`Money Hash`](../../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. | -| `total_tax_money` | [`Money Hash`](../../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. | -| `total_discount_money` | [`Money Hash`](../../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. | -| `total_tip_money` | [`Money Hash`](../../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. | -| `total_service_charge_money` | [`Money Hash`](../../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. | -| `ticket_name` | `String` | 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` | -| `pricing_options` | [`Order Pricing Options Hash`](../../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` | [`Array`](../../doc/models/order-reward.md) | Optional | A set-like list of Rewards that have been added to the Order. | -| `net_amount_due_money` | [`Money Hash`](../../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/doc/models/pagination-cursor.md b/doc/models/pagination-cursor.md deleted file mode 100644 index b2d4cc92e..000000000 --- a/doc/models/pagination-cursor.md +++ /dev/null @@ -1,24 +0,0 @@ - -# 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 - -`Pagination Cursor` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_value` | `String` | 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/doc/models/pause-subscription-request.md b/doc/models/pause-subscription-request.md deleted file mode 100644 index b98e21524..000000000 --- a/doc/models/pause-subscription-request.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Pause Subscription Request - -Defines input parameters in a request to the -[PauseSubscription](../../doc/api/subscriptions.md#pause-subscription) endpoint. - -## Structure - -`Pause Subscription Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `pause_effective_date` | `String` | 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. | -| `pause_cycle_duration` | `Integer` | 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. | -| `resume_effective_date` | `String` | 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`. | -| `resume_change_timing` | [`String (Change Timing)`](../../doc/models/change-timing.md) | Optional | Supported timings when a pending change, as an action, takes place to a subscription. | -| `pause_reason` | `String` | 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/doc/models/pause-subscription-response.md b/doc/models/pause-subscription-response.md deleted file mode 100644 index 28c95651f..000000000 --- a/doc/models/pause-subscription-response.md +++ /dev/null @@ -1,84 +0,0 @@ - -# Pause Subscription Response - -Defines output parameters in a response from the -[PauseSubscription](../../doc/api/subscriptions.md#pause-subscription) endpoint. - -## Structure - -`Pause Subscription Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered during the request. | -| `subscription` | [`Subscription Hash`](../../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` | [`Array`](../../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/doc/models/pay-order-request.md b/doc/models/pay-order-request.md deleted file mode 100644 index 825ffab24..000000000 --- a/doc/models/pay-order-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Pay Order Request - -Defines the fields that are included in requests to the -[PayOrder](../../doc/api/orders.md#pay-order) endpoint. - -## Structure - -`Pay Order Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `order_version` | `Integer` | Optional | The version of the order being paid. If not supplied, the latest version will be paid. | -| `payment_ids` | `Array` | 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/doc/models/pay-order-response.md b/doc/models/pay-order-response.md deleted file mode 100644 index ca1b5a98c..000000000 --- a/doc/models/pay-order-response.md +++ /dev/null @@ -1,226 +0,0 @@ - -# 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 - -`Pay Order Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `order` | [`Order Hash`](../../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/doc/models/payment-balance-activity-app-fee-refund-detail.md b/doc/models/payment-balance-activity-app-fee-refund-detail.md deleted file mode 100644 index 96f1171c5..000000000 --- a/doc/models/payment-balance-activity-app-fee-refund-detail.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Payment Balance Activity App Fee Refund Detail - -## Structure - -`Payment Balance Activity App Fee Refund Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | -| `refund_id` | `String` | Optional | The ID of the refund associated with this activity. | -| `location_id` | `String` | 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/doc/models/payment-balance-activity-app-fee-revenue-detail.md b/doc/models/payment-balance-activity-app-fee-revenue-detail.md deleted file mode 100644 index 3a08b2d31..000000000 --- a/doc/models/payment-balance-activity-app-fee-revenue-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity App Fee Revenue Detail - -## Structure - -`Payment Balance Activity App Fee Revenue Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | -| `location_id` | `String` | 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/doc/models/payment-balance-activity-automatic-savings-detail.md b/doc/models/payment-balance-activity-automatic-savings-detail.md deleted file mode 100644 index 40f3dc3aa..000000000 --- a/doc/models/payment-balance-activity-automatic-savings-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Automatic Savings Detail - -## Structure - -`Payment Balance Activity Automatic Savings Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | -| `payout_id` | `String` | 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/doc/models/payment-balance-activity-automatic-savings-reversed-detail.md b/doc/models/payment-balance-activity-automatic-savings-reversed-detail.md deleted file mode 100644 index 4bb3c8d76..000000000 --- a/doc/models/payment-balance-activity-automatic-savings-reversed-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Automatic Savings Reversed Detail - -## Structure - -`Payment Balance Activity Automatic Savings Reversed Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | -| `payout_id` | `String` | 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/doc/models/payment-balance-activity-charge-detail.md b/doc/models/payment-balance-activity-charge-detail.md deleted file mode 100644 index 905c7370e..000000000 --- a/doc/models/payment-balance-activity-charge-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Charge Detail - -## Structure - -`Payment Balance Activity Charge Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id2" -} -``` - diff --git a/doc/models/payment-balance-activity-deposit-fee-detail.md b/doc/models/payment-balance-activity-deposit-fee-detail.md deleted file mode 100644 index ea7522705..000000000 --- a/doc/models/payment-balance-activity-deposit-fee-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Deposit Fee Detail - -## Structure - -`Payment Balance Activity Deposit Fee Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payout_id` | `String` | Optional | The ID of the payout that triggered this deposit fee activity. | - -## Example (as JSON) - -```json -{ - "payout_id": "payout_id2" -} -``` - diff --git a/doc/models/payment-balance-activity-deposit-fee-reversed-detail.md b/doc/models/payment-balance-activity-deposit-fee-reversed-detail.md deleted file mode 100644 index 6060fbaf1..000000000 --- a/doc/models/payment-balance-activity-deposit-fee-reversed-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Deposit Fee Reversed Detail - -## Structure - -`Payment Balance Activity Deposit Fee Reversed Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payout_id` | `String` | Optional | The ID of the payout that triggered this deposit fee activity. | - -## Example (as JSON) - -```json -{ - "payout_id": "payout_id6" -} -``` - diff --git a/doc/models/payment-balance-activity-dispute-detail.md b/doc/models/payment-balance-activity-dispute-detail.md deleted file mode 100644 index daf9c3569..000000000 --- a/doc/models/payment-balance-activity-dispute-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Dispute Detail - -## Structure - -`Payment Balance Activity Dispute Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | -| `dispute_id` | `String` | 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/doc/models/payment-balance-activity-fee-detail.md b/doc/models/payment-balance-activity-fee-detail.md deleted file mode 100644 index 2ae3a3f51..000000000 --- a/doc/models/payment-balance-activity-fee-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Fee Detail - -## Structure - -`Payment Balance Activity Fee Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | 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/doc/models/payment-balance-activity-free-processing-detail.md b/doc/models/payment-balance-activity-free-processing-detail.md deleted file mode 100644 index d37ceacf9..000000000 --- a/doc/models/payment-balance-activity-free-processing-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Free Processing Detail - -## Structure - -`Payment Balance Activity Free Processing Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id8" -} -``` - diff --git a/doc/models/payment-balance-activity-hold-adjustment-detail.md b/doc/models/payment-balance-activity-hold-adjustment-detail.md deleted file mode 100644 index e6028c557..000000000 --- a/doc/models/payment-balance-activity-hold-adjustment-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Hold Adjustment Detail - -## Structure - -`Payment Balance Activity Hold Adjustment Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6" -} -``` - diff --git a/doc/models/payment-balance-activity-open-dispute-detail.md b/doc/models/payment-balance-activity-open-dispute-detail.md deleted file mode 100644 index 1a978ac7d..000000000 --- a/doc/models/payment-balance-activity-open-dispute-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Open Dispute Detail - -## Structure - -`Payment Balance Activity Open Dispute Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | -| `dispute_id` | `String` | 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/doc/models/payment-balance-activity-other-adjustment-detail.md b/doc/models/payment-balance-activity-other-adjustment-detail.md deleted file mode 100644 index 52195b4f4..000000000 --- a/doc/models/payment-balance-activity-other-adjustment-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Other Adjustment Detail - -## Structure - -`Payment Balance Activity Other Adjustment Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id4" -} -``` - diff --git a/doc/models/payment-balance-activity-other-detail.md b/doc/models/payment-balance-activity-other-detail.md deleted file mode 100644 index 5acea04c5..000000000 --- a/doc/models/payment-balance-activity-other-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Other Detail - -## Structure - -`Payment Balance Activity Other Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id4" -} -``` - diff --git a/doc/models/payment-balance-activity-refund-detail.md b/doc/models/payment-balance-activity-refund-detail.md deleted file mode 100644 index 4baa75613..000000000 --- a/doc/models/payment-balance-activity-refund-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Refund Detail - -## Structure - -`Payment Balance Activity Refund Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | -| `refund_id` | `String` | 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/doc/models/payment-balance-activity-release-adjustment-detail.md b/doc/models/payment-balance-activity-release-adjustment-detail.md deleted file mode 100644 index 1b1985b11..000000000 --- a/doc/models/payment-balance-activity-release-adjustment-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Release Adjustment Detail - -## Structure - -`Payment Balance Activity Release Adjustment Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id0" -} -``` - diff --git a/doc/models/payment-balance-activity-reserve-hold-detail.md b/doc/models/payment-balance-activity-reserve-hold-detail.md deleted file mode 100644 index 74ef32d0a..000000000 --- a/doc/models/payment-balance-activity-reserve-hold-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Reserve Hold Detail - -## Structure - -`Payment Balance Activity Reserve Hold Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id8" -} -``` - diff --git a/doc/models/payment-balance-activity-reserve-release-detail.md b/doc/models/payment-balance-activity-reserve-release-detail.md deleted file mode 100644 index 8e184ab44..000000000 --- a/doc/models/payment-balance-activity-reserve-release-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Reserve Release Detail - -## Structure - -`Payment Balance Activity Reserve Release Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6" -} -``` - diff --git a/doc/models/payment-balance-activity-square-capital-payment-detail.md b/doc/models/payment-balance-activity-square-capital-payment-detail.md deleted file mode 100644 index 635cfb7ed..000000000 --- a/doc/models/payment-balance-activity-square-capital-payment-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Square Capital Payment Detail - -## Structure - -`Payment Balance Activity Square Capital Payment Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6" -} -``` - diff --git a/doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md b/doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md deleted file mode 100644 index f2a1a638d..000000000 --- a/doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Square Capital Reversed Payment Detail - -## Structure - -`Payment Balance Activity Square Capital Reversed Payment Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id8" -} -``` - diff --git a/doc/models/payment-balance-activity-square-payroll-transfer-detail.md b/doc/models/payment-balance-activity-square-payroll-transfer-detail.md deleted file mode 100644 index d1562668e..000000000 --- a/doc/models/payment-balance-activity-square-payroll-transfer-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Square Payroll Transfer Detail - -## Structure - -`Payment Balance Activity Square Payroll Transfer Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id0" -} -``` - diff --git a/doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md b/doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md deleted file mode 100644 index 374acd516..000000000 --- a/doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Square Payroll Transfer Reversed Detail - -## Structure - -`Payment Balance Activity Square Payroll Transfer Reversed Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6" -} -``` - diff --git a/doc/models/payment-balance-activity-tax-on-fee-detail.md b/doc/models/payment-balance-activity-tax-on-fee-detail.md deleted file mode 100644 index 09888654e..000000000 --- a/doc/models/payment-balance-activity-tax-on-fee-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Tax on Fee Detail - -## Structure - -`Payment Balance Activity Tax on Fee Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | -| `tax_rate_description` | `String` | 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/doc/models/payment-balance-activity-third-party-fee-detail.md b/doc/models/payment-balance-activity-third-party-fee-detail.md deleted file mode 100644 index 7d043d059..000000000 --- a/doc/models/payment-balance-activity-third-party-fee-detail.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Payment Balance Activity Third Party Fee Detail - -## Structure - -`Payment Balance Activity Third Party Fee Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id8" -} -``` - diff --git a/doc/models/payment-balance-activity-third-party-fee-refund-detail.md b/doc/models/payment-balance-activity-third-party-fee-refund-detail.md deleted file mode 100644 index a9c879b1f..000000000 --- a/doc/models/payment-balance-activity-third-party-fee-refund-detail.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Payment Balance Activity Third Party Fee Refund Detail - -## Structure - -`Payment Balance Activity Third Party Fee Refund Detail` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Optional | The ID of the payment associated with this activity. | -| `refund_id` | `String` | Optional | The public refund id associated with this activity. | - -## Example (as JSON) - -```json -{ - "payment_id": "payment_id6", - "refund_id": "refund_id0" -} -``` - diff --git a/doc/models/payment-link-related-resources.md b/doc/models/payment-link-related-resources.md deleted file mode 100644 index a5b431eb9..000000000 --- a/doc/models/payment-link-related-resources.md +++ /dev/null @@ -1,223 +0,0 @@ - -# Payment Link Related Resources - -## Structure - -`Payment Link Related Resources` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `orders` | [`Array`](../../doc/models/order.md) | Optional | The order associated with the payment link. | -| `subscription_plans` | [`Array`](../../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/doc/models/payment-link.md b/doc/models/payment-link.md deleted file mode 100644 index f2bef8be2..000000000 --- a/doc/models/payment-link.md +++ /dev/null @@ -1,59 +0,0 @@ - -# Payment Link - -## Structure - -`Payment Link` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | The Square-assigned ID of the payment link. | -| `version` | `Integer` | Required | The Square-assigned version number, which is incremented each time an update is committed to the payment link.
**Constraints**: `<= 65535` | -| `description` | `String` | 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` | -| `order_id` | `String` | Optional | The ID of the order associated with the payment link.
**Constraints**: *Maximum Length*: `192` | -| `checkout_options` | [`Checkout Options Hash`](../../doc/models/checkout-options.md) | Optional | - | -| `pre_populated_data` | [`Pre Populated Data Hash`](../../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` | Optional | The shortened URL of the payment link.
**Constraints**: *Maximum Length*: `255` | -| `long_url` | `String` | Optional | The long URL of the payment link.
**Constraints**: *Maximum Length*: `255` | -| `created_at` | `String` | Optional | The timestamp when the payment link was created, in RFC 3339 format. | -| `updated_at` | `String` | Optional | The timestamp when the payment link was last updated, in RFC 3339 format. | -| `payment_note` | `String` | 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/doc/models/payment-options-delay-action.md b/doc/models/payment-options-delay-action.md deleted file mode 100644 index 74c430391..000000000 --- a/doc/models/payment-options-delay-action.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Payment Options Delay Action - -Describes the action to be applied to a delayed capture payment when the delay_duration -has elapsed. - -## Enumeration - -`Payment Options Delay Action` - -## 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/doc/models/payment-options.md b/doc/models/payment-options.md deleted file mode 100644 index adcea8418..000000000 --- a/doc/models/payment-options.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Payment Options - -## Structure - -`Payment Options` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `autocomplete` | `TrueClass \| FalseClass` | Optional | Indicates whether the `Payment` objects created from this `TerminalCheckout` are automatically
`COMPLETED` or left in an `APPROVED` state for later modification. | -| `delay_duration` | `String` | 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. | -| `accept_partial_authorization` | `TrueClass \| FalseClass` | 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 | -| `delay_action` | [`String (Payment Options Delay Action)`](../../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/doc/models/payment-refund.md b/doc/models/payment-refund.md deleted file mode 100644 index 355d9781c..000000000 --- a/doc/models/payment-refund.md +++ /dev/null @@ -1,75 +0,0 @@ - -# Payment Refund - -Represents a refund of a payment made using Square. Contains information about -the original payment and the amount of money refunded. - -## Structure - -`Payment Refund` - -## 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` | Optional | The refund's status:

- `PENDING` - Awaiting approval.
- `COMPLETED` - Successfully completed.
- `REJECTED` - The refund was rejected.
- `FAILED` - An error occurred.
**Constraints**: *Maximum Length*: `50` | -| `location_id` | `String` | Optional | The location ID associated with the payment this refund is attached to.
**Constraints**: *Maximum Length*: `50` | -| `unlinked` | `TrueClass \| FalseClass` | Optional | Flag indicating whether or not the refund is linked to an existing payment in Square. | -| `destination_type` | `String` | 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` | -| `destination_details` | [`Destination Details Hash`](../../doc/models/destination-details.md) | Optional | Details about a refund's destination. | -| `amount_money` | [`Money Hash`](../../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. | -| `app_fee_money` | [`Money Hash`](../../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. | -| `processing_fee` | [`Array`](../../doc/models/processing-fee.md) | Optional | Processing fees and fee adjustments assessed by Square for this refund. | -| `payment_id` | `String` | Optional | The ID of the payment associated with this refund.
**Constraints**: *Maximum Length*: `192` | -| `order_id` | `String` | Optional | The ID of the order associated with the refund.
**Constraints**: *Maximum Length*: `192` | -| `reason` | `String` | Optional | The reason for the refund.
**Constraints**: *Maximum Length*: `192` | -| `created_at` | `String` | Optional | The timestamp of when the refund was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | -| `updated_at` | `String` | Optional | The timestamp of when the refund was last updated, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | -| `team_member_id` | `String` | Optional | An optional ID of the team member associated with taking the payment.
**Constraints**: *Maximum Length*: `192` | -| `terminal_refund_id` | `String` | 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/doc/models/payment-sort-field.md b/doc/models/payment-sort-field.md deleted file mode 100644 index f15d03e5e..000000000 --- a/doc/models/payment-sort-field.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Payment Sort Field - -## Enumeration - -`Payment Sort Field` - -## Fields - -| Name | -| --- | -| `CREATED_AT` | -| `OFFLINE_CREATED_AT` | -| `UPDATED_AT` | - diff --git a/doc/models/payment.md b/doc/models/payment.md deleted file mode 100644 index dcdb4c221..000000000 --- a/doc/models/payment.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Payment - -Represents a payment processed by the Square API. - -## Structure - -`Payment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Optional | A unique ID for the payment.
**Constraints**: *Maximum Length*: `192` | -| `created_at` | `String` | Optional | The timestamp of when the payment was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | -| `updated_at` | `String` | Optional | The timestamp of when the payment was last updated, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | -| `amount_money` | [`Money Hash`](../../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. | -| `tip_money` | [`Money Hash`](../../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. | -| `total_money` | [`Money Hash`](../../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. | -| `app_fee_money` | [`Money Hash`](../../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. | -| `approved_money` | [`Money Hash`](../../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. | -| `processing_fee` | [`Array`](../../doc/models/processing-fee.md) | Optional | The processing fees and fee adjustments assessed by Square for this payment. | -| `refunded_money` | [`Money Hash`](../../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` | Optional | Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED.
**Constraints**: *Maximum Length*: `50` | -| `delay_duration` | `String` | 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. | -| `delay_action` | `String` | Optional | The action to be applied to the payment when the `delay_duration` has elapsed.

Current values include `CANCEL` and `COMPLETE`. | -| `delayed_until` | `String` | 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. | -| `source_type` | `String` | 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` | -| `card_details` | [`Card Payment Details Hash`](../../doc/models/card-payment-details.md) | Optional | Reflects the current status of a card payment. Contains only non-confidential information. | -| `cash_details` | [`Cash Payment Details Hash`](../../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). | -| `bank_account_details` | [`Bank Account Payment Details Hash`](../../doc/models/bank-account-payment-details.md) | Optional | Additional details about BANK_ACCOUNT type payments. | -| `external_details` | [`External Payment Details Hash`](../../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). | -| `wallet_details` | [`Digital Wallet Details Hash`](../../doc/models/digital-wallet-details.md) | Optional | Additional details about `WALLET` type payments. Contains only non-confidential information. | -| `buy_now_pay_later_details` | [`Buy Now Pay Later Details Hash`](../../doc/models/buy-now-pay-later-details.md) | Optional | Additional details about a Buy Now Pay Later payment type. | -| `square_account_details` | [`Square Account Details Hash`](../../doc/models/square-account-details.md) | Optional | Additional details about Square Account payments. | -| `location_id` | `String` | Optional | The ID of the location associated with the payment.
**Constraints**: *Maximum Length*: `50` | -| `order_id` | `String` | Optional | The ID of the order associated with the payment.
**Constraints**: *Maximum Length*: `192` | -| `reference_id` | `String` | Optional | An optional ID that associates the payment with an entity in
another system.
**Constraints**: *Maximum Length*: `40` | -| `customer_id` | `String` | 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` | -| `employee_id` | `String` | Optional | __Deprecated__: Use `Payment.team_member_id` instead.

An optional ID of the employee associated with taking the payment.
**Constraints**: *Maximum Length*: `192` | -| `team_member_id` | `String` | Optional | An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment.
**Constraints**: *Maximum Length*: `192` | -| `refund_ids` | `Array` | Optional | A list of `refund_id`s identifying refunds for the payment. | -| `risk_evaluation` | [`Risk Evaluation Hash`](../../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). | -| `terminal_checkout_id` | `String` | Optional | An optional ID for a Terminal checkout that is associated with the payment. | -| `buyer_email_address` | `String` | Optional | The buyer's email address.
**Constraints**: *Maximum Length*: `255` | -| `billing_address` | [`Address Hash`](../../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). | -| `shipping_address` | [`Address Hash`](../../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` | Optional | An optional note to include when creating a payment.
**Constraints**: *Maximum Length*: `500` | -| `statement_description_identifier` | `String` | 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` | `Array` | 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. | -| `receipt_number` | `String` | Optional | The payment's receipt number.
The field is missing if a payment is canceled.
**Constraints**: *Maximum Length*: `4` | -| `receipt_url` | `String` | Optional | The URL for the payment's receipt.
The field is only populated for COMPLETED payments.
**Constraints**: *Maximum Length*: `255` | -| `device_details` | [`Device Details Hash`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. | -| `application_details` | [`Application Details Hash`](../../doc/models/application-details.md) | Optional | Details about the application that took the payment. | -| `is_offline_payment` | `TrueClass \| FalseClass` | Optional | Whether or not this payment was taken offline. | -| `offline_payment_details` | [`Offline Payment Details Hash`](../../doc/models/offline-payment-details.md) | Optional | Details specific to offline payments. | -| `version_token` | `String` | 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/doc/models/payout-entry.md b/doc/models/payout-entry.md deleted file mode 100644 index eb4c10574..000000000 --- a/doc/models/payout-entry.md +++ /dev/null @@ -1,70 +0,0 @@ - -# 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 - -`Payout Entry` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `String` | Required | A unique ID for the payout entry.
**Constraints**: *Minimum Length*: `1` | -| `payout_id` | `String` | Required | The ID of the payout entries’ associated payout.
**Constraints**: *Minimum Length*: `1` | -| `effective_at` | `String` | Optional | The timestamp of when the payout entry affected the balance, in RFC 3339 format. | -| `type` | [`String (Activity Type)`](../../doc/models/activity-type.md) | Optional | - | -| `gross_amount_money` | [`Money Hash`](../../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. | -| `fee_amount_money` | [`Money Hash`](../../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. | -| `net_amount_money` | [`Money Hash`](../../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. | -| `type_app_fee_revenue_details` | [`Payment Balance Activity App Fee Revenue Detail Hash`](../../doc/models/payment-balance-activity-app-fee-revenue-detail.md) | Optional | - | -| `type_app_fee_refund_details` | [`Payment Balance Activity App Fee Refund Detail Hash`](../../doc/models/payment-balance-activity-app-fee-refund-detail.md) | Optional | - | -| `type_automatic_savings_details` | [`Payment Balance Activity Automatic Savings Detail Hash`](../../doc/models/payment-balance-activity-automatic-savings-detail.md) | Optional | - | -| `type_automatic_savings_reversed_details` | [`Payment Balance Activity Automatic Savings Reversed Detail Hash`](../../doc/models/payment-balance-activity-automatic-savings-reversed-detail.md) | Optional | - | -| `type_charge_details` | [`Payment Balance Activity Charge Detail Hash`](../../doc/models/payment-balance-activity-charge-detail.md) | Optional | - | -| `type_deposit_fee_details` | [`Payment Balance Activity Deposit Fee Detail Hash`](../../doc/models/payment-balance-activity-deposit-fee-detail.md) | Optional | - | -| `type_deposit_fee_reversed_details` | [`Payment Balance Activity Deposit Fee Reversed Detail Hash`](../../doc/models/payment-balance-activity-deposit-fee-reversed-detail.md) | Optional | - | -| `type_dispute_details` | [`Payment Balance Activity Dispute Detail Hash`](../../doc/models/payment-balance-activity-dispute-detail.md) | Optional | - | -| `type_fee_details` | [`Payment Balance Activity Fee Detail Hash`](../../doc/models/payment-balance-activity-fee-detail.md) | Optional | - | -| `type_free_processing_details` | [`Payment Balance Activity Free Processing Detail Hash`](../../doc/models/payment-balance-activity-free-processing-detail.md) | Optional | - | -| `type_hold_adjustment_details` | [`Payment Balance Activity Hold Adjustment Detail Hash`](../../doc/models/payment-balance-activity-hold-adjustment-detail.md) | Optional | - | -| `type_open_dispute_details` | [`Payment Balance Activity Open Dispute Detail Hash`](../../doc/models/payment-balance-activity-open-dispute-detail.md) | Optional | - | -| `type_other_details` | [`Payment Balance Activity Other Detail Hash`](../../doc/models/payment-balance-activity-other-detail.md) | Optional | - | -| `type_other_adjustment_details` | [`Payment Balance Activity Other Adjustment Detail Hash`](../../doc/models/payment-balance-activity-other-adjustment-detail.md) | Optional | - | -| `type_refund_details` | [`Payment Balance Activity Refund Detail Hash`](../../doc/models/payment-balance-activity-refund-detail.md) | Optional | - | -| `type_release_adjustment_details` | [`Payment Balance Activity Release Adjustment Detail Hash`](../../doc/models/payment-balance-activity-release-adjustment-detail.md) | Optional | - | -| `type_reserve_hold_details` | [`Payment Balance Activity Reserve Hold Detail Hash`](../../doc/models/payment-balance-activity-reserve-hold-detail.md) | Optional | - | -| `type_reserve_release_details` | [`Payment Balance Activity Reserve Release Detail Hash`](../../doc/models/payment-balance-activity-reserve-release-detail.md) | Optional | - | -| `type_square_capital_payment_details` | [`Payment Balance Activity Square Capital Payment Detail Hash`](../../doc/models/payment-balance-activity-square-capital-payment-detail.md) | Optional | - | -| `type_square_capital_reversed_payment_details` | [`Payment Balance Activity Square Capital Reversed Payment Detail Hash`](../../doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md) | Optional | - | -| `type_tax_on_fee_details` | [`Payment Balance Activity Tax on Fee Detail Hash`](../../doc/models/payment-balance-activity-tax-on-fee-detail.md) | Optional | - | -| `type_third_party_fee_details` | [`Payment Balance Activity Third Party Fee Detail Hash`](../../doc/models/payment-balance-activity-third-party-fee-detail.md) | Optional | - | -| `type_third_party_fee_refund_details` | [`Payment Balance Activity Third Party Fee Refund Detail Hash`](../../doc/models/payment-balance-activity-third-party-fee-refund-detail.md) | Optional | - | -| `type_square_payroll_transfer_details` | [`Payment Balance Activity Square Payroll Transfer Detail Hash`](../../doc/models/payment-balance-activity-square-payroll-transfer-detail.md) | Optional | - | -| `type_square_payroll_transfer_reversed_details` | [`Payment Balance Activity Square Payroll Transfer Reversed Detail Hash`](../../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/doc/models/payout-fee-type.md b/doc/models/payout-fee-type.md deleted file mode 100644 index 0f46b43b0..000000000 --- a/doc/models/payout-fee-type.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Payout Fee Type - -Represents the type of payout fee that can incur as part of a payout. - -## Enumeration - -`Payout Fee Type` - -## Fields - -| Name | Description | -| --- | --- | -| `TRANSFER_FEE` | Fee type associated with transfers. | -| `TAX_ON_TRANSFER_FEE` | Taxes associated with the transfer fee. | - diff --git a/doc/models/payout-fee.md b/doc/models/payout-fee.md deleted file mode 100644 index 40240ebdb..000000000 --- a/doc/models/payout-fee.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Payout Fee - -Represents a payout fee that can incur as part of a payout. - -## Structure - -`Payout Fee` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `amount_money` | [`Money Hash`](../../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. | -| `effective_at` | `String` | Optional | The timestamp of when the fee takes effect, in RFC 3339 format. | -| `type` | [`String (Payout Fee Type)`](../../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/doc/models/payout-status.md b/doc/models/payout-status.md deleted file mode 100644 index 4936acdd8..000000000 --- a/doc/models/payout-status.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Payout Status - -Payout status types - -## Enumeration - -`Payout Status` - -## 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/doc/models/payout-type.md b/doc/models/payout-type.md deleted file mode 100644 index 575251779..000000000 --- a/doc/models/payout-type.md +++ /dev/null @@ -1,19 +0,0 @@ - -# 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 - -`Payout Type` - -## 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/doc/models/payout.md b/doc/models/payout.md deleted file mode 100644 index 05662a0d6..000000000 --- a/doc/models/payout.md +++ /dev/null @@ -1,47 +0,0 @@ - -# 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 (Payout Status)`](../../doc/models/payout-status.md) | Optional | Payout status types | -| `location_id` | `String` | Required | The ID of the location associated with the payout.
**Constraints**: *Minimum Length*: `1` | -| `created_at` | `String` | Optional | The timestamp of when the payout was created and submitted for deposit to the seller's banking destination, in RFC 3339 format. | -| `updated_at` | `String` | Optional | The timestamp of when the payout was last updated, in RFC 3339 format. | -| `amount_money` | [`Money Hash`](../../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 Hash`](../../doc/models/destination.md) | Optional | Information about the destination against which the payout was made. | -| `version` | `Integer` | 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 (Payout Type)`](../../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. | -| `payout_fee` | [`Array`](../../doc/models/payout-fee.md) | Optional | A list of transfer fees and any taxes on the fees assessed by Square for this payout. | -| `arrival_date` | `String` | Optional | The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s banking destination. | -| `end_to_end_id` | `String` | 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/doc/models/phase-input.md b/doc/models/phase-input.md deleted file mode 100644 index 182739667..000000000 --- a/doc/models/phase-input.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Phase Input - -Represents the arguments used to construct a new phase. - -## Structure - -`Phase Input` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ordinal` | `Integer` | Required | index of phase in total subscription plan | -| `order_template_id` | `String` | Optional | id of order to be used in billing | - -## Example (as JSON) - -```json -{ - "ordinal": 234, - "order_template_id": "order_template_id4" -} -``` - diff --git a/doc/models/phase.md b/doc/models/phase.md deleted file mode 100644 index 2f6cf39cf..000000000 --- a/doc/models/phase.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Phase - -Represents a phase, which can override subscription phases as defined by plan_id - -## Structure - -`Phase` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `String` | Optional | id of subscription phase | -| `ordinal` | `Integer` | Optional | index of phase in total subscription plan | -| `order_template_id` | `String` | Optional | id of order to be used in billing | -| `plan_phase_uid` | `String` | 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/doc/models/pre-populated-data.md b/doc/models/pre-populated-data.md deleted file mode 100644 index 002428063..000000000 --- a/doc/models/pre-populated-data.md +++ /dev/null @@ -1,35 +0,0 @@ - -# 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 - -`Pre Populated Data` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `buyer_email` | `String` | Optional | The buyer email to prepopulate in the payment form.
**Constraints**: *Maximum Length*: `256` | -| `buyer_phone_number` | `String` | Optional | The buyer phone number to prepopulate in the payment form.
**Constraints**: *Maximum Length*: `17` | -| `buyer_address` | [`Address Hash`](../../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/doc/models/processing-fee.md b/doc/models/processing-fee.md deleted file mode 100644 index bb9bcdae4..000000000 --- a/doc/models/processing-fee.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Processing Fee - -Represents the Square processing fee. - -## Structure - -`Processing Fee` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `effective_at` | `String` | Optional | The timestamp of when the fee takes effect, in RFC 3339 format. | -| `type` | `String` | Optional | The type of fee assessed or adjusted. The fee type can be `INITIAL` or `ADJUSTMENT`. | -| `amount_money` | [`Money Hash`](../../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/doc/models/product-type.md b/doc/models/product-type.md deleted file mode 100644 index 1b8dc5dbe..000000000 --- a/doc/models/product-type.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Product Type - -## Enumeration - -`Product Type` - -## Fields - -| Name | -| --- | -| `TERMINAL_API` | - diff --git a/doc/models/product.md b/doc/models/product.md deleted file mode 100644 index 699d85d8e..000000000 --- a/doc/models/product.md +++ /dev/null @@ -1,24 +0,0 @@ - -# 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/doc/models/publish-invoice-request.md b/doc/models/publish-invoice-request.md deleted file mode 100644 index b3c8b70d0..000000000 --- a/doc/models/publish-invoice-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Publish Invoice Request - -Describes a `PublishInvoice` request. - -## Structure - -`Publish Invoice Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `Integer` | Required | The version of the [invoice](entity:Invoice) to publish.
This must match the current version of the invoice; otherwise, the request is rejected. | -| `idempotency_key` | `String` | 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/doc/models/publish-invoice-response.md b/doc/models/publish-invoice-response.md deleted file mode 100644 index 50e7713ed..000000000 --- a/doc/models/publish-invoice-response.md +++ /dev/null @@ -1,107 +0,0 @@ - -# Publish Invoice Response - -Describes a `PublishInvoice` response. - -## Structure - -`Publish Invoice Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoice` | [`Invoice Hash`](../../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` | [`Array`](../../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/doc/models/qr-code-options.md b/doc/models/qr-code-options.md deleted file mode 100644 index 751e5c6f0..000000000 --- a/doc/models/qr-code-options.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Qr Code Options - -Fields to describe the action that displays QR-Codes. - -## Structure - -`Qr Code Options` - -## 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` | -| `barcode_contents` | `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/doc/models/quantity-ratio.md b/doc/models/quantity-ratio.md deleted file mode 100644 index 99c01fbb6..000000000 --- a/doc/models/quantity-ratio.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Quantity Ratio - -A whole number or unreduced fractional ratio. - -## Structure - -`Quantity Ratio` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `quantity` | `Integer` | Optional | The whole or fractional quantity as the numerator. | -| `quantity_denominator` | `Integer` | 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/doc/models/quick-pay.md b/doc/models/quick-pay.md deleted file mode 100644 index 4c5a69c3f..000000000 --- a/doc/models/quick-pay.md +++ /dev/null @@ -1,32 +0,0 @@ - -# 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 - -`Quick Pay` - -## 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` | -| `price_money` | [`Money Hash`](../../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. | -| `location_id` | `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/doc/models/range.md b/doc/models/range.md deleted file mode 100644 index 731b3f450..000000000 --- a/doc/models/range.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Range - -The range of a number value between the specified lower and upper bounds. - -## Structure - -`Range` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `min` | `String` | 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` | 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/doc/models/receipt-options.md b/doc/models/receipt-options.md deleted file mode 100644 index 8fb4775dc..000000000 --- a/doc/models/receipt-options.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Receipt Options - -Describes receipt action fields. - -## Structure - -`Receipt Options` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `payment_id` | `String` | Required | The reference to the Square payment ID for the receipt. | -| `print_only` | `TrueClass \| FalseClass` | Optional | Instructs the device to print the receipt without displaying the receipt selection screen.
Requires `printer_enabled` set to true.
Defaults to false. | -| `is_duplicate` | `TrueClass \| FalseClass` | 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/doc/models/redeem-loyalty-reward-request.md b/doc/models/redeem-loyalty-reward-request.md deleted file mode 100644 index 37424465d..000000000 --- a/doc/models/redeem-loyalty-reward-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Redeem Loyalty Reward Request - -A request to redeem a loyalty reward. - -## Structure - -`Redeem Loyalty Reward Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `location_id` | `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/doc/models/redeem-loyalty-reward-response.md b/doc/models/redeem-loyalty-reward-response.md deleted file mode 100644 index be9cc3084..000000000 --- a/doc/models/redeem-loyalty-reward-response.md +++ /dev/null @@ -1,70 +0,0 @@ - -# Redeem Loyalty Reward Response - -A response that includes the `LoyaltyEvent` published for redeeming the reward. - -## Structure - -`Redeem Loyalty Reward Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `event` | [`Loyalty Event Hash`](../../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/doc/models/refund-payment-request.md b/doc/models/refund-payment-request.md deleted file mode 100644 index 8538a28c8..000000000 --- a/doc/models/refund-payment-request.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Refund Payment Request - -Describes a request to refund a payment using [RefundPayment](../../doc/api/refunds.md#refund-payment). - -## Structure - -`Refund Payment Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `idempotency_key` | `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` | -| `amount_money` | [`Money Hash`](../../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. | -| `app_fee_money` | [`Money Hash`](../../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. | -| `payment_id` | `String` | Optional | The unique ID of the payment being refunded.
Required when unlinked=false, otherwise must not be set. | -| `destination_id` | `String` | 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` | `TrueClass \| FalseClass` | 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. | -| `location_id` | `String` | 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` | -| `customer_id` | `String` | 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` | Optional | A description of the reason for the refund.
**Constraints**: *Maximum Length*: `192` | -| `payment_version_token` | `String` | 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. | -| `team_member_id` | `String` | Optional | An optional [TeamMember](entity:TeamMember) ID to associate with this refund.
**Constraints**: *Maximum Length*: `192` | -| `cash_details` | [`Destination Details Cash Refund Details Hash`](../../doc/models/destination-details-cash-refund-details.md) | Optional | Stores details about a cash refund. Contains only non-confidential information. | -| `external_details` | [`Destination Details External Refund Details Hash`](../../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/doc/models/refund-payment-response.md b/doc/models/refund-payment-response.md deleted file mode 100644 index 926663cc6..000000000 --- a/doc/models/refund-payment-response.md +++ /dev/null @@ -1,89 +0,0 @@ - -# 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 - -`Refund Payment Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `refund` | [`Payment Refund Hash`](../../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/doc/models/refund-status.md b/doc/models/refund-status.md deleted file mode 100644 index 0aadfbdcc..000000000 --- a/doc/models/refund-status.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Refund Status - -Indicates a refund's current status. - -## Enumeration - -`Refund Status` - -## 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/doc/models/refund.md b/doc/models/refund.md deleted file mode 100644 index 8220fbad2..000000000 --- a/doc/models/refund.md +++ /dev/null @@ -1,75 +0,0 @@ - -# 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` | -| `location_id` | `String` | Required | The ID of the refund's associated location.
**Constraints**: *Maximum Length*: `50` | -| `transaction_id` | `String` | Optional | The ID of the transaction that the refunded tender is part of.
**Constraints**: *Maximum Length*: `192` | -| `tender_id` | `String` | Optional | The ID of the refunded tender.
**Constraints**: *Maximum Length*: `192` | -| `created_at` | `String` | 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` | -| `amount_money` | [`Money Hash`](../../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 (Refund Status)`](../../doc/models/refund-status.md) | Required | Indicates a refund's current status. | -| `processing_fee_money` | [`Money Hash`](../../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. | -| `additional_recipients` | [`Array`](../../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/doc/models/register-domain-request.md b/doc/models/register-domain-request.md deleted file mode 100644 index e4e2e9144..000000000 --- a/doc/models/register-domain-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# 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 - -`Register Domain Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `domain_name` | `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/doc/models/register-domain-response-status.md b/doc/models/register-domain-response-status.md deleted file mode 100644 index 6d15dd97a..000000000 --- a/doc/models/register-domain-response-status.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Register Domain Response Status - -The status of the domain registration. - -## Enumeration - -`Register Domain Response Status` - -## 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/doc/models/register-domain-response.md b/doc/models/register-domain-response.md deleted file mode 100644 index b3effd623..000000000 --- a/doc/models/register-domain-response.md +++ /dev/null @@ -1,47 +0,0 @@ - -# 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 - -`Register Domain Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `status` | [`String (Register Domain Response Status)`](../../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/doc/models/remove-group-from-customer-response.md b/doc/models/remove-group-from-customer-response.md deleted file mode 100644 index 0f3747df4..000000000 --- a/doc/models/remove-group-from-customer-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# 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 - -`Remove Group From Customer Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../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/doc/models/resume-subscription-request.md b/doc/models/resume-subscription-request.md deleted file mode 100644 index a8cc58399..000000000 --- a/doc/models/resume-subscription-request.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Resume Subscription Request - -Defines input parameters in a request to the -[ResumeSubscription](../../doc/api/subscriptions.md#resume-subscription) endpoint. - -## Structure - -`Resume Subscription Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `resume_effective_date` | `String` | Optional | The `YYYY-MM-DD`-formatted date when the subscription reactivated. | -| `resume_change_timing` | [`String (Change Timing)`](../../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/doc/models/resume-subscription-response.md b/doc/models/resume-subscription-response.md deleted file mode 100644 index 8e8024e43..000000000 --- a/doc/models/resume-subscription-response.md +++ /dev/null @@ -1,84 +0,0 @@ - -# Resume Subscription Response - -Defines output parameters in a response from the -[ResumeSubscription](../../doc/api/subscriptions.md#resume-subscription) endpoint. - -## Structure - -`Resume Subscription Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered during the request. | -| `subscription` | [`Subscription Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-booking-custom-attribute-definition-request.md b/doc/models/retrieve-booking-custom-attribute-definition-request.md deleted file mode 100644 index f2004c652..000000000 --- a/doc/models/retrieve-booking-custom-attribute-definition-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Booking Custom Attribute Definition Request - -Represents a [RetrieveBookingCustomAttributeDefinition](../../doc/api/booking-custom-attributes.md#retrieve-booking-custom-attribute-definition) request. - -## Structure - -`Retrieve Booking Custom Attribute Definition Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `Integer` | 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/doc/models/retrieve-booking-custom-attribute-definition-response.md b/doc/models/retrieve-booking-custom-attribute-definition-response.md deleted file mode 100644 index ee8d20884..000000000 --- a/doc/models/retrieve-booking-custom-attribute-definition-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# 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 - -`Retrieve Booking Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-booking-custom-attribute-request.md b/doc/models/retrieve-booking-custom-attribute-request.md deleted file mode 100644 index 2ef13006b..000000000 --- a/doc/models/retrieve-booking-custom-attribute-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Booking Custom Attribute Request - -Represents a [RetrieveBookingCustomAttribute](../../doc/api/booking-custom-attributes.md#retrieve-booking-custom-attribute) request. - -## Structure - -`Retrieve Booking Custom Attribute Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `with_definition` | `TrueClass \| FalseClass` | 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` | `Integer` | 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/doc/models/retrieve-booking-custom-attribute-response.md b/doc/models/retrieve-booking-custom-attribute-response.md deleted file mode 100644 index 046759426..000000000 --- a/doc/models/retrieve-booking-custom-attribute-response.md +++ /dev/null @@ -1,63 +0,0 @@ - -# 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 - -`Retrieve Booking Custom Attribute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `errors` | [`Array`](../../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/doc/models/retrieve-booking-response.md b/doc/models/retrieve-booking-response.md deleted file mode 100644 index 1ce6f3ca5..000000000 --- a/doc/models/retrieve-booking-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Retrieve Booking Response - -## Structure - -`Retrieve Booking Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `booking` | [`Booking Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-business-booking-profile-response.md b/doc/models/retrieve-business-booking-profile-response.md deleted file mode 100644 index 96bcc5677..000000000 --- a/doc/models/retrieve-business-booking-profile-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Retrieve Business Booking Profile Response - -## Structure - -`Retrieve Business Booking Profile Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `business_booking_profile` | [`Business Booking Profile Hash`](../../doc/models/business-booking-profile.md) | Optional | A seller's business booking profile, including booking policy, appointment settings, etc. | -| `errors` | [`Array`](../../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/doc/models/retrieve-card-response.md b/doc/models/retrieve-card-response.md deleted file mode 100644 index 0706eccd7..000000000 --- a/doc/models/retrieve-card-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# 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 - -`Retrieve Card Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `card` | [`Card Hash`](../../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/doc/models/retrieve-cash-drawer-shift-request.md b/doc/models/retrieve-cash-drawer-shift-request.md deleted file mode 100644 index 443a85cff..000000000 --- a/doc/models/retrieve-cash-drawer-shift-request.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Retrieve Cash Drawer Shift Request - -## Structure - -`Retrieve Cash Drawer Shift Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_id` | `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/doc/models/retrieve-cash-drawer-shift-response.md b/doc/models/retrieve-cash-drawer-shift-response.md deleted file mode 100644 index af7f71b3c..000000000 --- a/doc/models/retrieve-cash-drawer-shift-response.md +++ /dev/null @@ -1,77 +0,0 @@ - -# Retrieve Cash Drawer Shift Response - -## Structure - -`Retrieve Cash Drawer Shift Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cash_drawer_shift` | [`Cash Drawer Shift Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-catalog-object-request.md b/doc/models/retrieve-catalog-object-request.md deleted file mode 100644 index 3976a597d..000000000 --- a/doc/models/retrieve-catalog-object-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Catalog Object Request - -## Structure - -`Retrieve Catalog Object Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `include_related_objects` | `TrueClass \| FalseClass` | 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` | -| `catalog_version` | `Integer` | 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. | -| `include_category_path_to_root` | `TrueClass \| FalseClass` | 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/doc/models/retrieve-catalog-object-response.md b/doc/models/retrieve-catalog-object-response.md deleted file mode 100644 index 65766e12d..000000000 --- a/doc/models/retrieve-catalog-object-response.md +++ /dev/null @@ -1,171 +0,0 @@ - -# Retrieve Catalog Object Response - -## Structure - -`Retrieve Catalog Object Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `object` | [`Catalog Object Hash`](../../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. | -| `related_objects` | [`Array`](../../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/doc/models/retrieve-customer-custom-attribute-definition-request.md b/doc/models/retrieve-customer-custom-attribute-definition-request.md deleted file mode 100644 index 962e099b0..000000000 --- a/doc/models/retrieve-customer-custom-attribute-definition-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Customer Custom Attribute Definition Request - -Represents a [RetrieveCustomerCustomAttributeDefinition](../../doc/api/customer-custom-attributes.md#retrieve-customer-custom-attribute-definition) request. - -## Structure - -`Retrieve Customer Custom Attribute Definition Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `Integer` | 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/doc/models/retrieve-customer-custom-attribute-definition-response.md b/doc/models/retrieve-customer-custom-attribute-definition-response.md deleted file mode 100644 index 7e4b302f9..000000000 --- a/doc/models/retrieve-customer-custom-attribute-definition-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# 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 - -`Retrieve Customer Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-customer-custom-attribute-request.md b/doc/models/retrieve-customer-custom-attribute-request.md deleted file mode 100644 index 18b78da7a..000000000 --- a/doc/models/retrieve-customer-custom-attribute-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Customer Custom Attribute Request - -Represents a [RetrieveCustomerCustomAttribute](../../doc/api/customer-custom-attributes.md#retrieve-customer-custom-attribute) request. - -## Structure - -`Retrieve Customer Custom Attribute Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `with_definition` | `TrueClass \| FalseClass` | 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` | `Integer` | 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/doc/models/retrieve-customer-custom-attribute-response.md b/doc/models/retrieve-customer-custom-attribute-response.md deleted file mode 100644 index 8e090fd5f..000000000 --- a/doc/models/retrieve-customer-custom-attribute-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# 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 - -`Retrieve Customer Custom Attribute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `errors` | [`Array`](../../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/doc/models/retrieve-customer-group-response.md b/doc/models/retrieve-customer-group-response.md deleted file mode 100644 index 52165efee..000000000 --- a/doc/models/retrieve-customer-group-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# 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 - -`Retrieve Customer Group Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `group` | [`Customer Group Hash`](../../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/doc/models/retrieve-customer-response.md b/doc/models/retrieve-customer-response.md deleted file mode 100644 index 3f3e728fe..000000000 --- a/doc/models/retrieve-customer-response.md +++ /dev/null @@ -1,85 +0,0 @@ - -# 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 - -`Retrieve Customer Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `customer` | [`Customer Hash`](../../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/doc/models/retrieve-customer-segment-response.md b/doc/models/retrieve-customer-segment-response.md deleted file mode 100644 index 05702220f..000000000 --- a/doc/models/retrieve-customer-segment-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# 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 - -`Retrieve Customer Segment Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `segment` | [`Customer Segment Hash`](../../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/doc/models/retrieve-dispute-evidence-response.md b/doc/models/retrieve-dispute-evidence-response.md deleted file mode 100644 index b19fd4a94..000000000 --- a/doc/models/retrieve-dispute-evidence-response.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Retrieve Dispute Evidence Response - -Defines the fields in a `RetrieveDisputeEvidence` response. - -## Structure - -`Retrieve Dispute Evidence Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `evidence` | [`Dispute Evidence Hash`](../../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/doc/models/retrieve-dispute-response.md b/doc/models/retrieve-dispute-response.md deleted file mode 100644 index 0b965bbe7..000000000 --- a/doc/models/retrieve-dispute-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Retrieve Dispute Response - -Defines fields in a `RetrieveDispute` response. - -## Structure - -`Retrieve Dispute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `dispute` | [`Dispute Hash`](../../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/doc/models/retrieve-employee-response.md b/doc/models/retrieve-employee-response.md deleted file mode 100644 index 4dea6671d..000000000 --- a/doc/models/retrieve-employee-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Retrieve Employee Response - -## Structure - -`Retrieve Employee Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `employee` | [`Employee Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-gift-card-from-gan-request.md b/doc/models/retrieve-gift-card-from-gan-request.md deleted file mode 100644 index 771577b4e..000000000 --- a/doc/models/retrieve-gift-card-from-gan-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Gift Card From GAN Request - -A request to retrieve gift cards by their GANs. - -## Structure - -`Retrieve Gift Card From GAN Request` - -## 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/doc/models/retrieve-gift-card-from-gan-response.md b/doc/models/retrieve-gift-card-from-gan-response.md deleted file mode 100644 index 3b4175ee4..000000000 --- a/doc/models/retrieve-gift-card-from-gan-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# 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 - -`Retrieve Gift Card From GAN Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `gift_card` | [`Gift Card Hash`](../../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/doc/models/retrieve-gift-card-from-nonce-request.md b/doc/models/retrieve-gift-card-from-nonce-request.md deleted file mode 100644 index 76a8ca0d4..000000000 --- a/doc/models/retrieve-gift-card-from-nonce-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Gift Card From Nonce Request - -A request to retrieve a gift card by using a payment token. - -## Structure - -`Retrieve Gift Card From Nonce Request` - -## 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/doc/models/retrieve-gift-card-from-nonce-response.md b/doc/models/retrieve-gift-card-from-nonce-response.md deleted file mode 100644 index bda52f80a..000000000 --- a/doc/models/retrieve-gift-card-from-nonce-response.md +++ /dev/null @@ -1,50 +0,0 @@ - -# 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 - -`Retrieve Gift Card From Nonce Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `gift_card` | [`Gift Card Hash`](../../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/doc/models/retrieve-gift-card-response.md b/doc/models/retrieve-gift-card-response.md deleted file mode 100644 index 030f28dd4..000000000 --- a/doc/models/retrieve-gift-card-response.md +++ /dev/null @@ -1,50 +0,0 @@ - -# 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 - -`Retrieve Gift Card Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `gift_card` | [`Gift Card Hash`](../../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/doc/models/retrieve-inventory-adjustment-response.md b/doc/models/retrieve-inventory-adjustment-response.md deleted file mode 100644 index a814099e3..000000000 --- a/doc/models/retrieve-inventory-adjustment-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Retrieve Inventory Adjustment Response - -## Structure - -`Retrieve Inventory Adjustment Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `adjustment` | [`Inventory Adjustment Hash`](../../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/doc/models/retrieve-inventory-changes-request.md b/doc/models/retrieve-inventory-changes-request.md deleted file mode 100644 index a5d3c8e4c..000000000 --- a/doc/models/retrieve-inventory-changes-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Inventory Changes Request - -## Structure - -`Retrieve Inventory Changes Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_ids` | `String` | Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | -| `cursor` | `String` | 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/doc/models/retrieve-inventory-changes-response.md b/doc/models/retrieve-inventory-changes-response.md deleted file mode 100644 index da54b1de5..000000000 --- a/doc/models/retrieve-inventory-changes-response.md +++ /dev/null @@ -1,79 +0,0 @@ - -# Retrieve Inventory Changes Response - -## Structure - -`Retrieve Inventory Changes Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `changes` | [`Array`](../../doc/models/inventory-change.md) | Optional | The set of inventory changes for the requested object and locations. | -| `cursor` | `String` | 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/doc/models/retrieve-inventory-count-request.md b/doc/models/retrieve-inventory-count-request.md deleted file mode 100644 index 462a28da6..000000000 --- a/doc/models/retrieve-inventory-count-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Inventory Count Request - -## Structure - -`Retrieve Inventory Count Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_ids` | `String` | Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | -| `cursor` | `String` | 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/doc/models/retrieve-inventory-count-response.md b/doc/models/retrieve-inventory-count-response.md deleted file mode 100644 index f961575fa..000000000 --- a/doc/models/retrieve-inventory-count-response.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Retrieve Inventory Count Response - -## Structure - -`Retrieve Inventory Count Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `counts` | [`Array`](../../doc/models/inventory-count.md) | Optional | The current calculated inventory counts for the requested object and
locations. | -| `cursor` | `String` | 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/doc/models/retrieve-inventory-physical-count-response.md b/doc/models/retrieve-inventory-physical-count-response.md deleted file mode 100644 index 87148c0a3..000000000 --- a/doc/models/retrieve-inventory-physical-count-response.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Retrieve Inventory Physical Count Response - -## Structure - -`Retrieve Inventory Physical Count Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `count` | [`Inventory Physical Count Hash`](../../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/doc/models/retrieve-inventory-transfer-response.md b/doc/models/retrieve-inventory-transfer-response.md deleted file mode 100644 index 23c5b7327..000000000 --- a/doc/models/retrieve-inventory-transfer-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Retrieve Inventory Transfer Response - -## Structure - -`Retrieve Inventory Transfer Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `transfer` | [`Inventory Transfer Hash`](../../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/doc/models/retrieve-job-response.md b/doc/models/retrieve-job-response.md deleted file mode 100644 index 5059e95b2..000000000 --- a/doc/models/retrieve-job-response.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Retrieve Job Response - -Represents a [RetrieveJob](../../doc/api/team.md#retrieve-job) response. Either `job` or `errors` -is present in the response. - -## Structure - -`Retrieve Job Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `job` | [`Job Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-location-booking-profile-response.md b/doc/models/retrieve-location-booking-profile-response.md deleted file mode 100644 index 1d9ce6173..000000000 --- a/doc/models/retrieve-location-booking-profile-response.md +++ /dev/null @@ -1,28 +0,0 @@ - -# Retrieve Location Booking Profile Response - -## Structure - -`Retrieve Location Booking Profile Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_booking_profile` | [`Location Booking Profile Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-location-custom-attribute-definition-request.md b/doc/models/retrieve-location-custom-attribute-definition-request.md deleted file mode 100644 index 677ec2445..000000000 --- a/doc/models/retrieve-location-custom-attribute-definition-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Location Custom Attribute Definition Request - -Represents a [RetrieveLocationCustomAttributeDefinition](../../doc/api/location-custom-attributes.md#retrieve-location-custom-attribute-definition) request. - -## Structure - -`Retrieve Location Custom Attribute Definition Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `Integer` | 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/doc/models/retrieve-location-custom-attribute-definition-response.md b/doc/models/retrieve-location-custom-attribute-definition-response.md deleted file mode 100644 index c99bf1a26..000000000 --- a/doc/models/retrieve-location-custom-attribute-definition-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# 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 - -`Retrieve Location Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-location-custom-attribute-request.md b/doc/models/retrieve-location-custom-attribute-request.md deleted file mode 100644 index 21fa56200..000000000 --- a/doc/models/retrieve-location-custom-attribute-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Location Custom Attribute Request - -Represents a [RetrieveLocationCustomAttribute](../../doc/api/location-custom-attributes.md#retrieve-location-custom-attribute) request. - -## Structure - -`Retrieve Location Custom Attribute Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `with_definition` | `TrueClass \| FalseClass` | 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` | `Integer` | 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/doc/models/retrieve-location-custom-attribute-response.md b/doc/models/retrieve-location-custom-attribute-response.md deleted file mode 100644 index 354ed169d..000000000 --- a/doc/models/retrieve-location-custom-attribute-response.md +++ /dev/null @@ -1,51 +0,0 @@ - -# 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 - -`Retrieve Location Custom Attribute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `errors` | [`Array`](../../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/doc/models/retrieve-location-response.md b/doc/models/retrieve-location-response.md deleted file mode 100644 index 5c6037381..000000000 --- a/doc/models/retrieve-location-response.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Retrieve Location Response - -Defines the fields that the [RetrieveLocation](../../doc/api/locations.md#retrieve-location) -endpoint returns in a response. - -## Structure - -`Retrieve Location Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `location` | [`Location Hash`](../../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/doc/models/retrieve-location-settings-response.md b/doc/models/retrieve-location-settings-response.md deleted file mode 100644 index d5838ed5e..000000000 --- a/doc/models/retrieve-location-settings-response.md +++ /dev/null @@ -1,93 +0,0 @@ - -# Retrieve Location Settings Response - -## Structure - -`Retrieve Location Settings Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `location_settings` | [`Checkout Location Settings Hash`](../../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/doc/models/retrieve-loyalty-account-response.md b/doc/models/retrieve-loyalty-account-response.md deleted file mode 100644 index 2d97d24fb..000000000 --- a/doc/models/retrieve-loyalty-account-response.md +++ /dev/null @@ -1,52 +0,0 @@ - -# Retrieve Loyalty Account Response - -A response that includes the loyalty account. - -## Structure - -`Retrieve Loyalty Account Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `loyalty_account` | [`Loyalty Account Hash`](../../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/doc/models/retrieve-loyalty-program-response.md b/doc/models/retrieve-loyalty-program-response.md deleted file mode 100644 index 243329fa3..000000000 --- a/doc/models/retrieve-loyalty-program-response.md +++ /dev/null @@ -1,96 +0,0 @@ - -# Retrieve Loyalty Program Response - -A response that contains the loyalty program. - -## Structure - -`Retrieve Loyalty Program Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `program` | [`Loyalty Program Hash`](../../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/doc/models/retrieve-loyalty-promotion-response.md b/doc/models/retrieve-loyalty-promotion-response.md deleted file mode 100644 index b8164e984..000000000 --- a/doc/models/retrieve-loyalty-promotion-response.md +++ /dev/null @@ -1,75 +0,0 @@ - -# Retrieve Loyalty Promotion Response - -Represents a [RetrieveLoyaltyPromotionPromotions](../../doc/api/loyalty.md#retrieve-loyalty-promotion) response. - -## Structure - -`Retrieve Loyalty Promotion Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `loyalty_promotion` | [`Loyalty Promotion Hash`](../../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/doc/models/retrieve-loyalty-reward-response.md b/doc/models/retrieve-loyalty-reward-response.md deleted file mode 100644 index 324e604f7..000000000 --- a/doc/models/retrieve-loyalty-reward-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Retrieve Loyalty Reward Response - -A response that includes the loyalty reward. - -## Structure - -`Retrieve Loyalty Reward Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `reward` | [`Loyalty Reward Hash`](../../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/doc/models/retrieve-merchant-custom-attribute-definition-request.md b/doc/models/retrieve-merchant-custom-attribute-definition-request.md deleted file mode 100644 index a35a09f3c..000000000 --- a/doc/models/retrieve-merchant-custom-attribute-definition-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Merchant Custom Attribute Definition Request - -Represents a [RetrieveMerchantCustomAttributeDefinition](../../doc/api/merchant-custom-attributes.md#retrieve-merchant-custom-attribute-definition) request. - -## Structure - -`Retrieve Merchant Custom Attribute Definition Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `Integer` | 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/doc/models/retrieve-merchant-custom-attribute-definition-response.md b/doc/models/retrieve-merchant-custom-attribute-definition-response.md deleted file mode 100644 index 5038cb178..000000000 --- a/doc/models/retrieve-merchant-custom-attribute-definition-response.md +++ /dev/null @@ -1,45 +0,0 @@ - -# 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 - -`Retrieve Merchant Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-merchant-custom-attribute-request.md b/doc/models/retrieve-merchant-custom-attribute-request.md deleted file mode 100644 index 8df027605..000000000 --- a/doc/models/retrieve-merchant-custom-attribute-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Merchant Custom Attribute Request - -Represents a [RetrieveMerchantCustomAttribute](../../doc/api/merchant-custom-attributes.md#retrieve-merchant-custom-attribute) request. - -## Structure - -`Retrieve Merchant Custom Attribute Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `with_definition` | `TrueClass \| FalseClass` | 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` | `Integer` | 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/doc/models/retrieve-merchant-custom-attribute-response.md b/doc/models/retrieve-merchant-custom-attribute-response.md deleted file mode 100644 index 96b40566d..000000000 --- a/doc/models/retrieve-merchant-custom-attribute-response.md +++ /dev/null @@ -1,57 +0,0 @@ - -# 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 - -`Retrieve Merchant Custom Attribute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `errors` | [`Array`](../../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/doc/models/retrieve-merchant-response.md b/doc/models/retrieve-merchant-response.md deleted file mode 100644 index 87631e99a..000000000 --- a/doc/models/retrieve-merchant-response.md +++ /dev/null @@ -1,47 +0,0 @@ - -# Retrieve Merchant Response - -The response object returned by the [RetrieveMerchant](../../doc/api/merchants.md#retrieve-merchant) endpoint. - -## Structure - -`Retrieve Merchant Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `merchant` | [`Merchant Hash`](../../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/doc/models/retrieve-merchant-settings-response.md b/doc/models/retrieve-merchant-settings-response.md deleted file mode 100644 index 539f49429..000000000 --- a/doc/models/retrieve-merchant-settings-response.md +++ /dev/null @@ -1,76 +0,0 @@ - -# Retrieve Merchant Settings Response - -## Structure - -`Retrieve Merchant Settings Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `merchant_settings` | [`Checkout Merchant Settings Hash`](../../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/doc/models/retrieve-order-custom-attribute-definition-request.md b/doc/models/retrieve-order-custom-attribute-definition-request.md deleted file mode 100644 index 8bf18d0cd..000000000 --- a/doc/models/retrieve-order-custom-attribute-definition-request.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Retrieve Order Custom Attribute Definition Request - -Represents a get request for an order custom attribute definition. - -## Structure - -`Retrieve Order Custom Attribute Definition Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `Integer` | 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/doc/models/retrieve-order-custom-attribute-definition-response.md b/doc/models/retrieve-order-custom-attribute-definition-response.md deleted file mode 100644 index 5bbfd9f1a..000000000 --- a/doc/models/retrieve-order-custom-attribute-definition-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Retrieve Order Custom Attribute Definition Response - -Represents a response from getting an order custom attribute definition. - -## Structure - -`Retrieve Order Custom Attribute Definition Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute_definition` | [`Custom Attribute Definition Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-order-custom-attribute-request.md b/doc/models/retrieve-order-custom-attribute-request.md deleted file mode 100644 index dbf474de3..000000000 --- a/doc/models/retrieve-order-custom-attribute-request.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Retrieve Order Custom Attribute Request - -Represents a get request for an order custom attribute. - -## Structure - -`Retrieve Order Custom Attribute Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `version` | `Integer` | 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. | -| `with_definition` | `TrueClass \| FalseClass` | 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/doc/models/retrieve-order-custom-attribute-response.md b/doc/models/retrieve-order-custom-attribute-response.md deleted file mode 100644 index a98feabdc..000000000 --- a/doc/models/retrieve-order-custom-attribute-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Retrieve Order Custom Attribute Response - -Represents a response from getting an order custom attribute. - -## Structure - -`Retrieve Order Custom Attribute Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `custom_attribute` | [`Custom Attribute Hash`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | -| `errors` | [`Array`](../../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/doc/models/retrieve-order-response.md b/doc/models/retrieve-order-response.md deleted file mode 100644 index 5de9ee837..000000000 --- a/doc/models/retrieve-order-response.md +++ /dev/null @@ -1,231 +0,0 @@ - -# Retrieve Order Response - -## Structure - -`Retrieve Order Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order` | [`Order Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-payment-link-response.md b/doc/models/retrieve-payment-link-response.md deleted file mode 100644 index c21d372a5..000000000 --- a/doc/models/retrieve-payment-link-response.md +++ /dev/null @@ -1,69 +0,0 @@ - -# Retrieve Payment Link Response - -## Structure - -`Retrieve Payment Link Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `payment_link` | [`Payment Link Hash`](../../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/doc/models/retrieve-snippet-response.md b/doc/models/retrieve-snippet-response.md deleted file mode 100644 index f2fdb5214..000000000 --- a/doc/models/retrieve-snippet-response.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Retrieve Snippet Response - -Represents a `RetrieveSnippet` response. The response can include either `snippet` or `errors`. - -## Structure - -`Retrieve Snippet Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `snippet` | [`Snippet Hash`](../../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/doc/models/retrieve-subscription-request.md b/doc/models/retrieve-subscription-request.md deleted file mode 100644 index 12cce4f2a..000000000 --- a/doc/models/retrieve-subscription-request.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Retrieve Subscription Request - -Defines input parameters in a request to the -[RetrieveSubscription](../../doc/api/subscriptions.md#retrieve-subscription) endpoint. - -## Structure - -`Retrieve Subscription Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `include` | `String` | 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/doc/models/retrieve-subscription-response.md b/doc/models/retrieve-subscription-response.md deleted file mode 100644 index cc045bbc2..000000000 --- a/doc/models/retrieve-subscription-response.md +++ /dev/null @@ -1,62 +0,0 @@ - -# Retrieve Subscription Response - -Defines output parameters in a response from the -[RetrieveSubscription](../../doc/api/subscriptions.md#retrieve-subscription) endpoint. - -## Structure - -`Retrieve Subscription Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered during the request. | -| `subscription` | [`Subscription Hash`](../../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/doc/models/retrieve-team-member-booking-profile-response.md b/doc/models/retrieve-team-member-booking-profile-response.md deleted file mode 100644 index be3c1f4cc..000000000 --- a/doc/models/retrieve-team-member-booking-profile-response.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Retrieve Team Member Booking Profile Response - -## Structure - -`Retrieve Team Member Booking Profile Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member_booking_profile` | [`Team Member Booking Profile Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-team-member-response.md b/doc/models/retrieve-team-member-response.md deleted file mode 100644 index 1c920e284..000000000 --- a/doc/models/retrieve-team-member-response.md +++ /dev/null @@ -1,82 +0,0 @@ - -# Retrieve Team Member Response - -Represents a response from a retrieve request containing a `TeamMember` object or error messages. - -## Structure - -`Retrieve Team Member Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_member` | [`Team Member Hash`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | -| `errors` | [`Array`](../../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/doc/models/retrieve-token-status-response.md b/doc/models/retrieve-token-status-response.md deleted file mode 100644 index 1835257b0..000000000 --- a/doc/models/retrieve-token-status-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Retrieve Token Status Response - -Defines the fields that are included in the response body of -a request to the `RetrieveTokenStatus` endpoint. - -## Structure - -`Retrieve Token Status Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `scopes` | `Array` | Optional | The list of scopes associated with an access token. | -| `expires_at` | `String` | Optional | The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never expires. | -| `client_id` | `String` | 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` | -| `merchant_id` | `String` | Optional | The ID of the authorizing merchant's business.
**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `191` | -| `errors` | [`Array`](../../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/doc/models/retrieve-transaction-response.md b/doc/models/retrieve-transaction-response.md deleted file mode 100644 index 4ed666f89..000000000 --- a/doc/models/retrieve-transaction-response.md +++ /dev/null @@ -1,190 +0,0 @@ - -# 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 - -`Retrieve Transaction Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `transaction` | [`Transaction Hash`](../../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/doc/models/retrieve-vendor-response.md b/doc/models/retrieve-vendor-response.md deleted file mode 100644 index c5d41b652..000000000 --- a/doc/models/retrieve-vendor-response.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Retrieve Vendor Response - -Represents an output from a call to [RetrieveVendor](../../doc/api/vendors.md#retrieve-vendor). - -## Structure - -`Retrieve Vendor Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | -| `vendor` | [`Vendor Hash`](../../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/doc/models/retrieve-wage-setting-response.md b/doc/models/retrieve-wage-setting-response.md deleted file mode 100644 index 0b048a34a..000000000 --- a/doc/models/retrieve-wage-setting-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Retrieve Wage Setting Response - -Represents a response from a retrieve request containing the specified `WageSetting` object or error messages. - -## Structure - -`Retrieve Wage Setting Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `wage_setting` | [`Wage Setting Hash`](../../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` | [`Array`](../../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/doc/models/retrieve-webhook-subscription-response.md b/doc/models/retrieve-webhook-subscription-response.md deleted file mode 100644 index d5d87daf9..000000000 --- a/doc/models/retrieve-webhook-subscription-response.md +++ /dev/null @@ -1,49 +0,0 @@ - -# 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 - -`Retrieve Webhook Subscription Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `subscription` | [`Webhook Subscription Hash`](../../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/doc/models/revoke-token-request.md b/doc/models/revoke-token-request.md deleted file mode 100644 index b490263cd..000000000 --- a/doc/models/revoke-token-request.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Revoke Token Request - -## Structure - -`Revoke Token Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `client_id` | `String` | 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` | -| `access_token` | `String` | 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` | -| `merchant_id` | `String` | 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. | -| `revoke_only_access_token` | `TrueClass \| FalseClass` | 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/doc/models/revoke-token-response.md b/doc/models/revoke-token-response.md deleted file mode 100644 index d622613c3..000000000 --- a/doc/models/revoke-token-response.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Revoke Token Response - -## Structure - -`Revoke Token Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `success` | `TrueClass \| FalseClass` | Optional | If the request is successful, this is `true`. | -| `errors` | [`Array`](../../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/doc/models/risk-evaluation-risk-level.md b/doc/models/risk-evaluation-risk-level.md deleted file mode 100644 index 805da3fde..000000000 --- a/doc/models/risk-evaluation-risk-level.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Risk Evaluation Risk Level - -## Enumeration - -`Risk Evaluation Risk Level` - -## 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/doc/models/risk-evaluation.md b/doc/models/risk-evaluation.md deleted file mode 100644 index f522a7322..000000000 --- a/doc/models/risk-evaluation.md +++ /dev/null @@ -1,30 +0,0 @@ - -# 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 - -`Risk Evaluation` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `created_at` | `String` | Optional | The timestamp when payment risk was evaluated, in RFC 3339 format. | -| `risk_level` | [`String (Risk Evaluation Risk Level)`](../../doc/models/risk-evaluation-risk-level.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "created_at": "created_at0", - "risk_level": "MODERATE" -} -``` - diff --git a/doc/models/save-card-options.md b/doc/models/save-card-options.md deleted file mode 100644 index a5d953be1..000000000 --- a/doc/models/save-card-options.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Save Card Options - -Describes save-card action fields. - -## Structure - -`Save Card Options` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_id` | `String` | Required | The square-assigned ID of the customer linked to the saved card. | -| `card_id` | `String` | Optional | The id of the created card-on-file.
**Constraints**: *Maximum Length*: `64` | -| `reference_id` | `String` | 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/doc/models/search-availability-filter.md b/doc/models/search-availability-filter.md deleted file mode 100644 index bf1db7a45..000000000 --- a/doc/models/search-availability-filter.md +++ /dev/null @@ -1,71 +0,0 @@ - -# Search Availability Filter - -A query filter to search for buyer-accessible availabilities by. - -## Structure - -`Search Availability Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `start_at_range` | [`Time Range Hash`](../../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. | -| `location_id` | `String` | 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` | -| `segment_filters` | [`Array`](../../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. | -| `booking_id` | `String` | 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/doc/models/search-availability-query.md b/doc/models/search-availability-query.md deleted file mode 100644 index 470a8c72e..000000000 --- a/doc/models/search-availability-query.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Search Availability Query - -The query used to search for buyer-accessible availabilities of bookings. - -## Structure - -`Search Availability Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filter` | [`Search Availability Filter Hash`](../../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/doc/models/search-availability-request.md b/doc/models/search-availability-request.md deleted file mode 100644 index 69b247f37..000000000 --- a/doc/models/search-availability-request.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Search Availability Request - -## Structure - -`Search Availability Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `query` | [`Search Availability Query Hash`](../../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/doc/models/search-availability-response.md b/doc/models/search-availability-response.md deleted file mode 100644 index cbd9a2333..000000000 --- a/doc/models/search-availability-response.md +++ /dev/null @@ -1,276 +0,0 @@ - -# Search Availability Response - -## Structure - -`Search Availability Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `availabilities` | [`Array`](../../doc/models/availability.md) | Optional | List of appointment slots available for booking. | -| `errors` | [`Array`](../../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/doc/models/search-catalog-items-request-stock-level.md b/doc/models/search-catalog-items-request-stock-level.md deleted file mode 100644 index a0217967c..000000000 --- a/doc/models/search-catalog-items-request-stock-level.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Search Catalog Items Request Stock Level - -Defines supported stock levels of the item inventory. - -## Enumeration - -`Search Catalog Items Request Stock Level` - -## Fields - -| Name | Description | -| --- | --- | -| `OUT` | The item inventory is empty. | -| `LOW` | The item inventory is low. | - diff --git a/doc/models/search-catalog-items-request.md b/doc/models/search-catalog-items-request.md deleted file mode 100644 index 4aad0c962..000000000 --- a/doc/models/search-catalog-items-request.md +++ /dev/null @@ -1,69 +0,0 @@ - -# Search Catalog Items Request - -Defines the request body for the [SearchCatalogItems](../../doc/api/catalog.md#search-catalog-items) endpoint. - -## Structure - -`Search Catalog Items Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `text_filter` | `String` | 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. | -| `category_ids` | `Array` | Optional | The category id query expression to return items containing the specified category IDs. | -| `stock_levels` | [`Array`](../../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 | -| `enabled_location_ids` | `Array` | Optional | The enabled-location query expression to return items and item variations having specified enabled locations. | -| `cursor` | `String` | Optional | The pagination token, returned in the previous response, used to fetch the next batch of pending results. | -| `limit` | `Integer` | Optional | The maximum number of results to return per page. The default value is 100.
**Constraints**: `<= 100` | -| `sort_order` | [`String (Sort Order)`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | -| `product_types` | [`Array`](../../doc/models/catalog-item-product-type.md) | Optional | The product types query expression to return items or item variations having the specified product types. | -| `custom_attribute_filters` | [`Array`](../../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. | -| `archived_state` | [`String (Archived State)`](../../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/doc/models/search-catalog-items-response.md b/doc/models/search-catalog-items-response.md deleted file mode 100644 index 00ccc42d5..000000000 --- a/doc/models/search-catalog-items-response.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Search Catalog Items Response - -Defines the response body returned from the [SearchCatalogItems](../../doc/api/catalog.md#search-catalog-items) endpoint. - -## Structure - -`Search Catalog Items Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `items` | [`Array`](../../doc/models/catalog-object.md) | Optional | Returned items matching the specified query expressions. | -| `cursor` | `String` | Optional | Pagination token used in the next request to return more of the search result. | -| `matched_variation_ids` | `Array` | 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/doc/models/search-catalog-objects-request.md b/doc/models/search-catalog-objects-request.md deleted file mode 100644 index b7b435933..000000000 --- a/doc/models/search-catalog-objects-request.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Search Catalog Objects Request - -## Structure - -`Search Catalog Objects Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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. | -| `object_types` | [`Array`](../../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. | -| `include_deleted_objects` | `TrueClass \| FalseClass` | Optional | If `true`, deleted objects will be included in the results. Deleted objects will have their
`is_deleted` field set to `true`. | -| `include_related_objects` | `TrueClass \| FalseClass` | 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` | -| `begin_time` | `String` | 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` | [`Catalog Query Hash`](../../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` | `Integer` | 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. | -| `include_category_path_to_root` | `TrueClass \| FalseClass` | 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/doc/models/search-catalog-objects-response.md b/doc/models/search-catalog-objects-response.md deleted file mode 100644 index fd48da58c..000000000 --- a/doc/models/search-catalog-objects-response.md +++ /dev/null @@ -1,231 +0,0 @@ - -# Search Catalog Objects Response - -## Structure - -`Search Catalog Objects Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `cursor` | `String` | 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` | [`Array`](../../doc/models/catalog-object.md) | Optional | The CatalogObjects returned. | -| `related_objects` | [`Array`](../../doc/models/catalog-object.md) | Optional | A list of CatalogObjects referenced by the objects in the `objects` field. | -| `latest_time` | `String` | 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/doc/models/search-customers-request.md b/doc/models/search-customers-request.md deleted file mode 100644 index c1768e107..000000000 --- a/doc/models/search-customers-request.md +++ /dev/null @@ -1,64 +0,0 @@ - -# Search Customers Request - -Defines the fields that are included in the request body of a request to the -`SearchCustomers` endpoint. - -## Structure - -`Search Customers Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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` | [`Customer Query Hash`](../../doc/models/customer-query.md) | Optional | Represents filtering and sorting criteria for a [SearchCustomers](../../doc/api/customers.md#search-customers) request. | -| `count` | `TrueClass \| FalseClass` | 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/doc/models/search-customers-response.md b/doc/models/search-customers-response.md deleted file mode 100644 index fc2fcd3c3..000000000 --- a/doc/models/search-customers-response.md +++ /dev/null @@ -1,131 +0,0 @@ - -# 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 - -`Search Customers Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `customers` | [`Array`](../../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` | 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` | `Integer` | 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/doc/models/search-events-filter.md b/doc/models/search-events-filter.md deleted file mode 100644 index 5af626c17..000000000 --- a/doc/models/search-events-filter.md +++ /dev/null @@ -1,43 +0,0 @@ - -# Search Events Filter - -Criteria to filter events by. - -## Structure - -`Search Events Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `event_types` | `Array` | Optional | Filter events by event types. | -| `merchant_ids` | `Array` | Optional | Filter events by merchant. | -| `location_ids` | `Array` | Optional | Filter events by location. | -| `created_at` | [`Time Range Hash`](../../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/doc/models/search-events-query.md b/doc/models/search-events-query.md deleted file mode 100644 index 4d5f7b2fb..000000000 --- a/doc/models/search-events-query.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Search Events Query - -Contains query criteria for the search. - -## Structure - -`Search Events Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filter` | [`Search Events Filter Hash`](../../doc/models/search-events-filter.md) | Optional | Criteria to filter events by. | -| `sort` | [`Search Events Sort Hash`](../../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/doc/models/search-events-request.md b/doc/models/search-events-request.md deleted file mode 100644 index 5f9cb1dc2..000000000 --- a/doc/models/search-events-request.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Search Events Request - -Searches [Event](../../doc/models/event.md)s for your application. - -## Structure - -`Search Events Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | 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` | [`Search Events Query Hash`](../../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/doc/models/search-events-response.md b/doc/models/search-events-response.md deleted file mode 100644 index c5be8e69b..000000000 --- a/doc/models/search-events-response.md +++ /dev/null @@ -1,85 +0,0 @@ - -# 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 - -`Search Events Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `events` | [`Array`](../../doc/models/event.md) | Optional | The list of [Event](entity:Event)s returned by the search. | -| `metadata` | [`Array`](../../doc/models/event-metadata.md) | Optional | Contains the metadata of an event. For more information, see [Event](entity:Event). | -| `cursor` | `String` | 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/doc/models/search-events-sort-field.md b/doc/models/search-events-sort-field.md deleted file mode 100644 index 01df18257..000000000 --- a/doc/models/search-events-sort-field.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Search Events Sort Field - -Specifies the sort key for events returned from a search. - -## Enumeration - -`Search Events Sort Field` - -## 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/doc/models/search-events-sort.md b/doc/models/search-events-sort.md deleted file mode 100644 index 40b437914..000000000 --- a/doc/models/search-events-sort.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Search Events Sort - -Criteria to sort events by. - -## Structure - -`Search Events Sort` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `field` | [`String (Search Events Sort Field)`](../../doc/models/search-events-sort-field.md) | Optional | Specifies the sort key for events returned from a search. | -| `order` | [`String (Sort Order)`](../../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/doc/models/search-invoices-request.md b/doc/models/search-invoices-request.md deleted file mode 100644 index dbb77f34e..000000000 --- a/doc/models/search-invoices-request.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Search Invoices Request - -Describes a `SearchInvoices` request. - -## Structure - -`Search Invoices Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `query` | [`Invoice Query Hash`](../../doc/models/invoice-query.md) | Required | Describes query criteria for searching invoices. | -| `limit` | `Integer` | 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` | 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/doc/models/search-invoices-response.md b/doc/models/search-invoices-response.md deleted file mode 100644 index 657f624d9..000000000 --- a/doc/models/search-invoices-response.md +++ /dev/null @@ -1,191 +0,0 @@ - -# Search Invoices Response - -Describes a `SearchInvoices` response. - -## Structure - -`Search Invoices Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoices` | [`Array`](../../doc/models/invoice.md) | Optional | The list of invoices returned by the search. | -| `cursor` | `String` | 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` | [`Array`](../../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/doc/models/search-loyalty-accounts-request-loyalty-account-query.md b/doc/models/search-loyalty-accounts-request-loyalty-account-query.md deleted file mode 100644 index 81bffffce..000000000 --- a/doc/models/search-loyalty-accounts-request-loyalty-account-query.md +++ /dev/null @@ -1,45 +0,0 @@ - -# Search Loyalty Accounts Request Loyalty Account Query - -The search criteria for the loyalty accounts. - -## Structure - -`Search Loyalty Accounts Request Loyalty Account Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `mappings` | [`Array`](../../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 | -| `customer_ids` | `Array` | 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/doc/models/search-loyalty-accounts-request.md b/doc/models/search-loyalty-accounts-request.md deleted file mode 100644 index 8a3801982..000000000 --- a/doc/models/search-loyalty-accounts-request.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Search Loyalty Accounts Request - -A request to search for loyalty accounts. - -## Structure - -`Search Loyalty Accounts Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `query` | [`Search Loyalty Accounts Request Loyalty Account Query Hash`](../../doc/models/search-loyalty-accounts-request-loyalty-account-query.md) | Optional | The search criteria for the loyalty accounts. | -| `limit` | `Integer` | Optional | The maximum number of results to include in the response. The default value is 30.
**Constraints**: `>= 1`, `<= 200` | -| `cursor` | `String` | 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/doc/models/search-loyalty-accounts-response.md b/doc/models/search-loyalty-accounts-response.md deleted file mode 100644 index e627d67c1..000000000 --- a/doc/models/search-loyalty-accounts-response.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Search Loyalty Accounts Response - -A response that includes loyalty accounts that satisfy the search criteria. - -## Structure - -`Search Loyalty Accounts Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `loyalty_accounts` | [`Array`](../../doc/models/loyalty-account.md) | Optional | The loyalty accounts that met the search criteria,
in order of creation date. | -| `cursor` | `String` | 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/doc/models/search-loyalty-events-request.md b/doc/models/search-loyalty-events-request.md deleted file mode 100644 index 0a09442b5..000000000 --- a/doc/models/search-loyalty-events-request.md +++ /dev/null @@ -1,56 +0,0 @@ - -# Search Loyalty Events Request - -A request to search for loyalty events. - -## Structure - -`Search Loyalty Events Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `query` | [`Loyalty Event Query Hash`](../../doc/models/loyalty-event-query.md) | Optional | Represents a query used to search for loyalty events. | -| `limit` | `Integer` | 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` | 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/doc/models/search-loyalty-events-response.md b/doc/models/search-loyalty-events-response.md deleted file mode 100644 index 8c6d248d3..000000000 --- a/doc/models/search-loyalty-events-response.md +++ /dev/null @@ -1,146 +0,0 @@ - -# Search Loyalty Events Response - -A response that contains loyalty events that satisfy the search -criteria, in order by the `created_at` date. - -## Structure - -`Search Loyalty Events Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `events` | [`Array`](../../doc/models/loyalty-event.md) | Optional | The loyalty events that satisfy the search criteria. | -| `cursor` | `String` | 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/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md b/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md deleted file mode 100644 index 69d6c7e4e..000000000 --- a/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Search Loyalty Rewards Request Loyalty Reward Query - -The set of search requirements. - -## Structure - -`Search Loyalty Rewards Request Loyalty Reward Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `loyalty_account_id` | `String` | Required | The ID of the [loyalty account](entity:LoyaltyAccount) to which the loyalty reward belongs.
**Constraints**: *Minimum Length*: `1` | -| `status` | [`String (Loyalty Reward Status)`](../../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/doc/models/search-loyalty-rewards-request.md b/doc/models/search-loyalty-rewards-request.md deleted file mode 100644 index fe1c5ce8b..000000000 --- a/doc/models/search-loyalty-rewards-request.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Search Loyalty Rewards Request - -A request to search for loyalty rewards. - -## Structure - -`Search Loyalty Rewards Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `query` | [`Search Loyalty Rewards Request Loyalty Reward Query Hash`](../../doc/models/search-loyalty-rewards-request-loyalty-reward-query.md) | Optional | The set of search requirements. | -| `limit` | `Integer` | Optional | The maximum number of results to return in the response. The default value is 30.
**Constraints**: `>= 1`, `<= 30` | -| `cursor` | `String` | 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/doc/models/search-loyalty-rewards-response.md b/doc/models/search-loyalty-rewards-response.md deleted file mode 100644 index a8c329528..000000000 --- a/doc/models/search-loyalty-rewards-response.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Search Loyalty Rewards Response - -A response that includes the loyalty rewards satisfying the search criteria. - -## Structure - -`Search Loyalty Rewards Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `rewards` | [`Array`](../../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` | 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/doc/models/search-orders-customer-filter.md b/doc/models/search-orders-customer-filter.md deleted file mode 100644 index 79467827c..000000000 --- a/doc/models/search-orders-customer-filter.md +++ /dev/null @@ -1,29 +0,0 @@ - -# 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 - -`Search Orders Customer Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_ids` | `Array` | 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/doc/models/search-orders-date-time-filter.md b/doc/models/search-orders-date-time-filter.md deleted file mode 100644 index e39b657b9..000000000 --- a/doc/models/search-orders-date-time-filter.md +++ /dev/null @@ -1,49 +0,0 @@ - -# 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 - -`Search Orders Date Time Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `created_at` | [`Time Range Hash`](../../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. | -| `updated_at` | [`Time Range Hash`](../../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. | -| `closed_at` | [`Time Range Hash`](../../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/doc/models/search-orders-filter.md b/doc/models/search-orders-filter.md deleted file mode 100644 index bfe5db86a..000000000 --- a/doc/models/search-orders-filter.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Search Orders Filter - -Filtering criteria to use for a `SearchOrders` request. Multiple filters -are ANDed together. - -## Structure - -`Search Orders Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `state_filter` | [`Search Orders State Filter Hash`](../../doc/models/search-orders-state-filter.md) | Optional | Filter by the current order `state`. | -| `date_time_filter` | [`Search Orders Date Time Filter Hash`](../../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) | -| `fulfillment_filter` | [`Search Orders Fulfillment Filter Hash`](../../doc/models/search-orders-fulfillment-filter.md) | Optional | Filter based on [order fulfillment](../../doc/models/fulfillment.md) information. | -| `source_filter` | [`Search Orders Source Filter Hash`](../../doc/models/search-orders-source-filter.md) | Optional | A filter based on order `source` information. | -| `customer_filter` | [`Search Orders Customer Filter Hash`](../../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/doc/models/search-orders-fulfillment-filter.md b/doc/models/search-orders-fulfillment-filter.md deleted file mode 100644 index 8263f3200..000000000 --- a/doc/models/search-orders-fulfillment-filter.md +++ /dev/null @@ -1,30 +0,0 @@ - -# Search Orders Fulfillment Filter - -Filter based on [order fulfillment](../../doc/models/fulfillment.md) information. - -## Structure - -`Search Orders Fulfillment Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `fulfillment_types` | [`Array`](../../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 | -| `fulfillment_states` | [`Array`](../../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/doc/models/search-orders-query.md b/doc/models/search-orders-query.md deleted file mode 100644 index 57ab63ba1..000000000 --- a/doc/models/search-orders-query.md +++ /dev/null @@ -1,69 +0,0 @@ - -# Search Orders Query - -Contains query criteria for the search. - -## Structure - -`Search Orders Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filter` | [`Search Orders Filter Hash`](../../doc/models/search-orders-filter.md) | Optional | Filtering criteria to use for a `SearchOrders` request. Multiple filters
are ANDed together. | -| `sort` | [`Search Orders Sort Hash`](../../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/doc/models/search-orders-request.md b/doc/models/search-orders-request.md deleted file mode 100644 index 84b038c10..000000000 --- a/doc/models/search-orders-request.md +++ /dev/null @@ -1,78 +0,0 @@ - -# Search Orders Request - -## Structure - -`Search Orders Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_ids` | `Array` | Optional | The location IDs for the orders to query. All locations must belong to
the same merchant.

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

Default: `500`
Max: `1000` | -| `return_entries` | `TrueClass \| FalseClass` | 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/doc/models/search-orders-response.md b/doc/models/search-orders-response.md deleted file mode 100644 index b62d5e6c9..000000000 --- a/doc/models/search-orders-response.md +++ /dev/null @@ -1,225 +0,0 @@ - -# 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 - -`Search Orders Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `order_entries` | [`Array`](../../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` | [`Array`](../../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` | 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` | [`Array`](../../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/doc/models/search-orders-sort-field.md b/doc/models/search-orders-sort-field.md deleted file mode 100644 index db40568e8..000000000 --- a/doc/models/search-orders-sort-field.md +++ /dev/null @@ -1,17 +0,0 @@ - -# Search Orders Sort Field - -Specifies which timestamp to use to sort `SearchOrder` results. - -## Enumeration - -`Search Orders Sort Field` - -## 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/doc/models/search-orders-sort.md b/doc/models/search-orders-sort.md deleted file mode 100644 index dfa13326d..000000000 --- a/doc/models/search-orders-sort.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Search Orders Sort - -Sorting criteria for a `SearchOrders` request. Results can only be sorted -by a timestamp field. - -## Structure - -`Search Orders Sort` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `sort_field` | [`String (Search Orders Sort Field)`](../../doc/models/search-orders-sort-field.md) | Required | Specifies which timestamp to use to sort `SearchOrder` results. | -| `sort_order` | [`String (Sort Order)`](../../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/doc/models/search-orders-source-filter.md b/doc/models/search-orders-source-filter.md deleted file mode 100644 index 70618638f..000000000 --- a/doc/models/search-orders-source-filter.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Search Orders Source Filter - -A filter based on order `source` information. - -## Structure - -`Search Orders Source Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `source_names` | `Array` | 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/doc/models/search-orders-state-filter.md b/doc/models/search-orders-state-filter.md deleted file mode 100644 index 78b76f094..000000000 --- a/doc/models/search-orders-state-filter.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Search Orders State Filter - -Filter by the current order `state`. - -## Structure - -`Search Orders State Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `states` | [`Array`](../../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/doc/models/search-shifts-request.md b/doc/models/search-shifts-request.md deleted file mode 100644 index 2a4cb25b9..000000000 --- a/doc/models/search-shifts-request.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Search Shifts Request - -A request for a filtered and sorted set of `Shift` objects. - -## Structure - -`Search Shifts Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `query` | [`Shift Query Hash`](../../doc/models/shift-query.md) | Optional | The parameters of a `Shift` search query, which includes filter and sort options. | -| `limit` | `Integer` | Optional | The number of resources in a page (200 by default).
**Constraints**: `>= 1`, `<= 200` | -| `cursor` | `String` | 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/doc/models/search-shifts-response.md b/doc/models/search-shifts-response.md deleted file mode 100644 index 8312b276a..000000000 --- a/doc/models/search-shifts-response.md +++ /dev/null @@ -1,120 +0,0 @@ - -# 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 - -`Search Shifts Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `shifts` | [`Array`](../../doc/models/shift.md) | Optional | Shifts. | -| `cursor` | `String` | Optional | An opaque cursor for fetching the next page. | -| `errors` | [`Array`](../../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/doc/models/search-subscriptions-filter.md b/doc/models/search-subscriptions-filter.md deleted file mode 100644 index e753b724b..000000000 --- a/doc/models/search-subscriptions-filter.md +++ /dev/null @@ -1,39 +0,0 @@ - -# 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 - -`Search Subscriptions Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `customer_ids` | `Array` | Optional | A filter to select subscriptions based on the subscribing customer IDs. | -| `location_ids` | `Array` | Optional | A filter to select subscriptions based on the location. | -| `source_names` | `Array` | 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/doc/models/search-subscriptions-query.md b/doc/models/search-subscriptions-query.md deleted file mode 100644 index c6c758758..000000000 --- a/doc/models/search-subscriptions-query.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Search Subscriptions Query - -Represents a query, consisting of specified query expressions, used to search for subscriptions. - -## Structure - -`Search Subscriptions Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filter` | [`Search Subscriptions Filter Hash`](../../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/doc/models/search-subscriptions-request.md b/doc/models/search-subscriptions-request.md deleted file mode 100644 index 104684432..000000000 --- a/doc/models/search-subscriptions-request.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Search Subscriptions Request - -Defines input parameters in a request to the -[SearchSubscriptions](../../doc/api/subscriptions.md#search-subscriptions) endpoint. - -## Structure - -`Search Subscriptions Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `cursor` | `String` | 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` | `Integer` | Optional | The upper limit on the number of subscriptions to return
in a paged response.
**Constraints**: `>= 1` | -| `query` | [`Search Subscriptions Query Hash`](../../doc/models/search-subscriptions-query.md) | Optional | Represents a query, consisting of specified query expressions, used to search for subscriptions. | -| `include` | `Array` | 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/doc/models/search-subscriptions-response.md b/doc/models/search-subscriptions-response.md deleted file mode 100644 index d876722ca..000000000 --- a/doc/models/search-subscriptions-response.md +++ /dev/null @@ -1,100 +0,0 @@ - -# Search Subscriptions Response - -Defines output parameters in a response from the -[SearchSubscriptions](../../doc/api/subscriptions.md#search-subscriptions) endpoint. - -## Structure - -`Search Subscriptions Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered during the request. | -| `subscriptions` | [`Array`](../../doc/models/subscription.md) | Optional | The subscriptions matching the specified query expressions. | -| `cursor` | `String` | 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/doc/models/search-team-members-filter.md b/doc/models/search-team-members-filter.md deleted file mode 100644 index edd8e7b69..000000000 --- a/doc/models/search-team-members-filter.md +++ /dev/null @@ -1,37 +0,0 @@ - -# 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 - -`Search Team Members Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `location_ids` | `Array` | Optional | When present, filters by team members assigned to the specified locations.
When empty, includes team members assigned to any location. | -| `status` | [`String (Team Member Status)`](../../doc/models/team-member-status.md) | Optional | Enumerates the possible statuses the team member can have within a business. | -| `is_owner` | `TrueClass \| FalseClass` | 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/doc/models/search-team-members-query.md b/doc/models/search-team-members-query.md deleted file mode 100644 index 50c72a7f7..000000000 --- a/doc/models/search-team-members-query.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Search Team Members Query - -Represents the parameters in a search for `TeamMember` objects. - -## Structure - -`Search Team Members Query` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filter` | [`Search Team Members Filter Hash`](../../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/doc/models/search-team-members-request.md b/doc/models/search-team-members-request.md deleted file mode 100644 index 7c433879e..000000000 --- a/doc/models/search-team-members-request.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Search Team Members Request - -Represents a search request for a filtered list of `TeamMember` objects. - -## Structure - -`Search Team Members Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `query` | [`Search Team Members Query Hash`](../../doc/models/search-team-members-query.md) | Optional | Represents the parameters in a search for `TeamMember` objects. | -| `limit` | `Integer` | Optional | The maximum number of `TeamMember` objects in a page (100 by default).
**Constraints**: `>= 1`, `<= 200` | -| `cursor` | `String` | 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/doc/models/search-team-members-response.md b/doc/models/search-team-members-response.md deleted file mode 100644 index f73b4feca..000000000 --- a/doc/models/search-team-members-response.md +++ /dev/null @@ -1,284 +0,0 @@ - -# Search Team Members Response - -Represents a response from a search request containing a filtered list of `TeamMember` objects. - -## Structure - -`Search Team Members Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `team_members` | [`Array`](../../doc/models/team-member.md) | Optional | The filtered list of `TeamMember` objects. | -| `cursor` | `String` | Optional | The opaque cursor for fetching the next page. For more information, see
[pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | -| `errors` | [`Array`](../../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/doc/models/search-terminal-actions-request.md b/doc/models/search-terminal-actions-request.md deleted file mode 100644 index d604daadb..000000000 --- a/doc/models/search-terminal-actions-request.md +++ /dev/null @@ -1,38 +0,0 @@ - -# Search Terminal Actions Request - -## Structure - -`Search Terminal Actions Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `query` | [`Terminal Action Query Hash`](../../doc/models/terminal-action-query.md) | Optional | - | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/search-terminal-actions-response.md b/doc/models/search-terminal-actions-response.md deleted file mode 100644 index 20e7514fb..000000000 --- a/doc/models/search-terminal-actions-response.md +++ /dev/null @@ -1,66 +0,0 @@ - -# Search Terminal Actions Response - -## Structure - -`Search Terminal Actions Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | -| `action` | [`Array`](../../doc/models/terminal-action.md) | Optional | The requested search result of `TerminalAction`s. | -| `cursor` | `String` | 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/doc/models/search-terminal-checkouts-request.md b/doc/models/search-terminal-checkouts-request.md deleted file mode 100644 index b6e17f792..000000000 --- a/doc/models/search-terminal-checkouts-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Search Terminal Checkouts Request - -## Structure - -`Search Terminal Checkouts Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `query` | [`Terminal Checkout Query Hash`](../../doc/models/terminal-checkout-query.md) | Optional | - | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/search-terminal-checkouts-response.md b/doc/models/search-terminal-checkouts-response.md deleted file mode 100644 index dccabc570..000000000 --- a/doc/models/search-terminal-checkouts-response.md +++ /dev/null @@ -1,123 +0,0 @@ - -# Search Terminal Checkouts Response - -## Structure - -`Search Terminal Checkouts Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `checkouts` | [`Array`](../../doc/models/terminal-checkout.md) | Optional | The requested search result of `TerminalCheckout` objects. | -| `cursor` | `String` | 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/doc/models/search-terminal-refunds-request.md b/doc/models/search-terminal-refunds-request.md deleted file mode 100644 index 99ede181d..000000000 --- a/doc/models/search-terminal-refunds-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Search Terminal Refunds Request - -## Structure - -`Search Terminal Refunds Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `query` | [`Terminal Refund Query Hash`](../../doc/models/terminal-refund-query.md) | Optional | - | -| `cursor` | `String` | 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` | `Integer` | 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/doc/models/search-terminal-refunds-response.md b/doc/models/search-terminal-refunds-response.md deleted file mode 100644 index e887bf9bb..000000000 --- a/doc/models/search-terminal-refunds-response.md +++ /dev/null @@ -1,72 +0,0 @@ - -# Search Terminal Refunds Response - -## Structure - -`Search Terminal Refunds Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | -| `refunds` | [`Array`](../../doc/models/terminal-refund.md) | Optional | The requested search result of `TerminalRefund` objects. | -| `cursor` | `String` | 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/doc/models/search-vendors-request-filter.md b/doc/models/search-vendors-request-filter.md deleted file mode 100644 index 4521c49fd..000000000 --- a/doc/models/search-vendors-request-filter.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Search Vendors Request Filter - -Defines supported query expressions to search for vendors by. - -## Structure - -`Search Vendors Request Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `Array` | Optional | The names of the [Vendor](entity:Vendor) objects to retrieve. | -| `status` | [`Array`](../../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/doc/models/search-vendors-request-sort-field.md b/doc/models/search-vendors-request-sort-field.md deleted file mode 100644 index a195bae84..000000000 --- a/doc/models/search-vendors-request-sort-field.md +++ /dev/null @@ -1,16 +0,0 @@ - -# Search Vendors Request Sort Field - -The field to sort the returned [Vendor](../../doc/models/vendor.md) objects by. - -## Enumeration - -`Search Vendors Request Sort Field` - -## 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/doc/models/search-vendors-request-sort.md b/doc/models/search-vendors-request-sort.md deleted file mode 100644 index 9352bd5bd..000000000 --- a/doc/models/search-vendors-request-sort.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Search Vendors Request Sort - -Defines a sorter used to sort results from [SearchVendors](../../doc/api/vendors.md#search-vendors). - -## Structure - -`Search Vendors Request Sort` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `field` | [`String (Search Vendors Request Sort Field)`](../../doc/models/search-vendors-request-sort-field.md) | Optional | The field to sort the returned [Vendor](../../doc/models/vendor.md) objects by. | -| `order` | [`String (Sort Order)`](../../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/doc/models/search-vendors-request.md b/doc/models/search-vendors-request.md deleted file mode 100644 index e6f6e30db..000000000 --- a/doc/models/search-vendors-request.md +++ /dev/null @@ -1,55 +0,0 @@ - -# Search Vendors Request - -Represents an input into a call to [SearchVendors](../../doc/api/vendors.md#search-vendors). - -## Structure - -`Search Vendors Request` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `filter` | [`Search Vendors Request Filter Hash`](../../doc/models/search-vendors-request-filter.md) | Optional | Defines supported query expressions to search for vendors by. | -| `sort` | [`Search Vendors Request Sort Hash`](../../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` | 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/doc/models/search-vendors-response.md b/doc/models/search-vendors-response.md deleted file mode 100644 index a118b4cfa..000000000 --- a/doc/models/search-vendors-response.md +++ /dev/null @@ -1,61 +0,0 @@ - -# Search Vendors Response - -Represents an output from a call to [SearchVendors](../../doc/api/vendors.md#search-vendors). - -## Structure - -`Search Vendors Response` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `errors` | [`Array`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | -| `vendors` | [`Array`](../../doc/models/vendor.md) | Optional | The [Vendor](entity:Vendor) objects matching the specified search filter. | -| `cursor` | `String` | 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/doc/models/segment-filter.md b/doc/models/segment-filter.md deleted file mode 100644 index 9cd6cb5b1..000000000 --- a/doc/models/segment-filter.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Segment Filter - -A query filter to search for buyer-accessible appointment segments by. - -## Structure - -`Segment Filter` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `service_variation_id` | `String` | Required | The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | -| `team_member_id_filter` | [`Filter Value Hash`](../../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/doc/models/select-option.md b/doc/models/select-option.md deleted file mode 100644 index ddc766068..000000000 --- a/doc/models/select-option.md +++ /dev/null @@ -1,23 +0,0 @@ - -# Select Option - -## Structure - -`Select Option` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `reference_id` | `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/doc/models/select-options.md b/doc/models/select-options.md deleted file mode 100644 index 0ca245356..000000000 --- a/doc/models/select-options.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Select Options - -## Structure - -`Select Options` - -## 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` | [`Array