Upload Document to Account
curl --request PUT \
--url https://api.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file='@example-file' \
--form 'documentId=<string>' \
--form 'documentType=<string>'import requests
url = "https://api.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"documentId": "<string>",
"documentType": "<string>"
}
headers = {"x-api-key": "<api-key>"}
response = requests.put(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('documentId', '<string>');
form.append('documentType', '<string>');
const options = {method: 'PUT', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload', 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.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentType\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"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.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentType\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload")
.header("x-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentType\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload")
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.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentType\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"accountId": "<string>",
"referenceId": "<string>",
"invoices": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>",
"mpanMprn": "<string>",
"supplierName": "<string>",
"supplierAccountNumber": "<string>",
"customerName": "<string>",
"invoiceNumber": "<string>",
"invoiceDate": "2023-12-25",
"dueDate": "2023-12-25",
"chargeStartDate": "2023-12-25",
"chargeEndDate": "2023-12-25",
"meterSerialNumber": "<string>",
"siteAddress": "<string>",
"paymentMethod": "<string>",
"standingCharge": 123,
"standingChargeType": "<string>",
"cclRate": 123,
"vatRate": 123,
"readFromDate": "2023-12-25",
"readToDate": "2023-12-25",
"consumption": 123,
"dayConsumption": 123,
"nightConsumption": 123,
"unitRate": 123,
"dayUnitRate": 123,
"nightUnitRate": 123,
"correctionFactor": 123,
"calorificValue": 123,
"totalUnitCharge": 123,
"totalStandingCharge": 123,
"capacityCharge": 123,
"amountDueNetOfVat": 123,
"vat": 123,
"totalAmount": 123
}
],
"contracts": [
{
"supplierAccountNumber": "<string>",
"supplierName": "<string>",
"supplierAddress": "<string>",
"supplierCode": "<string>",
"customerName": "<string>",
"billingAddress": "<string>",
"contractNumber": "<string>",
"contractStartDate": "2023-12-25",
"contractEndDate": "2023-12-25",
"cclRate": 123,
"isFixedContract": true,
"isMarketRates": true,
"isMicroBusiness": true,
"paymentMethod": "<string>",
"contractTermMonths": 123,
"supplyPoints": [
{
"mpanMprn": "<string>",
"meterSerialNumber": "<string>",
"siteName": "<string>",
"siteAddress": "<string>",
"tariffName": "<string>",
"isNonContractedRate": true,
"standingCharge": 123,
"standingChargeType": "<string>",
"unitRate": 123,
"dayUnitRate": 123,
"nightUnitRate": 123,
"estimatedAnnualConsumption": 123,
"previous12MonthsConsumption": 123,
"maximumImportCapacity": 123,
"capacityRate": 123,
"directDebitDiscount": 123,
"brokerName": "<string>",
"brokerUplift": 123,
"vatRate": 123
}
]
}
],
"creditNotes": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>"
}
],
"debitNotes": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>"
}
],
"certificates": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>"
}
],
"others": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>"
}
],
"loas": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>"
}
]
}
]Supplier Integration
Upload Document to Account
Upload a document to a specific account for processing and storage.
PUT
/
v1
/
suppliers
/
accounts
/
{id}
/
documents
/
upload
Upload Document to Account
curl --request PUT \
--url https://api.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file='@example-file' \
--form 'documentId=<string>' \
--form 'documentType=<string>'import requests
url = "https://api.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"documentId": "<string>",
"documentType": "<string>"
}
headers = {"x-api-key": "<api-key>"}
response = requests.put(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('documentId', '<string>');
form.append('documentType', '<string>');
const options = {method: 'PUT', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload', 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.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentType\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"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.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentType\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload")
.header("x-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentType\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voltview.co.uk/v1/suppliers/accounts/{id}/documents/upload")
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.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentId\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documentType\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"accountId": "<string>",
"referenceId": "<string>",
"invoices": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>",
"mpanMprn": "<string>",
"supplierName": "<string>",
"supplierAccountNumber": "<string>",
"customerName": "<string>",
"invoiceNumber": "<string>",
"invoiceDate": "2023-12-25",
"dueDate": "2023-12-25",
"chargeStartDate": "2023-12-25",
"chargeEndDate": "2023-12-25",
"meterSerialNumber": "<string>",
"siteAddress": "<string>",
"paymentMethod": "<string>",
"standingCharge": 123,
"standingChargeType": "<string>",
"cclRate": 123,
"vatRate": 123,
"readFromDate": "2023-12-25",
"readToDate": "2023-12-25",
"consumption": 123,
"dayConsumption": 123,
"nightConsumption": 123,
"unitRate": 123,
"dayUnitRate": 123,
"nightUnitRate": 123,
"correctionFactor": 123,
"calorificValue": 123,
"totalUnitCharge": 123,
"totalStandingCharge": 123,
"capacityCharge": 123,
"amountDueNetOfVat": 123,
"vat": 123,
"totalAmount": 123
}
],
"contracts": [
{
"supplierAccountNumber": "<string>",
"supplierName": "<string>",
"supplierAddress": "<string>",
"supplierCode": "<string>",
"customerName": "<string>",
"billingAddress": "<string>",
"contractNumber": "<string>",
"contractStartDate": "2023-12-25",
"contractEndDate": "2023-12-25",
"cclRate": 123,
"isFixedContract": true,
"isMarketRates": true,
"isMicroBusiness": true,
"paymentMethod": "<string>",
"contractTermMonths": 123,
"supplyPoints": [
{
"mpanMprn": "<string>",
"meterSerialNumber": "<string>",
"siteName": "<string>",
"siteAddress": "<string>",
"tariffName": "<string>",
"isNonContractedRate": true,
"standingCharge": 123,
"standingChargeType": "<string>",
"unitRate": 123,
"dayUnitRate": 123,
"nightUnitRate": 123,
"estimatedAnnualConsumption": 123,
"previous12MonthsConsumption": 123,
"maximumImportCapacity": 123,
"capacityRate": 123,
"directDebitDiscount": 123,
"brokerName": "<string>",
"brokerUplift": 123,
"vatRate": 123
}
]
}
],
"creditNotes": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>"
}
],
"debitNotes": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>"
}
],
"certificates": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>"
}
],
"others": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>"
}
],
"loas": [
{
"id": "<string>",
"filePath": "<string>",
"extension": "<string>"
}
]
}
]Authorizations
VoltView API key
Path Parameters
Account ID
Body
multipart/form-data
Response
Document uploaded successfully and sites retrieved
Site identifier
Account identifier
Reference identifier
List of invoices for the site
Show child attributes
Show child attributes
List of contracts for the site
Show child attributes
Show child attributes
List of credit notes for the site
Show child attributes
Show child attributes
List of debit notes for the site
Show child attributes
Show child attributes
List of certificates for the site
Show child attributes
Show child attributes
List of other documents for the site
Show child attributes
Show child attributes
List of loas for the site
Show child attributes
Show child attributes
⌘I