# 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. ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/c4be6343-f8e6-4b7e-ab56-466d11075412/image.png) 2. Scroll down to sales tab and go to **Sales > Payment Methods** ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/2044b55a-cc85-407b-b39a-658262d996b9/image.png) 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. ![](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/9e137d67-610f-4a42-aa20-8432fe2c7e88/image.png) 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. ![](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/4f6df8aa-25df-49e9-a0da-34295cab0e23/image.png) ### 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. ![](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/8cb2bf7c-721f-4925-b67c-a01223f9c5e3/image.png) ### 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. ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/31dab103-20d0-4b7b-a940-97583040359d/image.png) 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 ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/618e793a-f891-48af-abc4-600867e3fb66/image.png) 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. ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/080fd071-f82c-4ebf-8f49-ecafed728ffe/image.png) ### Step 3: Configure the Module 1. Once installed, click on the Configure button now to configure the keys. ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/4ba83650-454b-4828-a7ca-d29324b9ee76/image.png) 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. ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/dda0619d-ccb8-4413-b6fc-0c69e0af9d24/image.png) 3. Click the **Upload Plugin** button in the top-left corner. ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/1d4bef71-2635-4c34-a495-51ad3ea53f90/image.png) 4. Upload the plugin `.zip` file. ### Step 2: Activate the Plugin Once the plugin is successfully uploaded, click the **Activate Plugin** button ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/5d3d03a3-e9ca-4494-b28c-881984c73871/image.png) 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. ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/5193f465-6918-4d36-a986-25b828897045/image.png) 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. ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/35a4d6ed-4d60-43f1-b7e8-e45d02ea25fa/d81dfb6b-ad1e-48b7-8b81-03a7f98d9e20/image.png) ### 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 `` tag: ```html theme={null} ``` **Optional query parameters:** | Parameter | Values | Purpose | | :-------- | :------------------------- | :---------------------------------------------------------- | | env | `prod` \| `uat` \| `local` | Choose your environment | | iframe | `true` \| `false` | Whether to render checkout in an iframe | | style | `phone` | Apply preset button styling whether it's mobile view or not | ## 2️⃣ Create a Shopify App with required permissions ### ✅ Admin API access scopes (32 total) ``` read_cart_transforms, write_cart_transforms, read_discounts, write_order_edits, read_order_edits, write_orders, read_orders, read_payment_customizations, write_payment_customizations, write_payment_terms, read_payment_terms, write_product_listings, read_product_listings, write_price_rules, read_price_rules, write_products, read_products, write_script_tags, read_script_tags, write_shipping, read_shipping, write_assigned_fulfillment_orders, read_assigned_fulfillment_orders, write_third_party_fulfillment_orders, read_third_party_fulfillment_orders, read_custom_fulfillment_services, write_returns, read_returns, read_inventory, read_all_cart_transforms, read_customers, read_publications ``` ### 🌐 Storefront API access scopes ``` unauthenticated_write_checkouts, unauthenticated_read_checkouts, unauthenticated_write_customers, unauthenticated_read_customers, unauthenticated_read_customer_tags, unauthenticated_read_product_listings, unauthenticated_read_product_inventory, unauthenticated_read_product_pickup_locations, unauthenticated_read_product_tags, unauthenticated_write_bulk_operations, unauthenticated_read_bulk_operations ``` ### 📦 **Step 2.1: Store and share app credentials** Once the app is created, **securely store** the following four parameters: | Parameter | Purpose | | ----------------------------- | :-------------------------------------------------------- | | `Admin API access token` | Use your access token to request data from the Admin API | | `API key` | Public key for your Shopify app | | `API secret key` | Private secret used for app authentication | | `Storefront API access token` | Use your access token to request data from Storefront API | ✅ **After saving**, share these securely with the **Paytring team** so they can complete the integration on your behalf. *** ## 3️⃣ Replace the default checkout button ### 🔍 Step 1: Locate your checkout buttons Shopify usually has two main places with checkout buttons: * **Main cart page** Files: `cart.liquid`, `cart-template.liquid`, or sections like `main-cart-footer.liquid` * **Cart drawer / mini cart** Files: `cart-drawer.liquid`, `sections/cart-drawer.liquid`, `snippets/cart-drawer-footer.liquid` Use Shopify’s code search to look for: * `checkout` * `btn--checkout` * `name="checkout"` *** ### ✏ Step 2: Identify the button code The button could look like: ```html theme={null} Checkout ``` or ```html theme={null} ``` etc ... *** ### ⚙ Step 3: Replace it with your custom button #### If it’s an `` tag → replace with ` ``` Optionally add: ```html theme={null} onclick="TRIGGER_QUICK_CHECKOUT()" ``` to trigger Paytring checkout. #### If it’s already a ` ``` *** ### ⚠ Step 4: Do this for **both**: * The main cart page (`cart.liquid` or similar) * The cart drawer (`cart-drawer.liquid` or similar) *** ## ✅ Checklist * [ ] Find checkout buttons * [ ] Replace `` with ` ``` Files are usually `product.liquid`, `sections/main-product.liquid`, or similar. *** ### ✏ Step 2: Remove or comment out Shopify’s default button ```liquid theme={null} {%- comment -%}{{ form | payment_button }}{%- endcomment -%} ``` *** ### 📦 Step 3: Add the placeholder for Paytring button ```html theme={null}
``` Place it **exactly where the removed button was**. *** ### ⚙ Step 4: Render your Buy Now button Right after including the Paytring CDN scripts, add: ```html theme={null} ``` #### We have multiple styling options for this buy button | Option | Example | Notes | | :-------------- | :--------------------- | :-------------------------------------- | | backgroundColor | `"#003c23"` (hex code) | Button background color | | borderRadius | `"1rem"` | CSS border radius property | | padding | `"0px 0px 0px 0px"` | CSS padding; usually in px | | fontSize | `"16px"` | Button font size | | width | `"100%"` | Width in percentage | | gap | `"8px"` | Space between internal elements, if any | *** ## ✅ Quick summary: * [ ] Find and remove Shopify’s default payment button * [ ] Add `
` * [ ] Include CDN scripts * [ ] Add JS to render your Buy Now button *** ## 5️⃣ Notify business team & set webhook into paytring dashboard * Notify the business team after each shop integration * Set webhook URL to: ``` https://quick.paytring.com/quick//webhook/success ``` *** ## 6️⃣ Pass your shopify logged-in customer data to Paytring Above your CDN scripts, add below js snipet in `theme.liquid`: ```html theme={null} {% if customer %} {% endif %} ``` *** ## 7️⃣ Restrict Paytring checkout to certain countries Also in `theme.liquid`, add: ```html theme={null} ``` Replace with your target country codes. This ensures: ✅ Only users from allowed countries see Paytring checkout ✅ Others see Shopify’s default checkout *** ## 8️⃣ Listen to detected country and add custom logic If your store already uses a geo‑detection script or service, it may **automatically** dispatch a custom event named: ```js theme={null} "current_country" ``` with the visitor’s detected country code. You **only** need to add a listener to react when this happens. *** ### ✏ **How to add the listener** Add this script **after** your Paytring CDN scripts (for example, in `theme.liquid`): ```html theme={null} ``` *** ### 📍 **Why add this** This lets your shop: * React dynamically whenever the visitor’s country is detected or changes * Add custom UX behavior per country * Keep your checkout flow flexible and localized for different regions *** ⚠ **Important:** You do **not** need to dispatch or emit the event yourself. Your geo‑detection system or script will already emit it automatically. *** ✅ **Tip:** * You can combine this listener with Paytring’s built‑in method: ```js theme={null} QUICK_RESTRICT_COUNTRIES(["US", "IN", ...]); ``` to: * Automatically limit Paytring checkout to specific countries * And add extra client‑side behaviors — like showing custom messages, changing styling, or falling back to Shopify’s native checkout when the detected country isn’t supported * You can add your custom script to update the button visibility *** ## 9️⃣ Handle dynamic or shadow DOM checkout buttons (advanced) In some Shopify themes or custom storefronts, checkout buttons may: * Be added dynamically after page load * Appear inside **shadow DOM elements** * Or change based on product or cart updates In these cases, your initial DOM updates (like replacing or hiding the button) might **not work immediately**, because the elements don’t yet exist in the HTML. *** ### ⚙ **Solution: Run a script at custom intervals** You can add a script that **runs every few milliseconds** to repeatedly check for the target button and update it when it appears. Here’s an example: ```html theme={null} ``` *** ### 📍 **Why add this** * Handles buttons rendered **after** initial page load * Works even when elements are created dynamically by JavaScript * Useful when you don’t have direct access to edit theme code deeply *** ⚠ **Important:** Keep the interval reasonably short (e.g., 100–500 ms) to avoid performance issues. Optionally, stop the interval once your changes succeed (using `clearInterval`). *** ✅ **Tip:** This method is especially useful for: * Custom themes with heavy JavaScript * Themes using **shadow DOM** or **dynamic cart drawers** * When default liquid template changes alone aren’t enough *** # Return to Origin (RTO) Source: https://docs.paytring.com/quick/solve-rto Reduce RTO and Recover Abandoned Carts with Paytring Return-to-Origin (RTO) is a significant challenge for e-commerce merchants, leading to profit loss, inventory issues, and operational overhead. Paytring's Quick Checkout offers a smarter solution to reduce RTO and recover sales from abandoned carts. Here's how: ## Key Features ### 1. Pin Code Blacklisting Prevent orders from problematic areas by blocking specific pin codes. This eliminates potential losses from regions with unreliable delivery services or high return rates. ### 2. COD Surcharges Discourage impulsive Cash on Delivery (COD) orders by introducing a surcharge. Configure it as a fixed amount or a percentage of the order value. **Example:** * Order Value: ₹1000 * COD Surcharge: 30% * Total Payable: ₹1300 ### 3. Partial Payments Require customers to pay a portion of the order value upfront for COD orders, increasing their commitment and reducing cancellations. **Example:** * Order Value: ₹1000 * Partial Payment: 30% * Upfront Payment: ₹300 ### 4. Enhanced Order Verification Use CAPTCHA to block automated bots and prevent fake orders, reducing fraudulent activity. ### 5. OTP Login Secure customer information with OTP-based login, ensuring verified mobile numbers for direct communication and better customer relationships. ### 6. Abandoned Cart Management Recover lost sales with: * **Daily Reports:** Receive Excel reports of abandoned carts. * **Webhook Integration:** Automate follow-ups with platforms like WhatsApp or email marketing tools. ## Why Choose Paytring? Paytring's Quick Checkout is more than just speed. It provides a comprehensive solution to reduce RTO, protect profits, and recover lost sales. Contact us today to learn more and start optimizing your checkout process! # UpSell with UpCart Source: https://docs.paytring.com/quick/upsell Integrate UpCart with Paytring for seamless upselling. ## Recommended Settings To ensure proper functionality of the UpCart Cart Drawer with Paytring's Quick Checkout, follow these recommended settings: 1. **Enable "Go to cart instead of checkout"**: * Navigate to **Cart Editor > Settings**. * Enable the option: **Go to cart instead of checkout**. **AND** 2. **Use Custom HTML Scripts**: * Navigate to **Cart Editor > Settings > Custom HTML**. * Add the following script under `Above announcements/rewards`: ```html theme={null} ``` *** ## Important Notes * **Express Payments**: Do not use the Express Payments feature in the cart drawer. It is not compatible with the checkout button. * **Discount Codes**: Keep the `Discount codes` feature disabled in the cart drawer to avoid conflicts. # Quickstart Source: https://docs.paytring.com/quickstart Get started with Paytring and explore its powerful features ## Welcome to Paytring Paytring is your ultimate global payments stack, offering seamless integration with multiple Payment Gateways (PGs) and advanced features to simplify your payment operations. This quickstart guide will help you understand the key capabilities of Paytring and how to get started. ## Supported Payment Gateways Paytring integrates with a wide range of Payment Gateways (PGs) to provide you with unparalleled flexibility. Here’s a list of supported PGs: ### India | Payment Gateway | API Code | | ---------------------- | ---------------- | | Airpay | `airpay` | | Apex | `apex` | | Axis | `axis` | | Billdesk | `billdesk` | | Cashfree | `cashfree` | | CCAvenue | `ccavenue` | | Decentro | `decentro` | | Easebuzz | `easebuzz` | | Easebuzz Insta Collect | `instacollect` | | Enkash | `enkash` | | Freecharge | `freecharge` | | Ftcash | `ftcash` | | Getepay | `getepay` | | HaodaPay | `haodapay` | | ICICI | `icici` | | MmadPay | `mmadpay` | | Pay10 | `pay10` | | Payglocal | `payglocal` | | Paytm | `paytm` | | PayU | `payu` | | Phonepe | `phonepe` | | Pinelabs | `pinelabs` | | Pinelabs v3 | `pinelabsv3` | | RazorPay | `razorpay` | | Sabpaisa | `sabpaisa` | | Transactbridge | `transactbridge` | | Unlimit India | `unlimitindia` | | Wire | `upigateway` | | Zaakpay | `zaakpay` | ### Middle East | Payment Gateway | API Code | Coverage | | --------------- | ---------- | ------------------------- | | Gate2Pay | `gate2pay` | GCC | | Noon Pay | `noonpay` | UAE, Saudi Arabia | | Paytabs | `paytabs` | UAE, Saudi Arabia, Egypt | | Tabby | `tabby` | UAE, Saudi Arabia, Kuwait | ### Southeast Asia & APAC | Payment Gateway | API Code | Coverage | | --------------- | --------- | ------------------------------------------- | | Monay | `monay` | Philippines | | RDP | `rdp-*` | SEA, India, China (multi-method aggregator) | | Tazapay | `tazapay` | SEA, Cross-border | ### Nepal | Payment Gateway | API Code | | --------------- | ------------- | | NABIL Bank | `compassplus` | ### Europe | Payment Gateway | API Code | Coverage | | --------------- | ----------- | ----------------------- | | Adyen | `adyen` | Netherlands, EU, Global | | Checkout.com | `checkout` | UK, EU, Global | | Emerchant Pay | `emerchant` | EU, UK | | Unlimit | `unlimit` | UK, EU, LATAM, APAC | | Worldline | `worldline` | France, EU, Global | ### Americas | Payment Gateway | API Code | Coverage | | -------------------- | ------------- | ---------- | | ACI | `aci` | US, Global | | Authorize.net | `authorize` | US, Canada | | Braintree | `braintree` | US, Global | | Cybersource | `cybersource` | US, Global | | Fiserv | `fiserv` | US, Global | | Shift4 / SecurionPay | `securionpay` | US, EU | ### Global These gateways operate across multiple continents without a dominant home region. | Payment Gateway | API Code | | --------------- | ---------- | | Coingate | `coingate` | | PayPal | `paypal` | | Rapyd | `rapyd` | | Stripe | `stripe` | | Transak | `transak` | Some options are available on request only and may not be listed here. If you need a specific PG that is not mentioned, please reach out to our support team for assistance. With Paytring, you can connect to any of these PGs and manage transactions effortlessly. ## Key Features ### 1. **Omnichannel Capabilities** Paytring provides omnichannel capabilities, enabling you to view and manage transactions from various sources, including Point of Sale (POS) systems and online platforms, all within a single dashboard. This unified view simplifies reconciliation and enhances operational efficiency. ### 2. **Pool Management** For umbrella organizations managing multiple entities, Paytring offers a **Pool Management** feature. This allows you to oversee and control multiple organizations from a single dashboard, streamlining operations and improving visibility. ### 3. **Rule Engine** Paytring’s **Rule Engine** empowers you to define custom rules for routing transactions to different Payment Gateways. This ensures optimal transaction processing based on your business logic, such as cost efficiency, transaction type, or geographic location. ## Get Started To start using Paytring, follow these steps: 1. **Sign Up and Configure**: Create an account on Paytring and configure your preferred Payment Gateways. 2. **Integrate APIs**: Use our developer-friendly APIs to integrate Paytring into your application. Refer to our [API Documentation](../api-reference/introduction.mdx) for detailed guidance. 3. **Set Up Rules**: Leverage the Rule Engine to define transaction routing rules tailored to your business needs. 4. **Monitor and Manage**: Use the Paytring dashboard to monitor transactions, manage pools, and gain insights into your payment operations. ## Need Help? If you have any questions or need assistance, our support team is here to help. Visit our [Support Center](https://support.paytring.com) or contact us directly. Start your journey with Paytring today and experience the future of global payments! # Transformation Layer Source: https://docs.paytring.com/transformers Preview changes locally to update your docs # Transformation Layer API's The Transformation Layer enables merchants to integrate with Paytring using API formats they're already familiar with from other payment gateways. This eliminates the need for code changes when migrating from Razorpay, PayU, Pinelabs, Cashfree, or Worldline. ## Overview | Gateway | Authentication | Endpoints | Features | | ----------------------- | --------------------------------- | -------------------------------- | ----------------------------- | | [Razorpay](#razorpay) | Hash-based (V1) / Basic Auth (V2) | Create, Fetch | Order creation & status | | [PayU](#payu) | Hash-based (V1) / Basic Auth (V2) | Create, Fetch | Order creation & status | | [Pinelabs](#pinelabs) | Hash-based (V1) / Basic Auth (V2) | Create, Fetch | Order creation & status | | [Cashfree](#cashfree) | Header-based (x-client-id/secret) | Create, Fetch, Payments, Refunds | Full order & refund lifecycle | | [Worldline](#worldline) | None (V1) / Basic Auth (V2) | Create | Order creation | *** ## Authentication Methods ### V1 - Hash-based Authentication Used by: Razorpay, PayU, Pinelabs Include in request body: ```json theme={null} { "key": "your_paytring_api_key", "hash": "sha512_hash_of_params" } ``` **Hash Calculation:** 1. Sort all request parameters alphabetically by key 2. Concatenate values with `|` separator 3. Append `|` + API secret 4. Generate SHA512 hash See [Hash Documentation](./hash.md) for details. ### V2 - Basic Authentication Used by: Razorpay, PayU, Pinelabs, Worldline Include HTTP header: ``` Authorization: Basic base64(api_key:api_secret) ``` ### Cashfree-style Header Authentication Used by: Cashfree Include HTTP headers: ``` x-client-id: your_paytring_api_key x-client-secret: your_paytring_api_secret x-api-version: 2023-08-01 (optional) ``` *** ## Razorpay Emulates Razorpay's order API format. ### Create Order **V2 Endpoint:** `POST /api/v2/order/via/rzp/create` #### Request ```json theme={null} { "amount": 50000, "currency": "INR", "receipt": "receipt_123", "notes": { "key1": "value1" } } ``` | Field | Type | Required | Description | | ---------- | ------- | -------- | ------------------------------------ | | `amount` | integer | Yes | Amount in paise (e.g., 50000 = ₹500) | | `currency` | string | Yes | Currency code (INR) | | `receipt` | string | Yes | Unique receipt/order identifier | | `notes` | object | No | Additional metadata | #### Response ```json theme={null} { "id": "order_ABC123", "entity": "order", "amount": 50000, "currency": "INR", "receipt": "receipt_123", "status": "created", "created_at": 1234567890 } ``` ### Fetch Order **V2 Endpoint:** `POST /api/v2/order/via/rzp/fetch` #### Request ```json theme={null} { "order_id": "order_ABC123" } ``` #### Response ```json theme={null} { "id": "order_ABC123", "entity": "order", "amount": 50000, "amount_paid": 50000, "amount_due": 0, "currency": "INR", "receipt": "receipt_123", "status": "paid", "created_at": 1234567890 } ``` *** ## PayU Emulates PayU's order API format. ### Create Order **V2 Endpoint:** `POST /api/v2/order/via/payu/create` #### Request ```json theme={null} { "txnid": "TXN123456", "amount": "500.00", "productinfo": "Product Description", "firstname": "John", "email": "john@example.com", "phone": "9876543210", "surl": "https://merchant.com/success", "furl": "https://merchant.com/failure" } ``` | Field | Type | Required | Description | | ------------- | ------ | -------- | --------------------------------- | | `txnid` | string | Yes | Unique transaction ID | | `amount` | string | Yes | Amount in rupees (e.g., "500.00") | | `productinfo` | string | Yes | Product/order description | | `firstname` | string | Yes | Customer first name | | `email` | string | Yes | Customer email | | `phone` | string | Yes | Customer phone | | `surl` | string | Yes | Success callback URL | | `furl` | string | Yes | Failure callback URL | #### Response ```json theme={null} { "status": 1, "msg": "Order Created", "result": { "txnid": "TXN123456", "order_id": "order_ABC123", "payment_url": "https://paytring.com/pay/..." } } ``` ### Fetch Order **V2 Endpoint:** `POST /api/v2/order/via/payu/fetch` #### Request ```json theme={null} { "txnid": "TXN123456" } ``` #### Response ```json theme={null} { "status": 1, "result": { "txnid": "TXN123456", "amount": "500.00", "status": "success", "mode": "CC", "bank_ref_num": "123456789" } } ``` *** ## Pinelabs Emulates Pinelabs' order API format. ### Create Order **V2 Endpoint:** `POST /api/v2/order/via/pinelabs/create` #### Request ```json theme={null} { "merchant_txn_id": "PINE123456", "amount": 50000, "currency": "INR", "customer_name": "John Doe", "customer_email": "john@example.com", "customer_mobile": "9876543210", "callback_url": "https://merchant.com/callback" } ``` | Field | Type | Required | Description | | ----------------- | ------- | -------- | --------------------- | | `merchant_txn_id` | string | Yes | Unique transaction ID | | `amount` | integer | Yes | Amount in paise | | `currency` | string | Yes | Currency code | | `customer_name` | string | No | Customer name | | `customer_email` | string | No | Customer email | | `customer_mobile` | string | No | Customer phone | | `callback_url` | string | Yes | Webhook callback URL | #### Response ```json theme={null} { "response_code": 1, "response_message": "SUCCESS", "ppc_MerchantTxnId": "PINE123456", "ppc_PinelabsTxnId": "order_ABC123", "redirect_url": "https://paytring.com/pay/..." } ``` ### Fetch Order **V2 Endpoint:** `POST /api/v2/order/via/pinelabs/fetch` #### Request ```json theme={null} { "merchant_txn_id": "PINE123456" } ``` #### Response ```json theme={null} { "response_code": 1, "response_message": "SUCCESS", "ppc_MerchantTxnId": "PINE123456", "ppc_Amount": 50000, "ppc_TxnStatus": "SUCCESS", "ppc_PaymentMode": "CREDIT_CARD" } ``` *** ## Cashfree Emulates Cashfree's PG API format with full order and refund lifecycle support. ### Create Order **V2 Endpoint:** `POST /api/v2/pg/via/cashfree/orders` #### Request ```json theme={null} { "order_id": "CF_ORDER_123", "order_amount": 500.50, "order_currency": "INR", "customer_details": { "customer_id": "cust_123", "customer_name": "John Doe", "customer_email": "john@example.com", "customer_phone": "9876543210" }, "order_meta": { "return_url": "https://merchant.com/return?order_id={order_id}", "notify_url": "https://merchant.com/webhook" }, "order_note": "Test order" } ``` | Field | Type | Required | Description | | --------------------------------- | ------ | -------- | ---------------------------------------- | | `order_id` | string | Yes | Unique order identifier | | `order_amount` | number | Yes | Amount in rupees (decimal, e.g., 500.50) | | `order_currency` | string | Yes | Currency code (INR) | | `customer_details.customer_id` | string | Yes | Customer identifier | | `customer_details.customer_name` | string | No | Customer name | | `customer_details.customer_email` | string | Yes | Customer email | | `customer_details.customer_phone` | string | Yes | Customer phone (10 digits) | | `order_meta.return_url` | string | No | Return URL after payment | | `order_meta.notify_url` | string | No | Webhook notification URL | | `order_note` | string | No | Order description | #### Response ```json theme={null} { "cf_order_id": "order_ABC123", "order_id": "CF_ORDER_123", "order_status": "ACTIVE", "order_token": "token_xyz", "order_amount": 500.50, "order_currency": "INR", "payment_session_id": "session_abc", "payments": { "url": "https://api.paytring.com/api/v1/pg/via/cashfree/orders/order_ABC123/payments" }, "refunds": { "url": "https://api.paytring.com/api/v1/pg/via/cashfree/orders/order_ABC123/refunds" } } ``` ### Fetch Order **V2 Endpoint:** `GET /api/v2/pg/via/cashfree/orders/{order_id}` #### Response ```json theme={null} { "cf_order_id": "order_ABC123", "order_id": "CF_ORDER_123", "order_status": "PAID", "order_amount": 500.50, "order_currency": "INR", "customer_details": { "customer_id": "cust_123", "customer_name": "John Doe", "customer_email": "john@example.com", "customer_phone": "9876543210" }, "created_at": "2024-01-15T10:30:00+05:30" } ``` **Order Status Values:** | Status | Description | | --------- | ------------------------------- | | `ACTIVE` | Order created, awaiting payment | | `PAID` | Payment successful | | `EXPIRED` | Order expired or payment failed | ### Get Order Payments **V2 Endpoint:** `GET /api/v2/pg/via/cashfree/orders/{order_id}/payments` #### Response ```json theme={null} [ { "cf_payment_id": "pay_123", "order_id": "CF_ORDER_123", "payment_status": "SUCCESS", "payment_amount": 500.50, "payment_currency": "INR", "payment_method": { "card": { "card_network": "VISA", "card_type": "CREDIT_CARD", "card_last4": "1234" } }, "payment_time": "2024-01-15T10:35:00+05:30", "bank_reference": "123456789" } ] ``` ### Create Refund **V2 Endpoint:** `POST /api/v2/pg/via/cashfree/orders/{order_id}/refunds` #### Request ```json theme={null} { "refund_id": "refund_123", "refund_amount": 100.00, "refund_note": "Customer requested refund" } ``` | Field | Type | Required | Description | | --------------- | ------ | -------- | ------------------------ | | `refund_id` | string | Yes | Unique refund identifier | | `refund_amount` | number | Yes | Refund amount in rupees | | `refund_note` | string | No | Reason for refund | #### Response ```json theme={null} { "cf_refund_id": "rf_ABC123", "refund_id": "refund_123", "order_id": "CF_ORDER_123", "refund_status": "PENDING", "refund_amount": 100.00, "refund_currency": "INR", "created_at": "2024-01-15T11:00:00+05:30" } ``` ### List Refunds **V2 Endpoint:** `GET /api/v2/pg/via/cashfree/orders/{order_id}/refunds` #### Response ```json theme={null} [ { "cf_refund_id": "rf_ABC123", "refund_id": "refund_123", "refund_status": "SUCCESS", "refund_amount": 100.00, "created_at": "2024-01-15T11:00:00+05:30" } ] ``` ### Fetch Refund **V2 Endpoint:** `GET /api/v2/pg/via/cashfree/orders/{order_id}/refunds/{refund_id}` #### Response ```json theme={null} { "cf_refund_id": "rf_ABC123", "refund_id": "refund_123", "order_id": "CF_ORDER_123", "refund_status": "SUCCESS", "refund_amount": 100.00, "refund_currency": "INR", "refund_note": "Customer requested refund", "created_at": "2024-01-15T11:00:00+05:30", "processed_at": "2024-01-15T11:05:00+05:30" } ``` **Refund Status Values:** | Status | Description | | ----------- | ----------------------------- | | `PENDING` | Refund initiated | | `SUCCESS` | Refund processed successfully | | `CANCELLED` | Refund cancelled | *** ## Worldline Emulates Worldline's order creation API. ### Create Order **V2 Endpoint:** `POST /api/v2/order/via/worldline/create` (Basic Auth) #### Request ```json theme={null} { "merchant_id": "MID123", "order_id": "WL_ORDER_123", "amount": "500.00", "currency": "INR", "customer_name": "John Doe", "customer_email": "john@example.com", "customer_phone": "9876543210", "return_url": "https://merchant.com/return" } ``` | Field | Type | Required | Description | | ---------------- | ------ | -------- | ------------------------ | | `merchant_id` | string | Yes | Merchant identifier | | `order_id` | string | Yes | Unique order ID | | `amount` | string | Yes | Amount in rupees | | `currency` | string | Yes | Currency code | | `customer_name` | string | No | Customer name | | `customer_email` | string | No | Customer email | | `customer_phone` | string | No | Customer phone | | `return_url` | string | Yes | Return URL after payment | #### Response ```json theme={null} { "status": "SUCCESS", "order_id": "WL_ORDER_123", "paytring_order_id": "order_ABC123", "payment_url": "https://paytring.com/pay/..." } ``` *** ## Error Responses All endpoints return consistent error responses: ### Validation Error (400) ```json theme={null} { "status": "ERROR", "code": "VALIDATION_ERROR", "message": "Invalid request parameters", "errors": { "amount": ["Amount is required"], "email": ["Invalid email format"] } } ``` ### Authentication Error (401) ```json theme={null} { "status": "ERROR", "code": "AUTHENTICATION_FAILED", "message": "Invalid API credentials" } ``` ### Not Found (404) ```json theme={null} { "status": "ERROR", "code": "ORDER_NOT_FOUND", "message": "Order not found" } ``` ### Server Error (500) ```json theme={null} { "status": "ERROR", "code": "INTERNAL_ERROR", "message": "An unexpected error occurred" } ``` *** ## Migration Guide ### From Razorpay 1. Replace base URL: `https://api.razorpay.com/v1` → `https://api.paytring.com/api/v2/order/via/rzp` 2. Update authentication to use Paytring API credentials 3. No changes needed to request/response handling ### From PayU 1. Replace endpoint: PayU's endpoint → `https://api.paytring.com/api/v2/order/via/payu` 2. Update `key` and `salt` to Paytring credentials 3. Hash calculation remains the same ### From Pinelabs 1. Replace base URL → `https://api.paytring.com/api/v2/order/via/pinelabs` 2. Use Paytring API credentials 3. Response format remains compatible ### From Cashfree 1. Replace base URL: `https://api.cashfree.com/pg` → `https://api.paytring.com/api/v2/pg/via/cashfree` 2. Update `x-client-id` and `x-client-secret` headers with Paytring credentials 3. All endpoints and response formats remain compatible *** ## Rate Limits | Endpoint Type | Limit | | ----------------- | ------------------- | | Create Order | 100 requests/minute | | Fetch Order | 300 requests/minute | | Refund Operations | 50 requests/minute | *** ## Support For integration support or issues: * Email: [support@paytring.com](mailto:support@paytring.com) * Documentation: [https://docs.paytring.com](https://docs.paytring.com)