Testing your integration in the sandbox environment is essential before going live with BlinkPay.
Sandbox URL: https://sandbox.debit.blinkpay.co.nz
The sandbox environment provides:
Limitations:
Sandbox credentials are provisioned when you sign up at merchants.blinkpay.co.nz. If Settings > API Settings shows no sandbox key, select Request Sandbox API Key there. See Getting API Credentials.
To see the Gateway flow in action before building your integration, visit our demo site:
ACME Demo Site: https://acme-sandbox.blinkpay.co.nz
This demonstrates the full Gateway payment experience from a customer's perspective.
The sandbox has one test bank, PNZ: Payments NZ's API Centre test bank, shown as the PNZ tile in the Gateway. Use these values for every flow:
| Item | Value |
|---|---|
| Test bank | PNZ (the Gateway tile is labelled PNZ) |
| Redirect or Gateway login | Username user01, password password |
| Decoupled, auto-approve | Mobile number +64-259531933. In the Gateway, choose Send to PNZ app. The consent is approved automatically. |
| Decoupled, any other number | Accepted, but the consent never authorises: it stays AwaitingAuthorisation until the bank's authorisation window ends, then becomes Rejected (timeout). Other numbers do not simulate a decline. |
| Decline | On the PNZ login page, choose Cancel before logging in. The consent becomes Rejected; for a quick payment it carries one Rejected payment. |
Automated Testing
The auto-approve number needs no customer interaction, which makes it the easiest way to drive consents to Authorised in automated tests.
The sandbox can produce these outcomes, so test your handling of each:
| Outcome | How to produce it |
|---|---|
GatewayTimeout | Create a gateway consent, follow the redirect, but don't select a bank. Wait out the 15-minute Gateway session cutoff. |
Rejected (declined) | On the PNZ login page, choose Cancel before logging in. |
Rejected (timed out) | Leave the PNZ authorisation incomplete until the bank's window elapses, or start a decoupled consent with any number other than the auto-approve number. |
Revoked | Authorise a consent, then call its DELETE endpoint, for example DELETE /payments/v1/single-consents/{consent_id}. |
| Payment on a revoked consent | Revoke an authorised consent, then call POST /payments/v1/payments: 422 BP015. |
| Enduring limit breached | Request a payment above the consent's maximum_amount_payment (400 BP263), or a single payment above its maximum_amount_period (400 BP262). |
| Payment already in progress | Create a second payment on a consent while the first is still being processed: 409 BP703. |
| Idempotency conflicts | Reuse an idempotency-key with a different request body, or resend a request while the first is still in flight. See Error Codes. |
Bank-side rejections after authorisation, bank downtime, Fixed Recurring Payment failures, revocation at the bank and consent expiry can't be triggered in the sandbox. Build that handling from the documented statuses and error codes, and finish with a single low-value live payment in production.
The primary integration path is the Gateway flow, which hosts the bank selection and handles the redirect or decoupled sub-flow automatically.
Objective: Verify end-to-end payment using Gateway
Steps:
flow.type: 'gateway'consent.redirect_uriuser01 with password password → Approve+64-259531933 → Auto-approvescid (consent ID) and status query parameters. No status means the outcome was not reported as failed, not that it succeeded: confirm it with a server-side GET. See Return ParametersGET /payments/v1/single-consents/{cid} that the consent status is Authorisedconsent_idAcceptedSettlementCompletedExpected Results:
AuthorisedAcceptedSettlementCompletedObjective: Test simplified single-step payment
Steps:
POST /payments/v1/quick-payments and store the quick_payment_idGET /payments/v1/quick-payments/{quick_payment_id}; the gateway normally does this for you, and calling it again is safe. For a bank payment this call completes the payment. If it returns a 4xx or 5xx, retry the GET.Consumed and its single payment is AcceptedSettlementCompletedObjective: Test recurring payment setup
Steps:
POST /enduring-consents with maximum_amount_period, maximum_amount_payment, and periodAuthorised (not Consumed)Objective: Verify card payment flow via Gateway
Steps:
GET /payments/v1/meta and confirm the response contains a Card entryflow.detail.type: "gateway"redirect_uriAcceptedSettlementCompletedcard_network field is present in the response (e.g. VISA)Sandbox Test Card Numbers:
| Network | Card Number | Expiry | CVV |
|---|---|---|---|
| Visa | 4000 0000 0000 2503 | Any | Any |
| Mastercard | 5200 0000 0000 2151 | Any | Any |
Expected Results:
ConsumedAcceptedSettlementCompletedaccepted_reason: card_network_acceptedcard_network: VISA or MASTERCARDTest these scenarios to ensure your integration handles errors gracefully:
Timeout: Create a consent and redirect to the Gateway. If you don't select a bank, the consent becomes GatewayTimeout once the 15-minute Gateway session cutoff elapses. If you select PNZ but never complete authorisation, it becomes Rejected once that bank's authorisation window elapses. See Authorisation timeouts.
Rejection: On the PNZ login page, choose Cancel before logging in. The consent status becomes Rejected and you'll receive this in your redirect callback. For quick payments, the consent's payments[] array will contain a single payment record with status Rejected.
Revocation: Authorise a consent (the auto-approve number is quickest), then call DELETE /payments/v1/single-consents/{consent_id} before creating a payment. The consent becomes Revoked, and a subsequent POST /payments/v1/payments fails with 422 BP015.