ZezoPay Docs

Checkout

"Payment gateway integration into your application"

✍️ Naresh Dhamu

📅 02/03/2025

Checkout

Checkout a New Payment Request

API Endpoint

URL: https://payapi.zezo.in/api/v1/payments/checkout

Method: POST

Headers:

  • Content-Type: application/json

  • api-key: {your_api_key}

  • secret-key: {your_secret_key}

Request Body

Data Constraints

The request body should include the necessary details for creating a payment request.

{
  "userId": "[userId in string format]", // required
  "price": "[price in number format]", // required
  "provider": "[provider in string format]", // required (stripe, razorpay, phonepe, ccavenue)
  "metadata": {
    "isPaymentInitiatedEnabled": true,
    "userInfo": {
      "name": "[name in string format]", // required
      "email": "[email in string format]" // required
    }
  }
}

Example Request

{
  "userId": "66d2e734c67cf10fd3b46b86",
  "price": 200,
  "provider": "stripe",
  "metadata": {
    "isPaymentInitiatedEnabled": true,
    "userInfo": {
      "name": "John Doe",
      "email": "john.doe@example.com"
    }
  }
}

Success Response

Code : 200 OK

Example Response

{
  "price": 200,
  "currency": "INR",
  "provider": "stripe",
  "real_price": 200,
  "orderId": "23456789",
  "publicKey": "123243566767899",
  "status": true
}

Error Responses

400 Bad Request Error

Code : 400 Bad Request

Example Response

{
  "error": {
    "type": "BadRequestError",
    "msg": "message",
    "path": "",
    "location": ""
  }
}

401 Unauthorized

Code : 401 Unauthorized

Example Response

{
  "error": {
    "type": "UnauthorizedError",
    "status": 401,
    "message": "error message",
    "path": "",
    "location": ""
  }
}

500 Internal Server Error

Code : 500 Internal Server Error

Example Response

{
  "error": {
    "type": "InternalServerError",
    "status": 500,
    "message": "error message",
    "path": "",
    "location": ""
  }
}