To authenticate with Payment25 you will need to retrieve an access token using the OAuth flow. After registration you will receive a username and password, these credentials can be used to retrieve an access token. All authentication is managed via AWS Cognito.
The easiest way to retrieve an access token is by making an InitiateAuth API call. The ClientId, username, and password will be provided upon receiving an account.
curl --request POST \ --url 'https://cognito-idp.eu-central-1.amazonaws.com/' \ --header 'Content-Type: application/x-amz-json-1.1' \ --header 'X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth' \ --data '{ "AuthFlow": "USER_PASSWORD_AUTH", "ClientId": "", "AuthParameters": { "USERNAME": "", "PASSWORD": "" } }'
Access tokens are valid for one hour so make sure to implement a refreshing flow or retrieve a new access token every hour. Make sure to use the access tokens for the full hour and don’t request new tokens for every API call made.
Using libraries
Several languages provide libraries to make API Calls against AWS without doing a raw request. Feel free to use any of these libraries to accelerate your development process. For more information about using this API in one of the language-specific AWS SDKs, see the following: