# API Keys URL: /docs/api-keys Create, manage, and rotate API keys programmatically. API keys authenticate all requests to the Access API. You can manage keys from the dashboard or programmatically via the API. ## Create a Key [#create-a-key] ```bash title="Create API key" curl -X POST https://api.tryaccess.xyz/api/v1/api-keys \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "name": "Production Key", "expires_in": 2592000, "preset": "developer" }' ``` Response: ```json { "id": "key_01HXYZ...", "name": "Production Key", "key": "sk_G9XZC5pQ2wErTyUi_...", "status": "active", "permissions": ["checkout_sessions:*", "customers:read", "customers:write", "payments:read", "payments:create", "payment_methods:read", "webhooks:*", "verifications:*"], "preset": "developer", "expires_at": "2025-02-15T10:00:00.000Z", "created_at": "2025-01-15T10:00:00.000Z" } ``` The full `key` value is returned only once at creation time. Store it securely it cannot be retrieved later. ### Parameters [#parameters] | Field | Type | Required | Description | | ------------- | -------- | :------: | --------------------------------------------------------------------------- | | `name` | string | Yes | Human-readable label (min 1 character) | | `expires_in` | number | No | Expiry in seconds from now (min 3600). Omit for no expiry | | `preset` | string | One of | A named bundle of permissions, such as `read_only` or `developer` | | `permissions` | string[] | One of | Permissions such as `["customers:read", "invoices:read"]`, or wildcards | Send exactly one of `preset` or `permissions`; permissions are fixed once the key is made. ### Permissions [#permissions] Each permission is `resource:action`, such as `payments:read`. Wildcards are allowed: `*` (everything), `payments:*` (every action on a resource) and `*:read` (one action on every resource). Wildcards never match sensitive permissions (`payments:refund`, `payouts:create`, `crypto_payments:refund`, `api_keys:*`, `user:*`); name those explicitly. A key created through the API can't hold permissions the calling key doesn't, so a read-only key can only create read-only keys. Requests that break this get a [`403 forbidden`](/docs/errors/forbidden); unknown permissions or presets get a [`422 parameter_invalid`](/docs/errors/parameter_invalid). Today, permissions are checked when a key creates or rolls another key. Keys made before permissions existed have none (`"permissions": []`). They keep working, but can't create or roll keys through the API; create a new key from the dashboard instead. ### Presets [#presets] A preset is stored on the key as the grants below (wildcards stay wildcards), and its name is returned as `preset`. When you send `permissions` that exactly match a preset, `preset` is set too. | Preset | Grants | Description | | ------ | ------ | ----------- | | `full_access` | `*` | Everything except sensitive permissions (refunds, payouts, API keys, owner account). | | `read_only` | `*:read` | View every non-sensitive resource. Cannot change anything. | | `developer` | `checkout_sessions:*`, `customers:read`, `customers:write`, `payments:read`, `payments:create`, `payment_methods:read`, `webhooks:*`, `verifications:*` | A typical integration: checkout, customers, payments, webhooks and verifications. | | `checkout` | `checkout_sessions:*`, `customers:read`, `customers:write`, `payment_methods:read` | Run checkout sessions and manage the customers attached to them. | | `payments_only` | `payments:*`, `customers:read` | View and create payments. No refunds. | | `crypto_only` | `crypto_payments:*`, `customers:read` | View and create crypto payments. No refunds. | | `billing` | `subscriptions:*`, `invoices:*`, `customers:read`, `customers:write`, `payment_methods:*` | Subscriptions, invoices and payment methods. Customers can be viewed and edited, not deleted. | | `invoicing` | `invoices:*`, `customers:read`, `customers:write` | Manage invoices and the customers they belong to. | | `verification` | `verifications:*`, `payments:read`, `crypto_payments:read` | Run payment verifications and read the payments they check. | | `webhooks_only` | `webhooks:*` | Manage webhook endpoints and nothing else. | | `reporting` | `payments:read`, `crypto_payments:read`, `payouts:read`, `invoices:read`, `subscriptions:read`, `customers:read` | Read-only access to payments, payouts, invoices, subscriptions and customers. | | `support` | `*:read`, `subscriptions:cancel` | View everything non-sensitive and cancel subscriptions. | | `branding_editor` | `branding:*`, `settings:read` | Edit branding and read settings. | | `payouts_operator` | `payouts:read`, `payouts:create` | View and create payouts. Includes the sensitive payouts:create permission. | ### Resources and actions [#resources-and-actions] | Resource | Actions | | -------- | ------- | | `customers` | `read`, `write`, `delete` | | `payments` | `read`, `create`, `refund` (sensitive) | | `subscriptions` | `read`, `write`, `cancel` | | `invoices` | `read`, `write`, `void` | | `checkout_sessions` | `read`, `create`, `expire` | | `webhooks` | `read`, `write`, `delete` | | `api_keys` | `read` (sensitive), `create` (sensitive), `revoke` (sensitive) | | `settings` | `read`, `write` | | `payouts` | `read`, `create` (sensitive) | | `crypto_payments` | `read`, `create`, `refund` (sensitive) | | `payment_methods` | `read`, `write`, `delete` | | `user` | `read` (sensitive), `write` (sensitive), `delete` (sensitive) | | `branding` | `read`, `write` | | `verifications` | `read`, `create` | ## Get the Permission Catalog [#get-the-permission-catalog] ```bash title="List API key permissions" curl https://api.tryaccess.xyz/api/v1/api-keys/catalog \ -H "x-api-key: sk_..." ``` Returns every resource with its actions, and every preset, so you can build a permission picker without hard-coding the lists above. It's the same for every merchant. ```json { "resources": [ { "key": "payments", "label": "Payments", "actions": [ { "key": "refund", "permission": "payments:refund", "label": "Issue refunds", "description": "Refund payments back to customers.", "sensitive": true } ] } ], "presets": [ { "key": "read_only", "label": "Read only", "description": "View every non-sensitive resource. Cannot change anything.", "grants": ["*:read"], "resolved": ["customers:read", "payments:read", "subscriptions:read"] } ] } ``` | Field | Description | | --------------------- | ----------------------------------------------------------------------------- | | `actions[].permission` | The value to send in `permissions` when creating a key | | `actions[].sensitive` | Never granted by a wildcard; send it explicitly | | `presets[].key` | The value to send as `preset` when creating a key | | `presets[].grants` | What is stored on the key (wildcards stay wildcards) | | `presets[].resolved` | The permissions those grants match today, for a "this key can…" preview | ## List Keys [#list-keys] ```bash title="List API keys" curl https://api.tryaccess.xyz/api/v1/api-keys \ -H "x-api-key: sk_..." ``` Returns all keys for the merchant. Full key values are never included. ```json { "data": [ { "id": "key_01HXYZ...", "name": "Production Key", "status": "active", "request_count": 4523, "last_request": "2025-01-15T10:30:00.000Z", "expires_at": null, "created_at": "2025-01-01T00:00:00.000Z", "permissions": ["*:read"], "preset": "read_only" } ], "has_more": false, "next_cursor": null } ``` | Query Parameter | Description | | --------------- | ------------------------------------ | | `cursor` | Pagination cursor | | `limit` | Results per page (1-100, default 20) | ## Get a Key [#get-a-key] ```bash curl https://api.tryaccess.xyz/api/v1/api-keys/key_01HXYZ... \ -H "x-api-key: sk_..." ``` Returns key details including `request_count`, `last_request`, `permissions` and `preset`. ## Update a Key [#update-a-key] ```bash title="Revoke a key" curl -X PATCH https://api.tryaccess.xyz/api/v1/api-keys/key_01HXYZ... \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "status": "revoked" }' ``` Updatable fields: `name`, `status` (`active` or `revoked`). Set `status` to `revoked` to disable a key without deleting it. ## Revoke (Delete) a Key [#revoke-delete-a-key] ```bash title="Revoke API key" curl -X DELETE https://api.tryaccess.xyz/api/v1/api-keys/key_01HXYZ... \ -H "x-api-key: sk_..." ``` Permanently deletes the key. This action cannot be undone. ## Roll (Regenerate) a Key [#roll-regenerate-a-key] ```bash title="Roll API key" curl -X POST https://api.tryaccess.xyz/api/v1/api-keys/key_01HXYZ.../roll \ -H "x-api-key: sk_..." ``` Response: ```json { "id": "key_01HXYZ...", "key": "sk_Etf5YrbXaQ9mLpZk_..." } ``` Rolling generates a new key token while keeping the same key ID and permissions. The old token is immediately invalidated. The new key is returned only once. Request count is reset to 0. The calling key must hold every permission of the key it rolls (`403` otherwise). Keys made before permissions can't be rolled (`409`): create a new key with the permissions it needs, then revoke the old one. ## Endpoint Summary [#endpoint-summary] | Action | Method | Endpoint | | ------ | ------ | --------------------------- | | Create | POST | `/api/v1/api-keys` | | Catalog | GET | `/api/v1/api-keys/catalog` | | List | GET | `/api/v1/api-keys` | | Get | GET | `/api/v1/api-keys/:id` | | Update | PATCH | `/api/v1/api-keys/:id` | | Revoke | DELETE | `/api/v1/api-keys/:id` | | Roll | POST | `/api/v1/api-keys/:id/roll` | # Authentication URL: /docs/authentication How to authenticate with the Access API using API keys. All API requests require authentication via an API key passed in the `x-api-key` header. ## Obtaining an API Key [#obtaining-an-api-key] 1. Sign in to the [Access dashboard](https://tryaccess.xyz) 2. Navigate to your merchant settings 3. Create a new API key under the **API Keys** section You can also create API keys programmatically: ```bash title="Create an API key via API" curl -X POST https://api.tryaccess.xyz/api/v1/api-keys \ -H "Content-Type: application/json" \ -H "x-api-key: your-existing-key" \ -d '{ "name": "Production Key", "preset": "developer" }' ``` The full key is returned only once at creation time. Store it securely. ## Using Your API Key [#using-your-api-key] Include the key in every request via the `x-api-key` header: ```bash curl https://api.tryaccess.xyz/api/v1/customers \ -H "x-api-key: sk_..." ``` ## Key Format [#key-format] API keys follow the format `sk__`. The short token is used for lookup, and the long token is hashed and verified server-side. Keys created before the `sk_` format start with `ak_live` and keep working until they are rolled, revoked or expire. ## Key Options [#key-options] When creating a key, you can configure: | Option | Type | Description | | ------------- | -------- | ----------------------------------------------------------------- | | `name` | string | Display name for the key (required) | | `expires_in` | number | Expiry in seconds from creation (min 3600). Omit for no expiry | | `preset` | string | A named bundle of permissions, such as `read_only` or `developer` | | `permissions` | string[] | Permissions such as `customers:read`, or wildcards like `*:read` | Send exactly one of `preset` or `permissions`. Permissions are fixed once the key is made; wildcards never match sensitive permissions such as refunds and payouts. See [Permissions](/docs/api-keys#permissions) for every preset and permission, or fetch them from `GET /api/v1/api-keys/catalog`. ## Key Management [#key-management] | Action | Method | Endpoint | | ---------- | ------ | --------------------------- | | Create key | POST | `/api/v1/api-keys` | | List keys | GET | `/api/v1/api-keys` | | Permission catalog | GET | `/api/v1/api-keys/catalog` | | Get key | GET | `/api/v1/api-keys/:id` | | Update key | PATCH | `/api/v1/api-keys/:id` | | Revoke key | DELETE | `/api/v1/api-keys/:id` | | Roll key | POST | `/api/v1/api-keys/:id/roll` | Rolling a key generates a new token while keeping the same key ID. The old token is immediately invalidated. See the [API Keys](/docs/api-keys) guide for full details. ## Billing & Feature Gates [#billing--feature-gates] API key authentication also enforces billing plan limits. Each request is checked against your plan's feature gates and quotas: - **Feature gates** - Certain features (checkout, subscriptions, crypto, OAuth, portal, webhooks) may be restricted by your plan. - **Verification quota** - Plans may include a fixed number of verifications per billing period. Exceeding the quota returns `429 Too Many Requests` if your plan's overage behavior is set to `BLOCK`. - **API request quota** - Plans may cap total API requests per period. Quota alerts are triggered at 80% and 100% usage thresholds. ## Rate Limits [#rate-limits] Requests are counted per API key, per minute: 600 reads (`GET`) and 120 writes, counted separately. Every response says where you are: ```http RateLimit-Policy: 600;w=60 RateLimit: limit=600, remaining=598, reset=42 ``` Over the limit, the API answers `429` with the [`rate_limited`](/docs/errors/rate_limited) code and a `Retry-After` header. After 10 refused keys from one IP address in a minute, that address waits out the minute, even with a valid key. ## Portal Authentication [#portal-authentication] The customer portal uses a separate token-based auth system. Merchantes create portal sessions via the API (using API key auth), and customers receive a short-lived HMAC-signed token. ```bash title="Create a portal session" curl -X POST https://api.tryaccess.xyz/api/v1/portal/sessions \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "customer_id": "cus_01HXYZ..." }' ``` [Customer Portal API](/docs/portal-api) endpoints use Bearer token authentication instead of `x-api-key`. The hosted [Customer Portal](/docs/portal) needs no customer credentials: you create a session with your API key and send the customer to its URL. ## Error Responses [#error-responses] Invalid or missing keys return a `401 Unauthorized` response: ```json { "error": { "type": "authentication_error", "code": "unauthorized", "message": "Invalid API key. Authentication failed.", "doc_url": "https://docs.tryaccess.xyz/docs" } } ``` | Scenario | HTTP Status | Code | | ---------------------- | :---------: | ----------------------- | | Missing or invalid key | 401 | `unauthorized` | | Disabled key | 403 | `forbidden` | | Expired key | 401 | `unauthorized` | | Too many requests | 429 | `rate_limited` | | Feature not in plan | 403 | `feature_not_available` | | Quota exceeded | 429 | `quota_exceeded` | # Checkout Sessions URL: /docs/checkout Create hosted checkout sessions to collect payments from customers. Checkout sessions provide a hosted payment page. Create a session, redirect your customer to the returned URL, and poll or use webhooks to detect completion. ## Create a Session [#create-a-session] ```bash title="Create checkout session" curl -X POST https://api.tryaccess.xyz/api/v1/checkout/sessions \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "mode": "payment", "customer_id": "cus_01HXYZ...", "line_items": [ { "price": 15000, "quantity": 1, "product_data": { "name": "Premium Plan", "description": "Monthly subscription" } } ], "currency": "ETB", "success_url": "https://yourapp.com/success", "cancel_url": "https://yourapp.com/cancel" }' ``` Response: ```json { "id": "cs_live_01HXYZ...", "url": "https://yourapp.com/c/pay/cs_live_01HXYZ...", "status": "open", "expires_at": "2025-01-15T11:00:00.000Z" } ``` Redirect your customer to the `url` to complete payment. The session returns `201 Created`. ## Session Parameters [#session-parameters] | Field | Type | Required | Description | |-------|------|:---:|-------------| | `mode` | string | Yes | `payment` or `subscription` | | `customer_id` | string | Yes | ID of an existing customer | | `line_items` | array | Yes | 1–20 line items | | `success_url` | string | Yes | Redirect URL after successful payment | | `cancel_url` | string | Yes | Redirect URL if customer cancels | | `currency` | string | No | ISO 4217 code (default: `ETB`) | | `metadata` | object | No | Arbitrary key-value pairs | | `expires_in` | number | No | Session expiry in seconds (300–86400, default 1800) | | `billing_interval` | string | No | `monthly` or `yearly`. Required when `mode` is `subscription`, must be omitted for `payment` | ### Line Item Schema [#line-item-schema] ```json { "price": 5000, "quantity": 2, "product_data": { "name": "Widget", "image": "https://example.com/widget.png", "description": "A useful widget" } } ``` Prices are in minor units (santim for ETB). `image` and `description` in `product_data` are optional. ## Get a Session [#get-a-session] ```bash title="Get session" curl https://api.tryaccess.xyz/api/v1/checkout/sessions/cs_live_01HXYZ... \ -H "x-api-key: sk_..." ``` Returns the full session including customer details, line items, billing interval, and linked `transaction_id` (once completed). ## List Sessions [#list-sessions] ```bash title="List sessions" curl "https://api.tryaccess.xyz/api/v1/checkout/sessions?status=completed&limit=10" \ -H "x-api-key: sk_..." ``` | Parameter | Description | |-----------|-------------| | `cursor` | Pagination cursor | | `limit` | Results per page (1–100, default 20) | | `status` | Filter: `open`, `completed`, `expired`, `canceled` | | `customer_id` | Filter by customer | ## Expire a Session [#expire-a-session] Manually expire an open session: ```bash title="Expire session" curl -X POST https://api.tryaccess.xyz/api/v1/checkout/sessions/cs_live_01HXYZ.../expire \ -H "x-api-key: sk_..." ``` Only sessions with `open` status can be expired. Expiring a session also cancels the scheduled auto-expire job. ## Session Lifecycle [#session-lifecycle] ``` open → completed (customer pays) open → expired (timeout or manual expiry) open → canceled (customer cancels) ``` Sessions auto-expire after the `expires_in` duration (default 30 minutes). ## Webhooks [#webhooks] Subscribe to checkout events to get notified when a session completes: | Event | Description | |-------|-------------| | `checkout.completed` | Payment was successful | | `checkout.session.expired` | Session expired | See [Webhooks](/docs/webhooks) for setup instructions. ## Endpoint Summary [#endpoint-summary] | Action | Method | Endpoint | |--------|--------|----------| | Create | POST | `/api/v1/checkout/sessions` | | List | GET | `/api/v1/checkout/sessions` | | Get | GET | `/api/v1/checkout/sessions/:id` | | Expire | POST | `/api/v1/checkout/sessions/:id/expire` | # Crypto Payments URL: /docs/crypto-payments Let customers pay in stablecoins and other crypto, priced in birr. Crypto payments aren't open for public use yet. In production these endpoints answer `403` with the code `crypto_not_available`. Crypto payments let your customers pay in stablecoins: USDT and USDC, on the networks listed under [Coins](#coins). You set the price in birr; Access works out how much of the chosen coin the customer must send and gives you a deposit address to show them. What they pay goes to your crypto balance, which you can [pay out](/docs/crypto-payouts) to your own wallet. Turn crypto on first in **Settings → Payment methods → Crypto**. ## Coins [#coins] ```bash title="List coins" curl https://api.tryaccess.xyz/api/v1/crypto_payments/coins \ -H "x-api-key: sk_live_..." ``` ```json { "data": [ { "id": "usdt_tron", "asset": "USDT", "network": "TRON" }, { "id": "usdt_bsc", "asset": "USDT", "network": "BNB Smart Chain" }, { "id": "usdc_solana", "asset": "USDC", "network": "Solana" } ] } ``` Make sure your customer sends the coin **on the network you chose**: USDT on TRON and USDT on Ethereum are different. ## Create a payment [#create-a-payment] ```bash title="Create a crypto payment" curl -X POST https://api.tryaccess.xyz/api/v1/crypto_payments \ -H "x-api-key: sk_live_..." \ -H "Idempotency-Key: order-1042" \ -H "Content-Type: application/json" \ -d '{ "amount": 250000, "currency": "ETB", "pay_with": "usdt_tron", "customer": "cus_01J9Z8K2P3Q4R5S6T7U8V9W0X1", "description": "Order #1042", "metadata": { "order_id": "1042" } }' ``` | Field | Required | Description | |-------|----------|-------------| | `amount` | Yes | Price in cents of `currency` (`250000` is 2,500.00 ETB) | | `currency` | No | `ETB` (the only currency for now) | | `pay_with` | Yes | A coin id from [Coins](#coins) | | `customer` | Yes | The customer's id | | `description` | No | Shown in your dashboard | | `metadata` | No | Your own key-value data, returned as-is | ```json title="Response (201)" { "id": "cp_01JB2X7Q9R8S6T5U4V3W2X1Y0Z", "object": "crypto_payment", "status": "waiting", "failure_reason": null, "amount": 250000, "currency": "ETB", "pay_with": "usdt_tron", "pay_amount": "13.162245", "pay_address": "TXYZ...", "pay_memo": null, "amount_received": null, "fee": null, "customer": "cus_01J9Z8K2P3Q4R5S6T7U8V9W0X1", "description": "Order #1042", "metadata": { "order_id": "1042" }, "expires_at": "2026-10-18T12:20:00.000Z", "paid_at": null, "created_at": "2026-10-18T12:00:00.000Z", "updated_at": "2026-10-18T12:00:00.000Z" } ``` Show the customer `pay_address`, the exact `pay_amount` and, when it's set, `pay_memo` (some coins need a memo or the funds can't be matched). The price is fixed until `expires_at`, about 20 minutes. Coin amounts are **decimal strings**, never numbers, so nothing is lost to rounding. ## Statuses [#statuses] | Status | Meaning | |--------|---------| | `waiting` | Waiting for the customer to send the coin | | `confirming` | The coin arrived and the network is confirming it | | `finished` | Paid. The amount, less Access's fee, is in your crypto balance | | `failed` | Not paid. `failure_reason` is `underpaid` when the customer sent too little | | `expired` | Nothing arrived before `expires_at` | | `refunded` | The payment was refunded | A payment within 2% of `pay_amount` counts as paid in full. Anything more than that short fails as `underpaid`; what did arrive stays in your balance so you can [refund it](#refund-an-underpaid-payment). Overpayments count as paid and the extra stays in your balance. Follow status with the `crypto_payment.*` [webhook events](/docs/webhooks), or fetch the payment: ```bash curl https://api.tryaccess.xyz/api/v1/crypto_payments/cp_01JB2X7Q9R8S6T5U4V3W2X1Y0Z \ -H "x-api-key: sk_live_..." ``` List payments with `GET /api/v1/crypto_payments`, filtered by `status` or `customer` and paged with `limit` and `cursor`. ## Refund an underpaid payment [#refund-an-underpaid-payment] Ask the customer for their wallet address on the same network, then: ```bash curl -X POST https://api.tryaccess.xyz/api/v1/crypto_payments/cp_01JB.../refund \ -H "x-api-key: sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "address": "TCustomerWallet...", "memo": null }' ``` The refund is a [crypto payout](/docs/crypto-payouts) of type `refund`: everything the customer sent goes back, less the network fee, once Access approves it. Access charges no fee on refunds. ## Fees [#fees] Access takes **1%** of each finished payment, in the coin paid. `fee` on the payment shows it. # Crypto Payouts URL: /docs/crypto-payouts Withdraw your crypto balance to your own wallet. Crypto payouts aren't open for public use yet. In production these endpoints answer `403` with the code `crypto_not_available`. You can request payouts from the dashboard under **Payouts**. What customers pay in crypto collects in your **crypto balance**, per coin. A payout sends some of it to a wallet address you give. ## Balance [#balance] ```bash curl https://api.tryaccess.xyz/api/v1/crypto_payouts/balance \ -H "x-api-key: sk_live_..." ``` ```json { "balances": [ { "coin": "usdt_tron", "asset": "USDT", "network": "TRON", "available": "1240.5", "pending": "13.162245" } ], "as_of": "2026-10-18T12:00:00.000Z" } ``` `available` can be paid out now; `pending` is still settling. The balance refreshes every minute. ## Request a payout [#request-a-payout] ```bash curl -X POST https://api.tryaccess.xyz/api/v1/crypto_payouts \ -H "x-api-key: sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "coin": "usdt_tron", "amount": "500", "address": "TYourWallet...", "description": "October withdrawal" }' ``` | Field | Required | Description | |-------|----------|-------------| | `coin` | Yes | The coin to withdraw, e.g. `usdt_tron` | | `amount` | Yes | How much to take from the balance, as a decimal string | | `address` | Yes | Your wallet address **on the coin's network** | | `memo` | No | Memo or tag, for coins and exchanges that need one | | `description` | No | Your note | The address is checked before anything happens. The amount is then **held** right away, so it can't be paid out twice, and the payout waits for Access to approve it. ```json title="Response (201)" { "id": "cpo_01JB2X7Q9R8S6T5U4V3W2X1Y0Z", "object": "crypto_payout", "type": "payout", "status": "pending_approval", "coin": "usdt_tron", "address": "TYourWallet...", "memo": null, "amount": "500", "fee": "2.5", "network_fee": "5.4", "transaction_hash": null, "rejected_reason": null, "payment": null, "description": "October withdrawal", "paid_at": null, "created_at": "2026-10-18T12:00:00.000Z", "updated_at": "2026-10-18T12:00:00.000Z" } ``` Your wallet receives `amount` less `fee` and `network_fee`; here 492.1 USDT. ## Statuses [#statuses] | Status | Meaning | |--------|---------| | `pending_approval` | Held, waiting for Access to approve | | `processing` | Approved and on its way | | `paid` | Arrived. `transaction_hash` is the network transaction | | `failed` | Couldn't be sent. The amount is back in your balance | | `rejected` | Not approved; `rejected_reason` says why. The amount is back in your balance | Follow them with the `crypto_payout.*` [webhook events](/docs/webhooks), or with `GET /api/v1/crypto_payouts/:id` and `GET /api/v1/crypto_payouts`. ## Fees [#fees] Access takes **0.5%** of each payout (`fee`). The network fee (`network_fee`) depends on the coin; USDT on TRON is about 5 USDT. Refunds carry no Access fee. # Customers URL: /docs/customers Create and manage customer records for your business. Customers represent the people or entities that interact with your business. Each customer can have transactions, invoices, and checkout sessions. ## Create a Customer [#create-a-customer] ```bash title="Create customer" curl -X POST https://api.tryaccess.xyz/api/v1/customers \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "name": "Abebe Kebede", "email": "abebe@example.com", "phone_number": "+251911234567" }' ``` Response: ```json { "id": "cus_01HXYZ...", "name": "Abebe Kebede", "email": "abebe@example.com", "phone_number": "+251911234567", "created_at": "2025-01-15T10:00:00.000Z", "updated_at": "2025-01-15T10:00:00.000Z" } ``` ### Parameters [#parameters] | Field | Type | Required | Description | | -------------- | ------ | :------: | --------------------------------------------------- | | `name` | string | Yes | Full name (min 1 character) | | `email` | string | No | Email address. Must be unique per merchant | | `phone_number` | string | No | Phone number in E.164 format (e.g. `+251911234567`) | Customer IDs are prefixed with `cus_`. Duplicate emails within the same merchant are rejected with a `duplicate` error. ## List Customers [#list-customers] ```bash title="List customers" curl "https://api.tryaccess.xyz/api/v1/customers?limit=20" \ -H "x-api-key: sk_..." ``` | Parameter | Description | | --------- | ------------------------------------------------------------ | | `cursor` | Pagination cursor from the previous response's `next_cursor` | | `limit` | Results per page (1–100, default 20) | | `email` | Filter by email (partial match, case-insensitive) | Response: ```json { "data": [ { "id": "cus_01HXYZ...", "name": "Abebe Kebede", "email": "abebe@example.com", "phone_number": "+251911234567", "created_at": "2025-01-15T10:00:00.000Z", "updated_at": "2025-01-15T10:00:00.000Z" } ], "has_more": false, "next_cursor": null } ``` ## Get a Customer [#get-a-customer] ```bash curl https://api.tryaccess.xyz/api/v1/customers/cus_01HXYZ... \ -H "x-api-key: sk_..." ``` ## Update a Customer [#update-a-customer] Only provided fields are changed: ```bash title="Update customer" curl -X PATCH https://api.tryaccess.xyz/api/v1/customers/cus_01HXYZ... \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "phone_number": "+251922345678" }' ``` Updatable fields: `name`, `email`, `phone_number`. ## Delete a Customer [#delete-a-customer] ```bash title="Delete customer" curl -X DELETE https://api.tryaccess.xyz/api/v1/customers/cus_01HXYZ... \ -H "x-api-key: sk_..." ``` Response: ```json { "id": "cus_01HXYZ...", "deleted": true } ``` Deleting a customer cascades to their checkout sessions. ## Endpoint Summary [#endpoint-summary] | Action | Method | Endpoint | | ------ | ------ | ----------------------- | | Create | POST | `/api/v1/customers` | | List | GET | `/api/v1/customers` | | Get | GET | `/api/v1/customers/:id` | | Update | PATCH | `/api/v1/customers/:id` | | Delete | DELETE | `/api/v1/customers/:id` | # Errors URL: /docs/errors Error response format, error types, and all error codes returned by the Access API. All API errors return a consistent JSON body with machine-readable fields. ## Error Format [#error-format] ```json title="Error response" { "error": { "type": "invalid_request_error", "code": "not_found", "message": "Customer not found.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/not_found" } } ``` | Field | Type | Description | |-------|------|-------------| | `type` | string | Top-level error category | | `code` | string | Machine-readable error code | | `message` | string | Human-readable description | | `param` | string | Present when a specific request field caused the error | | `doc_url` | string | Link to the documentation for this error code | ## Error Types [#error-types] | Type | HTTP Range | Description | |------|:----------:|-------------| | `invalid_request_error` | 4xx | Bad input, missing fields, wrong types, resource not found | | `authentication_error` | 401 / 403 | Missing or invalid API key | | `verification_error` | 4xx | Payment receipt verification failed | | `upstream_error` | 502 / 503 | Bank or PSP service failure | | `api_error` | 5xx | Unexpected internal failure | ## Error Codes [#error-codes] ### Input / Validation [#input--validation] | Code | HTTP | Description | |------|:----:|-------------| | [`parameter_missing`](/docs/errors/parameter_missing) | 400 | A required field was not provided | | [`parameter_invalid`](/docs/errors/parameter_invalid) | 400 | A field value failed validation | | [`parameter_unknown`](/docs/errors/parameter_unknown) | 400 | An unrecognised field was sent | | [`invalid_psp`](/docs/errors/invalid_psp) | 400 | The specified PSP is not recognised | ### Resource State [#resource-state] | Code | HTTP | Description | |------|:----:|-------------| | [`not_found`](/docs/errors/not_found) | 404 | The requested resource does not exist | | [`duplicate`](/docs/errors/duplicate) | 409 | A resource with the same identifier already exists | | [`invalid_state`](/docs/errors/invalid_state) | 400 | The action is not allowed in the current resource state | | [`already_paid`](/docs/errors/already_paid) | 400 | The invoice is already marked as paid | | [`already_voided`](/docs/errors/already_voided) | 400 | The invoice has already been voided | | [`subscription_already_canceled`](/docs/errors/subscription_already_canceled) | 400 | The subscription is already canceled or scheduled to cancel | ### Auth [#auth] | Code | HTTP | Description | |------|:----:|-------------| | [`unauthorized`](/docs/errors/unauthorized) | 401 | API key is missing or invalid | | [`forbidden`](/docs/errors/forbidden) | 403 | API key does not have permission for this action | | [`key_generation_failed`](/docs/errors/key_generation_failed) | 500 | Failed to generate an API key | ### Verification Pipeline [#verification-pipeline] | Code | HTTP | Description | |------|:----:|-------------| | [`verification_failed`](/docs/errors/verification_failed) | 400 | Payment could not be verified | | [`tx_ref_not_found`](/docs/errors/tx_ref_not_found) | 404 | Transaction reference not found at the PSP | | [`image_fetch_failed`](/docs/errors/image_fetch_failed) | 400 | Could not retrieve the receipt image | | [`image_extraction_failed`](/docs/errors/image_extraction_failed) | 400 | Could not extract data from the receipt image | | [`extraction_failed`](/docs/errors/extraction_failed) | 400 | Data extraction from the receipt failed | | [`date_parse_failed`](/docs/errors/date_parse_failed) | 400 | Could not parse the date from the receipt | | [`empty_input`](/docs/errors/empty_input) | 400 | No input was provided for verification | ### Upstream / PSP [#upstream--psp] | Code | HTTP | Description | |------|:----:|-------------| | [`bank_fetch_failed`](/docs/errors/bank_fetch_failed) | 502 | Failed to fetch transaction data from the bank or PSP | | [`bank_url_build_failed`](/docs/errors/bank_url_build_failed) | 500 | Could not construct the request URL for the PSP | | [`unsupported_psp`](/docs/errors/unsupported_psp) | 400 | The specified PSP is not supported | ### Upstream / Crypto [#upstream--crypto] | Code | HTTP | Description | |------|:----:|-------------| | [`crypto_payment_failed`](/docs/errors/crypto_payment_failed) | 502 | A crypto payment operation could not be completed | | [`crypto_payout_failed`](/docs/errors/crypto_payout_failed) | 502 | A crypto payout could not be processed | | [`crypto_currency_unavailable`](/docs/errors/crypto_currency_unavailable) | 502 | The requested crypto currency is not available | | [`crypto_estimate_failed`](/docs/errors/crypto_estimate_failed) | 502 | The conversion estimate could not be calculated | | [`crypto_ipn_invalid`](/docs/errors/crypto_ipn_invalid) | 400 | The crypto payment webhook signature is invalid | ### Database [#database] | Code | HTTP | Description | |------|:----:|-------------| | [`db_error`](/docs/errors/db_error) | 500 | A database operation failed | ### Fallback [#fallback] | Code | HTTP | Description | |------|:----:|-------------| | [`internal_error`](/docs/errors/internal_error) | 500 | An unexpected internal error occurred | ## Handling Errors [#handling-errors] ```typescript title="Error handling" const response = await fetch("https://api.tryaccess.xyz/api/v1/customers", { headers: { "x-api-key": "ak_..." }, }); if (!response.ok) { const { error } = await response.json(); switch (error.code) { case "unauthorized": // Check or rotate your API key break; case "not_found": // Resource does not exist break; case "parameter_missing": // Check error.param for the missing field console.error(`Missing field: ${error.param}`); break; default: console.error(`[${error.code}] ${error.message}`); // See error.doc_url for details } } ``` # What is Access URL: /docs Payment verification, checkout, invoicing, and customer management API for Ethiopian payment service providers. Access is a unified API for verifying payments, managing customers, generating invoices, and processing checkout sessions across Ethiopian banks and mobile money providers. ## Supported Providers [#supported-providers] | Provider | Type | Verification | |----------|------|:---:| | CBE (Commercial Bank of Ethiopia) | Bank | ✅ | | Awash Bank | Bank | ✅ | | Dashen Bank | Bank | ✅ | | Bank of Abyssinia | Bank | ✅ | | Telebirr | Mobile Money | ✅ | | M-Pesa | Mobile Money | ✅ | | CBEBirr | Mobile Money | ✅ | | Siinqee Bank | Bank | ✅ | | Wegagen Bank | Bank | ✅ | | Amhara Bank | Bank | ✅ | | Zemen Bank | Bank | ✅ | | Kaafi ebirr | Mobile Money | ✅ | | COOPay ebirr | Mobile Money | ✅ | ## Quick Start [#quick-start] ```bash title="Verify a payment" curl -X POST https://api.tryaccess.xyz/api/v1/verify \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "psp": "Telebirr", "amount": 9900, "tx_ref": "FT250123456789" }' ``` ## Capabilities [#capabilities] ## Base URL [#base-url] ``` https://api.tryaccess.xyz ``` ## API Versions [#api-versions] | Version | Status | Base Path | |---------|--------|-----------| | v1 | Stable | `/api/v1/` | | v2 | Beta | `/api/v2/` | All endpoint paths in this documentation are relative to the base URL. For example, `POST /api/v1/verify` means `https://api.tryaccess.xyz/api/v1/verify`. # Invoices URL: /docs/invoices Create, manage, and track invoices for customers. Invoices are generated automatically by subscription renewals or created manually via the API. ## Create an Invoice [#create-an-invoice] ```bash title="Create manual invoice" curl -X POST https://api.tryaccess.xyz/api/v1/invoices \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "customer_id": "cus_01HXYZ...", "subscription_id": "sub_01HXYZ...", "amount": 50000, "currency": "ETB", "due_date": "2025-12-31T00:00:00.000Z" }' ``` Response: ```json { "id": "inv_01HXYZ...", "amount": 50000, "currency": "ETB", "status": "PENDING", "issued_at": "2025-01-15T10:00:00.000Z", "due_date": "2025-12-31T00:00:00.000Z", "created_at": "2025-01-15T10:00:00.000Z", "updated_at": "2025-01-15T10:00:00.000Z", "metadata": null } ``` ### Parameters [#parameters] | Field | Type | Required | Description | |-------|------|:---:|-------------| | `customer_id` | string | Yes | Customer to invoice | | `subscription_id` | string | No | Subscription this invoice belongs to. Leave it out for a one-off invoice. | | `amount` | number | Yes | Total amount in minor units (santim). 1 ETB = 100 santim | | `currency` | string | No | ISO 4217 code (default: `ETB`) | | `due_date` | string | Yes | ISO 8601 due date. Must be in the future | | `metadata` | object | No | Arbitrary key-value pairs | Invoice IDs are prefixed with `inv_`. ## List Invoices [#list-invoices] ```bash title="List invoices" curl "https://api.tryaccess.xyz/api/v1/invoices?status=PENDING&limit=20" \ -H "x-api-key: sk_..." ``` | Parameter | Description | |-----------|-------------| | `cursor` | Pagination cursor from the previous response's `next_cursor` | | `limit` | Results per page (1–100, default 20) | | `status` | Filter by status: `DRAFT`, `PENDING`, `PAID`, `OVERDUE`, `VOIDED`, `CANCELED` | | `subscription_id` | Filter by subscription | | `customer_id` | Filter by customer | The response includes an embedded `customer` object with `id`, `name`, `email`, and `phone_number`. ## Get an Invoice [#get-an-invoice] ```bash curl https://api.tryaccess.xyz/api/v1/invoices/inv_01HXYZ... \ -H "x-api-key: sk_..." ``` Returns the invoice with customer details and linked subscription. ## Mark as Paid [#mark-as-paid] ```bash title="Mark invoice paid" curl -X POST https://api.tryaccess.xyz/api/v1/invoices/inv_01HXYZ.../pay \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{}' ``` Response: ```json { "id": "inv_01HXYZ...", "amount": 50000, "currency": "ETB", "status": "paid", "paid_at": "2025-01-15T11:00:00.000Z" } ``` Cannot mark `voided` or `canceled` invoices as paid. ## Void an Invoice [#void-an-invoice] ```bash title="Void invoice" curl -X POST https://api.tryaccess.xyz/api/v1/invoices/inv_01HXYZ.../void \ -H "x-api-key: sk_..." ``` Response: ```json { "id": "inv_01HXYZ...", "amount": 50000, "currency": "ETB", "status": "voided" } ``` Paid invoices cannot be voided. ## Invoice Lifecycle [#invoice-lifecycle] ``` DRAFT → PENDING → PAID PENDING → OVERDUE (past due date) PENDING → VOIDED PENDING → CANCELED ``` ## Webhook Events [#webhook-events] | Event | Description | |-------|-------------| | `invoice.paid` | Invoice was marked as paid | | `invoice.overdue` | Invoice passed its due date | | `invoice.voided` | Invoice was voided | ## Endpoint Summary [#endpoint-summary] | Action | Method | Endpoint | |--------|--------|----------| | Create | POST | `/api/v1/invoices` | | List | GET | `/api/v1/invoices` | | Get | GET | `/api/v1/invoices/:id` | | Mark paid | POST | `/api/v1/invoices/:id/pay` | | Void | POST | `/api/v1/invoices/:id/void` | # MCP Server URL: /docs/mcp Connect your AI agent or editor to the Access docs over the Model Context Protocol. The Access docs are available as a [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server. Point your coding agent or AI editor at it and it can search the docs and read any page as Markdown, instead of guessing from stale training data. The server uses the streamable HTTP transport. It is read-only, serves only these public docs, and needs no authentication: ```txt https://docs.tryaccess.xyz/api/mcp ``` ## Tools [#tools] | Tool | Input | What it returns | | ------------ | -------------------------- | --------------------------------------------------------------- | | `list_pages` | none | The index of every docs page with its URL (same as `/llms.txt`) | | `get_page` | `url` of a docs page | The full page as Markdown, or an error if no page matches | | `search` | `query`, optional `locale` | Matching pages as JSON | A typical agent run is `search` to find the right page, then `get_page` to read it. Requests are rate limited per IP (60 per minute). Beyond that the server answers `429` with a `Retry-After` header. ## Connect your agent [#connect-your-agent] ### Claude Code [#claude-code] ```bash claude mcp add --transport http access-docs https://docs.tryaccess.xyz/api/mcp ``` ### Cursor [#cursor] Add this to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global): ```json title=".cursor/mcp.json" { "mcpServers": { "access-docs": { "url": "https://docs.tryaccess.xyz/api/mcp" } } } ``` ### VS Code [#vs-code] ```json title=".vscode/mcp.json" { "servers": { "access-docs": { "type": "http", "url": "https://docs.tryaccess.xyz/api/mcp" } } } ``` ### Other MCP clients [#other-mcp-clients] Any client that supports remote (streamable HTTP) servers works with the URL above. Clients that take a JSON config usually accept: ```json { "mcpServers": { "access-docs": { "url": "https://docs.tryaccess.xyz/api/mcp" } } } ``` ## Try it with curl [#try-it-with-curl] The endpoint speaks JSON-RPC. List the tools: ```bash curl -X POST https://docs.tryaccess.xyz/api/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/list" }' ``` Search the docs: ```bash curl -X POST https://docs.tryaccess.xyz/api/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "search", "arguments": { "query": "webhook signature" } } }' ``` ## Other formats for agents [#other-formats-for-agents] - [`/llms.txt`](/llms.txt) is the page index, and [`/llms-full.txt`](/llms-full.txt) is every page in one file. - Add `.md` to any docs URL (for example `/docs/quickstart.md`) to get that page as Markdown. # Pagination URL: /docs/pagination How cursor-based pagination works across all Access API list endpoints. All list endpoints use cursor-based pagination for consistent, efficient traversal of large datasets. ## How It Works [#how-it-works] Every list response includes: ```json { "data": [...], "has_more": true, "next_cursor": "id_01HABC..." } ``` | Field | Description | |-------|-------------| | `data` | Array of results for the current page | | `has_more` | `true` if more results exist beyond this page | | `next_cursor` | Pass this as the `cursor` parameter to get the next page | ## Fetching Pages [#fetching-pages] ```bash title="First page" curl "https://api.tryaccess.xyz/api/v1/transactions?limit=20" \ -H "x-api-key: sk_..." ``` ```bash title="Next page" curl "https://api.tryaccess.xyz/api/v1/transactions?cursor=txn_01HABC...&limit=20" \ -H "x-api-key: sk_..." ``` Continue until `has_more` is `false`. ## Parameters [#parameters] | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `cursor` | string | — | Cursor from a previous response | | `limit` | number | 20 | Results per page (1–100) | ## Endpoints Using Pagination [#endpoints-using-pagination] - `GET /api/v1/customers` - `GET /api/v1/transactions` - `GET /api/v1/subscriptions` - `GET /api/v1/invoices` - `GET /api/v1/checkout/sessions` - `GET /api/v1/webhooks/events` - `GET /api/v1/crypto/payments` - `GET /api/v1/crypto/payouts` ## Example: Fetch All Customers [#example-fetch-all-customers] ```typescript title="Paginate through all customers" let cursor: string | undefined; const allCustomers = []; do { const params = new URLSearchParams({ limit: "100" }); if (cursor) params.set("cursor", cursor); const res = await fetch( `https://api.tryaccess.xyz/api/v1/customers?${params}`, { headers: { "x-api-key": "sk_..." } } ); const { data, has_more, next_cursor } = await res.json(); allCustomers.push(...data); cursor = has_more ? next_cursor : undefined; } while (cursor); ``` ## Ordering [#ordering] Results are ordered by `createdAt` descending (newest first) by default. This ordering is consistent across pages. # Payment Methods URL: /docs/payment-methods Configure bank accounts for receiving payments through supported PSPs. Payment methods are the bank accounts and mobile money accounts your business uses to receive payments. Each merchant can have one account per PSP. These accounts are used by the verification engine to match incoming transactions. ## Add a Bank Account [#add-a-bank-account] ```bash title="Add bank account" curl -X POST https://api.tryaccess.xyz/api/v1/payment_methods \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "bank_code": "CBE", "account_name": "Abebe Girma", "account_number": "1000123456789" }' ``` Response: ```json { "id": "ba_01HXYZ...", "bank_code": "CBE", "account_name": "Abebe Girma", "account_number": "1000123456789", "status": "pending", "created_at": "2025-01-15T10:00:00.000Z", "updated_at": "2025-01-15T10:00:00.000Z" } ``` ### Parameters [#parameters] | Field | Type | Required | Description | |-------|------|:---:|-------------| | `bank_code` | string | Yes | PSP code. One of: `CBE`, `Awash`, `Dashen`, `Abyssinia`, `Telebirr`, `Mpesa`, `CBEBirr`, `Siinqee`, `Wegagen`, `AmharaBank`, `Zemen`, `EbirrKaafi`, `EbirrCoopay` | | `account_name` | string | Yes | Account holder name as it appears on the bank account | | `account_number` | string | Yes | Bank account number or wallet phone number | Bank account IDs are prefixed with `ba_`. Only one account per PSP is allowed per merchant — adding a duplicate returns a `duplicate` error. ## List Bank Accounts [#list-bank-accounts] ```bash title="List bank accounts" curl https://api.tryaccess.xyz/api/v1/payment_methods \ -H "x-api-key: sk_..." ``` Response: ```json { "data": [ { "id": "ba_01HXYZ...", "bank_code": "CBE", "account_name": "Abebe Girma", "account_number": "1000123456789", "status": "pending", "created_at": "2025-01-15T10:00:00.000Z", "updated_at": "2025-01-15T10:00:00.000Z" } ] } ``` ## Get a Bank Account [#get-a-bank-account] ```bash curl https://api.tryaccess.xyz/api/v1/payment_methods/ba_01HXYZ... \ -H "x-api-key: sk_..." ``` ## Update a Bank Account [#update-a-bank-account] ```bash title="Update bank account" curl -X PATCH https://api.tryaccess.xyz/api/v1/payment_methods/ba_01HXYZ... \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "account_name": "Abebe G. Tadesse" }' ``` Updatable fields: `account_name`, `account_number`. Normalized versions are re-derived automatically. ## Delete a Bank Account [#delete-a-bank-account] ```bash title="Delete bank account" curl -X DELETE https://api.tryaccess.xyz/api/v1/payment_methods/ba_01HXYZ... \ -H "x-api-key: sk_..." ``` Response: ```json { "id": "ba_01HXYZ...", "deleted": true } ``` After deletion, you can add a new account for the same PSP. ## Account Status [#account-status] | Status | Description | |--------|-------------| | `pending` | Account added, awaiting verification | | `active` | Account verified and active | | `inactive` | Account disabled | ## Supported PSPs [#supported-psps] | Code | Provider | |------|----------| | `CBE` | Commercial Bank of Ethiopia | | `Awash` | Awash Bank | | `Dashen` | Dashen Bank | | `Abyssinia` | Bank of Abyssinia | | `Telebirr` | Telebirr | | `Mpesa` | M-Pesa | | `CBEBirr` | CBEBirr | | `Siinqee` | Siinqee Bank | | `Wegagen` | Wegagen Bank | | `AmharaBank` | Amhara Bank | | `Zemen` | Zemen Bank | | `EbirrKaafi` | Kaafi ebirr | | `EbirrCoopay` | COOPay ebirr | ## Endpoint Summary [#endpoint-summary] | Action | Method | Endpoint | |--------|--------|----------| | Add | POST | `/api/v1/payment_methods` | | List | GET | `/api/v1/payment_methods` | | Get | GET | `/api/v1/payment_methods/:id` | | Update | PATCH | `/api/v1/payment_methods/:id` | | Delete | DELETE | `/api/v1/payment_methods/:id` | # Customer Portal URL: /docs/portal Send customers to a hosted page where they pay invoices, update their details and cancel subscriptions. The customer portal is a page Access hosts for you. Customers see what they owe and pay it, check their subscription, update their billing information, look through past invoices, and cancel, all without you building any UI. It's modelled on Stripe's customer portal and uses the same object shapes. The portal takes its logo, colours, font and light or dark mode from your [checkout](/docs/checkout) theme, so it looks like the rest of your billing. ## How It Works [#how-it-works] 1. Your backend [creates a portal session](#create-a-session) for a customer with your API key. 2. Access returns a short-lived `url`. 3. You redirect the customer to it (for example from a "Manage billing" button). 4. They use the portal until the link expires, then come back through the **Return to …** link. Sessions aren't stored. The URL carries a signed secret that names the customer and expires, so creating one is cheap: make a new session each time a customer clicks your button, and never email or reuse a link. ## Create a Session [#create-a-session] ```bash title="Create portal session" curl -X POST https://api.tryaccess.xyz/api/v1/billing_portal/sessions \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "customer": "cus_01J9Z8K2P3Q4R5S6T7U8V9W0X1", "return_url": "https://yourapp.com/account" }' ``` Response: ```json { "id": "bps_01J9Z8K2P3Q4R5S6T7U8V9W0X1", "object": "billing_portal.session", "configuration": "bpc_01J9Z8K2P3Q4R5S6T7U8V9W0X1", "created": 1793162342, "expires_at": 1793165942, "customer": "cus_01J9Z8K2P3Q4R5S6T7U8V9W0X1", "flow": null, "livemode": true, "locale": null, "return_url": "https://yourapp.com/account", "url": "https://tryaccess.xyz/p/session?secret=eyJhbGciOi..." } ``` ### Parameters [#parameters] | Field | Type | Required | Description | | ------------ | ------ | :------: | ------------------------------------------------------------------------------------------------- | | `customer` | string | Yes | The ID of one of your customers | | `return_url` | string | No | Where the portal's **Return to …** link goes. Defaults to the configuration's `default_return_url` | | `flow_data` | object | No | Open the portal on one task instead of its homepage. See [Deep links](#deep-links) | | `locale` | string | No | For example `en` or `am` | | `expires_in` | number | No | Seconds until the link stops working: 300 to 86400. Default 3600 (1 hour) | Anyone with the URL can act as that customer until it expires. Redirect to it right away; don't log it, store it or send it by email. ## What Customers Can Do [#what-customers-can-do] | On the portal | Controlled by | | --------------------------- | ----------------------------------------------- | | See and pay what's due | Always on | | See their subscription | Always on | | Update name, email, phone | `features.customer_update` | | Browse and search invoices | `features.invoice_history` | | Cancel a subscription | `features.subscription_cancel` | **Pay invoice** opens the invoice's own page, where the customer pays by bank or wallet transfer and Access verifies the reference, as for any [invoice](/docs/invoices). Customers don't save payment methods, so there's nothing to manage there. Cancelling always takes effect at the end of the period the customer paid for: the subscription stays `active` until `current_period_end` and isn't billed again. See [Subscriptions](/docs/subscriptions#subscription-lifecycle). ## Deep Links [#deep-links] Pass `flow_data` to send the customer straight to one task. When they finish, `after_completion` decides what happens next. ```bash title="Open the cancel page for one subscription" curl -X POST https://api.tryaccess.xyz/api/v1/billing_portal/sessions \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "customer": "cus_01J9Z8K2P3Q4R5S6T7U8V9W0X1", "flow_data": { "type": "subscription_cancel", "subscription_cancel": { "subscription": "sub_01J9Z8K2P3Q4" }, "after_completion": { "type": "redirect", "redirect": { "return_url": "https://yourapp.com/account?canceled=1" } } } }' ``` | `flow_data.type` | Opens | Needs | | --------------------- | ------------------------------------------ | ---------------------------------------- | | `customer_update` | The billing information form | `features.customer_update` enabled | | `subscription_cancel` | The cancel page for one subscription | `subscription_cancel.subscription`, an active or past-due subscription of this customer, and `features.subscription_cancel` enabled | | `after_completion.type` | After the task | | ----------------------- | ----------------------------------------------------------------------------------------- | | `portal_homepage` | Back to the portal homepage, with a short confirmation (default) | | `redirect` | To `redirect.return_url` | | `hosted_confirmation` | A confirmation page, with your `hosted_confirmation.custom_message` (up to 500 characters) | A flow your configuration doesn't allow, or a subscription that's already set to cancel, is rejected with [`invalid_state`](/docs/errors/invalid_state). ## Configuration [#configuration] Each merchant has one portal configuration. A merchant who has never changed it gets **Access's recommended settings**, and `created` is `null` until the first change. You can change it in the dashboard (**Settings → Customer portal**, which can also put you back on the recommended settings) or with the API. ```bash title="Retrieve the configuration" curl https://api.tryaccess.xyz/api/v1/billing_portal/configuration \ -H "x-api-key: sk_..." ``` ```json { "id": "bpc_01J9Z8K2P3Q4R5S6T7U8V9W0X1", "object": "billing_portal.configuration", "active": true, "is_default": true, "business_profile": { "headline": null, "privacy_policy_url": null, "terms_of_service_url": null }, "default_return_url": null, "features": { "customer_update": { "enabled": true, "allowed_updates": ["name", "email", "phone"] }, "invoice_history": { "enabled": true }, "subscription_cancel": { "enabled": true, "mode": "at_period_end", "cancellation_reason": { "enabled": true, "options": ["too_expensive", "missing_features", "switched_service", "unused", "other"] } }, "subscription_pause": { "enabled": false } }, "metadata": {}, "created": null, "updated": null } ``` ### Update It [#update-it] `POST` changes only the fields you send: ```bash title="Update the configuration" curl -X POST https://api.tryaccess.xyz/api/v1/billing_portal/configuration \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "business_profile": { "headline": "Acme partners with Access for simplified billing." }, "default_return_url": "https://yourapp.com/account", "features": { "customer_update": { "allowed_updates": ["name", "phone"] }, "subscription_cancel": { "cancellation_reason": { "options": ["too_expensive", "unused", "other"] } } } }' ``` | Field | Description | | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- | | `business_profile.headline` | Shown next to your logo, up to 60 characters. `null` shows "… partners with Access for simplified billing." | | `business_profile.privacy_policy_url`, `terms_of_service_url` | Your policies (http or https) | | `default_return_url` | The **Return to …** link when a session doesn't set `return_url` | | `features.customer_update.enabled`, `allowed_updates` | Whether customers can edit their details, and which of `name`, `email`, `phone` | | `features.invoice_history.enabled` | Whether customers see their past invoices | | `features.subscription_cancel.enabled` | Whether customers can cancel. `mode` is always `at_period_end` | | `features.subscription_cancel.cancellation_reason` | Whether customers are asked why, and which reasons they pick from (at least one) | | `features.subscription_pause.enabled` | Reserved: pausing isn't available yet | | `metadata` | Your own key/value pairs. A value of `""` removes that key | Cancellation reasons: `too_expensive`, `missing_features`, `switched_service`, `unused`, `customer_service`, `too_complex`, `low_quality`, `other`. ## Webhooks [#webhooks] The portal's actions send the usual events, so the rest of your integration doesn't need to know where a change came from. | When a customer… | Event | | ----------------------- | ----------------------------------------------------------------------------------------- | | Pays an invoice | `invoice.paid` | | Cancels a subscription | `customer.subscription.updated` with `reason: "cancel_requested"`, then `customer.subscription.canceled` at period end | A cancellation made in the portal also carries what the customer told you: ```json { "type": "customer.subscription.updated", "timestamp": "2026-10-28T09:14:02.000Z", "data": { "id": "sub_01J9Z8K2P3Q4", "object": "subscription", "status": "active", "cancel_at_period_end": true, "current_period_end": "2026-11-10T00:00:00.000Z", "reason": "cancel_requested", "cancellation_details": { "reason": "too_expensive", "feedback": "We need a cheaper plan for a small team." } } } ``` (Other subscription fields are left out above.) `cancellation_details.reason` is `null` when the customer skipped the question, and `feedback` is `null` when they left the box empty. ## Expired Links [#expired-links] After `expires_at` (or `expires_in` seconds) the URL shows **"For security reasons, this page has expired."** with a link back to the session's `return_url`. Create a new session to let the customer in again. ## Errors [#errors] | Scenario | HTTP | Code | | -------------------------------------------------- | :--: | -------------------------------------------------------- | | `customer` isn't one of your customers | 400 | [`resource_not_found`](/docs/errors/resource_not_found) | | A field is missing, unknown or invalid | 400 | [`parameter_invalid`](/docs/errors/parameter_invalid) | | The flow isn't allowed or the subscription can't be canceled | 400 | [`invalid_state`](/docs/errors/invalid_state) | | Missing or wrong API key | 401 | [`unauthorized`](/docs/errors/unauthorized) | ## Building Your Own Portal [#building-your-own-portal] To build your own UI instead, use the token-based [Customer Portal API](/docs/portal-api). # Quickstart URL: /docs/quickstart Verify your first payment with the Access API in under 5 minutes. This guide walks through verifying a payment using the Access API. ## Prerequisites [#prerequisites] - An Access account with a merchant created - An API key (see [Authentication](/docs/authentication)) - A transaction reference or receipt image from a supported payment provider ## Verify a Payment [#verify-a-payment] `POST /api/v1/verify` verifies a payment synchronously. It fetches the receipt directly from the bank, extracts the transaction, and matches it against your merchant account. The result is returned immediately. ```bash title="Verify a payment" curl -X POST https://api.tryaccess.xyz/api/v1/verify \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "psp": "Telebirr", "amount": 9900, "tx_ref": "FT250123456789" }' ``` Response: ```json { "id": "tran_01HXYZ...", "psp": "Telebirr", "tx_ref": "FT250123456789", "verified": true, "rejection_reason": null, "match": { "is_match": true, "name_match": true, "amount_match": true, "account_match": true, "status_match": true, "confidence": "high", "reasons": [] }, "transaction": { "reference": "FT250123456789", "date": "2025-01-15", "date_utc": "2025-01-15T07:00:00.000Z", "sender": { "name": "Abebe Kebede", "account": "0912345678" }, "receiver": { "name": "My Business", "account": "1000123456789" }, "amount": 9900, "currency": "ETB", "service_fee": 0, "vat": 0, "total": 9900, "amount_in_words": "Ninety-nine birr" } } ``` ## Request Fields [#request-fields] | Field | Type | Required | Description | | ------------------- | ------ | :------: | -------------------------------------------------------------------- | | `psp` | string | Yes | Payment service provider. See [Supported PSPs](#supported-psps) | | `amount` | number | Yes | Expected amount in minor units (santim). 1 ETB = 100 santim | | `tx_ref` | string | No | Transaction reference from the receipt | | `sender_account` | string | No | Sender's bank account number. Required for Abyssinia transactions, optional for Wegagen | | `receipt_image_url` | string | No | Publicly accessible URL of the receipt image for AI-based extraction | You must provide at least one of `tx_ref` or `receipt_image_url`. ## Receipt-Based Verification [#receipt-based-verification] If you don't have a transaction reference, provide a receipt screenshot URL. Access uses AI to extract the transaction details from the image. ```bash title="Verify with receipt image" curl -X POST https://api.tryaccess.xyz/api/v1/verify \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "psp": "CBE", "amount": 15000, "receipt_image_url": "https://storage.example.com/receipts/receipt-abc123.jpg" }' ``` ## Supported PSPs [#supported-psps] | Value | Provider | | ----------- | --------------------------- | | `CBE` | Commercial Bank of Ethiopia | | `Awash` | Awash Bank | | `Dashen` | Dashen Bank | | `Telebirr` | Telebirr | | `Abyssinia` | Bank of Abyssinia | | `Mpesa` | M-Pesa | | `CBEBirr` | CBEBirr | | `Siinqee` | Siinqee Bank | | `Wegagen` | Wegagen Bank | | `AmharaBank` | Amhara Bank | | `Zemen` | Zemen Bank | | `EbirrKaafi` | Kaafi ebirr | | `EbirrCoopay` | COOPay ebirr | ## Match Object [#match-object] The `match` object describes how the extracted transaction compares to your merchant account: | Field | Type | Description | | --------------- | ------------------- | --------------------------------------- | | `is_match` | boolean | Overall match result | | `name_match` | boolean | Receiver name matched | | `amount_match` | boolean \| null | Amount matched the expected value | | `account_match` | boolean | Receiver account matched | | `status_match` | boolean \| null | Transaction status was successful | | `confidence` | `"high"` \| `"low"` | Confidence level of the extraction | | `reasons` | string[] | Reasons for rejection or low confidence | ## Error Responses [#error-responses] | Status | Type | Description | | ------ | ----------------------- | -------------------------------------------------- | | `400` | `invalid_request_error` | Missing or invalid parameters | | `401` | `authentication_error` | Invalid or missing API key | | `422` | `verification_error` | Receipt could not be processed or tx_ref not found | | `500` | `api_error` | Internal server error | | `502` | `upstream_error` | Bank unreachable | ## Next Steps [#next-steps] - [Create a checkout session](/docs/checkout) to collect payments - [Set up webhooks](/docs/webhooks) to receive payment notifications - [Manage customers](/docs/customers) and track their transactions # Subscriptions URL: /docs/subscriptions Recurring billing with automatic lifecycle management. Subscriptions are under active development and not yet available in the v1 API. The portal endpoints for viewing and managing subscriptions are available now for customers who have subscriptions created internally. Subscriptions handle recurring billing for your customers. Access automatically schedules reminders, renewals, and expiry based on the billing interval. ## Subscription Object [#subscription-object] A subscription has the following fields: | Field | Type | Description | |-------|------|-------------| | `id` | string | Unique subscription ID (prefixed `sub_`) | | `status` | string | `active`, `past_due`, `canceled` | | `billing_interval` | string | `Monthly` or `Yearly` | | `amount` | number | Recurring amount in minor units (santim) | | `current_period_start` | string | ISO 8601 start of the current billing period | | `current_period_end` | string | ISO 8601 end of the current billing period | | `next_billing_date` | string | ISO 8601 date of the next renewal | | `auto_renew` | boolean | Whether the subscription renews automatically | | `cancel_at_period_end` | boolean | `true` once a cancel was requested; it ends at `current_period_end` | | `canceled_at` | string \| null | When the subscription was canceled (or the cancel was requested) | ## Subscription Lifecycle [#subscription-lifecycle] ``` active → past_due → canceled (renewal unpaid) active → canceled (cancel requested, at period end) ``` Access drives each period from the dates stored on the subscription: 1. **Invoice**: 3 days before `current_period_end`, Access issues the next period's invoice and emails it to the customer with payment instructions. 2. **Reminder**: 1 day before, if still unpaid, the customer gets a reminder. 3. **Renewal**: paying the invoice moves the subscription to the next period. If it's still unpaid at `current_period_end`, the subscription becomes `past_due` and the customer is told it will be canceled in 1 day. 4. **Cancellation**: still unpaid 1 day after going past due, the subscription is `canceled` and the invoice is voided. Canceling (through the API or the customer portal) keeps the subscription `active` until `current_period_end`, sets `cancel_at_period_end` and `auto_renew: false`, and voids any open invoice for the next period. It becomes `canceled` when the period ends. A cancel can't be undone. ## Webhook Events [#webhook-events] | Event | When | |-------|------| | `invoice.created` | Next period's invoice issued (3 days before period end) | | `invoice.upcoming` | Reminder sent (1 day before period end) | | `invoice.paid` | Invoice paid; the subscription moved to the next period | | `invoice.payment_failed` | A payment reference couldn't be verified; the invoice stays payable | | `invoice.voided` | Invoice voided by a cancellation | | `customer.subscription.updated` | Went `past_due`, or a cancel was requested | | `customer.subscription.canceled` | Subscription ended (unpaid, or a requested cancel at period end) | ## Customer Portal [#customer-portal] Send customers to the hosted [Customer Portal](/docs/portal) to manage their subscription themselves: - See the subscription, its price and when it renews - Pay the open invoice and browse past ones - Cancel, saying why (it ends at the end of the current period) A cancellation from the portal sends `customer.subscription.updated` with `reason: "cancel_requested"` and the customer's `cancellation_details` (`reason` and `feedback`). See [Webhooks](/docs/portal#webhooks). To build your own UI instead, including changing the billing interval and turning auto-renewal off, use the [Customer Portal API](/docs/portal-api). # Testing URL: /docs/testing Use test transaction references to see every error state of the checkout. Test references let you see how your checkout behaves when a payment cannot be verified, without moving any money. They work like Stripe's test cards: you type a known value and get a known outcome. Test references only work in **test sessions** and in the **checkout preview** of the checkout editor. In a live session they are treated like any other text and sent to the bank for verification. ## Try a test reference [#try-a-test-reference] 1. Open your checkout in test mode, or the checkout preview in the editor. 2. Pick a bank and go to the last step, where the customer uploads the receipt. 3. Choose **Enter the transaction reference instead** under the upload and type one of the references below. 4. Press **Submit for Verification**. The checkout shows the matching error, or the success screen. References ignore capital letters and spaces around them, so `test_wrong_amount` works too. The same reference gives the same outcome for every bank. ## Test references [#test-references] | Reference | Outcome | HTTP status | Error code | | --- | --- | --- | --- | | `TEST_SUCCESS` | Payment verified | `200` | none | | `TEST_WRONG_AMOUNT` | Amount does not match the order | `400` | [`verification_failed`](/docs/errors/verification_failed) | | `TEST_WRONG_RECIPIENT` | Money went to a different account | `400` | [`verification_failed`](/docs/errors/verification_failed) | | `TEST_MULTIPLE_MISMATCHES` | More than one detail does not match | `400` | [`verification_failed`](/docs/errors/verification_failed) | | `TEST_INCOMPLETE` | The payment is not completed at the bank | `400` | [`verification_failed`](/docs/errors/verification_failed) | | `TEST_DUPLICATE` | The reference was already used | `400` | [`duplicate`](/docs/errors/duplicate) | | `TEST_REF_NOT_FOUND` | The reference was not found at the bank | `422` | [`tx_ref_not_found`](/docs/errors/tx_ref_not_found) | | `TEST_UNREADABLE` | Details could not be read from the receipt | `422` | [`extraction_failed`](/docs/errors/extraction_failed) | | `TEST_BANK_DOWN` | The bank could not be reached | `502` | [`bank_fetch_failed`](/docs/errors/bank_fetch_failed) | | `TEST_SERVER_ERROR` | Something failed on our side | `500` | [`internal_error`](/docs/errors/internal_error) | Any other text, or a receipt image on its own, counts as a successful payment in a test session. ## Messages [#messages] Each reference shows this message to the customer. | Reference | Message | | --- | --- | | `TEST_WRONG_AMOUNT` | The payment amount does not match the expected value. expected ETB 900.00, but received ETB 450.00. | | `TEST_WRONG_RECIPIENT` | The recipient name or account does not match the expected merchant account. | | `TEST_MULTIPLE_MISMATCHES` | Multiple mismatches were detected in the payment details. | | `TEST_INCOMPLETE` | The transaction status could not be verified and appears incomplete. | | `TEST_DUPLICATE` | This payment receipt has already been processed. you need to pay again, and submit a different receipt. | | `TEST_REF_NOT_FOUND` | The receipt reference could not be found in the provided details. Please verify the reference and try again. | | `TEST_UNREADABLE` | The receipt could not be read. Please confirm the receipt is clear and try again. | | `TEST_BANK_DOWN` | The bank service is temporarily unavailable. Please try again in a moment. | | `TEST_SERVER_ERROR` | An unexpected error occurred while verifying the payment. Please try again later. | ## Test the receipt upload [#test-the-receipt-upload] In a test session the upload is simulated and nothing is stored. To see the upload error and its **Retry** button, choose an image whose file name contains `fail`, for example `fail-receipt.png`. ## Limits [#limits] - Session states such as expired or already paid are not part of the test references. - Test references skip the bank, so they do not check that a real reference has the right format. # Transactions URL: /docs/transactions View and filter transaction history. Transactions are created by the verification and checkout flows. The transactions API is read-only transactions are created automatically when payments are verified or checkout sessions complete. ## List Transactions [#list-transactions] ```bash title="List transactions" curl "https://api.tryaccess.xyz/api/v1/transactions?status=success&limit=20" \ -H "x-api-key: sk_..." ``` ### Query Parameters [#query-parameters] | Parameter | Description | |-----------|-------------| | `cursor` | Pagination cursor from the previous response's `next_cursor` | | `limit` | Results per page (1–100, default 20) | | `status` | Filter by status: `IDLE`, `PROCESSING`, `SUCCESS`, `FAILED`, `CANCELED`, `NOT_FOUND`, `REQUIRE_INPUT` | | `payment_method` | Filter by PSP: `CBE`, `Awash`, `Dashen`, `Telebirr`, `Abyssinia`, `Mpesa`, `CBEBirr`, `Siinqee`, `Wegagen`, `AmharaBank`, `Zemen`, `EbirrKaafi`, `EbirrCoopay` | | `customer_id` | Filter by customer ID | | `created_after` | ISO 8601 datetime only return transactions created after this timestamp | ### Response [#response] ```json { "data": [ { "id": "tran_01HXYZ...", "amount": 15000, "currency": "ETB", "status": "success", "tx_ref": "FT250123456789", "payment_method": "CBE", "receipt_image_url": null, "created_at": "2025-01-15T10:30:00.000Z", "updated_at": "2025-01-15T10:30:00.000Z", "customer": { "id": "cus_01HXYZ...", "name": "Abebe Kebede", "email": "abebe@example.com", "phone_number": "+251911234567" } } ], "has_more": true, "next_cursor": "tran_01HABC..." } ``` ## Get a Transaction [#get-a-transaction] ```bash curl https://api.tryaccess.xyz/api/v1/transactions/tran_01HXYZ... \ -H "x-api-key: sk_..." ``` Returns the transaction with full customer details: ```json { "id": "tran_01HXYZ...", "amount": 15000, "currency": "ETB", "status": "success", "tx_ref": "FT250123456789", "payment_method": "CBE", "receipt_image_url": null, "created_at": "2025-01-15T10:30:00.000Z", "updated_at": "2025-01-15T10:30:00.000Z", "customer": { "id": "cus_01HXYZ...", "name": "Abebe Kebede", "email": "abebe@example.com", "phone_number": "+251911234567" } } ``` ## Transaction Statuses [#transaction-statuses] | Status | Description | |--------|-------------| | `IDLE` | Created, not yet processed | | `PROCESSING` | Verification in progress | | `SUCCESS` | Payment verified | | `FAILED` | Verification failed | | `CANCELED` | Transaction was canceled | | `NOT_FOUND` | Transaction reference not found at the PSP | | `REQUIRE_INPUT` | Additional input needed (e.g. receipt image) | ## Endpoint Summary [#endpoint-summary] | Action | Method | Endpoint | |--------|--------|----------| | List | GET | `/api/v1/transactions` | | Get | GET | `/api/v1/transactions/:id` | # Payment Verification URL: /docs/verifications Synchronously verify payments from Ethiopian banks and mobile money providers. `POST /api/v1/verify` fetches the transaction directly from the bank or mobile money provider, extracts the details, and matches them against your merchant account. The result is returned immediately no polling required. ## Request [#request] ```bash title="Verify a payment" curl -X POST https://api.tryaccess.xyz/api/v1/verifications \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "psp": "CBE", "amount": 9900, "tx_ref": "FT250123456789" }' ``` ### Body Parameters [#body-parameters] | Field | Type | Required | Description | |-------|------|:--------:|-------------| | `psp` | string | ✅ | Payment service provider. See [Supported PSPs](#supported-psps) | | `amount` | number | ✅ | Expected amount in minor units (santim). 1 ETB = 100 santim | | `tx_ref` | string | — | Transaction reference from the receipt | | `sender_account` | string | — | Sender's bank account number. Required for Abyssinia. Optional for Wegagen, see [Transaction References by Provider](#transaction-references-by-provider) | | `receipt_image_url` | string | — | Publicly accessible URL of the receipt image | At least one of `tx_ref` or `receipt_image_url` must be provided. ## Response [#response] ```json title="200 OK" { "id": "tran_01HXYZ123456", "psp": "Telebirr", "tx_ref": "FT250123456789", "verified": true, "rejection_reason": null, "match": { "is_match": true, "name_match": true, "amount_match": true, "account_match": true, "status_match": true, "confidence": "high", "reasons": [] }, "transaction": { "reference": "FT250123456789", "date": "2025-01-23", "date_utc": "2025-01-23T08:30:00.000Z", "sender": { "name": "Abebe Kebede", "account": "0912345678" }, "receiver": { "name": "My Business", "account": "1000123456789" }, "amount": 9900, "currency": "ETB", "service_fee": 0, "vat": 0, "total": 9900, "amount_in_words": "Ninety-nine birr" } } ``` ### Response Fields [#response-fields] | Field | Type | Description | |-------|------|-------------| | `id` | string | Transaction record ID | | `psp` | string | Provider that processed the transaction | | `tx_ref` | string | Transaction reference | | `verified` | boolean | Whether the payment was verified | | `rejection_reason` | string \| null | Reason for rejection if `verified` is `false` | | `match` | object | Match details. See [Match Object](#match-object) | | `transaction` | object | Extracted transaction data. See [Transaction Object](#transaction-object) | ## Match Object [#match-object] Describes how the extracted transaction compares to your merchant account. | Field | Type | Description | |-------|------|-------------| | `is_match` | boolean | Overall match result | | `name_match` | boolean | Receiver name matched your account | | `amount_match` | boolean \| null | Amount matched the expected value | | `account_match` | boolean | Receiver account matched your account | | `status_match` | boolean \| null | Transaction status was successful | | `confidence` | `"high"` \| `"low"` | Confidence level of the extraction | | `reasons` | string[] | Reasons for rejection or low confidence | A payment can be `verified: false` with `is_match: false` when the transaction was found but the details don't match your account. Check `reasons` for specifics. ## Transaction Object [#transaction-object] Raw data extracted from the bank or receipt. | Field | Type | Description | |-------|------|-------------| | `reference` | string | Transaction reference number | | `date` | string | Transaction date (`YYYY-MM-DD`) | | `date_utc` | string \| null | UTC timestamp if available | | `sender` | object | `{ name, account }` | | `receiver` | object | `{ name, account }` | | `amount` | number | Amount in santim (ETB × 100) | | `currency` | `"ETB"` | Always `ETB` | | `service_fee` | number | Service fee in santim | | `vat` | number | VAT in santim | | `total` | number | Total charged in santim | | `amount_in_words` | string | Amount written out in words | ## Supported PSPs [#supported-psps] | Value | Provider | Type | |-------|----------|------| | `CBE` | Commercial Bank of Ethiopia | Bank | | `Awash` | Awash Bank | Bank | | `Dashen` | Dashen Bank | Bank | | `Abyssinia` | Bank of Abyssinia | Bank | | `Siinqee` | Siinqee Bank | Bank | | `Wegagen` | Wegagen Bank | Bank | | `AmharaBank` | Amhara Bank | Bank | | `Zemen` | Zemen Bank | Bank | | `Telebirr` | Telebirr | Mobile Money | | `Mpesa` | M-Pesa | Mobile Money | | `CBEBirr` | CBEBirr | Mobile Money | | `EbirrKaafi` | Kaafi ebirr (Kaafi Microfinance) | Mobile Money | | `EbirrCoopay` | COOPay ebirr (Cooperative Bank of Oromia) | Mobile Money | ## Transaction References by Provider [#transaction-references-by-provider] For most providers, `tx_ref` is the reference printed on the receipt, such as CBE's `FT…` number. A few providers look receipts up by a different ID: | `psp` | What to send as `tx_ref` | Notes | |-------|--------------------------|-------| | `EbirrKaafi` | The ID at the end of the receipt link in the SMS, `https://receipt.ebirr.com/kaafimf/` | Not the numeric `Ref:` from the SMS. The whole link also works | | `EbirrCoopay` | The ID at the end of the receipt link in the SMS, `https://receipt.ebirr.com/coopay/` | Not the numeric `Ref:` from the SMS. The whole link also works | | `Wegagen` | The 24-character ID from the receipt link in the SMS (`…?id=`) | The 16-character Reference No printed on the receipt also works if you send the payer's account number as `sender_account` | | `Zemen` | The 24-character ID from the receipt link, `https://share.zemenbank.com/rt//pdf` | The 16-character Reference No printed on the receipt is not enough. The whole link also works | | `AmharaBank` | The 12-character reference, such as `FT26170VYQXW` | The receipt link also works | ## Receipt Image Verification [#receipt-image-verification] If you don't have a transaction reference, pass a publicly accessible receipt screenshot URL. Access uses AI to extract the transaction details from the image. ```bash title="Verify with receipt image" curl -X POST https://api.tryaccess.xyz/api/v1/verify \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "psp": "CBE", "amount": 15000, "receipt_image_url": "https://storage.example.com/receipts/receipt.jpg" }' ``` You can also pass both `tx_ref` and `receipt_image_url` together Access will use the image as a fallback if the reference lookup fails. ## Duplicate Transaction References [#duplicate-transaction-references] Each `tx_ref` can only be verified once per merchant. Submitting the same `tx_ref` a second time returns a `400` error with code `parameter_invalid`. ## Error Responses [#error-responses] | Status | Type | Code | Description | |--------|------|------|-------------| | `400` | `invalid_request_error` | `parameter_missing` | Required field missing or `tx_ref` already used | | `400` | `invalid_request_error` | `parameter_invalid` | Duplicate `tx_ref` | | `401` | `authentication_error` | `unauthorized` | Invalid or missing API key | | `422` | `verification_error` | `image_extraction_failed` | Receipt image could not be processed | | `422` | `verification_error` | `extraction_failed` | Transaction details could not be extracted | | `500` | `api_error` | `internal_server_error` | Unexpected server error | | `502` | `upstream_error` | `bank_fetch_failed` | Bank or provider unreachable | See [Errors](/docs/errors) for the full error object shape. # Webhooks URL: /docs/webhooks Receive real-time event notifications for payments, subscriptions, and invoices. Webhooks deliver real-time HTTP POST notifications to your server when events occur in your Access account. ## Register an Endpoint [#register-an-endpoint] ```bash title="Create webhook endpoint" curl -X POST https://api.tryaccess.xyz/api/v1/webhooks/endpoints \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "url": "https://yourapp.com/webhooks/access", "enabled_events": ["checkout.session.completed", "invoice.paid"] }' ``` Response: ```json { "id": "we_01HXYZ...", "url": "https://yourapp.com/webhooks/access", "secret": "whsec_01HXYZ...", "status": "active", "enabled_events": ["checkout.session.completed", "invoice.paid"], "created_at": "2025-01-15T10:00:00.000Z", "updated_at": "2025-01-15T10:00:00.000Z" } ``` The signing `secret` is returned only at creation time. Store it securely. Leave `enabled_events` empty to receive all events. ## Event Types [#event-types] ### Checkout [#checkout] | Event | Description | |-------|-------------| | `checkout.session.completed` | Checkout session payment succeeded | | `checkout.session.expired` | Checkout session expired | ### Payments [#payments] | Event | Description | |-------|-------------| | `payment.completed` | Payment was verified | | `payment.failed` | Payment verification failed | ### Crypto [#crypto] | Event | Description | |-------|-------------| | `crypto_payment.confirming` | Crypto for a payment arrived and is being confirmed | | `crypto_payment.finished` | A crypto payment was paid in full | | `crypto_payment.failed` | A crypto payment failed, like when too little was sent | | `crypto_payment.expired` | A crypto payment ran out of time before it was paid | | `crypto_payout.paid` | A crypto payout or refund was sent | | `crypto_payout.failed` | A crypto payout or refund couldn't be sent | | `crypto_payout.rejected` | A crypto payout or refund was rejected | ### Subscriptions [#subscriptions] | Event | Description | |-------|-------------| | `subscription.renewed` | Subscription period renewed | | `subscription.payment_failed` | Subscription renewal payment failed | | `customer.subscription.canceled` | Subscription was cancelled | ### Invoices [#invoices] | Event | Description | |-------|-------------| | `invoice.paid` | Invoice was paid | | `invoice.payment_failed` | Invoice payment failed | | `invoice.voided` | Invoice was voided | ## Webhook Payload [#webhook-payload] ```json title="Example payload" { "id": "evt_01HXYZ...", "type": "checkout.completed", "created_at": "2025-01-15T10:30:00Z", "data": { "sessionId": "cs_01HXYZ...", "mode": "payment", "customerId": "cus_01HXYZ...", "amount": 15000, "currency": "ETB" } } ``` ## Signature Verification [#signature-verification] All webhook deliveries include an `x-access-signature` header. Verify it using HMAC-SHA256 with your webhook secret: ```typescript title="Verify webhook signature" import { createHmac } from 'crypto'; function verifyWebhook(body: string, signature: string, secret: string): boolean { const computed = createHmac('sha256', secret) .update(body) .digest('hex'); return computed === signature; } ``` Always verify signatures before processing webhook payloads to prevent spoofing. ## Matching a Webhook to Your Request [#matching-a-webhook-to-your-request] When one of your API requests caused the event, the delivery carries an `access-request-id` header with that request's id: the same `req_…` value the API returned in its `X-Request-Id` header. Retries carry it too, and so does work the request scheduled: the invoice, reminder and renewal events of a subscription carry the id of the request that created it (or of the payment that started its current period). Log it next to the event to tie the webhook back to the call that caused it, or paste it into the Workbench to see the request and everything that followed. Events Access starts on its own, with no request behind them, have no header. ## Managing Endpoints [#managing-endpoints] | Action | Method | Endpoint | |--------|--------|----------| | Create endpoint | POST | `/api/v1/webhooks/endpoints` | | List endpoints | GET | `/api/v1/webhooks/endpoints` | | Get endpoint | GET | `/api/v1/webhooks/endpoints/:id` | | Update endpoint | PATCH | `/api/v1/webhooks/endpoints/:id` | | Delete endpoint | DELETE | `/api/v1/webhooks/endpoints/:id` | | Roll secret | POST | `/api/v1/webhooks/endpoints/:id/roll-secret` | ### Update an Endpoint [#update-an-endpoint] ```bash title="Disable an endpoint" curl -X PATCH https://api.tryaccess.xyz/api/v1/webhooks/endpoints/we_01HXYZ... \ -H "Content-Type: application/json" \ -H "x-api-key: sk_..." \ -d '{ "status": "disabled" }' ``` You can update `url`, `enabled_events`, and `status` (`active` or `disabled`). ### Roll Secret [#roll-secret] Generate a new signing secret. The old secret is immediately invalidated: ```bash title="Roll webhook secret" curl -X POST https://api.tryaccess.xyz/api/v1/webhooks/endpoints/we_01HXYZ.../roll-secret \ -H "x-api-key: sk_..." ``` ## Webhook Events [#webhook-events] ### List Events [#list-events] ```bash title="List events" curl "https://api.tryaccess.xyz/api/v1/webhooks/events?type=checkout.completed&limit=20" \ -H "x-api-key: sk_..." ``` | Parameter | Description | |-----------|-------------| | `cursor` | Pagination cursor | | `limit` | Results per page (1–100, default 20) | | `type` | Filter by event type | | `endpoint_id` | Filter by endpoint | ### Get Event Details [#get-event-details] Returns the event with its delivery attempts: ```bash curl https://api.tryaccess.xyz/api/v1/webhooks/events/evt_01HXYZ... \ -H "x-api-key: sk_..." ``` The response includes the full payload and an array of `deliveries` with status, response code, and timestamps for each attempt. ### Redeliver an Event [#redeliver-an-event] Queue a failed event for redelivery: ```bash title="Redeliver event" curl -X POST https://api.tryaccess.xyz/api/v1/webhooks/events/evt_01HXYZ.../redeliver \ -H "x-api-key: sk_..." ``` Cannot redeliver to a disabled endpoint. ## Retry Policy [#retry-policy] Failed deliveries are retried with exponential backoff: | Attempt | Delay | |---------|-------| | 1st retry | 1 minute | | 2nd retry | 5 minutes | | 3rd retry | 30 minutes | | 4th retry | 2 hours | | 5th retry | 24 hours | After 5 failed attempts, the endpoint is marked as failing. No further retries are attempted until manually re-enabled or the event is redelivered. If your endpoint answers `429 Too Many Requests`, `502 Bad Gateway` or `504 Gateway Timeout`, Access slows down: it holds **all** deliveries to that endpoint for 30 seconds, doubling with each such answer in a row up to 15 minutes, or for as long as your `Retry-After` asks. Held deliveries don't use up any of their 10 attempts; they go out when the hold ends. The first successful delivery lifts it. ## Best Practices [#best-practices] 1. **Return 2xx quickly** - Process webhooks asynchronously. Return a 200 status immediately and handle the event in a background job. 2. **Verify signatures** - Always verify the `x-access-signature` header before processing. 3. **Handle duplicates** - Use the event `id` to deduplicate. The same event may be delivered more than once. 4. **Monitor failures** - Check the webhook events list for failed deliveries and redeliver as needed. # already_paid URL: /docs/errors/already_paid The invoice is already marked as paid. **Type:** `invalid_request_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] A payment or mark-as-paid action was attempted on an invoice that already has a `paid` status. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "already_paid", "message": "Invoice is already paid.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/already_paid" } } ``` ## Resolution [#resolution] Fetch the invoice to confirm its current status before attempting payment. No further action is needed if the invoice is already settled. # already_voided URL: /docs/errors/already_voided The invoice has already been voided. **Type:** `invalid_request_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] A void or update action was attempted on an invoice that already has a `void` status. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "already_voided", "message": "Invoice has been voided.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/already_voided" } } ``` ## Resolution [#resolution] A voided invoice cannot be modified or paid. Create a new invoice if needed. # bank_fetch_failed URL: /docs/errors/bank_fetch_failed Failed to fetch transaction data from the bank or PSP. **Type:** `upstream_error` **HTTP status:** `502 Bad Gateway` ## Cause [#cause] The Access API successfully contacted the PSP but received an error response, or the PSP's API is temporarily unavailable. This is an upstream failure outside of your control. ## Response [#response] ```json { "error": { "type": "upstream_error", "code": "bank_fetch_failed", "message": "Failed to fetch transaction from CBE.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/bank_fetch_failed" } } ``` ## Resolution [#resolution] - Retry the request after a short delay using exponential backoff. - Check the [status page](https://status.tryaccess.xyz) for any known PSP outages. - If the error persists for more than a few minutes, contact support. # bank_url_build_failed URL: /docs/errors/bank_url_build_failed The server could not construct the request URL for the PSP. **Type:** `upstream_error` **HTTP status:** `500 Internal Server Error` ## Cause [#cause] An internal error occurred while building the URL used to contact the PSP. This is typically caused by a misconfiguration or an unsupported combination of PSP and request parameters. ## Response [#response] ```json { "error": { "type": "upstream_error", "code": "bank_url_build_failed", "message": "Could not construct the PSP request URL.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/bank_url_build_failed" } } ``` ## Resolution [#resolution] - Verify the `psp` value is correct and supported. - Retry the request. If the error persists, contact support with the request details. # crypto_currency_unavailable URL: /docs/errors/crypto_currency_unavailable The requested crypto currency is not available. **Type:** `upstream_error` **HTTP status:** `502 Bad Gateway` ## Cause [#cause] The currency list could not be retrieved, or the requested currency is not currently available on your account. ## Response [#response] ```json { "error": { "type": "upstream_error", "code": "crypto_currency_unavailable", "message": "Unable to retrieve supported currencies. Please try again.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/crypto_currency_unavailable" } } ``` ## Resolution [#resolution] - Retry the request after a short delay. - Confirm the currency code is correct using `GET /api/v1/crypto_payments/currencies`. - Check the [Access status page](https://status.tryaccess.xyz) for any known outages. - If the error persists, contact support. # crypto_estimate_failed URL: /docs/errors/crypto_estimate_failed The conversion estimate could not be calculated. **Type:** `upstream_error` **HTTP status:** `502 Bad Gateway` ## Cause [#cause] The conversion estimate service is temporarily unavailable or the requested currency pair is not supported. ## Response [#response] ```json { "error": { "type": "upstream_error", "code": "crypto_estimate_failed", "message": "Unable to estimate conversion. Please try again.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/crypto_estimate_failed" } } ``` ## Resolution [#resolution] - Retry the request after a short delay. - Verify `currency_from` and `currency_to` are valid using `GET /api/v1/crypto_payments/currencies`. - Check the [Access status page](https://status.tryaccess.xyz) for any known outages. - If the error persists, contact support. # crypto_ipn_invalid URL: /docs/errors/crypto_ipn_invalid The crypto payment webhook signature is invalid. **Type:** `upstream_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The signature on an incoming crypto payment webhook could not be verified. This typically means the payload was tampered with or the wrong secret is configured. ## Response [#response] ```json { "error": { "type": "upstream_error", "code": "crypto_ipn_invalid", "message": "Webhook signature verification failed.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/crypto_ipn_invalid" } } ``` ## Resolution [#resolution] - This error is returned to the webhook sender, not to your API callers. - Ensure your webhook endpoint secret is correctly configured. - Do not modify the raw request body before verifying the signature. - If the error persists, contact support. # crypto_not_available URL: /docs/errors/crypto_not_available Crypto payments aren't open for public use yet. **Type:** `invalid_request_error` **HTTP status:** `403 Forbidden` ## Cause [#cause] The crypto payment and payout endpoints aren't available to API keys yet. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "crypto_not_available", "message": "Crypto payments aren't available for public use yet.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/crypto_not_available" } } ``` ## Resolution [#resolution] - Request crypto payouts from the dashboard under **Payouts**. - Watch the changelog for when crypto opens through the API. # crypto_payment_failed URL: /docs/errors/crypto_payment_failed A crypto payment operation could not be completed. **Type:** `upstream_error` **HTTP status:** `502 Bad Gateway` ## Cause [#cause] The crypto payment rail returned an error or is temporarily unavailable. This is an upstream failure outside of your control. ## Response [#response] ```json { "error": { "type": "upstream_error", "code": "crypto_payment_failed", "message": "Unable to create crypto payment. Please try again.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/crypto_payment_failed" } } ``` ## Resolution [#resolution] - Retry the request after a short delay using exponential backoff. - Verify the `pay_currency` value is valid using `GET /api/v1/crypto_payments/currencies`. - Check the [Access status page](https://status.tryaccess.xyz) for any known outages. - If the error persists, contact support. # crypto_payout_failed URL: /docs/errors/crypto_payout_failed A crypto payout could not be processed. **Type:** `upstream_error` **HTTP status:** `502 Bad Gateway` ## Cause [#cause] The crypto payout rail returned an error or is temporarily unavailable. This is an upstream failure outside of your control. ## Response [#response] ```json { "error": { "type": "upstream_error", "code": "crypto_payout_failed", "message": "Unable to process crypto payout. Please try again.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/crypto_payout_failed" } } ``` ## Resolution [#resolution] - Retry the request after a short delay using exponential backoff. - Verify each withdrawal `address` and `currency` are valid. - Check the [Access status page](https://status.tryaccess.xyz) for any known outages. - If the error persists, contact support. # date_parse_failed URL: /docs/errors/date_parse_failed The date could not be parsed from the receipt. **Type:** `verification_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The verification pipeline extracted text from the receipt but could not interpret the date field into a valid date. This can happen when the date is obscured, in an unexpected format, or missing from the receipt. ## Response [#response] ```json { "error": { "type": "verification_error", "code": "date_parse_failed", "message": "Could not parse the date from the receipt.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/date_parse_failed" } } ``` ## Resolution [#resolution] - Ensure the receipt image clearly shows the transaction date. - Use the original receipt rather than a cropped or edited version. - If the date is partially visible, provide a clearer image. # db_error URL: /docs/errors/db_error A database operation failed. **Type:** `api_error` **HTTP status:** `500 Internal Server Error` ## Cause [#cause] An internal database read or write operation failed. This is not caused by the request itself and indicates a server-side problem. ## Response [#response] ```json { "error": { "type": "api_error", "code": "db_error", "message": "A database error occurred. Please try again.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/db_error" } } ``` ## Resolution [#resolution] Retry the request after a short delay. If the error persists, contact support with the request ID and timestamp. # duplicate URL: /docs/errors/duplicate A resource with the same identifier already exists. **Type:** `invalid_request_error` **HTTP status:** `409 Conflict` ## Cause [#cause] The request would create a resource that conflicts with an existing one for example, a customer with an email address already in use. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "duplicate", "message": "A customer with this email already exists.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/duplicate" } } ``` ## Resolution [#resolution] Retrieve the existing resource instead of creating a new one, or use a different unique identifier. # empty_input URL: /docs/errors/empty_input No input was provided for verification. **Type:** `verification_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The verification request was submitted without any usable input for example, an empty receipt image URL or a missing transaction reference. ## Response [#response] ```json { "error": { "type": "verification_error", "code": "empty_input", "message": "No input provided for verification.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/empty_input" } } ``` ## Resolution [#resolution] Ensure the request includes all required fields. See the [quickstart guide](/docs/quickstart) for the minimum required fields for a verification request. # extraction_failed URL: /docs/errors/extraction_failed Data extraction from the receipt failed. **Type:** `verification_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The extraction step ran but could not produce a usable result from the receipt content. This differs from [`image_extraction_failed`](/docs/errors/image_extraction_failed) in that the failure occurred during structured data parsing rather than raw image processing. ## Response [#response] ```json { "error": { "type": "verification_error", "code": "extraction_failed", "message": "Failed to extract data from the receipt.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/extraction_failed" } } ``` ## Resolution [#resolution] - Confirm the receipt is from a supported PSP. - Ensure the receipt is complete and not partially cropped. - Retry with a higher-quality image if available. # forbidden URL: /docs/errors/forbidden The API key does not have permission to perform this action. **Type:** `authentication_error` **HTTP status:** `403 Forbidden` ## Cause [#cause] The API key is valid but isn't allowed to do this: - It tried to create or roll a key with permissions it doesn't hold itself (the message lists them). - It lacks the permission the operation needs. - The key has been disabled. ## Response [#response] ```json { "error": { "type": "authentication_error", "code": "forbidden", "message": "Your API key does not have permission to perform this request.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/forbidden" } } ``` ## Resolution [#resolution] - Check the key's permissions in your dashboard under **API Keys**. - Permissions can't be changed after a key is made: create a new key with the permissions you need. - Sensitive permissions (refunds, payouts, API keys, owner account) are never granted by wildcards; name them explicitly. - If the key is disabled, re-enable it or create a replacement. See [API key permissions](/docs/api-keys#permissions) for details. # image_extraction_failed URL: /docs/errors/image_extraction_failed Data could not be extracted from the receipt image. **Type:** `verification_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The receipt image was fetched successfully but the extraction pipeline could not parse meaningful data from it. Common causes include a blurry or low-resolution image, a screenshot of a screenshot, or an image that is not a payment receipt. ## Response [#response] ```json { "error": { "type": "verification_error", "code": "image_extraction_failed", "message": "Could not extract data from the receipt image.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/image_extraction_failed" } } ``` ## Resolution [#resolution] - Use the original receipt image, not a re-screenshot or heavily compressed version. - Ensure the image is well-lit and all text is legible. - Crop the image to show only the receipt, removing unrelated content. # image_fetch_failed URL: /docs/errors/image_fetch_failed The receipt image could not be retrieved. **Type:** `verification_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The server attempted to download the receipt image from the provided URL but the request failed the URL may be unreachable, expired, or returning a non-image response. ## Response [#response] ```json { "error": { "type": "verification_error", "code": "image_fetch_failed", "message": "Could not fetch the receipt image.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/image_fetch_failed" } } ``` ## Resolution [#resolution] - Ensure the image URL is publicly accessible and not behind authentication. - Check that the URL has not expired (e.g. pre-signed S3 URLs have a TTL). - Verify the URL points directly to an image file (JPEG, PNG, or PDF). # Error Codes URL: /docs/errors/index All machine readable error codes returned by the Access API, grouped by category. Every API error response includes a `code` field that identifies the specific failure. Use it to handle errors programmatically without parsing the `message` string. ```json title="Error response shape" { "error": { "type": "invalid_request_error", "code": "not_found", "message": "Customer not found.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/not_found" } } ``` The `doc_url` in every error response links directly to the page for that code. ## Input / Validation [#input--validation] Errors caused by malformed or missing request fields. | Code | HTTP | Description | | ----------------------------------------------------- | :--: | ----------------------------------- | | [`parameter_missing`](/docs/errors/parameter_missing) | 400 | A required field was not provided | | [`parameter_invalid`](/docs/errors/parameter_invalid) | 400 | A field value failed validation | | [`parameter_unknown`](/docs/errors/parameter_unknown) | 400 | An unrecognised field was sent | | [`invalid_psp`](/docs/errors/invalid_psp) | 400 | The specified PSP is not recognised | ## Resource State [#resource-state] Errors caused by the current state of a resource. | Code | HTTP | Description | | ----------------------------------------------- | :--: | ------------------------------------------------------- | | [`not_found`](/docs/errors/not_found) | 404 | The requested resource does not exist | | [`duplicate`](/docs/errors/duplicate) | 409 | A resource with the same identifier already exists | | [`invalid_state`](/docs/errors/invalid_state) | 400 | The action is not allowed in the current resource state | | [`already_paid`](/docs/errors/already_paid) | 400 | The invoice is already marked as paid | | [`already_voided`](/docs/errors/already_voided) | 400 | The invoice has already been voided | | [`subscription_already_canceled`](/docs/errors/subscription_already_canceled) | 400 | The subscription is already canceled or scheduled to cancel | ## Auth [#auth] Errors related to API key authentication and permissions. | Code | HTTP | Description | | ------------------------------------------------------------- | :--: | ------------------------------------------------ | | [`unauthorized`](/docs/errors/unauthorized) | 401 | API key is missing or invalid | | [`forbidden`](/docs/errors/forbidden) | 403 | API key does not have permission for this action | | [`key_generation_failed`](/docs/errors/key_generation_failed) | 500 | Failed to generate an API key | ## Verification Pipeline [#verification-pipeline] Errors from the payment receipt verification pipeline. | Code | HTTP | Description | | ----------------------------------------------------------------- | :--: | --------------------------------------------- | | [`verification_failed`](/docs/errors/verification_failed) | 400 | Payment could not be verified | | [`tx_ref_not_found`](/docs/errors/tx_ref_not_found) | 404 | Transaction reference not found at the PSP | | [`image_fetch_failed`](/docs/errors/image_fetch_failed) | 400 | Could not retrieve the receipt image | | [`image_extraction_failed`](/docs/errors/image_extraction_failed) | 400 | Could not extract data from the receipt image | | [`extraction_failed`](/docs/errors/extraction_failed) | 400 | Data extraction from the receipt failed | | [`date_parse_failed`](/docs/errors/date_parse_failed) | 400 | Could not parse the date from the receipt | | [`empty_input`](/docs/errors/empty_input) | 400 | No input was provided for verification | ## Upstream / PSP [#upstream--psp] Errors from bank or PSP integrations. | Code | HTTP | Description | | ------------------------------------------------------------- | :--: | ----------------------------------------------------- | | [`bank_fetch_failed`](/docs/errors/bank_fetch_failed) | 502 | Failed to fetch transaction data from the bank or PSP | | [`bank_url_build_failed`](/docs/errors/bank_url_build_failed) | 500 | Could not construct the request URL for the PSP | | [`unsupported_psp`](/docs/errors/unsupported_psp) | 400 | The specified PSP is not supported | ## Upstream / Crypto [#upstream--crypto] Errors from crypto payment and payout operations. | Code | HTTP | Description | | ----------------------------------------------------------------------------- | :--: | -------------------------------------------------- | | [`crypto_payment_failed`](/docs/errors/crypto_payment_failed) | 502 | A crypto payment operation could not be completed | | [`crypto_payout_failed`](/docs/errors/crypto_payout_failed) | 502 | A crypto payout could not be processed | | [`crypto_currency_unavailable`](/docs/errors/crypto_currency_unavailable) | 502 | The requested crypto currency is not available | | [`crypto_estimate_failed`](/docs/errors/crypto_estimate_failed) | 502 | The conversion estimate could not be calculated | | [`crypto_ipn_invalid`](/docs/errors/crypto_ipn_invalid) | 400 | The crypto payment webhook signature is invalid | ## Database [#database] | Code | HTTP | Description | | ----------------------------------- | :--: | --------------------------- | | [`db_error`](/docs/errors/db_error) | 500 | A database operation failed | ## Fallback [#fallback] | Code | HTTP | Description | | ----------------------------------------------- | :--: | ------------------------------------- | | [`internal_error`](/docs/errors/internal_error) | 500 | An unexpected internal error occurred | # internal_error URL: /docs/errors/internal_error An unexpected internal error occurred. **Type:** `api_error` **HTTP status:** `500 Internal Server Error` ## Cause [#cause] An unhandled error occurred on the server. This is a catch-all for failures that do not map to a more specific error code. ## Response [#response] ```json { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred. Please try again.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/internal_error" } } ``` ## Resolution [#resolution] - Retry the request with exponential backoff. - If the error is consistent across retries, contact support with the full request details and timestamp. # invalid_psp URL: /docs/errors/invalid_psp The specified payment service provider is not recognised. **Type:** `invalid_request_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The `psp` field contains a value that does not match any known payment service provider identifier. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "invalid_psp", "message": "Unknown PSP: UNKNOWN_BANK.", "param": "psp", "doc_url": "https://docs.tryaccess.xyz/docs/errors/invalid_psp" } } ``` ## Supported PSPs [#supported-psps] Refer to the [quickstart guide](/docs/quickstart) for the list of supported PSP identifiers (e.g. `CBE`, `AWASH`, `TELEBIRR`). ## Resolution [#resolution] Use one of the supported PSP identifiers. PSP values are case-sensitive. # invalid_state URL: /docs/errors/invalid_state The action is not allowed in the current resource state. **Type:** `invalid_request_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The resource exists but its current state does not permit the requested operation. For example, attempting to finalize an invoice that is already void. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "invalid_state", "message": "Invoice cannot be finalized because it is already void.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/invalid_state" } } ``` ## Resolution [#resolution] Check the current state of the resource before performing the operation. The `message` field describes which transition is not allowed. # key_generation_failed URL: /docs/errors/key_generation_failed The server failed to generate an API key. **Type:** `api_error` **HTTP status:** `500 Internal Server Error` ## Cause [#cause] An internal error occurred while generating a new API key token. This is not caused by the request itself. ## Response [#response] ```json { "error": { "type": "api_error", "code": "key_generation_failed", "message": "Failed to generate API key.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/key_generation_failed" } } ``` ## Resolution [#resolution] Retry the request. If the error persists, contact support. # not_found URL: /docs/errors/not_found The requested resource does not exist. **Type:** `invalid_request_error` **HTTP status:** `404 Not Found` ## Cause [#cause] The resource ID in the request path or body does not match any existing record. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "not_found", "message": "Customer not found.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/not_found" } } ``` ## Resolution [#resolution] Verify the resource ID is correct. IDs are case-sensitive and must belong to your merchant account. If you recently created the resource, confirm the creation request returned a `201` status. # parameter_invalid URL: /docs/errors/parameter_invalid A request field failed validation. **Type:** `invalid_request_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] A field was provided but its value did not pass validation wrong type, out of range, or an unsupported value. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "parameter_invalid", "message": "amount must be a positive number.", "param": "amount", "doc_url": "https://docs.tryaccess.xyz/docs/errors/parameter_invalid" } } ``` The `param` field identifies which field failed validation. ## Resolution [#resolution] Check the `param` and `message` fields. Correct the field value and resubmit the request. # parameter_missing URL: /docs/errors/parameter_missing A required request field was not provided. **Type:** `invalid_request_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The request body or query string is missing a field that the endpoint requires. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "parameter_missing", "message": "amount is required.", "param": "amount", "doc_url": "https://docs.tryaccess.xyz/docs/errors/parameter_missing" } } ``` The `param` field identifies which field is missing. ## Resolution [#resolution] Check the `param` field in the error response and include the missing field in your request. Refer to the endpoint's API reference for all required fields. # parameter_unknown URL: /docs/errors/parameter_unknown An unrecognised field was included in the request. **Type:** `invalid_request_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The request body contains a field that the endpoint does not accept. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "parameter_unknown", "message": "Unknown parameter: extra_field.", "param": "extra_field", "doc_url": "https://docs.tryaccess.xyz/docs/errors/parameter_unknown" } } ``` ## Resolution [#resolution] Remove the field identified in `param` from your request body. Check the API reference for the list of accepted fields for this endpoint. # rate_limited URL: /docs/errors/rate_limited Too many requests in a short time. **Type:** `invalid_request_error` **HTTP status:** `429 Too Many Requests` ## Cause [#cause] The API counts requests per API key, per minute: | Requests | Limit per minute | | -------- | :--------------: | | Reads (`GET`) | 600 | | Writes (`POST`, `PATCH`, `DELETE`) | 120 | Reads and writes are counted separately. A key can also have its own limit, which replaces both. Separately, after 10 refused API keys from one IP address in a minute, every request from that address gets `429` until the minute is up, even with a valid key. This stops anyone guessing keys. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "rate_limited", "message": "Too many requests. Retry in 23 seconds.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/rate_limited", "request_id": "req_01JB2X7Q9R8S6T5U4V3W2X1Y0Z" } } ``` Every response carries the current limit in standard headers: ```http RateLimit-Policy: 600;w=60 RateLimit: limit=600, remaining=598, reset=42 ``` A `429` also has `Retry-After`, the seconds until the window resets. ## Resolution [#resolution] Wait for the number of seconds in `Retry-After`, then retry. To stay under the limit, watch `remaining` in the `RateLimit` header, spread requests out, and back off when you get a `429` instead of retrying right away. If you're refused for bad keys, check the key you send in `x-api-key`. # resource_not_found URL: /docs/errors/resource_not_found An ID in the request body doesn't match any of your records. **Type:** `invalid_request_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] A field in the request body names a record that doesn't exist, or that belongs to another merchant. The error's `param` names the field. For example, `customer` when [creating a portal session](/docs/portal#create-a-session) for an unknown customer. Unlike [`not_found`](/docs/errors/not_found), which is a `404` for the resource in the URL, this is a `400` because the request itself is wrong. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "resource_not_found", "message": "No such customer.", "param": "customer", "doc_url": "https://docs.tryaccess.xyz/docs/errors/resource_not_found" } } ``` ## Resolution [#resolution] Check the ID in `param`. IDs are case-sensitive and must belong to the merchant whose API key you're using. Live and test records don't mix. # subscription_already_canceled URL: /docs/errors/subscription_already_canceled The subscription is already canceled or scheduled to cancel. **Type:** `invalid_request_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] A cancel was requested for a subscription that is already `canceled`, or that already has `cancel_at_period_end: true` and will end at its `current_period_end`. ## Response [#response] ```json { "error": { "type": "invalid_request_error", "code": "subscription_already_canceled", "message": "Subscription is already canceled or scheduled to cancel.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/subscription_already_canceled" } } ``` ## Resolution [#resolution] Fetch the subscription to check `status` and `cancel_at_period_end`. No further action is needed: a scheduled cancel ends the subscription automatically at `current_period_end`. # tx_ref_not_found URL: /docs/errors/tx_ref_not_found The transaction reference was not found at the PSP. **Type:** `verification_error` **HTTP status:** `404 Not Found` ## Cause [#cause] The PSP's API returned no record for the provided transaction reference. The transaction may not exist, may belong to a different PSP, or may not yet be settled. ## Response [#response] ```json { "error": { "type": "verification_error", "code": "tx_ref_not_found", "message": "Transaction reference not found.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/tx_ref_not_found" } } ``` ## Resolution [#resolution] - Double-check the `tx_ref` value it must match exactly as shown on the bank statement or receipt. - Confirm the `psp` field matches the bank or provider that processed the transaction. - If the transaction was very recent, wait a few minutes for it to settle and retry. # unauthorized URL: /docs/errors/unauthorized The API key is missing or invalid. **Type:** `authentication_error` **HTTP status:** `401 Unauthorized` ## Cause [#cause] The request did not include an `x-api-key` header, or the provided key does not exist, has been revoked, or has expired. ## Response [#response] ```json { "error": { "type": "authentication_error", "code": "unauthorized", "message": "Authentication required. Provide a valid API key.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/unauthorized" } } ``` ## Resolution [#resolution] - Ensure the `x-api-key` header is present on every request. - Verify the key is active in your dashboard under **Settings → API Keys**. - If the key has expired, create a new one. See [Authentication](/docs/authentication) for details. # unsupported_psp URL: /docs/errors/unsupported_psp The specified PSP is not supported. **Type:** `upstream_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The `psp` value is a valid identifier but the PSP is not currently supported for the requested operation (e.g. a PSP that supports verification but not payouts). ## Response [#response] ```json { "error": { "type": "upstream_error", "code": "unsupported_psp", "message": "PSP is not supported for this operation.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/unsupported_psp" } } ``` ## Resolution [#resolution] Check the [supported providers table](/docs#supported-providers) to confirm which PSPs are available for the operation you are attempting. # verification_failed URL: /docs/errors/verification_failed The payment could not be verified. **Type:** `verification_error` **HTTP status:** `400 Bad Request` ## Cause [#cause] The verification pipeline completed but could not confirm the payment. This can happen when: - The transaction reference does not match a real transaction at the PSP. - The receipt image data does not match the claimed transaction details. - The extracted amount, date, or reference does not meet the expected values. ## Response [#response] ```json { "error": { "type": "verification_error", "code": "verification_failed", "message": "Payment could not be verified.", "doc_url": "https://docs.tryaccess.xyz/docs/errors/verification_failed" } } ``` ## Resolution [#resolution] - Confirm the `tx_ref` matches the transaction reference shown in the bank receipt. - Ensure the receipt image is clear and unmodified. - Check that the `psp` value matches the bank or provider that issued the receipt. # Revoke API key URL: /docs/openapi/apikeys/deleteApiV1Api-keysById ## `DELETE /api/v1/api-keys/{id}` Permanently delete an API key. This action cannot be undone. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List API keys URL: /docs/openapi/apikeys/getApiV1Api-keys ## `GET /api/v1/api-keys/` List all API keys for the authenticated business. Full keys are never returned. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `limit` | query | number | no | | | `cursor` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get API key URL: /docs/openapi/apikeys/getApiV1Api-keysById ## `GET /api/v1/api-keys/{id}` Retrieve API key details by ID. The full key is never returned. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List API key permissions URL: /docs/openapi/apikeys/getApiV1Api-keysCatalog ## `GET /api/v1/api-keys/catalog` The permissions (grouped by resource, with sensitive ones marked) and presets a key can be created with. Use it to build a permission picker. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Update API key URL: /docs/openapi/apikeys/patchApiV1Api-keysById ## `PATCH /api/v1/api-keys/{id}` Update API key settings. Use enabled=false to disable a key without deleting it. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | no | Updated human-readable label for this API key | | `status` | `active` \| `revoked` | no | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Create API key URL: /docs/openapi/apikeys/postApiV1Api-keys ## `POST /api/v1/api-keys/` Generate a new API key. The full key is returned only once — store it securely. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | yes | Human-readable label for this API key | | `expires_in` | number | no | Key expiry duration in seconds from now. Minimum 3600 (1 hour). Omit for no expiry. | | `preset` | string | no | A named bundle of permissions, such as read_only or developer. Provide this or permissions. | | `permissions` | string[] | no | Permissions granted to this key: resource:action, or wildcards (*, payments:*, *:read) that never match sensitive permissions. Provide this or preset. The new key can't hold permissions the calling key doesn't. | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `422`: Response for status 422 - `429`: Response for status 429 - `500`: Response for status 500 # Roll API key URL: /docs/openapi/apikeys/postApiV1Api-keysByIdRoll ## `POST /api/v1/api-keys/{id}/roll` Regenerate an API key's secret. The old key is immediately invalidated. The new key is returned only once. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `409`: Response for status 409 - `422`: Response for status 422 - `429`: Response for status 429 - `500`: Response for status 500 # List checkout sessions URL: /docs/openapi/checkout/getApiV1CheckoutSessions ## `GET /api/v1/checkout/sessions/` List checkout sessions with optional filters. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `cursor` | query | string | no | | | `limit` | query | number | no | | | `status` | query | string | no | | | `customer_id` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get checkout session URL: /docs/openapi/checkout/getApiV1CheckoutSessionsById ## `GET /api/v1/checkout/sessions/{id}` Retrieve a checkout session by ID. Use to check payment status after redirect. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Create checkout session URL: /docs/openapi/checkout/postApiV1CheckoutSessions ## `POST /api/v1/checkout/sessions/` Create a hosted checkout session. Redirect your customer to the returned URL to collect payment. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `mode` | `payment` \| `subscription` | yes | | | `line_items` | object[] | yes | List of items the customer is purchasing (1–20 items) | | `currency` | string | no | ISO 4217 currency code | | `success_url` | string | yes | URL to redirect the customer to after a successful payment. May include {CHECKOUT_SESSION_ID}, which is replaced with the session id. | | `cancel_url` | string | yes | URL to redirect the customer to if they cancel the checkout. May include {CHECKOUT_SESSION_ID}, which is replaced with the session id. | | `metadata` | object | no | Arbitrary key-value metadata to attach to the session | | `customer` | string | yes | ID of an existing customer to associate with this session | | `expires_at` | number | no | Session expiry duration in seconds. Min 300 (5 min), max 86400 (24 h). Defaults to 1800 (30 min) | | `subscription_data` | object | no | | ### Responses - `201`: Response for status 201 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Expire checkout session URL: /docs/openapi/checkout/postApiV1CheckoutSessionsByIdExpire ## `POST /api/v1/checkout/sessions/{id}/expire` Manually expire a pending checkout session. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List crypto payments URL: /docs/openapi/crypto-payments/getApiV1Crypto_payments ## `GET /api/v1/crypto_payments/` Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `limit` | query | number | no | | | `status` | query | string | no | | | `customer` | query | string | no | | | `cursor` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Retrieve the crypto balance URL: /docs/openapi/crypto-payments/getApiV1Crypto_paymentsBalance ## `GET /api/v1/crypto_payments/balance` What can be paid out, per coin. Refreshed every minute. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `409`: Response for status 409 - `429`: Response for status 429 - `500`: Response for status 500 - `503`: Response for status 503 # Retrieve a crypto payment URL: /docs/openapi/crypto-payments/getApiV1Crypto_paymentsById ## `GET /api/v1/crypto_payments/{id}` Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List coins URL: /docs/openapi/crypto-payments/getApiV1Crypto_paymentsCoins ## `GET /api/v1/crypto_payments/coins` The coins and networks a customer can pay with. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Create a crypto payment URL: /docs/openapi/crypto-payments/postApiV1Crypto_payments ## `POST /api/v1/crypto_payments/` Price an amount in ETB or USD and get the deposit address and exact coin amount the customer must send. Status updates arrive as crypto_payment.* webhook events. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `amount` | | yes | Price in the smallest unit of currency (e.g. cents in ETB or USD) | | `currency` | `ETB` \| `USD` | yes | | | `pay_with` | string | yes | The coin and network the customer pays with: usdc_bsc, usdt_bsc, usdt_ton, usdc_base, usdt_tron, usdt_solana, usdc_solana, usdt_polygon, usdt_ethereum, usdc_ethereum | | `customer` | string | yes | The customer's id | | `description` | string | no | An arbitrary string attached to the object (max 500 characters) | | `metadata` | object | no | Key-value pairs for storing arbitrary custom metadata | ### Responses - `201`: Response for status 201 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `409`: Response for status 409 - `429`: Response for status 429 - `500`: Response for status 500 - `503`: Response for status 503 # Refund an underpaid crypto payment URL: /docs/openapi/crypto-payments/postApiV1Crypto_paymentsByIdRefund ## `POST /api/v1/crypto_payments/{id}/refund` Send what the customer paid back to their wallet. The refund is reviewed before it's sent; the network fee comes out of it. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `address` | string | yes | The customer's wallet address | | `memo` | string | no | Memo or tag, for coins that need one | ### Responses - `201`: Response for status 201 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `409`: Response for status 409 - `429`: Response for status 429 - `500`: Response for status 500 - `503`: Response for status 503 # List crypto payouts URL: /docs/openapi/crypto-payouts/getApiV1Crypto_payouts ## `GET /api/v1/crypto_payouts/` Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `limit` | query | number | no | | | `status` | query | string | no | | | `cursor` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Retrieve the crypto balance URL: /docs/openapi/crypto-payouts/getApiV1Crypto_payoutsBalance ## `GET /api/v1/crypto_payouts/balance` What can be paid out, per coin. Refreshed every minute. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `409`: Response for status 409 - `429`: Response for status 429 - `500`: Response for status 500 - `503`: Response for status 503 # Retrieve a crypto payout URL: /docs/openapi/crypto-payouts/getApiV1Crypto_payoutsById ## `GET /api/v1/crypto_payouts/{id}` Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Request a crypto payout URL: /docs/openapi/crypto-payouts/postApiV1Crypto_payouts ## `POST /api/v1/crypto_payouts/` Withdraw crypto to your wallet. The amount is held right away and sent once the payout is approved; Access's fee and the network fee come out of it. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `coin` | string | yes | One of: usdc_bsc, usdt_bsc, usdt_ton, usdc_base, usdt_tron, usdt_solana, usdc_solana, usdt_polygon, usdt_ethereum, usdc_ethereum | | `amount` | string | yes | How much to take from the balance, as a decimal string | | `address` | string | yes | Your wallet address | | `memo` | string | no | Memo or tag, for coins that need one | | `description` | string | no | | ### Responses - `201`: Response for status 201 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `409`: Response for status 409 - `429`: Response for status 429 - `500`: Response for status 500 - `503`: Response for status 503 # Retrieve the portal configuration URL: /docs/openapi/customer-portal/getApiV1Billing_portalConfiguration ## `GET /api/v1/billing_portal/configuration` What customers can do in the portal. A merchant who has never changed it gets Access's recommended settings, with `created` null. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 - `500`: Response for status 500 # Update the portal configuration URL: /docs/openapi/customer-portal/postApiV1Billing_portalConfiguration ## `POST /api/v1/billing_portal/configuration` Changes only the fields you send. A metadata value of "" removes that key. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `business_profile` | object | no | | | `default_return_url` | string \| null (uri) | no | | | `features` | object | no | | | `metadata` | object | no | | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 - `500`: Response for status 500 # Create a portal session URL: /docs/openapi/customer-portal/postApiV1Billing_portalSessions ## `POST /api/v1/billing_portal/sessions` Creates a short-lived link to a customer's portal, where they can see and pay their invoices, update their billing information, and cancel subscriptions, as the configuration allows. Use `flow_data` to send them straight to one task. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `customer` | string | yes | The ID of an existing customer. | | `return_url` | string (uri) | no | Where the portal's “Return to …” link goes. Defaults to the configuration's `default_return_url`. | | `flow_data` | object | no | | | `locale` | string | no | | | `expires_in` | number | no | Seconds until the URL stops working. 300 to 86400. | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 - `500`: Response for status 500 # Delete customer URL: /docs/openapi/customers/deleteApiV1CustomersById ## `DELETE /api/v1/customers/{id}` Delete a customer. This cascades to their checkout sessions. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List customers URL: /docs/openapi/customers/getApiV1Customers ## `GET /api/v1/customers/` List all customers for the authenticated business. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `limit` | query | number | no | | | `email` | query | string | no | | | `cursor` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get customer URL: /docs/openapi/customers/getApiV1CustomersById ## `GET /api/v1/customers/{id}` Retrieve a customer by ID. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Update customer URL: /docs/openapi/customers/patchApiV1CustomersById ## `PATCH /api/v1/customers/{id}` Update a customer's details. Only provided fields are changed. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | no | Updated full name of the customer | | `email` | string (email) | no | Updated email address | | `phone_number` | string | no | Updated phone number in E.164 format | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Create customer URL: /docs/openapi/customers/postApiV1Customers ## `POST /api/v1/customers/` Create a new customer record. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | yes | Full name of the customer | | `email` | string (email) | no | Customer's email address | | `phone_number` | string | no | Customer's phone number in E.164 format | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Health check URL: /docs/openapi/health/getApiV1Health ## `GET /api/v1/health/` Returns service health status including database and Redis connectivity. ### Responses - `200`: Response for status 200 # Health check (detailed services) URL: /docs/openapi/health/getApiV1HealthServices ## `GET /api/v1/health/services` Returns detailed service health with connection info. Protected by basic auth. Authentication: basicAuth ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `authorization` | header | string | no | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 # List invoices URL: /docs/openapi/invoices/getApiV1Invoices ## `GET /api/v1/invoices/` List invoices with optional filters. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `cursor` | query | string | no | | | `limit` | query | number | no | | | `status` | query | string | no | | | `subscription_id` | query | string | no | | | `customer_id` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get invoice URL: /docs/openapi/invoices/getApiV1InvoicesById ## `GET /api/v1/invoices/{id}` Retrieve an invoice by ID. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Create invoice URL: /docs/openapi/invoices/postApiV1Invoices ## `POST /api/v1/invoices/` Create a manual invoice for a customer. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `customer_id` | string | yes | ID of the customer this invoice is billed to | | `amount` | number | yes | Total invoice amount in minor units (santim). 1 ETB = 100 santim | | `currency` | string | no | ISO 4217 currency code | | `line_items` | | yes | | | `due_date` | string | yes | Invoice due date in ISO 8601 format. Must be a future date. | | `metadata` | object \| null | yes | | | `subscription_id` | string | no | Optional subscription this invoice belongs to. Leave it out for a one-off invoice. | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 - `500`: Response for status 500 # Mark invoice as paid URL: /docs/openapi/invoices/postApiV1InvoicesByIdPaid ## `POST /api/v1/invoices/{id}/paid` Mark an invoice as paid. Optionally link a transaction ID for reconciliation. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Void invoice URL: /docs/openapi/invoices/postApiV1InvoicesByIdVoid ## `POST /api/v1/invoices/{id}/void` Void an unpaid invoice. Paid invoices cannot be voided. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List logs URL: /docs/openapi/logs/getApiV1Logs ## `GET /api/v1/logs/` Returns a paginated list of log made with this merchant's API keys. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `cursor` | query | string | no | | | `limit` | query | number | no | | | `method` | query | `GET` \| `POST` \| `PATCH` \| `DELETE` | no | | | `status_code` | query | number | no | | | `endpoint` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get log URL: /docs/openapi/logs/getApiV1LogsById ## `GET /api/v1/logs/{id}` Returns a single log entry by ID. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Delete bank account URL: /docs/openapi/payment-methods/deleteApiV1Payment_methodsById ## `DELETE /api/v1/payment_methods/{id}` Remove a bank account. The merchant can add a new one for the same PSP after deletion. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List bank accounts URL: /docs/openapi/payment-methods/getApiV1Payment_methods ## `GET /api/v1/payment_methods/` List all bank accounts configured for the authenticated merchant. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get bank account URL: /docs/openapi/payment-methods/getApiV1Payment_methodsById ## `GET /api/v1/payment_methods/{id}` Retrieve a bank account by ID. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Update bank account URL: /docs/openapi/payment-methods/patchApiV1Payment_methodsById ## `PATCH /api/v1/payment_methods/{id}` Update account_name or account_number. Normalized fields are re-derived automatically. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `account_name` | string | no | Updated account holder name | | `account_number` | string | no | Updated bank account number or wallet phone number | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Add bank account URL: /docs/openapi/payment-methods/postApiV1Payment_methods ## `POST /api/v1/payment_methods/` Add a bank account for a supported PSP. One account per PSP per merchant. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `bank_code` | `CBE` \| `Awash` \| `Mpesa` \| `Dashen` \| `CBEBirr` \| `Siinqee` \| `Telebirr` \| `Abyssinia` \| `EbirrKaafi` \| `EbirrCoopay` \| `Wegagen` \| `AmharaBank` \| `Zemen` | yes | | | `account_name` | string | yes | Account holder name as it appears on the bank account | | `account_number` | string | yes | Bank account number or wallet phone number | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get my profile URL: /docs/openapi/portal/getApiV1CustomersPortalMe ## `GET /api/v1/customers/portal/me/` Get the authenticated customer's profile. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # List my checkout sessions URL: /docs/openapi/portal/getApiV1CustomersPortalMeCheckout-sessions ## `GET /api/v1/customers/portal/me/checkout-sessions` List the customer's checkout sessions. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `cursor` | query | string | no | | | `limit` | query | number | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # List my invoices URL: /docs/openapi/portal/getApiV1CustomersPortalMeInvoices ## `GET /api/v1/customers/portal/me/invoices` List the customer's invoices. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `cursor` | query | string | no | | | `limit` | query | number | no | | | `status` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get invoice detail URL: /docs/openapi/portal/getApiV1CustomersPortalMeInvoicesById ## `GET /api/v1/customers/portal/me/invoices/{id}` Get a single invoice with full details. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Invoice with subscription info - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List my subscriptions URL: /docs/openapi/portal/getApiV1CustomersPortalMeSubscriptions ## `GET /api/v1/customers/portal/me/subscriptions` List the customer's subscriptions. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get subscription detail URL: /docs/openapi/portal/getApiV1CustomersPortalMeSubscriptionsById ## `GET /api/v1/customers/portal/me/subscriptions/{id}` Get a subscription with its recent invoices. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Subscription with recent invoices - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List my transactions URL: /docs/openapi/portal/getApiV1CustomersPortalMeTransactions ## `GET /api/v1/customers/portal/me/transactions` List the customer's transaction history. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `cursor` | query | string | no | | | `limit` | query | number | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Update my profile URL: /docs/openapi/portal/patchApiV1CustomersPortalMe ## `PATCH /api/v1/customers/portal/me/` Update the authenticated customer's name, email, or phone number. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | no | | | `email` | string (email) | no | | | `phone_number` | string (email) | no | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Toggle auto-renew URL: /docs/openapi/portal/postApiV1CustomersPortalMeSubscriptionsByIdAuto-renew ## `POST /api/v1/customers/portal/me/subscriptions/{id}/auto-renew` Enable or disable auto-renewal on a subscription. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `auto_renew` | boolean | yes | Enable or disable auto-renewal | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Cancel my subscription URL: /docs/openapi/portal/postApiV1CustomersPortalMeSubscriptionsByIdCancel ## `POST /api/v1/customers/portal/me/subscriptions/{id}/cancel` Cancel a subscription at the end of its current period. It stays active until `current_period_end` and stops renewing. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Change my billing interval URL: /docs/openapi/portal/postApiV1CustomersPortalMeSubscriptionsByIdChange-interval ## `POST /api/v1/customers/portal/me/subscriptions/{id}/change-interval` Change the billing interval on a subscription. By default takes effect at next renewal. Authentication: portalToken ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `new_interval` | `Monthly` \| `Yearly` | yes | | | `effective_now` | boolean | no | Apply immediately or at next renewal | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Create portal session URL: /docs/openapi/portal/postApiV1CustomersPortalSessions ## `POST /api/v1/customers/portal/sessions` Generate a short-lived portal token for a customer. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `customer_id` | string | yes | ID of the customer to create a portal session for | | `expires_in` | number | no | Session TTL in seconds. Min 300 (5 min), max 86400 (24 h). Defaults to 3600 (1 hour) | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # List transactions URL: /docs/openapi/transactions/getApiV1Transactions ## `GET /api/v1/transactions/` List transactions with optional filters for status, PSP, customer, and date. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `cursor` | query | string | no | | | `limit` | query | number | no | | | `status` | query | string | no | | | `payment_method` | query | string | no | | | `customer_id` | query | string | no | | | `created_after` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Get transaction URL: /docs/openapi/transactions/getApiV1TransactionsById ## `GET /api/v1/transactions/{id}` Retrieve a single transaction by ID. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Retrieve a verification URL: /docs/openapi/verifications/getApiV1VerificationsById ## `GET /api/v1/verifications/{id}` Retrieves the status and result of a payment verification using its job ID. The job ID identifies the verification process and can be used to retrieve the verification result after processing. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `422`: Response for status 422 - `429`: Response for status 429 - `500`: Response for status 500 - `502`: Response for status 502 # Verify payment URL: /docs/openapi/verifications/postApiV1Verifications ## `POST /api/v1/verifications/` Creates a payment verification. By default, verification is processed synchronously and the completed verification result is returned in the response. The mode field can be set to 'sync' or 'async'. Asynchronous verification is currently under development and is not available for public use. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `psp` | `CBE` \| `Awash` \| `Mpesa` \| `Dashen` \| `CBEBirr` \| `Siinqee` \| `Telebirr` \| `Abyssinia` \| `EbirrKaafi` \| `EbirrCoopay` \| `Wegagen` \| `AmharaBank` \| `Zemen` | yes | | | `mode` | `sync` \| `async` | yes | | | `amount` | number | yes | Expected transaction amount in minor units (santim). 1 ETB = 100 santim | | `tx_ref` | string | no | Transaction reference number from the payment receipt | | `sender_account` | string | no | Sender's bank account number. Required for Abyssinia transactions. | | `receipt_image_url` | string (uri) | no | Publicly accessible URL of the payment receipt image to verify against | ### Responses - `200`: Response for status 200 - `202`: Response for status 202 - `400`: Response for status 400 - `401`: Response for status 401 - `403`: Response for status 403 - `422`: Response for status 422 - `429`: Response for status 429 - `500`: Response for status 500 - `502`: Response for status 502 # Delete webhook endpoint URL: /docs/openapi/webhooks/deleteApiV1WebhooksEndpointsById ## `DELETE /api/v1/webhooks/endpoints/{id}` Permanently delete a webhook endpoint and all its delivery records. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List webhook endpoints URL: /docs/openapi/webhooks/getApiV1WebhooksEndpoints ## `GET /api/v1/webhooks/endpoints` List all webhook endpoints. Secrets are never returned. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `limit` | query | number | no | | | `cursor` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get webhook endpoint URL: /docs/openapi/webhooks/getApiV1WebhooksEndpointsById ## `GET /api/v1/webhooks/endpoints/{id}` Retrieve a webhook endpoint by ID. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # List webhook events URL: /docs/openapi/webhooks/getApiV1WebhooksEvents ## `GET /api/v1/webhooks/events` List webhook events with optional event type filter. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `cursor` | query | string | no | | | `limit` | query | number | no | | | `event_type` | query | string | no | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Get webhook event URL: /docs/openapi/webhooks/getApiV1WebhooksEventsById ## `GET /api/v1/webhooks/events/{id}` Retrieve a webhook event with its full payload and delivery attempts. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Update webhook endpoint URL: /docs/openapi/webhooks/patchApiV1WebhooksEndpointsById ## `PATCH /api/v1/webhooks/endpoints/{id}` Update a webhook endpoint's URL, event filters, or status. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `url` | string (uri) | no | Updated HTTPS endpoint URL | | `enabled_events` | string[] | no | | | `status` | `active` \| `disabled` | no | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Create webhook endpoint URL: /docs/openapi/webhooks/postApiV1WebhooksEndpoints ## `POST /api/v1/webhooks/endpoints` Register a URL to receive webhook events. The signing secret is returned only on creation — store it securely. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `x-api-key` | header | string | yes | | ### Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `url` | string (uri) | yes | HTTPS endpoint URL that will receive webhook event POST requests | | `enabled_events` | string[] | no | Event types to subscribe to. Omit or pass an empty array to receive all events. e.g. checkout.completed, invoice.paid, subscription.renewed | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `429`: Response for status 429 # Roll webhook secret URL: /docs/openapi/webhooks/postApiV1WebhooksEndpointsByIdRoll-secret ## `POST /api/v1/webhooks/endpoints/{id}/roll-secret` Generate a new signing secret for a webhook endpoint. The old secret is immediately invalidated. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # Redeliver webhook event URL: /docs/openapi/webhooks/postApiV1WebhooksEventsByIdRedeliver ## `POST /api/v1/webhooks/events/{id}/redeliver` Re-queue a webhook event for delivery. The worker will attempt delivery to all active endpoints. Authentication: apiKeyHeader ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | yes | | | `x-api-key` | header | string | yes | | ### Responses - `200`: Response for status 200 - `401`: Response for status 401 - `403`: Response for status 403 - `404`: Response for status 404 - `429`: Response for status 429 # API Playground URL: /docs/openapi Interactive playground for the Access payment verification and management API. Explore the Access API. Each endpoint includes request/response schemas, example payloads, and a playground.