Airwallex logo

Accept Wero payments

Copy for LLMView as Markdown

You can accept Wero in three simple steps:

  1. Initialize a Payment Intent
  2. Confirm the intent with Wero as payment method
  3. Query the payment status

Step 1. Initialize a Payment Intent

Create a Payment Intent with the Create a Payment Intent API API.

Shell
1curl -X POST https://api-demo.airwallex.com/api/v1/pa/payment_intents/create \
2 -d '{
3 "request_id": "ed11e38a-7234-11ea-aa94-7fd44ffd1b89",
4 "amount": 200,
5 "currency": "EUR",
6 "merchant_order_id": "85d7b0e0-7235-11ea-862e-9f6aa1adfca6",
7 "return_url": "https://www.airwallex.com",
8 "order": {
9 "products": [
10 {
11 "name": "IPHONE7",
12 "quantity": 5,
13 "unit_price": 40
14 }
15 ],
16 "shipping": {
17 "address": {
18 "country_code": "GB",
19 "city": "xxx",
20 "state": "xxx",
21 "postcode": "546080",
22 "street": "16 Sandilands Road"
23 }
24 }
25 }
26 }'

Example response:

JSON
1{
2 "id": "int_hkdmtp6o2a3E3p8Oqxfkg00",
3 "request_id": "ed11e38a-7234-11ea-aa94-7fd44ffd1b89",
4 "amount": 200,
5 "currency": "EUR",
6 "merchant_order_id": "85d7b0e0-7235-11ea-862e-9f6aa1adfca6",
7 "status": "REQUIRES_PAYMENT_METHOD"
8}

Step 2. Confirm the intent with Wero as payment method

JSON
1{
2 "request_id": "c4a8a00a-3426-4f37-8d08-9bab98e97d50",
3 "payment_method": {
4 "type": "wero",
5 "wero": {
6 "billing": {
7 "date_of_birth": "2011-10-12",
8 "email": "[email protected]",
9 "first_name": "Jim",
10 "last_name": "RYKG",
11 "phone_number": "+4408082580300",
12 "address": {
13 "country_code": "GB",
14 "city": "London",
15 "state": "xxx",
16 "street": "5th Avenue",
17 "postcode": "10001"
18 }
19 }
20 }
21 }
22}

Sample response

JSON
1{
2 // ... other fields omitted.
3 "next_action": {
4 "type": "redirect",
5 "method": "GET",
6 "url": "https://api-staging.airwallex.com/pa/redirect/sg/sgstrjvkzhk60cywvjk_cwvvek?checksum=75f7b58cc2d1"
7 },
8}

Step 3. Query the payment result status

To get the payment result, we suggest polling the Payment Intent status via the Retrieve a Payment Intent API API.

Airwallex also notifies you of payment results asynchronously via webhooks. Refer to the webhook documentation to set this up. Although subscribing to webhook events is optional, we recommend subscribing to the payment_intent.succeeded webhook. You can also subscribe to the payment_intent.succeeded webhook event to receive real-time notifications when a payment is completed, instead of polling.

Was this page helpful?