v1

latestOpenAPI 3.0.3raw.githubusercontent.com2024-10-2916802.4 MB
🛒 Ecommerce

Verify razorpay payment

The API handles the verification of a Razorpay payment.

Once a user completes the payment, this API receives the Razorpay generated order credentials after payment (razorpay_payment_id, razorpay_order_id, razorpay_signature).

It then verifies the payment using the provided credentials and marks the corresponding order as paid if the received credentials are valid.

This API ensures secure and reliable payment processing, enabling the system to accurately track and manage paid orders.

post/ecommerce/orders/provider/razorpay/verify-payment

Request body

razorpay_order_idstring
razorpay_payment_idstring
razorpay_signaturestring

Example request

{
  "razorpay_order_id": "order_LyeEiwrtVj1rLh",
  "razorpay_payment_id": "pay_LyeHd4Puzr6c8h",
  "razorpay_signature": "b1fea28efbca9a5090b60c4f2b5ffabd9b651d2da8c543eaf86a703a7f598c3d"
}

Response

Verify razorpay payment

messagestring
statusCodenumber
successboolean

Example response

{
  "data": {
    "_id": "647f2e2014428a0fcb7fab38",
    "address": "647f2e0114428a0fcb7fab17",
    "createdAt": "2023-06-06T13:01:20.319Z",
    "customer": "647f20c1df9a47b425084b0b",
    "isPaymentDone": true,
    "items": [
      {
        "_id": "647f2e1314428a0fcb7fab25",
        "productId": "647f2a9146f36a6dc01ec5ba",
        "quantity": 3
      },
      {
        "_id": "647f2e1714428a0fcb7fab2f",
        "productId": "647f2a9d46f36a6dc01ec5bf",
        "quantity": 3
      }
    ],
    "orderPrice": 15600,
    "paymentId": "pay_LyeHd4Puzr6c8h",
    "paymentProvider": "RAZORPAY",
    "status": "PENDING",
    "updatedAt": "2023-06-06T13:01:20.319Z"
  },
  "message": "Order placed successfully",
  "statusCode": 201,
  "success": true
}