API Overview
Welcome to an Overview of the NATS REST API. The NATS API is available for all installations, giving you a programmatic way to manage, automate, and scale your business.
Please note: Certain API Endpoints require having additional features. External Hit and External Transaction, for example, require NATS Pro. While /biller/verify/ requires Payze.
Base URL Structure
All REST requests interact with the API layer via a predictable, structured routing template:
http://<domain>/api/<endpoint>/<action>When building your requests, ensure you input the correct routing properties:
<domain>: Replace this with your specific, licensed NATS installation domain name
<endpoint>: Replace with the endpoint you are trying to access.
<action>: Replace with the specific action you are trying to perform.
Some endpoints do not require an action in the URL, and will be specified in the documentation.
API Activation
Before your system can listen for outbound REST commands, you must have the Enable REST API configuration setting enabled.
Navigate to the Security section of the Configuration Admin.
Locate the Enable REST API setting underneath the APIs header.
Ensure the checkbox is set to Yes.
For a detailed guide on everything required to use the API, see API Usage Requirements.
Accessing APIs
The NATS REST API enforces strict restrictions to protect your system from unauthorized system manipulations.
User Authorization
All API is accessible exclusively to NATS affiliates with Admin-level permissions.
IP Whitelisting
To successfully communicate with the NATS REST API, your server's outbound IP address must be explicitly set in your system.
This is done by navigating to the Security section of the Configuration Admin.
Under the APIs header, modify the Admin API Allowed IPs setting to add or remove authorized IPs.
Authentication & Headers
Authentication is handled universally using secure HTTP Header Authentication. Every individual outbound request must be supplied with your admin credentials via headers.
Required HTTP Headers
Please note: Header keys are completely case-insensitive.
Pass these exact keys inside your request headers array:
api-key: Affiliate key
api-username: Affiliate Username
Retrieving Your API Key
Please note: Only full admin accounts are authorized to use the API and set an API key.
Navigate to the Affiliate Admin
Select the relevant Affiliate
Navigate to the API tab
Grab the key from the API Key underneath the General API Details section.
If you do not have an API key, you can set one by clicking the icon labeled "Change API Key."
Request Methods & Status Codes
All API payloads and system responses exchange data through raw JSON strings.
Supported HTTP Methods
GET
POST
DELETE
PATCH
If PATCH requests are not honored, please add 'x-http-method: PATCH' in the headers array passed.
For detailed information about these HTTP Request methods, please refer to their official documentation here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
Response Status Codes
200
On Success, the API will return a '200' status and output the results of the API call. Please refer to the available API endpoints for possible responses.
NOTE: As long as the endpoint and HTTP request method are valid and there are no invalid parameters, a '200' response is returned.
400
The API will return a '400' status if an invalid or unsupported HTTP request is sent.
404
The API will return either a '404' status if an invalid parameter is sent, or if an HTTP request is sent to an invalid endpoint.
405
The API will return a '405' status if an invalid HTTP request method is used.
Code Examples
Authentication can be handled in various ways using different programming languages. Below are some complete example calls to the Ping endpoint with HTTP Header authentication.
PHP
Python
This example requires pip and the requests library, which can be installed via pip by:
node.js
This example requires npm and the request module, which can be installed via npm by:
cURL
Expected output:
Related Articles
API Usage RequirementsLast updated
Was this helpful?