Challanwala logo
Challanwala
Challanwala API Docs
Endpoints

Create Payment Link

Create a payment link from challans returned by challan search.

POST/api/v1/staging/payment-links

Create 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_number is required.
  • Provide exactly one of challan_ids or challan_numbers.
  • A maximum of 100 challans can be included in one payment link.
  • If expiry_time is omitted, the payment link expires after 48 hours by default.
  • expiry_time must be a whole number between 24 and 168 hours.
  • Only challans in PENDING or TO_BE_ASSIGNED status can be included.
Request body
FieldTypeRequiredDescription
vehicle_numberstringRequiredVehicle registration number associated with the selected challans.
challan_idsuuid[]OptionalUse this or challan_numbers, but not both.
challan_numbersstring[]OptionalUse this or challan_ids, but not both.
expiry_timenumberOptionalOptional 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
FieldTypeRequiredDescription
data.iduuidRequiredPayment link identifier used by the status endpoint.
data.statusstringRequiredCurrent payment-link status.
data.paymentUrlstring | nullOptionalPublic payment page URL that can be shared with the payer.
data.expiresAtdatetime | nullOptionalExpiration timestamp for the link. When expiry_time is omitted, this is 48 hours from creation time.
data.paidAtdatetime | nullOptionalPayment completion timestamp when the link has been paid.
data.amountobjectRequiredAggregated amount breakdown for the default link configuration.
data.paymentModeOptionsobject[]RequiredAmount breakdown per supported payment mode.
data.challansobject[]RequiredThe 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.

On this page