Integration guide

How do I use it?

  1. Create a payment request with API request mandatory fields AND recurringPaymentAmount +recurringPaymentFrequency
  2. Present checkout.url to your customer
  3. Customer makes initial payment with Pay By Bank by providing PayID details
  4. At the time of successful initial payment completed, a Payment agreement is created for regular recurring payments
  5. Initiate PayTo payment(s) regularly at agreed intervals against the agreement

Key configurations / decisions

Experience

Configuration

Comments and guidance

Payment method selection

defaultLandingProduct

If defaultLandingProduct is 'PayTo', Pay By Bank is pre-selected

If defaultLandingProduct is 'PayID', Bank Transfer is pre-selected

Agreement frequency

recurringPaymentFrequency

WEEKLY - Weekly recurring payments

MONTHLY - Monthly recurring payments

ANNUAL - Annual recurring payments

Recurring payment amount

recurringPaymentAmount

Amount for the recurring payments


Create PaymentRequest for Pay & Subscribe UX solution

To use the Pay & Subscribe UX solution:

  • Call the paymentAgreementRequest API using POST method at https://api-uat.azupay.com.au/v1/paymentRequest .
    To create a payment request that includes subscription setup, include the following mandatory fields as specified in the in API reference for Create a Payment Request file spec and also must include: recurringPaymentAmount,recurringPaymentFrequency
  • In the response body of the POST /v1/paymentRequest call, there will be a field called PaymentRequestStatus.checkoutUrl
  • Once you receive the response load the Pay & Subscribe main landing page by redirecting your customer to the checkoutUrl from the API response

Sample 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-endpoint3df3.free.beeceptor.com",
      "paymentNotificationAuthorizationHeaderValue": "Secret Value"
    }
  }
}

Sample response:

{
  "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"
  }
}

📘

When both the 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.

Payment agreement structure

  1. 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

Initiating 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: