From 9780c49cba5fcfc453b531183d016bd2c5d99a14 Mon Sep 17 00:00:00 2001 From: autobot Date: Tue, 20 Aug 2024 17:01:04 +0000 Subject: [PATCH] Generated PR for Release: 38.0.0.20240821 --- doc/api/apple-pay.md | 1 - doc/api/bank-accounts.md | 3 --- doc/api/booking-custom-attributes.md | 11 --------- doc/api/bookings.md | 13 ---------- doc/api/cards.md | 4 --- doc/api/cash-drawers.md | 3 --- doc/api/catalog.md | 22 +++-------------- doc/api/checkout.md | 10 -------- doc/api/customer-custom-attributes.md | 10 -------- doc/api/customer-groups.md | 5 ---- doc/api/customer-segments.md | 2 -- doc/api/customers.md | 14 ----------- doc/api/devices.md | 5 ---- doc/api/disputes.md | 9 ------- doc/api/employees.md | 2 -- doc/api/events.md | 4 --- doc/api/gift-card-activities.md | 5 +--- doc/api/gift-cards.md | 15 ++++-------- doc/api/inventory.md | 13 ---------- doc/api/invoices.md | 10 -------- doc/api/labor.md | 16 ------------ doc/api/location-custom-attributes.md | 11 --------- doc/api/locations.md | 4 --- doc/api/loyalty.md | 18 -------------- doc/api/merchant-custom-attributes.md | 11 --------- doc/api/merchants.md | 2 -- doc/api/mobile-authorization.md | 1 - doc/api/o-auth.md | 18 ++------------ doc/api/order-custom-attributes.md | 11 --------- doc/api/orders.md | 8 ------ doc/api/payments.md | 21 +++++++++------- doc/api/payouts.md | 3 --- doc/api/refunds.md | 3 --- doc/api/sites.md | 1 - doc/api/snippets.md | 3 --- doc/api/subscriptions.md | 12 --------- doc/api/team.md | 8 ------ doc/api/terminal.md | 15 ------------ doc/api/transactions.md | 4 --- doc/api/v1-transactions.md | 3 --- doc/api/vendors.md | 7 ------ doc/api/webhook-subscriptions.md | 8 ------ doc/client.md | 6 ++--- doc/models/create-payment-request.md | 1 + doc/models/gift-card-activity-activate.md | 2 +- doc/models/gift-card-activity-load.md | 2 +- doc/models/gift-card-activity-refund.md | 4 +-- doc/models/gift-card-activity-type.md | 2 +- doc/models/gift-card-status.md | 2 +- doc/models/list-payments-request.md | 3 +++ doc/models/offline-payment-details.md | 23 +++++++++++++++++ doc/models/payment.md | 1 + pyproject.toml | 2 +- square/api/base_api.py | 2 +- square/api/catalog_api.py | 22 ++++++++--------- square/api/gift_card_activities_api.py | 7 +++--- square/api/gift_cards_api.py | 11 ++++++--- square/api/o_auth_api.py | 11 +++------ square/api/payments_api.py | 30 ++++++++++++++++++++++- square/client.py | 6 ++--- square/configuration.py | 2 +- 61 files changed, 120 insertions(+), 368 deletions(-) create mode 100644 doc/models/offline-payment-details.md diff --git a/doc/api/apple-pay.md b/doc/api/apple-pay.md index 7f4074e6..b6242e02 100644 --- a/doc/api/apple-pay.md +++ b/doc/api/apple-pay.md @@ -49,7 +49,6 @@ body = { } result = apple_pay_api.register_domain(body) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/bank-accounts.md b/doc/api/bank-accounts.md index af8b7d1c..b6c98de9 100644 --- a/doc/api/bank-accounts.md +++ b/doc/api/bank-accounts.md @@ -42,7 +42,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = bank_accounts_api.list_bank_accounts() -print(result) if result.is_success(): print(result.body) @@ -76,7 +75,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan v1_bank_account_id = 'v1_bank_account_id8' result = bank_accounts_api.get_bank_account_by_v1_id(v1_bank_account_id) -print(result) if result.is_success(): print(result.body) @@ -111,7 +109,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan bank_account_id = 'bank_account_id0' result = bank_accounts_api.get_bank_account(bank_account_id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/booking-custom-attributes.md b/doc/api/booking-custom-attributes.md index 1fc919a9..632896f7 100644 --- a/doc/api/booking-custom-attributes.md +++ b/doc/api/booking-custom-attributes.md @@ -51,7 +51,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = booking_custom_attributes_api.list_booking_custom_attribute_definitions() -print(result) if result.is_success(): print(result.body) @@ -93,7 +92,6 @@ body = { } result = booking_custom_attributes_api.create_booking_custom_attribute_definition(body) -print(result) if result.is_success(): print(result.body) @@ -133,7 +131,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan key = 'key0' result = booking_custom_attributes_api.delete_booking_custom_attribute_definition(key) -print(result) if result.is_success(): print(result.body) @@ -172,7 +169,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan key = 'key0' result = booking_custom_attributes_api.retrieve_booking_custom_attribute_definition(key) -print(result) if result.is_success(): print(result.body) @@ -221,7 +217,6 @@ result = booking_custom_attributes_api.update_booking_custom_attribute_definitio key, body ) -print(result) if result.is_success(): print(result.body) @@ -272,7 +267,6 @@ body = { } result = booking_custom_attributes_api.bulk_delete_booking_custom_attributes(body) -print(result) if result.is_success(): print(result.body) @@ -323,7 +317,6 @@ body = { } result = booking_custom_attributes_api.bulk_upsert_booking_custom_attributes(body) -print(result) if result.is_success(): print(result.body) @@ -371,7 +364,6 @@ result = booking_custom_attributes_api.list_booking_custom_attributes( booking_id, with_definitions=with_definitions ) -print(result) if result.is_success(): print(result.body) @@ -418,7 +410,6 @@ result = booking_custom_attributes_api.delete_booking_custom_attribute( booking_id, key ) -print(result) if result.is_success(): print(result.body) @@ -469,7 +460,6 @@ result = booking_custom_attributes_api.retrieve_booking_custom_attribute( key, with_definition=with_definition ) -print(result) if result.is_success(): print(result.body) @@ -523,7 +513,6 @@ result = booking_custom_attributes_api.upsert_booking_custom_attribute( key, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/bookings.md b/doc/api/bookings.md index 4a3d8fec..c37fa03c 100644 --- a/doc/api/bookings.md +++ b/doc/api/bookings.md @@ -63,7 +63,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = bookings_api.list_bookings() -print(result) if result.is_success(): print(result.body) @@ -113,7 +112,6 @@ body = { } result = bookings_api.create_booking(body) -print(result) if result.is_success(): print(result.body) @@ -156,7 +154,6 @@ body = { } result = bookings_api.search_availability(body) -print(result) if result.is_success(): print(result.body) @@ -199,7 +196,6 @@ body = { } result = bookings_api.bulk_retrieve_bookings(body) -print(result) if result.is_success(): print(result.body) @@ -224,7 +220,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = bookings_api.retrieve_business_booking_profile() -print(result) if result.is_success(): print(result.body) @@ -258,7 +253,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = bookings_api.list_location_booking_profiles() -print(result) if result.is_success(): print(result.body) @@ -292,7 +286,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan location_id = 'location_id4' result = bookings_api.retrieve_location_booking_profile(location_id) -print(result) if result.is_success(): print(result.body) @@ -334,7 +327,6 @@ bookable_only = False result = bookings_api.list_team_member_booking_profiles( bookable_only=bookable_only ) -print(result) if result.is_success(): print(result.body) @@ -374,7 +366,6 @@ body = { } result = bookings_api.bulk_retrieve_team_member_booking_profiles(body) -print(result) if result.is_success(): print(result.body) @@ -408,7 +399,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan team_member_id = 'team_member_id0' result = bookings_api.retrieve_team_member_booking_profile(team_member_id) -print(result) if result.is_success(): print(result.body) @@ -445,7 +435,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan booking_id = 'booking_id4' result = bookings_api.retrieve_booking(booking_id) -print(result) if result.is_success(): print(result.body) @@ -494,7 +483,6 @@ result = bookings_api.update_booking( booking_id, body ) -print(result) if result.is_success(): print(result.body) @@ -541,7 +529,6 @@ result = bookings_api.cancel_booking( booking_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/cards.md b/doc/api/cards.md index 9f084bd1..76b5f880 100644 --- a/doc/api/cards.md +++ b/doc/api/cards.md @@ -52,7 +52,6 @@ include_disabled = False result = cards_api.list_cards( include_disabled=include_disabled ) -print(result) if result.is_success(): print(result.body) @@ -102,7 +101,6 @@ body = { } result = cards_api.create_card(body) -print(result) if result.is_success(): print(result.body) @@ -136,7 +134,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan card_id = 'card_id4' result = cards_api.retrieve_card(card_id) -print(result) if result.is_success(): print(result.body) @@ -171,7 +168,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan card_id = 'card_id4' result = cards_api.disable_card(card_id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/cash-drawers.md b/doc/api/cash-drawers.md index 09489e0c..3ac3d291 100644 --- a/doc/api/cash-drawers.md +++ b/doc/api/cash-drawers.md @@ -51,7 +51,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan location_id = 'location_id4' result = cash_drawers_api.list_cash_drawer_shifts(location_id) -print(result) if result.is_success(): print(result.body) @@ -93,7 +92,6 @@ result = cash_drawers_api.retrieve_cash_drawer_shift( location_id, shift_id ) -print(result) if result.is_success(): print(result.body) @@ -138,7 +136,6 @@ result = cash_drawers_api.list_cash_drawer_shift_events( location_id, shift_id ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/catalog.md b/doc/api/catalog.md index 94158add..ef472dfe 100644 --- a/doc/api/catalog.md +++ b/doc/api/catalog.md @@ -39,7 +39,7 @@ children. 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. +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. @@ -69,7 +69,6 @@ body = { } result = catalog_api.batch_delete_catalog_objects(body) -print(result) if result.is_success(): print(result.body) @@ -114,7 +113,6 @@ body = { } result = catalog_api.batch_retrieve_catalog_objects(body) -print(result) if result.is_success(): print(result.body) @@ -135,7 +133,7 @@ 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. +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. @@ -269,7 +267,6 @@ body = { } result = catalog_api.batch_upsert_catalog_objects(body) -print(result) if result.is_success(): print(result.body) @@ -322,7 +319,6 @@ request = { result = catalog_api.create_catalog_image( request=request ) -print(result) if result.is_success(): print(result.body) @@ -370,7 +366,6 @@ result = catalog_api.update_catalog_image( image_id, request=request ) -print(result) if result.is_success(): print(result.body) @@ -396,7 +391,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = catalog_api.catalog_info() -print(result) if result.is_success(): print(result.body) @@ -439,7 +433,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = catalog_api.list_catalog() -print(result) if result.is_success(): print(result.body) @@ -452,7 +445,7 @@ elif result.is_error(): 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. +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. @@ -512,7 +505,6 @@ body = { } result = catalog_api.upsert_catalog_object(body) -print(result) if result.is_success(): print(result.body) @@ -530,7 +522,7 @@ are also deleted. For example, deleting a [CatalogItem](../../doc/models/catalog 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. +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. @@ -555,7 +547,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan object_id = 'object_id8' result = catalog_api.delete_catalog_object(object_id) -print(result) if result.is_success(): print(result.body) @@ -609,7 +600,6 @@ result = catalog_api.retrieve_catalog_object( include_related_objects=include_related_objects, include_category_path_to_root=include_category_path_to_root ) -print(result) if result.is_success(): print(result.body) @@ -663,7 +653,6 @@ body = { } result = catalog_api.search_catalog_objects(body) -print(result) if result.is_success(): print(result.body) @@ -743,7 +732,6 @@ body = { } result = catalog_api.search_catalog_items(body) -print(result) if result.is_success(): print(result.body) @@ -791,7 +779,6 @@ body = { } result = catalog_api.update_item_modifier_lists(body) -print(result) if result.is_success(): print(result.body) @@ -838,7 +825,6 @@ body = { } result = catalog_api.update_item_taxes(body) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/checkout.md b/doc/api/checkout.md index 1fa84c96..813d3482 100644 --- a/doc/api/checkout.md +++ b/doc/api/checkout.md @@ -150,7 +150,6 @@ result = checkout_api.create_checkout( location_id, body ) -print(result) if result.is_success(): print(result.body) @@ -184,7 +183,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan location_id = 'location_id4' result = checkout_api.retrieve_location_settings(location_id) -print(result) if result.is_success(): print(result.body) @@ -227,7 +225,6 @@ result = checkout_api.update_location_settings( location_id, body ) -print(result) if result.is_success(): print(result.body) @@ -252,7 +249,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = checkout_api.retrieve_merchant_settings() -print(result) if result.is_success(): print(result.body) @@ -288,7 +284,6 @@ body = { } result = checkout_api.update_merchant_settings(body) -print(result) if result.is_success(): print(result.body) @@ -322,7 +317,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = checkout_api.list_payment_links() -print(result) if result.is_success(): print(result.body) @@ -366,7 +360,6 @@ body = { } result = checkout_api.create_payment_link(body) -print(result) if result.is_success(): print(result.body) @@ -400,7 +393,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = checkout_api.delete_payment_link(id) -print(result) if result.is_success(): print(result.body) @@ -434,7 +426,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = checkout_api.retrieve_payment_link(id) -print(result) if result.is_success(): print(result.body) @@ -484,7 +475,6 @@ result = checkout_api.update_payment_link( id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/customer-custom-attributes.md b/doc/api/customer-custom-attributes.md index cec22400..900985e5 100644 --- a/doc/api/customer-custom-attributes.md +++ b/doc/api/customer-custom-attributes.md @@ -52,7 +52,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = customer_custom_attributes_api.list_customer_custom_attribute_definitions() -print(result) if result.is_success(): print(result.body) @@ -103,7 +102,6 @@ body = { } result = customer_custom_attributes_api.create_customer_custom_attribute_definition(body) -print(result) if result.is_success(): print(result.body) @@ -142,7 +140,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan key = 'key0' result = customer_custom_attributes_api.delete_customer_custom_attribute_definition(key) -print(result) if result.is_success(): print(result.body) @@ -182,7 +179,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan key = 'key0' result = customer_custom_attributes_api.retrieve_customer_custom_attribute_definition(key) -print(result) if result.is_success(): print(result.body) @@ -234,7 +230,6 @@ result = customer_custom_attributes_api.update_customer_custom_attribute_definit key, body ) -print(result) if result.is_success(): print(result.body) @@ -292,7 +287,6 @@ body = { } result = customer_custom_attributes_api.bulk_upsert_customer_custom_attributes(body) -print(result) if result.is_success(): print(result.body) @@ -344,7 +338,6 @@ result = customer_custom_attributes_api.list_customer_custom_attributes( customer_id, with_definitions=with_definitions ) -print(result) if result.is_success(): print(result.body) @@ -389,7 +382,6 @@ result = customer_custom_attributes_api.delete_customer_custom_attribute( customer_id, key ) -print(result) if result.is_success(): print(result.body) @@ -444,7 +436,6 @@ result = customer_custom_attributes_api.retrieve_customer_custom_attribute( key, with_definition=with_definition ) -print(result) if result.is_success(): print(result.body) @@ -500,7 +491,6 @@ result = customer_custom_attributes_api.upsert_customer_custom_attribute( key, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/customer-groups.md b/doc/api/customer-groups.md index 627b6b83..50ac0072 100644 --- a/doc/api/customer-groups.md +++ b/doc/api/customer-groups.md @@ -42,7 +42,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = customer_groups_api.list_customer_groups() -print(result) if result.is_success(): print(result.body) @@ -82,7 +81,6 @@ body = { } result = customer_groups_api.create_customer_group(body) -print(result) if result.is_success(): print(result.body) @@ -116,7 +114,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan group_id = 'group_id0' result = customer_groups_api.delete_customer_group(group_id) -print(result) if result.is_success(): print(result.body) @@ -150,7 +147,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan group_id = 'group_id0' result = customer_groups_api.retrieve_customer_group(group_id) -print(result) if result.is_success(): print(result.body) @@ -195,7 +191,6 @@ result = customer_groups_api.update_customer_group( group_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/customer-segments.md b/doc/api/customer-segments.md index e9c98df3..7d7a0d88 100644 --- a/doc/api/customer-segments.md +++ b/doc/api/customer-segments.md @@ -39,7 +39,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = customer_segments_api.list_customer_segments() -print(result) if result.is_success(): print(result.body) @@ -73,7 +72,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan segment_id = 'segment_id4' result = customer_segments_api.retrieve_customer_segment(segment_id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/customers.md b/doc/api/customers.md index 6686a0cc..5388879d 100644 --- a/doc/api/customers.md +++ b/doc/api/customers.md @@ -65,7 +65,6 @@ count = False result = customers_api.list_customers( count=count ) -print(result) if result.is_success(): print(result.body) @@ -123,7 +122,6 @@ body = { } result = customers_api.create_customer(body) -print(result) if result.is_success(): print(result.body) @@ -202,7 +200,6 @@ body = { } result = customers_api.bulk_create_customers(body) -print(result) if result.is_success(): print(result.body) @@ -244,7 +241,6 @@ body = { } result = customers_api.bulk_delete_customers(body) -print(result) if result.is_success(): print(result.body) @@ -286,7 +282,6 @@ body = { } result = customers_api.bulk_retrieve_customers(body) -print(result) if result.is_success(): print(result.body) @@ -338,7 +333,6 @@ body = { } result = customers_api.bulk_update_customers(body) -print(result) if result.is_success(): print(result.body) @@ -408,7 +402,6 @@ body = { } result = customers_api.search_customers(body) -print(result) if result.is_success(): print(result.body) @@ -446,7 +439,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan customer_id = 'customer_id8' result = customers_api.delete_customer(customer_id) -print(result) if result.is_success(): print(result.body) @@ -480,7 +472,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan customer_id = 'customer_id8' result = customers_api.retrieve_customer(customer_id) -print(result) if result.is_success(): print(result.body) @@ -531,7 +522,6 @@ result = customers_api.update_customer( customer_id, body ) -print(result) if result.is_success(): print(result.body) @@ -589,7 +579,6 @@ result = customers_api.create_customer_card( customer_id, body ) -print(result) if result.is_success(): print(result.body) @@ -632,7 +621,6 @@ result = customers_api.delete_customer_card( customer_id, card_id ) -print(result) if result.is_success(): print(result.body) @@ -676,7 +664,6 @@ result = customers_api.remove_group_from_customer( customer_id, group_id ) -print(result) if result.is_success(): print(result.body) @@ -720,7 +707,6 @@ result = customers_api.add_group_to_customer( customer_id, group_id ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/devices.md b/doc/api/devices.md index 516f591e..e2fcadad 100644 --- a/doc/api/devices.md +++ b/doc/api/devices.md @@ -47,7 +47,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = devices_api.list_devices() -print(result) if result.is_success(): print(result.body) @@ -85,7 +84,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = devices_api.list_device_codes() -print(result) if result.is_success(): print(result.body) @@ -127,7 +125,6 @@ body = { } result = devices_api.create_device_code(body) -print(result) if result.is_success(): print(result.body) @@ -161,7 +158,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = devices_api.get_device_code(id) -print(result) if result.is_success(): print(result.body) @@ -195,7 +191,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan device_id = 'device_id6' result = devices_api.get_device(device_id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/disputes.md b/doc/api/disputes.md index 65365c69..81bc5b05 100644 --- a/doc/api/disputes.md +++ b/doc/api/disputes.md @@ -48,7 +48,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = disputes_api.list_disputes() -print(result) if result.is_success(): print(result.body) @@ -82,7 +81,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan dispute_id = 'dispute_id2' result = disputes_api.retrieve_dispute(dispute_id) -print(result) if result.is_success(): print(result.body) @@ -120,7 +118,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan dispute_id = 'dispute_id2' result = disputes_api.accept_dispute(dispute_id) -print(result) if result.is_success(): print(result.body) @@ -156,7 +153,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan dispute_id = 'dispute_id2' result = disputes_api.list_dispute_evidence(dispute_id) -print(result) if result.is_success(): print(result.body) @@ -195,7 +191,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan dispute_id = 'dispute_id2' result = disputes_api.create_dispute_evidence_file(dispute_id) -print(result) if result.is_success(): print(result.body) @@ -240,7 +235,6 @@ result = disputes_api.create_dispute_evidence_text( dispute_id, body ) -print(result) if result.is_success(): print(result.body) @@ -282,7 +276,6 @@ result = disputes_api.delete_dispute_evidence( dispute_id, evidence_id ) -print(result) if result.is_success(): print(result.body) @@ -325,7 +318,6 @@ result = disputes_api.retrieve_dispute_evidence( dispute_id, evidence_id ) -print(result) if result.is_success(): print(result.body) @@ -365,7 +357,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan dispute_id = 'dispute_id2' result = disputes_api.submit_evidence(dispute_id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/employees.md b/doc/api/employees.md index 12b24ab6..3f676728 100644 --- a/doc/api/employees.md +++ b/doc/api/employees.md @@ -43,7 +43,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = employees_api.list_employees() -print(result) if result.is_success(): print(result.body) @@ -77,7 +76,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = employees_api.retrieve_employee(id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/events.md b/doc/api/events.md index 50fbd1e3..9ccf2ad0 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -41,7 +41,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan body = {} result = events_api.search_events(body) -print(result) if result.is_success(): print(result.body) @@ -68,7 +67,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = events_api.disable_events() -print(result) if result.is_success(): print(result.body) @@ -93,7 +91,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = events_api.enable_events() -print(result) if result.is_success(): print(result.body) @@ -125,7 +122,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = events_api.list_event_types() -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/gift-card-activities.md b/doc/api/gift-card-activities.md index 6873c446..7a956e93 100644 --- a/doc/api/gift-card-activities.md +++ b/doc/api/gift-card-activities.md @@ -54,7 +54,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = gift_card_activities_api.list_gift_card_activities() -print(result) if result.is_success(): print(result.body) @@ -66,8 +65,7 @@ elif result.is_error(): # Create Gift Card Activity Creates a gift card activity to manage the balance or state of a [gift card](../../doc/models/gift-card.md). -For example, you create an `ACTIVATE` activity to activate a gift card with an initial balance -before the gift card can be used. +For example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use. ```python def create_gift_card_activity(self, @@ -101,7 +99,6 @@ body = { } result = gift_card_activities_api.create_gift_card_activity(body) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/gift-cards.md b/doc/api/gift-cards.md index 4bc9b0bf..12c290e4 100644 --- a/doc/api/gift-cards.md +++ b/doc/api/gift-cards.md @@ -51,7 +51,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = gift_cards_api.list_gift_cards() -print(result) if result.is_success(): print(result.body) @@ -62,9 +61,11 @@ elif result.is_error(): # Create Gift Card -Creates a digital gift card or registers a physical (plastic) gift card. After the gift card -is created, you must call [CreateGiftCardActivity](../../doc/api/gift-card-activities.md#create-gift-card-activity) -to activate the card with an initial balance before it can be used for payment. +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. ```python def create_gift_card(self, @@ -93,7 +94,6 @@ body = { } result = gift_cards_api.create_gift_card(body) -print(result) if result.is_success(): print(result.body) @@ -129,7 +129,6 @@ body = { } result = gift_cards_api.retrieve_gift_card_from_gan(body) -print(result) if result.is_success(): print(result.body) @@ -165,7 +164,6 @@ body = { } result = gift_cards_api.retrieve_gift_card_from_nonce(body) -print(result) if result.is_success(): print(result.body) @@ -208,7 +206,6 @@ result = gift_cards_api.link_customer_to_gift_card( gift_card_id, body ) -print(result) if result.is_success(): print(result.body) @@ -251,7 +248,6 @@ result = gift_cards_api.unlink_customer_from_gift_card( gift_card_id, body ) -print(result) if result.is_success(): print(result.body) @@ -285,7 +281,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = gift_cards_api.retrieve_gift_card(id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/inventory.md b/doc/api/inventory.md index a90b7c99..4dfcd725 100644 --- a/doc/api/inventory.md +++ b/doc/api/inventory.md @@ -53,7 +53,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan adjustment_id = 'adjustment_id0' result = inventory_api.deprecated_retrieve_inventory_adjustment(adjustment_id) -print(result) if result.is_success(): print(result.body) @@ -88,7 +87,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan adjustment_id = 'adjustment_id0' result = inventory_api.retrieve_inventory_adjustment(adjustment_id) -print(result) if result.is_success(): print(result.body) @@ -142,7 +140,6 @@ body = { } result = inventory_api.deprecated_batch_change_inventory(body) -print(result) if result.is_success(): print(result.body) @@ -194,7 +191,6 @@ body = { } result = inventory_api.deprecated_batch_retrieve_inventory_changes(body) -print(result) if result.is_success(): print(result.body) @@ -239,7 +235,6 @@ body = { } result = inventory_api.deprecated_batch_retrieve_inventory_counts(body) -print(result) if result.is_success(): print(result.body) @@ -294,7 +289,6 @@ body = { } result = inventory_api.batch_change_inventory(body) -print(result) if result.is_success(): print(result.body) @@ -350,7 +344,6 @@ body = { } result = inventory_api.batch_retrieve_inventory_changes(body) -print(result) if result.is_success(): print(result.body) @@ -402,7 +395,6 @@ body = { } result = inventory_api.batch_retrieve_inventory_counts(body) -print(result) if result.is_success(): print(result.body) @@ -439,7 +431,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan physical_count_id = 'physical_count_id2' result = inventory_api.deprecated_retrieve_inventory_physical_count(physical_count_id) -print(result) if result.is_success(): print(result.body) @@ -474,7 +465,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan physical_count_id = 'physical_count_id2' result = inventory_api.retrieve_inventory_physical_count(physical_count_id) -print(result) if result.is_success(): print(result.body) @@ -509,7 +499,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan transfer_id = 'transfer_id6' result = inventory_api.retrieve_inventory_transfer(transfer_id) -print(result) if result.is_success(): print(result.body) @@ -550,7 +539,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan catalog_object_id = 'catalog_object_id6' result = inventory_api.retrieve_inventory_count(catalog_object_id) -print(result) if result.is_success(): print(result.body) @@ -602,7 +590,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan catalog_object_id = 'catalog_object_id6' result = inventory_api.retrieve_inventory_changes(catalog_object_id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/invoices.md b/doc/api/invoices.md index e2967182..cd4b1027 100644 --- a/doc/api/invoices.md +++ b/doc/api/invoices.md @@ -53,7 +53,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan location_id = 'location_id4' result = invoices_api.list_invoices(location_id) -print(result) if result.is_success(): print(result.body) @@ -140,7 +139,6 @@ body = { } result = invoices_api.create_invoice(body) -print(result) if result.is_success(): print(result.body) @@ -195,7 +193,6 @@ body = { } result = invoices_api.search_invoices(body) -print(result) if result.is_success(): print(result.body) @@ -233,7 +230,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan invoice_id = 'invoice_id0' result = invoices_api.delete_invoice(invoice_id) -print(result) if result.is_success(): print(result.body) @@ -267,7 +263,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan invoice_id = 'invoice_id0' result = invoices_api.get_invoice(invoice_id) -print(result) if result.is_success(): print(result.body) @@ -327,7 +322,6 @@ result = invoices_api.update_invoice( invoice_id, body ) -print(result) if result.is_success(): print(result.body) @@ -378,7 +372,6 @@ result = invoices_api.create_invoice_attachment( invoice_id, request=request ) -print(result) if result.is_success(): print(result.body) @@ -420,7 +413,6 @@ result = invoices_api.delete_invoice_attachment( invoice_id, attachment_id ) -print(result) if result.is_success(): print(result.body) @@ -466,7 +458,6 @@ result = invoices_api.cancel_invoice( invoice_id, body ) -print(result) if result.is_success(): print(result.body) @@ -523,7 +514,6 @@ result = invoices_api.publish_invoice( invoice_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/labor.md b/doc/api/labor.md index 470609e3..0efd496a 100644 --- a/doc/api/labor.md +++ b/doc/api/labor.md @@ -55,7 +55,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = labor_api.list_break_types() -print(result) if result.is_success(): print(result.body) @@ -110,7 +109,6 @@ body = { } result = labor_api.create_break_type(body) -print(result) if result.is_success(): print(result.body) @@ -146,7 +144,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = labor_api.delete_break_type(id) -print(result) if result.is_success(): print(result.body) @@ -180,7 +177,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = labor_api.get_break_type(id) -print(result) if result.is_success(): print(result.body) @@ -229,7 +225,6 @@ result = labor_api.update_break_type( id, body ) -print(result) if result.is_success(): print(result.body) @@ -267,7 +262,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = labor_api.list_employee_wages() -print(result) if result.is_success(): print(result.body) @@ -303,7 +297,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = labor_api.get_employee_wage(id) -print(result) if result.is_success(): print(result.body) @@ -385,7 +378,6 @@ body = { } result = labor_api.create_shift(body) -print(result) if result.is_success(): print(result.body) @@ -448,7 +440,6 @@ body = { } result = labor_api.search_shifts(body) -print(result) if result.is_success(): print(result.body) @@ -482,7 +473,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = labor_api.delete_shift(id) -print(result) if result.is_success(): print(result.body) @@ -516,7 +506,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = labor_api.get_shift(id) -print(result) if result.is_success(): print(result.body) @@ -594,7 +583,6 @@ result = labor_api.update_shift( id, body ) -print(result) if result.is_success(): print(result.body) @@ -630,7 +618,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = labor_api.list_team_member_wages() -print(result) if result.is_success(): print(result.body) @@ -664,7 +651,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan id = 'id0' result = labor_api.get_team_member_wage(id) -print(result) if result.is_success(): print(result.body) @@ -698,7 +684,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = labor_api.list_workweek_configs() -print(result) if result.is_success(): print(result.body) @@ -745,7 +730,6 @@ result = labor_api.update_workweek_config( id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/location-custom-attributes.md b/doc/api/location-custom-attributes.md index 616c6f78..a08d0933 100644 --- a/doc/api/location-custom-attributes.md +++ b/doc/api/location-custom-attributes.md @@ -53,7 +53,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = location_custom_attributes_api.list_location_custom_attribute_definitions() -print(result) if result.is_success(): print(result.body) @@ -100,7 +99,6 @@ body = { } result = location_custom_attributes_api.create_location_custom_attribute_definition(body) -print(result) if result.is_success(): print(result.body) @@ -137,7 +135,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan key = 'key0' result = location_custom_attributes_api.delete_location_custom_attribute_definition(key) -print(result) if result.is_success(): print(result.body) @@ -175,7 +172,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan key = 'key0' result = location_custom_attributes_api.retrieve_location_custom_attribute_definition(key) -print(result) if result.is_success(): print(result.body) @@ -224,7 +220,6 @@ result = location_custom_attributes_api.update_location_custom_attribute_definit key, body ) -print(result) if result.is_success(): print(result.body) @@ -272,7 +267,6 @@ body = { } result = location_custom_attributes_api.bulk_delete_location_custom_attributes(body) -print(result) if result.is_success(): print(result.body) @@ -326,7 +320,6 @@ body = { } result = location_custom_attributes_api.bulk_upsert_location_custom_attributes(body) -print(result) if result.is_success(): print(result.body) @@ -378,7 +371,6 @@ result = location_custom_attributes_api.list_location_custom_attributes( location_id, with_definitions=with_definitions ) -print(result) if result.is_success(): print(result.body) @@ -421,7 +413,6 @@ result = location_custom_attributes_api.delete_location_custom_attribute( location_id, key ) -print(result) if result.is_success(): print(result.body) @@ -473,7 +464,6 @@ result = location_custom_attributes_api.retrieve_location_custom_attribute( key, with_definition=with_definition ) -print(result) if result.is_success(): print(result.body) @@ -526,7 +516,6 @@ result = location_custom_attributes_api.upsert_location_custom_attribute( key, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/locations.md b/doc/api/locations.md index 2b7a1e04..6fd65a4a 100644 --- a/doc/api/locations.md +++ b/doc/api/locations.md @@ -33,7 +33,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = locations_api.list_locations() -print(result) if result.is_success(): print(result.body) @@ -84,7 +83,6 @@ body = { } result = locations_api.create_location(body) -print(result) if result.is_success(): print(result.body) @@ -119,7 +117,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan location_id = 'location_id4' result = locations_api.retrieve_location(location_id) -print(result) if result.is_success(): print(result.body) @@ -183,7 +180,6 @@ result = locations_api.update_location( location_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/loyalty.md b/doc/api/loyalty.md index 6c123c9a..21d0a471 100644 --- a/doc/api/loyalty.md +++ b/doc/api/loyalty.md @@ -63,7 +63,6 @@ body = { } result = loyalty_api.create_loyalty_account(body) -print(result) if result.is_success(): print(result.body) @@ -110,7 +109,6 @@ body = { } result = loyalty_api.search_loyalty_accounts(body) -print(result) if result.is_success(): print(result.body) @@ -144,7 +142,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan account_id = 'account_id2' result = loyalty_api.retrieve_loyalty_account(account_id) -print(result) if result.is_success(): print(result.body) @@ -204,7 +201,6 @@ result = loyalty_api.accumulate_loyalty_points( account_id, body ) -print(result) if result.is_success(): print(result.body) @@ -255,7 +251,6 @@ result = loyalty_api.adjust_loyalty_points( account_id, body ) -print(result) if result.is_success(): print(result.body) @@ -305,7 +300,6 @@ body = { } result = loyalty_api.search_loyalty_events(body) -print(result) if result.is_success(): print(result.body) @@ -335,7 +329,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = loyalty_api.list_loyalty_programs() -print(result) if result.is_success(): print(result.body) @@ -371,7 +364,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan program_id = 'program_id0' result = loyalty_api.retrieve_loyalty_program(program_id) -print(result) if result.is_success(): print(result.body) @@ -429,7 +421,6 @@ result = loyalty_api.calculate_loyalty_points( program_id, body ) -print(result) if result.is_success(): print(result.body) @@ -470,7 +461,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan program_id = 'program_id0' result = loyalty_api.list_loyalty_promotions(program_id) -print(result) if result.is_success(): print(result.body) @@ -543,7 +533,6 @@ result = loyalty_api.create_loyalty_promotion( program_id, body ) -print(result) if result.is_success(): print(result.body) @@ -584,7 +573,6 @@ result = loyalty_api.retrieve_loyalty_promotion( promotion_id, program_id ) -print(result) if result.is_success(): print(result.body) @@ -630,7 +618,6 @@ result = loyalty_api.cancel_loyalty_promotion( promotion_id, program_id ) -print(result) if result.is_success(): print(result.body) @@ -678,7 +665,6 @@ body = { } result = loyalty_api.create_loyalty_reward(body) -print(result) if result.is_success(): print(result.body) @@ -723,7 +709,6 @@ body = { } result = loyalty_api.search_loyalty_rewards(body) -print(result) if result.is_success(): print(result.body) @@ -765,7 +750,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan reward_id = 'reward_id4' result = loyalty_api.delete_loyalty_reward(reward_id) -print(result) if result.is_success(): print(result.body) @@ -799,7 +783,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan reward_id = 'reward_id4' result = loyalty_api.retrieve_loyalty_reward(reward_id) -print(result) if result.is_success(): print(result.body) @@ -853,7 +836,6 @@ result = loyalty_api.redeem_loyalty_reward( reward_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/merchant-custom-attributes.md b/doc/api/merchant-custom-attributes.md index 7c363111..ef617f57 100644 --- a/doc/api/merchant-custom-attributes.md +++ b/doc/api/merchant-custom-attributes.md @@ -53,7 +53,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = merchant_custom_attributes_api.list_merchant_custom_attribute_definitions() -print(result) if result.is_success(): print(result.body) @@ -100,7 +99,6 @@ body = { } result = merchant_custom_attributes_api.create_merchant_custom_attribute_definition(body) -print(result) if result.is_success(): print(result.body) @@ -137,7 +135,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan key = 'key0' result = merchant_custom_attributes_api.delete_merchant_custom_attribute_definition(key) -print(result) if result.is_success(): print(result.body) @@ -175,7 +172,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan key = 'key0' result = merchant_custom_attributes_api.retrieve_merchant_custom_attribute_definition(key) -print(result) if result.is_success(): print(result.body) @@ -224,7 +220,6 @@ result = merchant_custom_attributes_api.update_merchant_custom_attribute_definit key, body ) -print(result) if result.is_success(): print(result.body) @@ -269,7 +264,6 @@ body = { } result = merchant_custom_attributes_api.bulk_delete_merchant_custom_attributes(body) -print(result) if result.is_success(): print(result.body) @@ -323,7 +317,6 @@ body = { } result = merchant_custom_attributes_api.bulk_upsert_merchant_custom_attributes(body) -print(result) if result.is_success(): print(result.body) @@ -375,7 +368,6 @@ result = merchant_custom_attributes_api.list_merchant_custom_attributes( merchant_id, with_definitions=with_definitions ) -print(result) if result.is_success(): print(result.body) @@ -418,7 +410,6 @@ result = merchant_custom_attributes_api.delete_merchant_custom_attribute( merchant_id, key ) -print(result) if result.is_success(): print(result.body) @@ -470,7 +461,6 @@ result = merchant_custom_attributes_api.retrieve_merchant_custom_attribute( key, with_definition=with_definition ) -print(result) if result.is_success(): print(result.body) @@ -523,7 +513,6 @@ result = merchant_custom_attributes_api.upsert_merchant_custom_attribute( key, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/merchants.md b/doc/api/merchants.md index f01770e4..578dd070 100644 --- a/doc/api/merchants.md +++ b/doc/api/merchants.md @@ -46,7 +46,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = merchants_api.list_merchants() -print(result) if result.is_success(): print(result.body) @@ -80,7 +79,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan merchant_id = 'merchant_id0' result = merchants_api.retrieve_merchant(merchant_id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/mobile-authorization.md b/doc/api/mobile-authorization.md index 30a33438..e7ce1091 100644 --- a/doc/api/mobile-authorization.md +++ b/doc/api/mobile-authorization.md @@ -47,7 +47,6 @@ body = { } result = mobile_authorization_api.create_mobile_authorization_code(body) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/o-auth.md b/doc/api/o-auth.md index 691a05f7..8bd9f73b 100644 --- a/doc/api/o-auth.md +++ b/doc/api/o-auth.md @@ -65,7 +65,6 @@ result = o_auth_api.revoke_token( body, authorization ) -print(result) if result.is_success(): print(result.body) @@ -122,7 +121,6 @@ body = { } result = o_auth_api.obtain_token(body) -print(result) if result.is_success(): print(result.body) @@ -148,19 +146,10 @@ where `ACCESS_TOKEN` is a If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error. -:information_source: **Note** This endpoint does not require authentication. - ```python -def retrieve_token_status(self, - authorization) +def retrieve_token_status(self) ``` -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `authorization` | `str` | Header, Required | Client APPLICATION_SECRET | - ## Response Type This method returns a `ApiResponse` instance. The `body` property of this instance returns the response data which is of type [`Retrieve Token Status Response`](../../doc/models/retrieve-token-status-response.md). @@ -168,10 +157,7 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ## Example Usage ```python -authorization = 'Client CLIENT_SECRET' - -result = o_auth_api.retrieve_token_status(authorization) -print(result) +result = o_auth_api.retrieve_token_status() if result.is_success(): print(result.body) diff --git a/doc/api/order-custom-attributes.md b/doc/api/order-custom-attributes.md index 966abc5a..4257fe8f 100644 --- a/doc/api/order-custom-attributes.md +++ b/doc/api/order-custom-attributes.md @@ -55,7 +55,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = order_custom_attributes_api.list_order_custom_attribute_definitions() -print(result) if result.is_success(): print(result.body) @@ -101,7 +100,6 @@ body = { } result = order_custom_attributes_api.create_order_custom_attribute_definition(body) -print(result) if result.is_success(): print(result.body) @@ -137,7 +135,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan key = 'key0' result = order_custom_attributes_api.delete_order_custom_attribute_definition(key) -print(result) if result.is_success(): print(result.body) @@ -177,7 +174,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan key = 'key0' result = order_custom_attributes_api.retrieve_order_custom_attribute_definition(key) -print(result) if result.is_success(): print(result.body) @@ -227,7 +223,6 @@ result = order_custom_attributes_api.update_order_custom_attribute_definition( key, body ) -print(result) if result.is_success(): print(result.body) @@ -285,7 +280,6 @@ body = { } result = order_custom_attributes_api.bulk_delete_order_custom_attributes(body) -print(result) if result.is_success(): print(result.body) @@ -343,7 +337,6 @@ body = { } result = order_custom_attributes_api.bulk_upsert_order_custom_attributes(body) -print(result) if result.is_success(): print(result.body) @@ -397,7 +390,6 @@ result = order_custom_attributes_api.list_order_custom_attributes( order_id, with_definitions=with_definitions ) -print(result) if result.is_success(): print(result.body) @@ -442,7 +434,6 @@ result = order_custom_attributes_api.delete_order_custom_attribute( order_id, custom_attribute_key ) -print(result) if result.is_success(): print(result.body) @@ -497,7 +488,6 @@ result = order_custom_attributes_api.retrieve_order_custom_attribute( custom_attribute_key, with_definition=with_definition ) -print(result) if result.is_success(): print(result.body) @@ -553,7 +543,6 @@ result = order_custom_attributes_api.upsert_order_custom_attribute( custom_attribute_key, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/orders.md b/doc/api/orders.md index b9c43f5c..b146ff2c 100644 --- a/doc/api/orders.md +++ b/doc/api/orders.md @@ -111,7 +111,6 @@ body = { } result = orders_api.create_order(body) -print(result) if result.is_success(): print(result.body) @@ -153,7 +152,6 @@ body = { } result = orders_api.batch_retrieve_orders(body) -print(result) if result.is_success(): print(result.body) @@ -216,7 +214,6 @@ body = { } result = orders_api.calculate_order(body) -print(result) if result.is_success(): print(result.body) @@ -255,7 +252,6 @@ body = { } result = orders_api.clone_order(body) -print(result) if result.is_success(): print(result.body) @@ -331,7 +327,6 @@ body = { } result = orders_api.search_orders(body) -print(result) if result.is_success(): print(result.body) @@ -365,7 +360,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan order_id = 'order_id6' result = orders_api.retrieve_order(order_id) -print(result) if result.is_success(): print(result.body) @@ -420,7 +414,6 @@ result = orders_api.update_order( order_id, body ) -print(result) if result.is_success(): print(result.body) @@ -480,7 +473,6 @@ result = orders_api.pay_order( order_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/payments.md b/doc/api/payments.md index 79489fd7..7ea6b4c5 100644 --- a/doc/api/payments.md +++ b/doc/api/payments.md @@ -38,7 +38,10 @@ def list_payments(self, total=None, last_4=None, card_brand=None, - limit=None) + limit=None, + is_offline_payment=False, + offline_begin_time=None, + offline_end_time=None) ``` ## Parameters @@ -54,6 +57,9 @@ def list_payments(self, | `last_4` | `str` | Query, Optional | The last four digits of a payment card. | | `card_brand` | `str` | Query, Optional | The brand of the payment card (for example, VISA). | | `limit` | `int` | 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` | `bool` | Query, Optional | Whether the payment was taken offline or not. | +| `offline_begin_time` | `str` | 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` | `str` | 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. | ## Response Type @@ -62,8 +68,11 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ## Example Usage ```python -result = payments_api.list_payments() -print(result) +is_offline_payment = False + +result = payments_api.list_payments( + is_offline_payment=is_offline_payment +) if result.is_success(): print(result.body) @@ -120,7 +129,6 @@ body = { } result = payments_api.create_payment(body) -print(result) if result.is_success(): print(result.body) @@ -166,7 +174,6 @@ body = { } result = payments_api.cancel_payment_by_idempotency_key(body) -print(result) if result.is_success(): print(result.body) @@ -200,7 +207,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan payment_id = 'payment_id0' result = payments_api.get_payment(payment_id) -print(result) if result.is_success(): print(result.body) @@ -255,7 +261,6 @@ result = payments_api.update_payment( payment_id, body ) -print(result) if result.is_success(): print(result.body) @@ -290,7 +295,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan payment_id = 'payment_id0' result = payments_api.cancel_payment(payment_id) -print(result) if result.is_success(): print(result.body) @@ -334,7 +338,6 @@ result = payments_api.complete_payment( payment_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/payouts.md b/doc/api/payouts.md index 3b392c14..a330d0c2 100644 --- a/doc/api/payouts.md +++ b/doc/api/payouts.md @@ -52,7 +52,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = payouts_api.list_payouts() -print(result) if result.is_success(): print(result.body) @@ -87,7 +86,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan payout_id = 'payout_id6' result = payouts_api.get_payout(payout_id) -print(result) if result.is_success(): print(result.body) @@ -128,7 +126,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan payout_id = 'payout_id6' result = payouts_api.list_payout_entries(payout_id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/refunds.md b/doc/api/refunds.md index 88fa1cdd..0221b385 100644 --- a/doc/api/refunds.md +++ b/doc/api/refunds.md @@ -57,7 +57,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = refunds_api.list_payment_refunds() -print(result) if result.is_success(): print(result.body) @@ -106,7 +105,6 @@ body = { } result = refunds_api.refund_payment(body) -print(result) if result.is_success(): print(result.body) @@ -140,7 +138,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan refund_id = 'refund_id4' result = refunds_api.get_payment_refund(refund_id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/sites.md b/doc/api/sites.md index 9c3d2f90..1f9631d1 100644 --- a/doc/api/sites.md +++ b/doc/api/sites.md @@ -27,7 +27,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = sites_api.list_sites() -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/snippets.md b/doc/api/snippets.md index 48ee7d9b..d4e39bf6 100644 --- a/doc/api/snippets.md +++ b/doc/api/snippets.md @@ -44,7 +44,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan site_id = 'site_id6' result = snippets_api.delete_snippet(site_id) -print(result) if result.is_success(): print(result.body) @@ -82,7 +81,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan site_id = 'site_id6' result = snippets_api.retrieve_snippet(site_id) -print(result) if result.is_success(): print(result.body) @@ -132,7 +130,6 @@ result = snippets_api.upsert_snippet( site_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/subscriptions.md b/doc/api/subscriptions.md index ef513d36..6b08f029 100644 --- a/doc/api/subscriptions.md +++ b/doc/api/subscriptions.md @@ -73,7 +73,6 @@ body = { } result = subscriptions_api.create_subscription(body) -print(result) if result.is_success(): print(result.body) @@ -112,7 +111,6 @@ body = { } result = subscriptions_api.bulk_swap_plan(body) -print(result) if result.is_success(): print(result.body) @@ -173,7 +171,6 @@ body = { } result = subscriptions_api.search_subscriptions(body) -print(result) if result.is_success(): print(result.body) @@ -209,7 +206,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan subscription_id = 'subscription_id0' result = subscriptions_api.retrieve_subscription(subscription_id) -print(result) if result.is_success(): print(result.body) @@ -256,7 +252,6 @@ result = subscriptions_api.update_subscription( subscription_id, body ) -print(result) if result.is_success(): print(result.body) @@ -297,7 +292,6 @@ result = subscriptions_api.delete_subscription_action( subscription_id, action_id ) -print(result) if result.is_success(): print(result.body) @@ -341,7 +335,6 @@ result = subscriptions_api.change_billing_anchor_date( subscription_id, body ) -print(result) if result.is_success(): print(result.body) @@ -377,7 +370,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan subscription_id = 'subscription_id0' result = subscriptions_api.cancel_subscription(subscription_id) -print(result) if result.is_success(): print(result.body) @@ -415,7 +407,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan subscription_id = 'subscription_id0' result = subscriptions_api.list_subscription_events(subscription_id) -print(result) if result.is_success(): print(result.body) @@ -456,7 +447,6 @@ result = subscriptions_api.pause_subscription( subscription_id, body ) -print(result) if result.is_success(): print(result.body) @@ -497,7 +487,6 @@ result = subscriptions_api.resume_subscription( subscription_id, body ) -print(result) if result.is_success(): print(result.body) @@ -547,7 +536,6 @@ result = subscriptions_api.swap_plan( subscription_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/team.md b/doc/api/team.md index 19dd729c..af055f83 100644 --- a/doc/api/team.md +++ b/doc/api/team.md @@ -68,7 +68,6 @@ body = { } result = team_api.create_team_member(body) -print(result) if result.is_success(): print(result.body) @@ -138,7 +137,6 @@ body = { } result = team_api.bulk_create_team_members(body) -print(result) if result.is_success(): print(result.body) @@ -211,7 +209,6 @@ body = { } result = team_api.bulk_update_team_members(body) -print(result) if result.is_success(): print(result.body) @@ -259,7 +256,6 @@ body = { } result = team_api.search_team_members(body) -print(result) if result.is_success(): print(result.body) @@ -294,7 +290,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan team_member_id = 'team_member_id0' result = team_api.retrieve_team_member(team_member_id) -print(result) if result.is_success(): print(result.body) @@ -352,7 +347,6 @@ result = team_api.update_team_member( team_member_id, body ) -print(result) if result.is_success(): print(result.body) @@ -388,7 +382,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan team_member_id = 'team_member_id0' result = team_api.retrieve_wage_setting(team_member_id) -print(result) if result.is_success(): print(result.body) @@ -456,7 +449,6 @@ result = team_api.update_wage_setting( team_member_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/terminal.md b/doc/api/terminal.md index 93979276..6549dd79 100644 --- a/doc/api/terminal.md +++ b/doc/api/terminal.md @@ -63,7 +63,6 @@ body = { } result = terminal_api.create_terminal_action(body) -print(result) if result.is_success(): print(result.body) @@ -109,7 +108,6 @@ body = { } result = terminal_api.search_terminal_actions(body) -print(result) if result.is_success(): print(result.body) @@ -143,7 +141,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan action_id = 'action_id6' result = terminal_api.get_terminal_action(action_id) -print(result) if result.is_success(): print(result.body) @@ -177,7 +174,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan action_id = 'action_id6' result = terminal_api.cancel_terminal_action(action_id) -print(result) if result.is_success(): print(result.body) @@ -213,7 +209,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan action_id = 'action_id6' result = terminal_api.dismiss_terminal_action(action_id) -print(result) if result.is_success(): print(result.body) @@ -261,7 +256,6 @@ body = { } result = terminal_api.create_terminal_checkout(body) -print(result) if result.is_success(): print(result.body) @@ -302,7 +296,6 @@ body = { } result = terminal_api.search_terminal_checkouts(body) -print(result) if result.is_success(): print(result.body) @@ -336,7 +329,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan checkout_id = 'checkout_id8' result = terminal_api.get_terminal_checkout(checkout_id) -print(result) if result.is_success(): print(result.body) @@ -370,7 +362,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan checkout_id = 'checkout_id8' result = terminal_api.cancel_terminal_checkout(checkout_id) -print(result) if result.is_success(): print(result.body) @@ -404,7 +395,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan checkout_id = 'checkout_id8' result = terminal_api.dismiss_terminal_checkout(checkout_id) -print(result) if result.is_success(): print(result.body) @@ -449,7 +439,6 @@ body = { } result = terminal_api.create_terminal_refund(body) -print(result) if result.is_success(): print(result.body) @@ -490,7 +479,6 @@ body = { } result = terminal_api.search_terminal_refunds(body) -print(result) if result.is_success(): print(result.body) @@ -524,7 +512,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan terminal_refund_id = 'terminal_refund_id0' result = terminal_api.get_terminal_refund(terminal_refund_id) -print(result) if result.is_success(): print(result.body) @@ -558,7 +545,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan terminal_refund_id = 'terminal_refund_id0' result = terminal_api.cancel_terminal_refund(terminal_refund_id) -print(result) if result.is_success(): print(result.body) @@ -592,7 +578,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan terminal_refund_id = 'terminal_refund_id0' result = terminal_api.dismiss_terminal_refund(terminal_refund_id) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/transactions.md b/doc/api/transactions.md index c3f838b1..73c6159c 100644 --- a/doc/api/transactions.md +++ b/doc/api/transactions.md @@ -56,7 +56,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan location_id = 'location_id4' result = transactions_api.list_transactions(location_id) -print(result) if result.is_success(): print(result.body) @@ -99,7 +98,6 @@ result = transactions_api.retrieve_transaction( location_id, transaction_id ) -print(result) if result.is_success(): print(result.body) @@ -146,7 +144,6 @@ result = transactions_api.capture_transaction( location_id, transaction_id ) -print(result) if result.is_success(): print(result.body) @@ -193,7 +190,6 @@ result = transactions_api.void_transaction( location_id, transaction_id ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/v1-transactions.md b/doc/api/v1-transactions.md index f3a62798..03c6a0d8 100644 --- a/doc/api/v1-transactions.md +++ b/doc/api/v1-transactions.md @@ -48,7 +48,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan location_id = 'location_id4' result = v1_transactions_api.v1_list_orders(location_id) -print(result) if result.is_success(): print(result.body) @@ -91,7 +90,6 @@ result = v1_transactions_api.v1_retrieve_order( location_id, order_id ) -print(result) if result.is_success(): print(result.body) @@ -141,7 +139,6 @@ result = v1_transactions_api.v1_update_order( order_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/vendors.md b/doc/api/vendors.md index f7ed5f11..a14da494 100644 --- a/doc/api/vendors.md +++ b/doc/api/vendors.md @@ -49,7 +49,6 @@ body = { } result = vendors_api.bulk_create_vendors(body) -print(result) if result.is_success(): print(result.body) @@ -87,7 +86,6 @@ body = { } result = vendors_api.bulk_retrieve_vendors(body) -print(result) if result.is_success(): print(result.body) @@ -130,7 +128,6 @@ body = { } result = vendors_api.bulk_update_vendors(body) -print(result) if result.is_success(): print(result.body) @@ -166,7 +163,6 @@ body = { } result = vendors_api.create_vendor(body) -print(result) if result.is_success(): print(result.body) @@ -200,7 +196,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan body = {} result = vendors_api.search_vendors(body) -print(result) if result.is_success(): print(result.body) @@ -234,7 +229,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan vendor_id = 'vendor_id8' result = vendors_api.retrieve_vendor(vendor_id) -print(result) if result.is_success(): print(result.body) @@ -283,7 +277,6 @@ result = vendors_api.update_vendor( body, vendor_id ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/api/webhook-subscriptions.md b/doc/api/webhook-subscriptions.md index 5c19e8b7..13e1574c 100644 --- a/doc/api/webhook-subscriptions.md +++ b/doc/api/webhook-subscriptions.md @@ -43,7 +43,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan ```python result = webhook_subscriptions_api.list_webhook_event_types() -print(result) if result.is_success(): print(result.body) @@ -85,7 +84,6 @@ include_disabled = False result = webhook_subscriptions_api.list_webhook_subscriptions( include_disabled=include_disabled ) -print(result) if result.is_success(): print(result.body) @@ -130,7 +128,6 @@ body = { } result = webhook_subscriptions_api.create_webhook_subscription(body) -print(result) if result.is_success(): print(result.body) @@ -164,7 +161,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan subscription_id = 'subscription_id0' result = webhook_subscriptions_api.delete_webhook_subscription(subscription_id) -print(result) if result.is_success(): print(result.body) @@ -198,7 +194,6 @@ This method returns a `ApiResponse` instance. The `body` property of this instan subscription_id = 'subscription_id0' result = webhook_subscriptions_api.retrieve_webhook_subscription(subscription_id) -print(result) if result.is_success(): print(result.body) @@ -244,7 +239,6 @@ result = webhook_subscriptions_api.update_webhook_subscription( subscription_id, body ) -print(result) if result.is_success(): print(result.body) @@ -287,7 +281,6 @@ result = webhook_subscriptions_api.update_webhook_subscription_signature_key( subscription_id, body ) -print(result) if result.is_success(): print(result.body) @@ -330,7 +323,6 @@ result = webhook_subscriptions_api.test_webhook_subscription( subscription_id, body ) -print(result) if result.is_success(): print(result.body) diff --git a/doc/client.md b/doc/client.md index 59d2c822..2754989e 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `square_version` | `str` | Square Connect API versions
*Default*: `'2024-07-17'` | +| `square_version` | `str` | Square Connect API versions
*Default*: `'2024-08-21'` | | `custom_url` | `str` | 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`** | | `http_client_instance` | `HttpClient` | The Http Client passed from the sdk user for making requests | @@ -24,7 +24,7 @@ The API client can be initialized as follows: ```python client = Client( - square_version='2024-07-17', + square_version='2024-08-21', bearer_auth_credentials=BearerAuthCredentials( access_token='AccessToken' ), @@ -52,7 +52,7 @@ from square.http.auth.o_auth_2 import BearerAuthCredentials from square.client import Client client = Client( - square_version='2024-07-17', + square_version='2024-08-21', bearer_auth_credentials=BearerAuthCredentials( access_token='AccessToken' ) diff --git a/doc/models/create-payment-request.md b/doc/models/create-payment-request.md index 2a1394a0..407848bc 100644 --- a/doc/models/create-payment-request.md +++ b/doc/models/create-payment-request.md @@ -35,6 +35,7 @@ Describes a request to create a payment using | `cash_details` | [`Cash Payment Details`](../../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`](../../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`](../../doc/models/customer-details.md) | Optional | Details about the customer making the payment. | +| `offline_payment_details` | [`Offline Payment Details`](../../doc/models/offline-payment-details.md) | Optional | Details specific to offline payments. | ## Example (as JSON) diff --git a/doc/models/gift-card-activity-activate.md b/doc/models/gift-card-activity-activate.md index 2a7c3ec6..dece576b 100644 --- a/doc/models/gift-card-activity-activate.md +++ b/doc/models/gift-card-activity-activate.md @@ -15,7 +15,7 @@ Represents details about an `ACTIVATE` [gift card activity type](../../doc/model | `order_id` | `str` | 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` | `str` | 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` | `str` | 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` | `List[str]` | 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. | +| `buyer_payment_instrument_ids` | `List[str]` | 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) diff --git a/doc/models/gift-card-activity-load.md b/doc/models/gift-card-activity-load.md index 6d64ba0e..e1cc7b0e 100644 --- a/doc/models/gift-card-activity-load.md +++ b/doc/models/gift-card-activity-load.md @@ -15,7 +15,7 @@ Represents details about a `LOAD` [gift card activity type](../../doc/models/gif | `order_id` | `str` | 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` | `str` | 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` | `str` | 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` | `List[str]` | 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. | +| `buyer_payment_instrument_ids` | `List[str]` | 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) diff --git a/doc/models/gift-card-activity-refund.md b/doc/models/gift-card-activity-refund.md index 1fa9ed14..4cae12c7 100644 --- a/doc/models/gift-card-activity-refund.md +++ b/doc/models/gift-card-activity-refund.md @@ -11,10 +11,10 @@ Represents details about a `REFUND` [gift card activity type](../../doc/models/g | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `redeem_activity_id` | `str` | 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 redemption made by the same gift card. Note that you must use `RefundPayment`
to refund a gift card payment to the same gift card if the payment was processed by Square.

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. | +| `redeem_activity_id` | `str` | 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`](../../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` | `str` | Optional | A client-specified ID that associates the gift card activity with an entity in another system. | -| `payment_id` | `str` | Optional | The ID of the refunded payment. Square populates this field if the refund is for a
payment processed by Square and one of the following conditions is true:

- The Refunds API is used to refund a gift card payment to the same gift card.
- A seller initiated the refund from Square Point of Sale or the Seller Dashboard. The payment source can be the
same gift card or a cross-tender payment from a credit card or a different gift card. | +| `payment_id` | `str` | 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) diff --git a/doc/models/gift-card-activity-type.md b/doc/models/gift-card-activity-type.md index 2b22419f..4d820575 100644 --- a/doc/models/gift-card-activity-type.md +++ b/doc/models/gift-card-activity-type.md @@ -18,7 +18,7 @@ Indicates the type of [gift card activity](../../doc/models/gift-card-activity.m | `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 gift card payment processed by Square can be refunded to the same gift card using Square Point of Sale,
the Square Seller Dashboard, or the Refunds API.
- A cross-tender payment processed by Square can be refunded to a gift card using Square Point of Sale or the
Square Seller Dashboard. The payment source might be a credit card or different gift card.
- A payment processed using a custom payment processing system can be refunded to the same gift card. | +| `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. | diff --git a/doc/models/gift-card-status.md b/doc/models/gift-card-status.md index 31575513..7c02afe1 100644 --- a/doc/models/gift-card-status.md +++ b/doc/models/gift-card-status.md @@ -14,5 +14,5 @@ Indicates the gift card state. | `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. You must activate the gift card
before it can be used. | +| `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/list-payments-request.md b/doc/models/list-payments-request.md index ff5a346a..fad1019c 100644 --- a/doc/models/list-payments-request.md +++ b/doc/models/list-payments-request.md @@ -23,6 +23,9 @@ The maximum results per page is 100. | `last_4` | `str` | Optional | The last four digits of a payment card. | | `card_brand` | `str` | Optional | The brand of the payment card (for example, VISA). | | `limit` | `int` | 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` | `bool` | Optional | Whether the payment was taken offline or not. | +| `offline_begin_time` | `str` | 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` | `str` | 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. | ## Example (as JSON) diff --git a/doc/models/offline-payment-details.md b/doc/models/offline-payment-details.md new file mode 100644 index 00000000..9361c6cc --- /dev/null +++ b/doc/models/offline-payment-details.md @@ -0,0 +1,23 @@ + +# Offline Payment Details + +Details specific to offline payments. + +## Structure + +`Offline Payment Details` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `client_created_at` | `str` | 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/payment.md b/doc/models/payment.md index 8815ac46..f8c65697 100644 --- a/doc/models/payment.md +++ b/doc/models/payment.md @@ -52,6 +52,7 @@ Represents a payment processed by the Square API. | `device_details` | [`Device Details`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. | | `application_details` | [`Application Details`](../../doc/models/application-details.md) | Optional | Details about the application that took the payment. | | `is_offline_payment` | `bool` | Optional | Whether or not this payment was taken offline. | +| `offline_payment_details` | [`Offline Payment Details`](../../doc/models/offline-payment-details.md) | Optional | Details specific to offline payments. | | `version_token` | `str` | Optional | Used for optimistic concurrency. This opaque token identifies a specific version of the
`Payment` object. | ## Example (as JSON) diff --git a/pyproject.toml b/pyproject.toml index 67e24c3e..c5131c01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = ["setuptools>=61.0"] [project] name = "squareup" description = "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management." -version = "37.1.1.20240717" +version = "38.0.0.20240821" readme = "README.md" requires-python = ">=3.7" authors = [{name = "Square Developer Platform", email = "developers@squareup.com"}] diff --git a/square/api/base_api.py b/square/api/base_api.py index b419b93d..6aa0ab79 100644 --- a/square/api/base_api.py +++ b/square/api/base_api.py @@ -22,7 +22,7 @@ class BaseApi(object): @staticmethod def user_agent(): - return 'Square-Python-SDK/37.1.1.20240717 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}' + return 'Square-Python-SDK/38.0.0.20240821 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}' @staticmethod def user_agent_parameters(): diff --git a/square/api/catalog_api.py b/square/api/catalog_api.py index 9ec604b9..b163fb8f 100644 --- a/square/api/catalog_api.py +++ b/square/api/catalog_api.py @@ -36,9 +36,9 @@ def batch_delete_catalog_objects(self, 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. + per seller account. While one (batch or non-batch) delete request is being processed, - other (batched and non-batched) + other (batched and non-batched) delete requests are rejected with the `429` error code. Args: @@ -152,9 +152,9 @@ def batch_upsert_catalog_objects(self, no more than 10,000. To ensure consistency, only one update request is processed at a time - per seller account. + per seller account. While one (batch or non-batch) update request is being processed, - other (batched and non-batched) + other (batched and non-batched) update requests are rejected with the `429` error code. Args: @@ -259,7 +259,7 @@ def update_catalog_image(self, """Does a PUT request to /v2/catalog/images/{image_id}. Uploads a new image file to replace the existing one in the specified - [CatalogImage]($m/CatalogImage) object. + [CatalogImage]($m/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. @@ -352,9 +352,9 @@ def list_catalog(self, """Does a GET request to /v2/catalog/list. Returns a list of all [CatalogObject]($m/CatalogObject)s of the - specified types in the catalog. + specified types in the catalog. The `types` parameter is specified as a comma-separated list of the - [CatalogObjectType]($m/CatalogObjectType) values, + [CatalogObjectType]($m/CatalogObjectType) values, for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". __Important:__ ListCatalog does not return deleted catalog items. To @@ -434,9 +434,9 @@ def upsert_catalog_object(self, Creates a new or updates the specified [CatalogObject]($m/CatalogObject). To ensure consistency, only one update request is processed at a time - per seller account. + per seller account. While one (batch or non-batch) update request is being processed, - other (batched and non-batched) + other (batched and non-batched) update requests are rejected with the `429` error code. Args: @@ -491,9 +491,9 @@ def delete_catalog_object(self, will also delete all of its [CatalogItemVariation]($m/CatalogItemVariation) children. To ensure consistency, only one delete request is processed at a time - per seller account. + per seller account. While one (batch or non-batch) delete request is being processed, - other (batched and non-batched) + other (batched and non-batched) delete requests are rejected with the `429` error code. Args: diff --git a/square/api/gift_card_activities_api.py b/square/api/gift_card_activities_api.py index 4fd16572..0162ce20 100644 --- a/square/api/gift_card_activities_api.py +++ b/square/api/gift_card_activities_api.py @@ -129,10 +129,9 @@ def create_gift_card_activity(self, """Does a POST request to /v2/gift-cards/activities. Creates a gift card activity to manage the balance or state of a [gift - card]($m/GiftCard). - For example, you create an `ACTIVATE` activity to activate a gift card - with an initial balance - before the gift card can be used. + card]($m/GiftCard). + For example, create an `ACTIVATE` activity to activate a gift card + with an initial balance before first use. Args: body (CreateGiftCardActivityRequest): An object containing the diff --git a/square/api/gift_cards_api.py b/square/api/gift_cards_api.py index 9dbb39be..8ad7f243 100644 --- a/square/api/gift_cards_api.py +++ b/square/api/gift_cards_api.py @@ -101,11 +101,14 @@ def create_gift_card(self, """Does a POST request to /v2/gift-cards. Creates a digital gift card or registers a physical (plastic) gift - card. After the gift card - is created, you must call + card. The resulting gift card + has a `PENDING` state. To activate a gift card so that it can be + redeemed for purchases, call [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) - to activate the card with an initial balance before it can be used for - payment. + and create an `ACTIVATE` + activity with the initial balance. Alternatively, you can use + [RefundPayment]($e/Refunds/RefundPayment) + to refund a payment to the new gift card. Args: body (CreateGiftCardRequest): An object containing the fields to diff --git a/square/api/o_auth_api.py b/square/api/o_auth_api.py index 2a720042..27164928 100644 --- a/square/api/o_auth_api.py +++ b/square/api/o_auth_api.py @@ -7,6 +7,7 @@ from apimatic_core.response_handler import ResponseHandler from apimatic_core.types.parameter import Parameter from square.http.http_method_enum import HttpMethodEnum +from apimatic_core.authentication.multiple.single_auth import Single class OAuthApi(BaseApi): @@ -139,8 +140,7 @@ def obtain_token(self, .convertor(ApiResponse.create) ).execute() - def retrieve_token_status(self, - authorization): + def retrieve_token_status(self): """Does a POST request to /oauth2/token/status. Returns information about an [OAuth access @@ -161,9 +161,6 @@ def retrieve_token_status(self, If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error. - Args: - authorization (str): Client APPLICATION_SECRET - Returns: ApiResponse: An object with the response value as well as other useful information such as status codes and headers. Success @@ -180,12 +177,10 @@ def retrieve_token_status(self, RequestBuilder().server('default') .path('/oauth2/token/status') .http_method(HttpMethodEnum.POST) - .header_param(Parameter() - .key('Authorization') - .value(authorization)) .header_param(Parameter() .key('accept') .value('application/json')) + .auth(Single('global')) ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) diff --git a/square/api/payments_api.py b/square/api/payments_api.py index 78787f5f..0f32e10d 100644 --- a/square/api/payments_api.py +++ b/square/api/payments_api.py @@ -25,7 +25,10 @@ def list_payments(self, total=None, last_4=None, card_brand=None, - limit=None): + limit=None, + is_offline_payment=False, + offline_begin_time=None, + offline_end_time=None): """Does a GET request to /v2/payments. Retrieves a list of payments taken by the account making the request. @@ -66,6 +69,22 @@ def list_payments(self, 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 (bool, optional): Whether the payment was taken + offline or not. + offline_begin_time (str, 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 (str, 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. Returns: ApiResponse: An object with the response value as well as other @@ -110,6 +129,15 @@ def list_payments(self, .query_param(Parameter() .key('limit') .value(limit)) + .query_param(Parameter() + .key('is_offline_payment') + .value(is_offline_payment)) + .query_param(Parameter() + .key('offline_begin_time') + .value(offline_begin_time)) + .query_param(Parameter() + .key('offline_end_time') + .value(offline_end_time)) .header_param(Parameter() .key('accept') .value('application/json')) diff --git a/square/client.py b/square/client.py index 7065f669..27009137 100644 --- a/square/client.py +++ b/square/client.py @@ -55,11 +55,11 @@ class Client(object): @staticmethod def sdk_version(): - return '37.1.1.20240717' + return '38.0.0.20240821' @staticmethod def square_version(): - return '2024-07-17' + return '2024-08-21' def user_agent_detail(self): return self.config.user_agent_detail @@ -238,7 +238,7 @@ def __init__(self, http_client_instance=None, retry_statuses=None, retry_methods=None, environment='production', custom_url='https://connect.squareup.com', access_token=None, - bearer_auth_credentials=None, square_version='2024-07-17', + bearer_auth_credentials=None, square_version='2024-08-21', additional_headers={}, user_agent_detail='', config=None): self.config = config or Configuration( http_client_instance=http_client_instance, diff --git a/square/configuration.py b/square/configuration.py index 50e1ee23..3a0843e3 100644 --- a/square/configuration.py +++ b/square/configuration.py @@ -45,7 +45,7 @@ def __init__(self, http_client_instance=None, retry_statuses=None, retry_methods=None, environment='production', custom_url='https://connect.squareup.com', access_token=None, - bearer_auth_credentials=None, square_version='2024-07-17', + bearer_auth_credentials=None, square_version='2024-08-21', additional_headers={}, user_agent_detail=''): if retry_methods is None: retry_methods = ['GET', 'PUT']