Pay & Subscribe (Payto) - integration
How do I use it?
- Create a payment request with API request mandatory fields AND
recurringPaymentAmount+recurringPaymentFrequency - Present
checkout.urlto your customer - Customer makes initial payment with Pay By Bank by providing PayID details
- At the time of successful initial payment completed, a Payment agreement is created for regular recurring payments
- Initiate PayTo payment(s) regularly at agreed intervals against the agreement
Create PaymentRequest for Pay & Subscribe use case
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
checkoutUrlfrom 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 therecurringPaymentAmountandrecurringPaymentFrequencyfields 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.
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 processedamount: The recurring payment amount for future paymentsfrequency: 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:
Updated 2 days ago
