Browse

conflict error

conflict is returned with HTTP 409. Retryable: no. Sending the same request again returns the same error. Nothing is charged for this error.

What it means

The request conflicts with the current state of the resource.

Most likely cause

The request clashes with the state of the account. The usual case is starting a checkout for a subscription plan when the account already has a subscription: one account holds one subscription, so a second purchase is refused instead of charging twice.

How to fix it

Fetch the resource again, check its current state, then resend if the change still applies.

Example

Checkout uses the signed-in dashboard session token, not an API key. For an account that already has a subscription, this call returns HTTP 409. Change or cancel the plan in the billing portal.

Terminal
curl -i -X POST https://YOUR_API_HOST/v1/me/billing/checkout -H "Authorization: Bearer $FIREBASE_ID_TOKEN" -H "Content-Type: application/json" -d '{"offer":"starter"}'

An error response is one JSON envelope. Branch on code, never on the message text. The message and fix of a real response can be more specific than the defaults shown here.

{
  "error": {
    "code": "conflict",
    "message": "The request conflicts with the current state of the resource.",
    "fix": "Fetch the resource again, check its current state, then resend if the change still applies.",
    "docs_url": "https://lookvalid.com/docs/errors/conflict",
    "retryable": false,
    "request_id": "req_3fK9pQ2xVb7LmN4sTz8WcA"
  }
}

See also