Embedded Authorization

Creates a short-lived JSON Web Token (JWT) that client-side applications can use to authenticate against the Shippo API without exposing a long-lived API token.

Authenticate this request with either a Shippo API token (Authorization: ShippoToken <API_TOKEN>) or an OAuth bearer token (Authorization: Bearer <OAUTH_BEARER_TOKEN>). Platform accounts can mint a token on behalf of a Managed Shippo Account by setting the SHIPPO-ACCOUNT-ID header.

The returned token is valid for 12 hours. Send it on subsequent requests as Authorization: JWT <JWT_TOKEN>.

post/embedded/authz

Request

  • Base URL
    https://api.goshippo.com
  • URL
    https://api.goshippo.com/embedded/authz
  • Auth
    • API key in header Authorization
    • or OAuth 2
      Authorization code: https://goshippo.com/oauth/authorize
      Token URL: https://goshippo.com/oauth/access_token

Headers

SHIPPO-API-VERSIONstring
Example:2018-02-08

Optional string used to pick a non-default API version to use. See our API version guide.

Shippo-Account-Idstring

Optional. The object ID of a Managed Shippo Account. Platform accounts set this to mint a JWT scoped to one of their managed accounts. Shippo-Account-Id and SHIPPO-ACCOUNT-ID are the same header.

Request body

scopestring required

The scope requested for the token.

Example request

{
  "scope": "embedded:carriers"
}

Response

Success

tokenstring

The encoded JSON Web Token. Pass it on subsequent API requests as Authorization: JWT <JWT_TOKEN>.

expiresIninteger

Unix timestamp (seconds) of when the token expires. This matches the exp claim inside the token itself. Tokens are valid for 12 hours from issue.

Example response

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY3QiOnsidXNlcl9pZCI6MTIzNDU2N30sImV4cCI6MTcwMDAwMDAwMCwiaXNfdGVzdCI6dHJ1ZSwib2F1dGhfYXBwX2lkIjoxMDAwMSwib3JpZ2luYWxfYXV0aF9zdHJhdGVneSI6IkpXVEF1dGgiLCJwYXJ0bmVyX25hbWUiOiJleGFtcGxlLXBhcnRuZXIiLCJwbGF0Zm9ybV9pZCI6MTAwMCwidXNlcl9pZCI6MTIzNDU2NywidXNlcl9vYmplY3RfaWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJ1c2VybmFtZSI6InNoaXBwb3RsZUBzaGlwcG8uY29tIn0.EXAMPLE_SIGNATURE_NOT_VALID",
  "expiresIn": 1700000000
}

Changes