AutoPayDeveloper guideMerchant workspace
Documentation / Payment gateway

Payment gateway

Collect PKR transfers on your website. Connect a supported receiving account, create a checkout and confirm the order from your server.

Transaction feePKR 1 / paid checkout
Settlement destinationYour receiving account
Verification sourceSigned email or bank feed

Receiving banks and supported evidence

Customers can use any banking app that can transfer to the displayed account. The receiving institution supplies the evidence used to reconcile the order.

  • NayaPay supports automatic matching for recognized incoming Raast and 1Link receipts.
  • Bank Alfalah signs the alert body. The original credit format leaves the recipient email unsigned and shows only the account ending. Credit alerts appear in the merchant review count.
  • Standard Chartered Pakistan signs the recipient and identifies the transfer. Its alert gives a date for the transfer. The separate alert timestamp cannot establish the transfer minute. These credits also appear in review.
  • UBL, Faysal Bank, JazzCash, Easypaisa, SadaPay and other PKR receivers require a connected transaction feed for automatic checkout. A provider must supply a signed posted credit carrying the checkout ID, receiving account, reference, amount and transfer time.

Read verificationMode, feedActive and acceptingCheckouts from the account endpoint before offering checkout. A mode of email_review or feed_required keeps checkout closed. Review alerts carry no fee.

ONBOARDING

Connect your store

  1. Register your store and receiver

    In the merchant workspace, create an account and add your store’s HTTPS address. Select your receiving institution and enter the exact beneficiary name. For email alerts, enter the Gmail address that receives them. Your store key is available immediately.

  2. Authorize the receipt inbox

    In your workspace, select Connect receipt Gmail and choose that same account on Google. Allow the hosted application read-only access once. A successful NayaPay scan enables email-based checkout. Bank feed checkout opens after the first signed heartbeat for your account. Each credit must pass provider-signature, inbox, beneficiary and order checks.

  3. Create your store API key

    Select the active store and generate its key. Save it as BOOLCRAFTS_PAY_STORE_KEY on your backend. For payment links, create a service and share its link alongside your store’s transfer instructions. Rotating the key invalidates the previous one. Each store has its own key, payments and statement.

INTEGRATION

API reference

Set GATEWAY=https://auto-transactions.online and keep BOOLCRAFTS_PAY_STORE_KEY in your backend’s secret settings. The Account request checks your key and returns your store ID and checkout readiness. Calculate the order total from your own catalog, then redirect the buyer to the returned checkoutUrl.

POST/integrations/v1/checkouts
curl -X POST "$GATEWAY/integrations/v1/checkouts" \
  -H "Authorization: Bearer $BOOLCRAFTS_PAY_STORE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"externalId":"SHOP-1042","title":"Cotton shawl","amount":2500,"currency":"PKR"}'
cURL

Use a new externalId for each purchase. On a retry, send the same ID, title and amount to recover the original link.

Integrate with Node.js

Save the merchant client alongside your backend code. Run the account check once to get your store ID and confirm readiness.

import {createPayClient, readyToFulfill} from './merchant-client.mjs';
const pay = createPayClient({key: process.env.BOOLCRAFTS_PAY_STORE_KEY});
const account = await pay.account();
if (!account.acceptingCheckouts) throw Error('Receiving account needs attention');
const checkout = await pay.createCheckout({
  externalId: 'SHOP-1042', title: 'Cotton shawl', amount: 2500,
  returnPath: '/orders/SHOP-1042'
});

Save the returned identifiers and expected amount with your order, then send the customer to checkout.checkoutUrl. For retries use the original order ID, price, title and return path.

const payment = await pay.getCheckout(savedOrder.externalId);
if (readyToFulfill(payment, savedOrder)) {
  // In one database transaction, record this unique payment ID
  // and enqueue fulfillment only if the order is still unpaid.
}

Poll with backoff from your server. Save the original checkout ID as savedOrder.id, together with its storeId, externalId, amount and currency. Each merchant owns its order database and fulfillment process.

Request fields and response
externalId
1–96 letters, digits, dots, hyphens or underscores. Start with a letter or digit. The prefix LINK- is reserved.
title
2–120 characters describing the purchase.
amount
Whole PKR between 1 and 10,000,000.
currency
Use PKR.
notAfter
Optional UTC deadline in millisecond ISO format. Use your inventory reservation expiry to cap the payment window.
expectedReceiver
Optional object with title and iban from your own checkout settings. If your configuration conflicts with the workspace receiver, creation returns 409 before the buyer can pay.
returnPath
Optional path on the registered merchant website. A buyer returning to this page still needs server-side payment verification.

Creating a checkout returns HTTP 201 with id, externalId, storeId, title, amount, currency, status, timestamps and checkoutUrl. Save the identifiers, expected amount and currency alongside your order.

Confirm fulfillment and handle retries

Set GATEWAY to your gateway origin, such as https://auto-transactions.online on the intended host. Poll status with backoff. Fulfill once when the authenticated response says paid and id, externalId, storeId, amount and currency match the saved order. Use a unique payment ID in the same database transaction that marks the order paid. The customer’s browser return is only navigation.

A 401 requires a valid key. A 404 means this store has no matching order. A 409 indicates conflicting details or a receiver or store that needs attention. Honor Retry-After on 429. Retry timeouts with the original externalId.

RECONCILIATION

Payment verification

The reader checks the provider signature, receiver, transfer time and amount before booking a receipt. Enter the checkout ID in the payment memo where supported.

Exact payment

Transfer examplePKR
Order total
2,500.00
Received
2,500.00
Difference
0.00
Paid
Where customers find bank details

Publish your usual receiving instructions on the store order page. Use its path as returnPath. The hosted checkout opens the payment window and shows the beneficiary name and checkout ID. A receipt that names only the beneficiary supports payment matching. To show an IBAN on the hosted page, enter it in Receiving account. It appears once a signed NayaPay receipt explicitly contains that destination IBAN, or for an existing operator-reviewed receiver. Entering an IBAN alone never publishes it.

Buyer inputs and large payments

For an unmatched exact payment, use Find my transfer and enter the full sending account title, plus the last four digits if available. For a different amount, enter the amount actually sent, full sending account title and transaction reference. Those details help locate the authenticated credit.

In the merchant workspace, configure a high-value threshold in PKR. It starts at PKR 50,000. New checkouts at or above the threshold require both the payer’s title and sending account. You can require either check on smaller orders too.

Resolve an amount difference

A signed receipt with a matching checkout ID, or a uniquely corroborated buyer report, opens an amount review. If several checkouts fit, the merchant must investigate the receipt and payer before delivering anything. The online recovery window ends 24 hours after checkout expiry.

For an overpayment, return the excess to the original payer and record the outgoing reference to accept the order, or return the entire credit and close it. For an underpayment, return the full credit and issue a fresh checkout. The merchant makes the refund in their wallet and records it in the workspace.

BILLING

Fees & statements

One rupee per paid checkout

New third-party merchant checkouts accrue the fee once when paid. Unpaid attempts, duplicate notifications and full returns made during amount review accrue zero. Wallet provider charges are recorded separately.

Daily platform feesPKR 5,000

Customer funds go to your receiving wallet. The platform bills merchant fees separately. Your workspace shows daily fees in Pakistan time, total fees, recorded collections and the outstanding balance.