action squareup_retrieve_transaction { label: "RetrieveTransaction" description: "Retrieves details for a single transaction." provider: squareup method: GET path: "/v2/locations/{location_id}/transactions/{transaction_id}" encoding: json input: { type: "object" properties: { location_id: { type: "string" } transaction_id: { type: "string" } } required: ["location_id", "transaction_id"] additionalProperties: false } output: { type: "object" description: "Defines the fields that are included in the response body of\na request to the [RetrieveTransaction](https://developer.squareup.com/reference/square_2021-08-18/transactions-api/retrieve-transaction) endpoint.\n\nOne of `errors` or `transaction` is present in a given response (never both)." properties: { errors: { type: "array" description: "Any errors that occurred during the request." items: { type: "object" description: "Represents an error encountered during a request to the Connect API.\n\nSee [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information." required: ["category", "code"] properties: { category: { type: "string" description: "The high-level category for the error." } code: { type: "string" description: "The specific code of the error." } detail: { type: "string" description: "A human-readable description of the error for debugging purposes." } field: { type: "string" description: "The name of the field provided in the original request (if any) that\nthe error pertains to." } } } } transaction: { type: "object" description: "Represents a transaction processed with Square, either with the\nConnect API or with Square Point of Sale.\n\nThe `tenders` field of this object lists all methods of payment used to pay in\nthe transaction." properties: { client_id: { type: "string" description: "If the transaction was created in the Square Point of Sale app, this value\nis the ID generated for the transaction by Square Point of Sale.\n\nThis ID has no relationship to the transaction's canonical `id`, which is\ngenerated by Square's backend servers. This value is generated for bookkeeping\npurposes, in case the transaction cannot immediately be completed (for example,\nif the transaction is processed in offline mode).\n\nIt is not currently possible with the Connect API to perform a transaction\nlookup by this value." } created_at: { type: "string" description: "The timestamp for when the transaction was created, in RFC 3339 format." } id: { type: "string" description: "The transaction's unique ID, issued by Square payments servers." } location_id: { type: "string" description: "The ID of the transaction's associated location." } order_id: { type: "string" description: "The order_id is an identifier for the order associated with this transaction, if any." } product: { type: "string" description: "The Square product that processed the transaction." } reference_id: { type: "string" description: "If the transaction was created with the [Charge](https://developer.squareup.com/reference/square_2021-08-18/transactions-api/charge)\nendpoint, this value is the same as the value provided for the `reference_id`\nparameter in the request to that endpoint. Otherwise, it is not set." } refunds: { type: "array" description: "Refunds that have been applied to any tender in the transaction." items: { type: "object" description: "Represents a refund processed for a Square transaction." required: ["id", "location_id", "transaction_id", "tender_id", "reason", "amount_money", "status"] properties: { additional_recipients: { type: "array" description: "Additional recipients (other than the merchant) receiving a portion of this refund.\nFor example, fees assessed on a refund of a purchase by a third party integration." items: { type: "object" description: "Represents an additional recipient (other than the merchant) receiving a portion of this tender." required: ["location_id", "amount_money"] properties: { amount_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } description: { type: "string" description: "The description of the additional recipient." } location_id: { type: "string" description: "The location ID for a recipient (other than the merchant) receiving a portion of this tender." } receivable_id: { type: "string" description: "The unique ID for this [AdditionalRecipientReceivable](https://developer.squareup.com/reference/square_2021-08-18/objects/AdditionalRecipientReceivable), assigned by the server." } } } } amount_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } created_at: { type: "string" description: "The timestamp for when the refund was created, in RFC 3339 format." } id: { type: "string" description: "The refund's unique ID." } location_id: { type: "string" description: "The ID of the refund's associated location." } processing_fee_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } reason: { type: "string" description: "The reason for the refund being issued." } status: { type: "string" description: "The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`,\nor `FAILED`)." } tender_id: { type: "string" description: "The ID of the refunded tender." } transaction_id: { type: "string" description: "The ID of the transaction that the refunded tender is part of." } } } } shipping_address: { type: "object" description: "Represents a postal address in a country. The address format is based \non an [open-source library from Google](https://github.com/google/libaddressinput). For more information, \nsee [AddressValidationMetadata](https://github.com/google/libaddressinput/wiki/AddressValidationMetadata). \nThis format has dedicated fields for four address components: postal code, \nlocality (city), administrative district (state, prefecture, or province), and \nsublocality (town or village). These components have dedicated fields in the \n`Address` object because software sometimes behaves differently based on them. \nFor example, sales tax software may charge different amounts of sales tax \nbased on the postal code, and some software is only available in \ncertain states due to compliance reasons.\n\nFor the remaining address components, the `Address` type provides the \n`address_line_1` and `address_line_2` fields for free-form data entry. \nThese fields are free-form because the remaining address components have \ntoo many variations around the world and typical software does not parse \nthese components. These fields enable users to enter anything they want. \n\nNote that, in the current implementation, all other `Address` type fields are blank. \nThese include `address_line_3`, `sublocality_2`, `sublocality_3`, \n`administrative_district_level_2`, `administrative_district_level_3`, \n`first_name`, `last_name`, and `organization`. \n\nWhen it comes to localization, the seller's language preferences \n(see [Language preferences](https://developer.squareup.com/docs/locations-api#location-specific-and-seller-level-language-preferences)) \nare ignored for addresses. Even though Square products (such as Square Point of Sale \nand the Seller Dashboard) mostly use a seller's language preference in \ncommunication, when it comes to addresses, they will use English for a US address, \nJapanese for an address in Japan, and so on." properties: { address_line_1: { type: "string" description: "The first line of the address.\n\nFields that start with `address_line` provide the address's most specific\ndetails, like street number, street name, and building name. They do *not*\nprovide less specific details like city, state/province, or country (these\ndetails are provided in other fields)." } address_line_2: { type: "string" description: "The second line of the address, if any." } address_line_3: { type: "string" description: "The third line of the address, if any." } administrative_district_level_1: { type: "string" description: "A civil entity within the address's country. In the US, this\nis the state." } administrative_district_level_2: { type: "string" description: "A civil entity within the address's `administrative_district_level_1`.\nIn the US, this is the county." } administrative_district_level_3: { type: "string" description: "A civil entity within the address's `administrative_district_level_2`,\nif any." } country: { type: "string" description: "The address's country, in ISO 3166-1-alpha-2 format." } first_name: { type: "string" description: "Optional first name when it's representing recipient." } last_name: { type: "string" description: "Optional last name when it's representing recipient." } locality: { type: "string" description: "The city or town of the address." } organization: { type: "string" description: "Optional organization name when it's representing recipient." } postal_code: { type: "string" description: "The address's postal code." } sublocality: { type: "string" description: "A civil region within the address's `locality`, if any." } sublocality_2: { type: "string" description: "A civil region within the address's `sublocality`, if any." } sublocality_3: { type: "string" description: "A civil region within the address's `sublocality_2`, if any." } } } tenders: { type: "array" description: "The tenders used to pay in the transaction." items: { type: "object" description: "Represents a tender (i.e., a method of payment) used in a Square transaction." required: ["type"] properties: { additional_recipients: { type: "array" description: "Additional recipients (other than the merchant) receiving a portion of this tender.\nFor example, fees assessed on the purchase by a third party integration." items: { type: "object" description: "Represents an additional recipient (other than the merchant) receiving a portion of this tender." required: ["location_id", "amount_money"] properties: { amount_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } description: { type: "string" description: "The description of the additional recipient." } location_id: { type: "string" description: "The location ID for a recipient (other than the merchant) receiving a portion of this tender." } receivable_id: { type: "string" description: "The unique ID for this [AdditionalRecipientReceivable](https://developer.squareup.com/reference/square_2021-08-18/objects/AdditionalRecipientReceivable), assigned by the server." } } } } amount_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } card_details: { type: "object" description: "Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD`" properties: { card: { type: "object" description: "Represents the payment details of a card to be used for payments. These\ndetails are determined by the payment token generated by Web Payments SDK." properties: { billing_address: { type: "object" description: "Represents a postal address in a country. The address format is based \non an [open-source library from Google](https://github.com/google/libaddressinput). For more information, \nsee [AddressValidationMetadata](https://github.com/google/libaddressinput/wiki/AddressValidationMetadata). \nThis format has dedicated fields for four address components: postal code, \nlocality (city), administrative district (state, prefecture, or province), and \nsublocality (town or village). These components have dedicated fields in the \n`Address` object because software sometimes behaves differently based on them. \nFor example, sales tax software may charge different amounts of sales tax \nbased on the postal code, and some software is only available in \ncertain states due to compliance reasons.\n\nFor the remaining address components, the `Address` type provides the \n`address_line_1` and `address_line_2` fields for free-form data entry. \nThese fields are free-form because the remaining address components have \ntoo many variations around the world and typical software does not parse \nthese components. These fields enable users to enter anything they want. \n\nNote that, in the current implementation, all other `Address` type fields are blank. \nThese include `address_line_3`, `sublocality_2`, `sublocality_3`, \n`administrative_district_level_2`, `administrative_district_level_3`, \n`first_name`, `last_name`, and `organization`. \n\nWhen it comes to localization, the seller's language preferences \n(see [Language preferences](https://developer.squareup.com/docs/locations-api#location-specific-and-seller-level-language-preferences)) \nare ignored for addresses. Even though Square products (such as Square Point of Sale \nand the Seller Dashboard) mostly use a seller's language preference in \ncommunication, when it comes to addresses, they will use English for a US address, \nJapanese for an address in Japan, and so on." properties: { address_line_1: { type: "string" description: "The first line of the address.\n\nFields that start with `address_line` provide the address's most specific\ndetails, like street number, street name, and building name. They do *not*\nprovide less specific details like city, state/province, or country (these\ndetails are provided in other fields)." } address_line_2: { type: "string" description: "The second line of the address, if any." } address_line_3: { type: "string" description: "The third line of the address, if any." } administrative_district_level_1: { type: "string" description: "A civil entity within the address's country. In the US, this\nis the state." } administrative_district_level_2: { type: "string" description: "A civil entity within the address's `administrative_district_level_1`.\nIn the US, this is the county." } administrative_district_level_3: { type: "string" description: "A civil entity within the address's `administrative_district_level_2`,\nif any." } country: { type: "string" description: "The address's country, in ISO 3166-1-alpha-2 format." } first_name: { type: "string" description: "Optional first name when it's representing recipient." } last_name: { type: "string" description: "Optional last name when it's representing recipient." } locality: { type: "string" description: "The city or town of the address." } organization: { type: "string" description: "Optional organization name when it's representing recipient." } postal_code: { type: "string" description: "The address's postal code." } sublocality: { type: "string" description: "A civil region within the address's `locality`, if any." } sublocality_2: { type: "string" description: "A civil region within the address's `sublocality`, if any." } sublocality_3: { type: "string" description: "A civil region within the address's `sublocality_2`, if any." } } } bin: { type: "string" description: "The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API\nreturns this field." } card_brand: { type: "string" description: "The card's brand." } card_type: { type: "string" description: "The type of the card.\nThe Card object includes this field only in response to Payments API calls." } cardholder_name: { type: "string" description: "The name of the cardholder." } customer_id: { type: "string" description: "The ID of a customer created using the Customers API to be associated with the card." } enabled: { type: "boolean" description: "Indicates whether or not a card can be used for payments." } exp_month: { type: "integer" format: "int64" description: "The expiration month of the associated card as an integer between 1 and 12." } exp_year: { type: "integer" format: "int64" description: "The four-digit year of the card's expiration date." } fingerprint: { type: "string" description: "__Not currently set.__ Intended as a Square-assigned identifier, based\non the card number, to identify the card across multiple locations within a\nsingle application." } id: { type: "string" description: "Unique ID for this card. Generated by Square." } last_4: { type: "string" description: "The last 4 digits of the card number." } prepaid_type: { type: "string" description: "Indicates whether the Card is prepaid or not.\nThe Card object includes this field only in response to Payments API calls." } reference_id: { type: "string" description: "An optional user-defined reference ID that associates this card with\nanother entity in an external system. For example, a customer ID from an\nexternal customer management system." } version: { type: "integer" format: "int64" description: "Current version number of the card. Increments with each card update. Requests to update an\nexisting Card object will be rejected unless the version in the request matches the current\nversion for the Card." } } } entry_method: { type: "string" description: "The method used to enter the card's details for the transaction." } status: { type: "string" description: "The credit card payment's current state (such as `AUTHORIZED` or\n`CAPTURED`). See [TenderCardDetailsStatus](https://developer.squareup.com/reference/square_2021-08-18/objects/TenderCardDetailsStatus)\nfor possible values." } } } cash_details: { type: "object" description: "Represents the details of a tender with `type` `CASH`." properties: { buyer_tendered_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } change_back_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } } } created_at: { type: "string" description: "The timestamp for when the tender was created, in RFC 3339 format." } customer_id: { type: "string" description: "If the tender is associated with a customer or represents a customer's card on file,\nthis is the ID of the associated customer." } id: { type: "string" description: "The tender's unique ID." } location_id: { type: "string" description: "The ID of the transaction's associated location." } note: { type: "string" description: "An optional note associated with the tender at the time of payment." } payment_id: { type: "string" description: "The ID of the [Payment](https://developer.squareup.com/reference/square_2021-08-18/objects/Payment) that corresponds to this tender.\nThis value is only present for payments created with the v2 Payments API." } processing_fee_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } tip_money: { type: "object" description: "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information." properties: { amount: { type: "integer" format: "int64" description: "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case." } currency: { type: "string" description: "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values." } } } transaction_id: { type: "string" description: "The ID of the tender's associated transaction." } type: { type: "string" description: "The type of tender, such as `CARD` or `CASH`." } } } } } } } } }