Skip to content

Retrieve

experimental.payments.retrieve(strpayment_ref) -> PaymentRetrieveResponse
GET/payments/{payment_ref}

Gets a payment by ID or external ID.

ParametersExpand Collapse
payment_ref: str

Payment ID or external ID.

ReturnsExpand Collapse
class PaymentRetrieveResponse:
data: Payment

Payment object.

id: str

FRAGMENT generated unique ID.

amount: str

Amount in smallest currency unit.

created: str

Timestamp when the payment was created.

currency: str

Currency code.

direction: str

Direction of the payment.

modified: str

Timestamp when the payment was last modified.

payment_account_id: str

Payment account ID.

payment_flow_id: str

Payment flow ID.

status: str

Status of the payment.

transaction_ids: List[str]

Associated transaction IDs.

external_id: Optional[str]

User-provided unique ID when the payment was created with one.

Retrieve

from fragment import Fragment

client = Fragment()
payment = client.experimental.payments.retrieve(
    "pmt_abc123",
)
print(payment.data)
{
  "data": {
    "id": "pmt_abc123",
    "amount": "10000",
    "created": "2024-01-01T00:00:00.000Z",
    "currency": "USD",
    "direction": "payin",
    "modified": "2024-01-01T00:00:00.000Z",
    "payment_account_id": "pmt_account_abc123",
    "payment_flow_id": "pf_xyz789",
    "status": "settled",
    "transaction_ids": [
      "txn_abc123"
    ],
    "external_id": "pmt_ext_123"
  }
}
Returns Examples
{
  "data": {
    "id": "pmt_abc123",
    "amount": "10000",
    "created": "2024-01-01T00:00:00.000Z",
    "currency": "USD",
    "direction": "payin",
    "modified": "2024-01-01T00:00:00.000Z",
    "payment_account_id": "pmt_account_abc123",
    "payment_flow_id": "pf_xyz789",
    "status": "settled",
    "transaction_ids": [
      "txn_abc123"
    ],
    "external_id": "pmt_ext_123"
  }
}