Docs home

Payment Verification for Course

Checks a Razorpay checkout result after the learner pays, by verifying Razorpay's signature. Call it from your checkout page with the three values Razorpay returns, to confirm the payment is genuine before showing success.

POST/razorpay/verify
Payment Verification for Course
curl --request POST \
  --url 'https://<your-api-host>/nuSource/api/v1/razorpay/verify' \
  --header 'APIKEY: <your-api-key>' \
  --header 'ORGID: <your-org-id>' \
  --form 'JSONString={"razorpay_payment_id":"pay_JWxtLSDiXiAsSv","razorpay_order_id":"order_JWxiUS9BUQ2UWE","razorpay_signature":"bff8c8fc89141489128511b7ec6efdb3d07cfd8b88b39e7b79a1efec0e803f78"}'
{
  "code": 200,
  "message": "Success",
  "part_id": 5667,
  "payment_id": 4420,
  "masterbatch": {
    "master_batch_id": 1144,
    "class_ids": "1872"
  }
}

Access: Public, no API key.

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

BodyJSONString
razorpay_payment_idstringrequired
Payment ID from Razorpay checkout (pay_...).
razorpay_order_idstringrequired
Order ID from Razorpay checkout (order_...), or the subscription ID (sub_...) for an auto-debit subscription.
razorpay_signaturestringrequired
Signature from Razorpay checkout.
Response200application/json
codeinteger
Example: 200
messagestring
Example: Success
part_idinteger
Instalment ID
Example: 5667
payment_idinteger
Example: 4420
Show child attributesHide child attributes
Example: 1144
The batch the learner was enrolled in
Example: 1872

Notes: The signature is checked with the Razorpay account of the organization that created the order. A wrong signature, or a payment ID Edmingle doesn't know, returns "Invalid Signature". This call only verifies; the payment itself is recorded from Razorpay's notification to Edmingle.

Updated yesterday

Ask AI