BUILD WITH Infidreams Pay
One integration.
Your payment experience.
Create orders in your backend, open hosted checkout, and verify payment status before fulfilment. Your customers do not need an account here.
1. Get scoped access
Create a user account, choose the developer persona, and request business access. Depending on the approval policy, you receive your own workspace automatically or an administrator reviews the request. Live collections require an administrator to connect and select an approved payment gateway. Create an application in the Developer tab and save its key in your backend secret store.
Each application has isolated orders, events and customer references. A customer ID is meaningful only within your application; it never grants access to another user's payment history.
2. Create an order
POST /v1/orders
Authorization: Bearer YOUR_APPLICATION_KEY
Idempotency-Key: order-your-unique-reference
Content-Type: application/json
{
"amount": 10000,
"currency": "INR",
"reference": "invoice-1001",
"customerId": "your-external-customer-id",
"purpose": "services",
"paymentType": "p2m",
"payeeId": "your-approved-tenant"
}Amounts are integer paise (10000 = ₹100). Reuse the same idempotency key and identical payload when retrying. An unknown result needs reconciliation; never create another payment to work around a timeout.
3. Open checkout and verify
POST /v1/orders/ORDER_ID/checkout # Returns checkoutUrl. Redirect your customer to this URL. POST /v1/orders/ORDER_ID/reconcile GET /v1/orders/ORDER_ID GET /v1/events?after=0
Only a server-verified paid status authorizes fulfilment. Store the event cursor and deduplicate events by sequence. Checkout sessions expire after 15 minutes. Existing orders remain bound to their original gateway and merchant.
Refunds and financial records
GET /v1/orders/ORDER_ID/finance
POST /v1/orders/ORDER_ID/refunds
Idempotency-Key: refund-unique-reference
{"amount": 10000, "reason": "Customer cancellation"}
GET /v1/orders?before=TIMESTAMP
GET /v1/capabilitiesRefunds currently support Razorpay. Refund requests can be pending, processed, failed or unknown. Do not retry an unknown refund with a different idempotency key. Financial snapshots are refreshed in the merchant/admin portal and by signed provider webhooks. A processed refund or settlement does not independently confirm bank credit.
SDKs and MCP
The deployment package includes a JavaScript SDK (sdk/client.mjs), Python SDK (sdk/infidreams_pay.py) and stdio MCP server (sdk/mcp.mjs). Obtain the package from your platform administrator.
import { InfidreamsPay } from './sdk/client.mjs';
const pay = new InfidreamsPay({
baseUrl: process.env.INFIDREAMS_PAY_URL,
apiKey: process.env.INFIDREAMS_PAY_KEY
});
const order = await pay.createOrder({
amount: 10000, currency: 'INR', reference: 'invoice-1001',
customerId: 'customer-42', purpose: 'services'
}, 'invoice-1001-attempt-1');
const checkout = await pay.createCheckout(order.id);{
"mcpServers": {
"infidreams-pay": {
"command": "node",
"args": ["/absolute/path/to/sdk/mcp.mjs"],
"env": {
"INFIDREAMS_PAY_URL": "https://pay.infidreams.com",
"INFIDREAMS_PAY_KEY": "YOUR_APPLICATION_KEY"
}
}
}
}MCP exposes capabilities, order listing and lookup, financial lookup, order creation and checkout links. It cannot approve a customer's payment or move money to an arbitrary beneficiary.
Fees and supported flows
New payments have 0% platform commission. Payment gateway fees and applicable provider taxes still apply. Net proceeds equal the captured amount minus refunds and gateway charges. Historical orders retain their original commission terms; gateway fee refunds follow provider policy.
Business collections support consumer-to-merchant and business-to-merchant payments to the application's approved tenant. P2P transfers, payouts, recurring mandates and split settlements require separate provider capabilities and are not enabled by this API. Check /v1/capabilities rather than assuming availability.