API reference

Quotes

A Quote is a way to model prices that you'd like to provide to a customer. Once accepted, it will automatically create an invoice, subscription or subscription schedule.

Knox answers these operations with the same requests and responses as Stripe's API. Authenticate with your secret key, Authorization: Bearer sk_test_..., from your server, and send form-encoded bodies. Test mode only: live processing is currently disabled.

Create a quote

POST/v1/quotes

A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the quote template.

Body parameters

  • application_fee_amountinteger

    The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.

  • application_fee_percentnumber

    A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field.

  • automatic_taxobject

    Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.

    Show 2 child parameters
    • enabledbooleanRequired
    • liabilityobject
      Show 2 child parameters
      • typestringRequired
        Possible values
        • account
        • self
      • accountstring
  • collection_methodstring

    Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as active. Defaults to charge_automatically.

    Possible values
    • charge_automatically
    • send_invoice
  • customerstring

    The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.

  • customer_accountstring

    The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.

  • default_tax_ratesarray of strings

    The tax rates that will apply to any line item that does not have tax_rates set.

  • descriptionstring

    A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your quote template settings will be used.

  • discountsarray of objects

    The discounts applied to the quote.

    Show 3 child parameters
    • couponstring
    • discountstring
    • promotion_codestring
  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • expires_atinteger

    A future timestamp on which the quote will be canceled if in open or draft status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your quote template settings will be used.

  • footerstring

    A footer that will be displayed on the quote PDF. If no value is passed, the default footer configured in your quote template settings will be used.

  • from_quoteobject

    Clone an existing quote. The new quote will be created in status=draft. When using this parameter, you cannot specify any other parameters except for expires_at.

    Show 2 child parameters
    • quotestringRequired
    • is_revisionboolean
  • headerstring

    A header that will be displayed on the quote PDF. If no value is passed, the default header configured in your quote template settings will be used.

  • invoice_settingsobject

    All invoices will be billed using the specified settings.

    Show 5 child parameters
    • custom_fieldsarray of objects
      Show 2 child parameters
      • namestringRequired
      • valuestringRequired
    • days_until_dueinteger
    • descriptionstring
    • footerstring
    • issuerobject
      Show 2 child parameters
      • typestringRequired
        Possible values
        • account
        • self
      • accountstring
  • line_itemsarray of objects

    A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.

    Show 5 child parameters
    • discountsarray of objects
      Show 3 child parameters
      • couponstring
      • discountstring
      • promotion_codestring
    • pricestring
    • price_dataobject
      Show 6 child parameters
      • currencystringRequired
      • productstringRequired
      • recurringobject

        Child parameters are listed in the OpenAPI document.

      • tax_behaviorstring
        Possible values
        • exclusive
        • inclusive
        • unspecified
      • unit_amountinteger
      • unit_amount_decimalstring
    • quantityinteger
    • tax_ratesarray of strings
  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

  • on_behalf_ofstring

    The account on behalf of which to charge.

  • subscription_dataobject

    When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if subscription_data[effective_date] is present and in the future, otherwise a subscription is created.

    Show 5 child parameters
    • billing_modeobject
      Show 2 child parameters
      • typestringRequired
        Possible values
        • classic
        • flexible
      • flexibleobject

        Child parameters are listed in the OpenAPI document.

    • descriptionstring
    • effective_datestring | integer
      Possible values
      • current_period_end
    • metadataobject
    • trial_period_daysinteger
  • test_clockstring

    ID of the test clock to attach to the quote.

  • transfer_dataobject

    The data with which to automatically create a Transfer for each of the invoices.

    Show 3 child parameters
    • destinationstringRequired
    • amountinteger
    • amount_percentnumber

Returns

The quote object.

