We publish our API in machine-readable formats, most importantly the OpenAPI specification, specifically so you can hand it to an AI coding assistant and have it work from the real contract instead of guessing. Point your assistant (Claude, Cursor, Copilot, whatever you use) at the spec and it can generate correct request shapes, field names, and error handling without you having to paste every endpoint in by hand.
This page covers how to prime an assistant with our conventions, some example prompts to get you started, and, just as important, what to double-check before you ship what it writes.
Prompt for Your AI Coding Assistant
Most coding assistants let you set a standing project prompt (a system prompt, a .cursorrules file, a CLAUDE.md, or similar) that applies to every request in a session. Put our conventions there once, and the assistant stops re-deriving them (or worse, guessing wrong) on every new function you ask for.
Here's a starting point. Adjust it to your assistant's format, but keep the substance:
You are helping me build an application using the Shopsuey Capital API. Follow these rules:
- OpenAPI spec: Refer to the Shopsuey Capital OpenAPI specification at https://api-795734133708.asia-east1.run.app/openapi.json for all endpoint paths, parameters, and response schemas. Do not guess endpoints or field names.
- Money: Every amount is an integer number of centavos (1 PHP = 100 centavos), never a float or a decimal string. Do all arithmetic in integers and only format to pesos for display.
- Rates: Every rate is an integer number of basis points (100 bps = 1%), never a percentage float.
- Idempotency: Every write to /v1/* must send an Idempotency-Key header so retries are safe.
- Errors: Branch on the response's error.code field, never on error.message, which is for humans and can change.
- Field names: Request and response bodies use snake_case, and requests are strict — reject unknown fields client-side too, so typos surface early.
- Auth: /v1/* requests carry my API key and must only ever be made from my backend, never from a browser or mobile client.
- Webhooks: Verify the X-SSC-Signature header against the raw request body before parsing it as JSON, using a constant-time comparison.
- Environments: Test keys start with rk_test_ and live keys with rk_live_. Default to test keys unless I say otherwise.Example Prompts
With that context loaded, here are the kinds of prompts that tend to produce good results:
- "Write a function that creates an offer for a merchant's pending disbursals, including the
Idempotency-Keyheader, and returns the quoted fee." - "Add a webhook handler for
advance.confirmedandadvance.rejectedevents that verifies theX-SSC-Signatureheader before parsing the body." - "Write a retry wrapper for
POST /v1/advancesthat only retries on5xxand never on4xx." - "Generate a TypeScript type for the advance object from the OpenAPI schema."
- "Explain the difference between
opsandpartnerdisbursal modes and write the code for thepartnerpath."
Prompts that name a specific endpoint, mention idempotency, or reference the OpenAPI schema directly tend to do much better than open-ended ones like "integrate with the Shopsuey Capital API."
Reviewing AI-Generated Code
AI-generated code can look complete and still get something wrong, especially in the details that don't show up until a partner is moving real money. Treat it like a first draft from a new teammate: fast, often right, always worth a second look. Before you ship anything an assistant wrote against this API, check for:
- Money as integer centavos, not floats. Amounts should never be parsed as or stored in a
float/numberwith decimals, and never as a decimal string. - Rates as integer basis points. Same reasoning: no percentage floats.
- An
Idempotency-Keyon every/v1write, generated fresh per logical operation, not reused across retries with different bodies. - Error handling that branches on
error.code, never onerror.messageor an HTTP status alone. snake_casefield names, matching the OpenAPI schema exactly. A hallucinatedcamelCasefield will fail silently against our strict request validation.- Webhook signatures verified against the raw request body (not the re-serialized JSON) with a constant-time comparison. A subtly wrong implementation can look like it works and still be forgeable.
- API keys never hardcoded or shipped to a browser or mobile client.
/v1/*calls must originate from your backend. - Test keys (
rk_test_...) during development, swapped for live keys only when you're actually ready to move real money.
If something looks off, don't just ask the assistant to "fix it". Cross-check the specific endpoint or field against the OpenAPI specification, which is always the source of truth.