precondition_unmet
Error cause indicating a required precondition must be satisfied before the requested operation can proceed.
What this means
The Commerce API operation you're attempting requires certain conditions or prior state to be established before it can proceed, and those prerequisites are not currently satisfied. This error cause appears when the operation is valid and your parameters are correct, but the system state doesn't allow the operation at this moment. For example, completing an order when it hasn't been paid yet—completion requires payment as a precondition. Similarly, scheduling a payout before you've configured payout destinations, or trying to charge a payment method before it has been verified when verification is required.
The error detail field will identify which specific precondition is unmet, guiding you to perform the necessary prerequisite operation first. Once you satisfy the precondition by calling the appropriate endpoint or waiting for a state transition, retrying your original request should succeed.
Example error response
{
"error": {
"type": "invalid_request_parameter",
"cause": "precondition_unmet",
"code": "1745",
"message": "order not paid",
"detail": "Cannot complete order `or_abc123` because it has not been paid. Pay for the order first to satisfy this precondition.",
"fix_code": "satisfy_precondition",
"url": "https://commerce.zebo.dev/e/1745"
}
}
Related errors
- satisfy_precondition - Fix code for this cause