Token
以有效的 authorization code 換取授權範圍內的 Bearer token。
POST /api/partner-auth/token
從 Application 後端以 JSON body 呼叫此 endpoint。
| 欄位 | 必填 | 說明 |
|---|---|---|
client_id | 是 | Active 的 Partner Client ID,其 Organization 與 Merchant 也必須為 active。 |
client_secret | 是 | 只保存在 Application 後端的 secret。 |
code | 是 | 未過期、未使用過的 authorization code。 |
redirect_uri | 是 | 與 authorization code 綁定的完全相同 URI。 |
code_verifier | 條件 | 授權時有送 code_challenge 才需要;43–128 字元,S256 雜湊後須等於 code_challenge,否則 401。 |
成功回應包含 access_token、token_type: Bearer、expires_in: 3600,以及所授予的 scope 字串。