Create saved item
curl --request POST \
--url https://app.blinksale.test/api/v1/saved-items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Consulting Services",
"price": 150,
"quantity": 1,
"currency": "USD",
"description": "Professional consulting services",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y"
}
'import requests
url = "https://app.blinksale.test/api/v1/saved-items"
payload = {
"name": "Consulting Services",
"price": 150,
"quantity": 1,
"currency": "USD",
"description": "Professional consulting services",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y"
}
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({
name: 'Consulting Services',
price: 150,
quantity: 1,
currency: 'USD',
description: 'Professional consulting services',
tax_id: '01jtbf0c9zaraqx3swthf88n5y',
unit_of_measurement_id: '01jtbf0c9zaraqx3swthf88n5y'
})
};
fetch('https://app.blinksale.test/api/v1/saved-items', 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://app.blinksale.test/api/v1/saved-items",
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([
'name' => 'Consulting Services',
'price' => 150,
'quantity' => 1,
'currency' => 'USD',
'description' => 'Professional consulting services',
'tax_id' => '01jtbf0c9zaraqx3swthf88n5y',
'unit_of_measurement_id' => '01jtbf0c9zaraqx3swthf88n5y'
]),
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://app.blinksale.test/api/v1/saved-items"
payload := strings.NewReader("{\n \"name\": \"Consulting Services\",\n \"price\": 150,\n \"quantity\": 1,\n \"currency\": \"USD\",\n \"description\": \"Professional consulting services\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\"\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://app.blinksale.test/api/v1/saved-items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Consulting Services\",\n \"price\": 150,\n \"quantity\": 1,\n \"currency\": \"USD\",\n \"description\": \"Professional consulting services\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blinksale.test/api/v1/saved-items")
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 \"name\": \"Consulting Services\",\n \"price\": 150,\n \"quantity\": 1,\n \"currency\": \"USD\",\n \"description\": \"Professional consulting services\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Saved item created successfully",
"data": {
"id": "01jtbf0c9zaraqx3swthf88n5y",
"organization_id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Consulting Services",
"description": "Professional consulting services",
"price": 150,
"quantity": 1,
"currency": "USD",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_name": "Sales Tax",
"tax_percent": 8.5,
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y",
"unit_name": "Hour",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}{
"success": false,
"message": "Validation error",
"errors": {
"email": [
"The email field must be a valid email address."
]
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}Saved Line Items
Create Saved Item
Create a new saved item
POST
/
v1
/
saved-items
Create saved item
curl --request POST \
--url https://app.blinksale.test/api/v1/saved-items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Consulting Services",
"price": 150,
"quantity": 1,
"currency": "USD",
"description": "Professional consulting services",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y"
}
'import requests
url = "https://app.blinksale.test/api/v1/saved-items"
payload = {
"name": "Consulting Services",
"price": 150,
"quantity": 1,
"currency": "USD",
"description": "Professional consulting services",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y"
}
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({
name: 'Consulting Services',
price: 150,
quantity: 1,
currency: 'USD',
description: 'Professional consulting services',
tax_id: '01jtbf0c9zaraqx3swthf88n5y',
unit_of_measurement_id: '01jtbf0c9zaraqx3swthf88n5y'
})
};
fetch('https://app.blinksale.test/api/v1/saved-items', 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://app.blinksale.test/api/v1/saved-items",
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([
'name' => 'Consulting Services',
'price' => 150,
'quantity' => 1,
'currency' => 'USD',
'description' => 'Professional consulting services',
'tax_id' => '01jtbf0c9zaraqx3swthf88n5y',
'unit_of_measurement_id' => '01jtbf0c9zaraqx3swthf88n5y'
]),
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://app.blinksale.test/api/v1/saved-items"
payload := strings.NewReader("{\n \"name\": \"Consulting Services\",\n \"price\": 150,\n \"quantity\": 1,\n \"currency\": \"USD\",\n \"description\": \"Professional consulting services\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\"\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://app.blinksale.test/api/v1/saved-items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Consulting Services\",\n \"price\": 150,\n \"quantity\": 1,\n \"currency\": \"USD\",\n \"description\": \"Professional consulting services\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blinksale.test/api/v1/saved-items")
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 \"name\": \"Consulting Services\",\n \"price\": 150,\n \"quantity\": 1,\n \"currency\": \"USD\",\n \"description\": \"Professional consulting services\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Saved item created successfully",
"data": {
"id": "01jtbf0c9zaraqx3swthf88n5y",
"organization_id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Consulting Services",
"description": "Professional consulting services",
"price": 150,
"quantity": 1,
"currency": "USD",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_name": "Sales Tax",
"tax_percent": 8.5,
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y",
"unit_name": "Hour",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}{
"success": false,
"message": "Validation error",
"errors": {
"email": [
"The email field must be a valid email address."
]
}
}{
"success": false,
"message": "An error occurred",
"errors": {
"email": [
"The email field is required."
]
}
}Authorizations
Access token obtained from the /v1/auth/login endpoint
Body
application/json
Example:
"Consulting Services"
Example:
150
Example:
1
Example:
"USD"
Example:
"Professional consulting services"
Example:
"01jtbf0c9zaraqx3swthf88n5y"
Example:
"01jtbf0c9zaraqx3swthf88n5y"
⌘I

