Skip to content

Fix weclapp connector: migrate to API v2 (/party replaces /customer) - #143

Merged
keysersoft merged 2 commits into
mainfrom
keysersoft/verify-weclapp-connector
May 10, 2026
Merged

keysersoft merged 2 commits into
mainfrom
keysersoft/verify-weclapp-connector

Conversation

@keysersoft

Copy link
Copy Markdown
Contributor

Summary

  • Migrate weclapp adapter from legacy API v1 to v2 — /customer was removed in v2 and replaced by /party, which is the most likely cause of users reporting the connector "doesn't work"
  • Add optional properties / filter / sort params on list tools so AI agents can scope queries (e.g. filter=customerNumber-notnull=true for customers only)
  • Add weclapp.live.spec.ts with a static block (always runs in CI) that prevents regressions back to v1 / /customer, plus a live-edge block (gated by RUN_WECLAPP_LIVE=1) that proves the URL resolves to weclapp infrastructure and that AuthenticationToken is actually injected by RestEngine

Why

Verified against the official OpenAPI v2 spec at https://www.weclapp.com/api/openapi_v2.yaml:

  • baseUrl is https://<TENANT>.weclapp.com/webapp/api/v2/
  • /customer does not exist in v2 — replaced by /party (customers and suppliers unified, distinguishable via customerNumber-notnull / supplierNumber-notnull / partyType-eq)
  • Auth header is AuthenticationToken (was already correct)
  • Pagination defaults: 100, max 1000 (descriptions previously said 25/100)

Limitations

  • weclapp does not offer a public sandbox; full end-to-end validation against real /party / /article responses requires a real tenant + token. The live test only proves routing + auth pipeline reach weclapp's edge.

Test plan

  • npm test --workspace=packages/backend -- src/adapters/de/weclapp.live.spec.ts — 4 static tests pass
  • RUN_WECLAPP_LIVE=1 npm test ... — 6/6 pass (404 from server: weclapp, AuthenticationToken header confirmed injected)
  • End-to-end against a real weclapp tenant (out of scope, no trial available in this workspace)

The adapter was pinned to /webapp/api/v1, which weclapp marks as legacy
and discourages for new integrations. More importantly, /customer was
removed in v2 and replaced by /party (customers and suppliers unified),
so weclapp_list_customers / weclapp_get_customer were broken on any v2
tenant — the most common cause of users reporting the connector "doesn't
work".

Changes to weclapp.json:
- baseUrl /webapp/api/v1 -> /webapp/api/v2
- /customer, /customer/id/{customerId} -> /party, /party/id/{partyId}
- Add optional properties / filter / sort query params on list tools
  (matches v2 spec: properties_qs, filter_qs, sort_qs)
- Fix pageSize description (default 100, max 1000 per spec)

Add weclapp.live.spec.ts with two layers:
- Static (always runs): asserts baseUrl is on v2, auth header is
  AuthenticationToken, no path references /customer, and the v2 paths
  /party, /salesOrder, /salesInvoice, /article are all present.
- Live (RUN_WECLAPP_LIVE=1, skipped in CI): hits weclapp's edge with a
  bogus tenant, asserts 404 with `server: weclapp` (proves baseUrl
  resolves to weclapp infrastructure), and asserts the AuthenticationToken
  header is actually injected by RestEngine.

End-to-end validation against a real tenant still requires a weclapp
account (no public sandbox exists) and is out of scope for this change.
@keysersoft
keysersoft enabled auto-merge May 10, 2026 10:45
@keysersoft
keysersoft merged commit a98987d into main May 10, 2026
10 checks passed
@keysersoft
keysersoft deleted the keysersoft/verify-weclapp-connector branch May 10, 2026 10:47
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.

1 participant