POST /v1/quotes
curl -X POST https://api.knoxapi.com/v1/quotes \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "amount_subtotal": 0,
  "amount_total": 0,
  "application": null,
  "application_fee_amount": null,
  "application_fee_percent": null,
  "automatic_tax": {
    "enabled": false,
    "liability": {
      "type": "account"
    },
    "status": null,
    "provider": null
  },
  "collection_method": "charge_automatically",
  "computed": {
    "recurring": {
      "amount_subtotal": 1555417355,
      "amount_total": 1117121693,
      "interval": "month",
      "interval_count": 797691627,
      "total_details": {
        "amount_discount": 406046392,
        "amount_shipping": null,
        "amount_tax": 1424534716
      }
    },
    "upfront": {
      "amount_subtotal": 0,
      "amount_total": 0,
      "total_details": {
        "amount_discount": 0,
        "amount_shipping": 0,
        "amount_tax": 0
      }
    }
  },
  "created": 1234567890,
  "currency": "usd",
  "customer": "cus_QXg1o8vcGmoR32",
  "default_tax_rates": [],
  "description": null,
  "discounts": [],
  "expires_at": 1234567890,
  "footer": null,
  "from_quote": {
    "is_revision": true,
    "quote": "quote"
  },
  "header": null,
  "id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
  "invoice": null,
  "invoice_settings": {
    "days_until_due": null,
    "issuer": {
      "type": "self"
    },
    "custom_fields": null,
    "description": null,
    "footer": null
  },
  "livemode": false,
  "metadata": {},
  "number": null,
  "object": "quote",
  "on_behalf_of": null,
  "status": "draft",
  "status_transitions": {
    "accepted_at": null,
    "canceled_at": null,
    "finalized_at": null
  },
  "subscription": null,
  "subscription_data": {
    "description": null,
    "effective_date": null,
    "metadata": null,
    "trial_period_days": null,
    "billing_mode": {
      "type": "classic"
    }
  },
  "subscription_schedule": null,
  "test_clock": null,
  "total_details": {
    "amount_discount": 0,
    "amount_shipping": 0,
    "amount_tax": 0
  },
  "transfer_data": {
    "amount": null,
    "amount_percent": null,
    "destination": {
      "id": "obj_123",
      "object": "account"
    }
  },
  "customer_account": null
}

List all quotes

GET/v1/quotes

Returns a list of your quotes.

Query parameters

  • customerstring

    The ID of the customer whose quotes you're retrieving.

  • customer_accountstring

    The ID of the account representing the customer whose quotes you're retrieving.

  • ending_beforestring

    A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • starting_afterstring

    A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

  • statusstring

    The status of the quote.

    Possible values
    • accepted
    • canceled
    • draft
    • open
  • test_clockstring

    Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set.

Returns

A list of quote objects.

GET /v1/quotes
curl -G https://api.knoxapi.com/v1/quotes \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "object": "list",
  "url": "/v1/quotes",
  "has_more": false,
  "data": [
    {
      "amount_subtotal": 0,
      "amount_total": 0,
      "application": null,
      "application_fee_amount": null,
      "application_fee_percent": null,
      "automatic_tax": {
        "enabled": false,
        "liability": {
          "type": "account"
        },
        "status": null,
        "provider": null
      },
      "collection_method": "charge_automatically",
      "computed": {
        "recurring": {
          "amount_subtotal": 1555417355,
          "amount_total": 1117121693,
          "interval": "month",
          "interval_count": 797691627,
          "total_details": {
            "amount_discount": 406046392,
            "amount_shipping": null,
            "amount_tax": 1424534716
          }
        },
        "upfront": {
          "amount_subtotal": 0,
          "amount_total": 0,
          "total_details": {
            "amount_discount": 0,
            "amount_shipping": 0,
            "amount_tax": 0
          }
        }
      },
      "created": 1234567890,
      "currency": "usd",
      "customer": "cus_QXg1o8vcGmoR32",
      "default_tax_rates": [],
      "description": null,
      "discounts": [],
      "expires_at": 1234567890,
      "footer": null,
      "from_quote": {
        "is_revision": true,
        "quote": "quote"
      },
      "header": null,
      "id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
      "invoice": null,
      "invoice_settings": {
        "days_until_due": null,
        "issuer": {
          "type": "self"
        },
        "custom_fields": null,
        "description": null,
        "footer": null
      },
      "livemode": false,
      "metadata": {},
      "number": null,
      "object": "quote",
      "on_behalf_of": null,
      "status": "draft",
      "status_transitions": {
        "accepted_at": null,
        "canceled_at": null,
        "finalized_at": null
      },
      "subscription": null,
      "subscription_data": {
        "description": null,
        "effective_date": null,
        "metadata": null,
        "trial_period_days": null,
        "billing_mode": {
          "type": "classic"
        }
      },
      "subscription_schedule": null,
      "test_clock": null,
      "total_details": {
        "amount_discount": 0,
        "amount_shipping": 0,
        "amount_tax": 0
      },
      "transfer_data": {
        "amount": null,
        "amount_percent": null,
        "destination": {
          "id": "obj_123",
          "object": "account"
        }
      },
      "customer_account": null
    }
  ]
}

