Skip to content

feat(customers): require businessInfo when creating a business customer - #717

Merged
shreyav merged 1 commit into
mainfrom
07-20-require-business-info
Jul 20, 2026
Merged

feat(customers): require businessInfo when creating a business customer#717
shreyav merged 1 commit into
mainfrom
07-20-require-business-info

Conversation

@shreyav

@shreyav shreyav commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes businessInfo a required field when creating a business customer via POST /customers.

Previously businessInfo was optional on BusinessCustomerCreateRequest, even though the nested object already requires legalName, taxId, and incorporatedOn. A business customer can't be meaningfully onboarded without it, so this tightens the schema to reject requests that omit it entirely.

Changes

  • openapi/components/schemas/customers/BusinessCustomerCreateRequest.yaml — add businessInfo to the required list on the business-specific allOf member. This applies only to the BUSINESS branch of the create request; individual customers are unaffected.
  • Regenerated openapi.yaml and mintlify/openapi.yaml via make build.

make lint passes (only pre-existing, unrelated schema-properties-* warnings remain).

Note: info.version / servers.url are unchanged — the spec date-version tracks published API versions, and bumping it implies a new server path, which is a separate coordinated rollout.

Requested by @shreyav

Original PR: #716

@ls-bolt ls-bolt Bot added bolt breaking-change Introduces a breaking change to the OpenAPI spec labels Jul 20, 2026
@shreyav
shreyav marked this pull request as ready for review July 20, 2026 17:59
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Breaking OpenAPI changes detected

This PR introduces breaking changes to openapi.yaml:

API Changelog 2025-10-13 vs. 2025-10-13

API Changes

POST /customers

  • ⚠️ the request property oneOf[subschema #2: Business Customer Create Request]/allOf[subschema #3]/businessInfo became required

Detected by oasdiff. This PR will need approval from an API reviewer before merge.

@shreyav
shreyav requested a review from pengying July 20, 2026 17:59
@github-actions

github-actions Bot commented Jul 20, 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

fix(types): make BusinessInfo required for business customers

kotlin

fix(types): make businessInfo required in BusinessCustomerCreateRequest

openapi

fix(types): make businessInfo required in business customer schema

php

fix(types): make businessInfo required in BusinessCustomerCreateRequest

python

fix(types): make business_info required in business customer create request

ruby

fix(types): make business_info required in BusinessCustomerCreateRequest

typescript

fix(types): make businessInfo required in BusinessCustomerCreateRequest
⚠️ 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@acc0049901e94bc5ce7664e98a043b347a0808ad
⚠️ 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/bbdddb344661a724295da81f7182f1090aea9cfa/grid-0.0.1-py3-none-any.whl
grid-typescript studio · conflict

Your SDK build had at least one note diagnostic.

grid-php studio · code

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

⚠️ 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-07-20 20:34:38 UTC

@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR tightens the BusinessCustomerCreateRequest schema by adding businessInfo to the required list of the inline allOf member, ensuring the field cannot be omitted when creating a business customer via POST /customers. Both generated bundles (openapi.yaml and mintlify/openapi.yaml) are regenerated and in sync with the source change.

  • Schema change (openapi/components/schemas/customers/BusinessCustomerCreateRequest.yaml): adds required: [businessInfo] to the inline type: object allOf entry that already defined the businessInfo property (referencing BusinessInfo, which itself requires legalName, taxId, and incorporatedOn). Individual customers and the update endpoint are unaffected.
  • Documentation (mintlify/snippets/creating-customers/customers.mdx): the sentence "The only required field for all customers is customerType" is now inaccurate for BUSINESS customers and should be updated to reflect the new requirement.

Confidence Score: 4/5

Safe to merge; the schema change is minimal, correct, and both generated bundles are in sync. One doc snippet carries a now-inaccurate claim about required fields for business customers.

The schema change itself is correct and well-scoped. The only gap is that mintlify/snippets/creating-customers/customers.mdx still says 'The only required field for all customers is customerType', which contradicts the newly enforced businessInfo requirement for business customers and could mislead integrators.

mintlify/snippets/creating-customers/customers.mdx — the customer-type requirements description needs updating.

Important Files Changed

Filename Overview
openapi/components/schemas/customers/BusinessCustomerCreateRequest.yaml Adds required: [businessInfo] to the inline allOf member that already defined the businessInfo property; change is minimal and correctly placed.
openapi.yaml Generated bundle that correctly reflects the source schema change — required field added to BusinessCustomerCreateRequest's inline allOf member.
mintlify/openapi.yaml Mintlify-specific generated bundle; identical change to openapi.yaml, both are in sync.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Client
    participant API as POST /customers
    participant Validator as Schema Validator
    Client->>API: "{customerType: "BUSINESS", ...}"
    API->>Validator: validate against BusinessCustomerCreateRequest
    alt businessInfo omitted (before this PR)
        Validator-->>API: valid (businessInfo was optional)
        API-->>Client: 200 OK
    end
    alt businessInfo omitted (after this PR)
        Validator-->>API: invalid (businessInfo now required)
        API-->>Client: 400 Bad Request
    end
    alt businessInfo provided
        Validator-->>API: valid (legalName, taxId, incorporatedOn required within businessInfo)
        API-->>Client: 200 OK
    end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Client
    participant API as POST /customers
    participant Validator as Schema Validator
    Client->>API: "{customerType: "BUSINESS", ...}"
    API->>Validator: validate against BusinessCustomerCreateRequest
    alt businessInfo omitted (before this PR)
        Validator-->>API: valid (businessInfo was optional)
        API-->>Client: 200 OK
    end
    alt businessInfo omitted (after this PR)
        Validator-->>API: invalid (businessInfo now required)
        API-->>Client: 400 Bad Request
    end
    alt businessInfo provided
        Validator-->>API: valid (legalName, taxId, incorporatedOn required within businessInfo)
        API-->>Client: 200 OK
    end
Loading

Reviews (1): Last reviewed commit: "feat(customers): require businessInfo wh..." | Re-trigger Greptile

@shreyav
shreyav merged commit 1575663 into main Jul 20, 2026
18 checks passed
@shreyav
shreyav deleted the 07-20-require-business-info branch July 20, 2026 20:28
@claude claude Bot mentioned this pull request Jul 21, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bolt breaking-change Introduces a breaking change to the OpenAPI spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants