CargoLabs Docs

Errors

Every error tells you whether it is your fault, ours, or worth retrying.

Envelope

Endpoints under /api/v1 always return one of two shapes.

Success
{ "success": true, "data": {  }, "message": "Bundle created successfully" }
Error
{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Validation failed" } }

error.code is stable and safe to branch on. error.message is for humans and may change.

Every response, success or error, carries an X-Request-Id header. Include it when you contact support.

Codes

HTTPcodeMeaningRetry?
400VALIDATION_ERRORRequest body failed schema validation.No. Fix the body.
400QUERY_VALIDATION_ERRORA query parameter is out of range or unknown.No.
400INVALID_BUNDLE_IDPath id is not a positive integer.No.
400INVALID_ACCOUNT_IDA stripe-account header was sent but does not start with acct_.No.
400UNSUPPORTED_API_VERSIONAn api-version header was sent that is not v1.No.
400CARD_ERRORThe payment method was declined.Only with a different card.
400INVALID_REQUESTStripe rejected the request.No.
401AUTHENTICATION_ERRORThe connected Stripe account could not be authenticated.No.
403(gateway)Missing, unknown, frozen or deleted API key. Body is { "message": "Forbidden" }.No.
404NOT_FOUNDNo resource with that id.No.
404ROUTE_NOT_FOUNDThe path does not exist. Check the base URL and version.No.
429RATE_LIMIT_ERRORToo many requests.Yes, after Retry-After.
500INTERNAL_ERRORSomething broke on our side.Yes, with backoff.
500API_ERRORStripe returned an error.Yes, with backoff.
503CONNECTION_ERRORStripe was unreachable.Yes, with backoff.

Quote and certificate endpoints

The action-oriented endpoints under /public-quote and /coverport-agency-certs predate the envelope. They return 200 with a JSON body on success. On failure they return a 500 or 502 whose body is the underlying error serialised as JSON. Treat any non-200 from these endpoints as a failure, log the body, and retry idempotent reads. Do not retry a processUserDirectStripePayment call without first checking whether the payment went through.

Idempotency

POST /api/v1/products and POST /api/v1/bundles are not idempotent. If a create call times out, list the resource before retrying so you do not create a duplicate.

On this page