---
name: bullring-partner-api
description: Build and operate Bullring Finance partner integrations for NGN deposits, recipients, withdrawals, conversion quotes, and Convoy webhooks.
license: Proprietary
compatibility: Requires an RSA private key whose public key is registered to a Bullring store integration. Node.js, Python, Go, cURL, and any HTTP client can be used.
metadata:
  author: Bullring Finance
  version: "1.1"
---

# Bullring Partner API integration skill

Use this skill to implement a production-ready integration with the Bullring Finance Partner API. Read this file before writing client code. Use the linked API pages and OpenAPI document when a response contains a field not described here.

## Non-negotiable rules

1. Use only the documented partner routes in this skill and the OpenAPI specification.
2. Never use FusionAuth machine clients or partner API keys. Partner authentication uses a registered RSA public key ID and a request signature.
3. Never log, commit, upload, or expose the RSA private key, webhook secret, or complete signature.
4. Sign the exact HTTP method, path, and raw body bytes that will be sent.
5. Use a fresh idempotency ID for every new money-moving request and persist it with the operation.
6. Keep every request scoped to the store attached to the registered integration.
7. Treat all monetary response values as decimal strings; never use binary floating-point for settlement calculations.
8. Return `2xx` from a webhook receiver only after signature verification and durable acceptance.
9. Use deposit simulation only against the sandbox environment.
10. Do not invent access to balance, Lightning deposit, or stablecoin withdrawal routes.
11. If an integration has an IP allowlist, send requests only from one of its exact configured IPv4 or IPv6 addresses.

## Environments and credentials

```text
Sandbox:    https://sandbox-api.bullring.finance
Production: https://api.bullring.finance
Store ID:   supplied by the dashboard
Key ID:     supplied when the RSA public key is registered
Private key: kept locally or in a secret manager; never sent to Bullring
```

The dashboard associates the registered public key and key ID with a store/integration. A request cannot access another store by changing `storeId`.

An integration may optionally include exact allowed IP addresses. An empty allowlist permits any source IP; a non-empty allowlist rejects unmatched requests with `403 IP_NOT_ALLOWED`.

## Authentication

Every partner request sends these headers:

```http
X-Key-Id: <registered-key-id>
X-Timestamp: <unix-seconds>
X-Idempotency-Id: <uuid>
X-Digital-Signature: <base64-rsa-signature>
```

`Content-Type: application/json` is required when a request has a JSON body.

### Canonical signing input

Build one UTF-8 string:

```text
v1.<timestamp>.<idempotency-id>.<HTTP-METHOD>.<path>.<raw-body>
```

Rules:

- `timestamp` is Unix time in seconds and must be within the accepted five-minute clock window.
- `idempotency-id` must exactly equal `X-Idempotency-Id`.
- `HTTP-METHOD` is uppercase, such as `GET` or `POST`.
- `path` contains the path only, without scheme, host, or query string.
- `raw-body` is the exact bytes sent after the headers. For a bodyless request it is empty, so the canonical string ends with a final `.`.
- Do not pretty-print, reorder, parse, or reserialize JSON after signing.
- Sign with RSA-SHA256 using PKCS#1 v1.5 padding.
- Base64-encode the signature and send it as `X-Digital-Signature`.

Example bodyless GET canonical input:

```text
v1.1795300000.0f0e0d0c-0b0a-4908-8706-050403020100.GET./v2/ramp/store-uuid/banking/deposits.
```

Example JSON POST canonical input:

```text
v1.1795300000.0f0e0d0c-0b0a-4908-8706-050403020100.POST./v2/ramp/store-uuid/banking/recipients.{"currency":"NGN","payment_rail":"BANK_TRANSFER","bank_name":"Parkway","account_number":"8120001540","bank_code":"058"}
```

### Request algorithm

```text
method = uppercase HTTP method
path = exact URL path without query string
rawBody = exact body bytes, or ""
timestamp = current Unix seconds
idempotencyId = new UUID for a new operation
canonical = "v1." + timestamp + "." + idempotencyId + "." + method + "." + path + "." + rawBody
signature = Base64(RSA-SHA256-PKCS1v1.5(privateKey, UTF8(canonical)))
send headers and the exact rawBody
```

### Minimal cURL template

