Skip to content

docs(openapi): region and currencies resolve independently on customer create - #789

Merged
JasonCWang merged 1 commit into
mainfrom
jason/customer-create-region-currencies
Aug 3, 2026
Merged

docs(openapi): region and currencies resolve independently on customer create#789
JasonCWang merged 1 commit into
mainfrom
jason/customer-create-region-currencies

Conversation

@JasonCWang

@JasonCWang JasonCWang commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Reason

Create-customer required region and currencies to be sent together or not at all, but the spec never said so — it documented the two as independently conditional and promised currencies could be inferred from region. lightsparkdev/webdev#31313 removes the both-or-neither rule from the handler: currencies pin the payment configuration on their own, and region is only a tiebreaker. This brings the API surface in line.

Overview

CustomerCreateRequest.yaml:

  • region — drops the both-or-neither requirement, the "determines the regulatory jurisdiction and KYC requirements" claim, and "immutable after creation". Nothing persists the field. Now described by what it is actually for: optional, and only needed to say which region applies when the same currency is offered in more than one of yours.
  • currencies — drops "currencies will be inferred from the customer's region" as the only fallback. Now: optional, send them if your platform supports more than one currency; some combinations require separate customers.

Both are two plain sentences aimed at an integrator, rather than describing the resolution mechanism.

paths/customers/customers.yaml gains a create example with currencies and no region. Worth noting the existing individualCustomerInferred example (region, no currencies) was rejected by the old rule — the examples already assumed the behavior #31313 implements.

Two related things deliberately not here:

  • The region text describes the intended end state. Today unique(platform_id, currency_code) means one currency cannot be served by two switches on a platform, so region currently narrows across different currencies' jurisdictions instead. #31313's docstring TODO is the re-key to (platform, currency, jurisdiction) that makes the described behavior literal.
  • Customer.yaml documents region and currencies on the customer response, but neither is ever populated. Removing them is an oasdiff response-property-removed ERR, so it wants its own change.

Test Plan

  • npm run lint:openapi — redocly lint clean, spectral clean at --fail-severity=error, bundles regenerated into openapi.yaml and mintlify/openapi.yaml.
  • Description- and example-only, so there is nothing for the breaking-changes workflow to flag; the Detect breaking changes run on this PR confirms it. oasdiff could not be run locally (pinned v1.16.0 needs go >= 1.26; the docker image is OOM-killed on the bundle), so CI is the check.
  • Behavior itself is covered by the tests in lightsparkdev/webdev#31313; this should land with or after that merge, since until then it describes behavior the API does not have yet.

🤖 Generated with Claude Code

@mintlify

mintlify Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Grid 🟢 Ready View Preview Aug 3, 2026, 10:05 PM

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Aug 3, 2026 11:07pm
grid-wallet-demo Ignored Ignored Preview Aug 3, 2026 11:07pm

Request Review

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

✱ Stainless preview builds for grid

This PR will update the grid SDKs with the following commit messages.

cli

chore(internal): regenerate SDK with no functional changes

go

docs(api): update region and currencies parameter descriptions in customer create requests

kotlin

docs(api): clarify currencies and region parameters in customer creation requests

openapi

docs(api): clarify region/currencies optional in customer creation, add example

php

docs(api): clarify currencies and region parameters in customer create requests

python

docs(api): update currencies and region descriptions in customer create requests

ruby

docs(api): update currencies and region descriptions in customer create requests

typescript

docs(api): update currencies and region parameter descriptions in customers
⚠️ grid-openapi studio · code

Your SDK build had at least one "warning" diagnostic.
generate ⚠️

grid-ruby studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

⚠️ grid-go studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ❗

go get github.com/stainless-sdks/grid-go@5df0141f6eac7b003e5cc1adca5865c8ccc17521
⚠️ grid-kotlin studio · code

Your SDK build had a failure in the test CI job, which is a regression from the base state.
generate ⚠️build ✅lint ✅test ❗

⚠️ grid-python studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ❗

pip install https://pkg.stainless.com/s/grid-python/d0ceecf0208355999ad14fcc5c9c5a43b910e8c8/grid-0.0.1-py3-none-any.whl
grid-php studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅lint ✅test ✅

