Docs home

Record Payment for Course Enrollment

Records an offline payment (cash, cheque, card, UPI and so on) against one or more of a learner's pending invoices. Use it to sync payments collected outside Edmingle.

POST/invoices/payments
Record Payment for Course Enrollment
curl --request POST \
  --url 'https://<your-api-host>/nuSource/api/v1/invoices/payments' \
  --header 'APIKEY: <your-api-key>' \
  --header 'ORGID: <your-org-id>' \
  --form 'JSONString={"payment_date":1652985000,"mode":6,"ref_no":"Demo","payments":[{"invoice_id":1197,"amount":9,"credits_applied":0},{"invoice_id":1198,"amount":10,"credits_applied":0}],"total_payment":19,"cheque_date":null}'
{
  "code": 200,
  "message": "Success",
  "payment_id": 1805
}

Access: Institute admins and admins, plus custom roles that can manage learners.

Request body: form-data with one field, JSONString, containing this JSON:

BodyJSONString
paymentsarrayrequired
One object per invoice being paid (fields below). All invoices must belong to the same learner's organization and currency.
total_paymentnumberrequired
Sum of amount + credits_applied over all payments. Must match exactly.
modeintegerrequired
Payment mode: 1 Online, 2 Cash, 3 Cheque, 4 Card, 5 Paytm, 6 UPI, 7 Student loan, 8 Net banking, 9 Stripe, 10 PayPal.
payment_dateUnix timestamp
When the money was collected. Default now.
ref_nostring
Transaction or receipt reference.
notesstring
Internal notes.
cheque_idinteger
Cheque record this payment came from. Default 0.
send_emailboolean
false skips the payment receipt email. Default true.
0 skips the payment SMS to the learner and parent. Default 1.

Fields in each payments object:

Name Required Type Description
invoice_id Yes integer Invoice to pay (invoice_id from the learner's purchase details).
amount Yes number Amount paid towards this invoice.
credits_applied No number Wallet credits used towards this invoice. Default 0.
Response200application/json
codeinteger
Example: 200
messagestring
Example: Success
payment_idinteger
Example: 1805

Notes:

  • Errors: "Invalid Payment Mode.", "Payment Amount is pending and can't be left empty.", "Invalid Invoice Id.", "Sum of individual payments not equal to total payment.", "Payment allowed only in one currency at a time.", "Payment allowed only in one branch at a time.", "Amount paid is more than total invoice amount", and "Something went wrong." when an invoice isn't in one of your organizations. Any error cancels the whole payment.
  • Depending on your organization's settings, the learner (and parent) get a payment SMS and a receipt email.
  • Rate limit: 30 requests per minute; going over locks you out for 30 minutes.

Updated yesterday

Ask AI