Skip to content

Retrieve

client.experimental.payments.retrieve(stringpaymentRef, RequestOptionsoptions?): PaymentRetrieveResponse { data }
GET/payments/{payment_ref}

Gets a payment by ID or external ID.

ParametersExpand Collapse
paymentRef: string

Payment ID or external ID.

ReturnsExpand Collapse
PaymentRetrieveResponse { data }
data: Payment { id, amount, created, 8 more }

Payment object.

id: string

FRAGMENT generated unique ID.

amount: string

Amount in smallest currency unit.

created: string

Timestamp when the payment was created.

currency: string

Currency code.

direction: string

Direction of the payment.

modified: string

Timestamp when the payment was last modified.

payment_account_id: string

Payment account ID.

payment_flow_id: string

Payment flow ID.

status: string

Status of the payment.

transaction_ids: Array<string>

Associated transaction IDs.

external_id?: string

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

Retrieve

import Fragment from '@fragment-dev/ts-node';

const client = new Fragment();

const payment = await client.experimental.payments.retrieve('pmt_abc123');

console.log(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"
  }
}