Skip to main content

List All Credit Records

Endpoint​

GET https://api.verifik.co/v2/credits

Retrieve a list of Credit records in Verifik's system. This endpoint returns an array of credit objects, each containing detailed information about credit transactions, balances, and associated client accounts.

Headers​

Content-Type​

Type: String
Required: Yes

application/json

Authorization​

Type: String
Required: Yes

Bearer <token>

Parameters​

page​

Type: Number
Required: No

Specifies the page number for pagination, starting from 1.

perPage​

Type: Number
Required: No

Defines the number of items per page for pagination.

populates[]​

Type: String
Required: No

Populates the specified field, transforming ObjectId references into full objects. Available options: client, superAdmin

where_status​

Type: String
Required: No

Where condition to filter by status. Options: approved, pending, failed, postPaid

where_category​

Type: String
Required: No

Where condition to filter by category. Options: purchase, usage

where_client​

Type: String
Required: No

Filter by specific client ID

Request​

import axios from 'axios';

const options = {
method: 'GET',
url: 'https://api.verifik.co/v2/credits',
params: {
page: 1,
perPage: 20,
"populates[]": ["client"],
where_status: "approved",
where_category: "purchase"
},
headers: {
Accept: 'application/json',
Authorization: 'jwt <tu_token>'
}
};

try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}

Response​

{
"success": true,
"data": [
{
"_id": "credit_123456789",
"amount": 1000,
"status": "approved",
"category": "purchase",
"client": {
"_id": "client_123456789",
"name": "Example Client",
"email": "client@example.com"
},
"description": "Credit purchase for API usage",
"transactionId": "txn_123456789",
"paymentMethod": "credit_card",
"currency": "USD",
"exchangeRate": 1.0,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"perPage": 20,
"total": 1,
"pages": 1
}
}