Skip to main content

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

FieldTypeDescription
ownerAddressaddressYour wallet; must be the signer.
chainIdnumberChain to change the setting on.
feeBpsnumber0–500 (500 = 5%).
noncestringCurrent nonces(ownerAddress) on the factory.
deadlinestringUnix seconds (milliseconds are normalized).
signaturestringEIP-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​

HTTPMessageFix
400Invalid nonce. Expected X, got YRe-read nonces(owner), sign again.
400Signature deadline is expiredUse a future deadline (Unix seconds).
400feeBps is invalid. Allowed range: 0..500Keep the fee within 0–500.
400CHAIN_NOT_SUPPORTEDUse a supported chain.
401Invalid setFee signature / Invalid setPayout signatureCheck 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.