# Add Beneficiary
Source: https://docs.paytring.com/api-reference/endpoint/add-beneficiary
POST /api/v2/payout/beneficiary/create
This API is used to add a new beneficiary to the payout system.
### Request Body
```json theme={null}
{
"name": "string", // Beneficiary name
"email": "string", // Beneficiary email
"phone": "string", // Beneficiary phone number
"vpa": "string", // Virtual Payment Address (VPA)
"account": {
"account_no": "string", // Account number
"ifsc": "string" // IFSC code
}
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"beneficiary_id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# ADHOC Charge
Source: https://docs.paytring.com/api-reference/endpoint/adhoc-charge
POST /api/v2/subscription/adhoc
in case of an SI ( standing Instructions ) this api can be used to charge end users accounts as per merchant needs.
This API is used to charge end users' accounts as per merchant needs in case of standing instructions (SI).
### Request Body
```json theme={null}
{
"key": "string", // Merchant key
"id": "string", // Subscription ID
"amount": "string", // Amount in cents/paisa
"currency": "string", // 3-character currency code
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"transaction": {
"id": "string",
"amount": 200,
"currency": "SGD",
"status": "success",
"payment_attempt_at": "string"
},
"request_id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "string",
"code": 400
}
}
```
# Cancel Payment
Source: https://docs.paytring.com/api-reference/endpoint/cancel
POST /api/v2/order/cancel
This API allows you to cancel the authorized payment of a previously authorized order.
This API is used to cancel a payment for a specific order.
### Request Body
```json theme={null}
{
"key": "string", // Merchant API key
"id": "string", // Payment ID
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"message": "Payment cancelled successfully",
"id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Cancel Subscription
Source: https://docs.paytring.com/api-reference/endpoint/cancel-subscription
POST /api/v1/subscription/cancel
This API is used to cancel an existing subscription.
### Request Body
```json theme={null}
{
"subscription_id": "string", // ID of the subscription to cancel
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"message": "Subscription canceled successfully"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Capture Payment
Source: https://docs.paytring.com/api-reference/endpoint/capture
POST /api/v2/order/capture
This API allows you to capture the authorized payment of a previously created order.
This API is used to capture a payment for a specific order after authorization.
### Request Body
```json theme={null}
{
"key": "string", // Merchant API key
"id": "string", // Payment ID
"amount": 100, // Amount to capture
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"message": "Payment captured successfully",
"id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Check Payout Accounts Balance
Source: https://docs.paytring.com/api-reference/endpoint/check-payout-accounts-balance
POST /api/v2/payout/balance
This APi get you your account balance of each pg., or a specific one.
This API retrieves the account balance for all payment gateways or a specific one.
### Request Body
```json theme={null}
{
"pg": "string" // Optional: Specify the payment gateway to fetch balance for
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"balances": [
{
"pg": "string",
"balance": 1000.00
}
]
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Create Payout
Source: https://docs.paytring.com/api-reference/endpoint/create-payout
POST /api/v2/payout/create
Send money to accounts or via imps , rtgs or upi transfer
This API is used to initiate a payout to accounts via IMPS, RTGS, or UPI transfer.
### Request Body
```json theme={null}
{
"pg": "string", // Payment gateway (e.g., 'decentro')
"method": "string", // Transfer method (e.g., 'upi', 'imps')
"account_number": "string", // Account number to be debited
"beneficiary_id": "string", // Beneficiary ID
"pg_pool_id": "string", // Paytring pool ID
"receipt_id": "string", // Receipt ID
"amount": "string", // Amount to transfer
"notes": "object" // Additional notes
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"payment_status": "success",
"message": "Amount transferred successfully",
"transfer_id": "XXXXXXXXXXXXX"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Hash not verified.",
"code": 158
}
}
```
# Create Plan
Source: https://docs.paytring.com/api-reference/endpoint/create-plan
POST /api/v1/subscription/plan/create
This API is used to create a subscription plan.
### Request Body
```json theme={null}
{
"name": "string", // Name of the subscription plan
"amount": "integer", // Amount in cents/paisa
"currency": "string", // Currency code (e.g., USD, INR)
"interval": "string", // Billing interval (e.g., monthly, yearly)
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"plan_id": "string",
"message": "Plan created successfully"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Create Subscription
Source: https://docs.paytring.com/api-reference/endpoint/create-subscription
POST /api/v1/subscription/create
This API is used to create a new subscription for a customer.
### Request Body
```json theme={null}
{
"customer_id": "string", // ID of the customer
"plan_id": "string", // ID of the subscription plan
"start_date": "string", // Start date of the subscription
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"subscription_id": "string",
"message": "Subscription created successfully"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Create Vendor
Source: https://docs.paytring.com/api-reference/endpoint/create-vendor
POST /vendor/create
The API provides a means for merchants or administrators to add new vendors to the system with essential details.
The API provides a means for merchants or administrators to add new vendors to the system with essential details.
### Request Body
```json theme={null}
{
"vendor_id": "string", // Provided by merchant
"name": "string", // Vendor name (no special characters other than space)
"email": "string", // Valid email address
"phone": "string", // Vendor phone number (optional)
"upi_id": "string", // Vendor UPI ID (optional)
"bank_details": {
"account_no": "string", // Bank account number
"ifsc_code": "string" // Bank IFSC code
}
}
```
### Responses
#### 200 OK
```json theme={null}
{
"success": true,
"message": "Vendor added successfully",
"vendor_id": "string",
"id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Currency Conversion
Source: https://docs.paytring.com/api-reference/endpoint/currency-conversion
POST /api/v1/currency/get
This API is used to convert one currency to another.
### Request Body
```json theme={null}
{
"key": "string", // Merchant key
"hash": "string", // Calculated hash for request validation
"from": "string", // Base currency code
"to": "string" // Target currency code
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"conversion_rate": "number", // Conversion rate between the currencies
"converted_amount": "number" // Converted amount
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "string", // Error message
"code": 400 // Error code
}
}
```
# Fetch Order by ID
Source: https://docs.paytring.com/api-reference/endpoint/fetch
POST /api/v2/order/fetch
This API allows you to retrieve details of a previously created order.
This API allows you to retrieve details of a previously created order.
### Request Body
```json theme={null}
{
"key": "test_123", // Merchant API key
"id": "string", // Order ID
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"order": {
"order_id": "string",
"amount": 100,
"currency": "INR",
"status": "success",
"card_last_4": "6005",
"card_issuer": "amex"
}
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Fetch All Accounts
Source: https://docs.paytring.com/api-reference/endpoint/fetch-accounts
POST /api/v2/payout/accounts
This API retrieves all accounts associated with the payout system.
### Request Body
```json theme={null}
{
"pg": "string" // Optional: Specify the payment gateway to fetch accounts for
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"accounts": [
{
"pg": "string",
"account_id": "string",
"balance": 1000.00
}
]
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Fetch Beneficiary
Source: https://docs.paytring.com/api-reference/endpoint/fetch-beneficiary
POST /api/v2/payout/beneficiary/fetch
This API retrieves details of a specific beneficiary.
### Request Body
```json theme={null}
{
"id": "string" // Beneficiary ID received in response to the Add Beneficiary API
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"beneficiary": {
"name": "string",
"email": "string",
"phone": "string",
"vpa": "string",
"account": {
"account_no": "string",
"ifsc": "string"
}
}
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Fetch by Date
Source: https://docs.paytring.com/api-reference/endpoint/fetch-by-date
POST /api/v2/settlement/fetch
This API allows you to fetch settlement details by date.
### Request Body
```json theme={null}
{
"key": "string", // Merchant key, available in dashboard profile section
"date": "string", // The date you want to fetch settlements for (format: YYYY-MM-DD)
"pg": "string", // Payment gateway code (optional)
"offset": "string", // Starting point for results (optional)
"limit": "string" // Maximum number of records to return (optional)
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"data": [
{
"order_id": null,
"pg_transaction_id": "string",
"order_date": "string",
"utr": "string",
"settlement_date": "string",
"order_status": "string",
"pg_status": "string",
"payment_mode": "string",
"amount": 0,
"settled_amount": 0
}
],
"is_last_page": false,
"request_id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Fetch Payout Status
Source: https://docs.paytring.com/api-reference/endpoint/fetch-payout
POST /api/v2/payout/fetch
Check status of a payout created via paytring
This API is used to check the status of a payout created via Paytring.
### Request Body
```json theme={null}
{
"id": "string", // Payout ID received in response on create payout API
"fetch_type": "string" // Option to do a hard pull of info directly from PG when required (e.g., 'normal', 'advance')
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"payout": {
"transfer_status": "boolean",
"error": "string",
"transfer_id": "string",
"ut_no": "null",
"amount": 111,
"fund_source": "Cashfree",
"method": "neft",
"processed_at": "2020-12-16 09:17:42",
"transfer_status": "failed",
"beneficiary": {
"name": "Preetam",
"email": "preetam@mcsam.in",
"phone": "7027445661",
"vpa": "7027445661@paytm",
"account": {
"account_no": "917027445660",
"ifsc": "PYTM0123456"
}
},
"ack": ""
}
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error_code": "int",
"error_message": "string"
}
```
# Fetch Plan
Source: https://docs.paytring.com/api-reference/endpoint/fetch-plan
POST /api/v1/subscription/plan/fetch
This API is used to fetch details of a subscription plan.
### Request Body
```json theme={null}
{
"plan_id": "string", // ID of the subscription plan to fetch
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"plan": {
"id": "string",
"name": "string",
"amount": "integer",
"currency": "string",
"interval": "string"
},
"message": "Plan fetched successfully"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Fetch Subscription
Source: https://docs.paytring.com/api-reference/endpoint/fetch-subscription
POST /api/v1/subscription/subscription/fetch
This API is used to fetch details of an existing subscription.
### Request Body
```json theme={null}
{
"subscription_id": "string", // ID of the subscription to fetch
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"subscription": {
"id": "string",
"status": "string",
"plan": {
"id": "string",
"name": "string",
"amount": "integer",
"currency": "string",
"interval": "string"
}
},
"message": "Subscription fetched successfully"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Fetch Subscription By Receipt ID
Source: https://docs.paytring.com/api-reference/endpoint/fetch-subscription-by-receipt-id
POST /api/v1/subscription/subscription/fetch/receipt
This API is used to fetch subscription details using the receipt ID.
### Request Body
```json theme={null}
{
"key": "string", // Merchant key, available in dashboard profile section
"id": "string", // Merchant reference subscription ID (receipt ID)
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"subscription": {
"subscription_id": "string",
"mer_reference_id": "string",
"amount": 500,
"currency": "USD",
"subscription_status": "active",
"pg": "string",
"customer": {
"name": "string",
"email": "string",
"phone": "string"
}
},
"request_id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "string",
"code": 400
}
}
```
# Payment Methods
Source: https://docs.paytring.com/api-reference/endpoint/method
POST /api/v2/info/payment/methods
It includes fetch methods for payment data.
This API retrieves the list of available payment methods for a merchant.
### Request Parameters
* `key` (string): Merchant API key
* `hash` (string): Calculated hash for request validation
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"methods": [
{
"id": "string",
"name": "Credit Card",
"type": "card"
},
{
"id": "string",
"name": "Net Banking",
"type": "bank"
}
]
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Create Order
Source: https://docs.paytring.com/api-reference/endpoint/order
POST /api/v2/order/create
This API is used to initiate a payment request for a specific order.
This API is used to initiate a payment request for a specific order.
### Request Body
```json theme={null}
{
"email": "string", // End User Email
"callback_url": "https://httpbin.org/post", // Default callback URL
"currency": "INR", // Default currency
"pg": "string", // Payment gateway code (optional)
"pg_pool_id": "string", // Payment gateway pool ID (optional)
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"order_id": "string",
"message": "Order created successfully"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Process Order
Source: https://docs.paytring.com/api-reference/endpoint/process-order
POST /api/v1/order/process
This api can be used to process transaction without opening paytring checkout , also known as seamless api or custom checkout api
This API is used to process an order for payment after it has been created.
### Request Body
```json theme={null}
{
"key": "string", // Merchant API key
"order_id": "string", // Order ID
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"message": "Order processed successfully",
"transaction_id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Refund Order
Source: https://docs.paytring.com/api-reference/endpoint/refund
POST /api/v2/order/refund
This API can trigger refund for any order of any pg.
This API can trigger a refund for any order of any payment gateway.
### Request Body
```json theme={null}
{
"key": "string", // Merchant API key
"id": "string", // Order ID
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"message": "Refund has been initiated",
"id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Refund Attempts
Source: https://docs.paytring.com/api-reference/endpoint/refund-attempts
POST /api/v2/order/refund/attempts
This takes an order id and returns all associated refunds with that Order ID.
This API retrieves the list of refund attempts for a specific order.
### Request Parameters
* `key` (string): Merchant API key
* `order_id` (string): Order ID
* `hash` (string): Calculated hash for request validation
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"refund_attempts": [
{
"attempt_id": "string",
"status": "processed",
"amount": 50
},
{
"attempt_id": "string",
"status": "failed",
"amount": 30
}
]
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Partial Refund
Source: https://docs.paytring.com/api-reference/endpoint/refund-partial
POST /api/v2/order/refund/partial
This API can trigger partial refund for any order of any pg.
This API is used to initiate a partial refund for a specific order.
### Request Body
```json theme={null}
{
"key": "string", // Merchant API key
"order_id": "string", // Order ID
"amount": 50, // Amount to refund
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"message": "Partial refund initiated successfully",
"refund_id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Refund Status
Source: https://docs.paytring.com/api-reference/endpoint/refund-status
POST /api/v2/order/refund/fetch
The refund status is tracked via the Refund ID
This API retrieves the status of a refund for a specific order.
### Request Parameters
* `key` (string): Merchant API key
* `refund_id` (string): Refund ID
* `hash` (string): Calculated hash for request validation
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"refund_status": "processed",
"refund_id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Split Settlement
Source: https://docs.paytring.com/api-reference/endpoint/split-settlement
POST /api/v2/order/split-settlement
This API allows you to split settlements for an order.
### Request Body
```json theme={null}
{
"key": "string", // Merchant key, available in dashboard profile section
"order_id": "string", // Order ID for which settlement is to be split
"split_details": [
{
"vendor_id": "string", // Vendor ID
"amount": "string" // Amount to be settled (in paise/cents)
}
]
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"message": "Settlement split successfully",
"split_id": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid request",
"code": 400
}
}
```
# Validate Card
Source: https://docs.paytring.com/api-reference/endpoint/validate-card
POST /api/v1/info/bin
This api is for merchants integrating order process api and want to check if customer provided vpa is valid or not.
This API is used to validate card details before initiating a transaction.
### Request Body
```json theme={null}
{
"key": "string", // Merchant API key
"card_number": "string", // Card number
"expiry_date": "string", // Card expiry date in MM/YY format
"cvv": "string", // Card CVV
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"message": "Card is valid",
"card_type": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid card details",
"code": 400
}
}
```
# Validate VPA
Source: https://docs.paytring.com/api-reference/endpoint/validate-vpa
POST /api/v1/info/vpa
This api is for merchants integrating order process api and want to check if customer provided vpa is valid or not.
This API is used to validate a Virtual Payment Address (VPA) for UPI transactions.
### Request Body
```json theme={null}
{
"key": "string", // Merchant API key
"vpa": "string", // Virtual Payment Address
"hash": "string" // Calculated hash for request validation
}
```
### Responses
#### 200 OK
```json theme={null}
{
"status": true,
"message": "VPA is valid",
"vpa": "string"
}
```
#### 400 Bad Request
```json theme={null}
{
"status": false,
"error": {
"message": "Invalid VPA",
"code": 400
}
}
```
# Create Webhook
Source: https://docs.paytring.com/api-reference/endpoint/webhook-v2-create
POST /api/v2/webhook/create
Create a new webhook endpoint to receive notifications for specific events.
Create a new webhook endpoint to receive notifications for specific events.
### Body Parameters
The URL where notifications will be sent.
List of event types to subscribe to (e.g., `["order.paid", "order.failed"]`).
(Optional) Set to `true` to enable the webhook immediately (Default: `true`).
### Sample Request
```bash theme={null}
curl --location 'https://api.paytring.com/api/v2/webhook/create' \
--user ':' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://your-domain.com/webhook",
"topics": ["order.paid"],
"active": true
}'
```
# Fetch Webhook Details
Source: https://docs.paytring.com/api-reference/endpoint/webhook-v2-fetch
POST /api/v2/webhook/{id}/update
Retrieve configuration details for a specific webhook endpoint.
Retrieve configuration details for a specific webhook endpoint.
> \[!NOTE]
> The URL for fetching details uses `{id}/update` but uses the `POST` method.
### Path Parameters
The unique ID of the webhook.
### Sample Request
```bash theme={null}
curl --location 'https://api.paytring.com/api/v2/webhook/wh_12345/update' \
--user ':'
```
### Sample Response
```json theme={null}
{
"status": true,
"data": {
"id": "wh_12345",
"url": "https://your-domain.com/webhook",
"topics": ["order.paid"],
"status": "active",
"created_at": "2024-01-22T01:29:50Z"
}
}
```
# List Webhooks
Source: https://docs.paytring.com/api-reference/endpoint/webhook-v2-list
POST /api/v2/webhook/list
Fetch a list of all webhook endpoints associated with your merchant account.
Fetch a list of all webhook endpoints associated with your merchant account.
### Body Parameters
(Optional) Filter webhooks by status (`true` for active, `false` for inactive).
### Response
Indicates if the request was successful.
List of webhook endpoints.
### Sample Request
```bash theme={null}
curl --location 'https://api.paytring.com/api/v2/webhook/list' \
--user ':' \
--header 'Content-Type: application/json' \
--data '{
"active": true
}'
```
### Sample Response
```json theme={null}
{
"status": true,
"data": [
{
"id": "wh_12345",
"url": "https://your-domain.com/webhook",
"topics": ["order.paid", "order.failed"],
"status": "active",
"created_at": "2024-01-22T01:29:50Z"
}
]
}
```
# List Topics
Source: https://docs.paytring.com/api-reference/endpoint/webhook-v2-topics
POST /api/v2/webhook/topics
Retrieve a list of all available webhook event types (topics) that you can subscribe to.
Retrieve a list of all available webhook event types (topics) that you can subscribe to.
### Sample Request
```bash theme={null}
curl --location 'https://api.paytring.com/api/v2/webhook/topics' \
--user ':'
```
### Sample Response
```json theme={null}
{
"status": true,
"data": [
{
"name": "order.paid",
"description": "Triggered when an order is successfully paid."
},
{
"name": "order.failed",
"description": "Triggered when a payment attempt fails."
}
]
}
```
# Update Webhook
Source: https://docs.paytring.com/api-reference/endpoint/webhook-v2-update
POST /api/v2/webhook/{id}
Modify an existing webhook endpoint's configuration.
Modify an existing webhook endpoint's configuration.
### Path Parameters
The unique ID of the webhook.
### Body Parameters
(Optional) The new URL.
(Optional) Updated list of event types.
(Optional) Set to `false` to deactivate.
### Sample Request
```bash theme={null}
curl --location 'https://api.paytring.com/api/v2/webhook/wh_12345' \
--user ':' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://new-domain.com/webhook",
"active": false
}'
```
# Authentication
Source: https://docs.paytring.com/api-reference/introduction
Learn how to authenticate and secure API requests using Paytring.
### Authentication
All API endpoints are authenticated using Bearer tokens. The token must be included in the `Authorization` header of each request.
You can generate this token using Basic Authentication with your API key and secret:
```javascript theme={null}
const basicAuthToken = btoa(`${API_KEY}:${API_SECRET}`);
```
### Hashing
`hash value can be "none" for v2 API`
Hashing is a process of generating a unique value or a fixed-length string representation of data. This technique is used to store and retrieve data more efficiently and securely. Below is the explanation of how to create a hash for v1 and v2 APIs.
#### How to Create a Hash?
Follow these steps to create a hash:
1. **Sort all the parameters.**
2. **Join all the parameter string values using a `|` sign.**
3. **Append the key secret at the end.**
4. **Convert this string into a hash using the `SHA512()` function.**
#### Example Code
```javascript theme={null}
const params = {
amount: "100",
currency: "INR",
callback_url: "https://httpbin.org/post",
cname: "John Doe",
email: "johndoe@email.com",
key: "YOUR_API_KEY",
phone: "8930395227",
receipt_id: "TXN0438400150988993",
notes: {
udf1: "udf1",
udf2: "udf2"
},
};
// Step 1: Sort the object
const sortedParams = Object.keys(params).sort().reduce((accumulator, key) => {
accumulator[key] = params[key];
return accumulator;
}, {});
// Step 2: Join all string values with |
let valueString = "";
const allValues = Object.values(sortedParams);
for (let i = 0; i < allValues.length; i++) {
if (typeof allValues[i] !== "object") {
valueString += allValues[i] + "|";
}
}
// Step 3: Append key secret
valueString += "API_SECRET";
// Step 4: Create hash and add to the params
const hash = CryptoJS.SHA512(valueString).toString();
params.hash = hash;
```
### Steps to Create a Hash
1. **Sort all the parameters.**
* Skip all object values.
2. **Join all the string values using a `|` sign.**
3. **Add `KEY_SECRET` at the end of the string.**
4. **Convert this string into a hash using the `SHA512()` function.**
# Development
Source: https://docs.paytring.com/development
Preview changes locally to update your docs
## Payment Popup
If you wish to integrate Paytring's JS / iframe checkout into your platform, follow the steps outlined below.
### 1. Include Paytring Iframe JavaScript Library
Include the Paytring Iframe JavaScript library by adding the following CDN link to your HTML file:
```html theme={null}
```
### 2. Creating an Order
After including the Paytring Iframe library, you can create an order and initiate the iframe checkout. Use the following JavaScript code:
```javascript theme={null}
// Define a function to be executed if the transaction fails
async function fail_handle(order_id) {
// This function executes if the transaction fails
// You will receive the order id as an argument
// You can use the Fetch API to check order details
}
// Define a function to be executed if the transaction is successful
async function success_handle(order_id) {
// This function executes if the transaction is successful
// You will receive the order id as an argument
// You can use the Fetch API to check order details
}
// Define a function to log events
async function event_happen(resp) {
console.log("Event Name: " + resp.event_name);
console.log("Event Value: " + resp.event_value);
}
// Define a function to handle popup closure
async function on_close(order_id) {
// This function executes if the popup is closed
// You will receive the order id as an argument
// You can use the Fetch API to check order details
}
// Define options for the Paytring Iframe
var options = {
"order_id": response.order_id, // Replace with the order id you received when creating the order
"success": success_handle,
"failed": fail_handle,
"events": event_happen, // Executes on various events, such as payment option selection or proceeding with payment
"onClose": on_close
// optional parameters
"zIndex": 99999 // optional parameter to set z-index of the iframe
};
// Create an instance of the Paytring class with the specified options
const paytring = new Paytring(options);
// Open the Paytring Iframe
paytring.open();
```
#### Explanation
1. **fail\_handle Function**:
* This function is a callback that will be executed if the transaction fails.
* It receives the `order_id` as an argument, allowing you to handle and log information about failed transactions.
* You can use the Fetch API or other methods to check and retrieve details about the failed order.
2. **success\_handle Function**:
* This function is a callback that will be executed if the transaction is successful.
* Similar to `fail_handle`, it receives the `order_id` as an argument.
* You can use the Fetch API or other methods to check and retrieve details about the successful order.
3. **event\_happen Function**:
* This function is a callback that logs events related to the Paytring Iframe.
* It logs the event name and event value to the console.
* The function is intended to be used for debugging and monitoring purposes.
4. **on\_close Function**:
* This function is a callback that will be executed if the popup is closed for any reason.
* Similar to other callback functions, it receives the `order_id` as an argument.
* You can use the Fetch API or other methods to check and retrieve details about the order.
5. **options Object**:
* An object that holds various options for configuring the Paytring Iframe.
* It includes the `order_id` received when creating the order, success and failed callback functions, and an events callback for logging events.
* The `order_id` is mandatory, while the other parameters (`success`, `failed`, and `events`) are optional.
6. **Paytring Instance**:
* Creates an instance of the Paytring class with the specified options.
7. **Open Iframe**:
* The `open()` method is called on the Paytring instance, which opens the Paytring Iframe for the user to complete the payment.
* Ensure that you replace `response.order_id` with the actual order id obtained from your order creation process. The provided callbacks (`fail_handle`, `success_handle`, and `event_happen`) allow you to customize how your application handles different aspects of the payment process.
### 3. Handling Events
If you prefer not to pass callback functions directly in the options, you can alternatively use event handling to capture specific events during the iframe checkout process. This approach allows you to receive notifications for various actions, such as successful payments (`payment.success`), failed transactions (`payment.failed`), and the user closing the iframe before completing the transaction (`payment.close`).
#### Event Handling Example
To capture events, you can utilize the following code:
* **Failed Event**
```javascript theme={null}
document.addEventListener("payment.failed", (e) => {
// This code block executes when the payment transaction fails
console.log("Payment Failed order id:", e.detail.order_id);
});
```
* **Success Event**
```javascript theme={null}
document.addEventListener("payment.success", (e) => {
// This code block executes when the payment transaction is successful
// You can add your custom logic here
console.log("Payment Successful order id:", e.detail.order_id);
});
```
* **Close Event**
```javascript theme={null}
document.addEventListener("payment.close", (e) => {
// This event is triggered when the user closes the iframe before completing the transaction
console.log("Iframe closed for order id:", e.detail.order_id);
});
```
If you prefer using these events, you don't need to pass functions in the options. Simply use the following code:
```javascript theme={null}
var options = {
"order_id": response.order_id, // Replace with the order id you received when creating the order
};
const paytring = new Paytring(options);
// Open Iframe
paytring.open();
```
## Payment Callback Request
| Param | Datatype | Sample Value |
| :---------- | :------- | :------------------------------------------------------------------------------------------------------------------------------- |
| order\_id | string | 488659548274428965 |
| receipt\_id | string | TXN01071200893 |
| hash | string | ceb38f5bfba8ba190754d6cadd7af58b845406010b01aa297e10b145ca45da8f9eb1632d814158d0e88c15cc78ccc8e0a8661ae93c8a7f2356432e2b25fada65 |
Above is a sample of a request in Form Data Format. We strongly suggest you perform a lookup of the transaction in your database with the given details and fetch the order using the "**Fetch by Order ID**" API endpoint before updating your database.
## Payment Webhook Request
```json theme={null}
{
"key": "test_123",
"receipt_id": "HYD2245637",
"hash": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
```
Above is a sample of a request in JSON format. We strongly suggest you verify the hash, fetch the transaction, and perform a lookup of the transaction in your database with the given details before updating your database.
# Introduction
Source: https://docs.paytring.com/introduction
Paytring is a universal, feature-rich payment orchestration platform designed for online businesses and payment institutions. Our platform integrates payment providers and acquirers to bring a unified communication, control, and management interface.
## Products
All the guides & references you’ll need to integrate and build with Paytring.
Learn how to edit and customize your Paytring documentation to suit your needs.
Preview your documentation changes to ensure accuracy and consistency.
Tailor the appearance of your documentation to align with your brand identity.
Access comprehensive API documentation to integrate Paytring seamlessly.
Enhance your documentation with interactive components and reusable snippets.
Explore examples and best practices to create outstanding documentation.
# Platform SDK
Source: https://docs.paytring.com/plugins/integration
Integrate with any platform using our SDK.
You can find the SDK at the following link:
[Download the SDK's](https://sdk.paytring.com)
# Magento
Source: https://docs.paytring.com/plugins/magento
Integrate with Magento using our SDK.
# How to install Magento plugin on your shop?
### Step 1: Upload the Extension
1. Connect with Magento server via FTP/SFTP.
2. Navigate to root directory where Magento is installed.
3. You can upload the plugin `.zip` file directly to the Magento root directory via FTP/SFTP, then extract it to magento root > app > code > Quick. Please make sure that you have extracted the zip in Quick folder.
### Step 2: Install the Extension
1. Open the Magento root directory via SSH or terminal.
2. Run the following commands to install the extension:
```bash theme={null}
php bin/magento module:enable Quick_QuickCheckout
php bin/magento module:enable Quick_Api
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
```
3. Clear the Magento cache using the command:
```bash theme={null}
php bin/magento cache:clean
```
4. Navigate back to the **Magento Admin Panel** and refresh the page.
### Step 3: Configure the Extension
1. Navigate to **Stores > Configuration** from the sidebar.

2. Scroll down to sales tab and go to **Sales > Payment Methods**

3. Look for the n**ewly added module** in the list of payment methods.
### Step 4: Update Configuration Settings
1. Update the configurations as per your requirements.
2. Enter your API keys and other required details.
3. Save the configuration by clicking the **Save Config** button.
That's it! This is how you can successfully install the payment module on your Magento shop. 🎉
# OpenCart
Source: https://docs.paytring.com/plugins/opencart
Integrate with OpenCart using our SDK.
# How to install OpenCart plugin on your shop?
### Step 1: Upload the Extension
1. Log in to the OpenCart admin panel.
2. Navigate to **Extension > Installer** from the sidebar.
3. Click the **Upload** icon in the top-right corner.

1. Upload the `quick.ocmod.zip` file. Please make sure, plugin zip file name should be same, if not please rename it to **quick.ocmod.zip**
### Step 2: Install the Extension
1. After uploading the file, click on the **Install** button.

### Step 3: Enable the Extension
1. Go to the **Extensions** section from the sidebar.
2. Locate the newly added extension inside payments category and click on the **Install** button.

### Step 4: Configure the Extension
1. Once installed, click on the **Edit** button (pencil icon) next to the **Install** button.
2. Update the configurations as per your requirements.
3. Click the **Save** button to apply changes.
That's it! This is how you can successfully install the payment plugin on your OpenCart shop. 🎉
# PrestaShop
Source: https://docs.paytring.com/plugins/prestashop
Integrate with PrestaShop using our SDK.
# How to install PrestaShop plugin on your shop?
### Step 1: Upload the Module
1. Log in to the PrestaShop admin panel.
2. Navigate to Modules **> Module Manager** from the sidebar.
3. Click the **Upload a module** button in the top-right corner.

1. Upload the plugin `.zip` file.
### Step 2: Install the Module
After successful uploading the module will be automatically installed on your shop and you will get direct option to configure the module

Or you can use the below steps to configure the same. You can use the below method if module not showing configure option and asking to install
1. Scroll down to the payments section and look for newly added Module.
2. Click on the **Install** button.

### Step 3: Configure the Module
1. Once installed, click on the Configure button now to configure the keys.

1. Update the configurations as per your requirements.
2. Click the **Save** button to apply changes.
That's it! This is how you can successfully install the payment module on your Prestashop shop. 🎉
# WooCommerce
Source: https://docs.paytring.com/plugins/woocommerce
Integrate with WooCommerce using our SDK.
# How to install WooCommerce plugin on your shop?
### Step 1: Upload the Plugin
1. Log in to the WordPress admin panel.
2. Navigate to **Plugins > Add New** from the sidebar.

3. Click the **Upload Plugin** button in the top-left corner.

4. Upload the plugin `.zip` file.
### Step 2: Activate the Plugin
Once the plugin is successfully uploaded, click the **Activate Plugin** button

Alternatively, navigate to **Plugins > Installed Plugins**, locate the newly added **Plugin**, and click **Activate**.
### Step 3: Configure the Plugin
1. Navigate to **WooCommerce > Settings** from the sidebar.

2. Click on the **Payments** tab.
3. Locate newly added plugin in the list of payment methods and click on the **Manage** button next to it.

### Step 3: Update Configuration Settings
1. Update the configurations as per your requirements.
2. Click the **Save** button to apply changes.
That's it! This is how you can successfully install the payment plugin on your WordPress shop. 🎉
# 🛒 Abandoned Checkout Webhook
Source: https://docs.paytring.com/quick/abandoned-checkout
Notifies external servers when a customer leaves the checkout process without completing their purchase.
## 📘 Overview
When a checkout is considered "abandoned," the system captures the cart state, user details, and sends this information to configured external endpoints. This allows for automated recovery campaigns (e.g., via email or WhatsApp) with thrid party apps..
## 🚀 Webhook Payload (JSON)
### Field Specifications
| Field | Type | Description |
| :------------- | :----- | :---------------------------------------------- |
| `checkout_url` | string | The direct URL to resume the checkout session. |
| `variants` | array | List of items left in the cart. |
| `phone` | string | Customer's primary phone number. |
| `user_details` | object | Contains `name`, `email`, and `country`. |
| `shop_id` | string | The unique identifier of the merchant store. |
| `order_id` | int64 | The internal ID of the abandoned order/session. |
| `address` | object | Comprehensive shipping/billing address details. |
### Sample Payload
```json theme={null}
{
"checkout_url": "https://quick.paytring.com/.......",
"variants": [
{
"vairant_id": "987654321",
"title": "Breeze Premium T-Shirt",
"price": "999.00",
"image_url": "https://cdn.example.com/item.jpg",
"quantity": 1
}
],
"phone": "+919999999999",
"user_details": {
"name": "Jane Doe",
"email": "jane@example.com",
"country": "IN"
},
"shop_id": "breeze-store",
"order_id": 554433
}
```
***
## 🛠️ Testing with CURL
You can test your server's endpoint using the following command:
```bash theme={null}
curl -X POST https://your-webhook-receiver.com/abandoned \
-H "Content-Type: application/json" \
-d '{
"checkout_url": "https://quick.paytring.com/",
"variants": [{"vairant_id": "123", "title": "Test Product", "price": "10.00", "quantity": 1}],
"shop_id": "test-shop",
"user_details": {"name": "Test User", "email": "test@example.com"}
}'
```
# Events Tracking
Source: https://docs.paytring.com/quick/analytics
Google Tag Manager events tracking for conversion and much more.
Track and analyze user behavior during the checkout process with Paytring's Quick Checkout. Here's a breakdown of key events and how they enhance your analytics:
## Key Events
### `begin_checkout`
This event signifies the start of the checkout process. It captures details such as:
* Items in the cart
* Total value
* User information (if logged in)
* Relevant pricing details
**Example Payload:**
```json theme={null}
{
"event": "begin_checkout",
"event_label": "begin_checkout",
"event_category": "ecommerce",
"value": "1049.00",
"currency": "INR",
"shipping": "5.99",
"shipping_tier": "Ground",
"items": [
{
"item_id": "string",
"item_name": "string",
"item_variant": "string",
"affiliation": "Quick Checkout",
"price": "string",
"currency": "string"
}
]
}
```
### `add_shipping_info`
This event indicates that the user has provided their shipping details. It includes additional information such as:
* Shipping address (city, country, line1, line2, name, etc.)
* Shipping handle
* Shipping charges
### `purchase`
This event signifies the completion of a purchase. It includes detailed order information, marking the successful processing of the order.
## Send Custom Cart Data to Your Analytics Stack
With Paytring’s Quick Checkout, **all cart attributes—including custom fields like `rp_id`, `track_code`, `source_code`, and more—are automatically pushed to your analytics platforms**. This ensures deeper insights, better attribution, and actionable data.
### Seamless Integration with Analytics Tools
Paytring supports all major analytics platforms, including:
* **Mixpanel**
* **Google Analytics (GA4)**
* **Google Tag Manager (GTM)**
**Example:**
If your cart includes:
```json theme={null}
{
"rp_id": "CAMPAIGN_1234",
"track_code": "SUMMER24",
"source": "newsletter"
}
```
These attributes will appear in your event data across analytics dashboards, enabling segmentation, funnel analysis, and campaign attribution.
### Benefits of Analytics Sync
* ✅ **Campaign Attribution:** Identify which marketing efforts drive revenue.
* ✅ **User Segmentation:** Create granular cohorts using custom attributes.
* ✅ **Funnel Optimization:** Pinpoint drop-off points with more context.
* ✅ **A/B Testing Insights:** Correlate test variants with real checkout behavior.
* ✅ **Zero Manual Tagging:** Automatically sync all data passed through Quick Checkout.
This powerful visibility empowers your **marketing, product, and data teams** to optimize campaigns, product offerings, and customer journeys—without additional development effort.
# Currency Conversion
Source: https://docs.paytring.com/quick/currency-conversion
A Guide to Multi-Currency Support with Paytring
Expand your global reach by offering customers the option to pay in their local currency. Here's how Paytring's Quick Checkout makes it easy:
## Getting Started
### Use a Currency Converter Plugin
For a quick setup of [Paytring Currency Convertor](https://apps.shopify.com/paytring-currency-converter):
* **Important Setup Step:** Go to the Markets section, choose the markets, and uncheck the checkbox for "Show prices to customers in their local currency."
* **Automatic Detection:** Display prices in the customer's local currency.
* **Real-Time Rates:** Ensure accurate conversions.
* **Customizable Display:** Match your store's branding.
### Advanced Customization
Set the `quick_currency_code` variable in session storage to define the currency:
**Example:**
```jsx theme={null}
sessionStorage.setItem('quick_currency_code', 'CAD');
```
## Payment Gateway Considerations
* **Visualization Pro Plugin:** Ensure the selected currency is communicated to the payment gateway.
* **Auto-Conversion:** If the gateway doesn't support the currency, Paytring will convert it automatically.
## Optimization for speeds
```javascript theme={null}
```
## Why Choose Paytring?
Paytring's Quick Checkout provides robust multi-currency support, ensuring a seamless and localized checkout experience. Contact us to learn more and start catering to a global audience!
# Custom Cart Data
Source: https://docs.paytring.com/quick/custom-tracking
Track user activity with custom attributes
Personalize your checkout experience by capturing and integrating custom cart data seamlessly into your order processing system. Here's how Paytring's Quick Checkout empowers you:
## Why Custom Cart Data Matters
### For Business Owners
* **GST Compliance:** Collect GST numbers during checkout.
* **Campaign Tracking:** Track marketing campaigns with custom codes.
* **Personalized Options:** Offer gift options or delivery preferences.
* **Streamlined Operations:** Ensure accurate order details.
### For Developers
* Persist cart data throughout the checkout process.
* Handle Shopify's 100-attribute limit effectively.
* Implement robust error handling and data validation.
## Paytring's Solution
### Seamless Integration
1. Customize your Shopify cart using `cart/update.js` or cookies.
2. Paytring captures and integrates this data into your orders.
3. Exclude unwanted attributes using `skip_attributes_by_quick`.
**Example:**
```jsx theme={null}
fetch('/cart/update.js', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
attributes: {
'gst_number': '12345',
'skip_attributes_by_quick': 'internal_code'
},
note: 'Custom tracking code: ABC123'
})
});
```
### Benefits
* **Accuracy:** Minimize errors in order processing.
* **Customization:** Cater to individual customer preferences.
* **Efficiency:** Automate data transfer and reduce manual effort.
* **Control:** Decide which attributes are included in order details.
## Technical Deep Dive
* Use `cart/update.js` or cookies to add cart attributes.
* Validate data to ensure quality and security.
* Access cart data via Paytring's API for detailed insights.
## Ready to Enhance Your Checkout?
Unlock the power of custom cart data with Paytring's Quick Checkout. Contact us to get started!
# Discounts & Coupons
Source: https://docs.paytring.com/quick/discount-coupons
Simplify discount and coupon management with Paytring
Attract customers and drive sales with Paytring's robust discount and coupon engine. Here's how you can create targeted promotions and maximize ROI:
## Key Features
### 1. Granular Control
Set precise conditions for coupon applicability:
* **Minimum Order Value:** Encourage higher spending.
* **Customer Type:** Target new or existing customers.
* **Usage Limits:** Restrict per-user or overall usage.
* **Maximum Discount Amount:** Protect profit margins.
* **Expiry Date:** Create urgency with time-limited offers.
### 2. Prepaid Method Discounts
Incentivize online payments by offering discounts for prepaid methods like UPI or credit cards.
**Example:**
* Cart Value: ₹1000
* Prepaid Discount: 5%
* Total Payable: ₹950
### 3. Free Shipping Coupons
Boost sales by waiving shipping fees under specific conditions:
* **Geographic Targeting:** Offer free shipping in select regions.
* **Minimum Order Value:** Encourage bulk purchases.
* **Quantity-Based Discounts:** Reward customers for buying more items.
## Examples of Campaigns
* **"Get 10% off on 3+ items"**: Encourage bulk purchases.
* **"Flat ₹50 off for new users"**: Attract first-time customers.
* **"Free shipping on orders over ₹500"**: Increase cart value.
## Why Choose Paytring?
Paytring's Quick Checkout simplifies discount management, offering flexibility and control to create compelling campaigns. Contact us today to start maximizing your sales!
# Quick Checkout Integration
Source: https://docs.paytring.com/quick/integration
Integrate Paytring Quick Checkout with your store.
# 🛠️ **Integration Guide**
This guide will help you seamlessly integrate **Paytring Quick Checkout** into your Shopify/Other store, replacing platform’s default checkout buttons & keeping the user experience smooth.
***
## 1️⃣ Add Paytring CDN scripts to `theme.liquid`
Paste these lines **inside** your `theme.liquid` file, ideally before the closing `