Getting started
Onboard a merchant
Create a business, get it verified, and give it somewhere to be paid.
A merchant is a business you take payments for. Onboarding is three things: create the record, let verification run, and add the bank account payouts go to.
None of it is instant. Verification is asynchronous and a merchant can take payments before it finishes, but it cannot be paid out until it has.
The business details, and the country it trades in, which decides the currency it settles in.
curl -X POST "https://api.tst.au.apgpay.dev/bezel/merchants" \
-H "Authorization: Bearer $API_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"marketplaceId": "<useMarketplaceIdFromSeed>",
"business": {
"legalName": "Blue Hill Coffee Pty Ltd",
"brandName": "Blue Hill Coffee",
"businessRegistrationNumber": "53004085616",
"taxRegistrationNumber": null,
"country": "AU",
"website": "https://bluehillcoffee.example",
"contactEmail": "accounts@bluehillcoffee.example",
"type": "MchtBusinessAttributes"
},
"slug": "bluehillcoffee",
"timeZone": "Australia/Sydney",
"referenceMerchantId": "crm-8842",
"termsAndConditionsAccepted": true,
"tradingCountry": "AU",
"organisationId": null,
"type": "MchtCmdCreate"
}'verification carries the state and, when something is missing, the codes saying what. Poll it or listen for the webhook; do not assume a created merchant is a verified one.
curl -X GET "https://api.tst.au.apgpay.dev/bezel/merchants/<useMerchantIdFromStep1>" \
-H "Authorization: Bearer $API_SECRET_KEY"Payouts in a currency go to the primary account for that currency. Account numbers are write-only, only the last four digits come back.
curl -X POST "https://api.tst.au.apgpay.dev/bezel/external-accounts" \
-H "Authorization: Bearer $API_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"merchantId": "<useMerchantIdFromStep1>",
"accountName": "Blue Hill Coffee Pty Ltd",
"bankName": "Commonwealth Bank",
"accountNumber": "12345678",
"routingNumber": "062000",
"country": "AU",
"currency": "AUD",
"primary": true,
"reference": null,
"requesterId": "ops-user-114",
"type": "XaccCmdCreate"
}'status on the account. Blocked means a payout to it failed non-recoverably, a closure, or a bad BSB, and blockReason says which. A blocked account needs replacing, not retrying.See take a payment.
