Get invoice attachments
curl --request GET \
--url https://api.valyx.com/invoice/attachments \
--header 'X-Valyx-Attachment-Upload-Signature: <x-valyx-attachment-upload-signature>'import requests
url = "https://api.valyx.com/invoice/attachments"
headers = {"X-Valyx-Attachment-Upload-Signature": "<x-valyx-attachment-upload-signature>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Valyx-Attachment-Upload-Signature': '<x-valyx-attachment-upload-signature>'}
};
fetch('https://api.valyx.com/invoice/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'GET',
headers: {'X-Valyx-Attachment-Upload-Signature': '<x-valyx-attachment-upload-signature>'}
};
fetch('https://api.valyx.com/invoice/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.valyx.com/invoice/attachments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Valyx-Attachment-Upload-Signature", "<x-valyx-attachment-upload-signature>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.valyx.com/invoice/attachments")
.header("X-Valyx-Attachment-Upload-Signature", "<x-valyx-attachment-upload-signature>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valyx.com/invoice/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Valyx-Attachment-Upload-Signature: <x-valyx-attachment-upload-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.valyx.com/invoice/attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Valyx-Attachment-Upload-Signature"] = '<x-valyx-attachment-upload-signature>'
response = http.request(request)
puts response.read_bodyimport Foundation
let url = URL(string: "https://api.valyx.com/invoice/attachments")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["X-Valyx-Attachment-Upload-Signature": "<x-valyx-attachment-upload-signature>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.valyx.com/invoice/attachments")
.get()
.addHeader("X-Valyx-Attachment-Upload-Signature", "<x-valyx-attachment-upload-signature>")
.build()
val response = client.newCall(request).execute()using RestSharp;
var options = new RestClientOptions("https://api.valyx.com/invoice/attachments");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Valyx-Attachment-Upload-Signature", "<x-valyx-attachment-upload-signature>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"error": "<string>",
"message": "<string>",
"data": {
"invoiceId": "<string>",
"invoiceNumber": "<string>",
"customerName": "<string>",
"buyerId": "<string>",
"attachments": [
{
"filename": "<string>",
"purpose": "<string>",
"createdAt": "<string>"
}
]
}
}APIs
Fetch Invoice attachments
GET
/
invoice
/
attachments
Get invoice attachments
curl --request GET \
--url https://api.valyx.com/invoice/attachments \
--header 'X-Valyx-Attachment-Upload-Signature: <x-valyx-attachment-upload-signature>'import requests
url = "https://api.valyx.com/invoice/attachments"
headers = {"X-Valyx-Attachment-Upload-Signature": "<x-valyx-attachment-upload-signature>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Valyx-Attachment-Upload-Signature': '<x-valyx-attachment-upload-signature>'}
};
fetch('https://api.valyx.com/invoice/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'GET',
headers: {'X-Valyx-Attachment-Upload-Signature': '<x-valyx-attachment-upload-signature>'}
};
fetch('https://api.valyx.com/invoice/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.valyx.com/invoice/attachments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Valyx-Attachment-Upload-Signature", "<x-valyx-attachment-upload-signature>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.valyx.com/invoice/attachments")
.header("X-Valyx-Attachment-Upload-Signature", "<x-valyx-attachment-upload-signature>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valyx.com/invoice/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Valyx-Attachment-Upload-Signature: <x-valyx-attachment-upload-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.valyx.com/invoice/attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Valyx-Attachment-Upload-Signature"] = '<x-valyx-attachment-upload-signature>'
response = http.request(request)
puts response.read_bodyimport Foundation
let url = URL(string: "https://api.valyx.com/invoice/attachments")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["X-Valyx-Attachment-Upload-Signature": "<x-valyx-attachment-upload-signature>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.valyx.com/invoice/attachments")
.get()
.addHeader("X-Valyx-Attachment-Upload-Signature", "<x-valyx-attachment-upload-signature>")
.build()
val response = client.newCall(request).execute()using RestSharp;
var options = new RestClientOptions("https://api.valyx.com/invoice/attachments");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Valyx-Attachment-Upload-Signature", "<x-valyx-attachment-upload-signature>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"error": "<string>",
"message": "<string>",
"data": {
"invoiceId": "<string>",
"invoiceNumber": "<string>",
"customerName": "<string>",
"buyerId": "<string>",
"attachments": [
{
"filename": "<string>",
"purpose": "<string>",
"createdAt": "<string>"
}
]
}
}Headers
Auth key for attachment upload
Auth key for attachment upload
An optional fields mask
Query Parameters
uploaded before should be this date
uploaded before should be this date
Purpose of the attachment. Allowed values:
- INVOICE_FOR_BUYER, INVOICE_SUPPORTING, PURCHASE_ORDER etc.
Available options:
INVOICE_FOR_BUYER, INVOICE_SUPPORTING, PURCHASE_ORDER, SALES_ORDER, DELIVERY_DOCUMENT, PAYMENT_PROOF, DISPUTE, DISPUTE_RESOLUTION, ENQUIRY, ENQUIRY_RESOLUTION, TAX_DOCUMENT, COMMERCIAL_AGREEMENT, COMMERCIAL_AGREEMENT_SUPPORTING, LEGAL, GENERAL, CREDITNOTE_FOR_BUYER, CREDITNOTE_SUPPORTING, TICKET, USAGE_ESTIMATE, MAIL_ATTACHMENT ⌘I