Search Documentation

Search for a documentation page...

Payments API

Check whether a store can take live payments, switch it to live, get the Stripe connect link and call the Stripe API on the store's own account.

A store starts in test mode. Live mode is the money switch: the store takes real orders and payments. It does not decide whether the storefront is visible. That is publishing.

Who can call these endpoints

EndpointStore API keyOAuth connection
GET /api/v1/payments/livesettings:read or store:admin scopeMember with the same permission
POST /api/v1/payments/liveRefused with 403Member allowed to manage the store
POST /api/v1/payments/stripe/connect-linksettings:write scopeMember who may change settings
POST /api/v1/payments/stripe/requestssettings:write scopeRefused with 403

Check live readiness

GET /api/v1/payments/live

Says whether the store is live and what would stop it from switching.

A store can go live once it has:

  • at least one product,
  • a store address,
  • at least one shipping method,
  • a way to take a live payment: Stripe able to charge, a payment add-on such as PayNow or Montonio switched on in production, or bank transfer or cash on delivery,
  • an active billing subscription, on a paid plan.
{
"live": false,
"ready": false,
"blockedBy": ["no shipping methods set up"],
"paymentProviders": ["stripe", "manual"]
}
FieldDescription
liveThe store takes real orders and payments
readytrue when blockedBy is empty
blockedByThe missing steps, in plain English
paymentProvidersHow a shopper could pay once live: frame, przelewy24, paynow, montonio, stripe or manual

Switch to live payments

POST /api/v1/payments/live

Switches the store from test mode to live. It runs the readiness checks first and switches only when nothing blocks.

Taking real money is a team member's decision. Only an OAuth connection made by a member allowed to manage the store can switch. A store API key gets 403. Confirm with the merchant before you call it.

Response (200)Meaning
{ "live": true }Switched
{ "live": true, "alreadyLive": true }The store was already live
{ "live": false, "blockedBy": [...] }Something blocks it. Nothing changed

The switch does not publish the storefront.

POST /api/v1/payments/stripe/connect-link

Returns the link a team member opens to connect the store's Stripe account. Stripe's signup can't be finished through the API, so hand the link to the merchant as it is. It opens the store's dashboard, so it works for a signed-in member who may change settings. The store shows as connected once they finish on Stripe.

{ "url": "https://yns.store/s/acme/manage/stripe-connect/start", "connected": false }

connected is true when the store already has a Stripe account linked. Opening the link again replaces it.

Call the Stripe API

POST /api/v1/payments/stripe/requests

Sends one request to the Stripe API on the store's own connected Stripe account, in the store's current mode (test or live). No other account is reachable. Only the store API key can call it.

Use it for what the store does not track itself: balance and payouts, disputes and evidence, payment and charge details, Stripe customers, invoices, subscriptions, tax and payment method settings, Radar reviews, and the account's business profile and branding.

For orders, refunds, products, prices, customers and coupons, use the store's own endpoints. A change made straight in Stripe does not update the store's records: a refund made here does not show on the order.

FieldTypeRequiredDescription
method"GET" | "POST" | "DELETE"YesGET reads, POST creates or updates, DELETE deletes
pathstringYesA Stripe REST path starting with /v1/, without a query string
queryobjectNoQuery parameters for GET and DELETE, with Stripe's bracket keys, such as { "limit": 10, "created[gte]": 1767225600, "expand": ["data.customer"] }
bodyobjectNoPOST fields as nested JSON, such as { "evidence": { "customer_name": "Ada" } }
curl -X POST \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"method":"GET","path":"/v1/disputes","query":{"limit":5}}' \
https://your-store.yns.store/api/v1/payments/stripe/requests

The response is { "result": … } with Stripe's answer, or { "truncated": true, "id", "object", "note" } when the answer is too large to return. Keep list reads small with limit.

The store's account is GET /v1/account. Update it with POST /v1/accounts/<its id>: only business_profile, settings and metadata. POST and DELETE change the merchant's Stripe account, so confirm with them first.

Errors

StatusDescription
400Invalid body, a refused path (Connect platform endpoints, webhooks, files, API keys, card and bank numbers), a store without a connected Stripe account, or Stripe refused the request. Stripe's message is passed on
403Called over OAuth, or the API key lacks the settings:write scope
504Stripe did not answer in time. A change may still have gone through
  • Store Setup – the setup checklist that leads up to going live
  • Settings – the store address and other settings readiness checks