Não sabe como começar a integrar?
Acesse os primeiros passosPOST
OBRIGATÓRIO
OBRIGATÓRIO
OBRIGATÓRIO
400Erro
invalid_client
The provided client_id and/or client_secret of your app is invalid.
invalid_grant
There are several reasons for this error, it could be because the authorization_code or refresh_token is invalid, expired or revoked, was sent in an incorrect flow, belongs to another client, or the redirect_uri used in the authorization flow does not match what your application has configured.
invalid_scope
The requested scope is invalid, unknown, or wrongly formed. The allowed values for the scope parameter are “offline_access”, ”write”, ”read”.
invalid_request
The request does not include a required parameter, includes an unsupported parameter or parameter value, has a duplicated value, or is otherwise malformed.
unsupported_grant_type
Allowed values for grant_type are “authorization_code” or “refresh_token”.
forbidden
The call does not authorize access, possibly another user's token is being used.
unauthorized_client
The application does not have a grant with the user or the permissions (scopes) that the application has with this user do not allow creating a token.
Essa informação foi útil?
Sim
Não
curl -X POST \
'https://api.mercadopago.com/oauth/token'\
-H 'Content-Type: application/json' \
-d '{
"client_id": "client_id",
"client_secret": "client_secret",
"code": "TG-XXXXXXXX-241983636",
"grant_type": "authorization_code"
}'
{
"access_token": "APP_USR-4934588586838432-XXXXXXXX-241983636",
"token_type": "bearer",
"expires_in": 15552000,
"scope": "offline_access read write",
"user_id": 241983636,
"refresh_token": "TG-XXXXXXXX-241983636",
"public_key": "APP_USR-d0a26210-XXXXXXXX-479f0400869e",
"live_mode": true
}