PayTo Pay & Subscribe

Collect payment and setup PayTo agreement for future payments

Key use cases:

  • Collect an initial amount, while setting up a recurring PayTo agreement
  • Recurring PayTo agreement can be for a recurring regular amount, or a flexible PayTo agreement for future ad-hoc payments

Initial payment and then recurring subscription payment

This use case for PayTo allows merchants to use the Pay By Bank UX solution for payment capture and setup of recurring payment agreement with their customers.

This combines an initial payment with recurring payments, enabling ongoing billing relationships with minimal integration effort.

Key features

  • Initial Payment – One-time setup payment or first billing cycle amount.
  • Recurring Payments – Collect ongoing payments via a simple API call.
  • Automatic Agreement Creation – Payment agreements are created during checkout, linking initial and recurring amounts.

Making an initial payment and setting up ongoing subscription payments

  1. Customer lands on the Pay by Bank main landing page
  2. PayID Entry: Customer enters their PayID (email or phone)
  3. Verification: PayID is verified and account holder name is displayed

  1. Confirmation: Customer confirms the payment details and authorises the PayTo agreement in their online banking or mobile banking app

  1. Processing: Initial payment is processed through the NPP (New Payments Platform)

How do I use it?

  1. Create a payment request with API request mandatory fields, paymentAmountAND recurringPaymentAmount +recurringPaymentFrequency
Create Payment Request
POST /paymentRequest

Headers:
   Authorization: your-api-key
   Content-Type: application/json
   Request Body:
{
  "PaymentRequest": {
    "clientId": "your-client-id",
    "clientTransactionId": "unique-transaction-id",
    "paymentAmount": 100.00,
    "recurringPaymentAmount": 50.00,
    "recurringPaymentFrequency": "ANNUAL",
    "paymentDescription": "Annual subscription setup",
    "paymentNotification": {
      "paymentNotificationEndpointUrl": "https://my-webhook.merchantname.com",
      "paymentNotificationAuthorizationHeaderValue": "webhook-secret"
    }
  }
}
{
  "PaymentRequest": {
    "clientId": "your-client-id",
    "clientTransactionId": "unique-transaction-id",
    "paymentAmount": 100.00,
    "recurringPaymentAmount": 50.00,
    "recurringPaymentFrequency": "ANNUAL",
    "paymentDescription": "Annual subscription setup",
    "checkoutUrl": "https://pay.azupay.com.au/xxxx/pay"
  },
  "PaymentRequestStatus": {
    "paymentRequestId": "abc123",
    "status": "WAITING",
    "createdDateTime": "2024-01-15T10:30:00Z"
  }
}
  1. Present checkoutUrl to your customer returned in the 200 response

Redirect Customer to Checkout

Once you receive the response, redirect your customer to the checkoutUrl from the response:

If you are not embedding this checkoutUrl inside an iframe on your checkout app then provide the following additional query parameters to the checkout url:

redirectURL: the url that a successfull transaction should be redirected to.

cancelRedirectURL: the url that an unsuccessfull transcation should be redirected to.

const checkoutUrl = response.PaymentRequest.checkoutUrl;
// Create a URL object
const url = new URL(checkoutUrl);
// Add your redirect URLs
url.searchParams.set("redirectURL", "[https://example.com/success](https://example.com/success)");
url.searchParams.set("cancelRedirectURL", "[https://example.com/cancel](https://example.com/cancel)");
// Redirect
window.location.href = url.toString();
  1. Once a customer approves the PayTo agreement:
    1. A Payment agreement is created for regular recurring payments at the specified recurring amount and frequency
    2. A payment initiation is automatically triggered for the payment Amount specified (not the recurring amount)
    3. Future payments can be initiated against the PayTo agreement
  2. Initiate PayTo payment(s) regularly at agreed intervals against the agreement
    1. Handle payment initiation webhook

Verify Payment agreement details

At the time of successful initial payment completed, a Payment Agreement is created for regular recurring payments, a payment agreement is created with the following properties

  • firstPaymentAmount: The initial payment amount that was processed
  • amount: The recurring payment amount for future payments
  • frequency: The payment frequency (WEEKLY, MONTHLY, ANNUAL)
  • endDate: Null for open-ended

Initiate recurring payments

To initiate a recurring payment using the payment agreement after the first period has elapsed, use the payment initiation endpoint: https://api-uat.azupay.com.au/v1/paymentInitiation and refer to the following API file spec and guides for detailed information on initiating a PayTo payment:


📘

When paymentAmount, recurringPaymentAmount and recurringPaymentFrequency fields are provided in the request the UX will remove the PayID option and will only enable PayTo checkout. If neither is provided then it will present the UX depending what was configured in the Client Dashboard Apps Settings.