Getting a credential
Aclient_id and client_secret are issued from the DropHub console by a signed-in operator. A credential cannot mint its successor, so this is deliberately not an API call.
Requesting a token
HTTP Basic is the preferred way to present the credentials:/v2/external request:
Scopes
A token carries exactly the scopes its credential was granted. A request outside them is rejected with
403, not 401 — the caller is known, and not permitted.
The token request takes no
scope parameter. Scopes are a property of the credential, fixed when it was issued. Sending one changes nothing; to change what a credential may do, change the credential.Token lifecycle
Readexpires_in from the token response rather than assuming a duration — it is the only value that stays correct if the lifetime changes.
Refresh proactively — a little before expiry, not after the first 401. When a request does fail with 401, the response carries a WWW-Authenticate: Bearer challenge; obtain a new token and retry once. Repeated 401s after a fresh token mean the credential was rotated or revoked.
401 means the token is missing, malformed, or expired. 403 means the token is valid but the credential lacks the scope, or the resource belongs to another merchant. Retrying a 403 with the same credential will never succeed.Token endpoint errors
/oauth/token uses OAuth error semantics, not problem details — it is the one endpoint that does.
