# Payments ## Retrieve `client.experimental.payments.retrieve(stringpaymentRef, RequestOptionsoptions?): PaymentRetrieveResponse` **get** `/payments/{payment_ref}` Gets a payment by ID or external ID. ### Parameters - `paymentRef: string` Payment ID or external ID. ### Returns - `PaymentRetrieveResponse` - `data: Payment` 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` Associated transaction IDs. - `external_id?: string` User-provided unique ID when the payment was created with one. ### Example ```typescript import Fragment from '@fragment-dev/ts-node'; const client = new Fragment(); const payment = await client.experimental.payments.retrieve('pmt_abc123'); console.log(payment.data); ``` ## Search `client.experimental.payments.search(PaymentSearchParamsbody?, RequestOptionsoptions?): PaymentSearchResponse` **post** `/payments/search` Searches payments. ### Parameters - `body: PaymentSearchParams` - `page_info?: PageInfo` Pagination parameters. - `after?: string` Pagination cursor. - `limit?: number` Maximum number of results. - `payment_flow_id?: string` Filter by payment flow ID. ### Returns - `PaymentSearchResponse` List of payments. - `data: Array` - `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` Associated transaction IDs. - `external_id?: string` User-provided unique ID when the payment was created with one. ### Example ```typescript import Fragment from '@fragment-dev/ts-node'; const client = new Fragment(); const response = await client.experimental.payments.search(); console.log(response.data); ``` ## Domain Types ### Payment - `Payment` 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` Associated transaction IDs. - `external_id?: string` User-provided unique ID when the payment was created with one.