curl --request PUT \
--url https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 9999,
"currency": "USD",
"description": "Monthly Premium Plan Subscription - January 2024",
"planCode": "PREMIUM_MONTHLY",
"planName": "Premium Monthly Plan",
"templateId": "template-123",
"status": "DRAFT",
"startDate": "2024-01-01T00:00:00.000Z",
"renewalDate": "2024-02-01T00:00:00.000Z",
"paymentTerms": 30
}
'import requests
url = "https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}"
payload = {
"amount": 9999,
"currency": "USD",
"description": "Monthly Premium Plan Subscription - January 2024",
"planCode": "PREMIUM_MONTHLY",
"planName": "Premium Monthly Plan",
"templateId": "template-123",
"status": "DRAFT",
"startDate": "2024-01-01T00:00:00.000Z",
"renewalDate": "2024-02-01T00:00:00.000Z",
"paymentTerms": 30
}
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({
amount: 9999,
currency: 'USD',
description: 'Monthly Premium Plan Subscription - January 2024',
planCode: 'PREMIUM_MONTHLY',
planName: 'Premium Monthly Plan',
templateId: 'template-123',
status: 'DRAFT',
startDate: '2024-01-01T00:00:00.000Z',
renewalDate: '2024-02-01T00:00:00.000Z',
paymentTerms: 30
})
};
fetch('https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}', 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://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}",
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([
'amount' => 9999,
'currency' => 'USD',
'description' => 'Monthly Premium Plan Subscription - January 2024',
'planCode' => 'PREMIUM_MONTHLY',
'planName' => 'Premium Monthly Plan',
'templateId' => 'template-123',
'status' => 'DRAFT',
'startDate' => '2024-01-01T00:00:00.000Z',
'renewalDate' => '2024-02-01T00:00:00.000Z',
'paymentTerms' => 30
]),
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://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}"
payload := strings.NewReader("{\n \"amount\": 9999,\n \"currency\": \"USD\",\n \"description\": \"Monthly Premium Plan Subscription - January 2024\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"planName\": \"Premium Monthly Plan\",\n \"templateId\": \"template-123\",\n \"status\": \"DRAFT\",\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"renewalDate\": \"2024-02-01T00:00:00.000Z\",\n \"paymentTerms\": 30\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://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 9999,\n \"currency\": \"USD\",\n \"description\": \"Monthly Premium Plan Subscription - January 2024\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"planName\": \"Premium Monthly Plan\",\n \"templateId\": \"template-123\",\n \"status\": \"DRAFT\",\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"renewalDate\": \"2024-02-01T00:00:00.000Z\",\n \"paymentTerms\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}")
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 \"amount\": 9999,\n \"currency\": \"USD\",\n \"description\": \"Monthly Premium Plan Subscription - January 2024\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"planName\": \"Premium Monthly Plan\",\n \"templateId\": \"template-123\",\n \"status\": \"DRAFT\",\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"renewalDate\": \"2024-02-01T00:00:00.000Z\",\n \"paymentTerms\": 30\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"invoiceNumber": "<string>",
"date": "<string>",
"status": "DRAFT",
"amount": 123,
"currency": "<string>",
"description": "<string>",
"customerName": "<string>",
"customerEmail": "<string>",
"downloadLink": "<string>",
"planType": "<string>"
}Update invoice
Update an existing invoice. Only draft invoices can be updated.
curl --request PUT \
--url https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 9999,
"currency": "USD",
"description": "Monthly Premium Plan Subscription - January 2024",
"planCode": "PREMIUM_MONTHLY",
"planName": "Premium Monthly Plan",
"templateId": "template-123",
"status": "DRAFT",
"startDate": "2024-01-01T00:00:00.000Z",
"renewalDate": "2024-02-01T00:00:00.000Z",
"paymentTerms": 30
}
'import requests
url = "https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}"
payload = {
"amount": 9999,
"currency": "USD",
"description": "Monthly Premium Plan Subscription - January 2024",
"planCode": "PREMIUM_MONTHLY",
"planName": "Premium Monthly Plan",
"templateId": "template-123",
"status": "DRAFT",
"startDate": "2024-01-01T00:00:00.000Z",
"renewalDate": "2024-02-01T00:00:00.000Z",
"paymentTerms": 30
}
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({
amount: 9999,
currency: 'USD',
description: 'Monthly Premium Plan Subscription - January 2024',
planCode: 'PREMIUM_MONTHLY',
planName: 'Premium Monthly Plan',
templateId: 'template-123',
status: 'DRAFT',
startDate: '2024-01-01T00:00:00.000Z',
renewalDate: '2024-02-01T00:00:00.000Z',
paymentTerms: 30
})
};
fetch('https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}', 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://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}",
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([
'amount' => 9999,
'currency' => 'USD',
'description' => 'Monthly Premium Plan Subscription - January 2024',
'planCode' => 'PREMIUM_MONTHLY',
'planName' => 'Premium Monthly Plan',
'templateId' => 'template-123',
'status' => 'DRAFT',
'startDate' => '2024-01-01T00:00:00.000Z',
'renewalDate' => '2024-02-01T00:00:00.000Z',
'paymentTerms' => 30
]),
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://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}"
payload := strings.NewReader("{\n \"amount\": 9999,\n \"currency\": \"USD\",\n \"description\": \"Monthly Premium Plan Subscription - January 2024\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"planName\": \"Premium Monthly Plan\",\n \"templateId\": \"template-123\",\n \"status\": \"DRAFT\",\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"renewalDate\": \"2024-02-01T00:00:00.000Z\",\n \"paymentTerms\": 30\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://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 9999,\n \"currency\": \"USD\",\n \"description\": \"Monthly Premium Plan Subscription - January 2024\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"planName\": \"Premium Monthly Plan\",\n \"templateId\": \"template-123\",\n \"status\": \"DRAFT\",\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"renewalDate\": \"2024-02-01T00:00:00.000Z\",\n \"paymentTerms\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-billing-api.iqraa.ai/api/v1/api/v1/invoices/{id}")
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 \"amount\": 9999,\n \"currency\": \"USD\",\n \"description\": \"Monthly Premium Plan Subscription - January 2024\",\n \"planCode\": \"PREMIUM_MONTHLY\",\n \"planName\": \"Premium Monthly Plan\",\n \"templateId\": \"template-123\",\n \"status\": \"DRAFT\",\n \"startDate\": \"2024-01-01T00:00:00.000Z\",\n \"renewalDate\": \"2024-02-01T00:00:00.000Z\",\n \"paymentTerms\": 30\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"invoiceNumber": "<string>",
"date": "<string>",
"status": "DRAFT",
"amount": 123,
"currency": "<string>",
"description": "<string>",
"customerName": "<string>",
"customerEmail": "<string>",
"downloadLink": "<string>",
"planType": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
The total amount for the invoice in smallest currency unit (e.g., cents)
x >= 09999
The currency code in ISO 4217 format
USD, EUR, GBP, AED "USD"
A clear description of what this invoice is for
"Monthly Premium Plan Subscription - January 2024"
The unique identifier of the plan being billed
"PREMIUM_MONTHLY"
The display name of the plan being billed
"Premium Monthly Plan"
ID of the invoice template to use. If not provided, default template will be used
"template-123"
Current status of the invoice
DRAFT, FINALIZED, PAYMENT_FAILED, PAID, VOID "DRAFT"
Custom invoice components including line items and customer details
Show child attributes
Show child attributes
The start date of the billing period
"2024-01-01T00:00:00.000Z"
The next renewal date for recurring invoices
"2024-02-01T00:00:00.000Z"
Number of days until payment is due
x >= 030
Response
Invoice updated successfully
DRAFT, FINALIZED, PAYMENT_FAILED, PAID, VOID