Square: V1 Retrieve Order
Square v1Transactions.v1RetrieveOrder: arguments, response, policy and SDK examples.
← V1 transactions operations · Get started
Operation square.v1retrieveorder
Provider route: GET /v1/{location_id}/orders/{order_id}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/square with npm, or alter-sdk-square with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { SquareIntegration } from "@alter-ai/square";
async function execute(input: Parameters<SquareIntegration["v1Transactions"]["v1RetrieveOrder"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new SquareIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.v1Transactions.v1RetrieveOrder(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_square import SquareIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = SquareIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.v1_transactions.v1_retrieve_order(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.location_id | string | Required within parent | |
path.order_id | string | Required within parent |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand V1 Update Order — response body |
Referenced models: V1 Update Order — response body
Schemas
Section titled “Schemas”6 more schemas are linked from the tables above, on the schema pages.
V1 Update Order — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | V1Order |
btc_price_satoshi | JSON | Optional | |
btc_price_satoshi (anyOf 1) | JSON | Alternative | |
btc_price_satoshi (anyOf 1) (anyOf 1) | number | Alternative | For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 BTC). |
btc_price_satoshi (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
btc_price_satoshi (anyOf 2) | null | Alternative | |
btc_receive_address | JSON | Optional | |
btc_receive_address (anyOf 1) | string | Alternative | For Bitcoin transactions, the address that the buyer sent Bitcoin to. |
btc_receive_address (anyOf 2) | null | Alternative | |
buyer_email | JSON | Optional | |
buyer_email (anyOf 1) | string | Alternative | The email address of the order's buyer. |
buyer_email (anyOf 2) | null | Alternative | |
buyer_note | JSON | Optional | |
buyer_note (anyOf 1) | string | Alternative | A note provided by the buyer when the order was created, if any. |
buyer_note (anyOf 2) | null | Alternative | |
canceled_note | JSON | Optional | |
canceled_note (anyOf 1) | string | Alternative | A note provided by the merchant when the order's state was set to CANCELED, if any. |
canceled_note (anyOf 2) | null | Alternative | |
completed_note | JSON | Optional | |
completed_note (anyOf 1) | string | Alternative | A note provided by the merchant when the order's state was set to COMPLETED, if any |
completed_note (anyOf 2) | null | Alternative | |
created_at | string | Optional | The time when the order was created, in ISO 8601 format. |
errors | JSON | Optional | |
errors (anyOf 1) | array | Alternative | Any errors that occurred during the request. |
errors (anyOf 1)[] | Model | Each item | Expand Get Shift — response body — errors item |
errors (anyOf 2) | null | Alternative | |
expires_at | JSON | Optional | |
expires_at (anyOf 1) | string | Alternative | The time when the order expires if no action is taken, in ISO 8601 format. |
expires_at (anyOf 2) | null | Alternative | |
id | string | Optional | The order's unique identifier. |
order_history | JSON | Optional | |
order_history (anyOf 1) | array | Alternative | The history of actions associated with the order. |
order_history (anyOf 1)[] | Model | Each item | Expand V1 Update Order — response body — order history The history of actions associated with the order item |
order_history (anyOf 2) | null | Alternative | |
payment_id | JSON | Optional | |
payment_id (anyOf 1) | string | Alternative | The unique identifier of the payment associated with the order. |
payment_id (anyOf 2) | null | Alternative | |
promo_code | JSON | Optional | |
promo_code (anyOf 1) | string | Alternative | The promo code provided by the buyer, if any. |
promo_code (anyOf 2) | null | Alternative | |
recipient_name | JSON | Optional | |
recipient_name (anyOf 1) | string | Alternative | The name of the order's buyer. |
recipient_name (anyOf 2) | null | Alternative | |
recipient_phone_number | JSON | Optional | |
recipient_phone_number (anyOf 1) | string | Alternative | The phone number to use for the order's delivery. |
recipient_phone_number (anyOf 2) | null | Alternative | |
refunded_note | JSON | Optional | |
refunded_note (anyOf 1) | string | Alternative | A note provided by the merchant when the order's state was set to REFUNDED, if any. |
refunded_note (anyOf 2) | null | Alternative | |
shipping_address | JSON | Optional | |
shipping_address (anyOf 1) | Model | Alternative | Expand Get Payment — response body — payment billing address The address to ship the order to. |
shipping_address (anyOf 2) | null | Alternative | |
state | JSON | Optional | |
state (anyOf 1) | string | Alternative | Whether the tax is an ADDITIVE tax or an INCLUSIVE tax. See [V1OrderState](#type-v1orderstate) for possible values Known values: PENDING, OPEN, COMPLETED, CANCELED, REFUNDED, REJECTED |
state (anyOf 2) | null | Alternative | |
subtotal_money | JSON | Optional | |
subtotal_money (anyOf 1) | Model | Alternative | Expand V1 Update Order — response body — subtotal money amount, currency code The amount of all items purchased in the order, before taxes and shipping. |
subtotal_money (anyOf 2) | null | Alternative | |
tender | JSON | Optional | |
tender (anyOf 1) | Model | Alternative | Expand V1 Update Order — response body — tender card brand, change back money, employee id, entry method, id, is exchange, name, pan suffix, payment note, receipt url, refunded money, settled at, tendered at, tendered money, total money, type The tender used to pay for the order. |
tender (anyOf 2) | null | Alternative | |
total_discount_money | JSON | Optional | |
total_discount_money (anyOf 1) | Model | Alternative | Expand V1 Update Order — response body — subtotal money amount, currency code The total of all discounts applied to the order. |
total_discount_money (anyOf 2) | null | Alternative | |
total_price_money | JSON | Optional | |
total_price_money (anyOf 1) | Model | Alternative | Expand V1 Update Order — response body — subtotal money amount, currency code The total cost of the order. |
total_price_money (anyOf 2) | null | Alternative | |
total_shipping_money | JSON | Optional | |
total_shipping_money (anyOf 1) | Model | Alternative | Expand V1 Update Order — response body — subtotal money amount, currency code The shipping cost for the order. |
total_shipping_money (anyOf 2) | null | Alternative | |
total_tax_money | JSON | Optional | |
total_tax_money (anyOf 1) | Model | Alternative | Expand V1 Update Order — response body — subtotal money amount, currency code The total of all taxes applied to the order. |
total_tax_money (anyOf 2) | null | Alternative | |
updated_at | string | Optional | The time when the order was last modified, in ISO 8601 format. |
Referenced models: Get Payment — response body — payment billing address, Get Shift — response body — errors item, V1 Update Order — response body — subtotal money amount, currency code, V1 Update Order — response body — order history The history of actions associated with the order item, V1 Update Order — response body — tender card brand, change back money, employee id, entry method, id, is exchange, name, pan suffix, payment note, receipt url, refunded money, settled at, tendered at, tendered money, total money, type
Get Shift — response body — errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an error encountered during a request to the Connect API. See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. |
category | string | Required within parent | Indicates which high-level category of error has occurred during a request to the Connect API. The high-level category for the error. See [ErrorCategory](#type-errorcategory) for possible values Known values: API_ERROR, AUTHENTICATION_ERROR, INVALID_REQUEST_ERROR, RATE_LIMIT_ERROR, PAYMENT_METHOD_ERROR, REFUND_ERROR, MERCHANT_SUBSCRIPTION_ERROR, EXTERNAL_VENDOR_ERROR |
code | Model | Required within parent | Expand Get Shift — response body — errors item code The specific code of the error. See [ErrorCode](#type-errorcode) for possible values |
detail | string | Optional | A human-readable description of the error for debugging purposes. |
field | string | Optional | The name of the field provided in the original request (if any) that the error pertains to. |
Referenced models: Get Shift — response body — errors item code
V1 Update Order — response body — subtotal money amount, currency code
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amount | JSON | Optional | |
amount (anyOf 1) | JSON | Alternative | |
amount (anyOf 1) (anyOf 1) | integer | Alternative | Amount in the lowest denominated value of this Currency. E.g. in USD these are cents, in JPY they are Yen (which do not have a 'cent' concept). |
amount (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
amount (anyOf 2) | null | Alternative | |
currency_code | JSON | Optional | |
currency_code (anyOf 1) | Model | Alternative | Expand Create Location — response body — location currency See [Currency](#type-currency) for possible values |
currency_code (anyOf 2) | null | Alternative |
Referenced models: Create Location — response body — location currency
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.v1retrieveorder. Catalog operation: V1RetrieveOrder. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["ORDERS_READ"]
Pinned headers: {"Square-Version": "2026-11-18"}