Skip to main content

Payouts

Use the payouts endpoint to review the amounts that are expected to be routed to your pharmacy for paid physical-prescription orders, and the amounts that were actually routed after completed orders. The endpoint only returns payouts where the requested pharmacy is the payment receiver. With a single-pharmacy API key, this is your current pharmacy. With a group-wide API key, this is the pharmacy selected by pharmacy_uid.
Actual payment routing happens only when the pharmacy order is completed. projected payouts are indicative previews for paid physical-prescription orders based on the current order values and routing configuration, and can change before completion. routed payout values are populated only after the completed order has a persisted split-payment route.

List Payouts

GET /v1/external-pharmacy-api-v1/payouts
Requires the orders_read permission.
pharmacy_uid
string
Required for group-wide API keys. Single-pharmacy API keys are automatically scoped to their pharmacy.
status
string
Filter by payout status. Accepted values are projected and routed.
Search term. Matches pharmacy_order_uid, pharmacy_order_name, routed payout provider_route_id, and routing_description.
start_date
integer
Unix timestamp for the start of the date range. For routed rows, this filters by routing_created_at. For projected rows, this filters by pharmacy_order_created_at.
end_date
integer
Unix timestamp for the end of the date range. For routed rows, this filters by routing_created_at. For projected rows, this filters by pharmacy_order_created_at.
sort_by
string
default:"pharmacy_order_created_at"
Field used for sorting. Accepted values are pharmacy_order_created_at, routing_created_at, and amount.
sort_direction
string
default:"desc"
Sort direction. Accepted values are asc and desc.
page
integer
default:"0"
Page number (0-indexed).
limit
integer
default:"50"
Number of items per page.

Statuses

StatusDescription
projectedIndicative preview for a paid physical-prescription order based on current order values and routing configuration. This can change before the order is completed.
routedPersisted split-payment route created after pharmacy order completion. These values represent the routed amount recorded by RxScale.

Example Request

curl -X GET "https://api.rxscale.com/v1/external-pharmacy-api-v1/payouts?pharmacy_uid=ph-xyz&start_date=1711843200&end_date=1714521599&page=0&limit=20" \
  -H "X-API-Key: your-api-key-here"

Response

{
  "data": [
    {
      "status": "routed",
      "amount": 1299,
      "currency": "EUR",
      "component_type": "item_rest",
      "routing_description": "Medication X 100mg rest amount",
      "provider_route_id": "rt_abc123",
      "pharmacy_order_uid": "po-abc123",
      "pharmacy_order_name": "#1001",
      "pharmacy_order_created_at": 1711899000,
      "routing_created_at": 1711985400
    },
    {
      "status": "routed",
      "amount": 250,
      "currency": "EUR",
      "component_type": "item_markup",
      "routing_description": "Medication X 100mg markup",
      "provider_route_id": "rt_def456",
      "pharmacy_order_uid": "po-abc123",
      "pharmacy_order_name": "#1001",
      "pharmacy_order_created_at": 1711899000,
      "routing_created_at": 1711985400
    },
    {
      "status": "projected",
      "amount": 499,
      "currency": "EUR",
      "component_type": "shipping",
      "routing_description": "DHL Standard",
      "provider_route_id": null,
      "pharmacy_order_uid": "po-def456",
      "pharmacy_order_name": "#1002",
      "pharmacy_order_created_at": 1711981200,
      "routing_created_at": null
    }
  ],
  "totalRegistries": 3,
  "totalPages": 1
}

Response Fields

data
array
Payout rows for the requested page.
data[].status
string
projected for indicative payouts on paid physical-prescription orders, or routed for persisted routes created after order completion.
data[].amount
integer
Payout amount in cents, for example 1299 for EUR 12.99.
data[].currency
string
ISO 4217 currency code, for example EUR.
data[].component_type
string
The payout component, such as item_rest, item_markup, or shipping.
data[].routing_description
string | null
Human-readable description of the routed or projected component.
data[].provider_route_id
string | null
Payment provider route identifier. This is populated for routed payouts when the provider returned an identifier, and null for projected payouts.
data[].pharmacy_order_uid
string
UID of the related pharmacy order.
data[].pharmacy_order_name
string | null
Human-readable pharmacy order name, for example #1001.
data[].pharmacy_order_created_at
integer
Unix timestamp when the pharmacy order was created.
data[].routing_created_at
integer | null
Unix timestamp when the split-payment route was created. This is null for projected payouts and populated for routed payouts.
totalRegistries
integer
Total number of payout rows matching the filters.
totalPages
integer
Total number of pages available for the current limit.