Error Handling
Token Request Errors
401 Unauthorized:
- Invalid client_id or client_secret
- Solution: Verify your credentials
400 Bad Request:
- Missing required fields
- Solution: Ensure grant_type, client_id, and client_secret are provided
Contract Creation Errors
401 Unauthorized:
- Invalid or expired access token
- Solution: Request a new token
400 Bad Request:
- Missing required fields
- Invalid field values
- Check `validationErrors` array in response for details
Example Error Response:
{
"message": "Validation failed",
"status": 400,
"validationErrors": [
{
"field": "amount",
"message": "Amount must be greater than 0"
}
]
}
Contract Fee Errors
These errors relate to setting your platform fee on a contract. See Contract Fees for the full guide.
| HTTP | Code | Message | Cause |
|---|---|---|---|
| 403 | 1887 | ContractLevelFeeNotEligible | You sent a fee field, but contract-level fee is not enabled |
| 400 | — | BuyerOrSellerFeeRequired | contract-level fee is enabled, but no fee was specified |
| 400 | — | NoFeesAppliedCannotCombineWithFees | noFeesApplied sent together with a fee percentage |
| 400 | — | BuyerFeePercentageOutOfRange | buyerFeePercentage is outside 0–100 |
| 400 | — | SellerFeePercentageOutOfRange | sellerFeePercentage is outside 0–100 |
403 · ContractLevelFeeNotEligible (code 1887)
- You sent
buyerFeePercentage,sellerFeePercentageornoFeesAppliedbut your account uses the fee agreed with WePay for every contract. - Solution: remove the fee fields, or contact WePay to enable contract-level fee for your account.
400 · BuyerOrSellerFeeRequired
- contract-level fee is enabled for your account, so WePay expects you to state the fee on every contract. It does not fall back to your agreed fee.
- Solution: send
buyerFeePercentageand/orsellerFeePercentage. If you intend to charge nothing on this contract, sendnoFeesApplied: true.