spoonity logo
    • API
    • Documentation
    • Support
    • 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

    Discount

    Discounts are modifiers applied to orders that offset cost. Discounts can also be linked to loyalty spending rules.

    The discount model

    The discount model contains identifying information about the discount.

    Properties

    • Name
      id
      Type
      string
      Description

      Unique identifier for the discount.

    • Name
      spending_rule_id
      Type
      string or null
      Description

      Optional identifier for a linked loyalty spending rule.

    • Name
      invoice_id
      Type
      string
      Description

      Identifier for the invoice the discount is applied to.

    • Name
      line_item_id
      Type
      string or null
      Description

      Optional identifier for the line item the discount is applied to.

    • Name
      amount
      Type
      float
      Description

      The amount of the discount.


    POST/discounts

    Create a discount

    This endpoint allows you to apply a discount to an invoice. A discount must include an invoice ID and an amount.

    Required attributes

    • Name
      invoice_id
      Type
      string
      Description

      The ID of the invoice the discount is applied to.

    • Name
      amount
      Type
      float
      Description

      The amount of the discount.

    Optional attributes

    • Name
      spending_rule_id
      Type
      string
      Description

      Identifier for a linked loyalty spending rule.

    • Name
      line_item_id
      Type
      string
      Description

      Identifier for the line item the discount is applied to.

    Request

    POST
    /discounts
    curl -G https://api.spoonity.com/discounts \
    -H "Authorization: Bearer {token}" \
    -d invoice_id="invo_yrhst36ruqh41h31" \
    -d amount=5.00
    

    Response

    {
      "id": "disc_32f9395aa82770bb",
      "invoice_id": "invo_yrhst36ruqh41h31",
      "spending_rule_id": null,
      "line_item_id": null,
      "amount": 5.00,
    }
    

    PUT/discounts/:id

    Update a discount

    This endpoint allows you to update a discount. Only a discount's amount can be updated.

    Path parameters

    • Name
      id
      Type
      string
      Description

      The discount ID.

    Optional attributes

    • Name
      amount
      Type
      float
      Description

      The amount of the discount.

    Request

    PUT
    /discounts/:id
    curl -G https://api.spoonity.com/discounts/:id \
    --request PUT \
    -H "Authorization: Bearer {token}" \
    -d amount=10.00
    

    Response

    {
      "id": "disc_32f9395aa82770bb",
      "invoice_id": "invo_yrhst36ruqh41h31",
      "spending_rule_id": null,
      "line_item_id": null,
      "amount": 10.00,
    }
    

    DELETE/discounts/:id

    Delete a discount

    This endpoint allows you to remove a discount from an invoice.

    Path parameters

    • Name
      id
      Type
      string
      Description

      The discount ID.

    Request

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

    Response

    {}
    

    Was this page helpful?

    PreviousCustomer
    NextInvoice

    © Copyright 2026 Spoonity, Inc. All rights reserved.