Developers

Errors

What the API answers when a call fails, and what to do about it.

When a call fails, SKUFlow answers with an HTTP status and a JSON body that says what went wrong in words you can show to a person:

{
	"defined": false,
	"code": "PLAN_UPGRADE_REQUIRED",
	"status": 402,
	"message": "This needs the Grow plan or higher. Upgrade in Settings → Billing.",
	"data": {
		"feature": "online_stores",
		"requiredPlan": "grow",
		"requiredAddon": null,
		"currentPlan": "connect"
	}
}
  • code is stable: branch on it, not on the message.
  • message is written for people. It often says what to do next.
  • data carries details for some codes (below). It may be missing.

Status codes

StatusCodeWhat it meansWhat to do
400BAD_REQUESTThe input is not valid: a missing field, a wrong format, a value out of range, or a rule the record breaks.Fix the input. For validation errors, data.issues lists each field.
401UNAUTHORIZEDNo credential, or the key is wrong, revoked or expired.Check the Authorization: Bearer skf_… header. Make a new key if this one was revoked.
402PLAN_UPGRADE_REQUIREDThe business's plan doesn't include this (the API itself needs Pro).Upgrade, or add the add-on named in data.requiredAddon.
402PLAN_LIMIT_REACHEDA plan limit is used up: AI credits this month, texts or emails past the cap, or every user seat is taken.Buy AI credits, wait for the month to reset, or change plan in Settings → Plan and billing.
403FORBIDDENYour role, the key's permissions or its access level don't allow this, or a key can't do it at all.Read the message: it names the missing permission or scope. See Authentication.
404NOT_FOUNDNo such record in this business (or one your role can't see).Check the id and the business id in the path.
409CONFLICTThe record's state doesn't allow it (an invoice already paid, a duplicate), or an Idempotency-Key clash.Read the record again, then decide.
409APPROVAL_DECLINEDYou declined this call in SKUFlow.Don't retry unless you change your mind.
409APPROVAL_EXPIREDThe approval request expired before it was approved or used.Call again without the approval header to ask again.
409APPROVAL_ALREADY_RUNThat approval was already used. An approval runs once.Read the record to see the result.
409CONFIRMATION_INVALIDThe approval header doesn't match this exact call (other inputs, endpoint, key or business).Repeat the call exactly as it was approved, or ask again.
413PAYLOAD_TOO_LARGEThe request body is over 40 MB.Send less, or upload files by URL.
428APPROVAL_REQUIREDThis action waits for a person's approval in SKUFlow. Nothing was done yet.See Approvals.
429TOO_MANY_REQUESTSToo many calls in a minute.Slow down and retry. See Rate limits.
500INTERNAL_SERVER_ERRORSomething broke on our side. It is reported to us automatically.Retry later. Use an Idempotency-Key on writes so a retry is safe.
503SERVICE_UNAVAILABLEA part of SKUFlow, or a service it relies on, is briefly unavailable.Retry in a moment.

Validation errors

A 400 from input validation lists every problem in message (field: what's wrong; …) and in data.issues, with the path to each field:

{
	"code": "BAD_REQUEST",
	"status": 400,
	"message": "dueDate: Use a date as YYYY-MM-DD",
	"data": {
		"issues": [{ "path": ["dueDate"], "message": "Use a date as YYYY-MM-DD" }]
	}
}

Plan errors in detail

402 PLAN_UPGRADE_REQUIRED names what's needed in data:

FieldMeaning
featureThe feature the call needs, such as online_stores or business_units.
requiredPlanThe cheapest plan that has it (connect, grow, pro), or null for an add-on-only feature.
requiredAddonThe add-on that sells it (such as phone), or null.
currentPlanThe plan the business is on.

402 PLAN_LIMIT_REACHED has data.feature (such as ai_credits or office_users) and, for spending limits, data.reason. When SKUFlow can't check the plan for a moment, anything that costs money is paused with this code too; try again in a few minutes.

Inside the app, reads are not blocked by the plan: after a downgrade you can still read and export what you made. With an API key, every call needs the Pro plan, reads included.

Approval errors in detail

428 APPROVAL_REQUIRED carries what you need to finish the call in data:

FieldMeaning
statusAPPROVAL_PENDING.
approvalIdThe request's id.
tokenThe value to send back in the X-SKUFlow-Approval header, sfc_….
summaryWhat the person is asked to approve, in words.
expiresAtWhen the request expires if nobody decides.
approvalUrlThe SKUFlow page where the person approves it.
headerX-SKUFlow-Approval.

See Approvals for the whole flow.

On this page