Skip to content

Creates a line item

Request

POST {{baseURL}}/pay-int-api/line-items

This endpoint creates a new line item in the merchant's catalog.

The catalog is the collective set of line items assigned to a merchant. A line item represents a single product or service that can be added to an invoice. Each request must include the item name, unit price, and unit type. When adding a line item to an invoice, the unit price can be overwritten.

A minimal request only needs three fields to succeed. Category and tax rate are optional and can be added later if needed.

Here is the simple example:

{
  "productName": "Wireless Mouse",
  "unitPrice": 18.99,
  "unitTypeId": 1
}

This creates a catalog item priced at $18.99, measured by the unit type specified. The response returns the new line item along with its generated ID.

See Also:
To list line items, see GET /pay-int-api/line-items.
To retrieve line item unit types, see GET /pay-int-api/line-items/unit-types.
To update a line item, see PUT /pay-int-api/line-items/{lineItemId}.
To delete a line item, see DELETE /pay-int-api/line-items/{lineItemId}.

Security
Bearer
Headers
x-api-versionstring

Specifies the API version to use for the request.

Example: 1.0

Example:1.0
Bodyapplication/json

The line item creation request.

productNamestring or null, <= 50 charactersrequired

Indicates the name of the item.

Example: RollerMouse Wireless Mouse

Example:"RollerMouse Wireless Mouse"
unitTypeIdinteger, (int32)required

Indicates the identifier of the unit type.

This is a numeric identifier represents the unit of measure for the item. Each supplier provides their own lookup value. That value maps to a predefined unit type in their system.

Example: 1

Example:1
unitPricenumber, (double), decimal places <= 2, >= 0.01required

Indicates the unit price (in USD) of the item.

Example: 18.99 (for $18.99)

Example:18.99
descriptionstring, <= 200 characters

Indicates a description of the item.

Example: RollerMouse Design Collection, Limited Edition Wireless Mouse

Example:"RollerMouse Design Collection, Limited Edition Wireless Mouse"
skustring or null, <= 100 characters

Indicates the product identifier item.

Example: 24474771

Example:"24474771"
categoryIdstring or null, (uuid)

Indicates the identifier of the item category.

Example: a2d1c4b5-6e7f-4890-9abc-1d2e3f4a5b68

Example:"a2d1c4b5-6e7f-4890-9abc-1d2e3f4a5b68"
taxRatenumber, (double)

Indicates the type of tax rate.

Example: 3.25 (as 3.25%)

Example:3.25
curl -i -X POST \
  https://developer.flute.com/_mock/api-reference/pay-int-api/line-items \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'x-api-version: 1.0' \
  -d '{
    "productName": "RollerMouse Wireless Mouse",
    "unitTypeId": 1,
    "unitPrice": 18.99,
    "description": "RollerMouse Design Collection, Limited Edition Wireless Mouse",
    "sku": "24474771",
    "categoryId": "a2d1c4b5-6e7f-4890-9abc-1d2e3f4a5b68",
    "taxRate": 3.25
  }'

Responses

OK

Bodyapplication/json
idstring, (uuid)

Indicates the line item identifier.

Example: 6f2e4a3b-9c1d-4e5f-8a7b-2d3c4e5f6a7b

Example:"6f2e4a3b-9c1d-4e5f-8a7b-2d3c4e5f6a7b"
Response
{ "id": "6f2e4a3b-9c1d-4e5f-8a7b-2d3c4e5f6a7b" }