Skip to content

fix: add missing /v1/ prefix in getEmbedUrl URL path#645

Merged
mirek26 merged 1 commit intolithic-com:nextfrom
tonymike99:fix/get-embed-url-v1-prefix
Mar 17, 2026
Merged

fix: add missing /v1/ prefix in getEmbedUrl URL path#645
mirek26 merged 1 commit intolithic-com:nextfrom
tonymike99:fix/get-embed-url-v1-prefix

Conversation

@tonymike99
Copy link
Copy Markdown
Contributor

Summary

CardService.getEmbedUrl() and CardServiceAsync.getEmbedUrl() produce an incorrect Embedded Card UI URL — <baseUrl>/embed/card?... — missing the required /v1/ API version prefix.

  • Expected: https://api.lithic.com/v1/embed/card?embed_request=...&hmac=...
  • Actual: https://api.lithic.com/embed/card?embed_request=...&hmac=...

Per the Embedded Card UI docs, the endpoint is GET https://api.lithic.com/v1/embed/card.

Root cause

This is the same class of bug that was previously fixed for getEmbedHtml() in commit 6659ab9. That commit corrected addPathSegments("embed", "card")addPathSegments("v1", "embed", "card") in the getEmbedHtml method.

However, getEmbedUrl() was missed because it uses a different URL construction mechanism — manual buildString { append("embed/card") } concatenation instead of HttpRequest.builder().addPathSegments(...) — making it invisible to a targeted search for the pattern fixed in 6659ab9.

Changes

  • CardServiceImpl.kt: append("embed/card")append("v1/embed/card")
  • CardServiceAsyncImpl.kt: append("embed/card")append("v1/embed/card")

Test plan

  • Verified clientOptions.baseUrl() defaults (https://api.lithic.com, https://sandbox.lithic.com) do not include /v1, so no double-prefix risk
  • Verified consistency with sibling methods embed() and getEmbedHtml() which already use addPathSegments("v1", "embed", "card")
  • Verified against Embedded Card UI docs confirming GET /v1/embed/card
  • Existing callGetEmbedUrl test continues to pass (asserts contains("hmac"))

getEmbedUrl() builds the Embedded Card UI iframe URL via manual string
concatenation and was producing <baseUrl>/embed/card?... instead of
<baseUrl>/v1/embed/card?.... This is the same class of bug that was
fixed for getEmbedHtml() in commit 6659ab9, but getEmbedUrl() was
missed because it uses buildString rather than HttpRequest.builder()
with addPathSegments.
@mirek26 mirek26 changed the base branch from main to next March 17, 2026 15:34
@mirek26 mirek26 merged commit 7f06652 into lithic-com:next Mar 17, 2026
4 checks passed
stainless-app bot pushed a commit that referenced this pull request Mar 17, 2026
getEmbedUrl() builds the Embedded Card UI iframe URL via manual string
concatenation and was producing <baseUrl>/embed/card?... instead of
<baseUrl>/v1/embed/card?.... This is the same class of bug that was
fixed for getEmbedHtml() in commit 6659ab9, but getEmbedUrl() was
missed because it uses buildString rather than HttpRequest.builder()
with addPathSegments.
@stainless-app stainless-app bot mentioned this pull request Mar 17, 2026
@mirek26
Copy link
Copy Markdown
Contributor

mirek26 commented Mar 17, 2026

@tonymike99 apologies for the issue and thanks for the fix - this will go out with the next release

stainless-app bot pushed a commit that referenced this pull request Mar 18, 2026
getEmbedUrl() builds the Embedded Card UI iframe URL via manual string
concatenation and was producing <baseUrl>/embed/card?... instead of
<baseUrl>/v1/embed/card?.... This is the same class of bug that was
fixed for getEmbedHtml() in commit 6659ab9, but getEmbedUrl() was
missed because it uses buildString rather than HttpRequest.builder()
with addPathSegments.
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