Skip to main content
POST
/
billing
/
payment-terminal
/
charge-card
/
{payment_method_id}
Charge Payment Method
curl --request POST \
  --url https://api.decodahealth.com/billing/payment-terminal/charge-card/{payment_method_id} \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "payinConfigId": "<string>"
}
'
{
  "payinId": "<string>",
  "amount": 123,
  "status": "<string>",
  "authCode": "<string>"
}

Request body

Send JSON with the Rainforest pay-in configuration id (not your Decoda charge id):
{
  "payinConfigId": "payin_cfg_xxxxxxxx"
}
FieldRequiredDescription
payinConfigIdYesValue returned by POST /billing/payment-terminal/payin-config as payinConfigId. This ties the charge to Rainforest’s pay-in flow. It is not the same as chargeId / chg_….

Two-step flow

  1. Create a pay-in config for the outstanding charge(s) — same payload shape as the in-app terminal: POST /billing/payment-terminal/payin-config Include the charge(s) (e.g. full ChargeSummary objects), paymentMedium, merchantAccountId as required by that endpoint. The response includes payinConfigId (and often sessionKey for browser components; for server-side charge-card you only need payinConfigId).
  2. Charge the saved cardPOST /billing/payment-terminal/charge-card/{paymentMethodId} Path: Decoda paymentMethodId (e.g. pm_… from the store-details embed). Body: { "payinConfigId": "<from step 1>" }.
If payinConfigId is missing or wrong, Rainforest may respond with an error such as “Field is required” — that refers to the pay-in config id in their API, not chargeId or amount on this endpoint.

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Path Parameters

payment_method_id
string
required

Body

application/json
payinConfigId
string
required

From POST /billing/payment-terminal/payin-config (not the Decoda charge id).

Response

Successful Response

payinId
string
required
amount
integer
required
status
string
required
authCode
string | null