Endpoints
Create Payment Link
Create a payment link from challans returned by challan search.
POST
/api/v1/staging/payment-linksCreate a public payment URL for one vehicle's challans. This endpoint is intended to be called after challan search, once you know which challans the payment link should include.
Base URL
https://cms-staging.challanwala.com
Authentication
Bearer YOUR_API_SECRET
Access gate
Requires the Payment Link Generation service to be enabled for your organization.
Request rules
- Call challan search first so the vehicle and challans are available to your organization.
vehicle_numberis required.- Provide exactly one of
challan_idsorchallan_numbers. - A maximum of 100 challans can be included in one payment link.
- If
expiry_timeis omitted, the payment link expires after 48 hours by default. expiry_timemust be a whole number between 24 and 168 hours.- Only challans in
PENDINGorTO_BE_ASSIGNEDstatus can be included.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| vehicle_number | string | Required | Vehicle registration number associated with the selected challans. |
| challan_ids | uuid[] | Optional | Use this or challan_numbers, but not both. |
| challan_numbers | string[] | Optional | Use this or challan_ids, but not both. |
| expiry_time | number | Optional | Optional link lifetime in hours. If omitted, the default is 48 hours. Accepted values are 24 through 168. |
cURL request
curl --request POST 'https://cms-staging.challanwala.com/api/v1/staging/payment-links' \ --header 'Authorization: Bearer YOUR_API_SECRET' \ --header 'Content-Type: application/json' \ --data '{"vehicle_number": "DL01AB1234","challan_ids": [ "8cb4fb9a-88eb-4d5c-b484-e857a90a8b71", "b2ef5129-cdf8-48b9-afd0-b6ca0fe9ddad"],"expiry_time": 48}'JavaScript request
const response = await fetch('https://cms-staging.challanwala.com/api/v1/staging/payment-links', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_SECRET', 'Content-Type': 'application/json', }, body: JSON.stringify({vehicle_number: 'DL01AB1234',challan_ids: [ '8cb4fb9a-88eb-4d5c-b484-e857a90a8b71', 'b2ef5129-cdf8-48b9-afd0-b6ca0fe9ddad',],expiry_time: 48,}),});const data = await response.json();console.log(data);Example response
{"success": true,"data": { "id": "17de2557-58d6-4f8d-aa2b-fb60074c6a6d", "status": "ACTIVE", "organization": { "id": "bf4cc07b-d395-456a-8aac-e419d9ef10ff", "name": "North Fleet Operations" }, "paymentUrl": "https://cms.challanwala.com/prepaid-payment/ppl_6e1f65f4f7a04ebd9d8cbff62853d4f3", "expiresAt": "2026-05-15T14:20:00.000Z", "paidAt": null, "amount": { "baseAmount": 1500, "legalFee": 100, "gst": 18, "convenienceFee": 0, "totalAmount": 1618 }, "paymentModeOptions": [ { "baseAmount": 1500, "legalFee": 100, "gst": 18, "convenienceFee": 0, "totalAmount": 1618, "paymentMode": "UPI" }, { "baseAmount": 1500, "legalFee": 100, "gst": 18, "convenienceFee": 40.45, "totalAmount": 1658.45, "paymentMode": "CREDIT_CARD" } ], "challans": [ { "id": "8cb4fb9a-88eb-4d5c-b484-e857a90a8b71", "challanNo": "DL-TRF-101299", "rcNumber": "DL01AB1234", "status": "PENDING", "challanType": "ONLINE", "state": "Delhi", "challanAmount": 500, "legalFee": 50, "totalAmount": 550 }, { "id": "b2ef5129-cdf8-48b9-afd0-b6ca0fe9ddad", "challanNo": "DL-TRF-101300", "rcNumber": "DL01AB1234", "status": "TO_BE_ASSIGNED", "challanType": "ONLINE", "state": "Delhi", "challanAmount": 1000, "legalFee": 50, "totalAmount": 1050 } ]}}Stable response fields
| Field | Type | Required | Description |
|---|---|---|---|
| data.id | uuid | Required | Payment link identifier used by the status endpoint. |
| data.status | string | Required | Current payment-link status. |
| data.paymentUrl | string | null | Optional | Public payment page URL that can be shared with the payer. |
| data.expiresAt | datetime | null | Optional | Expiration timestamp for the link. When expiry_time is omitted, this is 48 hours from creation time. |
| data.paidAt | datetime | null | Optional | Payment completion timestamp when the link has been paid. |
| data.amount | object | Required | Aggregated amount breakdown for the default link configuration. |
| data.paymentModeOptions | object[] | Required | Amount breakdown per supported payment mode. |
| data.challans | object[] | Required | The challans included in the payment link. |
400
Invalid payment link request
The request body is malformed, includes both challan selectors, or uses an invalid expiry value.
404
Vehicle or challans not found
The vehicle must already be available to your organization from challan search, and every selected challan must belong to that vehicle.
409
Vehicle belongs elsewhere or cannot be paid
This includes deleted vehicles, non-payable challan states, or selected challans that already have an active payment link.
429
Daily limit exceeded
The organization has reached its daily payment-link generation allowance.
