Skip to main content
POST
/
v1
/
line_items
/
upsell
Upsell
curl --request POST \
  --url https://{defaultHost}/v1/line_items/upsell \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "line_item": {
    "price": "f5af0064-fb07-47a0-8f89-4997715ba221",
    "checkout": "953ac87d-7010-4dfa-9b5c-60a5a354f05e",
    "upsell": "fc5025ef-e731-42fa-b272-1bc5ab96e808"
  }
}
'
{
  "id": "8e3c3560-5008-4bc2-b061-4785c5145024",
  "object": "line_item",
  "ad_hoc_amount": null,
  "discount_amount": 0,
  "fees_amount": -500,
  "full_amount": 2400,
  "fulfilled_quantity": 0,
  "locked": false,
  "note": null,
  "purchasable_status": "purchasable",
  "quantity": 1,
  "g_weight": 0,
  "unit_g_weight": 0,
  "scratch_amount": 2900,
  "stock_held": true,
  "subtotal_amount": 2900,
  "tax_amount": 0,
  "tax_rate": 0,
  "total_amount": 2400,
  "total_savings_amount": -500,
  "trial": false,
  "trial_amount": 0,
  "variant_options": null,
  "variant_option_names": null,
  "bump": null,
  "checkout": "953ac87d-7010-4dfa-9b5c-60a5a354f05e",
  "price": "f5af0064-fb07-47a0-8f89-4997715ba221",
  "upsell": "fc5025ef-e731-42fa-b272-1bc5ab96e808",
  "variant": null,
  "swap": null,
  "created_at": 1767909720,
  "updated_at": 1767909720
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

preview
boolean

Whether or not the endpoint should return a preview of the result. If true, no modifications to the resource will be saved.

Body

application/json
line_item
object

Response

200 - application/json

Success

id
string | null

The UUID of the specific object.

object
string

A string describing the object type returned.

ad_hoc_amount
integer | null

The amount to use for this line item when the associated price is ad_hoc=true.

quantity
integer

The quantity of products being purchased.

note
string | null

A custom note for this line item. Useful for adding context or special instructions related to the product or purchase.

bump

Expandable – The associated bump ID.

checkout

Expandable – The associated checkout ID.

checkout_fees_amount
integer

The total amount of checkout fees applied to this line item.

discount_amount
integer

Total discount amount applied to this line item.

fees

Expandable – Property not returned unless expanded.

fees_amount
integer

The total amount of fees applied to this line item.

full_amount
integer

The full amount to be charged across all periods.

fulfilled_quantity
integer

The quantity of products that have been fulfilled.

g_weight
number

Total weight of all items (quantity * unit_g_weight) in grams.

locked
boolean

Whether or not this line item is locked. If locked, it cannot be edited or deleted. Line items are locked when an invoice is opened.

price

Expandable – The associated price ID.

unit_g_weight
number

Total weight of the product in grams.

purchasable_status
string

The status indicating if this line item can be purchased (finalized with) or not and why. Possible values are price_gone, price_old_version, variant_mising, variant_gone, variant_old_version, out_of_stock, exceeds_purchase_limit, or purchasable.

scratch_amount
integer

The amount in cents that should be shown as the original amount before any price reductions, also known as the pre-sale price.

stock_held
boolean

Whether or not stock is being held for this line item. (This only applies to the quantity that has not been fulfilled.)

subtotal_amount
integer

Total before any discounts or taxes are applied.

swap

Expandable – The associated swap ID.

tax_amount
integer

Total tax amount.

tax_rate
number

The tax rate for this line item.

total_amount
integer

Total after discounts and taxes are applied.

total_savings_amount
integer

The total amount in cents that was saved on this line item taking into account all negative fees, discounts, and all price scratch_amount values.

trial
boolean

Set to true if this line item is for a price that has a trial.

trial_amount
integer

The total amount in cents that is removed from this line item due to a trial period.

upsell

Expandable – The associated upsell ID.

variant

Expandable – The associated variant ID.

variant_options
array | null

An array of the associated variant's options.

variant_option_names
array | null

An array of the associated product's variant option names.

created_at
integer | null

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at
integer | null

Time at which the object was last updated. Measured in seconds since the Unix epoch.