Invoice metadata#2
Open
kirushik wants to merge 3 commits into
Open
Conversation
Stored verbatim, echoed in responses and webhook payloads, capped at 8192 bytes serialized; update replaces it (cart semantics). Matches the daemon implementation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Error schema required a phantom 'type' field it never defined and constrained 'category' to a 3-value lowercase enum the daemon doesn't emit. Now requires [code, message], 'category' is free-form (daemon emits SCREAMING_SNAKE) — making both the existing examples and the new metadata_too_large example valid. - metadata is sticky on update (omitting keeps the stored value), must be a JSON object, and is stripped from the public payment-page endpoint — matching the daemon implementation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the Merchant API v3 OpenAPI spec to document an optional opaque metadata object on invoices/orders, supporting TiendaNube integration requirements.
Changes:
- Adds
metadatato theInvoice,CreateInvoiceRequest, andUpdateInvoiceRequestschemas with size/behavior notes. - Documents a new validation error example for oversized metadata (
metadata_too_large/INVOICE_METADATA_TOO_LARGE). - Adjusts the
Errorschema documentation arounderror.category(now described as free-form).
Comments suppressed due to low confidence (1)
kalatori-merchant-api-v3.yaml:496
- This example also uses
type, while theErrorschema defineserror.category. Keeping examples consistent with the schema helps avoid ambiguity for integrators.
value:
error:
type: "invalid_request_error"
code: "validation_failed"
message: "Request validation failed"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address PR #2 review comments: replace the phantom `type`/`param`/ `validation_errors` fields and lower_snake codes in examples with the `category` + SCREAMING_SNAKE `code` envelope the daemon actually emits, document that update-not-allowed is a 409, and note explicitly that `metadata` is always omitted from /public/invoice responses. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For TiendaNube integration to work (as implemented in https://github.com/Kalapaja/konductor/pull/189), our daemons should support an opaque "metadata" field on orders.
This documents this extra API parameter as a part of v3 API spec