# TalusPay API

The TalusPay API lets you onboard merchants, follow their application through review and payments setup, and receive
events about them.
- **Merchants**
: create merchants, send their application, and read their status, branding and devices.
- **Onboarding Links**
: create a hosted link where a merchant completes onboarding.
- **Contracts**
: the documents owners sign during hosted onboarding.
- **Webhooks**
: subscribe an HTTPS endpoint to merchant and charge events.
- **Events**
: test helpers that send a webhook or change a merchant's state.
- **Statements**
: list and download a merchant's monthly statements.

## Payments
The payments API (taking payments, refunds and charges) is in progress and will be published here when it is ready.
You can already onboard merchants and track their payment setup status.
## Environments
| Environment | Base URL |
|  --- | --- |
| Sandbox | `https://api.taluspay-sandbox.com` |
| Production | `https://api.taluspay.com` |

Build and test against sandbox, then switch the base URL and credentials to go live.
## Authentication
Most routes take your API credentials as HTTP Basic auth: your account ID (`account_…`) as the username and your secret
key as the password.

```bash
curl -u "account_01k3t3as4efzxr9agynz6z404s:sk_your_secret_key" \
  https://api.taluspay-sandbox.com/v1/merchants
```
Keep the secret key on your server. Each route lists the credentials it accepts.
## IDs
Every object has a string ID with a type prefix, such as `merchant_…` or `webhook_…`. Treat IDs as opaque.
## Pagination
`GET /v1/merchants` returns one page at a time. Pass `page` (starting at 1) and `limit` (up to 100), and read the
`pagination` object for `total`, `total_pages`, `has_next` and `has_previous`. Other lists return every item.
## Errors
A failed request returns a 4xx or 5xx status and a JSON body:

```json
{
  "status_code": 400,
  "message": "Device IMEI '357111112222333' is not available to be used.",
  "error": "DEVICE_IMEI_ALREADY_BOUND",
  "debug_id": "dbg_01k8x2v9j3m4n5p6q7r8s9t0vw",
  "timestamp": "2026-01-15T10:30:00.000Z"
}
```
Branch on `error`: a broken business rule returns a stable code like the one above. `message` is meant for people and
may change. Quote `debug_id`, also sent in the `X-Debug-Id` header, when you contact support.
## Onboarding status
Every merchant carries `lead_onboarding_status`. It moves forward through:
| Status | Meaning |
|  --- | --- |
| `IN_PROGRESS` | The application is open and a required field is still missing. Every merchant starts here. |
| `READY_TO_SIGN` | Every required field is filled; the main owner can sign the contract. |
| `COMPLETED` | The main owner has signed. Review has not started: other owners may still need to sign. |
| `KYC_IN_PROGRESS` | The application is being verified. |
| `APPROVED` | The application is approved. |
| `APPROVED_ON_HOLD` | The application is approved on condition that more documents are provided. |
| `PENDED` | Review needs more information from the merchant. |
| `FAILED` | The application is declined, or onboarding could not finish. |

Until the main owner signs, each change to the application moves the status between `IN_PROGRESS` and `READY_TO_SIGN`,
so clearing a required field moves a merchant back to `IN_PROGRESS`. From `COMPLETED` on, application changes leave the
status alone. While a merchant is `COMPLETED`, `KYC_IN_PROGRESS` or `APPROVED`, its application cannot be changed and an
update returns `LEAD_DATA_LOCKED`. Treat an unknown status as one you do not act on: new ones may be added.
Every merchant starts at `IN_PROGRESS`, including before any application data is sent. The application status is never `null`.
Filter the merchant list by `IN_PROGRESS` to include merchants that have not started their application.
## Webhooks
Each event is delivered as a JSON `POST` to your webhook URL:

