Skip to main content

Payment Items

Overview​

Payment Items endpoints provide access to the products and services configured for merchant transactions. These endpoints allow merchants to retrieve available payment options, view detailed configurations, and understand pricing and requirements before initializing transactions.

1. Get Payment Items​

Endpoint: GET /api/v1/transactions/in/payment-items

Purpose: Retrieves a complete list of all active payment items configured for the merchant account.

Authentication: Bearer token (merchant_secret_key) in Authorization header

Code Snippets​

const url = "https://ags.payislands.com/api/v1/transactions/in/payment-items";

const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MERCHANT_SECRET_KEY}` },
});

const json = await res.json();
console.log(json);

Sample cURL Request​

curl -X GET "https://ags.payislands.com/api/v1/transactions/in/payment-items" \
-H "Authorization: Bearer {{merchant_secret_key}}"

Success Response (200 OK)​

{
"status": true,
"message": "payment items fetched successfully",
"data": [
{
"id": 3,
"core_service_business_id": 2,
"name": "Testing Item",
"description": null,
"amount": "1000",
"form_data": [],
"transaction_split_code": "TS_PSL2v2CwhVQoGCG8cdf9CoEOiGn",
"is_enumerated_data": false,
"category": 1,
"category_details": {
"id": 1,
"name": "Government",
"status": 1
},
"sub_category": 1,
"sub_category_details": {
"id": 1,
"name": "Federal",
"status": 1
},
"status": 1,
"is_deleted": false,
"created_at": "2024-09-20T06:06:30.215Z",
"allow_quick_print": true
},
{
"id": 13,
"core_service_business_id": 2,
"name": "Coke Zero",
"description": null,
"amount": "500000",
"form_data": [
{
"name": "Name",
"type": "input",
"value": "",
"options": [],
"required": true
},
{
"name": "Age",
"type": "input",
"value": "",
"options": [],
"required": true
}
],
"transaction_split_code": "TS_PSL2E7qXJkAGp4wyuIDDwn2E83U",
"is_enumerated_data": false,
"category": 1,
"category_details": {
"id": 1,
"name": "Government",
"status": 1
},
"sub_category": 1,
"sub_category_details": {
"id": 1,
"name": "Federal",
"status": 1
},
"status": 1,
"is_deleted": false,
"created_at": "2024-10-07T06:50:56.339Z",
"allow_quick_print": true
}
],
"statusCode": 200
}

Failure Response (403 Forbidden)​

{
"message": "Forbidden resource",
"error": "Forbidden",
"statusCode": 403
}

2. Get Payment Item Details​

Endpoint: GET /api/v1/transactions/in/payment-item/{payment_item_id}

Purpose: Fetches comprehensive details for a specific payment item by ID.

Authentication: Bearer token (merchant_secret_key) in Authorization header

Path Parameter: payment_item_id (Integer) - Unique identifier of the payment item

Code Snippets​

const paymentItemId = 3;
const url = `https://ags.payislands.com/api/v1/transactions/in/payment-item/${paymentItemId}`;

const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MERCHANT_SECRET_KEY}` },
});

const json = await res.json();
console.log(json);

Sample cURL Request​

curl -X GET "https://ags.payislands.com/api/v1/transactions/in/payment-item/3" \
-H "Authorization: Bearer {{merchant_secret_key}}"

Success Response (200 OK)​

{
"status": true,
"message": "payment item details fetched successfully",
"data": {
"id": 3,
"core_service_business_id": 2,
"name": "Testing Item",
"description": null,
"amount": "1000",
"form_data": [],
"transaction_split_code": "TS_PSL2v2CwhVQoGCG8cdf9CoEOiGn",
"is_enumerated_data": false,
"category": 1,
"category_details": {
"id": 1,
"name": "Government",
"status": 1,
"delete_at": null,
"created_at": "2024-09-12T20:31:41.030Z",
"created_by": 1,
"is_deleted": false,
"updated_at": "2024-09-12T20:31:41.030Z"
},
"sub_category": 1,
"sub_category_details": {
"id": 1,
"name": "Federal",
"status": 1,
"delete_at": null,
"created_at": "2024-09-12T20:31:41.583Z",
"created_by": 1,
"is_deleted": false,
"updated_at": "2024-09-12T20:31:41.583Z",
"business_registration_type_id": 1
},
"status": 1,
"is_deleted": false,
"created_at": "2024-09-20T06:06:30.215Z",
"allow_quick_print": true
},
"statusCode": 200
}

Key Fields in Payment Item Objects​

GroupFieldTypeDescriptionExample / Notes
IdentificationidintegerUnique payment item identifier.3
IdentificationnamestringDisplay name."Testing Item"
Identificationdescriptionstring | nullAdditional product info (often null).null
Identificationcore_service_business_idintegerAssociated business identifier.2
PricingamountstringBase price in Naira (NGN major units), with up to two decimal places. "1000" means ₦1,000.00. Fixed items have a value; variable items often use "0"."1000", "500000", "0"
Formform_dataarrayCustom fields required to pay for this item.[] or [{name,type,value,options,required}]
Formis_enumerated_databooleanIndicates whether the item uses enumerated data.false
Revenue splittransaction_split_codestringRevenue split configuration ID.TS_PSL...
ClassificationcategoryintegerCategory ID.1
Classificationcategory_detailsobjectCategory metadata (name, status, etc.).{ id, name, status, ... }
Classificationsub_categoryintegerSub-category ID.1
Classificationsub_category_detailsobjectSub-category metadata.{ id, name, status, ... }
FlagsstatusintegerItem status: typically 1 = active.1
Flagsis_deletedbooleanWhether the item is deleted/archived.false
Flagsallow_quick_printbooleanWhether receipts/quick print is supported.true
Flagscan_edit_itembooleanWhether this item can be edited (in detailed response).true/false
Flagsshow_on_agent_appbooleanVisibility in agent apps (in detailed response).true/false
Timestampscreated_atstring (ISO8601)When the item was created."2024-09-20T06:06:30.215Z"
Timestampsupdated_atstring (ISO8601)Last modification time (in detailed response)."2024-09-12T20:31:41.030Z"
Timestampsdelete_atstring (ISO8601) | nullDeletion timestamp (usually null).null

Common Use Cases​

1. Payment Selection Interface​

Fetch all payment items, filter by active status and category, display with names and amounts for customer selection.

2. Dynamic Form Generation​

Retrieve payment item details, parse form_data array, dynamically generate input fields with validation based on configuration.

3. Amount Verification​

Before transaction initialization, fetch payment item details to verify amount matches for fixed-amount items or validate range for variable items.

4. Revenue Split Verification​

Check transaction_split_code to understand default fund distribution before initializing transaction or to display settlement information.

5. Category-Based Navigation​

Filter payment items by category_details and sub_category_details to create organized navigation structure (Government > Federal > specific items).