Skip to Content

Items

List saved items

GET /i/v1/items

item.read. Non-archived by default (archived=true archived only, all both); q is a case-insensitive substring over name, description, sku, hsnCode and serviceCode; sorted most used first (-useCount), by name, or -lastUsedAt. The token’s mode decides which items are read.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
qquerystringNoCase-insensitive substring over name, description, sku, hsnCode, serviceCode. At most 100 characters.
itemTypequerystringNoOne of goods | service.
archivedquerystringNofalse non-archived (default), true archived only, all both. One of false | true | all. Default: false.
sortquerystringNoOne of -useCount | name | -lastUsedAt. Default: -useCount.
pagequerynumberNoDefault: 1. At least 1.
limitquerynumberNoDefault: 20. Between 1 and 100.

Example request

bash
curl https://gp.useyona.com/i/v1/items \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

One page of items, meta.pagination set.

Errors: 400, 401, 403, 429, 500, 503


Save an item

POST /i/v1/items

item.create; charged per item before it is saved (refunded if the save fails). A goods item needs an hsnCode, a service item a serviceCode; productCategory is required; taxCategory is a code-list id of the organization’s jurisdiction (a line alias is stored resolved); sku, when sent, is unique among the organization’s non-archived items. Emits the invoice.item.created event.

Who can call it: API key or signed-in user.

Request body

FieldTypeRequiredDescription
namestringYesThe item’s name. A line built from the item that sends no description or itemName of its own takes this. 1 to 255 characters.
descriptionstring or nullNoA longer description of the item; null and absent are the same. A line built from the item does not copy it. At most 1000 characters.
itemTypestringYesgoods (needs an hsnCode, no serviceCode) or service (needs a serviceCode, no hsnCode). It cannot be changed later. One of goods | service.
hsnCodestring or nullNoRequired for goods.
serviceCodestring or nullNoRequired for services.
productCategorystringYesThe product category a line built from the item carries to the tax authority (the HS or service code’s description); never blank. 1 to 500 characters.
unitCodestringYesThe unit of measure, as a unit code (EA each, HUR hour, KGM kilogram).
unitPriceMinorstringYesMinor units as a decimal string (₦1,500.50 → “150050”); at most 10^14 — the same maximum as an invoice line’s unit price.
currencystringYesISO 4217 currency of unitPriceMinor. A line in another currency must send its own unitPrice.
taxCategorystringYesA tax-category id the jurisdiction serves, or a line alias (standard | zero | exempt).
skustring or nullNoUnique among the organization’s non-archived items. At most 64 characters.

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/items \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Consulting hour",
    "description": "One hour of software consulting",
    "itemType": "service",
    "hsnCode": "8471.30",
    "serviceCode": "6201",
    "productCategory": "Machinery",
    "unitCode": "EA",
    "unitPriceMinor": "150050",
    "currency": "NGN",
    "taxCategory": "STANDARD_VAT",
    "sku": "CONS-HR"
  }'

Responses

The saved item.

Errors: 400, 401, 402, 403, 409, 413, 415, 422, 429, 500, 503


Get a saved item

GET /i/v1/items/{id}

item.read. An archived item is readable by id (archivedAt set).

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Example request

bash
curl https://gp.useyona.com/i/v1/items/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The item.

Errors: 400, 401, 403, 404, 429, 500, 503


Update a saved item

PATCH /i/v1/items/{id}

item.update. The create fields, all optional; itemType is immutable; a sku change obeys the unique rule; an archived item is editable but not usable on a line. Lines already built from the item never change. Charged ITEM_UPDATE per request only when the body changes something (a no-op edit is free; refunded when the write then changes nothing). Emits the invoice.item.updated event.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes
Idempotency-KeyheaderstringNo8–128 characters of A–Z, a–z, 0–9, _ or -. A retry with the same key is not charged twice (the work is done again); the key is bound to its first request, so another request with it is 409 BIZ107.

Request body

FieldTypeRequiredDescription
namestringNoThe item’s name; it can be changed, not cleared. 1 to 255 characters.
descriptionstring or nullNoA longer description of the item; null clears it. At most 1000 characters.
itemTypestringNoImmutable: only the stored value is accepted. One of goods | service.
hsnCodestring or nullNoThe HS code of a goods item; a goods item cannot clear it, a service item cannot carry one.
serviceCodestring or nullNoThe service code of a service item; a service item cannot clear it, a goods item cannot carry one.
productCategorystringNoThe product category a line built from the item carries; it can be changed, not cleared. 1 to 500 characters.
unitCodestringNoThe unit of measure, as a unit code.
unitPriceMinorstringNoMinor units as a decimal string, as on create (₦27,500.00 → “2750000”).
currencystringNoISO 4217 currency of unitPriceMinor.
taxCategorystringNoA tax-category id the jurisdiction serves, or a line alias (standard | zero | exempt); stored resolved.
skustring or nullNoUnique among the organization’s non-archived items; null clears it. At most 64 characters.

Example request

bash
curl -X PATCH https://gp.useyona.com/i/v1/items/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer sk_test_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Consulting hour",
    "description": "One hour of software consulting",
    "itemType": "service",
    "hsnCode": "8471.30",
    "serviceCode": "6201",
    "productCategory": "Computer programming activities",
    "unitCode": "HUR",
    "unitPriceMinor": "2750000",
    "currency": "NGN",
    "taxCategory": "STANDARD_VAT",
    "sku": "CONS-HR"
  }'

Responses

The item after the edit.

Errors: 400, 401, 402, 403, 404, 409, 413, 415, 422, 429, 500, 503


Delete a saved item

DELETE /i/v1/items/{id}

item.archive. Hard delete only while no invoice line of this mode’s database references the item (drafts included); otherwise 409 BIZ004 — archive it instead. Answers 200 {id, deleted: true}. Emits the invoice.item.deleted event.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Example request

bash
curl -X DELETE https://gp.useyona.com/i/v1/items/9f8e7d6c-5b4a-3210-fedc-ba9876543210 \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The item was deleted.

Errors: 400, 401, 403, 404, 409, 429, 500, 503


Archive a saved item

POST /i/v1/items/{id}/archive

item.archive. Idempotent (an archived item answers 200 with the same view). An archived item is left out of the item list by default and refused on a new line (409 BIZ004); lines that already carry it are untouched. Emits the invoice.item.archived event.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/items/9f8e7d6c-5b4a-3210-fedc-ba9876543210/archive \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The archived item.

Errors: 400, 401, 403, 404, 429, 500, 503


Unarchive a saved item

POST /i/v1/items/{id}/unarchive

item.archive. Idempotent. Refused 409 RES002 when another non-archived item took the sku meanwhile. Emits the invoice.item.unarchived event.

Who can call it: API key or signed-in user.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Example request

bash
curl -X POST https://gp.useyona.com/i/v1/items/9f8e7d6c-5b4a-3210-fedc-ba9876543210/unarchive \
  -H "Authorization: Bearer sk_test_your_key_here"

Responses

The item, live again.

Errors: 400, 401, 403, 404, 409, 429, 500, 503