A Transaction in the Paylias network is a fundamental ledger record that reflects the complete movement of funds between two partners. It adheres to double-entry accounting principles, meaning every transaction consists of both a debit and a credit line, ensuring the financial state of all parties remains consistent and auditable. Transactions are system generated and represent the successful culmination of a payment flow whether initiated via a push or pull payment.

Key Characteristics

Every transaction:
  • Is linked to a specific payment via its payment_id
  • Contains one debit and one credit entry in transaction_lines
  • Records lifecycle timestamps for initiation, processing, and settlement
  • Includes optional approval or response codes
  • Reflects real-time status updates and error handling through defined enums

Transaction Fields

FieldTypeDescription
tokenstringUnique identifier for the transaction
transaction_idstringExternal-facing reference for the transaction
payment_idstringID of the related payment
statusenumLifecycle status of the transaction
transaction_linesarrayList of credit/debit entries (see below)
response_codestringOptional processor response code
approval_codestringOptional authorization code
initiated_onintegerTimestamp when the transaction began
processed_onintegerTimestamp when the transaction was processed
settled_onintegerTimestamp when the transaction was settled
expires_onintegerTimestamp when the transaction expires
created_onintegerTimestamp when the transaction was created
updated_onintegerTimestamp of last update

Transaction Lines

Each transaction line captures a single leg of the ledger entry—either a debit or a credit. Lines include:
FieldTypeDescription
tokenstringUnique identifier for this transaction line
transaction_idstringParent transaction
partner_idstringID of the partner associated with this line
directionenumDirection of funds (see below)
transaction_typeenumType of transaction (e.g., payment, refund)
amountobjectObject with currency and total (amount in minor units)

Status Types

EnumValueDescription
TS_INITIATED1Transaction started
TS_PROCESSING2Transaction is being processed
TS_COMPLETED3Successfully completed
TS_FAILED4Failed to complete
TS_REVERSED5Manually or programmatically reversed
TS_EXPIRED6Timed out
TS_RECOVERED7Recovered from a failure

Direction Types

EnumValueDescription
TD_Credit1Funds received
TD_Debit2Funds sent

Transaction Types

EnumValueDescription
TT_PAYMENT1Normal payment transaction
TT_REFUND2Refund transaction
TT_REVERSAL3Payment reversal
TT_FEE4Service or platform fee

Retrieve a Transaction

Fetch details of a specific transaction associated with a payment using the Fetch Transaction endpoint.
curl --request GET \
     --url https://sandbox.paylias.xyz/gateway/api/v1/csp/payments/{payment_id}/transactions/{transaction_id} \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-paylias-api-key: <API-KEY>' \
     --header 'x-org-id: <Org-ID>' \
     --header 'x-partner-id: <Partner-ID>'

Response

{
  "ok": true,
  "data": {
    "approval_code": "123456",
    "created_on": "2023-08-12T08:55:04Z",
    "initiated_on": "2023-08-12T08:55:04Z",
    "payment_id": "pay_123456789",
    "status": 1,
    "token": "trans_123456789",
    "transaction_id": "transaction_123456789",
    "updated_on": "2023-08-12T08:55:04Z",
    "transaction_lines": [
      {
        "amount": {
          "currency": "USD",
          "total": "10000"
        },
        "direction": "TD_Credit",
        "partner_id": "part_abc123",
        "token": "tline_1",
        "transaction_id": "transaction_123456789",
        "transaction_type": "TT_PAYMENT"
      },
      {
        "amount": {
          "currency": "USD",
          "total": "10000"
        },
        "direction": "TD_Debit",
        "partner_id": "part_xyz456",
        "token": "tline_2",
        "transaction_id": "transaction_123456789",
        "transaction_type": "TT_PAYMENT"
      }
    ]
  }
}