Accept PayTo payments
This guide describes how to offer PayTo as a payment method on your checkout page using Native API integration.
You can accept PayTo payments in three simple steps:
- Create and verify a Payment Consent
- Confirm your Payment Intent with a verified Payment Consent
- Query Payment Consent status
Step 1. Create and verify a Payment Consent
Create a Payment Consent using the Create a Payment Consent API API
Example request:
Example response:
Ask your customer to authorize the payment agreement via verify Payment Consent API
Example request:
Example response:
Step 2. Confirm Payment Intent with a verified Payment Consent
Create a Payment Intent using the Create a Payment Intent API API.
Example request:
Example response:
To collect with PayTo, Confirm your Payment Intent API with a verified Payment Consent
Example request:
Example response:
Step 3. Query your Payment Consent status
Customers may authorize, pause, or cancel a payment agreement at any time. Airwallex will notify you of any change to the consent status via webhook. Please refer to the webhook documentation to set up your webhook accordingly.
| Event | Webhook |
|---|---|
| Customer authorizes the payment agreement | payment_consent.verified |
| Customer declines or does not authorize the payment agreement before expiry | payment_consent.verification_failed |
| Customer pauses an active agreement | payment_consent.paused |
| Customer cancels an active agreement | payment_consent.disabled |
Sample webhook
Demo scenarios
| Scenarios | Variables |
|---|---|
| Successfully verify a payment consent |
• Set fixed_payment_amount or max_payment_amount != 400• Wait for ~5s for the consent to move to the VERIFIED state
|
| Failed to verify a payment consent |
• Set fixed_payment_amount or max_payment_amount = 400• Wait for ~5s for the consent to move to the DISABLED state
|
| Successfully initiate a payment |
After successfully verifying the consent: • Create a payment intent with an amount != 400• Wait for ~5s for the intent to move to the SUCCEEDED state
|
| Failed to initiate a payment |
After successfully verifying the consent: • Create a payment intent with an amount of 400• Wait for ~5s for the intent to move to the FAILED state
|
| Successfully refund |
Once the payment has SUCCEEDED, you can create a partial or full refund:• The refund amount must not exceed the original payment amount. • Wait for ~5s for the intent to move to PARTIALLY REFUNDED or FULLY REFUNDED state
|
| Failed to refund |
• Trigger a refund with the refund amount of 4• Wait for ~5s for the intent to move to REFUND_FAILED state
|