Update a quote

POST/v1/quotes/{quote}

A quote models prices and services for a customer.

Path parameters

  • quotestringRequired

Body parameters

  • application_fee_amountinteger

    The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.

  • application_fee_percentnumber

    A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field.

  • automatic_taxobject

    Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.

    Show 2 child parameters
    • enabledbooleanRequired
    • liabilityobject
      Show 2 child parameters
      • typestringRequired
        Possible values
        • account
        • self
      • accountstring
  • collection_methodstring

    Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as active. Defaults to charge_automatically.

    Possible values
    • charge_automatically
    • send_invoice
  • customerstring

    The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.

  • customer_accountstring

    The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.

  • default_tax_ratesarray of strings

    The tax rates that will apply to any line item that does not have tax_rates set.

  • descriptionstring

    A description that will be displayed on the quote PDF.

  • discountsarray of objects

    The discounts applied to the quote.

    Show 3 child parameters
    • couponstring
    • discountstring
    • promotion_codestring
  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • expires_atinteger

    A future timestamp on which the quote will be canceled if in open or draft status. Measured in seconds since the Unix epoch.

  • footerstring

    A footer that will be displayed on the quote PDF.

  • headerstring

    A header that will be displayed on the quote PDF.

  • invoice_settingsobject

    All invoices will be billed using the specified settings.

    Show 5 child parameters
    • custom_fieldsarray of objects
      Show 2 child parameters
      • namestringRequired
      • valuestringRequired
    • days_until_dueinteger
    • descriptionstring
    • footerstring
    • issuerobject
      Show 2 child parameters
      • typestringRequired
        Possible values
        • account
        • self
      • accountstring
  • line_itemsarray of objects

    A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.

    Show 6 child parameters
    • discountsarray of objects
      Show 3 child parameters
      • couponstring
      • discountstring
      • promotion_codestring
    • idstring
    • pricestring
    • price_dataobject
      Show 6 child parameters
      • currencystringRequired
      • productstringRequired
      • recurringobject

        Child parameters are listed in the OpenAPI document.

      • tax_behaviorstring
        Possible values
        • exclusive
        • inclusive
        • unspecified
      • unit_amountinteger
      • unit_amount_decimalstring
    • quantityinteger
    • tax_ratesarray of strings
  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

  • on_behalf_ofstring

    The account on behalf of which to charge.

  • subscription_dataobject

    When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if subscription_data[effective_date] is present and in the future, otherwise a subscription is created.

    Show 4 child parameters
    • descriptionstring
    • effective_datestring | integer
      Possible values
      • current_period_end
    • metadataobject
    • trial_period_daysinteger
  • transfer_dataobject

    The data with which to automatically create a Transfer for each of the invoices.

    Show 3 child parameters
    • destinationstringRequired
    • amountinteger
    • amount_percentnumber

Returns

The quote object.

