Search Documentation

Search across all documentation pages, APIs and guides.

Items Management

Create and manage product or service line items. Attach items to a payment transaction via the items array to give customers a clear, itemized view of exactly what they are purchasing, only available for custom API integrations.

Up to two items will be added to the payment success receipt generated by OnePay. This communicates a clear purchase picture to your customers and builds trust at the point of payment.

E-commerce

Show product names and prices on the checkout receipt. Customers see exactly what they paid for, reducing disputes and chargebacks.

Subscriptions & SaaS

Attach the plan name and billing period as line items so customers recognise charges on their bank statement.

Invoicing

Map invoice line items to OnePay items for an itemized receipt that matches your invoice, useful for B2B reconciliation.

Custom metadata

Store internal attributes (SKU, brand, RAM, batch ID) in the metadata array for your own reporting without affecting the customer-facing display.

Create Item

POSThttps://api.onepay.lk/v3/item/
PARAMETER
PARAMETERTYPEDESCRIPTION
name
required
string
Product or service name.
description
required
string
Short description of the item.
price
required
number
Unit price, e.g. 1400.99.
currency
required
string
LKR or USD.
image_url
optional
string
Public URL of a product image shown on checkout.
metadata
optional
object
Arbitrary key-value pairs for internal cataloguing (e.g. brand, SKU, RAM).
RESPONSE PARAMETERS
ParameterTypeDescription
status
Number
Status code of the response (e.g., 200 for success)
message
String
Response message indicating the result of the operation
data
Object
Contains the response data
data.item_id
String
Unique identifier of the created item

Get items

GEThttps://api.onepay.lk/v3/item/?app_id={app_id}

Returns all items created under your App ID. Pass app_id as a query parameter no request body required.

QUERY PARAMETERS
PARAMETERTYPEDESCRIPTION
app_id
required
string
Your application identifier.
RESPONSE PARAMETERS — 200 OK
FIELDTYPEDESCRIPTION
status
number
Status code of the response (e.g. 200 for success).
message
string
Response message indicating the result of the operation.
data
array
Array of item objects.
data[].item_id
string
Unique identifier for the item.
data[].name
string
Name of the item.
data[].description
string
Description of the item.
data[].price
string
Price of the item.
data[].currency
string
Currency code for the price.
data[].image_url
string
URL of the item's image.
data[].is_deleted
boolean
Indicates if the item has been deleted.
data[].metadata
array
Array of metadata objects for the item.
data[].metadata[].key
string
Key of the metadata property.
data[].metadata[].value
string
Value of the metadata property.
data[].metadata[].is_deleted
boolean
Indicates if this metadata property has been deleted.

Update item

PUThttps://api.onepay.lk/v3/item/{item_id}/

Update any field on an existing item. Pass only the fields you want to change all other fields retain their current values.

REQUEST BODY
PARAMETERTYPEDESCRIPTION
app_id
required
string
Your application identifier.
name
optional
string
Updated item name.
price
optional
number
Updated unit price.
description
optional
string
Updated description.
image_url
optional
string
Updated product image URL.
metadata
optional
array
Updated metadata array. Replaces the existing metadata entirely.
RESPONSE PARAMETERS
FIELDTYPEDESCRIPTION
status
number
Status code of the response (e.g. 200 for success).
message
string
Response message indicating the result of the operation.
data
object
Contains the response data.
data.item_id
string
Unique identifier of the updated item.

Delete Item

DELETEhttps://api.onepay.lk/v3/item/{item_id}/?app_id={app_id}

Permanently removes an item record. Items already attached to completed transactions cannot be deleted.

QUERY PARAMETERS
PARAMETERTYPEDESCRIPTION
app_id
required
string
Your application identifier.
RESPONSE PARAMETERS
FIELDTYPEDESCRIPTION
status
number
Status code of the response (e.g. 200 for success).
message
string
Response message indicating the result of the operation.