Skip to content

make platformCustomerId optional on create customer#345

Merged
shreyav merged 1 commit intomainfrom
04-15-make_platformcustomerid_optional_on_create_customer
Apr 16, 2026
Merged

make platformCustomerId optional on create customer#345
shreyav merged 1 commit intomainfrom
04-15-make_platformcustomerid_optional_on_create_customer

Conversation

@shreyav
Copy link
Copy Markdown
Contributor

@shreyav shreyav commented Apr 16, 2026

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

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

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment Apr 16, 2026 4:26am

Request Review

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented Apr 16, 2026

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

Project Status Preview Updated (UTC)
Grid 🟢 Ready View Preview Apr 16, 2026, 4:27 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Copy link
Copy Markdown
Contributor Author

shreyav commented Apr 16, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@shreyav shreyav marked this pull request as ready for review April 16, 2026 04:26
@shreyav shreyav requested a review from pengying April 16, 2026 04:26
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

✱ Stainless preview builds

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

kotlin

fix(types): make platformCustomerId optional in customer create types

openapi

fix(types): make platformCustomerId optional in IndividualCustomerFields

python

fix(types): make platform_customer_id optional in CustomerCreateParam

typescript

fix(types): make platformCustomerId optional in customers
grid-openapi studio · code

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

grid-python studio · code

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

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

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

npm install https://pkg.stainless.com/s/grid-typescript/9b479b153728bb10419c7430f3eec7b40dfc79c3/dist.tar.gz
grid-kotlin studio · code

Your SDK build had at least one "note" diagnostic.
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-04-16 20:33:13 UTC

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 16, 2026

Greptile Summary

This PR makes platformCustomerId optional on the POST /customers endpoint by removing it from the required array in CustomerCreateRequest.yaml and updating both OpenAPI bundles and documentation to reflect the new behavior (the system will auto-generate an ID if one is not supplied).

Confidence Score: 5/5

Safe to merge — schema change is correct and documentation is accurate; one minor doc improvement suggested.

All three artifacts (source schema, generated bundles, and docs) are updated consistently. The only finding is a P2 documentation suggestion about the idempotency best practice not being updated to reflect the new optional behavior.

mintlify/snippets/creating-customers/customers.mdx — best practices section could be improved

Important Files Changed

Filename Overview
openapi/components/schemas/customers/CustomerCreateRequest.yaml Removes platformCustomerId from required; existing field description already documents auto-generation behavior.
openapi.yaml Generated bundle correctly rebundled to reflect source schema change (same single-line removal).
mintlify/openapi.yaml Mintlify copy of the generated bundle correctly updated to match.
mintlify/snippets/creating-customers/customers.mdx Documentation updated to describe platformCustomerId as optional; the "Idempotent operations" best practice note further down is not updated to reflect that omitting the field loses idempotency.
mintlify/global-p2p/onboarding-customers/configuring-customers.mdx Page-level copy of the same documentation update; consistent with the snippet change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[POST /customers] --> B{platformCustomerId\nprovided?}
    B -- Yes --> C[Use supplied platformCustomerId]
    B -- No --> D[System generates platformCustomerId]
    C --> E[Create customer record]
    D --> E
    E --> F[Return customer object\nwith platformCustomerId]
    F --> G{Retry on\nnetwork failure?}
    G -- With same platformCustomerId --> H[⚠️ May create duplicate\nno built-in deduplication]
    G -- With same platformCustomerId\n provided by caller --> I[Caller can use ID\nto detect duplicates]
Loading

Comments Outside Diff (1)

  1. mintlify/snippets/creating-customers/customers.mdx, line 229-231 (link)

    P2 Idempotency best practice now incomplete

    The "Idempotent operations" tip says to use platformCustomerId consistently to avoid duplicate customers, but now that the field is optional and auto-generated, a caller who omits it on a retry (e.g., after a network timeout) will silently create a second customer with a different system-generated ID. The note should warn that omitting platformCustomerId removes the idempotency guarantee.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: mintlify/snippets/creating-customers/customers.mdx
    Line: 229-231
    
    Comment:
    **Idempotency best practice now incomplete**
    
    The "Idempotent operations" tip says to use `platformCustomerId` consistently to avoid duplicate customers, but now that the field is optional and auto-generated, a caller who omits it on a retry (e.g., after a network timeout) will silently create a second customer with a different system-generated ID. The note should warn that omitting `platformCustomerId` removes the idempotency guarantee.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Claude Code

Fix All in Claude Code

Prompt To Fix All With AI
This is a comment left during a code review.
Path: mintlify/snippets/creating-customers/customers.mdx
Line: 229-231

Comment:
**Idempotency best practice now incomplete**

The "Idempotent operations" tip says to use `platformCustomerId` consistently to avoid duplicate customers, but now that the field is optional and auto-generated, a caller who omits it on a retry (e.g., after a network timeout) will silently create a second customer with a different system-generated ID. The note should warn that omitting `platformCustomerId` removes the idempotency guarantee.

```suggestion
1. **Regular updates**: Keep customer information up to date, especially banking details
1. **Error handling**: Implement proper error handling to manage validation failures gracefully
1. **Idempotent operations**: Provide a `platformCustomerId` on every create request and use it consistently — this is the only way to avoid duplicate customer creation on retries. If you omit it, the system generates a unique ID each time and there is no built-in deduplication.
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "make platformCustomerId optional on crea..." | Re-trigger Greptile

@shreyav shreyav merged commit 285910b into main Apr 16, 2026
9 checks passed
@shreyav shreyav deleted the 04-15-make_platformcustomerid_optional_on_create_customer branch April 16, 2026 20:26
claude Bot pushed a commit that referenced this pull request Apr 17, 2026
Sync Kotlin sample with schema change from #345. The field is now
optional with auto-generation when not provided.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
shreyav pushed a commit that referenced this pull request Apr 17, 2026
## Summary
- Update Kotlin sample to treat `platformCustomerId` as optional,
syncing with schema change from #345
- Remove unused `requireText` import

## Context
The schema change in #345 made `platformCustomerId` optional on customer
creation (if not provided, one is auto-generated). The Mintlify docs
were updated in that same PR, but the Kotlin sample still used
`requireText()` which would throw an error if the field was missing.

## Test plan
- [ ] Verify Kotlin sample compiles
- [ ] Test customer creation without `platformCustomerId` in request
body

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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