```json
{
  "id": "evt_01k8x2v9j3m4n5p6q7r8s9t0vw",
  "created_at": 1768473000000,
  "event_type": "merchant.updated",
  "api_version": "2026-08-11",
  "data": {}
}
```
`created_at` is in milliseconds since the Unix epoch. To check that a delivery came from TalusPay, compute the
HMAC-SHA256 of `<X-Talus-Webhook-Timestamp>.<raw request body>` with your webhook `secret`, and compare its hex digest
with the `X-Talus-Webhook-Signature` header, which is sent as `sha256=<digest>`. Reject deliveries whose timestamp is
too old.
### Merchant events
A webhook subscribed to the `merchant` scope receives these events:
| Event | Sent when |
|  --- | --- |
| `merchant.created` | A merchant is created. |
| `merchant.processing` | The create request has finished setting up the merchant, right after `merchant.created`. |
| `merchant.updated` | The merchant changes: its onboarding status moves, its trading name is updated, or it is reactivated. |
| `merchant.kyc_approved` | The application is approved. Carries `payment_onboarding_status`. |
| `merchant.verification_failed` | The application is declined or onboarding fails. `lead_onboarding_status` is `FAILED`. |
| `merchant.payments_onboarded` | The merchant is set up to take payments. |
| `merchant.payments_onboarding_failed` | Setting up payments failed. |
| `merchant.verification_approved` | Sent together with `merchant.payments_onboarded`. Kept for older integrations; new ones should use `merchant.kyc_approved` and `merchant.payments_onboarded`. |
| `merchant.deactivated` | The merchant is deactivated. `deactivated` is `true`. |

