spoonity logo
      spoonity logo
    • Getting Started

      • Introduction
      • Authentication
      • Handling Errors
      • Webhooks
    • Workflows

      • Placing an order
      • Retrieving a list of checked-in users
      • Registering an account
      • Working with user profiles
      • Reloading an account
    • Resources

      • Billing Profile
      • Card
      • Content
      • Country & Region
      • EGift
      • OnScreen
      • Order
      • User
      • Balances & Rewards
      • Transaction History
      • Inbox
      • Spending Rules
    • Sign in

    Line Item

    Line items include the products purchased as part of an invoice.

    The line item model

    The line item model contains identifying information about the line item.

    Properties

    • Name
      id
      Type
      string
      Description

      Unique identifier for the line item.

    • Name
      parent_id
      Type
      string or null
      Description

      Optional identifier for a nested line item.

    • Name
      invoice_id
      Type
      string
      Description

      Identifier for the invoice the discount is applied to.

    • Name
      product_id
      Type
      string
      Description

      Unique identifier for the product being purchased.

    • Name
      quantity
      Type
      float
      Description

      The number of units purchased.

    • Name
      price
      Type
      float
      Description

      The price per unit purchased.


    POST/line-items

    Create a line item

    This endpoint allows you to add a line item to an invoice. A line item must include an invoice ID, product ID, quantity, and amount.

    Required attributes

    • Name
      invoice_id
      Type
      string
      Description

      The ID of the invoice the line item is linked to.

    • Name
      product_id
      Type
      string
      Description

      The ID of the product being purchased.

    • Name
      quantity
      Type
      float
      Description

      The number of units purchased.

    • Name
      price
      Type
      float
      Description

      The price per unit purchased.

    Optional attributes

    • Name
      parent_id
      Type
      string
      Description

      Identifier for a parent line item to nest this line item under.

    Request

    POST
    /line-items
    curl -G https://api.spoonity.com/line-items \
    -H "Authorization: Bearer {token}" \
    -d invoice_id="invo_yrhst36ruqh41h31" \
    -d product_id="prod_470c4fe22cb2d13a" \
    -d quantity=1 \
    -d price=5.00
    

    Response

    {
      "id": "line_32f9395aa82770bb",
      "parent_id": null,
      "invoice_id": "invo_yrhst36ruqh41h31",
      "product_id": "prod_470c4fe22cb2d13a",
      "quantity": 1,
      "price": 5.00,
    }
    

    PUT/line-items/:id

    Update a line item

    This endpoint allows you to update a line item. Only a line item's quantity and amount can be updated.

    Path parameters

    • Name
      id
      Type
      string
      Description

      The line item ID.

    Optional attributes

    • Name
      quantity
      Type
      float
      Description

      The number of units purchased.

    • Name
      amount
      Type
      float
      Description

      The price per unit purchased.

    Request

    PUT
    /line-items/:id
    curl -G https://api.spoonity.com/line-items/:id \
    --request PUT \
    -H "Authorization: Bearer {token}" \
    -d quantity=2
    

    Response

    {
      "id": "line_32f9395aa82770bb",
      "parent_id": null,
      "invoice_id": "invo_yrhst36ruqh41h31",
      "product_id": "prod_470c4fe22cb2d13a",
      "quantity": 2,
      "price": 5.00,
    }
    

    DELETE/line-items/:id

    Delete a line item

    This endpoint allows you to remove a line item from an invoice.

    Path parameters

    • Name
      id
      Type
      string
      Description

      The line item ID.

    Request

    DELETE
    /line-items/:id
    curl -G https://api.spoonity.com/line-items/:id \
    --request DELETE \
    -H "Authorization: Bearer {token}"
    

    Response

    {}
    

    Was this page helpful?

    PreviousJourney
    NextMessage

    © Copyright 2026 Spoonity, Inc. All rights reserved.