Process a payment
Charges a card or bank account now, once or on a recurring schedule.
Needs a payment processor set up in DCDial. Prefer payment links, which keep card data off your servers.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
charge_customerfor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
Your reference for the account (its accountid).
ExampleACC-10045Amount in the account currency.
Example150Card (CC) or bank account (ACH).
One ofCCACHPhone number in E.164 or 10-digit US format.
Example5551234567Your DCDial company ID.
Example101Username of the agent taking the payment.
Examplejane.agentCurrency of the payment.
One ofUSDGBPFirst name.
ExampleJaneLast name.
ExampleDoeDescription shown on the receipt.
Card number. Required when payment_method=CC.
Example4242424242424242Card expiry date (MMYY). Required when payment_method=CC.
Example1229Card security code. Required when payment_method=CC.
Example123Name on the card. Required when payment_method=CC.
ExampleJane DoeBank routing number. Required when payment_method=ACH.
Example110000000Bank account number. Required when payment_method=ACH.
Example000123456789Bank name. Required when payment_method=ACH.
ExampleExample BankName on the bank account. Required when payment_method=ACH.
ExampleJane DoeStreet address.
City.
ZIP code.
Y to set up recurring payments with start_date and total_payments.
One ofYNDate of the first recurring payment (YYYY-MM-DD). Required when isrecurring=Y.
Example2026-10-01Number of recurring payments. Required when isrecurring=Y.
Example6Billing address line 1.
Billing address line 2.
Billing city.
Billing ZIP code.
Billing state.
Billing country.
Email for the receipt.
curl https://api.dcdial.com/api/ \ -d type=charge_customer \ -d token="$DCDIAL_TOKEN" \ -d account_id=ACC-10045 \ -d amount=150 \ -d payment_method=CC \ -d phone_number=5551234567 \ -d company_id=101 \ -d agent=jane.agent \ -d currency_code=USD \ -d first_name=Jane \ -d last_name=Doe<?php$ch = curl_init('https://api.dcdial.com/api/');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => http_build_query([ 'type' => 'charge_customer', 'token' => getenv('DCDIAL_TOKEN'), 'account_id' => 'ACC-10045', 'amount' => 150, 'payment_method' => 'CC', 'phone_number' => '5551234567', 'company_id' => 101, 'agent' => 'jane.agent', 'currency_code' => 'USD', 'first_name' => 'Jane', 'last_name' => 'Doe', ]),]);$result = json_decode(curl_exec($ch), true);curl_close($ch);
if (($result['response']['success'] ?? 0) != 1) { throw new RuntimeException($result['response']['error'] ?? 'Request failed');}const res = await fetch('https://api.dcdial.com/api/', { method: 'POST', body: new URLSearchParams({ type: "charge_customer", token: process.env.DCDIAL_TOKEN, account_id: "ACC-10045", amount: "150", payment_method: "CC", phone_number: "5551234567", company_id: "101", agent: "jane.agent", currency_code: "USD", first_name: "Jane", last_name: "Doe", }),});const { response } = await res.json();if (response.success != 1) throw new Error(response.error);import osimport requests
r = requests.post( "https://api.dcdial.com/api/", data={ "type": "charge_customer", "token": os.environ["DCDIAL_TOKEN"], "account_id": "ACC-10045", "amount": 150, "payment_method": "CC", "phone_number": "5551234567", "company_id": 101, "agent": "jane.agent", "currency_code": "USD", "first_name": "Jane", "last_name": "Doe", }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "response": { "approved": 1, "transaction_id": "ch_3Q8x2e", "invoice_id": 88812, "message": "Payment approved" }}Try it