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

# Test payloads

# Sandbox test payloads

Validated copy-paste payloads for sandbox QA. Replace `API_KEY` and `network_id` if your environment differs.

**Default asset:** Base USDC (`BASE_USDC` below). Prefer that for all corridors. `POLYGON_USDT` is optional — only use when testing that rail explicitly.

## Setup

```bash theme={null}
export BASE="https://sandbox.elementpay.net/api/v1"
export API_KEY="is_test_YOUR_KEY"

# Recommended default for quotes
export BASE_USDC="0x833589fcd6edb6e08f4c7c32d4f71b54bdA02913"
# Optional alternate rail
export POLYGON_USDT="0xc2132d05d31c914a87c6611c10748aeb04b58e8f"
export WALLET="0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe"
export REFUND="0xE1E4E1E4E1E4E1E4E1E4E1E4E1E4E1E4E1E4E1E4"

# Verify on your sandbox via GET /partner/catalog
export NG_BANK_NETWORK_ID="5f1af11b-305f-4420-8fce-65ed2725a409"
export KE_MOMO_NETWORK_ID="7ea6df5c-6bba-46b2-a7e6-f511959e7edb"
export KE_BANK_NETWORK_ID="30f11b2e-0905-4c09-ba5f-d05aa4e4a11c"
export UG_MOMO_NETWORK_ID="04a3083a-567c-4a2b-aa39-fa8f19e64341"
```

## Quote → accept helper

```bash theme={null}
quote_and_accept() {
  local payload="$1"
  curl -sS -X POST "$BASE/partner/orders/quote" \
    -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
    -d "$payload" | tee /tmp/last-quote.json | jq '{quote_id:.data.quote_id, status:.data.status}'

  export QUOTE_ID=$(jq -r '.data.quote_id' /tmp/last-quote.json)
  sleep 2
  curl -sS -X POST "$BASE/partner/orders/$QUOTE_ID/accept" \
    -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
    -d '{}' | jq '.data'
}
```

## Scenarios

See [Sandbox success & failure](/sandbox/success-failure) for the full success/failure matrix and production warnings.

| Corridor | Type    | Rail               | Success trigger                                         |
| -------- | ------- | ------------------ | ------------------------------------------------------- |
| KE       | OnRamp  | momo               | `+2541111111111`                                        |
| KE       | OffRamp | momo               | `Successful` in `customer.name` (auto-deposit)          |
| KE       | OnRamp  | bank               | `account_number: 1111111111`                            |
| KE       | OffRamp | bank (institution) | `Successful` in `customer.business_name` (auto-deposit) |
| NG       | OnRamp  | bank               | BVN + `account_number: 1111111111`                      |
| UG       | OnRamp  | momo               | `+256111111111`                                         |

Failure: momo `+2540000000000` / bank `0000000000` / OffRamp name contains `Failure` (retail `customer.name` or institution `business_name`).

## KE OnRamp momo (inline)

```bash theme={null}
quote_and_accept '{
  "order_type": "OnRamp",
  "currency": "KES",
  "country": "KE",
  "local_amount": 800,
  "asset": {"token": "'"$BASE_USDC"'", "currency": "USDC", "network": "BASE"},
  "customer": {
    "uid": "sandbox-ke-onramp-001",
    "type": "user",
    "name": "Jane Doe",
    "country": "KE",
    "phone": "+2541111111111",
    "address": "Nairobi",
    "dob": "02/01/1997",
    "email": "jane@example.com",
    "id_number": "A1234567",
    "id_type": "passport"
  },
  "payment_method": {
    "type": "mobile_money",
    "phone_number": "+2541111111111",
    "network_id": "'"$KE_MOMO_NETWORK_ID"'"
  },
  "wallet_address": "'"$WALLET"'"
}'
```

## KE OffRamp momo (inline)

Sandbox auto-credits the crypto leg when `Successful` is in `customer.name` — **do not** send on-chain after accept. Use Polygon USDT:

```bash theme={null}
quote_and_accept '{
  "order_type": "OffRamp",
  "currency": "KES",
  "country": "KE",
  "crypto_amount": 20,
  "asset": {"token": "'"$POLYGON_USDT"'", "currency": "USDT", "network": "POLYGON"},
  "customer": {
    "uid": "sandbox-ke-offramp-001",
    "type": "user",
    "name": "Successful Jane Doe",
    "country": "KE",
    "phone": "+2541111111111",
    "address": "Nairobi",
    "dob": "02/01/1997",
    "email": "jane@example.com",
    "id_number": "A1234567",
    "id_type": "passport"
  },
  "payment_method": {
    "type": "mobile_money",
    "phone_number": "+2541111111111",
    "network_id": "'"$KE_MOMO_NETWORK_ID"'"
  },
  "refund_address": "'"$REFUND"'"
}'
```

## KE OffRamp bank — institution (B2B)

Same quote shape as retail OffRamp; institution KYC uses `business_name` / `business_id` / `email` / `uid` (no DOB or personal `name`). Bank payee is `payment_method.account_name` (can differ from the paying business). `business_id` is the legal registration/tax id — not an Element Pay console id. Base USDC; `network_id` example is National Bank of Kenya (verify via catalog).

**Sandbox:** auto-credits the crypto leg when **`Successful`** is in `customer.business_name` (same pattern as retail `customer.name`) — **do not** send on-chain after accept. Without `Successful`, OffRamp stays `pending_settlement`. See [Sandbox success & failure](/sandbox/success-failure).

```bash theme={null}
quote_and_accept '{
  "order_type": "OffRamp",
  "customer_type": "institution",
  "currency": "KES",
  "country": "KE",
  "crypto_amount": 20,
  "asset": {"token": "'"$BASE_USDC"'", "currency": "USDC", "network": "BASE"},
  "customer": {
    "uid": "sandbox-ke-inst-offramp-001",
    "type": "institution",
    "business_name": "Successful Acme Trading Ltd",
    "business_id": "PVT-1234567A",
    "email": "treasury@acme-trading.example"
  },
  "payment_method": {
    "type": "bank",
    "account_number": "1111111111",
    "account_name": "Acme Payee Holdings Ltd",
    "network_id": "'"$KE_BANK_NETWORK_ID"'"
  },
  "refund_address": "'"$REFUND"'"
}'
```