```bash
BASE_URL="https://sandbox-api.bullring.finance"
STORE_ID="replace-with-store-id"
KEY_ID="replace-with-registered-key-id"
PRIVATE_KEY="./partner-private-key.pem"
TIMESTAMP="$(date +%s)"
IDEMPOTENCY_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"
METHOD="GET"
PATH="/v2/ramp/${STORE_ID}/banking/deposits"
BODY=""

CANONICAL="v1.${TIMESTAMP}.${IDEMPOTENCY_ID}.${METHOD}.${PATH}.${BODY}"
SIGNATURE="$(
  printf '%s' "$CANONICAL" |
  openssl dgst -sha256 -sign "$PRIVATE_KEY" |
  openssl base64 -A
)"

curl "${BASE_URL}${PATH}" \
  -H "X-Key-Id: ${KEY_ID}" \
  -H "X-Timestamp: ${TIMESTAMP}" \
  -H "X-Idempotency-Id: ${IDEMPOTENCY_ID}" \
  -H "X-Digital-Signature: ${SIGNATURE}"
```

For a JSON request, set `BODY` to the exact compact JSON string and pass the same value with `--data-raw "$BODY"`.

## Supported API operations

All paths below are relative to the selected environment base URL. Every operation requires the authentication headers.

| Operation | Method and path | Required body |
| --- | --- | --- |
| List NGN institutions | `GET /v2/ramp/{storeId}/banking/ngn/institutions` | none |
| Validate NGN account | `POST /v2/ramp/{storeId}/banking/ngn/validate` | `accountNumber`, `bankCode` |
| Create virtual account | `POST /v2/ramp/{storeId}/banking/deposits` | `channelId` |
| List deposits | `GET /v2/ramp/{storeId}/banking/deposits` | none |
| Get deposit | `GET /v2/ramp/{storeId}/banking/deposits/{depositId}` | none |
| Simulate deposit | `POST /v2/ramp/{storeId}/banking/deposits/simulate` | sandbox-only simulation fields |
| List recipients | `GET /v2/ramp/{storeId}/banking/recipients` | none |
| Create recipient | `POST /v2/ramp/{storeId}/banking/recipients` | recipient fields |
| Get recipient | `GET /v2/ramp/{storeId}/banking/recipients/{recipientId}` | none |
| List withdrawals | `GET /v2/ramp/{storeId}/banking/withdrawals` | none |
| Create withdrawal | `POST /v2/ramp/{storeId}/banking/withdrawals` | `recipient_id`, `amount`, `currency` |
| Get withdrawal | `GET /v2/ramp/{storeId}/banking/withdrawals/{withdrawalId}` | none |
| Conversion quote | `POST /v1/ramp/{storeId}/banking/conversions/quote` | `fromCurrency`, `toCurrency`, `amount` |

Do not assume a successful request means final settlement. Persist returned IDs and process webhook status events.

## Deposit workflow

### Create or retrieve a virtual account

`POST /v2/ramp/{storeId}/banking/deposits`

Request:

```json
{
  "channelId": "ngn-channel-id-bullring-finance",
  "generateNewAccount": true,
  "beneficiaryName": "Partner NGN"
}
```

Rules:

- `channelId` is required.
- `generateNewAccount` controls whether a new virtual account is generated.
- `beneficiaryName` applies when `generateNewAccount` is `true`.
- When an existing account is reused, do not assume the beneficiary name changes.

Response fields:

```json
{
  "currency": "NGN",
  "bankInfo": {
    "bankAccountNumber": "4000005216",
    "bankBeneficiaryName": "Partner NGN"
  },
  "channelId": "ngn-channel-id-bullring-finance"
}
```

### List deposits

`GET /v2/ramp/{storeId}/banking/deposits`

Optional query parameters:

```text
status, channelId, page, limit, fromDate, toDate
```

The response is paginated:

```json
{
  "data": [],
  "count": 0,
  "page": 1,
  "limit": 20,
  "totalPages": 0
}
```

### Get a deposit

`GET /v2/ramp/{storeId}/banking/deposits/{depositId}`

The deposit ID must belong to the store in the path. A missing or inaccessible deposit returns `404`; do not reveal whether an ID belongs to another store.

Deposit shape:

```json
{
  "id": "deposit-uuid",
  "status": "paid",
  "amount": "100.00000000",
  "localAmount": "100.00",
  "currency": "NGN",
  "localCurrency": "NGN",
  "fee": "0.00",
  "feeCurrency": "NGN",
  "expiresAt": "2026-11-22T00:31:47.602Z",
  "createdAt": "2026-11-22T00:27:14.270Z",
  "reference": "provider-reference",
  "bankInfo": {},
  "depositor": {}
}
```

### Simulate a sandbox deposit

`POST /v2/ramp/{storeId}/banking/deposits/simulate`

Example:

```json
{
  "depositType": "deposit",
  "currency": "NGN",
  "amount": 100,
  "transferReference": "test-transfer-001"
}
```

`depositType` may be `deposit`, `onramp`, or `offramp`. Never expose this operation as a production settlement mechanism.

## Recipient workflow

