Create Intent API
The Intent API is used to generate an intent token that encapsulates the payment context for a transaction.
This token is then used to initialise the Master Widget.
Endpoint
POST https://api.preproduction.powerboard.commbank.com.au/v1/checkouts/intent
Request Schema
{
"amount": number,
"version": number,
"currency": "string",
"description": "string",
"reference": "string",
"reference2": "string",
"customisation": {
"template_id": "string"
},
"configuration": {
"template_id": "string"
},
"customer": {
"email": "string",
"phone": "string",
"billing_address": {
"first_name": "string",
"last_name": "string",
"address_line1": "string",
"address_line2": "string",
"address_city": "string",
"address_state": "string",
"address_country": "string",
"address_postcode": "string"
}
}
}
Field Validation
As there are various payment gateway types that are able to be surfaced within the Master Widget, this means there are also different field validations applied per-gateway.
Note: If a merchant is attempting to render a set of payment gateway methods in the master widget but does not provide the relevant fields in the intent request in order to meet minimum validation across all payment methods attempting to be rendered, an API validation error will be returned in response to the intent request.
Field path in intent API request | Required | Additional conditions |
---|---|---|
amount | - | |
version | - | |
currency | - | |
description | - | |
reference | - | |
reference2 | - | |
customisation | - | |
customisation.template_id | - | |
configuration | - | |
configuration.template_id | - | |
customer | +- | Required if: configuration.payment_method_options.afterpay_checkout OR configuration.payment_method_options.zip_checkout existsNote: This indicates that at least one field of customer._ array needs to be provided for Afterpay and Zip gateway types. |
customer.email | +- | Required if: configuration.payment_method_options.afterpay_checkout OR configuration.payment_method_options.zip_checkout exists |
customer.phone | - | Optional |
customer.billing_address.last_name | +- | Required if: configuration.payment_method_options.afterpay_checkout OR configuration.payment_method_options.zip_checkout exists |
customer.billing_address.first_name | +- | Required if:configuration.payment_method_options.afterpay_checkout OR configuration.payment_method_options.zip_checkout exists |
customer.billing_address.address_line1 | +- | Required if: configuration.payment_method_options.cybersource_card OR configuration.payment_method_options.zip_checkout exists |
customer.billing_address.address_postcode | +- | Required if: configuration.payment_method_options.zip_checkout exists |
customer.billing_address.address_country | +- | Required if: configuration.payment_method_options.cybersource_card OR configuration.payment_method_options.zip_checkout exists |
customer.billing_address.address_city | +- | Required if: configuration.payment_method_options.cybersource_card OR configuration.payment_method_options.zip_checkout exists |
customer.billing_address.address_state | +- | Required if: configuration.payment_method_options.zip_checkout exists |
customer.billing_address.address_line2 | - | Optional |
Legend:
+
= required-
= optional+-
= conditional
Important Notes
- Each intent token is active for 15 minutes. Users must complete their payment within this timeframe.
- The
customisation.template_id
andreference
fields are optional in the Create Intent API request. - If you modify the payment amount during checkout (e.g., applying coupon codes), you must regenerate the intent and reinitialise the widget.
Updated about 13 hours ago