grid-typescript studio · conflict

Your SDK build had at least one note diagnostic.

⚠️ grid-cli studio · code

Your SDK build had a failure in the test CI job, which is a regression from the base state.
generate ⚠️build ⏭️lint ⏭️test ❗


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-08-03 23:40:02 UTC

…r create

Create-customer required `region` and `currencies` to be sent together or not
at all. lightsparkdev/webdev#31313 drops that rule: currencies pin the payment
configuration on their own, and region is only a tiebreaker.

- `region`: drop the both-or-neither requirement, the regulatory-jurisdiction
  claim, and "immutable after creation" — nothing persists the field. Described
  as what it is for: disambiguating a currency offered in more than one region.
- `currencies`: drop "inferred from the customer's region" as the only fallback.
- Add a create example with currencies and no region. The existing
  `individualCustomerInferred` example (region, no currencies) was rejected by
  the old rule, which is part of why the rule was wrong.

Description- and example-only, so there is nothing for oasdiff to flag.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the customer-create contract so region and currencies are documented as independently optional and adds a currencies-only request example.

  • Reframes region as an optional configuration-selection tiebreaker.
  • Clarifies when integrators should supply currencies.
  • Regenerates both committed OpenAPI bundles from the modular source.
  • Leaves the CLI’s region help inconsistent with the updated contract.

Confidence Score: 4/5

The PR appears safe to merge with the coordinated backend rollout, though the customer CLI help should be aligned with the new region semantics.

The source schema, example, and generated bundles are internally consistent; the remaining issue is non-blocking contradictory documentation in the CLI.

Files Needing Attention: openapi/components/schemas/customers/CustomerCreateRequest.yaml and cli/src/commands/customers.ts

Important Files Changed

Filename Overview
openapi/components/schemas/customers/CustomerCreateRequest.yaml Updates the two field descriptions correctly for the intended backend behavior, but exposes contradictory region semantics in the CLI help.
openapi/paths/customers/customers.yaml Adds a well-formed currencies-without-region example demonstrating the newly supported request shape.
openapi.yaml Root generated bundle consistently reflects the modular schema and example changes.
mintlify/openapi.yaml Mintlify’s generated bundle consistently reflects the source OpenAPI changes.
Prompt To Fix All With AI
### Issue 1
openapi/components/schemas/customers/CustomerCreateRequest.yaml:13-16
**Region semantics conflict with CLI**

The updated schema describes `region` solely as an optional configuration-selection tiebreaker, while the customer CLI still calls it immutable after creation. This gives users conflicting guidance about whether the value becomes durable customer state.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "docs(openapi): region and currencies res..." | Re-trigger Greptile

Comment on lines 13 to +16
description: >-
Country code (ISO 3166-1 alpha-2) representing the customer's regional identity.
This determines the regulatory jurisdiction and KYC requirements for the customer.
Required if the customer will use currencies with different KYC requirements across
regions. A customer with accounts in multiple regions should be registered as separate
customers. This field is immutable after creation.
Country code (ISO 3166-1 alpha-2) for the customer's region. Optional — send
it only when the same currency is offered in more than one of your regions,
to pick the one that applies to this customer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Region semantics conflict with CLI

The updated schema describes region solely as an optional configuration-selection tiebreaker, while the customer CLI still calls it immutable after creation. This gives users conflicting guidance about whether the value becomes durable customer state.

Knowledge Base Used:

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/CustomerCreateRequest.yaml
Line: 13-16

Comment:
**Region semantics conflict with CLI**

The updated schema describes `region` solely as an optional configuration-selection tiebreaker, while the customer CLI still calls it immutable after creation. This gives users conflicting guidance about whether the value becomes durable customer state.

**Knowledge Base Used:**
- [Customers and KYC](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/customers-and-kyc.md)
- [OpenAPI Spec Core: Structure, Build, and Shared Schemas](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/openapi-spec-core.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@JasonCWang
JasonCWang merged commit 854c805 into main Aug 3, 2026
10 checks passed
@JasonCWang
JasonCWang deleted the jason/customer-create-region-currencies branch August 3, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants