invalid_requestFix the JSON body before sending again; do not repeat an unchanged request.
Calculate break-even ROAS, target-profit ROAS, and CPA guardrails from price, costs, fees, and refund reserve.
Authorization: Bearer ecw_live_...
X-API-Key: ecw_live_...X-Quota-Limit: 1000
X-Quota-Remaining: 997
X-RateLimit-Limit: 30Idempotency-Key: order-sync-2026-06-14-001Scope: tools:gtin:generateECOMWITH_API_KEY=ecw_live_...Error responses use error.code and error.message. Handle the status and code first, then decide whether to wait or retry the same business request with its original Idempotency-Key.
invalid_requestFix the JSON body before sending again; do not repeat an unchanged request.
authentication_required / invalid_api_keyCheck Authorization: Bearer or X-API-Key; never put the full key in error logs.
membership_required / insufficient_scopeCheck the current plan and the key scope; a scope cannot increase membership quota.
idempotency_conflict / idempotency_in_progressKeep one key for the same business request; stop on conflict, or wait and retry an active request with the same key.
payload_too_largeReduce the request body to the current plan payload limit before sending again.
quota_exceeded / rate_limited / concurrency_limitedRead X-Quota-*, X-RateLimit-*, and Retry-After; stop at zero quota and wait for rate or concurrency limits.
| Status | error.code | Next step |
|---|---|---|
| 400 | invalid_request | Fix the JSON body before sending again; do not repeat an unchanged request. |
| 401 | authentication_required / invalid_api_key | Check Authorization: Bearer or X-API-Key; never put the full key in error logs. |
| 403 | membership_required / insufficient_scope | Check the current plan and the key scope; a scope cannot increase membership quota. |
| 409 | idempotency_conflict / idempotency_in_progress | Keep one key for the same business request; stop on conflict, or wait and retry an active request with the same key. |
| 413 | payload_too_large | Reduce the request body to the current plan payload limit before sending again. |
| 429 | quota_exceeded / rate_limited / concurrency_limited | Read X-Quota-*, X-RateLimit-*, and Retry-After; stop at zero quota and wait for rate or concurrency limits. |
Error response shape
{"object":"tool_api.error","error":{"code":"invalid_request","message":"Request body must be a JSON object."}}Limits are calculated from the current membership tier of the API key owner. Minute limits are counted separately for each API key and tool; requests beyond the limit return 429 rate_limited. Send requests sequentially and treat quota and rateLimit in each response as the source of truth.
| Plan | API access | Daily quota | Per request | Per minute | How to use it |
|---|---|---|---|---|---|
| Basic | Not included in API access today | Unavailable | Unavailable | Unavailable | If the API returns membership_required, stop and check the account plan. |
| Pro | Included | 1,000 calculations | 1 scenario | 60 requests | One request calculates one product or scenario and does not use a quantity field. Use it to keep ad sheets, product sheets, or internal agents on the same profit formula. |
| Max | Included | 10,000 calculations | 1 scenario | 200 requests | One request calculates one product or scenario and does not use a quantity field. Use it to keep ad sheets, product sheets, or internal agents on the same profit formula. |
Send Requests Sequentially
For the same API key and tool, Ecomwith handles one request at a time. If the API returns 429 concurrency_limited, wait for the previous request to finish and retry with the same Idempotency-Key.
You are my automation agent. Use the Ecomwith Tool API to call the Break-even ROAS API, and never print the full API key.
Authentication:
- Read ECOMWITH_API_KEY from the environment.
- Send Authorization: Bearer <ECOMWITH_API_KEY>.
Request:
- Endpoint: POST https://ecomwith.com/api/v1/tools/break-even-roas/calculate
- Body example: {"price":49,"productCost":14,"shippingCost":6,"paymentFeeRate":4,"refundRate":5,"targetProfit":8}
- One request calculates one product or scenario and consumes 1 calculation unit.
Current limits:
- Pro: 1,000 calculations per day, up to 60 requests per minute.
- Max: 10,000 calculations per day, up to 200 requests per minute.
Rules:
- Send requests sequentially. Do not call the same tool concurrently.
- Use one stable Idempotency-Key per product or scenario, for example break-even-sku-123.
- Handle concurrency_limited, rate_limited, quota_exceeded, and idempotency_conflict by stopping or retrying according to the code.
On success, return result.breakEvenRoas, result.targetProfitRoas, result.maxCpa, result.targetCpa, quota.remaining, and rateLimit.remaining.curl -X POST https://ecomwith.com/api/v1/tools/break-even-roas/calculate \
-H "Authorization: Bearer $ECOMWITH_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: break-even-sku-001" \
-d '{"price":49,"productCost":14,"shippingCost":6,"paymentFeeRate":4,"refundRate":5,"targetProfit":8}'