202 and an operationId. Poll the operation for onchain
confirmation.
- Scope:
portfolios:withdrawon both stages. - Idempotency anchor: Stage 1 returns
message.nonce. The response also shows this value asauthorizationId. - Authorization TTL: 10 minutes from stage-1 response.
- Request limit: One recipient on one chain. Use separate authorizations for multiple chains.
Sequence
Stage 1: Prepare the authorization
POST /v2/portfolios/{portfolioId}/withdraw/signature
Glider validates the request and checks the live onchain balances. Then, it
returns the EIP-712 typed data, a nonce, and a 10-minute expiry.
Exceptions to the B2B API conventions
EIP-712 requires two exceptions inside the signed envelope:domain.verifyingContractis a bare EVM address. It is not a CAIP-10 identifier. The wallet shows this value during signing.message.expiresAtis Unix seconds as a number, not an ISO-8601 string. Typed-data hashing is binary.
data.expiresAt value
is an ISO-8601 string.
Recipient rules
- Use a chain-bound CAIP-10 value (
eip155:<chainId>:<addr>). A chain-agnostic value returnsAPI_211. - Make sure that the recipient chain matches each asset chain. A mismatch
returns
API_213. - Make sure that the portfolio has a smart account on the recipient chain.
A missing account returns
API_215.
Stage 2: Sign and submit
The user signstypedData with signTypedData in their wallet. Pass the full
object to the wallet library. Viem, ethers, wagmi, and Privy accept this
shape.
typedData.message to
POST /v2/portfolios/{portfolioId}/withdraw. Send typedData.message
unchanged as body.message.
Echo the inner message exactly
body.message must equal the full stage-1 typedData.message. Keep it
byte-for-byte unchanged. These changes cause verification to fail:
- Re-serializing
amountRawas a number instead of a string. - Changing
noncecasing or stripping the0xprefix. - Changing the order of
assets[]. Array order is part of the hash. - Recomputing
expiresAtas an ISO string instead of the original Unix seconds integer.
Stage 3: Poll for onchain confirmation
Stage 2 returns202 and starts an asynchronous transfer. Poll the operation:
completed, failed, or
cancelled.
Error handling
See Idempotency for the full 409 model.
Common errors
- Do not omit
messagefrom stage 2. Send the fulltypedData.message. - Do not change the order of
assetsin stage 2. Array order changes the typed-data hash. - Do not wait more than 10 minutes between stages. An expired
authorization returns
API_216. Start again at stage 1. - Do not convert
message.expiresAtto an ISO string. This field uses Unix seconds. Usedata.expiresAtfor an ISO-8601 display value.