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.
Environment | Link |
---|---|
Sandbox | https://caxapi-integration.azurewebsites.net/api/ |
Staging | https://caxapi-staging.caxton.io/api/ |
Production | https://caxtonapi.caxtonfx.com/api/ |
Step 1. Generate Password
To generate a password for a Main Account:
- Call
POST - Generate Password
. - Enter the
Username
. - Enter the
Clientname
. - If the request is submitted successfully, a
ClientPassword
is created.
Note
If you are accessing your main account for the first time, the
Username
andClientname
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:
- For
Grant_Type
, enter the word 'password' - without the quotes. - Enter the
Username
provided to you by our Team. - Enter the
ClientPassword
created in Step 1 - Generate Password. - 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:
- 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. - Enter the
IdentityNumber
for the Sub-Account. - Follow Step 1. Generate Password.
- Follow Step 2. Generate Access Token
Updated 2 months ago