Getting started
This API docs describes how to use Credify's SMB product API as a provider.
API Base
https://smb.api.credify.live/api/v1/
Authentication
The API key and API secret can be used to obtain the token as follows.
POST /auth/token
{
"app_key":"<key>",
"app_secret":"<secret-key>",
"grant_type": "ACCESS_TOKEN"
}
Sample response
{
"access_token": "eyJh..."
}
Note: this this is a short lived access token, you need to generate a new one if your flow expands the expiry date.
Usage on subsequent requests
Authorized endpoints require Authorization header with a Bearer token
Authorization: Bearer <ACCESS_TOKEN>
Success Response
All error responses will return a JSON object with success: true
and data
fields, in addition to the proper HTTP status code.
Example Success Response
{
"success": true,
"data": {...} // your data is here
}
Error Response
All error responses will return a JSON object with success: false
and error_code
fields, in addition to the proper HTTP status code.
Example Error Response
{
"success": false,
"error_code": "MERCHANT_NOT_FOUND"
}
Conventions
Naming
- Endpoint paths:
kebab-case
- Query parameters:
snake_case
- Request and response body fields:
snake_case
For example:
POST /some-endpoint/path?param_abc=123
{
"field_abc": "xyz",
"field_123": 999
}
Dates
All dates are in ISO-8601 date format, e.g: 2008-01-10T11:00:00-05:00
Usage example
- JS
- C#
const isoDate = "2008-01-10T11:00:00-05:00";
const parsedDate = new Date(isoDate);
console.log(parsedDate); // Outputs: Thu Jan 10 2008 16:00:00 GMT+0000 (Coordinated Universal Time)
string isoDate = "2008-01-10T11:00:00-05:00";
DateTime parsedDate = DateTime.Parse(isoDate);
Console.WriteLine(parsedDate); // Outputs: 1/10/2008 11:00:00 AM