Details
# airwallex-agentos plugin (Claude Code / Cursor / Codex)
Teaches Claude, Cursor, and Codex how to use Airwallex across Billing, Payouts, Issuing, and Treasury, through either the `airwallex` CLI or an Airwallex MCP server.
The same skills work on every supported surface. Each `SKILL.md` is surface-neutral: the workflow logic is shared, and the agent picks up the surface-specific details (command names, tool names, auth, pagination) from `awx-best-practices/references/surface-quickstart.md` and from the connected toolchain itself.
## Skills
| Skill | Category | Description |
| --- | --- | --- |
| [contract-to-billing](skills/contract-to-billing/SKILL.md) | Billing | Extract billing details from POs/contracts/quotes, match existing resources, and create invoices and/or subscriptions |
| [beneficiary-creation](skills/beneficiary-creation/SKILL.md) | Payouts | Extract bank details from supplier documents, validate per-country schemas, and create beneficiaries |
| [card-provisioning](skills/card-provisioning/SKILL.md) | Issuing | Create cardholders and issue virtual or physical corporate cards with spend limits, and manage card spending |
| [manage-cashflow](skills/manage-cashflow/SKILL.md) | Treasury | Aggregate multi-currency balances, receivables, obligations, FX exposure, and indicative rates (conversion execution via Airwallex Dashboard) |
| [awx-best-practices](skills/awx-best-practices/SKILL.md) | Fallback | Ad-hoc operations, troubleshooting, and domains not covered by a workflow skill above |
### Skill file structure
Each workflow skill is self-contained in a single `SKILL.md` (workflow, examples, gotchas). Larger skills carry a `references/` folder with templates and pitfall notes that the agent loads only when it needs them:
```
skills/awx-best-practices/
├── SKILL.md # Domain routing, auth rules, refusal templates
└── references/
├── api_traps.md # Common API pitfalls and workarounds
└── surface-quickstart.md # CLI- and MCP-specific operating rules
```
## Plugin structure
```
airwallex-agentos/
├── .claude-plugin/plugin.json
├── .codex-plugin/plugin.json
├── .cursor-plugin/plugin.json
├── .cursor-mcp.json
├── .mcp.json
├── assets/
│ ├── icon.svg
│ └── logo.svg
├── references/
│ └── feedback.md
├── README.md
└── skills/
├── contract-to-billing/
│ └── SKILL.md
├── beneficiary-creation/
│ └── SKILL.md
├── card-provisioning/
│ ├── SKILL.md
│ └── references/
│ └── card-templates.md
├── manage-cashflow/
│ ├── SKILL.md
│ └── references/
│ └── response-templates.md
└── awx-best-practices/
├── SKILL.md
└── references/
├── api_traps.md
└── surface-quickstart.md
```
## Prerequisites
You need **at least one** of the following toolchains available. The skills detect which one the agent is using and act accordingly.
- **CLI:** `airwallex` CLI installed and authenticated (`airwallex auth login`).
- **MCP:** An Airwallex MCP server connected to your Claude Code, Cursor, or Codex client. Configure the MCP server entry per your host's MCP setup docs.
## skills/awx-best-practices/SKILL.md
---
name: awx-best-practices
description: Fallback Airwallex skill — works with the Airwallex CLI or the Airwallex MCP server. Use ONLY when no dedicated workflow skill matches the task. Covers ad-hoc operations (list, get, update, delete, void, cancel), general Airwallex API questions, troubleshooting, and domains not covered by a workflow skill (payment links, refunds, disputes, spend management, financial reports). Do NOT load this skill alongside a workflow skill — each workflow skill is self-contained. For invoices/billing/coupons/meters/credit notes use contract-to-billing, for suppliers/beneficiaries use beneficiary-creation, for cards use card-provisioning, for balances/FX/cashflow use manage-cashflow.
metadata:
author: Airwallex
version: 0.1.0
compatibility: Works with the Airwallex CLI (`airwallex` binary on PATH, authenticated via `airwallex auth login`) or the Airwallex MCP server (enabled and authenticated).
---
# Airwallex Best Practices
Fallback skill for Airwallex tasks. **Use only when no dedicated workflow skill fits.** Each workflow skill (beneficiary-creation, card-provisioning, contract-to-billing, manage-cashflow) is self-contained — do NOT load this skill alongside them.
## When to use
- Ad-hoc operations (list, get, update, delete, void, cancel, deactivate)
- General Airwallex API questions or troubleshooting
- Payment links, refunds, disputes, spend management, financial reports, and other domains not covered by a dedicated workflow skill
## Use a workflow skill instead
| Task | Skill |
| --- | --- |
| Create invoice from PO/contract/quote | **contract-to-billing** |
| Coupons, meters, usage events, credit notes | **contract-to-billing** |
| Onboard suppliers / create beneficiaries | **beneficiary-creation** |
| Provision corporate cards | **card-provisioning** |
| Cash position, FX, balances, rebalancing | **manage-cashflow** |
If a workflow skill matches, use that skill instead — do NOT load this one alongside it.
## Out of scope — refuse and redirect
Do NOT attempt to fulfill these by aggregating API calls. State plainly that the capability is not available, explain the closest alternative, and offer to help with it.
| Request pattern | Why out of scope | Redirect |
| --- | --- | --- |
| "Forecast", "hedging strategy", "FX prediction" | Agent provides indicative spot rates only | Offer **manage-cashflow** for current exposure and indicative FX rates |
| "Yield", "investment advice", "idle funds", "automated top-up", "should I lock a rate?" | Financial advice or unsupported treasury action | Offer **manage-cashflow** for current balances, obligations, and informational indicative FX only |
---
## Environment quickstart
See [references/surface-quickstart.md](references/surface-quickstart.md) for full per-surface details (auth, discovery, write safety, pagination, error handling).
---
## Operational rules
- **NEVER fabricate or assume missing information.** If any required field is uncertain — STOP and ask the user.
- **Always fetch fresh data** — re-fetch before every step.
- **If the user supplied a file or attachment, treat it as primary ground truth** unless they ask for live data.
- **For ambiguous-intent requests, confirm the action before starting.**
- **Never overclaim unsupported capabilities.** Transfers, payouts, FX execution, PAN/CVV retrieval: refuse immediately, state what is not available, offer the closest alternative.
- **Do not provide financial advice.** Never recommend yield, investment products, automated top-ups, hedging strategy, FX prediction, or rate-locking. For treasury questions, redirect to **manage-cashflow** and keep any FX discussion informational and clearly labelled as indicative.
- **Split supported and unsupported asks.** Complete the supported portion and clearly state what was not configured.
- **Prefer business labels over raw IDs in user-facing output.** Show human-readable business labels (customer names, product names, beneficiary names, card nicknames, etc.) instead of raw system IDs whenever possible. Only show IDs when they are operationally necessary for follow-up actions, verification, troubleshooting, or when the user explicitly asks for them.
## Core Airwallex concepts
- **One wallet, multiple currencies.** Say "AUD balance" — never "AUD wallet."
- **Invoices = receivables (money in).** Issued BY the user TO their customers.
- **Bills = payables (money out).** Money the user owes to suppliers.
- **FX conversions happen within one wallet** — not between wallets.
---
## Consequential operations
These are **irreversible or high-impact**. Before executing ANY of them: (1) confirm and state the environment (sandbox vs production), (2) explain the effect, (3) get explicit user confirmation.
| Operation | CLI | MCP | Notes |
| --- | --- | --- | --- |
| Void invoice | `airwallex --confirm invoices void <id>` | invoke the billing-invoice void tool | Irreversible. FINALIZED+UNPAID only. |
| Delete draft invoice | `airwallex --confirm invoices delete <id>` | _not exposed_ | DRAFT only. |
| Finalize invoice | `airwallex --confirm invoices finalize <id>` | invoke the billing-invoice finalize tool | Irreversible — cannot edit after. |
| Mark invoice paid | `airwallex --confirm invoices mark-as-paid <id>` | invoke the billing-invoice mark-as-paid tool | Must be FINALIZED. Use when paid outside Airwallex. |
| Cancel subscription | `airwallex --confirm subscriptions cancel <id>` | invoke the subscription cancel tool | Check flags via schema. |
| Deactivate card | `cards update <id>` body `{"status":"INACTIVE"}` | card-update tool with `card_status: INACTIVE` | Reversible. See [references/api_traps.md](references/api_traps.md) for which statuses are NOT settable here. |
| Close card | `cards update <id>` body `{"status":"CLOSED"}` | card-update tool with `card_status: CLOSED` | **Permanent.** |
| FX conversion | **Airwallex Dashboard only** | **Airwallex Dashboard only** | Not executable via either surface. |
| Finalize credit note | `airwallex --confirm credit-notes finalize <id>` | _credit-note tools not exposed — use the CLI or the Airwallex Dashboard_ | Irreversible. |
| Void credit note | `airwallex --confirm credit-notes void <id>` | _credit-note tools not exposed — use the CLI or the Airwallex Dashboard_ | Irreversible. |
| Close global account | `airwallex --confirm global-accounts close <id>` | invoke the global-account close tool if exposed | **Permanent.** |
| Delete cardholder | `airwallex --confirm cardholders delete <id>` | invoke the cardholder delete tool if exposed | Ensure no active cards. |
---
## Error handling
| Situation | Action |
| --- | --- |
| Required field missing or ambiguous | STOP, list gaps, ask user |
| API error | Show full error, ask user |
| API validation error | Check [references/api_traps.md](references/api_traps.md). **IF** using the CLI, **THEN** also run `airwallex <resource> <action> --api-schema-only` to verify body structure. **ELSE IF** using the MCP server, **THEN** re-inspect the tool's input schema. |
| 401 / auth expired | **IF** using the CLI, **THEN** retry once (auto-refresh). If retry fails, ask the user which environment, immediately execute `auth login` (or `--prod`) yourself, confirm with `auth whoami`, then resume. **ELSE IF** using the MCP server, **THEN** the server refreshes tokens automatically; if a tool keeps returning 401, the OAuth grant has been revoked — ask the user to re-authorize the MCP server. |
| Duplicate detected | Show details, let user choose |
| Partial completion | Report what succeeded (with IDs) and what failed |
## References
- [references/api_traps.md](references/api_traps.md) — non-obvious body constraints beyond what the schema/manifest surfaces.
- **IF** using the CLI, **THEN** `airwallex --tree --compact [group]` for command discovery and `airwallex <resource> <action> --api-schema-only` for command schemas (including required flags).
- [Airwallex API Introduction](https://www.airwallex.com/docs/api/introduction)
## Feedback
When the user reacts to how this skill performed (praise, frustration, a gap, a missing capability) — or when you hit a real gap, unclear/wrong instruction, or unexpected behavior while using it — briefly offer to pass feedback along and, on the user's go-ahead, submit it. See [references/feedback.md](../../references/feedback.md) for when to offer, the channel commands (CLI / MCP), and the rules (ask first, no sensitive data, don't nag).
## skills/beneficiary-creation/SKILL.md
---
name: beneficiary-creation
description: Extract bank details from supplier invoices or documents, validate per-country requirements, and create beneficiaries in Airwallex. Use when the user says "set up this supplier", "onboard these vendors", "create beneficiary from invoice", "add a payee", or uploads supplier documents with bank details. Do NOT use for creating invoices, checking balances or FX rates, or provisioning cards.
metadata:
author: Airwallex
version: 0.1.0
compatibility: Works with the Airwallex CLI (`airwallex` binary on PATH, authenticated via `airwallex auth login`) or the Airwallex MCP server (enabled and authenticated).
---
# Beneficiary Creation
Reads supplier invoices or documents, extracts bank details, validates against country-specific schemas, and creates beneficiaries in Airwallex. **This skill creates beneficiaries only — money movement (transfers) is not in scope.**
## When to use
- User uploads supplier invoices, contracts, vendor lists, or documents with bank details
- User asks to "set up a supplier" or "onboard a vendor"
- User wants to create beneficiaries from extracted bank information
- User has multiple suppliers to onboard in batch
## When NOT to use
This skill only covers Payouts-domain operations — listing, creating, updating, validating, and verifying beneficiaries, plus beneficiary-schema lookup. If the task requires capabilities outside this domain, **stop — this is the wrong skill.** Redirect the user:
- Wire transfers / payouts → not yet available (use Airwallex Dashboard)
- Creating invoices (money in) → **contract-to-billing** skill
- FX conversions, balances, treasury → **manage-cashflow** skill
- Provisioning corporate cards → **card-provisioning** skill
- Ad-hoc tasks outside beneficiary workflow → **awx-best-practices** skill (fallback)
## Non-negotiables
### HARD GATE — money-movement requests
If the user's message mentions **transferring, sending, wiring, or paying money** (e.g., "set up and transfer", "send $15K to them", "pay this supplier now"):
1. **Very first sentence of your reply** must state the capability boundary: *"I can set up [name] as a beneficiary, but I can't execute transfers — that must be done in the Airwallex Dashboard after the beneficiary is created."*
2. Do NOT ask for payment amount, payment reason, source wallet, or any transfer-related details — these are not inputs to this skill.
3. Do NOT imply that the transfer will happen as part of this workflow or that you will "set up the payment right away."
4. After stating the boundary, proceed normally with the beneficiary-creation workflow.
This gate fires even if the transfer request is mixed with a valid beneficiary-creation request. Acknowledge what you CAN do, clearly state what you CANNOT, then continue with the part you can handle.
### Terminology
- **Beneficiary = first step of the payout workflow.** The full payout flow is: **create beneficiary → (optional) verify bank ownership → initiate transfer (Airwallex Dashboard only)**. This skill covers the first two steps. Transfers are out of scope and must be done in the Airwallex Dashboard.
- **Beneficiary ≠ transfer.** Creating a beneficiary saves payee details — does NOT send money. Duplicate beneficiaries waste time during the transfer step, which is why the skill searches for existing records before creating.
- **LOCAL vs SWIFT.** LOCAL = domestic clearing (cheaper, faster). SWIFT = international wire (costlier). Do NOT silently pick a transfer method — determine the available rails from the document, country docs, and schema, then present the options to the user with a brief note on cost/speed differences. If the document specifies a preferred rail, surface that preference but still confirm with the user. Only when the document is silent AND the schema shows exactly one supported rail for the country/currency combo may you proceed without asking.
- **COMPANY vs PERSONAL.** COMPANY = business entity. PERSONAL = individual (freelancer). Determines required identity fields.
- **Schema ≠ country docs — you need both.** The schema's `required` flag is not always accurate (some fields marked optional are actually required by the API). Country docs tell you which fields are truly required AND which values are valid. When in doubt, include all fields the country docs list as required, even if the schema says optional.
### Operational rules
- **For ambiguous-intent requests, do not start the workflow until the action is confirmed.** If the user has not clearly confirmed the exact write action, stop before schema reads, auth checks, or other workflow setup that materially advances execution.
- **NEVER fabricate or assume missing information.** If any required field is uncertain, absent, or ambiguous — STOP and ask the user. Keep asking until you have every parameter needed. Do NOT fill in defaults, placeholders, or "reasonable guesses." The only data you may fill in yourself is `nickname` (and `request_id` for surfaces that require it).
- **NEVER echo back unverified field names from the user.** If the user mentions routing types, code names, or bank-detail parameters that you have not confirmed via schema fetch, do NOT include them in your response as if they were real API fields. Instead: (1) acknowledge what the user asked for, (2) fetch the beneficiary schema for that country/currency/transfer-method combo, (3) reply with only the fields the schema actually requires — and flag any user-mentioned terms that do not map to a schema field. Parroting an unverified parameter name back to the user — even just to ask for its value — treats it as a real field and is a form of hallucination.
- **Even when the user says "use example data"** — STOP and list the concrete fields needed. Offer to create a JSON template for them to fill in.
- **Flag any extraction uncertainty** — never guess at bank details.
- **Always fetch fresh data** — re-fetch before every step.
- **Prefer business labels over raw IDs in user-facing output.** Show beneficiary names first; surface IDs only when operationally necessary or when the user asks.
- **Default to sandbox.** Confirm with user before any production write — production beneficiaries are real payee records.
- **Always validate before creating** — validation is the primary safety mechanism. Only create after validation passes AND user confirms.
- **Search for existing beneficiaries by name before creating** — duplicate beneficiaries clutter the payout workflow.
- **Write safety.** Show the full payload to the user and get confirmation before every beneficiary create / update / validate / verify.
### Beneficiary constraints
The beneficiary create body nests bank fields inside `bank_details`. The example below illustrates the canonical shape — verify exact field names and nesting against the resource schema for your surface before sending, as some surfaces flatten or rename fields:
```json
{
"request_id": "<generate via uuidgen>",
"beneficiary": {
"bank_details": {
"account_name": "...",
"account_number": "...",
"account_routing_type1": "sort_code",
"account_routing_value1": "123456",
"bank_country_code": "GB",
"account_currency": "GBP"
},
"entity_type": "COMPANY",
"company_name": "Acme Ltd",
"address": {
"city": "London", "country_code": "GB",
"postcode": "EC1A 1BB", "street_address": "123 Main St"
}
},
"transfer_methods": ["LOCAL"],
"nickname": "Acme supplier"
}
```
- **Fetch schema AND country docs for EVERY country before building ANY JSON:**
1. **Schema fetch** for each unique country/currency/transfer-method/entity-type combo. Parameters: `bank_country_code`, `account_currency` (not `currency`), `transfer_method`, `entity_type`.
2. **Country docs page** via WebFetch (`https://www.airwallex.com/docs/payouts/payout-network/bank-accounts/{country-slug}`) — valid enum values, routing formats, extra field requirements. **Do NOT skip the country docs** — the schema alone does not provide valid values for routing types, state formats, or fields like `bank_account_category`.
- **`transfer_method` vs `transfer_methods`:** Schema fetch uses singular `transfer_method`. Validate/create body uses plural array (`"transfer_methods": ["LOCAL"]`). Mixing causes API rejection.
- **Top-level vs nested fields.** `transfer_methods` is a top-level array. `bank_country_code` and `account_currency` live inside `bank_details`. The **schema-fetch** endpoint takes singular `transfer_method` plus `bank_country_code` and `account_currency` as top-level query parameters — do not confuse the two shapes.
- **`account_name`** inside `bank_details` is required for most countries even when the schema does not mark it required.
- **SWIFT uses `swift_code`, not routing** — do NOT put BIC in `account_routing_type1` (LOCAL routing only).
- **IBAN countries may still require both `iban` and `swift_code` on SWIFT** — follow schema exactly for each combo.
- **LOCAL routing keys vary by country** (`sort_code`, `aba`, `bsb`, etc.) — use schema + country docs, never hardcode.
- **`bank_account_category`** — required for **US/USD/LOCAL** (both COMPANY and PERSONAL) and some personal accounts (e.g., BR). Valid values: **`"Checking"` / `"Savings"`** (note the `s`). The schema may omit this field — always include it for US beneficiaries.
- **SE/SEK/LOCAL** — the schema marks `account_routing_type1`, `account_routing_value1`, and `account_number` as optional — **they are actually required**. IBAN alone is NOT enough. Include `account_routing_type1` (`bank_code`), `account_routing_value1` (clearing number, 4–5 digits depending on the bank), and `account_number` (length is bank-dependent; the schema allows up to 15 digits). Ask the user for these values (see IBAN rule below).
- **PERSONAL uses `additional_info` for tax IDs** — `personal_id_type` and `personal_id_number` belong in `additional_info` (nested under `beneficiary` per the canonical body; verify exact path against your surface's schema). COMPANY uses `company_name`; PERSONAL uses `first_name` + `last_name`.
- **List search uses `name` (PERSONAL) / `company_name` (COMPANY)** — there is no `first_name` filter. Use the actual filter names exposed by the listing operation; do not invent filters from JSON body field names.
- **Do NOT decompose IBANs into bank_code + account_number yourself** — if the schema requires separate routing and account fields but the document only provides an IBAN, tell the user exactly which fields are needed (e.g., "The SE/SEK/LOCAL schema requires a 4–5 digit clearing number and a bank-specific account number separately — I cannot reliably extract these from the IBAN. Could you provide them?"). IBAN BBAN structures vary by country; guessing the split causes validation failures.
- **Preserve original values during extraction; normalize only when building the JSON payload.** In the extraction table (Steps 2/6), show bank details **AS WRITTEN** in the document (e.g., "Agência: 1234-5", "Conta Corrente: 1234567-8") and explicitly label the API field mapping (e.g., "Agência → `bank_branch`", "Conta Corrente → `account_number`"). Do NOT strip formatting during extraction.
- **Strip formatting to match schema `pattern` only in Step 10 (payload construction).** Check the field's `pattern` regex first, then strip only characters that prevent a match. E.g., GB sort code pattern `^[0-9]{6}$` → strip hyphens from `20-32-06` to get `203206`. But if the pattern already allows the characters (e.g., BR `bank_branch` pattern `^[0-9A-Za-z.-]{4,7}$` allows dashes, CA account number `^[0-9A-Za-z]{7,21}$`), preserve the original value. **Always show the before→after transformation** so the user can verify each mapping.
- **`address.state` uses ISO 3166-2 codes** with country prefix (e.g., `CA-ON`, `AU-NSW`, `IN-KA`). Do NOT use bare abbreviations.
- **Account number errors (`066`, `086`)** mean wrong length or invalid format — ask the user, never pad or truncate.
- **`validate` ≠ `create`** — validation only checks payloads, it does NOT create. Always validate first, confirm with user, then create.
- **Multiple banking options in one document** — if an invoice/document lists more than one bank account or transfer method (e.g., LOCAL SEK + SWIFT EUR), surface ALL options to the user and ask which to use. Follow the document's stated preference if one exists. Do NOT silently pick one.
- **Pagination:** use `page_num` (0-based) + `page_size`; increment until `has_more` is false.
---
## Workflow
### Phase 1: Extract
**Step 1 — Get the document(s).** Accept one or more supplier invoices, contracts, vendor lists, or bank detail documents. Batch supported.
**Step 2 — Extract supplier and bank details.** Identify: supplier name, entity type, bank name, bank country, currency, account number/IBAN, routing code(s), address (all five components: `street_address`, `city`, `state`, `postcode`, `country_code`), contact info. Documents may be in any language — extract bank details regardless of language, keep company/entity names in their original language, and present the extracted summary in English for user confirmation.
**Step 2b — Verify user-supplied field names against schema.** If the user's request mentions routing types, code names, or bank-detail parameters that you cannot confirm exist in the Airwallex API, **do NOT echo them back as required fields.** Instead, proceed to Step 4 (pre-flight) and Step 5 (schema fetch) first, then return to the user with only the fields the schema actually requires — and call out any user-mentioned terms that don't correspond to real API fields.
**Step 3 — Clarify intent before proceeding.** Before entering schema checks or API calls, confirm the user's actual goal. Present the extracted summary and explicitly ask:
- **Create new** beneficiary — proceed to validation and creation.
- **Update existing** — search first, show matches, then update.
- **Check for duplicates only** — search and report without creating.
- **Something else** — clarify before committing to a workflow path.
Do NOT assume "create new" by default. If the user's request is ambiguous (e.g., "set up this supplier" could mean create or update), ask. Only proceed to Step 4 after the user confirms the intended action.
If the user's wording does not unambiguously identify which beneficiary records to act on, and there is more than one possible supplier/payee/vendor/beneficiary in the attachment, prior extraction, or conversation context, do **not** choose for them or process every row by default. Present the candidate list and ask which specific record(s) they mean before schema checks or API calls. This applies to singular references ("this supplier", "that vendor", "them"), vague batch language ("these suppliers", "the new vendors"), and any request where the selected rows are unclear.
**Step 4 — Confirm environment.** State sandbox vs production to the user (sandbox default; production only on explicit confirmation). Validate auth via a low-cost read.
**Step 5 — Fetch country-specific schema AND country docs.** For EVERY unique country/currency/transfer-method/entity-type combo, run BOTH:
1. Schema fetch (required fields + patterns) — see the constraints section above for the exact form on each surface.
2. Country docs page via WebFetch (`https://www.airwallex.com/docs/payouts/payout-network/bank-accounts/{country-slug}`) — valid enum values, routing formats, extra field requirements. **Do NOT skip the country docs.**
**Step 6 — Build beneficiary table:**
| # | Company/Name | Entity Type | Bank Country | Currency | Transfer Method | Key Bank Fields | State | Status |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
Fill `State` with ISO 3166-2 code or `n/a`. Mark incomplete rows with `[?]`.
**Step 7 — Validate and confirm.** Cross-check against schema. Do NOT proceed until every row passes and user confirms.
### Phase 2: Validate & Create
**Step 8 — Completeness check.** Validate all planned beneficiaries before first write.
**Step 9 — Match existing beneficiaries.** Search by name/company_name. Paginate fully. If match exists, user decides: skip, update, or create new.
**Step 10 — Validate.** **Process one at a time, sequentially** — do NOT parallelize (a parallel failure cancels sibling calls). Prepare each payload, validate it, show the result, and fix failures using exact API error messages before moving to the next.
**Step 11 — Confirm environment before writes.** Re-state the active environment / account to the user (the session may have changed since Step 4). Wait for explicit user approval before proceeding.
**Step 12 — Create.** **HARD GATE: NEVER attempt `create` for a beneficiary whose `validate` returned an error.** Fix the validation error first (ask the user for corrected data) or skip that row entirely. Retrying create with the same failing payload wastes turns and will fail identically. **Process one at a time, sequentially** — do NOT parallelize. Create only validated, unmatched rows. Wait for each creation to succeed before starting the next. Report each result immediately.
**Step 13 — Summary & next steps.** Show final summary: created/skipped/failed. Then advise on what the user can do next:
- **Verify** — offer bank account ownership verification if the country supports it (Phase 3).
- **Transfer** — remind the user that transfers must be initiated in the Airwallex Dashboard (this skill cannot move money).
- **Cashflow impact** — if the user plans to pay these suppliers soon, note that each payout will reduce their currency balance. Suggest using the **manage-cashflow** skill to check whether their current balances can cover the planned payments and whether any FX conversion is needed before initiating transfers.
### Phase 3: Verify bank account (optional)
Bank account ownership verification confirms the account belongs to the named beneficiary. Not all countries or transfer methods support this.
**Step 14 — Check verify eligibility.** Confirm the beneficiary-account verification operation is available on your surface. If it is not exposed, suggest the Airwallex Dashboard.
Not all country/transfer-method combinations support verification — if the verify call rejects with an unsupported-country or unsupported-method error, explain and suggest the Airwallex Dashboard as fallback.
**Step 15 — Submit verification.** The verify operation takes a candidate `bank_details` payload — **NOT a beneficiary ID** — so you can verify before the beneficiary record exists. Body shape: `entity_type`, `transfer_method`, `bank_details`. No `request_id`. Verify the exact body schema before sending.
Show the verification status to the user. Possible responses include `VERIFIED`, `INVALID`, `CANNOT_VERIFY`, and `EXTERNAL_SERVICE_UNAVAILABLE`; if the call is rejected outright, suggest the Airwallex Dashboard as fallback.
---
## Error handling
Generic patterns (401/auth, API validation, duplicates, partial writes, missing required fields) — see [awx-best-practices Error handling](../awx-best-practices/SKILL.md) and [api_traps.md](../awx-best-practices/references/api_traps.md).
Domain-specific:
| Situation | Action |
| --- | --- |
| Document unreadable | Ask for content another way |
| Extraction ambiguous | Mark `[?]`, ask user, do not guess |
| Bank country unclear | Ask user — wrong country cascades to wrong fields |
| Required bank field missing | Show which field for which country schema |
| Schema fetch fails | Try alternate transfer method (LOCAL → SWIFT) |
| Validation fails | Show exact API error, ask user to correct |
| `066` / `086` account errors | Ask user to verify account format/length; never pad or truncate |
---
## Country reference
For each country, fetch: `https://www.airwallex.com/docs/payouts/payout-network/bank-accounts/{country-slug}`
Common slugs: `united-kingdom`, `united-states`, `australia`, `india`, `canada`, `new-zealand`, `united-arab-emirates`, `singapore`, `hong-kong-sar`, `brazil`, `japan`. EU countries use the name (e.g., `germany`, `france`, `sweden`).
---
## Workflow summary
```
Phase 1: Extract
get document(s) → extract bank details → clarify intent
→ environment / account + auth → fetch country schema + docs
→ build table → validate → user confirms
Phase 2: Validate & Create
completeness check → match existing → validate each
→ confirm environment → create → summary & next steps
Phase 3: Verify bank account (optional)
check eligibility → submit verification → show status
```
## Feedback
When the user reacts to how this skill performed (praise, frustration, a gap, a missing capability) — or when you hit a real gap, unclear/wrong instruction, or unexpected behavior while using it — briefly offer to pass feedback along and, on the user's go-ahead, submit it. See [references/feedback.md](../../references/feedback.md) for when to offer, the channel commands (CLI / MCP), and the rules (ask first, no sensitive data, don't nag).
## skills/card-provisioning/SKILL.md
---
name: card-provisioning
description: Provision virtual or physical corporate cards in Airwallex Issuing — create cardholders, issue cards with spend limits, and manage card spending. Use when the user says "create a card for", "spin up a virtual card", "set up a card for Adobe", "provision a card", or needs to manage corporate card spending. Do NOT use for bank transfers, creating invoices, or checking FX rates.
metadata:
author: Airwallex
version: 0.1.0
compatibility: Works with the Airwallex CLI (`airwallex` binary on PATH, authenticated via `airwallex auth login`) or the Airwallex MCP server (enabled and authenticated). Requires Issuing enabled on the Airwallex account.
---
# Card Provisioning
Creates virtual or physical corporate cards in Airwallex Issuing — one workflow to set up a cardholder, issue a card with spend limits, and optionally manage ongoing spend.
**Tone:** The target user is a busy entrepreneur, not a finance analyst. Keep language conversational and action-oriented — say "Your Adobe card is set up with a $50/month limit" rather than "Card ID card_xxx created with authorization_controls.transaction_limits.limits[0].amount = 50.00." Show business labels (card nicknames, cardholder names) first; keep raw IDs and technical details in the background unless the user asks for them.
## When to use
- User asks to create a virtual or physical card
- User wants to set up a card for a specific purpose (e.g., "card for Adobe", "travel card")
- User needs to provision cards for team members (batch)
- User wants to update card limits or review card spend
- User asks "what are we spending on software cards?" or wants spend aggregation by category
## When NOT to use
This skill only covers Issuing-domain operations (cards, cardholders, issuing-transactions). If the task requires anything outside that domain, **stop — this is the wrong skill.** Redirect the user:
- Viewing sensitive card details (PAN, CVV) → direct to Airwallex Dashboard
- Wire transfers / payouts → not yet available (use Airwallex Dashboard)
- Setting up suppliers / beneficiaries → **beneficiary-creation** skill
- Creating invoices → **contract-to-billing** skill
- FX conversions, balances, treasury → **manage-cashflow** skill
- Ad-hoc tasks outside card workflow → **awx-best-practices** skill (fallback)
## Non-negotiables
### Terminology
- **Cards draw from the account's currency balance — no "card balance."** Say "$X/month limit" or "$X drawn this month."
- **Cardholder ≠ Card.** One cardholder can have multiple cards. Match or create cardholder first.
- **`AUTHORIZED` ≠ money moved.** It's a hold. `CLEARED` = money left. Be explicit when reporting.
- **Spend limits are always per interval + currency.** Say "$50.00 per month in USD."
### Operational rules
- **For ambiguous-intent requests, do not start the workflow until the action is confirmed.** If the user has not clearly confirmed the exact write action, stop before schema reads, auth checks, or other workflow setup that materially advances execution.
- **NEVER fabricate or assume missing information.** If any required field is uncertain, absent, or ambiguous — STOP and ask the user. Keep asking until you have every parameter needed. Do NOT fill in defaults, placeholder values, or "reasonable guesses."
- **Flag generic or test-like cardholder names.** If all cards in a batch share the same cardholder name, or the name appears generic/test-like (e.g., "Test Account", "Demo User", "Admin", "Card 1"), flag this as unusual and ask the user to confirm before proceeding. In production, generic names are a high-risk fraud signal.
- **Always fetch fresh data** — re-fetch before every step.
- **Prefer business labels over raw IDs in user-facing output.** Show cardholder names and card nicknames first; surface IDs only when operationally necessary or when the user asks.
- **One wallet, multiple currencies.** Say "AUD balance" — never "AUD wallet."
- **Default to sandbox.** Confirm with user before any production write.
- **Always set a spend limit** — never create an unlimited card. Every card must have an explicit limit amount, currency, and interval.
- **Always require a purpose/nickname** for each card.
- **Never handle or display PAN, CVV, or expiry.** Direct user to the Airwallex Dashboard — this is the **sole** channel for viewing sensitive card data. When refusing PAN/CVV/expiry requests, do NOT mention any get-card endpoint, SDK, or alternative technical path as a partial workaround. Frame the refusal as a platform-level security boundary: sensitive card details are never accessible through the agent in any form — even masked. Mentioning other APIs weakens the security message.
- **Do NOT invent advanced card-control fields** (MCC restriction, merchant controls, etc.) — see "Card & cardholder constraints" below.
- **Write safety.** Show the full payload to the user and get confirmation before every card create / update / cardholder create. **Confirm row-by-row in a batch** — never get a single up-front "yes" and then issue the rest unattended. Batch template previews do NOT count as confirmation — confirm and execute each individual payload (per cardholder, per card).
- **Never retrieve full card details via API.** Direct user to the Airwallex Dashboard.
- **Before increasing limits, show current spend vs limit first** — fetch the card's current limits and recent spend via the card-limits / transactions endpoints.
- **Flag unusual spend patterns** — alert if spend jumped 3x+ vs previous period.
- **Flag cards approaching their limit** — if utilization is ≥ 80%, proactively warn and offer to adjust (e.g., "Your AWS card is at $412 / $500 (82%) — want me to increase it?").
- **Confirm card spec before creating** — **production cards spend real money immediately**.
- **Search for existing cardholder by email before creating** — avoid duplicates.
- **Never fabricate cardholder or card IDs.** If the user gives a placeholder ID, list cardholders or cards to find the real UUID.
- **Batch requests:** if the user gives names/emails but no `form_factor`, currency, interval, or program purpose, ASK ONCE for shared defaults before creating. Process rows sequentially — never in parallel.
- **Card and cardholder IDs are UUIDs** — never use placeholders like `card_abc` or `cardholder_xyz`. If you only have a name or label, look up the real UUID first.
### Card & cardholder constraints
- **`created_by`** — full legal name of the **person requesting** the card, not the cardholder. Ask the user if unspecified.
- **`is_personalized`** — VIRTUAL → `false`, PHYSICAL → `true`. Ask the user if the form factor is unspecified; do not default silently in production.
- **Body shape differs by surface.** Use the templates in [references/card-templates.md](references/card-templates.md) — do NOT build the payload incrementally or guess fields. Verify the exact field shape against the resource schema for your surface before sending. Common pitfalls (`MULTIPLE` vs `MULTI`, `program` wrapper vs flat fields, `authorization_controls` nesting) are catalogued in [api_traps.md](../awx-best-practices/refe