Skip to content

docs: Rewrite README, add InvoiceSalesOrderResult::findByProcessId() - #701

Merged
stephangroen merged 2 commits into
mainfrom
docs/readme-rewrite
Sep 23, 2026
Merged

stephangroen merged 2 commits into
mainfrom
docs/readme-rewrite

Conversation

@stephangroen

Copy link
Copy Markdown
Member

Summary

README rewrite

The README is restructured around what users need to do, and brought up to date with the current library.

Examples that led to broken setups are fixed:

  • Tokens were only stored after connect(). Refresh tokens rotate, so a refresh during later requests lost the new token and locked users out. The README now puts setTokenUpdateCallback() front and centre.
  • The lock and unlock callbacks were set after connect(), so they weren't active during the first refresh. The multi-process locking pattern is now explained, including setRefreshAccessTokenCallback().
  • $item->find($id); and $item->get(); threw away their results.
  • download() was documented as returning a string. It returns a stream.
  • Tokens were run through serialize()/unserialize() for no reason.

Newly documented: error handling and status codes; all filter() options ($expand, $select, other OData options, headers such as CustomDescriptionLanguage); first() and findId(); manual paging with getResultSet(); sync endpoints (Timestamp) and bulk endpoints; lazy loading versus $expand; why to always set the division; base urls per country; state for CSRF; logging via middleware; webhook code examples; the daily maintenance window (#691).

Also: a table of contents, badges, updated troubleshooting, a versions table with upgrade notes for 4.7 and 4.8, and a contributing section that links the entity generator. The job openings link and text copied from an old PR are removed. The #invoice-sales-orders-async anchor (linked from the v4.9.0 release notes) still works.

InvoiceSalesOrderResult::findByProcessId()

$result = (new InvoiceSalesOrderResult($connection))->findByProcessId($processId);

This keeps the ProcessID parameter format (guid'…') inside the library. If the format turns out to be wrong, a patch release fixes it for everyone, without users changing their code. get(['ProcessID' => …]) keeps working.

Test plan

  • All 27 PHP snippets in the README pass php -l
  • Every field, method and class used in the README exists in the library
  • 2 new tests for findByProcessId(); vendor/bin/phpunit (598 tests) and vendor/bin/phpstan pass
  • CI passes

🤖 Generated with Claude Code

stephangroen and others added 2 commits September 23, 2026 14:49
Keeps the ProcessID parameter format in one place in the library, so users
don't have to build "guid'...'" themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restructures the README around the tasks users have (authenticate, read,
write, related data, rate limits, errors, webhooks) and brings it up to date:

- Fix examples that led to broken setups: tokens are now stored through the
  token update callback (refresh tokens rotate), lock callbacks are set
  before the first refresh, find()/get() results are used instead of
  discarded, download() returns a stream, tokens are no longer serialized
- Document what was missing: error handling and status codes, filter
  options, first()/findId(), manual paging, sync and bulk endpoints, lazy
  loading and $expand, setting the division, base urls per country, state
  for CSRF, logging via middleware, webhook code examples
- Update troubleshooting, add a versions table and upgrade notes, add a
  contributing section with the entity generator
- Remove the job openings link and leftover text copied from a PR

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stephangroen
stephangroen merged commit ca5d3ae into main Sep 23, 2026
21 checks passed
@stephangroen
stephangroen deleted the docs/readme-rewrite branch September 23, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant