Skip to content

Retrieve

invoices.retrieve(strid) -> InvoiceRetrieveResponse
GET/invoices/{id}

Gets an invoice by ID with balance details

ParametersExpand Collapse
id: str

Invoice ID

ReturnsExpand Collapse
class InvoiceRetrieveResponse:
data: Data

Invoice with balance details

balances: List[DataBalance]

Invoice-level balances by currency: payins, payouts, and net (payins - payouts)

currency: str

Currency code

net: DataBalanceNet
actual: str

Actual amount (represented as string)

expected: str

Expected amount (represented as string)

remaining: str

Remaining amount (expected - actual, represented as string)

payins: DataBalancePayins
actual: str

Actual amount (represented as string)

expected: str

Expected amount (represented as string)

remaining: str

Remaining amount (expected - actual, represented as string)

payouts: DataBalancePayouts
actual: str

Actual amount (represented as string)

expected: str

Expected amount (represented as string)

remaining: str

Remaining amount (expected - actual, represented as string)

payments: List[DataPayment]

Transaction allocations (payments) associated with this invoice.

amount: str

Amount allocated in smallest currency unit as stringified bigint.

currency: Literal["ADA", "BTC", "DAI", 176 more]

Currency code (ISO 4217 or crypto)

Accepts one of the following:
"ADA"
"BTC"
"DAI"
"ETH"
"SOL"
"USDC"
"USDT"
"USDG"
"EURC"
"CADC"
"CADT"
"XLM"
"UNI"
"BCH"
"LTC"
"AAVE"
"LINK"
"MATIC"
"PTS"
"AED"
"AFN"
"ALL"
"AMD"
"ANG"
"AOA"
"ARS"
"AUD"
"AWG"
"AZN"
"BAM"
"BBD"
"BDT"
"BGN"
"BHD"
"BIF"
"BMD"
"BND"
"BOB"
"BRL"
"BSD"
"BTN"
"BWP"
"BYR"
"BZD"
"CAD"
"CDF"
"CHF"
"CLP"
"CNY"
"COP"
"CRC"
"CUC"
"CUP"
"CVE"
"CZK"
"DJF"
"DKK"
"DOP"
"DZD"
"EGP"
"ERN"
"ETB"
"EUR"
"FJD"
"FKP"
"GBP"
"GEL"
"GGP"
"GHS"
"GIP"
"GMD"
"GNF"
"GTQ"
"GYD"
"HKD"
"HNL"
"HRK"
"HTG"
"HUF"
"IDR"
"ILS"
"IMP"
"INR"
"IQD"
"IRR"
"ISK"
"JMD"
"JOD"
"JPY"
"KES"
"KGS"
"KHR"
"KMF"
"KPW"
"KRW"
"KWD"
"KYD"
"KZT"
"LAK"
"LBP"
"LKR"
"LRD"
"LSL"
"LYD"
"MAD"
"MDL"
"MGA"
"MKD"
"MMK"
"MNT"
"MOP"
"MUR"
"MVR"
"MWK"
"MXN"
"MYR"
"MZN"
"NAD"
"NGN"
"NIO"
"NOK"
"NPR"
"NZD"
"OMR"
"PAB"
"PEN"
"PGK"
"PHP"
"PKR"
"PLN"
"PYG"
"QAR"
"RON"
"RSD"
"RUB"
"RWF"
"SAR"
"SBD"
"SCR"
"SDG"
"SEK"
"SGD"
"SHP"
"SLL"
"SOS"
"SPL"
"SRD"
"SVC"
"SYP"
"STN"
"SZL"
"THB"
"TJS"
"TMT"
"TND"
"TOP"
"TRY"
"TTD"
"TVD"
"TWD"
"TZS"
"UAH"
"UGX"
"USD"
"UYU"
"UZS"
"VEF"
"VND"
"VUV"
"WST"
"XAF"
"XCD"
"XOF"
"XPF"
"YER"
"ZAR"
"ZMW"
"LOGICAL"
"CUSTOM"
posted: datetime

Posted timestamp of the parent transaction in ISO 8601 format.

formatdate-time
transaction: DataPaymentTransaction

Reference to a transaction by encoded ID and external ID.

id: str

Encoded transaction ID.

external_id: str

External transaction ID.

tags: List[DataPaymentTransactionTag]

Metadata tags from the parent transaction.

key: str

Tag key

value: str

Tag value

type: Literal["payin", "payout"]

The type of the payment.

Accepts one of the following:
"payin"
"payout"
user: DataPaymentUser

User reference in API responses: Fragment user id and external_id.

id: str

FRAGMENT generated ID of the user

external_id: str

External ID of the user

users: List[DataUser]

Users/parties involved in the invoice

id: str

User/party ID

balances: List[DataUserBalance]

Per-currency balance breakdown for this user

currency: str

Currency code

net: DataUserBalanceNet
actual: str

Actual amount (represented as string)

