Skip to content
Last updated

API

The ZRU REST API can be used on websites, mobile applications, software, etc.

Using the API in a Test application does not incur any charges.

To better understand the API Reference, it is essential to grasp some basic concepts, which we explain in this section.

URLs

The ZRU API is hosted at: https://api.zrupay.com/v1/.

To access the resources explained in the API Reference, use the following structure, shown relative to https://api.zrupay.com/v1/:

  • Get a list of items: GET /<resource>/

  • Get a specific item: GET /<resource>/<identifier>/

  • Create an item: POST /<resource>/

  • Edit an item: PATCH /<resource>/<identifier>/

  • Delete an item: DELETE /<resource>/<identifier>/

  • Perform an action on an item: POST /<resource>/<identifier>/<action>/

Authentication

All requests made to the API must include an Authorization header with the credentials for the environment being used. The content of the Authorization header follows this format: AppKeys <key>:<secret_key>

When creating an environment, API credentials can be found in the Environment Summary. These credentials should remain confidential; avoid placing them in sites like GitHub, client-side code, and other public locations, especially the Secret Code.

Suppose the credentials are as follows:

  • Code: at8844d39340

  • Secret Code: 8a78931t094c47819d85gf457fayc9d4

The Authorization header would then be: AppKeys aa8834d69280:8a78931g094c44519d83df457fayc9d4

Pagination

Some requests return lists with multiple items. In these cases, pagination is used, returning 20 items per page.

These requests can include the page parameter to specify the desired page.

The response would have the following format:

{
  "count": 50,
  "items_per_page": 20,
  "next": "<link to the next page>",
  "previous": "<link to the previous page>",
  "results": [...]
}

Resources

Resources are the items that can be created or retrieved via the API. Each of these items, whether created, edited, or deleted, can always be verified through the Panel. They are detailed in the [API Reference].