---
title: "Approve builder fee"
method: POST
path: "/v1/orders/builder-fee/approve"
tags: ["Orders"]
---

# Approve builder fee

`POST /v1/orders/builder-fee/approve`

## Request

- Base URL: `https://api.testnet.rise.trade`
- URL: `https://api.testnet.rise.trade/v1/orders/builder-fee/approve`
- Auth: none required
- TypeScript: <https://skmtc.dev/rise/apis/risex-rest-api/docs/v1/orders/builder-fee/approve/post.ts> (a function with typed inputs; its response is checked against the schema)

Approve a builder's maximum per-order fee ceiling. User signs the approval off-chain; server submits via Router.approveBuilderFee(). Gas sponsored by API service.

Set max_fee_bps=0 to revoke a previously granted approval.

**Permit:** Client signs an EIP-712 `VerifyWitness` permit; the server recovers the signer off-chain and matches it to `permit.signer` (server holds no keys).

**Prerequisites:**
1. `GET /v1/auth/eip712-domain` — EIP-712 domain (`name`, `version`, `chainId`, `verifyingContract` = Authorization contract)
2. `GET /v1/nonce-state/{account}` — `nonce_anchor` and `current_bitmap_index` (pass it as `permit.nonce_bitmap_index`; if 208 the anchor is full — use `nonce_anchor+1` with bitmap index 0)
3. `GET /v1/system/config` — `router` address (RISExUniversalRouter), used as the `target` field below

**Action hash:**
```
actionHash = keccak256(abi.encode(
  keccak256("RISE_APPROVE_BUILDER_FEE_V1"),  // bytes32 action selector
  uint16(builder_id),
  uint16(max_fee_bps)))
```

**Permit digest (EIP-712):**
```
VerifyWitness(address account,address target,bytes32 hash,uint48 nonceAnchor,uint8 nonceBitmap,uint32 deadline)
```
Sign as standard EIP-712 typed data (e.g. ethers `signTypedData`) with `hash` = actionHash, `target` = RISExUniversalRouter address (NOT the account, NOT the domain `verifyingContract`), `nonceBitmap` = `permit.nonce_bitmap_index`.

**Signature:** 64-byte EIP-2098 compact (r + yParityAndS) or 65-byte (r+s+v, auto-converted).

## Request body

- ApiApproveBuilderFeeRequest: Request to approve a builder's max per-order fee ceiling. The signature binding builder_id + max_fee_bps lives in permit.signature (the permit's action hash already covers both values) — there is no separate signer/signature pair.
  - `builder_id` integer: Builder ID (uint16)
  - `max_fee_bps` integer: Max builder fee in parts per million (denominator 1e6, uint16). 100 = 1 bps. 0 = revoke.
  - `permit` ApiPermitParams: Permit parameters for v3 authenticated operations. Client signs EIP-712 VerifyWitness; server builds byte-packed permit suffix. Uses bitmap nonces for replay protection.
    - `account` string: Account address (hex)
    - `signer` string: Signer address (hex)
    - `nonce_anchor` string, uint64: Permit nonce anchor (uint48)
    - `nonce_bitmap_index` integer: Permit nonce bitmap index within the anchor epoch (uint8, valid range 0-207). Despite the uint8 type the contract reverts `InvalidNonceIndex(uint8)` above 207. When `GET /v1/nonce-state/{account}` returns `current_bitmap_index` = 208 the anchor is full — use `nonce_anchor + 1` with index 0.
    - `deadline` integer: Permit deadline (unix timestamp)
    - `signature` string, byte: EIP-2098 compact signature (64 bytes: r + yParityAndS) or standard 65-byte (r+s+v, auto-converted). Protobuf `bytes` — over REST this field is **base64**, not 0x hex. (The `account_signature` / `signer_signature` fields on `/v1/auth/register-signer` are hex strings instead.)

## Response `200`

A successful response.

- ApiApproveBuilderFeeResponse: Response after approving a builder fee ceiling.
  - `tx_hash` string
  - `block_number` string, uint64

## Other responses

- `default`: An unexpected error response.

## Changes

- **2026-11-03** `98eabcd6a6ad`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rise/apis/risex-rest-api/changes/v1/orders/builder-fee/approve/post.md)

---

[API](https://skmtc.dev/rise/apis/risex-rest-api.md) - [All operations](https://skmtc.dev/rise/apis/risex-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rise/apis/risex-rest-api/revisions/98eabcd6a6ad?raw)
