### Search Subscriptions Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/search-subscriptions-response.md A JSON example of the Search Subscriptions Response, illustrating the structure with sample data for subscriptions, errors, and the cursor. ```JSON { "subscriptions": [ { "canceled_date": "2021-10-30", "card_id": "ccof:mueUsvgajChmjEbp4GB", "charged_through_date": "2021-11-20", "created_at": "2021-10-20T21:53:10Z", "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", "id": "de86fc96-8664-474b-af1a-abbe59cacf0e", "location_id": "S8GWD5R9QB376", "paid_until_date": "2021-11-20", "plan_variation_id": "L3TJVDHVBEQEGQDEZL2JJM7R", "source": { "name": "My Application" }, "start_date": "2021-10-20", "status": "CANCELED", "timezone": "UTC" }, { "charged_through_date": "2022-08-19", "created_at": "2022-01-19T21:53:10Z", "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", "invoice_ids": [ "grebK0Q_l8H4fqoMMVvt-Q", "rcX_i3sNmHTGKhI4W2mceA" ], "location_id": "S8GWD5R9QB376", "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", "price_override_money": { "amount": 1000, "currency": "USD" }, "source": { "name": "My Application" }, "start_date": "2022-01-19", "status": "PAUSED", "tax_percentage": "5", "timezone": "America/Los_Angeles", "version": 2 }, { "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", "created_at": "2023-06-20T21:53:10Z", "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", "location_id": "S8GWD5R9QB376", "phases": [ { "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", "ordinal": 0, "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", "uid": "873451e0-745b-4e87-ab0b-c574933fe616" } ], "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", "source": { "name": "My Application" }, "start_date": "2023-06-20", "status": "ACTIVE", "timezone": "America/Los_Angeles", "version": 1 } ], "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ], "cursor": "cursor2" } ``` -------------------------------- ### Get Payment Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-payment-response.md An example JSON payload illustrating the structure of a Get Payment Response, including payment details and potential errors. ```json { "payment": { "amount_money": { "amount": 555, "currency": "USD" }, "application_details": { "application_id": "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", "square_product": "VIRTUAL_TERMINAL" }, "approved_money": { "amount": 555, "currency": "USD" }, "card_details": { "auth_result_code": "2Nkw7q", "avs_status": "AVS_ACCEPTED", "card": { "bin": "411111", "card_brand": "VISA", "card_type": "DEBIT", "exp_month": 11, "exp_year": 2022, "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", "last_4": "1111", "prepaid_type": "NOT_PREPAID" }, "card_payment_timeline": { "authorized_at": "2021-10-13T19:34:33.680Z", "captured_at": "2021-10-13T19:34:34.340Z" }, "cvv_status": "CVV_ACCEPTED", "entry_method": "KEYED", "statement_description": "SQ *EXAMPLE TEST GOSQ.C", "status": "CAPTURED" }, "created_at": "2021-10-13T19:34:33.524Z", "delay_action": "CANCEL", "delay_duration": "PT168H", "delayed_until": "2021-10-20T19:34:33.524Z", "employee_id": "TMoK_ogh6rH1o4dV", "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", "location_id": "L88917AVBK2S5", "note": "Test Note", "order_id": "d7eKah653Z579f3gVtjlxpSlmUcZY", "processing_fee": [ { "amount_money": { "amount": 34, "currency": "USD" }, "effective_at": "2021-10-13T21:34:35.000Z", "type": "INITIAL" } ], "receipt_number": "bP9m", "receipt_url": "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", "source_type": "CARD", "status": "COMPLETED", "team_member_id": "TMoK_ogh6rH1o4dV", "total_money": { "amount": 555, "currency": "USD" }, "updated_at": "2021-10-13T19:34:34.339Z", "version_token": "56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o", "tip_money": { "amount": 190, "currency": "TWD" } }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Example ListLoyaltyPromotions Response (JSON) Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/list-loyalty-promotions-response.md A JSON example of the ListLoyaltyPromotions response, showcasing the structure with sample data for loyalty promotions, errors, and the pagination cursor. ```json { "loyalty_promotions": [ { "available_time": { "start_date": "2022-08-16", "time_periods": [ "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" ], "end_date": "end_date8" }, "created_at": "2022-08-16T08:38:54Z", "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", "incentive": { "points_multiplier_data": { "multiplier": "3.000", "points_multiplier": 3 }, "type": "POINTS_MULTIPLIER", "points_addition_data": { "points_addition": 218 } }, "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", "name": "Tuesday Happy Hour Promo", "qualifying_item_variation_ids": [ "CJ3RYL56ITAKMD4VRCM7XERS", "AT3RYLR3TUA9C34VRCB7X5RR" ], "status": "ACTIVE", "trigger_limit": { "interval": "DAY", "times": 1 }, "updated_at": "2022-08-16T08:38:54Z", "canceled_at": "canceled_at0" }, { "available_time": { "end_date": "2022-08-01", "start_date": "2022-07-01", "time_periods": [ "BEGIN:VEVENT\nDTSTART:20220704T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=MO\nEND:VEVENT", "BEGIN:VEVENT\nDTSTART:20220705T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TU\nEND:VEVENT", "BEGIN:VEVENT\nDTSTART:20220706T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=WE\nEND:VEVENT", "BEGIN:VEVENT\nDTSTART:20220707T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TH\nEND:VEVENT", "BEGIN:VEVENT\nDTSTART:20220701T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=FR\nEND:VEVENT" ] }, "created_at": "2022-06-27T15:37:38Z", "id": "loypromo_e696f057-2286-35ff-8108-132241328106", "incentive": { "points_multiplier_data": { "multiplier": "2.000", "points_multiplier": 2 }, "type": "POINTS_MULTIPLIER", "points_addition_data": { "points_addition": 218 } }, "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", "minimum_spend_amount_money": { "amount": 2000, "currency": "USD" }, "name": "July Special", "qualifying_category_ids": [ "XTQPYLR3IIU9C44VRCB3XD12" ], "status": "ENDED", "trigger_limit": { "interval": "ALL_TIME", "times": 5 }, "updated_at": "2022-06-27T15:37:38Z", "canceled_at": "canceled_at0" } ], "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ], "cursor": "cursor8" } ``` -------------------------------- ### Get Bank Account Response JSON Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-bank-account-response.md An example of the Get Bank Account Response object in JSON format, illustrating the structure of the 'bank_account' and 'errors' fields. ```json { "bank_account": { "account_number_suffix": "971", "account_type": "CHECKING", "bank_name": "Bank Name", "country": "US", "creditable": false, "currency": "USD", "debitable": false, "holder_name": "Jane Doe", "id": "w3yRgCGYQnwmdl0R3GB", "location_id": "S8GWD5example", "primary_bank_identification_number": "112200303", "status": "VERIFICATION_IN_PROGRESS", "version": 5, "secondary_bank_identification_number": "secondary_bank_identification_number4", "debit_mandate_reference_id": "debit_mandate_reference_id0", "reference_id": "reference_id2", "fingerprint": "fingerprint0" }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Get Device Code Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-device-code-response.md An example of the Get Device Code Response in JSON format, illustrating the structure with sample data for device code and errors. ```JSON { "device_code": { "code": "EBCARJ", "created_at": "2020-02-06T18:44:33.000Z", "device_id": "907CS13101300122", "id": "B3Z6NAMYQSMTM", "location_id": "B5E4484SHHNYH", "name": "Counter 1", "pair_by": "2020-02-06T18:49:33.000Z", "product_type": "TERMINAL_API", "status": "PAIRED", "status_changed_at": "2020-02-06T18:47:28.000Z" }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Create Loyalty Promotion Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/create-loyalty-promotion-response.md An example of the JSON response received after creating a loyalty promotion. This demonstrates the structure with either loyalty promotion details or error information. ```JSON { "loyalty_promotion": { "available_time": { "start_date": "2022-08-16", "time_periods": [ "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" ], "end_date": "end_date8" }, "created_at": "2022-08-16T08:38:54Z", "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", "incentive": { "points_multiplier_data": { "multiplier": "3.000", "points_multiplier": 3 }, "type": "POINTS_MULTIPLIER", "points_addition_data": { "points_addition": 218 } }, "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", "minimum_spend_amount_money": { "amount": 2000, "currency": "USD" }, "name": "Tuesday Happy Hour Promo", "qualifying_category_ids": [ "XTQPYLR3IIU9C44VRCB3XD12" ], "status": "ACTIVE", "trigger_limit": { "interval": "DAY", "times": 1 }, "updated_at": "2022-08-16T08:38:54Z", "canceled_at": "canceled_at0" }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Get Employee Wage Response JSON Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-employee-wage-response.md An example of the Get Employee Wage Response in JSON format, illustrating the structure of employee wage data and error objects. ```JSON { "employee_wage": { "employee_id": "33fJchumvVdJwxV0H6L9", "hourly_rate": { "amount": 2000, "currency": "USD" }, "id": "pXS3qCv7BERPnEGedM4S8mhm", "title": "Manager" }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Resume Subscription Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/resume-subscription-response.md An example of the Resume Subscription Response in JSON format, illustrating the structure with sample data for errors, subscription details, and actions. ```json { "actions": [ { "effective_date": "2023-09-01", "id": "18ff74f4-3da4-30c5-929f-7d6fca84f115", "type": "RESUME", "monthly_billing_anchor_date": 186, "phases": [ { "uid": "uid0", "ordinal": 78, "order_template_id": "order_template_id2", "plan_phase_uid": "plan_phase_uid6" }, { "uid": "uid0", "ordinal": 78, "order_template_id": "order_template_id2", "plan_phase_uid": "plan_phase_uid6" }, { "uid": "uid0", "ordinal": 78, "order_template_id": "order_template_id2", "plan_phase_uid": "plan_phase_uid6" } ] } ], "subscription": { "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", "created_at": "2023-06-20T21:53:10Z", "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", "location_id": "S8GWD5R9QB376", "phases": [ { "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", "ordinal": 0, "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", "uid": "873451e0-745b-4e87-ab0b-c574933fe616" } ], "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", "source": { "name": "My Application" }, "start_date": "2023-06-20", "status": "ACTIVE", "timezone": "America/Los_Angeles", "version": 1 }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Get Payout Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-payout-response.md A JSON example illustrating the structure of a Get Payout Response, including sample data for payout details (amount, currency, dates, destination, status) and associated errors. ```JSON { "payout": { "amount_money": { "amount": -103, "currency_code": "USD", "currency": "AUD" }, "arrival_date": "2022-03-24", "created_at": "2022-03-24T03:07:09Z", "destination": { "id": "bact:ZPp3oedR3AeEUNd3z7", "type": "BANK_ACCOUNT" }, "id": "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", "location_id": "L88917AVBK2S5", "status": "PAID", "type": "BATCH", "updated_at": "2022-03-24T03:07:09Z", "version": 1 }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Example Create Webhook Subscription Request (JSON) Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/create-webhook-subscription-request.md Provides a JSON example of a Create Webhook Subscription Request, demonstrating the required fields and their typical values. ```JSON { "idempotency_key": "63f84c6c-2200-4c99-846c-2670a1311fbf", "subscription": { "api_version": "2021-12-15", "event_types": [ "payment.created", "payment.updated" ], "name": "Example Webhook Subscription", "notification_url": "https://example-webhook-url.com", "id": "id4", "enabled": false } } ``` -------------------------------- ### Bulk Swap Plan Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/bulk-swap-plan-response.md An example of the Bulk Swap Plan Response in JSON format, illustrating the structure with sample data for affected subscriptions and errors. ```JSON { "affected_subscriptions": 12, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Example Get Payment Refund Response (JSON) Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-payment-refund-response.md An example JSON payload illustrating the structure of a Get Payment Refund Response, including sample data for refund details and potential errors. ```json { "refund": { "amount_money": { "amount": 555, "currency": "USD" }, "created_at": "2021-10-13T19:59:05.073Z", "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", "location_id": "L88917AVBK2S5", "order_id": "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", "payment_id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", "processing_fee": [ { "amount_money": { "amount": -34, "currency": "USD" }, "effective_at": "2021-10-13T21:34:35.000Z", "type": "INITIAL" } ], "reason": "Example Refund", "status": "COMPLETED", "updated_at": "2021-10-13T20:00:02.442Z", "unlinked": false, "destination_type": "destination_type2", "destination_details": { "card_details": { "card": { "id": "id6", "card_brand": "OTHER_BRAND", "last_4": "last_48", "exp_month": 228, "exp_year": 68 }, "entry_method": "entry_method8", "auth_result_code": "auth_result_code0" }, "cash_details": { "seller_supplied_money": { "amount": 36, "currency": "MKD" }, "change_back_money": { "amount": 78, "currency": "XBD" } }, "external_details": { "type": "type6", "source": "source0", "source_id": "source_id8" } } }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Quick Pay JSON Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/quick-pay.md Provides a JSON example demonstrating how to structure the Quick Pay data, including the item's name, price with currency, and the location ID. ```json { "name": "name8", "price_money": { "amount": 202, "currency": "GTQ" }, "location_id": "location_id2" } ``` -------------------------------- ### Get Terminal Refund Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-terminal-refund-response.md An example of the Get Terminal Refund Response in JSON format. This illustrates the data structure for both successful refund details and potential errors returned by the Square API. ```JSON { "refund": { "amount_money": { "amount": 111, "currency": "CAD" }, "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", "card": { "bin": "411111", "card_brand": "INTERAC", "card_type": "CREDIT", "exp_month": 1, "exp_year": 2022, "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", "last_4": "1111" }, "created_at": "2020-09-29T15:21:46.771Z", "deadline_duration": "PT5M", "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", "id": "009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", "location_id": "76C9W6K8CNNQ5", "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", "reason": "Returning item", "refund_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb", "status": "COMPLETED", "updated_at": "2020-09-29T15:21:48.675Z" }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Get Team Member Wage Response JSON Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-team-member-wage-response.md An example of the Get Team Member Wage Response in JSON format, illustrating the structure with sample data for team member wage and errors. ```json { "team_member_wage": { "hourly_rate": { "amount": 2000, "currency": "USD" }, "id": "pXS3qCv7BERPnEGedM4S8mhm", "job_id": "jxJNN6eCJsLrhg5UFJrDWDGE", "team_member_id": "33fJchumvVdJwxV0H6L9", "tip_eligible": false, "title": "Manager" }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Create Device Code Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/create-device-code-response.md An example of the Create Device Code Response in JSON format, illustrating the structure with sample data for device code and errors. ```json { "device_code": { "code": "EBCARJ", "created_at": "2020-02-06T18:44:33.000Z", "id": "B3Z6NAMYQSMTM", "location_id": "B5E4484SHHNYH", "name": "Counter 1", "pair_by": "2020-02-06T18:49:33.000Z", "product_type": "TERMINAL_API", "status": "UNPAIRED", "status_changed_at": "2020-02-06T18:44:33.000Z", "device_id": "device_id0" }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Get Terminal Action Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-terminal-action-response.md An example of the Get Terminal Action Response in JSON format, illustrating the structure with sample data for both 'action' and 'errors' fields. This helps in understanding how to parse and utilize the response. ```JSON { "action": { "app_id": "APP_ID", "created_at": "2021-07-28T23:22:07.476Z", "deadline_duration": "PT5M", "device_id": "DEVICE_ID", "id": "termapia:jveJIAkkAjILHkdCE", "location_id": "LOCATION_ID", "save_card_options": { "customer_id": "CUSTOMER_ID", "reference_id": "user-id-1" }, "status": "IN_PROGRESS", "type": "SAVE_CARD", "updated_at": "2021-07-28T23:22:08.301Z", "cancel_reason": "TIMED_OUT" }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Example Create Loyalty Reward Request (JSON) Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/create-loyalty-reward-request.md Provides a JSON example of a complete request to create a loyalty reward, including all necessary fields and their typical values. ```JSON { "idempotency_key": "18c2e5ea-a620-4b1f-ad60-7b167285e451", "reward": { "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", "id": "id0", "status": "ISSUED", "points": 222, "created_at": "created_at8" } } ``` -------------------------------- ### Get Shift Response Example (JSON) Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-shift-response.md An example of the Get Shift Response in JSON format, illustrating the nested structure of the 'shift' object with details like breaks, timestamps, and wage information, as well as an array of potential 'errors'. ```JSON { "shift": { "breaks": [ { "break_type_id": "92EPDRQKJ5088", "end_at": "2019-02-23T20:00:00-05:00", "expected_duration": "PT1H", "id": "M9BBKEPQAQD2T", "is_paid": true, "name": "Lunch Break", "start_at": "2019-02-23T19:00:00-05:00" } ], "created_at": "2019-02-27T00:12:12Z", "declared_cash_tip_money": { "amount": 500, "currency": "USD" }, "employee_id": "D71KRMQof6cXGUW0aAv7", "end_at": "2019-02-23T21:00:00-05:00", "id": "T35HMQSN89SV4", "location_id": "PAA1RJZZKXBFG", "start_at": "2019-02-23T18:00:00-05:00", "status": "CLOSED", "team_member_id": "D71KRMQof6cXGUW0aAv7", "timezone": "America/New_York", "updated_at": "2019-02-27T00:12:12Z", "version": 1, "wage": { "hourly_rate": { "amount": 1457, "currency": "USD" }, "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", "tip_eligible": true, "title": "Cashier" } }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### List Workweek Configs Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/list-workweek-configs-response.md An example of the List Workweek Configs Response in JSON format, demonstrating the structure with sample data for workweek configurations, cursor, and errors. ```JSON { "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", "workweek_configs": [ { "created_at": "2016-02-04T00:58:24Z", "id": "FY4VCAQN700GM", "start_of_day_local_time": "10:00", "start_of_week": "MON", "updated_at": "2019-02-28T01:04:35Z", "version": 11 } ], "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Get Bank Account by V1 Id Response Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-bank-account-by-v1-id-response.md An example of the Get Bank Account by V1 Id Response object in JSON format, illustrating the data structure for bank account details and potential errors. ```json { "bank_account": { "account_number_suffix": "971", "account_type": "CHECKING", "bank_name": "Bank Name", "country": "US", "creditable": false, "currency": "USD", "debitable": false, "holder_name": "Jane Doe", "id": "w3yRgCGYQnwmdl0R3GB", "location_id": "S8GWD5example", "primary_bank_identification_number": "112200303", "status": "VERIFICATION_IN_PROGRESS", "version": 5, "secondary_bank_identification_number": "secondary_bank_identification_number4", "debit_mandate_reference_id": "debit_mandate_reference_id0", "reference_id": "reference_id2", "fingerprint": "fingerprint0" }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" }, { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ``` -------------------------------- ### Create Device Code Request JSON Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/create-device-code-request.md An example of a Create Device Code Request formatted as JSON, demonstrating the structure with sample data for device code and idempotency key. ```json { "device_code": { "location_id": "B5E4484SHHNYH", "name": "Counter 1", "product_type": "TERMINAL_API", "id": "id4", "code": "code2", "device_id": "device_id0" }, "idempotency_key": "01bb00a6-0c86-4770-94ed-f5fca973cd56" } ``` -------------------------------- ### Create Loyalty Promotion Example Source: https://github.com/square/square-ruby-sdk/blob/master/doc/api/loyalty.md Provides an example of creating a loyalty promotion using the Square Ruby SDK. It includes setting up the request body with promotion details such as name, incentive type, availability, trigger limits, minimum spend, and qualifying categories, along with an idempotency key. ```ruby program_id = 'program_id0' body = { :loyalty_promotion => { :name => 'Tuesday Happy Hour Promo', :incentive => { :type => 'POINTS_MULTIPLIER', :points_multiplier_data => { :multiplier => '3.0' } }, :available_time => { :time_periods => [ 'BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT' ] }, :trigger_limit => { :times => 1, :interval => 'DAY' }, :minimum_spend_amount_money => { :amount => 2000, :currency => 'USD' }, :qualifying_category_ids => [ 'XTQPYLR3IIU9C44VRCB3XD12' ] }, :idempotency_key => 'ec78c477-b1c3-4899-a209-a4e71337c996' } result = loyalty_api.create_loyalty_promotion( program_id: program_id, body: body ) if result.success? puts result.data elsif result.error? warn result.errors end ``` -------------------------------- ### Get Terminal Checkout Response Example (JSON) Source: https://github.com/square/square-ruby-sdk/blob/master/doc/models/get-terminal-checkout-response.md Provides a JSON example of the Get Terminal Checkout Response, illustrating the data structure for both 'checkout' and 'errors' fields. ```json { "checkout": { "amount_money": { "amount": 2610, "currency": "USD" }, "app_id": "APP_ID", "created_at": "2020-04-06T16:39:32.545Z", "deadline_duration": "PT5M", "device_options": { "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", "skip_receipt_screen": false, "tip_settings": { "allow_tipping": false, "separate_tip_screen": false, "custom_tip_field": false, "tip_percentages": [ 48 ], "smart_tipping": false }, "collect_signature": false, "show_itemized_cart": false }, "id": "08YceKh7B3ZqO", "location_id": "LOCATION_ID", "note": "A brief note", "reference_id": "id11572", "status": "IN_PROGRESS", "updated_at": "2020-04-06T16:39:323.001Z", "order_id": "order_id6", "payment_options": { "autocomplete": false, "delay_duration": "delay_duration2", "accept_partial_authorization": false, "delay_action": "CANCEL" } }, "errors": [ { "category": "MERCHANT_SUBSCRIPTION_ERROR", "code": "INVALID_EXPIRATION", "detail": "detail6", "field": "field4" } ] } ```