make platformCustomerId optional on create customer#345
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript ✅ grid-python studio · code
✅ grid-typescript studio · code
✅ grid-kotlin studio · code
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryThis PR makes Confidence Score: 5/5Safe 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
|
| 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]
Comments Outside Diff (1)
-
mintlify/snippets/creating-customers/customers.mdx, line 229-231 (link)Idempotency best practice now incomplete
The "Idempotent operations" tip says to use
platformCustomerIdconsistently 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 omittingplatformCustomerIdremoves 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.
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
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>
## 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>

No description provided.