API Authentication
Our API is secured by API keys, please make sure you don’t share these keys with anyone! They should only be used in a secure server side environment, our API isn't supported for use in the browser, see our Embed SDK instead.
You can find your API key in the integrations section of the merchants admin.
Authorization Header (recommended)
We recommend passing your API key in the Authorization header, like so:
$ curl -X GET https://api.payhere.co/api/v1/user -H "Authorization: Bearer ${api_key_here}"
require "http"
require "json"
raw_json = HTTP.auth("Bearer #{api_key_here}")
.get("https://api.payhere.co/api/v1/user")
.body.to_s
json = JSON.parse(raw_json)
access_token parameter
If you are wanting to test GET endpoints quickly you can pass your API key as a parameter labelled access_token
GET https://api.payhere.co/api/v1/user?access_token=${api_key_here}