Skip to content

feat(api): add GET /batches/{batch_id} endpoint#5462

Merged
martinconic merged 1 commit into
masterfrom
feat/batches-by-id
May 15, 2026
Merged

feat(api): add GET /batches/{batch_id} endpoint#5462
martinconic merged 1 commit into
masterfrom
feat/batches-by-id

Conversation

@martinconic
Copy link
Copy Markdown
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Closes #5458.

Adds the singular companion to GET /batches so callers can fetch a
single globally-visible postage batch by ID in O(1) instead of pulling
the entire batch set client-side. Mirrors the existing
/stamps/{batch_id} pattern: 32-byte ID path param, batchStore.Get
lookup, 404 on ErrNotFound, 200 with PostageBatchShort otherwise.

OpenAPI spec bumped 8.0.0 -> 8.1.0 (backwards-compatible new endpoint).

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

@martinconic martinconic self-assigned this May 13, 2026
@martinconic martinconic added this to the 2026 milestone May 13, 2026
Copy link
Copy Markdown
Contributor

@akrem-chabchoub akrem-chabchoub left a comment

Choose a reason for hiding this comment

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

Looks good

Comment thread pkg/api/postage.go
@martinconic martinconic merged commit c770f90 into master May 15, 2026
15 checks passed
@martinconic martinconic deleted the feat/batches-by-id branch May 15, 2026 10:19
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.

Add new /batches/:batchId endpoint

3 participants