Payments authentication
Start by generating a payment token to make payment API requests. Make a HTTP POST
request to the relevant endpoint + /api/oauth/token/
. Use a payments access token.
Request
curl --location --request POST 'https://uat.app.payvyne.com/api/oauth/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'grant_type=client_credentials'
--data-urlencode 'client_id=<payment_key>'
--data-urlencode 'client_secret=<payment_secret>’
Try it out
If your request was successful you will receive a payment token like this in the response
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElkIjoxLCJzY29wZSI6WyJwYXkiXSwiaXNzIjoiaHR0cDovL2FwcC5kZXYucGF5dnluZS5zeXN0ZW1zIiwiZXhwIjoxNTg2MzY5NzExLCJpYXQiOjE1ODYzNjYxMTEsImF1dGhvcml0aWVzIjpbIlJPTEVfUEFZIl0sImp0aSI6ImExY2UzZjdmLTE3MzItNDhmNC04NTI3LTA5NWQ5NjlhNjkzNSIsImNsaWVudF9pZCI6IllNUFE2aDZQYTNaYmpEMXplbkQ0eXcifQ.g3XSXftyHvlCL1z1tlW6khboY7hzbiZVZgIzKHF2Rdc
Helpful to know
Payment tokens expire after 60 minutes and can be used for multiple calls during this period. In order to prevent unnecessary processing you should store the payment token generated and use it for all calls during the 60 minute period. After it expires you should request a new token.
Updated 4 months ago