Create payment agreement
Creates a payment agreement (a schedule of payments) for an account and sends it to the account holder by SMS, email or both to sign.
Payments start once the account holder signs. Use billing_dates and billing_amounts for an irregular schedule.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
create_payment_planfor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
Your reference for the account (its accountid).
ExampleACC-10045Date of the first payment (YYYY-MM-DD).
Example2026-11-01Number of payments in the plan.
Example6Amount in the account currency.
Example150How often payments are taken.
One ofdailyweeklybiweeklymonthlybimonthlyquarterlyannuallybiannuallyHow the agreement is sent to the account holder to sign.
One ofsmsemailbothPhone number in E.164 or 10-digit US format.
Example5551234567Email address.
Example[email protected]Your DCDial company ID.
Example101Explicit payment dates instead of a schedule, as a JSON array.
Example["2026-11-01","2026-12-01","2027-01-01"]Amounts for each date in billing_dates, as a JSON array.
Example["50.00","50.00","50.00"]
Notes
type=create_payment_agreement is another name for this endpoint and works the same way.
curl https://api.dcdial.com/api/ \ -d type=create_payment_plan \ -d token="$DCDIAL_TOKEN" \ -d account_id=ACC-10045 \ -d billing_start_date=2026-11-01 \ -d total_payments=6 \ -d amount=150 \ -d payment_schedule=daily \ -d communication_method=sms \ -d phone_number=5551234567 \ -d company_id=101<?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' => 'create_payment_plan', 'token' => getenv('DCDIAL_TOKEN'), 'account_id' => 'ACC-10045', 'billing_start_date' => '2026-11-01', 'total_payments' => 6, 'amount' => 150, 'payment_schedule' => 'daily', 'communication_method' => 'sms', 'phone_number' => '5551234567', 'company_id' => 101, ]),]);$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: "create_payment_plan", token: process.env.DCDIAL_TOKEN, account_id: "ACC-10045", billing_start_date: "2026-11-01", total_payments: "6", amount: "150", payment_schedule: "daily", communication_method: "sms", phone_number: "5551234567", company_id: "101", }),});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": "create_payment_plan", "token": os.environ["DCDIAL_TOKEN"], "account_id": "ACC-10045", "billing_start_date": "2026-11-01", "total_payments": 6, "amount": 150, "payment_schedule": "daily", "communication_method": "sms", "phone_number": "5551234567", "company_id": 101, }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "response": { "success": 1, "message": "Payment plan created successfully", "agreement_id": 5521, "agreement_link": "https://pay.dcdial.com/a/Xy12Ab", "account_id": "ACC-10045", "lead_id": "884512" }}Try it