Authentication

Overview

The Caxton API, is a comprehensive suite of endpoints that empowers companies to enhance their financial operations, by managing supplier payments, expenses, payroll, and other business processes through a single unified service.

Our dedicated API integration merges with your systems, enabling you to harness your data for diverse payment outputs with precision and frequency.

Request Access

To receive your API credentials, we ask that you first Request Access. Our team can then provide you with a Username and Clientname to access the Main Account, and solve any outstanding queries you may have.

Links

Once access has been granted by our Team, the Sandbox and Production environments, can be found via the following links.

Step 1. Generate Password

To generate a password for a Main Account:

  1. Call POST - Generate Password.
  2. Enter the Username.
  3. Enter the Clientname.
  4. If the request is submitted successfully, a ClientPassword is created.

πŸ“˜

Note

If you are accessing your main account for the first time, the Username and Clientname are provided to you by our team.

REQUEST

This is what an example request looks like when you populate your Username and Clientname:

curl --request POST \
     --url https://sandbox.caxton.io/api/clients/auth/register \
     --header 'accept: application/json' \
     --header 'content-type: text/json' \
     --data '
{
  "Username": "<username>",
  "Clientname": "cxtnclient"
}

RESPONSE

The following shows a successful response, notice how the ClientPassword is generated on line number four:

{
    "Content": {
        "Model": {
            "ClientPassword": "<clientpassword>",
            "StartDate": "2023-08-23T10:55:45.0645017Z",
            "EndDate": "2023-09-22T10:55:45.0645017Z",
            "PublicKey": "<publickey>",
            "ApiStatusCode": 100,
            "ApiStatus": "IsValid",
            "ApiStatusDescription": "Valid Operation"
        },
        "ExpectedResponses": [
            "IsValid"
        ]
    }
}

Step 2 - Generate Access Token

After generating a password, the next step is to generate an access_token.

Call POST - Get Access Token and populate the following:

  1. For Grant_Type, enter the word 'password' - without the quotes.
  2. Enter the Username provided to you by our Team.
  3. Enter the ClientPassword created in Step 1 - Generate Password.
  4. If the request is submitted successfully, an access_token is created.

REQUEST

curl --request POST \
     --url https://sandbox.caxton.io/api/token \
     --header 'accept: */*' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data Grant_Type=password \
     --data Password=<password> \
     --data Username=<username>

RESPONSE

This is an example response, with the access token as shown on line 2:

{
  "access_token": "<access_token>",
  "token_type": "bearer",
  "expires_in": 2591999
}

expires_in is in seconds. By default, this is 30 days, and it's configurable, depending on your needs.

Reset Password

To reset the password follow these instructions:

  1. Call PUT - Reset Client Credentials to reset the client password. If the password is being reset for a Sub-Account, proceed to the next step, otherwise, skip to Step 3.
  2. Enter the IdentityNumber for the Sub-Account.
  3. Follow Step 1. Generate Password.
  4. Follow Step 2. Generate Access Token