Retrieve a Credit Record
Endpointβ
GET https://api.verifik.co/v2/credits/{id}
Retrieve a specific credit record by its unique identifier. This endpoint returns detailed information about a single credit transaction including its status, amount, and associated client information.
Headersβ
Content-Typeβ
Type: String
Required: Yes
application/json
Authorizationβ
Type: String
Required: Yes
Bearer <token>
Parametersβ
idβ
Type: String
Required: Yes
The unique identifier of the credit record you want to retrieve.
populates[]β
Type: Array
Required: No
Optional array of related data to include. Available options: client, superAdmin.
Requestβ
- Node.js
- Python
- PHP
- Go
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://api.verifik.co/v2/credits/credit_123456789',
params: {
"populates[]": ["client", "superAdmin"]
},
headers: {
Accept: 'application/json',
Authorization: 'jwt <tu_token>'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
import http.client
conn = http.client.HTTPSConnection("api.verifik.co")
headers = {
'Accept': "application/json",
'Authorization': "JWT token"
}
conn.request("GET", "/v2/credits/credit_123456789?populates[]=client&populates[]=superAdmin", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.verifik.co/v2/credits/credit_123456789?populates[]=client&populates[]=superAdmin', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'JWT token',
],
]);
echo $response->getBody();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.verifik.co/v2/credits/credit_123456789?populates[]=client&populates[]=superAdmin"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "JWT token")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
Responseβ
- 200
- 404
- 401
{
"success": true,
"data": {
"_id": "credit_123456789",
"amount": 1000,
"status": "approved",
"category": "purchase",
"client": {
"_id": "client_123456789",
"name": "Example Client",
"email": "client@example.com"
},
"superAdmin": {
"_id": "admin_123456789",
"name": "Admin User",
"email": "admin@verifik.co"
},
"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"
}
}
{
"error": "Credit record not found",
"message": "CREDIT_RECORD_NOT_FOUND"
}
{
"error": "Unauthorized",
"message": "UNAUTHORIZED"
}