paymentSessions

List payment sessions with filtering and pagination

All payment sessions created with the Create payment session API call can be listed via a GET to /payments/v1/payment_sessions.

By default, all payment sessions, including those that are pending, created as auth holds and those that have been manually voided or captured will be listed. Options are provided for granular filtering, pagination, and search.

Pagination

All results are paginated, with 30 per page. The response field pagination contains information on how many payment sessions there are and how many pages are available for the filtered query.

Sorting

Payment sessions are sorted by the date they are created, with newer ones being returned first.

Response Notes

The response is an array of payment sessions in the payment_sessions key. A few things to point out about the response payload:

  • order_items (Optional) - The list of the current state of the order items passed into create_payment_session if include_order_items is True
    • total_refundable (Optional) - If the Payment Session has been captured, this value will be the remaining amount refundable for this item. Otherwise it will not be included.
    • quantity_refundable (Optional) - If the Payment Session has been captured, this value will be the remaining quantity refundable for this item. Otherwise it will not be included.
    • total_capturable (Optional) - If the Payment Session is an authorization and is currently authorized, this value will be the remaining amount capturable for this item. Otherwise it will not be included.
    • quantity_capturable (Optional) - If the Payment Session is an authorization and is currently authorized, this value will be the remaining quantity capturable for this item. Otherwise it will not be included.
  • authorized_on - the date the payment was authorized in ISO 8601 format
    • example: "2024-06-13T16:03:07.473Z"
    • For kind: one_time_payment, this will be the same as captured_on
  • refund_amount (Optional) - int
    • Only present when summarize_refunds=True is included in the request.
    • The sum of processed refunds for the payment session, in cents
  • truemed_fee (Optional) - decimal - in dollars
    • Only present when include_truemed_fee=True is included in the request.
    • The fee collected by truemed for this payment session.

The response also includes a pagination object:

{
  "pagination": {
    "current_page": 1,
    "page_size": 30,
    "count": 54,
    "last_page": 2
  },
  "payment_sessions": [
    ]
}
  • current_page - the page requested. If none was provided, this will default to 1.
  • page_size - the number of payment_session's per page, which is always 30.
  • count - the total number of payment_session's matching the filters provided.
  • last_page - the last page.
    • You can iterate through pages by providing integers up to last_page in the page parameter.
get/payments/v1/payment_sessions

Request

  • Base URL: https://dev-api.truemed.com
  • URL: https://dev-api.truemed.com/payments/v1/payment_sessions
  • Auth: API key in header x-truemed-api-key

Query parameters

pageinteger

Optional field indicating which page to access. Defaults to 1.

page_sizeinteger

Optional field indicating the number of records per page. Defaults to 30.

filter_pendingboolean

Filter out pending payment sessions.

filter_voidedboolean

Filter out voided payment sessions.

include_metadataboolean

Include metadata field in the response.

include_order_itemsboolean

Include order items in the response.

searchstring

Search by payment session ID, user business ID, email, or name.

created_on_startstring date-time

Filter payment sessions created on or after this date (ISO 8601 format).

created_on_endstring date-time

Filter payment sessions created on or before this date (ISO 8601 format).

captured_on_startstring date-time

Filter payment sessions captured on or after this date (ISO 8601 format).

captured_on_endstring date-time

Filter payment sessions captured on or before this date (ISO 8601 format).

include_refundsboolean

Include refund details in the response (default: true).

include_disputesboolean

Include dispute details in the response (default: true).

kindstring[]

Filter by payment kind (comma-separated list: one_time_payment, authorization).

statusstring[]

Filter by payment session status (comma-separated list).

summarize_refundsboolean

Include refund_amount summary instead of full refund details.

include_truemed_feeboolean

Include Truemed fee in the response.

payment_tokenstring

Filter payment sessions by payment token ID.

Response

Successful response

Changes

No recorded changes to this operation across all 1 revision of this API.