
# Transaction

Represents a transaction processed with Square, either with the
Connect API or with Square Point of Sale.

The `tenders` field of this object lists all methods of payment used to pay in
the transaction.

## Structure

`Transaction`

## Fields

| Name | Type | Tags | Description |
|  --- | --- | --- | --- |
| `id` | `string \| undefined` | Optional | The transaction's unique ID, issued by Square payments servers.<br>**Constraints**: *Maximum Length*: `192` |
| `locationId` | `string \| null \| undefined` | Optional | The ID of the transaction's associated location.<br>**Constraints**: *Maximum Length*: `50` |
| `createdAt` | `string \| undefined` | Optional | The timestamp for when the transaction was created, in RFC 3339 format.<br>**Constraints**: *Maximum Length*: `32` |
| `tenders` | [`Tender[] \| null \| undefined`](../../doc/models/tender.md) | Optional | The tenders used to pay in the transaction. |
| `refunds` | [`Refund[] \| null \| undefined`](../../doc/models/refund.md) | Optional | Refunds that have been applied to any tender in the transaction. |
| `referenceId` | `string \| null \| undefined` | Optional | If the transaction was created with the [Charge](api-endpoint:Transactions-Charge)<br>endpoint, this value is the same as the value provided for the `reference_id`<br>parameter in the request to that endpoint. Otherwise, it is not set.<br>**Constraints**: *Maximum Length*: `40` |
| `product` | [`string \| undefined`](../../doc/models/transaction-product.md) | Optional | Indicates the Square product used to process a transaction. |
| `clientId` | `string \| null \| undefined` | Optional | If the transaction was created in the Square Point of Sale app, this value<br>is the ID generated for the transaction by Square Point of Sale.<br><br>This ID has no relationship to the transaction's canonical `id`, which is<br>generated by Square's backend servers. This value is generated for bookkeeping<br>purposes, in case the transaction cannot immediately be completed (for example,<br>if the transaction is processed in offline mode).<br><br>It is not currently possible with the Connect API to perform a transaction<br>lookup by this value.<br>**Constraints**: *Maximum Length*: `192` |
| `shippingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.<br>For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). |
| `orderId` | `string \| null \| undefined` | Optional | The order_id is an identifier for the order associated with this transaction, if any.<br>**Constraints**: *Maximum Length*: `192` |

## Example (as JSON)

```json
{
  "id": "id4",
  "location_id": "location_id8",
  "created_at": "created_at8",
  "tenders": [
    {
      "id": "id8",
      "location_id": "location_id2",
      "transaction_id": "transaction_id6",
      "created_at": "created_at6",
      "note": "note4",
      "type": "THIRD_PARTY_CARD"
    },
    {
      "id": "id8",
      "location_id": "location_id2",
      "transaction_id": "transaction_id6",
      "created_at": "created_at6",
      "note": "note4",
      "type": "THIRD_PARTY_CARD"
    },
    {
      "id": "id8",
      "location_id": "location_id2",
      "transaction_id": "transaction_id6",
      "created_at": "created_at6",
      "note": "note4",
      "type": "THIRD_PARTY_CARD"
    }
  ],
  "refunds": [
    {
      "id": "id8",
      "location_id": "location_id2",
      "transaction_id": "transaction_id6",
      "tender_id": "tender_id6",
      "created_at": "created_at6",
      "reason": "reason4",
      "amount_money": {
        "amount": 186,
        "currency": "AUD"
      },
      "status": "PENDING",
      "processing_fee_money": {
        "amount": 112,
        "currency": "DJF"
      },
      "additional_recipients": [
        {
          "location_id": "location_id0",
          "description": "description6",
          "amount_money": {
            "amount": 186,
            "currency": "AUD"
          },
          "receivable_id": "receivable_id6"
        },
        {
          "location_id": "location_id0",
          "description": "description6",
          "amount_money": {
            "amount": 186,
            "currency": "AUD"
          },
          "receivable_id": "receivable_id6"
        }
      ]
    },
    {
      "id": "id8",
      "location_id": "location_id2",
      "transaction_id": "transaction_id6",
      "tender_id": "tender_id6",
      "created_at": "created_at6",
      "reason": "reason4",
      "amount_money": {
        "amount": 186,
        "currency": "AUD"
      },
      "status": "PENDING",
      "processing_fee_money": {
        "amount": 112,
        "currency": "DJF"
      },
      "additional_recipients": [
        {
          "location_id": "location_id0",
          "description": "description6",
          "amount_money": {
            "amount": 186,
            "currency": "AUD"
          },
          "receivable_id": "receivable_id6"
        },
        {
          "location_id": "location_id0",
          "description": "description6",
          "amount_money": {
            "amount": 186,
            "currency": "AUD"
          },
          "receivable_id": "receivable_id6"
        }
      ]
    },
    {
      "id": "id8",
      "location_id": "location_id2",
      "transaction_id": "transaction_id6",
      "tender_id": "tender_id6",
      "created_at": "created_at6",
      "reason": "reason4",
      "amount_money": {
        "amount": 186,
        "currency": "AUD"
      },
      "status": "PENDING",
      "processing_fee_money": {
        "amount": 112,
        "currency": "DJF"
      },
      "additional_recipients": [
        {
          "location_id": "location_id0",
          "description": "description6",
          "amount_money": {
            "amount": 186,
            "currency": "AUD"
          },
          "receivable_id": "receivable_id6"
        },
        {
          "location_id": "location_id0",
          "description": "description6",
          "amount_money": {
            "amount": 186,
            "currency": "AUD"
          },
          "receivable_id": "receivable_id6"
        }
      ]
    }
  ]
}
```

