Pular para o conteúdo

Authentication

Use these API operations to manage your authentication tokens.

OperationMethodDescription
Request an access tokenPOSTRequest an access token for authentication with Ripple APIs.
Test access tokenGETTest if an access token can be used for authentication.

Request an access token

Requisição

Request an access token for authentication with Ripple APIs.

You need to request a token for the environment you want to authenticate with.

Note: The length of the access token isn't fixed, hence it can vary. Avoid validating tokens based on character length.

Developer guide

Environments

EnvironmentDomainDescription
Testapi.test.ripple.comTest environment with simulated currency.
Productionapi.ripple.comProduction environment for Ripple Payments Direct
Segurança
BasicAuth
Cabeçalhos
Authorizationstring

Optional base64-encoded client_id:client_secret. If provided here they aren't required in the request body.

Exemplo:Basic ZGVtbzpwQDU1dzByZA==
Corpoobrigatório
client_idstringobrigatório

The client ID associated with a specific set of API credentials.

Exemplo:"{YOUR_CLIENT_ID}"
client_secretstringobrigatório

The client secret associated with a specific set of API credentials.

Exemplo:"{YOUR_CLIENT_SECRET}"
audiencestringobrigatório

The value of the audience field is based on URN syntax.

Format: urn:ripplexcurrent-{ENVIRONMENT_STRING}:{YOUR_TENANT_ID}

  • The first component is urn:ripplexcurrent-.
  • The second component refers to the environment you want to access.
  • The third component is your tenant ID. Ripple integration engineers provide this component during training.
EnvironmentEnvironment stringDescription
UATuatUAT environment with simulated partners and simulated currency.
ProductionprodProduction environment for Ripple's internal services.

Example: urn:ripplexcurrent-uat:{YOUR_TENANT_ID}

Exemplo:"urn:ripplexcurrent-uat:{YOUR_TENANT_ID}"
grant_typestringobrigatório

Set the grant-type for this client credentials request. This must be set to client_credentials.

Value:"client_credentials"
Exemplo:"client_credentials"
curl -i -X POST \
  -u '<username>:<password>' \
  https://docs.ripple.com/_mock/pt-br/products/payments-direct-2/api-docs/payments-direct-api/payments-direct-2-api/v2/oauth/token \
  -H 'Authorization: Basic ZGVtbzpwQDU1dzByZA==' \
  -H 'Content-Type: application/json' \
  -d '{
    "client_id": "{YOUR_CLIENT_ID}",
    "client_secret": "{YOUR_CLIENT_SECRET}",
    "audience": "urn:ripplexcurrent-uat:{YOUR_TENANT_ID}",
    "grant_type": "client_credentials"
  }'

Respostas

Returns the authentication response object that includes the token, type, scopes, and expiry.

Corpoapplication/json
access_tokenstring

The bearer token you use when authenticating with a Ripple API.

Exemplo:"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ"
scopestring

List of scopes applied to your access_token.

Exemplo:"pos:payments:create quote_collection:quote:create quote:quote:read pos:payments:read pcs_config:external_read data_requirements:read identities:creat
expires_ininteger, (int64)

How long your access_token is valid. You need to request a new token when it expires.

Exemplo:3600
token_typestring

The type of token. Ripple APIs use Bearer auth tokens.

Exemplo:"Bearer"
Resposta
{ "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ", "scope": "pos:payments:create quote_collection:quote:create quote:quote:read pos:payments:read pcs_config:external_read data_requirements:read identities:create identities:read identities:write ledger:balance:read ledger:read", "expires_in": 3600, "token_type": "Bearer" }