API Documentation

Complete guide to integrate PayMe 2D Gateway into your application. Follow these simple steps to start accepting payments.

Getting Started

Welcome to PayMe 2D Gateway API documentation. This guide will help you integrate our payment gateway into your application quickly and securely.

Base URL

https://api.payme2d.com/v1

Authentication

All API requests require authentication using your API key. Include it in the request header:

Authorization: Bearer YOUR_API_KEY

API Key Location

You can find your API keys in your Client Dashboard under the "API Keys" section. Keep your secret key secure and never share it publicly.

Create Payment

POST /payments/create

Create a new payment request for your customer

Request Parameters

Parameter Type Required Description
amount number Required Payment amount in INR
currency string Optional Currency code (default: INR)
customer_name string Required Customer's full name
customer_email string Required Customer's email address
customer_phone string Optional Customer's phone number
description string Optional Payment description
callback_url string Optional URL to redirect after payment

Example Request

curl -X POST https://api.payme2d.com/v1/payments/create \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1000,
    "currency": "INR",
    "customer_name": "John Doe",
    "customer_email": "john@example.com",
    "customer_phone": "+91 9876543210",
    "description": "Product Purchase",
    "callback_url": "https://yoursite.com/callback"
  }'

Example Response

{
  "success": true,
  "payment_id": "pay_abc123xyz",
  "payment_url": "https://payme2d.com/pay/abc123xyz",
  "amount": 1000,
  "currency": "INR",
  "status": "pending",
  "created_at": "2025-10-05T10:30:00Z"
}

Success Response

On successful payment creation, you'll receive a payment_url that you should redirect your customer to for completing the payment.

Get Payment Status

GET /payments/{payment_id}

Retrieve the current status of a payment

Example Request

curl -X GET https://api.payme2d.com/v1/payments/pay_abc123xyz \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "success": true,
  "payment_id": "pay_abc123xyz",
  "amount": 1000,
  "currency": "INR",
  "status": "success",
  "customer_name": "John Doe",
  "customer_email": "john@example.com",
  "created_at": "2025-10-05T10:30:00Z",
  "completed_at": "2025-10-05T10:32:15Z"
}

Payment Status Values

pending: Payment initiated but not completed
success: Payment completed successfully
failed: Payment failed
refunded: Payment has been refunded

Refund Payment

POST /payments/{payment_id}/refund

Initiate a refund for a completed payment

Request Parameters

Parameter Type Required Description
amount number Optional Refund amount (default: full amount)
reason string Optional Reason for refund

Example Request

curl -X POST https://api.payme2d.com/v1/payments/pay_abc123xyz/refund \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1000,
    "reason": "Customer request"
  }'

Example Response

{
  "success": true,
  "refund_id": "ref_xyz789abc",
  "payment_id": "pay_abc123xyz",
  "amount": 1000,
  "status": "processing",
  "created_at": "2025-10-05T11:00:00Z"
}

Refund Processing Time

Refunds typically take 5-7 business days to reflect in the customer's account. The actual time may vary depending on the payment method and bank.

Webhooks

PayMe 2D Gateway sends webhook notifications for payment events. Configure your webhook URL in the dashboard settings to receive real-time updates.

Webhook Events

Event Description
payment.success Payment completed successfully
payment.failed Payment failed
refund.processed Refund processed successfully

Webhook Payload Example

{
  "event": "payment.success",
  "payment_id": "pay_abc123xyz",
  "amount": 1000,
  "currency": "INR",
  "customer_email": "john@example.com",
  "timestamp": "2025-10-05T10:32:15Z"
}

Webhook Security

All webhook requests include a signature in the X-PayMe2D-Signature header. Verify this signature to ensure the webhook is from PayMe 2D Gateway.

Error Codes

PayMe 2D Gateway uses standard HTTP response codes to indicate the success or failure of API requests.

400
Bad Request - Invalid parameters provided
401
Unauthorized - Invalid or missing API key
404
Not Found - Requested resource doesn't exist
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error - Something went wrong

Error Response Format

{
  "success": false,
  "error": {
    "code": "invalid_request",
    "message": "Amount must be greater than 0",
    "param": "amount"
  }
}

Need Help?

If you have any questions or need assistance with the integration, our support team is here to help!

Contact Support

Email: support@payme2d.com
Response Time: Within 24 hours
Live Chat: Available in your dashboard