### List institutions and validate an account

List institutions before rendering a bank selector:

```text
GET /v2/ramp/{storeId}/banking/ngn/institutions
```

Each institution includes a display `name` and a `code`. Preserve the selected code and send it to account validation.

Validate the account before creating a recipient:

```text
POST /v2/ramp/{storeId}/banking/ngn/validate
```

```json
{
  "accountNumber": "0123456789",
  "bankCode": "058"
}
```

`bankCode` accepts an institution code or institution name. The result includes `valid` and may include `message`, resolved bank information, provider information, or provider error details. Only create a recipient after a successful validation result.

Successful validation commonly returns:

```json
{
  "valid": true,
  "bank": {
    "name": "GTBank",
    "code": "058"
  },
  "account_name": "SIMULATED HOLDER 1540"
}
```

### Create a recipient

`POST /v2/ramp/{storeId}/banking/recipients`

```json
{
  "currency": "NGN",
  "payment_rail": "BANK_TRANSFER",
  "bank_name": "Parkway",
  "account_number": "8120001540",
  "bank_code": "058"
}
```

Required fields are `currency`, `payment_rail`, `bank_name`, `account_number`, and `bank_code`.

### List or get recipients

```text
GET /v2/ramp/{storeId}/banking/recipients
GET /v2/ramp/{storeId}/banking/recipients/{recipientId}
```

Recipient responses may include:

```json
{
  "id": "recipient-uuid",
  "account_owner_name": "Account Owner",
  "active": true,
  "currency": "NGN",
  "account_id": "provider-account-id",
  "payment_rail": "BANK_TRANSFER",
  "bank_name": "Parkway",
  "last_4": "1540"
}
```

Do not store or display a full bank account number from logs. Use the returned recipient ID for withdrawals.

## Withdrawal workflow

### Create a withdrawal

`POST /v2/ramp/{storeId}/banking/withdrawals`

```json
{
  "recipient_id": "recipient-uuid",
  "amount": "1000",
  "currency": "NGN",
  "client_reference": "payout-2026-0001"
}
```

Use a unique idempotency ID for the request. `client_reference` is an application reference and does not replace the required idempotency header.

Withdrawal response:

```json
{
  "id": "withdrawal-uuid",
  "amount": "1000",
  "currency": "NGN",
  "status": "screening",
  "fee_amount": "0.00",
  "fee_currency": "NGN",
  "net_amount": "1000",
  "client_reference": "payout-2026-0001"
}
```

### List or get withdrawals

```text
GET /v2/ramp/{storeId}/banking/withdrawals
GET /v2/ramp/{storeId}/banking/withdrawals/{withdrawalId}
```

Persist the withdrawal ID and treat the webhook event as the source of status transitions.

## Conversion quotes

`POST /v1/ramp/{storeId}/banking/conversions/quote`

```json
{
  "fromCurrency": "USD",
  "toCurrency": "NGN",
  "amount": 1000
}
```

Quote fields include:

```text
fromCurrency, toCurrency, amount, grossTargetAmount,
sourceNetAmount, feeAmount, feeCurrency, feeAppliedTo,
netTargetAmount, rate, rawRate, rateDetails, routeType, bridgeCurrency
```

Money fields are returned as decimal strings. `feeAppliedTo` is `source` or `target`. A quote is informational and does not reserve liquidity or guarantee a later execution price.

## Webhooks

Webhook endpoints are created and managed in the Bullring dashboard. Bullring delivers events through Convoy.

### Verify `X-BULLRING-SIGNATURE`

Every delivery includes:

```http
X-BULLRING-SIGNATURE: t=<unix-seconds>,v1=<base64-hmac>
```

The endpoint secret is shown when the dashboard creates the endpoint. Save it immediately; it is not returned in later endpoint listings. If it is lost, recreate the endpoint.

Verification:

```text
parts = split header by ","
timestamp = value of "t"
received = value of "v1"
signed = timestamp + "," + exact raw request body
expected = Base64(HMAC-SHA256(endpointSecret, signed))
valid = constantTimeEqual(received, expected)
```

Use the raw body bytes, not a parsed and reserialized JSON object. Reject stale timestamps according to the application’s replay window. Verify before deserialization and business processing.

### Events

Deposit events include:

```text
deposit.status.paid
deposit.status.unpaid
```

Withdrawal events include:

```text
withdrawal.status.not_initiated
withdrawal.status.in_progress
withdrawal.status.completed
withdrawal.status.failed
withdrawal.status.reversed
```

### Delivery behavior

- Return `2xx` only after durable acceptance.
- Return non-`2xx` when verification or persistence fails so Convoy can retry.
- Deduplicate by the event ID when present.
- Do not assume delivery order.
- Store the raw event, verification result, received time, and processing result.
- Make handlers idempotent because retries can represent the same business event.

