Issuing a credential
An API credential is created from an authenticated merchant session, not from an API token — a credential cannot mint its successor.1
Create the credential
POST /v2/merchant-api-credential returns the client_id and, exactly once, the client_secret.2
Store the secret immediately
The secret is shown on creation and never again. DropHub stores only a verifier.
3
Rotate on a schedule
POST /v2/merchant-api-credential/secret-rotations issues a new secret. Rotation requires an If-Match header carrying the credential’s current ETag.Requesting a token
client_id and client_secret parameters above are the supported alternative.
Scopes
A token carries only the scopes its credential was granted. A request outside them is rejected with403, not 401 — the caller is known, and not permitted.
Token lifecycle
Tokens are short-lived. Readexpires_in from the token response rather than assuming a duration — it is the only value that stays correct if the lifetime changes.
Scopes are fixed to what the credential was granted; the token request takes no scope parameter.
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 itself was revoked or rotated.
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 company. Retrying a 403 with the same credential will never succeed.