Skip to main content

Overview

Create a payment via the API, display the returned URL as a QR code on your POS terminal, and the customer scans to pay. You get an instant webhook when payment completes.

Create a Payment

curl -X POST https://api.acountpay.com/v1/partner/payments \
  -H "X-Partner-Client-Id: your-client-id" \
  -H "X-Partner-Client-Secret: your-client-secret" \
  -H "Content-Type: application/json" \
  -d '{
    "merchantClientId": "merchant-uuid-here",
    "amount": 149.50,
    "referenceNumber": "ORDER-123",
    "description": "Table 5 - 2 items",
    "currency": "DKK",
    "storeId": "a1b2c3d4-e5f6-...",
    "registerId": "REG-001"
  }'

Request Body

FieldTypeRequiredDescription
merchantClientIdstringYesThe merchant’s client ID (UUID returned when the merchant was created via the API — not the numeric merchant ID)
amountnumberYesPayment amount (minimum 0.01)
referenceNumberstringYesYour order/invoice reference
descriptionstringNoDescription shown to customer
currencystringNoCurrency code (default: DKK)
storeIdstringNoStore UUID (from Stores API) to attribute the payment to a specific location
registerIdstringNoRegister/terminal identifier within the store

Response

{
  "paymentId": 456,
  "paymentUrl": "https://pos.acountpay.com/pay?token=eyJhbG...",
  "status": "pending",
  "amount": 149.50,
  "currency": "DKK",
  "referenceNumber": "ORDER-123"
}

Display the QR Code

Render paymentUrl as a QR code on your POS screen. Use any QR library:
import QRCode from 'qrcode';

const { paymentUrl } = await createPayment(orderData);
const qrImage = await QRCode.toDataURL(paymentUrl, { width: 300 });
document.getElementById('qr').src = qrImage;

Customer Payment Flow

  1. Customer sees QR code on POS terminal screen
  2. Scans with phone camera (opens browser)
  3. AcountPay payment page shows the amount and bank selector
  4. Customer picks their bank and authorizes the payment
  5. Payment completes — POS receives webhook notification

Poll Payment Status

If you prefer polling over webhooks (or as a backup):
curl https://api.acountpay.com/v1/partner/payments/456/status \
  -H "X-Partner-Client-Id: your-client-id" \
  -H "X-Partner-Client-Secret: your-client-secret"

Response

{
  "paymentId": 456,
  "status": "paid",
  "amount": 149.50,
  "currency": "DKK",
  "referenceNumber": "ORDER-123",
  "bankPaymentStatus": "AcceptedSettlementCompleted",
  "createdAt": "2026-03-18T12:00:00.000Z",
  "updatedAt": "2026-03-18T12:01:30.000Z"
}

Payment Statuses

StatusDescription
pendingPayment created, waiting for customer
authorizedCustomer authorized, bank is processing
paidPayment confirmed by bank
settledFunds settled
completedPayment fully complete
failedPayment failed
rejectedPayment rejected by bank

List Payments

curl "https://api.acountpay.com/v1/partner/payments?page=1&limit=20&merchantClientId=uuid" \
  -H "X-Partner-Client-Id: your-client-id" \
  -H "X-Partner-Client-Secret: your-client-secret"

Full Integration Example

const ACOUNTPAY_BASE = 'https://api.acountpay.com/v1';
const headers = {
  'X-Partner-Client-Id': process.env.ACOUNTPAY_CLIENT_ID,
  'X-Partner-Client-Secret': process.env.ACOUNTPAY_CLIENT_SECRET,
  'Content-Type': 'application/json',
};

async function processOrder(order) {
  // 1. Create payment
  // IMPORTANT: merchantClientId must be the UUID clientId from merchant creation,
  // not the numeric merchant ID.
  const res = await fetch(`${ACOUNTPAY_BASE}/partner/payments`, {
    method: 'POST',
    headers,
    body: JSON.stringify({
      merchantClientId: order.clientId,
      amount: order.total,
      referenceNumber: order.id,
      description: `Order ${order.id}`,
    }),
  });
  const { paymentId, paymentUrl } = await res.json();

  // 2. Show QR on POS screen
  displayQrCode(paymentUrl);

  // 3. Payment status comes via webhook (see Webhooks guide)
  // Or poll: GET /partner/payments/{paymentId}/status
}