Payments infrastructure
without the busywork.
Build reliable pay-ins and payouts with one clean API. APA Paisa hosts the payment experience, handles verification, and sends you the events that matter.
From first request to first payment.
Keep your private key on your server, create a pay-in, then redirect your customer to the hosted payment URL. Every transaction can be reconciled through status checks and webhooks.
Get credentials
Request your merchant code and private API key from the APA Paisa team.
Create a pay-in
Call the initialize endpoint with a unique order ID and amount.
Redirect securely
Send the customer to payInUrl and wait for the callback.
const response = await fetch("https://app.apapaisa.com/api/v1/payIn/generate-payin?code=YOUR_MERCHANT_CODE&ot=y&amount=505&user_id=23131", { headers: { "x-api-key": process.env.APA_PAISA_PRIVATE_KEY } }); const { data } = await response.json(); redirectCustomer(data.payInUrl);
One private key. Every request.
Authenticate server-to-server calls with your merchant private key in the x-api-key header. Never expose this key in browser code or commit it to source control.
Merchant API key
Issued per merchant and scoped to production access.
x-api-key: YOUR_MERCHANT_PRIVATE_KEYKeep secrets on the server.
Use environment variables or your secret manager to store credentials. Rotate keys if they are ever exposed.
APA Paisa support can issue a replacement key and revoke the old one. Treat the private key like a password.
One production endpoint.
This merchant portal documents the live API only. All requests use the same stable base URL.
https://app.apapaisa.com/api/v1v1Errors you can act on.
Validation failures return a structured error. Handle the response code first, then use the message to correct the request.
Listen for the final state.
Provide an HTTPS notifyUrl when creating a transaction. Your endpoint receives a callback when APA Paisa has a result. Respond quickly with a 2xx status and process events idempotently.
We send a POST to your notifyUrl.
When a hosted payment or payout reaches a new state, APA Paisa sends a JSON POST request to the HTTPS URL you provided during initialization. Your endpoint should accept application/json, verify the merchant order ID and amount, persist the event, and return a 2xx response.
notifyUrlHeader: Content-Type: application/json
Pay-in status values include SUCCESS, PENDING, DROPPED, DUPLICATE, DISPUTE, FAILED, BANK_MISMATCH, and IMG_PENDING.
notifyUrlPayout status values include INITIATED, APPROVED, REJECTED, REVERSED, and PENDING.
Pay-in callback · SUCCESS
{ "status": "SUCCESS", "merchantOrderId": "279cebf7-52ba-4309-b56d-1807c906d667", "amount": 1200, "payinId": "81f20af5-2bd0-4ba1-93ac-717aa2241fd7", "req_amount": 1200, "utr_id": "5342343423" }
Payout callback · APPROVED
{ "status": "APPROVED", "merchantOrderId": "79334b7a-f6bc-4131-92f3-5046ff5ef011", "amount": 5770, "payoutId": "f01cad58-ec14-46e5-84c4-efde465b60db", "utr_id": "23423423421" }
Return 2xx after the event is durably accepted. Treat callbacks as repeatable: use the transaction ID, payinId or payoutId, and status to make processing idempotent. If a callback is missed, use the corresponding status endpoint.
Make retries safe.
Use a unique merchant_order_id for each transaction. Persist the returned pay-in or payout ID and use status endpoints when a network timeout leaves the result unknown.
Designed for steady traffic.
Keep requests measured and retry transient 5xx responses with exponential backoff. Contact support before a large launch or traffic spike.
Initialize a pay-in
Create a hosted payment link and receive the pay-in identifiers needed to track the transaction.
Request
All requests require the x-api-key header.
code · string · requiredot · string · required · use yamount · integer · requireduser_id · string · requiredmerchant_order_id · string · requirednotifyUrl · URL · HTTPSreturnUrl · URL · HTTPSResponse
A successful response includes a transaction ID and current status.
{ "message": "PayIn is generated & url is sent successfully", "statusCode": 200, "data": { "expirationDate": "2025-05-05T15:36:12.434Z", "payInUrl": "https://pay.apapaisa.com/transaction/…", "payinId": "0b6a4d30-3689-44e4-9d12-1d47d19db400", "merchantOrderId": "ORDER-123", "status": "INITIATED", "intentUrl": "upi://pay?pa=merchant@upi&am=505.00&cu=INR", "paymentId": "27031146017", "paymentUrl": "https://anypaymenturl/tnxid", "merchantVpa": "merchant@upi", "merchantName": "APA Paisa Merchant", "amount": "505.00", "transactionId": "IND96d1859a5c6b4" } }
When the transaction state changes, APA Paisa sends this JSON payload as a POST request to the HTTPS notifyUrl in your request.
{ "status": "SUCCESS", "merchantOrderId": "279cebf7-52ba-4309-b56d-1807c906d667", "amount": 1200, "payinId": "81f20af5-2bd0-4ba1-93ac-717aa2241fd7", "req_amount": 1200, "utr_id": "5342343423" }
Your endpoint must accept POST requests, persist the payload idempotently, and return a 2xx response.
- The pay-in link is valid for 10 minutes.
- Persist the
payinIduntil the transaction reaches a final state. - If
intentUrlis empty or missing, redirect the customer topaymentUrl. - Use the HTTPS
notifyUrlcallback to reconcile the final result.
Launch with confidence.
Before launch, verify callback handling, persist transaction IDs, test all terminal statuses, and confirm your account limits with APA Paisa support.