API Documentation
Authentication
Learn how to authenticate and secure API requests using Paytring.
Authentication
All API endpoints are authenticated using Bearer tokens. The token must be included in the Authorization
header of each request.
You can generate this token using Basic Authentication with your API key and secret:
Hashing
hash value can be "none" for v2 API
Hashing is a process of generating a unique value or a fixed-length string representation of data. This technique is used to store and retrieve data more efficiently and securely. Below is the explanation of how to create a hash for v1 and v2 APIs.
How to Create a Hash?
Follow these steps to create a hash:
- Sort all the parameters.
- Join all the parameter string values using a
|
sign. - Append the key secret at the end.
- Convert this string into a hash using the
SHA512()
function.
Example Code
Steps to Create a Hash
- Sort all the parameters.
- Skip all object values.
- Join all the string values using a
|
sign. - Add
KEY_SECRET
at the end of the string. - Convert this string into a hash using the
SHA512()
function.