POST /v1/quotes/{quote}
curl https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  -d "metadata[order_id]=6735"
Response
{
  "amount_subtotal": 0,
  "amount_total": 0,
  "application": null,
  "application_fee_amount": null,
  "application_fee_percent": null,
  "automatic_tax": {
    "enabled": false,
    "liability": {
      "type": "account"
    },
    "status": null,
    "provider": null
  },
  "collection_method": "charge_automatically",
  "computed": {
    "recurring": {
      "amount_subtotal": 1555417355,
      "amount_total": 1117121693,
      "interval": "month",
      "interval_count": 797691627,
      "total_details": {
        "amount_discount": 406046392,
        "amount_shipping": null,
        "amount_tax": 1424534716
      }
    },
    "upfront": {
      "amount_subtotal": 0,
      "amount_total": 0,
      "total_details": {
        "amount_discount": 0,
        "amount_shipping": 0,
        "amount_tax": 0
      }
    }
  },
  "created": 1234567890,
  "currency": "usd",
  "customer": "cus_QXg1o8vcGmoR32",
  "default_tax_rates": [],
  "description": null,
  "discounts": [],
  "expires_at": 1234567890,
  "footer": null,
  "from_quote": {
    "is_revision": true,
    "quote": "quote"
  },
  "header": null,
  "id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
  "invoice": null,
  "invoice_settings": {
    "days_until_due": null,
    "issuer": {
      "type": "self"
    },
    "custom_fields": null,
    "description": null,
    "footer": null
  },
  "livemode": false,
  "metadata": {},
  "number": null,
  "object": "quote",
  "on_behalf_of": null,
  "status": "draft",
  "status_transitions": {
    "accepted_at": null,
    "canceled_at": null,
    "finalized_at": null
  },
  "subscription": null,
  "subscription_data": {
    "description": null,
    "effective_date": null,
    "metadata": null,
    "trial_period_days": null,
    "billing_mode": {
      "type": "classic"
    }
  },
  "subscription_schedule": null,
  "test_clock": null,
  "total_details": {
    "amount_discount": 0,
    "amount_shipping": 0,
    "amount_tax": 0
  },
  "transfer_data": {
    "amount": null,
    "amount_percent": null,
    "destination": {
      "id": "obj_123",
      "object": "account"
    }
  },
  "customer_account": null
}

Retrieve a quote

GET/v1/quotes/{quote}

Retrieves the quote with the given ID.

Path parameters

  • quotestringRequired

Query parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The quote object.

GET /v1/quotes/{quote}
curl https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "amount_subtotal": 0,
  "amount_total": 0,
  "application": null,
  "application_fee_amount": null,
  "application_fee_percent": null,
  "automatic_tax": {
    "enabled": false,
    "liability": {
      "type": "account"
    },
    "status": null,
    "provider": null
  },
  "collection_method": "charge_automatically",
  "computed": {
    "recurring": {
      "amount_subtotal": 1555417355,
      "amount_total": 1117121693,
      "interval": "month",
      "interval_count": 797691627,
      "total_details": {
        "amount_discount": 406046392,
        "amount_shipping": null,
        "amount_tax": 1424534716
      }
    },
    "upfront": {
      "amount_subtotal": 0,
      "amount_total": 0,
      "total_details": {
        "amount_discount": 0,
        "amount_shipping": 0,
        "amount_tax": 0
      }
    }
  },
  "created": 1234567890,
  "currency": "usd",
  "customer": "cus_QXg1o8vcGmoR32",
  "default_tax_rates": [],
  "description": null,
  "discounts": [],
  "expires_at": 1234567890,
  "footer": null,
  "from_quote": {
    "is_revision": true,
    "quote": "quote"
  },
  "header": null,
  "id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
  "invoice": null,
  "invoice_settings": {
    "days_until_due": null,
    "issuer": {
      "type": "self"
    },
    "custom_fields": null,
    "description": null,
    "footer": null
  },
  "livemode": false,
  "metadata": {},
  "number": null,
  "object": "quote",
  "on_behalf_of": null,
  "status": "draft",
  "status_transitions": {
    "accepted_at": null,
    "canceled_at": null,
    "finalized_at": null
  },
  "subscription": null,
  "subscription_data": {
    "description": null,
    "effective_date": null,
    "metadata": null,
    "trial_period_days": null,
    "billing_mode": {
      "type": "classic"
    }
  },
  "subscription_schedule": null,
  "test_clock": null,
  "total_details": {
    "amount_discount": 0,
    "amount_shipping": 0,
    "amount_tax": 0
  },
  "transfer_data": {
    "amount": null,
    "amount_percent": null,
    "destination": {
      "id": "obj_123",
      "object": "account"
    }
  },
  "customer_account": null
}

