> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polygon.technology/llms.txt
> Use this file to discover all available pages before exploring further.

# Pay a third party

> Register a counterparty and their bank account, then pay them from a customer's wallet with the quote and transaction flow.

> [!NOTE]
>
> **Before you start:** the OMS API is in early access. Every endpoint, including the ones in this guide, requires an early-access API key. [Request access](https://polygon.technology/get-access?utm_source=docs\&utm_medium=card\&utm_campaign=oms_access) before you begin.
>
> Authenticate by exchanging your API key and secret for a bearer token at `POST /auth/token`, then send it as `Authorization: Bearer {accessToken}` on every request. Every `POST` that creates or changes a resource also requires an `Idempotency-Key` header. See [Get started](https://docs.polygon.technology/payments/get-started.md) for the full flow.

This guide pays someone who is not your customer, such as a vendor or a payee, from a customer's wallet. The recipient is a counterparty in the customer's address book (see [Entities](https://docs.polygon.technology/payments/core-concepts/entities.md)) and never needs an OMS account. The flow has four steps: create the counterparty, register their bank account, quote, and execute.

## Prerequisites

1. **A customer** with a `cst_` ID whose `cryptoCustody` and `usd` endorsements are `active`: the payout is funded from this customer's wallet.
2. **A funded OMS wallet** with a `wlt_` ID holding enough USDC to cover the payout.
3. **The recipient's details**: their legal name, and their bank account information.

## Step 1: Create the counterparty

`POST /counterparties` requires the owning `customerId`, an `entityType` discriminator, and the name fields for that type:

* `entityType: "individual"` requires `firstName` and `lastName`, with optional `dateOfBirth`.
* `entityType: "business"` requires `businessName`.

An `address` is also required unless your project is configured not to require one. Other identity fields are optional but improve compliance screening: `email`, `phone`, `taxId`, and `nationality`.

The request is strictly validated: a missing or unrecognized `entityType` returns `422 EntityTypeInvalid`, and a flat `name` field is rejected. Each `entityType` arm rejects keys from the other arm, so `firstName` on a `business` request (or `businessName` on an `individual` request) returns `422 Validation`.

### Request

```
POST /v0.13/counterparties
Authorization: Bearer {accessToken}
Idempotency-Key: ctp-acme-001
Content-Type: application/json
```

```json theme={null}
{
  "customerId": "cst_01H9Xa...",
  "entityType": "business",
  "businessName": "Acme Supplies LLC",
  "email": "billing@acme.example",
  "taxId": "98-7654321",
  "address": {
    "line1": "500 Market St",
    "city": "San Francisco",
    "state": "CA",
    "zipCode": "94105",
    "country": "US"
  }
}
```

When you supply an `address`, OMS validates it in full: non-blank `line1`, `city`, and `zipCode`, a two-letter ISO `country`, and `state` for a US address. `line2` is optional. A counterparty created without an address omits `address` from its responses.

### Response, `201 Created`

Responses echo the split name fields and add a read-only `name`, server-composed as `businessName` for a business or `firstName + " " + lastName` for an individual. The composed value is at most 140 characters.

```json theme={null}
{
  "id": "ctp_01H9Xc...",
  "customer": { "id": "cst_01H9Xa..." },
  "entityType": "business",
  "businessName": "Acme Supplies LLC",
  "name": "Acme Supplies LLC",
  "email": "billing@acme.example",
  "taxId": "98-7654321",
  "address": {
    "line1": "500 Market St",
    "city": "San Francisco",
    "state": "CA",
    "zipCode": "94105",
    "country": "US"
  },
  "status": "active",
  "createdAt": "2026-11-02T10:00:00.000Z",
  "updatedAt": "2026-11-02T10:00:00.000Z"
}
```

For an `individual` counterparty, the response carries `firstName`, `lastName`, and optional `dateOfBirth` in place of `businessName`, and `name` renders as `"{firstName} {lastName}"`.

Store the `ctp_` ID. A counterparty that fails compliance screening comes back `rejected` with a `failure` object whose `code` says why; only `active` counterparties can own external accounts. Screening also runs on `PATCH /counterparties/{counterpartyId}`: an update can move a counterparty to `rejected`, and a counterparty rejected only for `countryProhibited` returns to `active` when an update moves its address to an allowed country.

Address changes on an existing counterparty are screened the same way. A `PATCH /counterparties/{counterpartyId}` that resolves to a prohibited country returns `200` with `status: rejected` and `failure.code: countryProhibited`, and fires `counterparty.statusChanged`. Quote and transaction flows in this guide refuse payouts to external accounts owned by a rejected counterparty until the counterparty is updated back to an allowed country. Supplying an allowed country on a counterparty rejected with `countryProhibited` reactivates it; a counterparty rejected for any other reason stays `rejected`.

## Step 2: Register the counterparty's bank account

Register the recipient's bank with `POST /external-accounts`, setting the `owner` to the counterparty. The per-type detail object must match the `type`: `bankUs` for US accounts, `bankIban` for international IBAN accounts, or `bankCanada` for Canadian accounts.

### Request

```
POST /v0.13/external-accounts
Authorization: Bearer {accessToken}
Idempotency-Key: ext-acme-bank-001
Content-Type: application/json
```

```json theme={null}
{
  "owner": { "kind": "counterparty", "counterpartyId": "ctp_01H9Xc..." },
  "type": "bankUs",
  "bankUs": {
    "accountNumber": "987654321012",
    "routingNumber": "021000021",
    "accountType": "checking",
    "bankName": "Example Bank"
  },
  "label": "Acme payouts"
}
```

### Response, `201 Created`

```json theme={null}
{
  "id": "ext_01H9Xm...",
  "type": "bankUs",
  "customer": { "id": "cst_01H9Xa..." },
  "owner": { "kind": "counterparty", "id": "ctp_01H9Xc...", "name": "Acme Supplies LLC" },
  "asset": "usd",
  "supportedDestinations": [
    { "asset": "usd", "rail": "ach" },
    { "asset": "usd", "rail": "achSameDay" },
    { "asset": "usd", "rail": "wire" }
  ],
  "details": {
    "accountNumberLast4": "1012",
    "routingNumber": "021000021",
    "accountType": "checking",
    "bankName": "Example Bank",
    "holderName": "Acme Supplies LLC"
  },
  "status": "pending",
  "label": "Acme payouts",
  "createdAt": "2026-11-02T10:01:00.000Z",
  "updatedAt": "2026-11-02T10:01:00.000Z"
}
```

The full account number is write-only; reads return `details.accountNumberLast4`. `owner` names the counterparty, and `customer` is the customer the account is registered for. The account starts `pending` and moves to `active` (usable on quotes), or to `failed` or `rejected` with a `failure`. Wait for `active`, or `externalAccount.statusChanged`, before quoting against it.

### Beneficiary identity on a US bank payout

When the destination is a counterparty-owned `bankUs` account, OMS registers the beneficiary with the paying bank under the **counterparty's own** structured identity: the `entityType`, the matching name fields (`firstName` and `lastName`, or `businessName`), and the counterparty's `address`. The customer's identity is not used for a counterparty-owned account. Register US bank counterparties with the complete `entityType`, name, and address fields shown in Step 1; a counterparty without `entityType` cannot be used as a `bankUs` destination and is rejected with `422 AccountTypeRequirementsNotMet`. A payout the receiving bank returns as a payee-name mismatch flips the external account to [`invalid`](https://docs.polygon.technology/payments/external-accounts#invalid-external-accounts) with `failure.code: payeeNameMismatch`.

## Step 3: Create the quote

The quote is identical to any other bank payout: the `source` is the customer's OMS wallet, and the `destination` is the counterparty's registered bank account referenced by its `ext_` ID.

```
POST /v0.13/quotes
Authorization: Bearer {accessToken}
Idempotency-Key: qt-acme-payout-001
Content-Type: application/json
```

```json theme={null}
{
  "customerId": "cst_01H9Xa...",
  "source": {
    "type": "walletCrypto",
    "details": { "id": "wlt_01H9Xb...", "asset": "usdc", "network": "polygon" },
    "amount": "2500.00"
  },
  "destination": {
    "type": "bankUs",
    "details": {
      "id": "ext_01H9Xm...",
      "asset": "usd",
      "network": "ach"
    }
  }
}
```

On the response, OMS resolves the recipient's identity onto the destination's `owner` block, so you can render who is being paid without extra reads:

```json theme={null}
"destination": {
  "type": "bankUs",
  "id": "ext_01H9Xm...",
  "asset": "usd",
  "owner": { "kind": "counterparty", "id": "ctp_01H9Xc...", "name": "Acme Supplies LLC" },
  "details": { "accountNumberLast4": "1012", "holderName": "Acme Supplies LLC" }
}
```

Dereference the counterparty by `owner.id` for the recipient's full record (entity type, address, contact fields). All amounts and fees live in the top-level `pricing` object, and `sourceToDestination` is `cryptoToFiatAccount`. The bank destination carries no rail; the rail is on the payout transfer once it exists.

## Step 4: Execute and track

Accept the quote with `POST /transactions` and the `quoteId`:

```json theme={null}
{ "quoteId": "qt_01H9Xq..." }
```

The transaction starts at `processing` and moves to `completed` when the bank payout settles, or `failed` with a `failure` object. The payout leg surfaces granular progress in `subStatus`: `processing.awaitingFiatOut` while the payout is queued, then `processing.fiatOut` once it is in flight. If the payout fails and is retried, `subStatus` reads `processing.payoutRetrying`; if the provider holds it until your prefunded balance covers it, `processing.payoutHeld`. Poll `GET /transactions/{transactionId}` or subscribe to `transaction.statusChanged`; see the [webhook events catalog](https://docs.polygon.technology/api-reference/webhook-events.md).

To reconcile a payout run, filter `GET /transactions?customerId=...`: each transaction's destination `owner.id` is the counterparty it paid (`owner.kind: "counterparty"`).

To see the name the recipient's bank shows as the sender, read `payoutOrigin.accountHolderName` on the quote or transaction. `payoutOrigin.accountHolder` says whose identity that is: `customer`, `partner`, or `paymentProvider`.

## Managing counterparties

* `GET /counterparties?customerId=...` lists a customer's counterparties. Paginate with `limit`, `startingAfter`, and `endingBefore`.
* `GET /counterparties/{counterpartyId}` fetches one by ID.
* `PATCH /counterparties/{counterpartyId}` partially updates identity fields; omitted fields are unchanged. `entityType` is immutable, and both `entityType` and the composed `name` field are rejected with `400`. Name updates go through the split fields for the stored `entityType` (`firstName` and `lastName` for `individual`; `businessName` for `business`); the server recomposes and echoes back `name`. A name field that does not belong to the stored `entityType` returns `422 Validation`, and an empty body returns `422 EmptyUpdate`.
* `DELETE /counterparties/{counterpartyId}` soft-deletes. It returns `409 CounterpartyHasActiveExternalAccounts` while the counterparty still owns active external accounts: delete those accounts first, then delete the counterparty.

## Related

* [B2B payouts](https://docs.polygon.technology/payments/guides/b2b-payouts.md): running payouts to many recipients
* [Bank transfers](https://docs.polygon.technology/payments/guides/bank-transfers.md): rails, per-type bank fields, and registration details
* [External accounts](https://docs.polygon.technology/payments/external-accounts.md): the full registration and lifecycle model
* [Crypto to fiat](https://docs.polygon.technology/payments/guides/crypto-to-fiat.md): the underlying quote and transaction flow
