Skip to main content
POST
/
billing
/
embed-payment
/
{patient_id}
Create Embed Payment Config
curl --request POST \
  --url https://api.decodahealth.com/billing/embed-payment/{patient_id} \
  --header 'API-KEY: <api-key>' \
  --header 'TENANT: <tenant>'
{
  "sessionKey": "<string>",
  "payinConfigId": "<string>",
  "sandbox": true,
  "patient": {
    "id": "<string>",
    "firstName": "<string>",
    "lastName": "<string>"
  },
  "fee": 0
}
Creates a payin configuration for the embedded payment component. Use this when your website needs to collect a payment from a patient inside an iframe.

Two modes

Simple amount

Pass amount_cents for a single, flat payment. The embed shows a “Custom Amount” line item.
POST /billing/embed-payment/{patient_id}?amount_cents=5000&is_surcharged=true

Itemized charge (items and discounts)

Pass charge_id to use a pre-created charge with line items, discounts, and taxes. The embed displays the full charge breakdown.
POST /billing/embed-payment/{patient_id}?charge_id=chg_xxx&is_surcharged=true
You must create the charge first via the Create Charge or Convert Cart to Charge API. See Payment Embed: Itemized Charges for the full flow.

Embed URL parameters

The embed page (/embed/pay/{patientId}) accepts these query parameters:
ParameterDescription
amountPayment amount in cents (required when charge_id is not used)
charge_id or chargeIdPre-created charge ID for itemized charges
allowedMethods or allowed_methodsComma-separated payment methods: CARD, ACH, APPLE_PAY. Use CARD to disable ACH.
themelight or dark
showSummarytrue (default) or false to hide the payment summary header

Response

When charge_id is used, the response includes a charge object with items, totalOutstanding, and totalDiscount for display in your UI.

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Path Parameters

patient_id
string
required

Query Parameters

amount_cents
integer
required
is_surcharged
boolean
default:true

Response

Successful Response

Response schema for embed payment configuration.

sessionKey
string
required
payinConfigId
string
required
sandbox
boolean
required
patient
PublicPatient · object
required
fee
integer
default:0