Update recurring invoice
curl --request PUT \
--url https://app.blinksale.test/api/v1/recurring-invoices/{recurringInvoiceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Monthly Hosting",
"frequency": "MONTHLY",
"start_date": "2023-06-01",
"end_date": "2023-12-25",
"max_occurrences": 123,
"currency": "USD",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_distribution": "PER_DOCUMENT",
"discount_type": "PERCENTAGE",
"discount_value": 0,
"discount_distribution": "NO_DISCOUNT",
"net_terms": "NET30",
"has_late_fee": true,
"late_fee_kind": "PERCENTAGE",
"late_fee_interval": "ONE_TIME",
"late_fee": 5,
"shipping": 0,
"notes": "Monthly hosting services",
"options": {},
"template_items": [
{
"id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Hosting Services",
"description": "Monthly hosting and maintenance",
"quantity": 1,
"price": 99,
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_name": "Sales Tax",
"tax_percent": 8.5,
"discount_type": "PERCENTAGE",
"discount_value": 0
}
]
}
'import requests
url = "https://app.blinksale.test/api/v1/recurring-invoices/{recurringInvoiceId}"
payload = {
"client_id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Monthly Hosting",
"frequency": "MONTHLY",
"start_date": "2023-06-01",
"end_date": "2023-12-25",
"max_occurrences": 123,
"currency": "USD",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_distribution": "PER_DOCUMENT",
"discount_type": "PERCENTAGE",
"discount_value": 0,
"discount_distribution": "NO_DISCOUNT",
"net_terms": "NET30",
"has_late_fee": True,
"late_fee_kind": "PERCENTAGE",
"late_fee_interval": "ONE_TIME",
"late_fee": 5,
"shipping": 0,
"notes": "Monthly hosting services",
"options": {},
"template_items": [
{
"id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Hosting Services",
"description": "Monthly hosting and maintenance",
"quantity": 1,
"price": 99,
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_name": "Sales Tax",
"tax_percent": 8.5,
"discount_type": "PERCENTAGE",
"discount_value": 0
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: '01jtbf0c9zaraqx3swthf88n5y',
name: 'Monthly Hosting',
frequency: 'MONTHLY',
start_date: '2023-06-01',
end_date: '2023-12-25',
max_occurrences: 123,
currency: 'USD',
tax_id: '01jtbf0c9zaraqx3swthf88n5y',
tax_distribution: 'PER_DOCUMENT',
discount_type: 'PERCENTAGE',
discount_value: 0,
discount_distribution: 'NO_DISCOUNT',
net_terms: 'NET30',
has_late_fee: true,
late_fee_kind: 'PERCENTAGE',
late_fee_interval: 'ONE_TIME',
late_fee: 5,
shipping: 0,
notes: 'Monthly hosting services',
options: {},
template_items: [
{
id: '01jtbf0c9zaraqx3swthf88n5y',
name: 'Hosting Services',
description: 'Monthly hosting and maintenance',
quantity: 1,
price: 99,
unit_of_measurement_id: '01jtbf0c9zaraqx3swthf88n5y',
tax_id: '01jtbf0c9zaraqx3swthf88n5y',
tax_name: 'Sales Tax',
tax_percent: 8.5,
discount_type: 'PERCENTAGE',
discount_value: 0
}
]
})
};
fetch('https://app.blinksale.test/api/v1/recurring-invoices/{recurringInvoiceId}', 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/recurring-invoices/{recurringInvoiceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => '01jtbf0c9zaraqx3swthf88n5y',
'name' => 'Monthly Hosting',
'frequency' => 'MONTHLY',
'start_date' => '2023-06-01',
'end_date' => '2023-12-25',
'max_occurrences' => 123,
'currency' => 'USD',
'tax_id' => '01jtbf0c9zaraqx3swthf88n5y',
'tax_distribution' => 'PER_DOCUMENT',
'discount_type' => 'PERCENTAGE',
'discount_value' => 0,
'discount_distribution' => 'NO_DISCOUNT',
'net_terms' => 'NET30',
'has_late_fee' => true,
'late_fee_kind' => 'PERCENTAGE',
'late_fee_interval' => 'ONE_TIME',
'late_fee' => 5,
'shipping' => 0,
'notes' => 'Monthly hosting services',
'options' => [
],
'template_items' => [
[
'id' => '01jtbf0c9zaraqx3swthf88n5y',
'name' => 'Hosting Services',
'description' => 'Monthly hosting and maintenance',
'quantity' => 1,
'price' => 99,
'unit_of_measurement_id' => '01jtbf0c9zaraqx3swthf88n5y',
'tax_id' => '01jtbf0c9zaraqx3swthf88n5y',
'tax_name' => 'Sales Tax',
'tax_percent' => 8.5,
'discount_type' => 'PERCENTAGE',
'discount_value' => 0
]
]
]),
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/recurring-invoices/{recurringInvoiceId}"
payload := strings.NewReader("{\n \"client_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Monthly Hosting\",\n \"frequency\": \"MONTHLY\",\n \"start_date\": \"2023-06-01\",\n \"end_date\": \"2023-12-25\",\n \"max_occurrences\": 123,\n \"currency\": \"USD\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_distribution\": \"PER_DOCUMENT\",\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0,\n \"discount_distribution\": \"NO_DISCOUNT\",\n \"net_terms\": \"NET30\",\n \"has_late_fee\": true,\n \"late_fee_kind\": \"PERCENTAGE\",\n \"late_fee_interval\": \"ONE_TIME\",\n \"late_fee\": 5,\n \"shipping\": 0,\n \"notes\": \"Monthly hosting services\",\n \"options\": {},\n \"template_items\": [\n {\n \"id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Hosting Services\",\n \"description\": \"Monthly hosting and maintenance\",\n \"quantity\": 1,\n \"price\": 99,\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_name\": \"Sales Tax\",\n \"tax_percent\": 8.5,\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.blinksale.test/api/v1/recurring-invoices/{recurringInvoiceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Monthly Hosting\",\n \"frequency\": \"MONTHLY\",\n \"start_date\": \"2023-06-01\",\n \"end_date\": \"2023-12-25\",\n \"max_occurrences\": 123,\n \"currency\": \"USD\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_distribution\": \"PER_DOCUMENT\",\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0,\n \"discount_distribution\": \"NO_DISCOUNT\",\n \"net_terms\": \"NET30\",\n \"has_late_fee\": true,\n \"late_fee_kind\": \"PERCENTAGE\",\n \"late_fee_interval\": \"ONE_TIME\",\n \"late_fee\": 5,\n \"shipping\": 0,\n \"notes\": \"Monthly hosting services\",\n \"options\": {},\n \"template_items\": [\n {\n \"id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Hosting Services\",\n \"description\": \"Monthly hosting and maintenance\",\n \"quantity\": 1,\n \"price\": 99,\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_name\": \"Sales Tax\",\n \"tax_percent\": 8.5,\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blinksale.test/api/v1/recurring-invoices/{recurringInvoiceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Monthly Hosting\",\n \"frequency\": \"MONTHLY\",\n \"start_date\": \"2023-06-01\",\n \"end_date\": \"2023-12-25\",\n \"max_occurrences\": 123,\n \"currency\": \"USD\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_distribution\": \"PER_DOCUMENT\",\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0,\n \"discount_distribution\": \"NO_DISCOUNT\",\n \"net_terms\": \"NET30\",\n \"has_late_fee\": true,\n \"late_fee_kind\": \"PERCENTAGE\",\n \"late_fee_interval\": \"ONE_TIME\",\n \"late_fee\": 5,\n \"shipping\": 0,\n \"notes\": \"Monthly hosting services\",\n \"options\": {},\n \"template_items\": [\n {\n \"id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Hosting Services\",\n \"description\": \"Monthly hosting and maintenance\",\n \"quantity\": 1,\n \"price\": 99,\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_name\": \"Sales Tax\",\n \"tax_percent\": 8.5,\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Recurring invoice updated successfully",
"data": {
"id": "01jtbf0c9zaraqx3swthf88n5y",
"organization_id": "01jtbf0c9zaraqx3swthf88n5y",
"client_id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Monthly Hosting",
"frequency": "MONTHLY",
"frequency_name": "Monthly",
"status": "ACTIVE",
"status_name": "Active",
"start_date": "2023-06-01",
"end_date": null,
"max_occurrences": null,
"occurrences": 3,
"last_generated_date": "2023-08-01",
"next_date": "2023-09-01",
"client": {
"id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Acme Inc",
"email": "[email protected]",
"kind": "BUSINESS",
"kind_name": "Business",
"profile": {
"company_name": "Acme Inc",
"website": "https://acme.com"
},
"address": {
"line1": "123 Main St",
"line2": "Suite 101",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"country": "US"
},
"document_defaults": {
"currency": "USD"
},
"contact_count": 3,
"note_count": 2,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"template": {
"id": "01jtbf0c9zaraqx3swthf88n5y",
"currency": "USD",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_name": "Sales Tax",
"tax_percent": 8.5,
"tax_distribution": "PER_DOCUMENT",
"discount_type": "PERCENTAGE",
"discount_value": 10,
"discount_distribution": "PER_DOCUMENT",
"net_terms": "NET30",
"has_late_fee": true,
"late_fee_kind": "PERCENTAGE",
"late_fee_interval": "ONE_TIME",
"late_fee": 5,
"shipping": 15,
"notes": "Monthly hosting services.",
"options": {},
"items": [
{
"id": "01jtbf0c9zaraqx3swthf88n5y",
"organization_id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Consulting Services",
"description": "Professional consulting services",
"quantity": 10,
"price": 150,
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y",
"unit_name": "Hour",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_name": "Sales Tax",
"tax_percent": 8.5,
"discount_type": "PERCENTAGE",
"discount_value": 10,
"subtotal": 1500,
"tax_amount": 127.5,
"total": 1627.5
}
]
},
"is_due_for_generation": false,
"can_generate_invoices": true,
"is_editable": true,
"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": "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."
]
}
}Recurring Invoices
Update Recurring Invoice
Update an existing recurring invoice
PUT
/
v1
/
recurring-invoices
/
{recurringInvoiceId}
Update recurring invoice
curl --request PUT \
--url https://app.blinksale.test/api/v1/recurring-invoices/{recurringInvoiceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Monthly Hosting",
"frequency": "MONTHLY",
"start_date": "2023-06-01",
"end_date": "2023-12-25",
"max_occurrences": 123,
"currency": "USD",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_distribution": "PER_DOCUMENT",
"discount_type": "PERCENTAGE",
"discount_value": 0,
"discount_distribution": "NO_DISCOUNT",
"net_terms": "NET30",
"has_late_fee": true,
"late_fee_kind": "PERCENTAGE",
"late_fee_interval": "ONE_TIME",
"late_fee": 5,
"shipping": 0,
"notes": "Monthly hosting services",
"options": {},
"template_items": [
{
"id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Hosting Services",
"description": "Monthly hosting and maintenance",
"quantity": 1,
"price": 99,
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_name": "Sales Tax",
"tax_percent": 8.5,
"discount_type": "PERCENTAGE",
"discount_value": 0
}
]
}
'import requests
url = "https://app.blinksale.test/api/v1/recurring-invoices/{recurringInvoiceId}"
payload = {
"client_id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Monthly Hosting",
"frequency": "MONTHLY",
"start_date": "2023-06-01",
"end_date": "2023-12-25",
"max_occurrences": 123,
"currency": "USD",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_distribution": "PER_DOCUMENT",
"discount_type": "PERCENTAGE",
"discount_value": 0,
"discount_distribution": "NO_DISCOUNT",
"net_terms": "NET30",
"has_late_fee": True,
"late_fee_kind": "PERCENTAGE",
"late_fee_interval": "ONE_TIME",
"late_fee": 5,
"shipping": 0,
"notes": "Monthly hosting services",
"options": {},
"template_items": [
{
"id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Hosting Services",
"description": "Monthly hosting and maintenance",
"quantity": 1,
"price": 99,
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_name": "Sales Tax",
"tax_percent": 8.5,
"discount_type": "PERCENTAGE",
"discount_value": 0
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: '01jtbf0c9zaraqx3swthf88n5y',
name: 'Monthly Hosting',
frequency: 'MONTHLY',
start_date: '2023-06-01',
end_date: '2023-12-25',
max_occurrences: 123,
currency: 'USD',
tax_id: '01jtbf0c9zaraqx3swthf88n5y',
tax_distribution: 'PER_DOCUMENT',
discount_type: 'PERCENTAGE',
discount_value: 0,
discount_distribution: 'NO_DISCOUNT',
net_terms: 'NET30',
has_late_fee: true,
late_fee_kind: 'PERCENTAGE',
late_fee_interval: 'ONE_TIME',
late_fee: 5,
shipping: 0,
notes: 'Monthly hosting services',
options: {},
template_items: [
{
id: '01jtbf0c9zaraqx3swthf88n5y',
name: 'Hosting Services',
description: 'Monthly hosting and maintenance',
quantity: 1,
price: 99,
unit_of_measurement_id: '01jtbf0c9zaraqx3swthf88n5y',
tax_id: '01jtbf0c9zaraqx3swthf88n5y',
tax_name: 'Sales Tax',
tax_percent: 8.5,
discount_type: 'PERCENTAGE',
discount_value: 0
}
]
})
};
fetch('https://app.blinksale.test/api/v1/recurring-invoices/{recurringInvoiceId}', 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/recurring-invoices/{recurringInvoiceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => '01jtbf0c9zaraqx3swthf88n5y',
'name' => 'Monthly Hosting',
'frequency' => 'MONTHLY',
'start_date' => '2023-06-01',
'end_date' => '2023-12-25',
'max_occurrences' => 123,
'currency' => 'USD',
'tax_id' => '01jtbf0c9zaraqx3swthf88n5y',
'tax_distribution' => 'PER_DOCUMENT',
'discount_type' => 'PERCENTAGE',
'discount_value' => 0,
'discount_distribution' => 'NO_DISCOUNT',
'net_terms' => 'NET30',
'has_late_fee' => true,
'late_fee_kind' => 'PERCENTAGE',
'late_fee_interval' => 'ONE_TIME',
'late_fee' => 5,
'shipping' => 0,
'notes' => 'Monthly hosting services',
'options' => [
],
'template_items' => [
[
'id' => '01jtbf0c9zaraqx3swthf88n5y',
'name' => 'Hosting Services',
'description' => 'Monthly hosting and maintenance',
'quantity' => 1,
'price' => 99,
'unit_of_measurement_id' => '01jtbf0c9zaraqx3swthf88n5y',
'tax_id' => '01jtbf0c9zaraqx3swthf88n5y',
'tax_name' => 'Sales Tax',
'tax_percent' => 8.5,
'discount_type' => 'PERCENTAGE',
'discount_value' => 0
]
]
]),
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/recurring-invoices/{recurringInvoiceId}"
payload := strings.NewReader("{\n \"client_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Monthly Hosting\",\n \"frequency\": \"MONTHLY\",\n \"start_date\": \"2023-06-01\",\n \"end_date\": \"2023-12-25\",\n \"max_occurrences\": 123,\n \"currency\": \"USD\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_distribution\": \"PER_DOCUMENT\",\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0,\n \"discount_distribution\": \"NO_DISCOUNT\",\n \"net_terms\": \"NET30\",\n \"has_late_fee\": true,\n \"late_fee_kind\": \"PERCENTAGE\",\n \"late_fee_interval\": \"ONE_TIME\",\n \"late_fee\": 5,\n \"shipping\": 0,\n \"notes\": \"Monthly hosting services\",\n \"options\": {},\n \"template_items\": [\n {\n \"id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Hosting Services\",\n \"description\": \"Monthly hosting and maintenance\",\n \"quantity\": 1,\n \"price\": 99,\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_name\": \"Sales Tax\",\n \"tax_percent\": 8.5,\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.blinksale.test/api/v1/recurring-invoices/{recurringInvoiceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Monthly Hosting\",\n \"frequency\": \"MONTHLY\",\n \"start_date\": \"2023-06-01\",\n \"end_date\": \"2023-12-25\",\n \"max_occurrences\": 123,\n \"currency\": \"USD\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_distribution\": \"PER_DOCUMENT\",\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0,\n \"discount_distribution\": \"NO_DISCOUNT\",\n \"net_terms\": \"NET30\",\n \"has_late_fee\": true,\n \"late_fee_kind\": \"PERCENTAGE\",\n \"late_fee_interval\": \"ONE_TIME\",\n \"late_fee\": 5,\n \"shipping\": 0,\n \"notes\": \"Monthly hosting services\",\n \"options\": {},\n \"template_items\": [\n {\n \"id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Hosting Services\",\n \"description\": \"Monthly hosting and maintenance\",\n \"quantity\": 1,\n \"price\": 99,\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_name\": \"Sales Tax\",\n \"tax_percent\": 8.5,\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.blinksale.test/api/v1/recurring-invoices/{recurringInvoiceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Monthly Hosting\",\n \"frequency\": \"MONTHLY\",\n \"start_date\": \"2023-06-01\",\n \"end_date\": \"2023-12-25\",\n \"max_occurrences\": 123,\n \"currency\": \"USD\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_distribution\": \"PER_DOCUMENT\",\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0,\n \"discount_distribution\": \"NO_DISCOUNT\",\n \"net_terms\": \"NET30\",\n \"has_late_fee\": true,\n \"late_fee_kind\": \"PERCENTAGE\",\n \"late_fee_interval\": \"ONE_TIME\",\n \"late_fee\": 5,\n \"shipping\": 0,\n \"notes\": \"Monthly hosting services\",\n \"options\": {},\n \"template_items\": [\n {\n \"id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"name\": \"Hosting Services\",\n \"description\": \"Monthly hosting and maintenance\",\n \"quantity\": 1,\n \"price\": 99,\n \"unit_of_measurement_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_id\": \"01jtbf0c9zaraqx3swthf88n5y\",\n \"tax_name\": \"Sales Tax\",\n \"tax_percent\": 8.5,\n \"discount_type\": \"PERCENTAGE\",\n \"discount_value\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Recurring invoice updated successfully",
"data": {
"id": "01jtbf0c9zaraqx3swthf88n5y",
"organization_id": "01jtbf0c9zaraqx3swthf88n5y",
"client_id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Monthly Hosting",
"frequency": "MONTHLY",
"frequency_name": "Monthly",
"status": "ACTIVE",
"status_name": "Active",
"start_date": "2023-06-01",
"end_date": null,
"max_occurrences": null,
"occurrences": 3,
"last_generated_date": "2023-08-01",
"next_date": "2023-09-01",
"client": {
"id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Acme Inc",
"email": "[email protected]",
"kind": "BUSINESS",
"kind_name": "Business",
"profile": {
"company_name": "Acme Inc",
"website": "https://acme.com"
},
"address": {
"line1": "123 Main St",
"line2": "Suite 101",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"country": "US"
},
"document_defaults": {
"currency": "USD"
},
"contact_count": 3,
"note_count": 2,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"template": {
"id": "01jtbf0c9zaraqx3swthf88n5y",
"currency": "USD",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_name": "Sales Tax",
"tax_percent": 8.5,
"tax_distribution": "PER_DOCUMENT",
"discount_type": "PERCENTAGE",
"discount_value": 10,
"discount_distribution": "PER_DOCUMENT",
"net_terms": "NET30",
"has_late_fee": true,
"late_fee_kind": "PERCENTAGE",
"late_fee_interval": "ONE_TIME",
"late_fee": 5,
"shipping": 15,
"notes": "Monthly hosting services.",
"options": {},
"items": [
{
"id": "01jtbf0c9zaraqx3swthf88n5y",
"organization_id": "01jtbf0c9zaraqx3swthf88n5y",
"name": "Consulting Services",
"description": "Professional consulting services",
"quantity": 10,
"price": 150,
"unit_of_measurement_id": "01jtbf0c9zaraqx3swthf88n5y",
"unit_name": "Hour",
"tax_id": "01jtbf0c9zaraqx3swthf88n5y",
"tax_name": "Sales Tax",
"tax_percent": 8.5,
"discount_type": "PERCENTAGE",
"discount_value": 10,
"subtotal": 1500,
"tax_amount": 127.5,
"total": 1627.5
}
]
},
"is_due_for_generation": false,
"can_generate_invoices": true,
"is_editable": true,
"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": "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
Path Parameters
The ID of the recurring invoice to update
Body
application/json
Example:
"01jtbf0c9zaraqx3swthf88n5y"
Example:
"Monthly Hosting"
Example:
"MONTHLY"
Example:
"2023-06-01"
Example:
"USD"
Example:
"01jtbf0c9zaraqx3swthf88n5y"
Example:
"PER_DOCUMENT"
Example:
"PERCENTAGE"
Example:
0
Example:
"NO_DISCOUNT"
Example:
"NET30"
Example:
true
Example:
"PERCENTAGE"
Example:
"ONE_TIME"
Example:
5
Example:
0
Example:
"Monthly hosting services"
Show child attributes
Show child attributes
⌘I

