Get Collection
curl --request GET \
--url https://api.fyatu.com/api/v3/collections/{collectionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fyatu.com/api/v3/collections/{collectionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fyatu.com/api/v3/collections/{collectionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fyatu.com/api/v3/collections/{collectionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fyatu.com/api/v3/collections/{collectionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fyatu.com/api/v3/collections/{collectionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fyatu.com/api/v3/collections/{collectionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"status": 200,
"message": "<string>",
"data": {
"collectionId": "<string>",
"reference": "<string>",
"orderId": "<string>",
"amount": 123,
"fee": 123,
"netAmount": 123,
"currency": "<string>",
"status": "<string>",
"description": "<string>",
"payer": {
"clientId": "<string>",
"name": "<string>"
},
"metadata": {},
"callbackUrl": "<string>",
"webhookUrl": "<string>",
"statusReason": "<string>",
"completedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"status": 401,
"message": "Unable to identify business",
"error": {
"code": "AUTH_TOKEN_INVALID"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2026-01-05T10:30:00+00:00"
}
}{
"success": false,
"status": 404,
"message": "Wallet not found",
"error": {
"code": "RESOURCE_NOT_FOUND"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2026-01-05T10:30:00+00:00"
}
}Collections
Get Collection
Get details of a specific payment collection — amount, status, checkout URL, and metadata. GET /collections/.
GET
/
collections
/
{collectionId}
Get Collection
curl --request GET \
--url https://api.fyatu.com/api/v3/collections/{collectionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fyatu.com/api/v3/collections/{collectionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fyatu.com/api/v3/collections/{collectionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fyatu.com/api/v3/collections/{collectionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fyatu.com/api/v3/collections/{collectionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fyatu.com/api/v3/collections/{collectionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fyatu.com/api/v3/collections/{collectionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"status": 200,
"message": "<string>",
"data": {
"collectionId": "<string>",
"reference": "<string>",
"orderId": "<string>",
"amount": 123,
"fee": 123,
"netAmount": 123,
"currency": "<string>",
"status": "<string>",
"description": "<string>",
"payer": {
"clientId": "<string>",
"name": "<string>"
},
"metadata": {},
"callbackUrl": "<string>",
"webhookUrl": "<string>",
"statusReason": "<string>",
"completedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"status": 401,
"message": "Unable to identify business",
"error": {
"code": "AUTH_TOKEN_INVALID"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2026-01-05T10:30:00+00:00"
}
}{
"success": false,
"status": 404,
"message": "Wallet not found",
"error": {
"code": "RESOURCE_NOT_FOUND"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2026-01-05T10:30:00+00:00"
}
}Overview
Retrieve details of a specific collection by its ID. Use this to verify payment status.Path Parameters
| Parameter | Type | Description |
|---|---|---|
collectionId | string | The collection ID (batch ID) |
Response
| Field | Type | Description |
|---|---|---|
collectionId | string | Unique collection identifier |
reference | string | Human-readable reference |
orderId | string | Your order ID (if provided) |
amount | number | Payment amount |
fee | number | Processing fee |
netAmount | number | Amount received (amount - fee) |
currency | string | Currency code |
description | string | Payment description |
status | string | Payment status |
statusReason | string | Reason for status (if failed/refunded) |
payer | object | Payer information |
metadata | object | Your custom metadata |
completedAt | string | Completion timestamp |
expiresAt | string | Session expiry time |
createdAt | string | Creation timestamp |
Payer Object
| Field | Type | Description |
|---|---|---|
email | string | Payer’s email |
name | string | Payer’s name |
accountName | string | Fyatu account name |
clientId | string | Payer’s Fyatu client ID |
Status Values
| Status | Description |
|---|---|
PENDING | Awaiting payment |
COMPLETED | Payment successful |
FAILED | Payment failed or expired |
REFUNDED | Fully refunded |
PARTIALLY_REFUNDED | Partially refunded |
Example Usage
<?php
$collectionId = 'col_a1b2c3d4e5f6';
$response = file_get_contents(
"https://api.fyatu.com/api/v3/collections/{$collectionId}",
false,
stream_context_create([
'http' => [
'method' => 'GET',
'header' => 'Authorization: Bearer ' . $accessToken
]
])
);
$result = json_decode($response, true);
if ($result['success'] && $result['data']['status'] === 'COMPLETED') {
// Payment confirmed
$netAmount = $result['data']['netAmount'];
$payerName = $result['data']['payer']['name'];
// Fulfill the order
fulfillOrder($result['data']['orderId']);
}
const collectionId = 'col_a1b2c3d4e5f6';
const response = await fetch(
`https://api.fyatu.com/api/v3/collections/${collectionId}`,
{
headers: {
'Authorization': `Bearer ${accessToken}`
}
}
);
const result = await response.json();
if (result.success && result.data.status === 'COMPLETED') {
// Payment confirmed
const { netAmount, orderId } = result.data;
const payerName = result.data.payer.name;
// Fulfill the order
await fulfillOrder(orderId);
}
Example Response
{
"success": true,
"status": 200,
"message": "Collection retrieved successfully",
"data": {
"collectionId": "col_a1b2c3d4e5f6",
"reference": "A2B4C6D8E0F2",
"orderId": "ORD-0001",
"amount": 25.00,
"fee": 0.75,
"netAmount": 24.25,
"currency": "USD",
"description": "Premium Subscription",
"status": "COMPLETED",
"statusReason": null,
"payer": {
"email": "alice@example.com",
"name": "Alice Example",
"accountName": "Alice E.",
"clientId": "clt_a1b2c3d4e5f6"
},
"metadata": {
"plan": "premium"
},
"completedAt": "2026-01-08T11:35:00+00:00",
"expiresAt": "2026-01-08T12:30:00+00:00",
"createdAt": "2026-01-08T11:30:00+00:00"
},
"meta": {
"requestId": "req_xyz789ghi012",
"timestamp": "2026-01-08T11:40:00+00:00"
}
}
Verifying Payments
Always verify payment status server-side before fulfilling orders. Never trust client-side redirects alone.
Recommended Verification Flow
- Webhook: Receive payment notification at your
webhookUrl - API Verification: Call this endpoint to confirm the payment
- Check Status: Ensure
statusisCOMPLETED - Check Amount: Verify
amountmatches expected value - Fulfill Order: Only then process the order
<?php
// Webhook handler example
function handleWebhook($payload) {
$collectionId = $payload['collectionId'];
// Always verify with API
$collection = getCollection($collectionId);
if ($collection['status'] !== 'COMPLETED') {
return; // Not completed yet
}
// Check if already processed
if (orderAlreadyFulfilled($collection['orderId'])) {
return; // Duplicate webhook
}
// Fulfill the order
fulfillOrder($collection['orderId'], $collection['netAmount']);
}
Error Responses
| Error Code | HTTP | Description |
|---|---|---|
RESOURCE_NOT_FOUND | 404 | Collection not found or not owned by you |
AUTH_TOKEN_INVALID | 401 | Invalid or expired token |
Authorizations
JWT access token obtained from /auth/token
Path Parameters
Collection ID, batch ID, or order ID
⌘I