Accept a quote

POST/v1/quotes/{quote}/accept

Accepts the specified quote.

Path parameters

  • quotestringRequired

Body parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The quote object.

POST /v1/quotes/{quote}/accept
curl -X POST https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/accept \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "amount_subtotal": 0,
  "amount_total": 0,
  "application": null,
  "application_fee_amount": null,
  "application_fee_percent": null,
  "automatic_tax": {
    "enabled": false,
    "liability": {
      "type": "account"
    },
    "status": null,
    "provider": null
  },
  "collection_method": "charge_automatically",
  "computed": {
    "recurring": {
      "amount_subtotal": 1555417355,
      "amount_total": 1117121693,
      "interval": "month",
      "interval_count": 797691627,
      "total_details": {
        "amount_discount": 406046392,
        "amount_shipping": null,
        "amount_tax": 1424534716
      }
    },
    "upfront": {
      "amount_subtotal": 0,
      "amount_total": 0,
      "total_details": {
        "amount_discount": 0,
        "amount_shipping": 0,
        "amount_tax": 0
      }
    }
  },
  "created": 1234567890,
  "currency": "usd",
  "customer": "cus_QXg1o8vcGmoR32",
  "default_tax_rates": [],
  "description": null,
  "discounts": [],
  "expires_at": 1234567890,
  "footer": null,
  "from_quote": {
    "is_revision": true,
    "quote": "quote"
  },
  "header": null,
  "id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
  "invoice": null,
  "invoice_settings": {
    "days_until_due": null,
    "issuer": {
      "type": "self"
    },
    "custom_fields": null,
    "description": null,
    "footer": null
  },
  "livemode": false,
  "metadata": {},
  "number": null,
  "object": "quote",
  "on_behalf_of": null,
  "status": "draft",
  "status_transitions": {
    "accepted_at": null,
    "canceled_at": null,
    "finalized_at": null
  },
  "subscription": null,
  "subscription_data": {
    "description": null,
    "effective_date": null,
    "metadata": null,
    "trial_period_days": null,
    "billing_mode": {
      "type": "classic"
    }
  },
  "subscription_schedule": null,
  "test_clock": null,
  "total_details": {
    "amount_discount": 0,
    "amount_shipping": 0,
    "amount_tax": 0
  },
  "transfer_data": {
    "amount": null,
    "amount_percent": null,
    "destination": {
      "id": "obj_123",
      "object": "account"
    }
  },
  "customer_account": null
}

Cancel a quote

POST/v1/quotes/{quote}/cancel

Cancels the quote.

Path parameters

  • quotestringRequired

Body parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The quote object.

