Real Time Payin Workflow

📘

Australia only

This guide is for platforms operating in Australia.

Overview

This integration guide will run you through how to use Real Time payments (which uses the NPP banking technology) to directly fund a user’s digital wallet with Zai.

For your customers to send funds via this payment method, they need to enter your PayID details into their internet banking portal. The banks often refer to this as 'pay anyone' or 'PayID'. Once those funds arrive (in near real-time), we will notify you via a webhook (callback) and you can move those funds via an Item as needed.

Getting Started

Before you can run your Real Time payin workflow there are a few setup steps that need to be completed so that all of the pieces are available.

Prerequisites
You will need to provide specific details to your users for them to be able to send funds via the NPP including both a PayID unique to your platform as well as their individual reference number. If the funds they send us cannot be matched, they will be automatically returned to their account and no callback will be thrown for that user.

Terminology used
The following terminology is used throughout this guide:

  • Platform​ refers to you as a Zai customer, or your website, application, marketplace etc.
  • User​ refers to your customer who has a User record in Zai.
  • Item​ is the mechanism for moving funds between users in the API.
  • Payin​ is money being paid into the Zai ecosystem from a bank account.
  • Payout​ is money being paid out of the Zai ecosystem to a bank account.

API steps

  1. Check if a ​user​ exists in Zai already
    GET /users/:id
  2. Create ​user​ in Zai if it doesn’t exist in step 1.
    POST /users
  3. Update ​user​ in Zai if it does exist in step 1.
    PATCH /users/:id
  4. Get the ​digital wallet​ account ID for the user
    GET /users/:id/wallet_accounts
  5. Get the Osko/NPP reference details for the user
    GET /wallet_accounts/:id/npp_details
  6. (Pre-live Only) Fund a user’s digital wallet with NPP
    PATCH /testing/wallet_accounts/process_npp_payin
{
  "crn": "Customer reference number - reference from wallet", 
  "payid":"PayID - pay_id from wallet",
  "amount": 10000 // Amount in cents,
  "payee_name": "Name of the payee",
  "remittance_information": "Test npp payin"
  
}
  1. (Once off) Set up a ​Callback​ (webhook) on the transactions object to be notified of incoming NPP funds.
    POST /callbacks
"object_type": "transactions",
  1. Create ​Item​ (use Type=2) to pay the Payin account from the user’s account.
    POST /items
  2. Fund the ​Item​ with the user’s ​digital wallet​ account.
    PATCH /items/:id/make_payment

Design considerations

When designing how this workflow will interface with your platform, we suggest storing a map of specific object IDs on your side in order to reduce the number of API calls required throughout the API workflow.

User data design

your_customer_idzai_user_idzai_bank_account_idzai_digital_wallet_idzai_user_npp_crn
100010015b8f59b6-32c1-44a3-8f5b-b9e2c77bc265fb35b028-76fb-44df-86ac-822dccf1cd7ddcdfdb78-27e7-485d-90c0-11ffbf950d721000023456
10001002efe6f8c1-0a30-484a-b085-9d9d0539dbfc4355de7b-18c2-4892-b800-b7bbb6f0a9b3054cd04e-19f1-4938-908b-8e9e5c212f4d1000098653

Payin data design
Once you’ve run through the API steps, and implemented something like the above in your platform, the sequence of calls to run the Payin's workflow in production will be reduced to:

  1. Create user in Zai if it doesn’t exist in step 1.
    POST /users
  2. Update user in Zai if it does exist in step 1.
    PATCH /users/:id
  3. Catch the callback when the user’s digital wallet is funded via NPP.
  4. Create Item to pay the Payin account from the user’s account.
    POST /items
  5. Fund the Item with the user’s digital wallet account.
    PATCH /items/:id/make_payment
your_payin_idzai_item_idzai_batch_transaction_id
300010011563db1c-add2-4dcd-ae20-5 ad3802bf1c41ddb9cbb-90a7-41c6-bbbe-0 5e44f3134f1
30001002f827dbb5-ba17-4241-a282-1 4336351faff445bbaf3-c9bc-41aa-aec4-c 9a99944941d