General information
API URL: https://api.paymaster24.com/v1.0
Depending on the type of operation, certain URLs are added to this address. Each url is registered in method. The format of the service messages is the JSON object (application / json). Character encoding - UTF-8.
Each method is accompanied by an example api request and described what type it is. All enumerable fields and their values can be obtained from the service, they are also presented in the documentation.
- Decimal number separator - point
- All fractional numbers are transmitted in a format with two decimal places, if they contain a fractional part. It is possible to transfer a number without a fractional part. Example: 1500.76; 5; 5.00,
- Date format for transmission (UTC+3) - dd.MM.yyyy HH:mm:ss
- Boolean fields are passed as true\false
- The mobile phone is transmitted in international format as a number. No other characters like: plus, dots, parentheses, spaces, etc are not allowed
- All parameters of the integer type are defaulted to - 0, fractional - 0.00, logical - false, date - 01.01.0001
Each request must contain the Login and Signature fields. Login is the username in the Payouts.Paymaster24 service.
Requests flow
Example query in which the required fields are defined
{
"request": {
"Login":"admin@paymaster24.com",
"Signature":"Y4mab0rwOLXedtLfUf7AwIMhdGitxUkkX2+0BimWazg="
}
}
Each request should have Signature. It consists of three parts
- Url method
- Formalized request body (deletes line breaks, extra spaces and tabs)
- Secret client key
Example: We want to call /transaction/new with a query
{ "request":{ "ClientTransactionId":"abcd1234", "AccountId":"1", "AccountNumber":"79093222111", "Amount":100.03, "Currency":"USD", "TypePaymentMethod":20, "Passport":"023477812", "Address":"221B Baker Street, London NW1 6XE", "TaxId":"16500101012", "Login":"admin@paymaster24.com" } }
Secret key - 9DRQ3EcGP4ovAdzr
Secret line:
/transaction/new{"request":{"ClientTransactionId":"abcd1234","AccountId":"1","AccountNumber":"79093222111","Amount":100.03,"Currency":"USD","TypePaymentMethod":20,"Passport":"023477812","Address":"221B Baker Street, London NW1 6XE","TaxId":"16500101012","Login":"admin@paymaster24.com"}}9DRQ3EcGP4ovAdzr
Devided:
- /transaction/new - method URL
- {"request":{"ClientTransactionId":"abcd1234","AccountId":"1","AccountNumber":"79093222111","Amount":100.03,"Currency":"USD","TypePaymentMethod":20,"Passport":"023477812","Address":"221B Baker Street, London NW1 6XE","TaxId":"16500101012","Login":"admin@paymaster24.com"}} - request body formalized
- 9DRQ3EcGP4ovAdzr - secret key
And from this line get a hash using the SHA-256 algorithm. Then the resulting value is converted to the Base64 format. This is the line you want to add to the Signature field
Similarly, each response from the service contains two required fields and a Signature field, which is returned only if the request signature is successfully verified
- ErrorCode - error code. In case of failure of the operation, this code will be different from 0. The decoding of all error codes can be found in the Appendix "Types of errors".
- ErrorMessage - error message
- Signature - the signature of the response from the server.
If the response is successful, ErrorCode will be set to 0, and ErrorMessage will be an empty string
If the error occurred while the query was running on the server, ErrorCode would be -1, and ErrorMessage "Internal service error"
If the request signature is incorrectly verified, ErrorCode will be set to 30, and ErrorMessage will have an "Authentication error." The hash check failed, and returns a string from which the service received the hash
If the login is incorrect, ErrorCode will be 40, and ErrorMessage will have an "Incorrect login"
Response example api
{
"response":{
"ErrorCode":0,
"ErrorMessage":"",
"Signature": "692lzInUZShCjdUnScA0rhJu8ybmc8lPvpAlflpjkxw"
}
}
The response signature is formed similarly
/transaction/new{"response":{"ErrorCode":0,"ErrorMessage":""}}9DRQ3EcGP4ovAdzr
Devided:
- /transaction/new - method URL
- {"response":{"ErrorCode":0,"ErrorMessage":""}} - request body formalized
- 9DRQ3EcGP4ovAdzr - secret key