POST /v1/quotes/{quote}/cancel
curl -X POST https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/cancel \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "amount_subtotal": 0,
  "amount_total": 0,
  "application": null,
  "application_fee_amount": null,
  "application_fee_percent": null,
  "automatic_tax": {
    "enabled": false,
    "liability": {
      "type": "account"
    },
    "status": null,
    "provider": null
  },
  "collection_method": "charge_automatically",
  "computed": {
    "recurring": {
      "amount_subtotal": 1555417355,
      "amount_total": 1117121693,
      "interval": "month",
      "interval_count": 797691627,
      "total_details": {
        "amount_discount": 406046392,
        "amount_shipping": null,
        "amount_tax": 1424534716
      }
    },
    "upfront": {
      "amount_subtotal": 0,
      "amount_total": 0,
      "total_details": {
        "amount_discount": 0,
        "amount_shipping": 0,
        "amount_tax": 0
      }
    }
  },
  "created": 1234567890,
  "currency": "usd",
  "customer": "cus_QXg1o8vcGmoR32",
  "default_tax_rates": [],
  "description": null,
  "discounts": [],
  "expires_at": 1234567890,
  "footer": null,
  "from_quote": {
    "is_revision": true,
    "quote": "quote"
  },
  "header": null,
  "id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
  "invoice": null,
  "invoice_settings": {
    "days_until_due": null,
    "issuer": {
      "type": "self"
    },
    "custom_fields": null,
    "description": null,
    "footer": null
  },
  "livemode": false,
  "metadata": {},
  "number": null,
  "object": "quote",
  "on_behalf_of": null,
  "status": "draft",
  "status_transitions": {
    "accepted_at": null,
    "canceled_at": null,
    "finalized_at": null
  },
  "subscription": null,
  "subscription_data": {
    "description": null,
    "effective_date": null,
    "metadata": null,
    "trial_period_days": null,
    "billing_mode": {
      "type": "classic"
    }
  },
  "subscription_schedule": null,
  "test_clock": null,
  "total_details": {
    "amount_discount": 0,
    "amount_shipping": 0,
    "amount_tax": 0
  },
  "transfer_data": {
    "amount": null,
    "amount_percent": null,
    "destination": {
      "id": "obj_123",
      "object": "account"
    }
  },
  "customer_account": null
}

Retrieve a quote's upfront line items

GET/v1/quotes/{quote}/computed_upfront_line_items

When retrieving a quote, there is an includable computed.upfront.line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.

Path parameters

  • quotestringRequired

Query parameters

  • ending_beforestring

    A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • starting_afterstring

    A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Returns

A list of item objects.

GET /v1/quotes/{quote}/computed_upfront_line_items
curl -G https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/computed_upfront_line_items \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "object": "list",
  "url": "/v1/quotes",
  "has_more": false,
  "data": [
    {
      "amount_discount": 0,
      "amount_subtotal": 0,
      "amount_tax": 0,
      "amount_total": 0,
      "currency": "usd",
      "description": "T-shirt",
      "id": "li_1Pgc73B7WZ01zgkWx8kcmZPK",
      "object": "item",
      "price": {
        "active": true,
        "billing_scheme": "per_unit",
        "created": 1721948530,
        "currency": "usd",
        "custom_unit_amount": {
          "maximum": null,
          "minimum": null,
          "preset": null
        },
        "id": "price_1PgafmB7WZ01zgkW02Hf9z6c",
        "livemode": false,
        "lookup_key": null,
        "metadata": {},
        "nickname": null,
        "object": "price",
        "product": "prod_QXg1hqf4jFNsqG",
        "recurring": {
          "interval": "month",
          "interval_count": 797691627,
          "meter": null,
          "trial_period_days": null,
          "usage_type": "licensed"
        },
        "tax_behavior": "unspecified",
        "tiers_mode": null,
        "transform_quantity": {
          "divide_by": 1592560163,
          "round": "down"
        },
        "type": "one_time",
        "unit_amount": 1000,
        "unit_amount_decimal": "1000"
      },
      "quantity": 1,
      "metadata": null,
      "adjustable_quantity": {
        "enabled": true,
        "maximum": null,
        "minimum": null
      }
    }
  ]
}

Finalize a quote

POST/v1/quotes/{quote}/finalize

Finalizes the quote.

Path parameters

  • quotestringRequired

Body parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • expires_atinteger

    A future timestamp on which the quote will be canceled if in open or draft status. Measured in seconds since the Unix epoch.

Returns

The quote object.

