Online Pet Shop: E-Commerce 1-Click Checkout
Scenario A: Online Pet Shop, Luna Store, is an Australian e-commerce retailer that wants to enable Pay by Bank as a one-click checkout payment method. They need to have payment mandates in place so that users can make one-click payments going forward. These mandates will have no end date and will be variable amounts, because the users’ cart size will be different for each purchase.
Step 1: The customer agrees to use Pay by Bank for 1-Click checkout at Online Pet Shop. The customer authorizes the mandate in their banking app.
Step 2: Online Pet Shop creates a Pay by Bank mandate.
Example Request
POST /v2/mandates
jsoncurl --location --request POST "https://api.banked.com/v2/mandates" \ --header "Content-Type: application/json" \ --user "YOUR_API_KEY:YOUR_API_SECRET" \ --data " { "currency": "AUD", "external_reference": "54a4fa72-d7b1-4328-b8c2-5a35c730cc2b", "description": "Enable 1-click checkout for Outback Pet Shop online purchases.", "destination": { "account_type": "banked_bank_account", "bank_account_id": "52e7bedc-2775-4d07-805d-a30fbc0b6a22" }, "payment_terms": { "terms_type": "variable", "frequency": "adhoc", "count": 10, "max_amount": 100000 // (in cents) required in Australia }, "source": { "account_type": "plain_bank_account", "account_owner_name": "Gerald Wiley", "account_identifier": { "identifier_type": "BSBAccountNumber", "bsb": "111114", "account_number": "020211" } }, "actions": [ { "action_type": "create_mandate_attempt" } ] }
Sample 200 Response
json{ "authorisation_timeout": 600, "created_at": "2025-05-19T14:40:06Z", "currency": "AUD", "description": "Enable 1-click checkout for Outback Pet Shop online purchases.", "external_reference": "54a4fa72-d7b1-4328-b8c2-5a35c730cc2b", "id": "b8a20e79-d1cd-4395-a22b-3340c3192ed1", "latest_action": { "action_type": "create_mandate_attempt", "created_at": "2025-05-19T14:40:06Z", "id": "5ef5074b-5068-42a4-8f58-19ae1f7f799c", "mandate_id": "b8a20e79-d1cd-4395-a22b-3340c3192ed1", "status": "completed" }, "mode": "test", "next_actions": { "alternate_paths": [ { "action_type": "cancel_current_mandate_attempt" } ], "completion_paths": [ { "action_type": "await" } ] }, "payment_terms": { "count": 10, "frequency": "adhoc", "max_amount": 100000, "terms_type": "variable" }, "validity_start_date": "2024-08-01", // will default to current date "validity_end_date": null, // null when not specified in the request "state": "created", "token": "7e230d62-c455-4948-951d-a0b82851d1b7", "url": "https://mandates.dev.banked.com/au/mandate/b8a20e79-d1cd-4395-a22b-3340c3192ed1?token=<TOKEN>" }
Step 3: User is now able to complete 1-click payments per the active mandate.
Online Pet Shop will initiate 1-click payments using
POST /v2/payment_sessions
.Post Request
POST /v2/payment_sessions
json{ "reference": "oioiWI09", "external_reference": "external-reference", "amount": 400, "mandate": { "token": "00000000-0000-0000-0000-000000000000" }, "actions": [ { "action_type": "init_attempt" } ] }
Sample 201 Response
json{ "amount": 400, "amount_formatted": "$4.00", "business_application_id": "a487760b-111f-4f4e-b954-4e9dad74ca9d", "created_at": "2025-05-19T14:53:35.430Z", "currency": "AUD", "email_receipt": false, "end_to_end_id": "B-XjgQcc8SAmH6e", "error_url": null, "external_reference": "external-reference", "id": "690684ee-e27a-48e8-8086-d38ec4bb67b5", "live": false, "mandate_id": "b8a20e79-d1cd-4395-a22b-3340c3192ed1", "next_actions": { "alternate_paths": [ { "action_type": "cancel_payment" }, { "action_type": "create_payment_attempt", "input_options": [ "SOURCE_BSB", "SOURCE_PAYID" ] }, { "action_type": "cancel_current_payment_attempt" } ], "completion_paths": [ { "action_type": "init_attempt" } ] }, "payee": { "account_identifier": "111114-050511", "bank_account_id": "52e7bedc-2775-4d07-805d-a30fbc0b6a22", "identifier_type": "BSBAccountNumber", "name": "Lucian " }, "reference": "oioiWI09", "sent_at": null, "state": "awaiting_provider", "success_url": null, "updated_at": "2025-05-19T14:53:35.430Z", "url": "https://checkout.dev.banked.com/au/690684ee-e27a-48e8-8086-d38ec4bb67b5?token=eyJhbGciOiJIUzM4NCIsImtpZCI6IjEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJiYW5rZWQiLCJpYXQiOjE3NDc2NjY0MTUsImp0aSI6IjYwMzNmYmZiLTJkMWMtNDVkNy1hMjgwLTRjYTgyMTRiN2YyYiIsImJhaSI6ImE0ODc3NjBiLTExMWYtNGY0ZS1iOTU0LTRlOWRhZDc0Y2E5ZCIsInBpaSI6IjY5MDY4NGVlLWUyN2EtNDhlOC04MDg2LWQzOGVjNGJiNjdiNSJ9.mBBE1HcRriZhHSIssdlonZJRfZkwxJPMj7KAyA0VNHQoDNQqPjmgzNpigMZBEvPn" }
Bonus Step 4: Online Pet Shop wants to retrieve the mandate details so that they can validate mandate status before making payments. Online Pet Shop can retrieve details using
GET /v2/mandates/{mandate_id}
for individual mandates orGET /v2/mandates
for multiple mandates, up to a max of 100 items.Sample Request GET
v2/mandates/b8a20e79-d1cd-4395-a22b-3340c3192ed1
Sample Response:
json{ "authorisation_timeout": 600, "created_at": "2025-05-19T14:40:06Z", "currency": "AUD", "description": "Enable 1-click checkout for Outback Pet Shop online purchases.", "external_reference": "54a4fa72-d7b1-4328-b8c2-5a35c730cc2b", "id": "b8a20e79-d1cd-4395-a22b-3340c3192ed1", "latest_action": { "action_type": "create_mandate_attempt", "created_at": "2025-05-19T14:40:06Z", "id": "5ef5074b-5068-42a4-8f58-19ae1f7f799c", "mandate_id": "b8a20e79-d1cd-4395-a22b-3340c3192ed1", "status": "completed" }, "mode": "test", "network_mandate_id": "25c733c3-bb7d-4afe-87ae-6d6e81d5d77b", "next_actions": { "alternate_paths": [ { "action_type": "cancel_current_mandate_attempt" }, { "action_type": "amend_mandate" } ], "completion_paths": [] }, "payment_terms": { "count": 10, "frequency": "adhoc", "max_amount": 100000, "terms_type": "variable" }, "state": "active", "token": "7e230d62-c455-4948-951d-a0b82851d1b7", "url": "https://mandates.dev.banked.com/au/mandate/b8a20e79-d1cd-4395-a22b-3340c3192ed1?token=<TOKEN>" }
Bonus Step 5: User would like to cancel the mandate.
If a user initiates a request with their bank to cancel their mandate in favor of no mandate or a new mandate or for any reason, Online Pet Shop will receive status webhooks and can make updates to specific mandates using
POST /v2/mandates/{mandate_id}/actions
. See below for a sample cancellation:Sample Request
POST
v2/mandates/b8a20e79-d1cd-4395-a22b-3340c3192ed1/actions
json{ "action_type": "cancel_current_mandate_attempt", "payload": { "reason": "customer_requested", "narrative": "Customer no longer wants to proceed" // free text field to store a description to accompany the given reason code } }
Sample 200 Response
json{ "action_type": "cancel_current_mandate_attempt", "created_at": "2025-05-19T15:25:43Z", "id": "870ff85b-6b8b-45d6-b010-f481fe2c56f8", "mandate_id": "b8a20e79-d1cd-4395-a22b-3340c3192ed1", "status": "completed" }
Banked Telecom: Monthly Subscription Billing
Scenario B: Banked Telecom is a regional telecommunications service provider that wants to offer Pay by Bank as a payment options for their customers who make fixed monthly payments to pay their internet bill. Their payment mandates will specify the amount that is authorized or payment have an end date depending on the nature of their service agreement with the customer.
Step 1: The customer agrees to use Pay by Bank to pay their monthly home internet plan. The customer authorizes the payment in their banking application.
Step 2: Banked Telecom creates a Pay by Bank mandate.
Start by initiating a call to
POST /v2/mandates
with the request body:json{ "currency": "AUD", "external_reference": "KangatelExtRef123456", // set by merchant "description": "Monthly billing - KangaTel Basic Plan", "destination": { "account_type": "banked_bank_account", "bank_account_id": "d8e74781-5fdb-40c8-9d08-54da83495efb" }, "payment_terms": { "terms_type": "fixed", "frequency": "monthly", "max_amount": 6000,// set relative to the price plan }, "validity_start_date": "2024-08-01", "validity_end_date": null, // set if the service contract has an expiration date "actions": [ { "action_type": "create_mandate_attempt", "payload": { "customer_ip_address": "127.0.0.1", "source": { "account_type": "plain_bank_account", "account_owner_name": "Gerald Wiley", "account_identifier": { "identifier_type": "BSBAccountNumber", "bsb": "111111", "account_number": "0312345678" } } } }, ] }
Sample 200 Response
json{ "id": "8086851c-14ac-4341-97dd-bfa17da0f045", "mode": "test", "state": "created", "created_at": "2023-08-01T12:32:00.000Z", "currency": "AUD", "external_reference": "KangatelExtRef123456", "description": "Monthly billing - KangaTel Basic Plan", "token": "c147cce1-3099-436d-a163-14dece454797", "payment_terms": { "terms_type": "fixed", "frequency": "monthly", "amount": 6000, }, "validity_start_date": "2024-08-01", "validity_end_date": null, "latest_action": { "id": "bf409f6f-e060-454c-8c09-2f6adcb2554b", "mandate_id": "8086851c-14ac-4341-97dd-bfa17da0f045", "action_type": "create_mandate_attempt", "status": "in_progress", "created_at": "2023-08-01T12:30:00.000Z" }, "next_actions": { "completion_paths": [ { "action_type": "await" } ], "alternate_paths": [ { "action_type": "cancel_mandate" } ] } }
Step 3: Each month on the billing date, Banked Telecom initiates a Pay by Bank transaction per the active mandate.
Banked Telecom will initiate monthly bill payments using
POST /v2/payment_sessions
.json{ "error_url": null, // not required for account not present transactions "success_url": null, // not required for account not present transactions "reference": "KangaTelOrder123456", "external_reference": "external-reference", "amount": 6000, "payee": { "name": "KangaTel", "account_number": "12345678", "sort_code": "123456" }, "payer": { "name": "John Doe", "email": "john.doe@banked.com" }, "mandate": { "token": "c147cce1-3099-436d-a163-14dece454797" } }
Step 4: The user upgrades their KangaTel plan, and Banked Telecom updates the payment mandate.
Banked Telecom will create an action against an active mandate to update the mandate using
POST /v2/mandates/{mandate_id}/actions
.json{ "action_type": "amend_mandate", "payload": { "changes": { "payment_terms": { "max_amount": 10000 } } } }