expected: str

Expected amount (represented as string)

remaining: str

Remaining amount (expected - actual, represented as string)

payins: DataUserBalancePayins
actual: str

Actual amount (represented as string)

expected: str

Expected amount (represented as string)

remaining: str

Remaining amount (expected - actual, represented as string)

payouts: DataUserBalancePayouts
actual: str

Actual amount (represented as string)

expected: str

Expected amount (represented as string)

remaining: str

Remaining amount (expected - actual, represented as string)

Retrieve

from fragment import Fragment

client = Fragment()
invoice = client.invoices.retrieve(
    "inv_1234567890",
)
print(invoice.data)
{
  "data": {
    "id": "inv_1234567890",
    "created": "2024-01-13T00:00:00Z",
    "status": "active",
    "tags": [
      {
        "key": "region",
        "value": "us-east"
      }
    ],
    "version": 1,
    "workspace_id": "ws_1234567890",
    "line_items": [
      {
        "id": "item_1234567890",
        "amount": "1000",
        "currency_code": "USD",
        "description": "Professional services for January 2026",
        "price": {
          "amount": "1000",
          "quantity": 1,
          "unit_price": "1000"
        },
        "product_id": "prod_1234567890",
        "tags": [
          {
            "key": "region",
            "value": "us-east"
          }
        ],
        "type": "payout",
        "user_id": "user_ext_456"
      }
    ],
    "modified": "2024-01-13T00:00:00Z",
    "balances": [
      {
        "currency": "USD",
        "net": {
          "actual": "5000",
          "expected": "10000",
          "remaining": "5000"
        },
        "payins": {
          "actual": "5000",
          "expected": "10000",
          "remaining": "5000"
        },
        "payouts": {
          "actual": "5000",
          "expected": "10000",
          "remaining": "5000"
        }
      }
    ],
    "payments": [
      {
        "amount": "150",
        "currency": "USD",
        "posted": "2026-02-12T00:00:00.000Z",
        "transaction": {
          "id": "txn_dHhuX2ZyYWdfMDAx",
          "external_id": "bank_txn_123",
          "tags": [
            {
              "key": "region",
              "value": "us-east"
            }
          ]
        },
        "type": "payin",
        "user": {
          "id": "user_abc123",
          "external_id": "user-ext-001"
        }
      }
    ],
    "users": [
      {
        "id": "user_ext_789",
        "balances": [
          {
            "currency": "USD",
            "net": {
              "actual": "5000",
              "expected": "10000",
              "remaining": "5000"
            },
            "payins": {
              "actual": "5000",
              "expected": "10000",
              "remaining": "5000"
            },
            "payouts": {
              "actual": "5000",
              "expected": "10000",
              "remaining": "5000"
            }
          }
        ]
      }
    ]
  }
}
Returns Examples
{
  "data": {
    "id": "inv_1234567890",
    "created": "2024-01-13T00:00:00Z",
    "status": "active",
    "tags": [
      {
        "key": "region",
        "value": "us-east"
      }
    ],
    "version": 1,
    "workspace_id": "ws_1234567890",
    "line_items": [
      {
        "id": "item_1234567890",
        "amount": "1000",
        "currency_code": "USD",
        "description": "Professional services for January 2026",
        "price": {
          "amount": "1000",
          "quantity": 1,
          "unit_price": "1000"
        },
        "product_id": "prod_1234567890",
        "tags": [
          {
            "key": "region",
            "value": "us-east"
          }
        ],
        "type": "payout",
        "user_id": "user_ext_456"
      }
    ],
    "modified": "2024-01-13T00:00:00Z",
    "balances": [
      {
        "currency": "USD",
        "net": {
          "actual": "5000",
          "expected": "10000",
          "remaining": "5000"
        },
        "payins": {
          "actual": "5000",
          "expected": "10000",
          "remaining": "5000"
        },
        "payouts": {
          "actual": "5000",
          "expected": "10000",
          "remaining": "5000"
        }
      }
    ],
    "payments": [
      {
        "amount": "150",
        "currency": "USD",
        "posted": "2026-02-12T00:00:00.000Z",
        "transaction": {
          "id": "txn_dHhuX2ZyYWdfMDAx",
          "external_id": "bank_txn_123",
          "tags": [
            {
              "key": "region",
              "value": "us-east"
            }
          ]
        },
        "type": "payin",
        "user": {
          "id": "user_abc123",
          "external_id": "user-ext-001"
        }
      }
    ],
    "users": [
      {
        "id": "user_ext_789",
        "balances": [
          {
            "currency": "USD",
            "net": {
              "actual": "5000",
              "expected": "10000",
              "remaining": "5000"
            },
            "payins": {
              "actual": "5000",
              "expected": "10000",
              "remaining": "5000"
            },
            "payouts": {
              "actual": "5000",
              "expected": "10000",
              "remaining": "5000"
            }
          }
        ]
      }
    ]
  }
}