POST /v1/quotes/{quote}/finalize
curl -X POST https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/finalize \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "amount_subtotal": 0,
  "amount_total": 0,
  "application": null,
  "application_fee_amount": null,
  "application_fee_percent": null,
  "automatic_tax": {
    "enabled": false,
    "liability": {
      "type": "account"
    },
    "status": null,
    "provider": null
  },
  "collection_method": "charge_automatically",
  "computed": {
    "recurring": {
      "amount_subtotal": 1555417355,
      "amount_total": 1117121693,
      "interval": "month",
      "interval_count": 797691627,
      "total_details": {
        "amount_discount": 406046392,
        "amount_shipping": null,
        "amount_tax": 1424534716
      }
    },
    "upfront": {
      "amount_subtotal": 0,
      "amount_total": 0,
      "total_details": {
        "amount_discount": 0,
        "amount_shipping": 0,
        "amount_tax": 0
      }
    }
  },
  "created": 1234567890,
  "currency": "usd",
  "customer": "cus_QXg1o8vcGmoR32",
  "default_tax_rates": [],
  "description": null,
  "discounts": [],
  "expires_at": 1234567890,
  "footer": null,
  "from_quote": {
    "is_revision": true,
    "quote": "quote"
  },
  "header": null,
  "id": "qt_1Pgc79B7WZ01zgkWHyj9Adwl",
  "invoice": null,
  "invoice_settings": {
    "days_until_due": null,
    "issuer": {
      "type": "self"
    },
    "custom_fields": null,
    "description": null,
    "footer": null
  },
  "livemode": false,
  "metadata": {},
  "number": null,
  "object": "quote",
  "on_behalf_of": null,
  "status": "draft",
  "status_transitions": {
    "accepted_at": null,
    "canceled_at": null,
    "finalized_at": null
  },
  "subscription": null,
  "subscription_data": {
    "description": null,
    "effective_date": null,
    "metadata": null,
    "trial_period_days": null,
    "billing_mode": {
      "type": "classic"
    }
  },
  "subscription_schedule": null,
  "test_clock": null,
  "total_details": {
    "amount_discount": 0,
    "amount_shipping": 0,
    "amount_tax": 0
  },
  "transfer_data": {
    "amount": null,
    "amount_percent": null,
    "destination": {
      "id": "obj_123",
      "object": "account"
    }
  },
  "customer_account": null
}

Retrieve a quote's line items

GET/v1/quotes/{quote}/line_items

When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

Path parameters

  • quotestringRequired

Query parameters

  • ending_beforestring

    A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • starting_afterstring

    A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Returns

A list of item objects.

GET /v1/quotes/{quote}/line_items
curl -G https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/line_items \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "object": "list",
  "url": "/v1/quotes",
  "has_more": false,
  "data": [
    {
      "amount_discount": 0,
      "amount_subtotal": 0,
      "amount_tax": 0,
      "amount_total": 0,
      "currency": "usd",
      "description": "T-shirt",
      "id": "li_1Pgc73B7WZ01zgkWx8kcmZPK",
      "object": "item",
      "price": {
        "active": true,
        "billing_scheme": "per_unit",
        "created": 1721948530,
        "currency": "usd",
        "custom_unit_amount": {
          "maximum": null,
          "minimum": null,
          "preset": null
        },
        "id": "price_1PgafmB7WZ01zgkW02Hf9z6c",
        "livemode": false,
        "lookup_key": null,
        "metadata": {},
        "nickname": null,
        "object": "price",
        "product": "prod_QXg1hqf4jFNsqG",
        "recurring": {
          "interval": "month",
          "interval_count": 797691627,
          "meter": null,
          "trial_period_days": null,
          "usage_type": "licensed"
        },
        "tax_behavior": "unspecified",
        "tiers_mode": null,
        "transform_quantity": {
          "divide_by": 1592560163,
          "round": "down"
        },
        "type": "one_time",
        "unit_amount": 1000,
        "unit_amount_decimal": "1000"
      },
      "quantity": 1,
      "metadata": null,
      "adjustable_quantity": {
        "enabled": true,
        "maximum": null,
        "minimum": null
      }
    }
  ]
}

Download quote PDF

GET/v1/quotes/{quote}/pdf

Download the PDF for a finalized quote. Explanation for special handling can be found here

Path parameters

  • quotestringRequired

Query parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

Successful response.

GET /v1/quotes/{quote}/pdf
curl https://api.knoxapi.com/v1/quotes/qt_1Pgc79B7WZ01zgkWHyj9Adwl/pdf \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"

Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.