## Idempotency and retries

For every new POST:

1. Generate an idempotency UUID.
2. Store it with the business operation before sending.
3. Sign it into the canonical request.
4. Send the same value as `X-Idempotency-Id`.
5. On a timeout, retry the same request with the same idempotency ID.
6. Do not generate a new ID unless intentionally creating a new operation.

Do not blindly retry validation, authentication, authorization, or permanent business errors. Retry transient `5xx`, network failures, and provider failures with bounded exponential backoff and jitter.

## Errors

Error responses generally follow:

```json
{
  "statusCode": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request details"
}
```

Handle at least:

| Status | Meaning | Agent action |
| --- | --- | --- |
| `400` | Invalid request or validation | Fix fields; do not retry unchanged |
| `401` | Missing or invalid signature | Rebuild canonical bytes and verify credentials |
| `403` | Store or scope denied | Check integration registration and store ID |
| `404` | Resource not found | Confirm resource ID and store scope |
| `409` | Duplicate or state conflict | Reconcile using the original idempotency ID |
| `500` | Temporary API failure | Bounded retry where operation is safe |
| `502` | Provider failure | Retry cautiously and reconcile |
| `503` | Temporary service unavailability | Bounded retry |

## Implementation checklist

Before coding:

- [ ] Obtain the store ID and registered key ID from the dashboard.
- [ ] Store the RSA private key in a secret manager.
- [ ] Select sandbox or production explicitly.
- [ ] Read the relevant OpenAPI operation.

Before sending a request:

- [ ] Construct the exact path without query string in the signature.
- [ ] Serialize the body once and retain those exact bytes.
- [ ] Generate or reuse the correct idempotency ID.
- [ ] Verify the timestamp is current.
- [ ] Sign with RSA-SHA256/PKCS#1 v1.5.
- [ ] Send the same method, path, headers, and body that were signed.

Before production:

- [ ] Test virtual-account creation.
- [ ] Test a sandbox deposit simulation.
- [ ] Test deposit lookup by ID.
- [ ] Test recipient creation and lookup.
- [ ] Test withdrawal creation with a fixed idempotency ID.
- [ ] Test webhook verification, retry, duplicate, and out-of-order handling.
- [ ] Confirm secrets are absent from logs, traces, client bundles, and source control.

## Installation

Install this file with the open agent-skills CLI:

```bash
npx skills add https://docs.bullring.finance/skill.md
```

Target common harnesses globally:

```bash
npx skills add https://docs.bullring.finance/skill.md --agent opencode --global
npx skills add https://docs.bullring.finance/skill.md --agent claude-code --global
npx skills add https://docs.bullring.finance/skill.md --agent codex --global
npx skills add https://docs.bullring.finance/skill.md --agent cursor --global
npx skills add https://docs.bullring.finance/skill.md --agent windsurf --global
```

For OpenCode manual installation:

```bash
mkdir -p .opencode/skills/bullring-partner-api
curl -fsSL https://docs.bullring.finance/skill.md \
  -o .opencode/skills/bullring-partner-api/SKILL.md
```

Restart the harness after installation. Run `npx skills update` to refresh an installed copy.

## Authoritative references

- https://docs.bullring.finance/llms-full.txt
- https://docs.bullring.finance/mcp
- https://docs.bullring.finance/.well-known/mcp
- https://docs.bullring.finance/openapi.json
- https://docs.bullring.finance/01-authentication
- https://docs.bullring.finance/03-signing
- https://docs.bullring.finance/api-reference/ngn/institutions
- https://docs.bullring.finance/api-reference/ngn/validate-account
- https://docs.bullring.finance/api-reference/deposits/create-virtual-account
- https://docs.bullring.finance/api-reference/deposits/list
- https://docs.bullring.finance/api-reference/deposits/get
- https://docs.bullring.finance/api-reference/deposits/simulate
- https://docs.bullring.finance/api-reference/recipients/list
- https://docs.bullring.finance/api-reference/recipients/create
- https://docs.bullring.finance/api-reference/recipients/get
- https://docs.bullring.finance/api-reference/withdrawals/list
- https://docs.bullring.finance/api-reference/withdrawals/create
- https://docs.bullring.finance/api-reference/withdrawals/get
- https://docs.bullring.finance/api-reference/quotes/conversion
- https://docs.bullring.finance/webhook-notifications
- https://docs.bullring.finance/11-webhook-verification
- https://docs.bullring.finance/08-idempotency
- https://docs.bullring.finance/09-errors
- https://docs.bullring.finance/14-security
