Update Invoice
curl --request PUT \
--url https://api.wizcommerce.com/v1/invoices/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reference_id": "INV-20250101",
"order_id": "ORD-20250101",
"invoice_number": "INV-20250101",
"total_amount": 1000000,
"paid_amount": 0,
"due_date": "2025-01-01T00:00:00Z",
"items": [
{
"reference_id": "ITEM-20250101",
"sku": "SKU-20250101",
"quantity": 1000000,
"amount": 1000000,
"name": "Item Name"
}
],
"status": "PAID",
"remarks": "Remarks",
"url": "https://example.com/invoice/INV-20250101",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
}
'import requests
url = "https://api.wizcommerce.com/v1/invoices/{id}"
payload = {
"reference_id": "INV-20250101",
"order_id": "ORD-20250101",
"invoice_number": "INV-20250101",
"total_amount": 1000000,
"paid_amount": 0,
"due_date": "2025-01-01T00:00:00Z",
"items": [
{
"reference_id": "ITEM-20250101",
"sku": "SKU-20250101",
"quantity": 1000000,
"amount": 1000000,
"name": "Item Name"
}
],
"status": "PAID",
"remarks": "Remarks",
"url": "https://example.com/invoice/INV-20250101",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference_id: 'INV-20250101',
order_id: 'ORD-20250101',
invoice_number: 'INV-20250101',
total_amount: 1000000,
paid_amount: 0,
due_date: '2025-01-01T00:00:00Z',
items: [
{
reference_id: 'ITEM-20250101',
sku: 'SKU-20250101',
quantity: 1000000,
amount: 1000000,
name: 'Item Name'
}
],
status: 'PAID',
remarks: 'Remarks',
url: 'https://example.com/invoice/INV-20250101',
created_at: '2025-01-01T00:00:00Z',
updated_at: '2025-01-01T00:00:00Z'
})
};
fetch('https://api.wizcommerce.com/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://api.wizcommerce.com/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([
'reference_id' => 'INV-20250101',
'order_id' => 'ORD-20250101',
'invoice_number' => 'INV-20250101',
'total_amount' => 1000000,
'paid_amount' => 0,
'due_date' => '2025-01-01T00:00:00Z',
'items' => [
[
'reference_id' => 'ITEM-20250101',
'sku' => 'SKU-20250101',
'quantity' => 1000000,
'amount' => 1000000,
'name' => 'Item Name'
]
],
'status' => 'PAID',
'remarks' => 'Remarks',
'url' => 'https://example.com/invoice/INV-20250101',
'created_at' => '2025-01-01T00:00:00Z',
'updated_at' => '2025-01-01T00:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.wizcommerce.com/v1/invoices/{id}"
payload := strings.NewReader("{\n \"reference_id\": \"INV-20250101\",\n \"order_id\": \"ORD-20250101\",\n \"invoice_number\": \"INV-20250101\",\n \"total_amount\": 1000000,\n \"paid_amount\": 0,\n \"due_date\": \"2025-01-01T00:00:00Z\",\n \"items\": [\n {\n \"reference_id\": \"ITEM-20250101\",\n \"sku\": \"SKU-20250101\",\n \"quantity\": 1000000,\n \"amount\": 1000000,\n \"name\": \"Item Name\"\n }\n ],\n \"status\": \"PAID\",\n \"remarks\": \"Remarks\",\n \"url\": \"https://example.com/invoice/INV-20250101\",\n \"created_at\": \"2025-01-01T00:00:00Z\",\n \"updated_at\": \"2025-01-01T00:00:00Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://api.wizcommerce.com/v1/invoices/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"INV-20250101\",\n \"order_id\": \"ORD-20250101\",\n \"invoice_number\": \"INV-20250101\",\n \"total_amount\": 1000000,\n \"paid_amount\": 0,\n \"due_date\": \"2025-01-01T00:00:00Z\",\n \"items\": [\n {\n \"reference_id\": \"ITEM-20250101\",\n \"sku\": \"SKU-20250101\",\n \"quantity\": 1000000,\n \"amount\": 1000000,\n \"name\": \"Item Name\"\n }\n ],\n \"status\": \"PAID\",\n \"remarks\": \"Remarks\",\n \"url\": \"https://example.com/invoice/INV-20250101\",\n \"created_at\": \"2025-01-01T00:00:00Z\",\n \"updated_at\": \"2025-01-01T00:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v1/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference_id\": \"INV-20250101\",\n \"order_id\": \"ORD-20250101\",\n \"invoice_number\": \"INV-20250101\",\n \"total_amount\": 1000000,\n \"paid_amount\": 0,\n \"due_date\": \"2025-01-01T00:00:00Z\",\n \"items\": [\n {\n \"reference_id\": \"ITEM-20250101\",\n \"sku\": \"SKU-20250101\",\n \"quantity\": 1000000,\n \"amount\": 1000000,\n \"name\": \"Item Name\"\n }\n ],\n \"status\": \"PAID\",\n \"remarks\": \"Remarks\",\n \"url\": \"https://example.com/invoice/INV-20250101\",\n \"created_at\": \"2025-01-01T00:00:00Z\",\n \"updated_at\": \"2025-01-01T00:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "INV-20250101",
"order_id": "ORD-20250101",
"invoice_number": "INV-20250101",
"total_amount": 269.96,
"paid_amount": 100,
"status": "PAID",
"due_date": "2025-01-01T00:00:00Z",
"remarks": "Remarks",
"url": "https://example.com/invoice/INV-20250101",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z",
"items": [
{
"name": "Item Name",
"product_id": "1234567890",
"amount": 1000000,
"item_total": 1000000,
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"quantity": 1000000,
"reference_id": "ITEM-20250101"
}
]
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Invoices
Update Invoice
Update Invoice
PUT
/
v1
/
invoices
/
{id}
Update Invoice
curl --request PUT \
--url https://api.wizcommerce.com/v1/invoices/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reference_id": "INV-20250101",
"order_id": "ORD-20250101",
"invoice_number": "INV-20250101",
"total_amount": 1000000,
"paid_amount": 0,
"due_date": "2025-01-01T00:00:00Z",
"items": [
{
"reference_id": "ITEM-20250101",
"sku": "SKU-20250101",
"quantity": 1000000,
"amount": 1000000,
"name": "Item Name"
}
],
"status": "PAID",
"remarks": "Remarks",
"url": "https://example.com/invoice/INV-20250101",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
}
'import requests
url = "https://api.wizcommerce.com/v1/invoices/{id}"
payload = {
"reference_id": "INV-20250101",
"order_id": "ORD-20250101",
"invoice_number": "INV-20250101",
"total_amount": 1000000,
"paid_amount": 0,
"due_date": "2025-01-01T00:00:00Z",
"items": [
{
"reference_id": "ITEM-20250101",
"sku": "SKU-20250101",
"quantity": 1000000,
"amount": 1000000,
"name": "Item Name"
}
],
"status": "PAID",
"remarks": "Remarks",
"url": "https://example.com/invoice/INV-20250101",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference_id: 'INV-20250101',
order_id: 'ORD-20250101',
invoice_number: 'INV-20250101',
total_amount: 1000000,
paid_amount: 0,
due_date: '2025-01-01T00:00:00Z',
items: [
{
reference_id: 'ITEM-20250101',
sku: 'SKU-20250101',
quantity: 1000000,
amount: 1000000,
name: 'Item Name'
}
],
status: 'PAID',
remarks: 'Remarks',
url: 'https://example.com/invoice/INV-20250101',
created_at: '2025-01-01T00:00:00Z',
updated_at: '2025-01-01T00:00:00Z'
})
};
fetch('https://api.wizcommerce.com/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://api.wizcommerce.com/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([
'reference_id' => 'INV-20250101',
'order_id' => 'ORD-20250101',
'invoice_number' => 'INV-20250101',
'total_amount' => 1000000,
'paid_amount' => 0,
'due_date' => '2025-01-01T00:00:00Z',
'items' => [
[
'reference_id' => 'ITEM-20250101',
'sku' => 'SKU-20250101',
'quantity' => 1000000,
'amount' => 1000000,
'name' => 'Item Name'
]
],
'status' => 'PAID',
'remarks' => 'Remarks',
'url' => 'https://example.com/invoice/INV-20250101',
'created_at' => '2025-01-01T00:00:00Z',
'updated_at' => '2025-01-01T00:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.wizcommerce.com/v1/invoices/{id}"
payload := strings.NewReader("{\n \"reference_id\": \"INV-20250101\",\n \"order_id\": \"ORD-20250101\",\n \"invoice_number\": \"INV-20250101\",\n \"total_amount\": 1000000,\n \"paid_amount\": 0,\n \"due_date\": \"2025-01-01T00:00:00Z\",\n \"items\": [\n {\n \"reference_id\": \"ITEM-20250101\",\n \"sku\": \"SKU-20250101\",\n \"quantity\": 1000000,\n \"amount\": 1000000,\n \"name\": \"Item Name\"\n }\n ],\n \"status\": \"PAID\",\n \"remarks\": \"Remarks\",\n \"url\": \"https://example.com/invoice/INV-20250101\",\n \"created_at\": \"2025-01-01T00:00:00Z\",\n \"updated_at\": \"2025-01-01T00:00:00Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://api.wizcommerce.com/v1/invoices/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"INV-20250101\",\n \"order_id\": \"ORD-20250101\",\n \"invoice_number\": \"INV-20250101\",\n \"total_amount\": 1000000,\n \"paid_amount\": 0,\n \"due_date\": \"2025-01-01T00:00:00Z\",\n \"items\": [\n {\n \"reference_id\": \"ITEM-20250101\",\n \"sku\": \"SKU-20250101\",\n \"quantity\": 1000000,\n \"amount\": 1000000,\n \"name\": \"Item Name\"\n }\n ],\n \"status\": \"PAID\",\n \"remarks\": \"Remarks\",\n \"url\": \"https://example.com/invoice/INV-20250101\",\n \"created_at\": \"2025-01-01T00:00:00Z\",\n \"updated_at\": \"2025-01-01T00:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v1/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference_id\": \"INV-20250101\",\n \"order_id\": \"ORD-20250101\",\n \"invoice_number\": \"INV-20250101\",\n \"total_amount\": 1000000,\n \"paid_amount\": 0,\n \"due_date\": \"2025-01-01T00:00:00Z\",\n \"items\": [\n {\n \"reference_id\": \"ITEM-20250101\",\n \"sku\": \"SKU-20250101\",\n \"quantity\": 1000000,\n \"amount\": 1000000,\n \"name\": \"Item Name\"\n }\n ],\n \"status\": \"PAID\",\n \"remarks\": \"Remarks\",\n \"url\": \"https://example.com/invoice/INV-20250101\",\n \"created_at\": \"2025-01-01T00:00:00Z\",\n \"updated_at\": \"2025-01-01T00:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "INV-20250101",
"order_id": "ORD-20250101",
"invoice_number": "INV-20250101",
"total_amount": 269.96,
"paid_amount": 100,
"status": "PAID",
"due_date": "2025-01-01T00:00:00Z",
"remarks": "Remarks",
"url": "https://example.com/invoice/INV-20250101",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z",
"items": [
{
"name": "Item Name",
"product_id": "1234567890",
"amount": 1000000,
"item_total": 1000000,
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"quantity": 1000000,
"reference_id": "ITEM-20250101"
}
]
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}The
PUT request is used to fully replace an existing entity with a new one based on the provided ID. This means:- All fields in the request body will overwrite the existing entity.
- Any missing fields will be removed from the entity.
- The request is idempotent, meaning multiple identical PUT requests will always result in the same final state.
Authorizations
API Key for authentication
Path Parameters
Invoice ID
Body
application/json
Invoice
Maximum string length:
255Example:
"INV-20250101"
Maximum string length:
255Example:
"ORD-20250101"
Maximum string length:
255Example:
"INV-20250101"
Example:
1000000
Required range:
x >= 0Example:
0
Example:
"2025-01-01T00:00:00Z"
Show child attributes
Show child attributes
Available options:
PAID, PENDING, PARTIALLY_PAID, OVERPAID Example:
"PAID"
Maximum string length:
255Example:
"Remarks"
Example:
"https://example.com/invoice/INV-20250101"
Example:
"2025-01-01T00:00:00Z"
Updated at must be later than the order creation date
Example:
"2025-01-01T00:00:00Z"
Response
Created
Show child attributes
Show child attributes
Was this page helpful?
⌘I
