Quotes
Create Quote
Create a new quote for a customer
POST
/
v1
/
quotes
Create a quote
curl --request POST \
--url https://billing.example.com/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"amount": 123
}
],
"currency": "<string>",
"valid_until": "2023-11-07T05:31:56Z",
"notes": "<string>",
"terms": "<string>",
"tax_amount": 123,
"discount_amount": 123
}
'import requests
url = "https://billing.example.com/v1/quotes"
payload = {
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"amount": 123
}
],
"currency": "<string>",
"valid_until": "2023-11-07T05:31:56Z",
"notes": "<string>",
"terms": "<string>",
"tax_amount": 123,
"discount_amount": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
line_items: [{description: '<string>', quantity: 123, unit_price: 123, amount: 123}],
currency: '<string>',
valid_until: '2023-11-07T05:31:56Z',
notes: '<string>',
terms: '<string>',
tax_amount: 123,
discount_amount: 123
})
};
fetch('https://billing.example.com/v1/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/quotes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'line_items' => [
[
'description' => '<string>',
'quantity' => 123,
'unit_price' => 123,
'amount' => 123
]
],
'currency' => '<string>',
'valid_until' => '2023-11-07T05:31:56Z',
'notes' => '<string>',
'terms' => '<string>',
'tax_amount' => 123,
'discount_amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://billing.example.com/v1/quotes"
payload := strings.NewReader("{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"amount\": 123\n }\n ],\n \"currency\": \"<string>\",\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"terms\": \"<string>\",\n \"tax_amount\": 123,\n \"discount_amount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://billing.example.com/v1/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"amount\": 123\n }\n ],\n \"currency\": \"<string>\",\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"terms\": \"<string>\",\n \"tax_amount\": 123,\n \"discount_amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"amount\": 123\n }\n ],\n \"currency\": \"<string>\",\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"terms\": \"<string>\",\n \"tax_amount\": 123,\n \"discount_amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_number": "<string>",
"status": "draft",
"line_items": [
{
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"amount": 123
}
],
"subtotal": 123,
"tax_amount": 123,
"discount_amount": 123,
"total": 123,
"currency": "<string>",
"valid_until": "2023-11-07T05:31:56Z",
"notes": "<string>",
"terms": "<string>",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accepted_at": "2023-11-07T05:31:56Z",
"declined_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | string | Yes | Customer ID |
line_items | array | Yes | List of line item objects |
currency | string | Yes | Three-letter ISO currency code |
expires_at | string | No | Quote expiration date (ISO 8601) |
notes | string | No | Additional notes or terms |
Line Item Object
| Parameter | Type | Required | Description |
|---|---|---|---|
description | string | Yes | Line item description |
quantity | integer | Yes | Quantity |
unit_amount | integer | Yes | Price per unit in smallest currency unit |
Example Request
curl -X POST https://api.recurso.dev/v1/quotes \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "cust_abc123",
"line_items": [
{ "description": "Pro Plan — Annual", "quantity": 1, "unit_amount": 49999 },
{ "description": "Additional seats (x5)", "quantity": 5, "unit_amount": 9999 }
],
"currency": "INR",
"expires_at": "2024-04-15T23:59:59Z",
"notes": "Valid for 30 days. Inclusive of onboarding support."
}'
Response
{
"id": "qt_m3n8j5",
"object": "quote",
"customer_id": "cust_abc123",
"status": "draft",
"currency": "INR",
"line_items": [
{ "description": "Pro Plan — Annual", "quantity": 1, "unit_amount": 49999, "amount": 49999 },
{ "description": "Additional seats (x5)", "quantity": 5, "unit_amount": 9999, "amount": 49995 }
],
"subtotal": 99994,
"tax_amount": 17999,
"total": 117993,
"expires_at": "2024-04-15T23:59:59Z",
"notes": "Valid for 30 days. Inclusive of onboarding support.",
"created_at": "2024-03-16T10:00:00Z"
}
Authorizations
Tenant API key obtained from POST /auth/register or POST /v1/developer/keys.
Body
application/json
Response
Quote created (status draft).
Show child attributes
Show child attributes
⌘I
Create a quote
curl --request POST \
--url https://billing.example.com/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"amount": 123
}
],
"currency": "<string>",
"valid_until": "2023-11-07T05:31:56Z",
"notes": "<string>",
"terms": "<string>",
"tax_amount": 123,
"discount_amount": 123
}
'import requests
url = "https://billing.example.com/v1/quotes"
payload = {
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"line_items": [
{
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"amount": 123
}
],
"currency": "<string>",
"valid_until": "2023-11-07T05:31:56Z",
"notes": "<string>",
"terms": "<string>",
"tax_amount": 123,
"discount_amount": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
line_items: [{description: '<string>', quantity: 123, unit_price: 123, amount: 123}],
currency: '<string>',
valid_until: '2023-11-07T05:31:56Z',
notes: '<string>',
terms: '<string>',
tax_amount: 123,
discount_amount: 123
})
};
fetch('https://billing.example.com/v1/quotes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/quotes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'line_items' => [
[
'description' => '<string>',
'quantity' => 123,
'unit_price' => 123,
'amount' => 123
]
],
'currency' => '<string>',
'valid_until' => '2023-11-07T05:31:56Z',
'notes' => '<string>',
'terms' => '<string>',
'tax_amount' => 123,
'discount_amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://billing.example.com/v1/quotes"
payload := strings.NewReader("{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"amount\": 123\n }\n ],\n \"currency\": \"<string>\",\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"terms\": \"<string>\",\n \"tax_amount\": 123,\n \"discount_amount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://billing.example.com/v1/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"amount\": 123\n }\n ],\n \"currency\": \"<string>\",\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"terms\": \"<string>\",\n \"tax_amount\": 123,\n \"discount_amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 123,\n \"unit_price\": 123,\n \"amount\": 123\n }\n ],\n \"currency\": \"<string>\",\n \"valid_until\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"terms\": \"<string>\",\n \"tax_amount\": 123,\n \"discount_amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_number": "<string>",
"status": "draft",
"line_items": [
{
"description": "<string>",
"quantity": 123,
"unit_price": 123,
"amount": 123
}
],
"subtotal": 123,
"tax_amount": 123,
"discount_amount": 123,
"total": 123,
"currency": "<string>",
"valid_until": "2023-11-07T05:31:56Z",
"notes": "<string>",
"terms": "<string>",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"accepted_at": "2023-11-07T05:31:56Z",
"declined_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}