php-authenticationlisted
Install: claude install-skill MuHamza30/paypal-api-plugin
# Authenticating an APIMatic PHP SDK client
Which schemes exist is decided by the API spec. **The authoritative list is the set of
`->{scheme}Credentials(…)` setters on `src/{Client}Builder.php`** (mirrored on
`src/ConfigurationInterface.php` as one `get{Scheme}CredentialsBuilder()` plus one credentials getter per
scheme, and documented one-file-per-scheme under `doc/auth/`). Start there — and note that only the
*setter* name is uniform: the credentials getter is `get{Scheme}Credentials()`, **except** when the API has
exactly one scheme and it is an OAuth 2 grant, where the `Credentials` suffix is dropped and it is
`get{Scheme}()`. Grepping only for the suffixed getter on such an SDK finds nothing and looks like the
scheme is absent.
## The shape: one credentials builder per scheme
```php
use PaypalServerSdkLib\{Client}Builder;
use PaypalServerSdkLib\Authentication\{Scheme}CredentialsBuilder;
$client = {Client}Builder::init()
->{scheme}Credentials(
{Scheme}CredentialsBuilder::init(/* required params, positionally */)
// optional params are fluent setters
)
->build();
```
Every credentials builder follows the same rules:
- `init(...)` takes the scheme's **required** parameters, positionally.
- Optional parameters are fluent setters returning `$this`.
- The builder is passed to the client builder, which merges its config — you never call
`getConfiguration()` yourself.
**Where `{scheme}` comes from depends on how many schemes the API has.*