Fees and Payout
Base route: /integration/fees
Auth: API key or request signature.
Both endpoints submit an owner-signed EIP-712 message to the PaymentFactory contract; SodaPop pays the gas. The guide Fees and payout address has the typed data and complete signing code.
Set the withdraw fee
POST /integration/fees/set-meta
| Field | Type | Description |
|---|---|---|
ownerAddress | address | Your wallet; must be the signer. |
chainId | number | Chain to change the setting on. |
feeBps | number | 0–500 (500 = 5%). |
nonce | string | Current nonces(ownerAddress) on the factory. |
deadline | string | Unix seconds (milliseconds are normalized). |
signature | string | EIP-712 SetFee signature. |
curl -X POST "$BASE_URL/integration/fees/set-meta" \
-H 'Content-Type: application/json' \
-H "x-depay-api-key: $SODAPOP_API_KEY" \
-d '{
"ownerAddress": "'"$OWNER_ADDRESS"'",
"chainId": 8453,
"feeBps": 200,
"nonce": "7",
"deadline": "1714203600",
"signature": "0x..."
}'
Response
{
"ownerAddress": "0x501BEF961A6f40E063efD6048768b0BC35ab1428",
"chainId": 8453,
"feeBps": "200",
"nonce": "7",
"deadline": "1714203600",
"txHash": "0x..."
}
Set the payout address
POST /integration/fees/set-payout-meta
Same fields as above, with payoutAddress (address) instead of feeBps and an
EIP-712 SetPayout signature.
Request body
{
"ownerAddress": "0x501BEF961A6f40E063efD6048768b0BC35ab1428",
"chainId": 8453,
"payoutAddress": "0xAaaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa",
"nonce": "8",
"deadline": "1714207200",
"signature": "0x..."
}
The response mirrors the request with payoutAddress and txHash.
Errors
| HTTP | Message | Fix |
|---|---|---|
| 400 | Invalid nonce. Expected X, got Y | Re-read nonces(owner), sign again. |
| 400 | Signature deadline is expired | Use a future deadline (Unix seconds). |
| 400 | feeBps is invalid. Allowed range: 0..500 | Keep the fee within 0–500. |
| 400 | CHAIN_NOT_SUPPORTED | Use a supported chain. |
| 401 | Invalid setFee signature / Invalid setPayout signature | Check the domain (chainId, verifyingContract) and that the owner wallet signed. |
The fee and payout settings share one nonce, so re-read it between consecutive calls.