In every merchant event, `data` is `{ "object": "merchant", "payload": { … } }`. The payload is a snapshot of the
merchant with the same field names as the merchant response: `id`, `email`, `phone`, `lead_id`, `doing_business_as`,
`legal_business_name`, `dba_address`, `lead_onboarding_status`, `deactivated`, `automatic_payouts`, `campaign`,
`timezone`, `created_at`, `branding`, `defaults`, `receipt_settings`, `default_capabilities`, `device`,
`hardware_offerings` and `hardware_selection`. It never includes the application itself, so bank details, tax IDs and
SSNs are not sent. The events above add the fields they name.
## Testing
`POST /v1/events/test` sends any merchant event to your webhooks without changing the merchant.
`POST /v1/events/trigger` approves, declines or deactivates a merchant and sends the matching event, so you can run your
integration end to end in sandbox. Approve and decline do not work in production.
## Status
The [status page](https://status.taluspay.com) shows the current state of the API and its uptime history.

Version: v1

## Servers

Sandbox environment endpoint
```
https://api.taluspay-sandbox.com
```

Production environment endpoint
```
https://api.taluspay.com
```

## Security

### api-key-secret

Your API credentials as HTTP Basic auth: your account ID (`account_…`) as the username and your secret key as the password.

Type: http
Scheme: basic

## Download OpenAPI description

 - [TalusPay API](https://docs.taluspay.com/_bundle/openapi.yaml)

## Merchants

 - [POST /v1/merchants](https://docs.taluspay.com/openapi/merchants/create%20merchant.md): Creates a merchant from a phone number, email or device IMEI; send at least one. Send `merchant` to prefill the application. Device IMEIs are unique across accounts: an IMEI held by your account retur
 - [GET /v1/merchants](https://docs.taluspay.com/openapi/merchants/list%20merchants.md): Lists the merchants of your account, newest first, one page at a time. Each item carries `doing_business_as` and `legal_business_name` for labels: show the trading name and fall back to the legal name
 - [GET /v1/merchants/{merchant_id}/logo](https://docs.taluspay.com/openapi/merchants/get%20merchant%20logo.md): Returns the logo set on this merchant only, or null when it uses your account logo. `defaults.logo` on the merchant response has the logo in effect.
 - [POST /v1/merchants/{merchant_id}/logo](https://docs.taluspay.com/openapi/merchants/upload%20merchant%20logo.md): Sets a logo for this merchant, replacing your account logo on its receipts and onboarding pages. Send the image as multipart/form-data in the `logo` field.
 - [DELETE /v1/merchants/{merchant_id}/logo](https://docs.taluspay.com/openapi/merchants/delete%20merchant%20logo.md): Removes the logo set on this merchant, so it uses your account logo again.
 - [PUT /v1/merchants/{merchant_id}/receipt_settings](https://docs.taluspay.com/openapi/merchants/upsert%20merchant%20receipt%20settings.md): Sets the thank-you message and return/refund policy printed on email, hosted and PDF receipts. Each field is optional: omit it to keep the current value, or send null to clear it.
 - [GET /v1/merchants/{merchant_id}](https://docs.taluspay.com/openapi/merchants/get%20merchant.md): Returns a merchant with its application, payment setup and hardware. Authenticates with your account ID and secret key as HTTP Basic auth.
 - [PATCH /v1/merchants/{merchant_id}](https://docs.taluspay.com/openapi/merchants/update%20merchant.md): Updates the fields you send and leaves the rest unchanged. Application fields cannot change while onboarding is COMPLETED, KYC_IN_PROGRESS or APPROVED (LEAD_DATA_LOCKED). Authenticates with your accou
## Onboarding Links

 - [POST /v1/onboarding_links](https://docs.taluspay.com/openapi/onboarding-links/create%20onboarding%20link.md): Creates a link the merchant opens to complete onboarding. Send `attribution` to record the sales agent, channel and partners on the merchant application at the same time. A new link expires every earl
## Contracts

 - [GET /v1/contracts/click_to_sign/{lead_signature_id}](https://docs.taluspay.com/openapi/contracts/open%20signing%20link.md): The link emailed to each additional owner once the main owner signs. Records that it was opened and redirects to the signing page. Needs no credentials: the signature ID is the access key.
 - [GET /v1/contracts/download/{lead_signature_id}](https://docs.taluspay.com/openapi/contracts/download%20signed%20contract.md): Downloads the signed contract PDF. Needs no credentials: the signature ID is the access key.
 - [GET /v1/contracts/{lead_signature_id}](https://docs.taluspay.com/openapi/contracts/get%20the%20agreement%20for%20extra%20owners.md): Returns the documents an additional owner signs: the contract, and the ACH agreement when ACH is enabled. Needs no credentials: the signature ID is the access key.
## Webhooks

 - [POST /v1/webhooks](https://docs.taluspay.com/openapi/webhooks/create%20webhook.md): Subscribes an HTTPS endpoint to events. Each delivery is a JSON POST of `{ id, created_at, event_type, api_version, data }`, signed with the `secret` in the response.
 - [GET /v1/webhooks](https://docs.taluspay.com/openapi/webhooks/get%20webhook.md): Lists the webhooks of your account, with their signing secrets.
 - [DELETE /v1/webhooks/{webhook_id}](https://docs.taluspay.com/openapi/webhooks/delete%20webhook.md): Stops event deliveries to the webhook and deletes it.
## Events

 - [POST /v1/events/test](https://docs.taluspay.com/openapi/events/send%20test%20merchant%20webhook.md): Sends a merchant event to your webhooks without changing the merchant, to test your endpoint. Test deliveries have event ids starting with `evt_00000000000000`.
 - [POST /v1/events/trigger](https://docs.taluspay.com/openapi/events/trigger%20merchant%20state.md): Approves, declines or deactivates a merchant as if it happened for real, and sends the matching webhook, so you can test your integration end to end. Approve and decline work only in sandbox: in produ
## Statements

 - [GET /v1/statements/{merchant_id}](https://docs.taluspay.com/openapi/statements/list%20merchant%20statements.md): Lists the monthly processing statements available for an approved merchant.
 - [GET /v1/statements/{merchant_id}/download/{statement_id}](https://docs.taluspay.com/openapi/statements/download%20merchant%20statement.md): Downloads one monthly statement as a PDF, branded with your account branding.
