curl --request PATCH \
--url https://eu.sequencehq.com/api/invoices/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"dueDate": "2022-09-30",
"purchaseOrderNumber": "PO123",
"reference": "ref",
"customerEmails": [
"customer.user.a@example.com",
"customer.user.b@example.com"
],
"customerLegalCompanyName": "Facebook",
"customerBillingAddress": {
"line1": "Flat 1",
"line2": "15 Yemen Road",
"town": "Yemen",
"state": "CA",
"postcode": "YE1 2YE",
"country": "YE"
},
"customerShippingAddress": {
"line1": "742 Evergreen Terrace",
"town": "Springfield",
"state": "CA",
"postcode": "12345",
"country": "US"
},
"memo": "Thanks",
"paymentOptions": [
"BANK_TRANSFER"
],
"billingPeriod": {
"start": "2022-10-01",
"endInclusive": "2022-10-30"
},
"metadata": [
{
"key": "example-label",
"value": "label-value"
}
],
"creditBalances": "Verification 2 credit balance: 7/7 (expiring on 4 May 2023)",
"billingRunId": "53ff21c8-4872-46c4-83bf-517d54876945",
"accountingDate": "2022-09-30",
"attachmentAssetIds": [
"99874519-25ce-46ff-8823-093115aa7222"
]
}
'import requests
url = "https://eu.sequencehq.com/api/invoices/{id}"
payload = {
"dueDate": "2022-09-30",
"purchaseOrderNumber": "PO123",
"reference": "ref",
"customerEmails": ["customer.user.a@example.com", "customer.user.b@example.com"],
"customerLegalCompanyName": "Facebook",
"customerBillingAddress": {
"line1": "Flat 1",
"line2": "15 Yemen Road",
"town": "Yemen",
"state": "CA",
"postcode": "YE1 2YE",
"country": "YE"
},
"customerShippingAddress": {
"line1": "742 Evergreen Terrace",
"town": "Springfield",
"state": "CA",
"postcode": "12345",
"country": "US"
},
"memo": "Thanks",
"paymentOptions": ["BANK_TRANSFER"],
"billingPeriod": {
"start": "2022-10-01",
"endInclusive": "2022-10-30"
},
"metadata": [
{
"key": "example-label",
"value": "label-value"
}
],
"creditBalances": "Verification 2 credit balance: 7/7 (expiring on 4 May 2023)",
"billingRunId": "53ff21c8-4872-46c4-83bf-517d54876945",
"accountingDate": "2022-09-30",
"attachmentAssetIds": ["99874519-25ce-46ff-8823-093115aa7222"]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dueDate: '2022-09-30',
purchaseOrderNumber: 'PO123',
reference: 'ref',
customerEmails: ['customer.user.a@example.com', 'customer.user.b@example.com'],
customerLegalCompanyName: 'Facebook',
customerBillingAddress: {
line1: 'Flat 1',
line2: '15 Yemen Road',
town: 'Yemen',
state: 'CA',
postcode: 'YE1 2YE',
country: 'YE'
},
customerShippingAddress: {
line1: '742 Evergreen Terrace',
town: 'Springfield',
state: 'CA',
postcode: '12345',
country: 'US'
},
memo: 'Thanks',
paymentOptions: ['BANK_TRANSFER'],
billingPeriod: {start: '2022-10-01', endInclusive: '2022-10-30'},
metadata: [{key: 'example-label', value: 'label-value'}],
creditBalances: 'Verification 2 credit balance: 7/7 (expiring on 4 May 2023)',
billingRunId: '53ff21c8-4872-46c4-83bf-517d54876945',
accountingDate: '2022-09-30',
attachmentAssetIds: ['99874519-25ce-46ff-8823-093115aa7222']
})
};
fetch('https://eu.sequencehq.com/api/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://eu.sequencehq.com/api/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'dueDate' => '2022-09-30',
'purchaseOrderNumber' => 'PO123',
'reference' => 'ref',
'customerEmails' => [
'customer.user.a@example.com',
'customer.user.b@example.com'
],
'customerLegalCompanyName' => 'Facebook',
'customerBillingAddress' => [
'line1' => 'Flat 1',
'line2' => '15 Yemen Road',
'town' => 'Yemen',
'state' => 'CA',
'postcode' => 'YE1 2YE',
'country' => 'YE'
],
'customerShippingAddress' => [
'line1' => '742 Evergreen Terrace',
'town' => 'Springfield',
'state' => 'CA',
'postcode' => '12345',
'country' => 'US'
],
'memo' => 'Thanks',
'paymentOptions' => [
'BANK_TRANSFER'
],
'billingPeriod' => [
'start' => '2022-10-01',
'endInclusive' => '2022-10-30'
],
'metadata' => [
[
'key' => 'example-label',
'value' => 'label-value'
]
],
'creditBalances' => 'Verification 2 credit balance: 7/7 (expiring on 4 May 2023)',
'billingRunId' => '53ff21c8-4872-46c4-83bf-517d54876945',
'accountingDate' => '2022-09-30',
'attachmentAssetIds' => [
'99874519-25ce-46ff-8823-093115aa7222'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://eu.sequencehq.com/api/invoices/{id}"
payload := strings.NewReader("{\n \"dueDate\": \"2022-09-30\",\n \"purchaseOrderNumber\": \"PO123\",\n \"reference\": \"ref\",\n \"customerEmails\": [\n \"customer.user.a@example.com\",\n \"customer.user.b@example.com\"\n ],\n \"customerLegalCompanyName\": \"Facebook\",\n \"customerBillingAddress\": {\n \"line1\": \"Flat 1\",\n \"line2\": \"15 Yemen Road\",\n \"town\": \"Yemen\",\n \"state\": \"CA\",\n \"postcode\": \"YE1 2YE\",\n \"country\": \"YE\"\n },\n \"customerShippingAddress\": {\n \"line1\": \"742 Evergreen Terrace\",\n \"town\": \"Springfield\",\n \"state\": \"CA\",\n \"postcode\": \"12345\",\n \"country\": \"US\"\n },\n \"memo\": \"Thanks\",\n \"paymentOptions\": [\n \"BANK_TRANSFER\"\n ],\n \"billingPeriod\": {\n \"start\": \"2022-10-01\",\n \"endInclusive\": \"2022-10-30\"\n },\n \"metadata\": [\n {\n \"key\": \"example-label\",\n \"value\": \"label-value\"\n }\n ],\n \"creditBalances\": \"Verification 2 credit balance: 7/7 (expiring on 4 May 2023)\",\n \"billingRunId\": \"53ff21c8-4872-46c4-83bf-517d54876945\",\n \"accountingDate\": \"2022-09-30\",\n \"attachmentAssetIds\": [\n \"99874519-25ce-46ff-8823-093115aa7222\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.patch("https://eu.sequencehq.com/api/invoices/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"dueDate\": \"2022-09-30\",\n \"purchaseOrderNumber\": \"PO123\",\n \"reference\": \"ref\",\n \"customerEmails\": [\n \"customer.user.a@example.com\",\n \"customer.user.b@example.com\"\n ],\n \"customerLegalCompanyName\": \"Facebook\",\n \"customerBillingAddress\": {\n \"line1\": \"Flat 1\",\n \"line2\": \"15 Yemen Road\",\n \"town\": \"Yemen\",\n \"state\": \"CA\",\n \"postcode\": \"YE1 2YE\",\n \"country\": \"YE\"\n },\n \"customerShippingAddress\": {\n \"line1\": \"742 Evergreen Terrace\",\n \"town\": \"Springfield\",\n \"state\": \"CA\",\n \"postcode\": \"12345\",\n \"country\": \"US\"\n },\n \"memo\": \"Thanks\",\n \"paymentOptions\": [\n \"BANK_TRANSFER\"\n ],\n \"billingPeriod\": {\n \"start\": \"2022-10-01\",\n \"endInclusive\": \"2022-10-30\"\n },\n \"metadata\": [\n {\n \"key\": \"example-label\",\n \"value\": \"label-value\"\n }\n ],\n \"creditBalances\": \"Verification 2 credit balance: 7/7 (expiring on 4 May 2023)\",\n \"billingRunId\": \"53ff21c8-4872-46c4-83bf-517d54876945\",\n \"accountingDate\": \"2022-09-30\",\n \"attachmentAssetIds\": [\n \"99874519-25ce-46ff-8823-093115aa7222\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.sequencehq.com/api/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dueDate\": \"2022-09-30\",\n \"purchaseOrderNumber\": \"PO123\",\n \"reference\": \"ref\",\n \"customerEmails\": [\n \"customer.user.a@example.com\",\n \"customer.user.b@example.com\"\n ],\n \"customerLegalCompanyName\": \"Facebook\",\n \"customerBillingAddress\": {\n \"line1\": \"Flat 1\",\n \"line2\": \"15 Yemen Road\",\n \"town\": \"Yemen\",\n \"state\": \"CA\",\n \"postcode\": \"YE1 2YE\",\n \"country\": \"YE\"\n },\n \"customerShippingAddress\": {\n \"line1\": \"742 Evergreen Terrace\",\n \"town\": \"Springfield\",\n \"state\": \"CA\",\n \"postcode\": \"12345\",\n \"country\": \"US\"\n },\n \"memo\": \"Thanks\",\n \"paymentOptions\": [\n \"BANK_TRANSFER\"\n ],\n \"billingPeriod\": {\n \"start\": \"2022-10-01\",\n \"endInclusive\": \"2022-10-30\"\n },\n \"metadata\": [\n {\n \"key\": \"example-label\",\n \"value\": \"label-value\"\n }\n ],\n \"creditBalances\": \"Verification 2 credit balance: 7/7 (expiring on 4 May 2023)\",\n \"billingRunId\": \"53ff21c8-4872-46c4-83bf-517d54876945\",\n \"accountingDate\": \"2022-09-30\",\n \"attachmentAssetIds\": [\n \"99874519-25ce-46ff-8823-093115aa7222\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "ba37a392-7054-4dae-ab37-6fee9e23fe06",
"sequenceAccountId": "af9b5988-1d7b-45f6-a188-326df5e59b24",
"status": "DRAFT",
"currency": "GBP",
"invoiceNumber": "INV2",
"dueDate": "2022-11-05",
"purchaseOrderNumber": "PO123",
"reference": "ref",
"customerEmails": [
"customer@example.com"
],
"customerLegalCompanyName": "Facebook",
"customerBillingAddress": {
"line1": "Flat 1",
"line2": "15 Yemen Road",
"town": "Yemen",
"state": "CA",
"postcode": "YE1 2YE",
"country": "YE"
},
"customerShippingAddress": {
"line1": "742 Evergreen Terrace",
"line2": "",
"town": "Springfield",
"state": "CA",
"postcode": "12345",
"country": "US"
},
"memo": "Thanks",
"paymentOptions": [
"BANK_TRANSFER"
],
"billingPeriod": {
"start": "2022-10-01",
"endInclusive": "2022-10-30"
},
"customerId": "b3c0cf23-6717-4cdc-b190-acf8aa6ccd8a",
"totalTax": "2",
"netTotal": "12",
"grossTotal": "10",
"metadata": [
{
"key": "example-label",
"value": "label-value"
}
],
"paymentStatus": "UNPAID",
"createdAt": "2022-10-30T00:00:00Z",
"creditNoteIds": [
"941272d1-f840-4e16-b698-0cd455c81e0e"
],
"linkedServices": [
{
"externalId": "ID",
"externalService": "Xero",
"syncTime": "2022-06-28T16:47:00Z",
"externalUrl": "https://invoicing.xero.com/view/85e52542-3e54-4f0d-872b-33bba11a0504"
}
],
"merchantDetails": {
"address": {
"line1": "Flat 1",
"line2": "123 Fake Street",
"town": "New York",
"state": "NY",
"postcode": "AB1 2EF",
"country": "US"
},
"phoneNumber": "0800001066",
"email": "donald@example.com",
"taxId": "TAX",
"iban": "GB33BUKB20201555555555",
"ukAccountDetails": {
"sortCode": "123456",
"accountNumber": "12345678"
},
"usAchDetails": {
"accountNumber": "12345678",
"accountName": "John Doe",
"bankName": "Chase",
"bankRoutingNumber": "123456789"
},
"usWireDetails": {
"accountNumber": "12345678",
"accountName": "John Doe",
"bankName": "Chase",
"bankRoutingNumber": "123456789",
"swiftCode": "CHASUS33",
"bankAddress": {
"line1": "JP Morgan Chase",
"town": "New York City",
"state": "NY",
"postcode": "10017",
"country": "US"
}
},
"swedishBankgiroDestination": {
"bankgiroNumber": "123-4567",
"accountName": "The Merchant"
},
"legalCompanyName": "The Merchant",
"customFields": [],
"includeBeneficiaryAddressInPaymentDetails": false
},
"accountingDate": "2022-10-05",
"customerTaxStatus": "TAXED",
"renderSettings": {
"paymentLinkDisplay": "HIDE_PAYMENT_LINK"
},
"isCustomerArchived": false,
"updatedAt": "2022-10-30T00:00:00Z"
}This response has no body data.This response has no body data.This response has no body data.Patch an invoice
Patch an invoice
curl --request PATCH \
--url https://eu.sequencehq.com/api/invoices/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"dueDate": "2022-09-30",
"purchaseOrderNumber": "PO123",
"reference": "ref",
"customerEmails": [
"customer.user.a@example.com",
"customer.user.b@example.com"
],
"customerLegalCompanyName": "Facebook",
"customerBillingAddress": {
"line1": "Flat 1",
"line2": "15 Yemen Road",
"town": "Yemen",
"state": "CA",
"postcode": "YE1 2YE",
"country": "YE"
},
"customerShippingAddress": {
"line1": "742 Evergreen Terrace",
"town": "Springfield",
"state": "CA",
"postcode": "12345",
"country": "US"
},
"memo": "Thanks",
"paymentOptions": [
"BANK_TRANSFER"
],
"billingPeriod": {
"start": "2022-10-01",
"endInclusive": "2022-10-30"
},
"metadata": [
{
"key": "example-label",
"value": "label-value"
}
],
"creditBalances": "Verification 2 credit balance: 7/7 (expiring on 4 May 2023)",
"billingRunId": "53ff21c8-4872-46c4-83bf-517d54876945",
"accountingDate": "2022-09-30",
"attachmentAssetIds": [
"99874519-25ce-46ff-8823-093115aa7222"
]
}
'import requests
url = "https://eu.sequencehq.com/api/invoices/{id}"
payload = {
"dueDate": "2022-09-30",
"purchaseOrderNumber": "PO123",
"reference": "ref",
"customerEmails": ["customer.user.a@example.com", "customer.user.b@example.com"],
"customerLegalCompanyName": "Facebook",
"customerBillingAddress": {
"line1": "Flat 1",
"line2": "15 Yemen Road",
"town": "Yemen",
"state": "CA",
"postcode": "YE1 2YE",
"country": "YE"
},
"customerShippingAddress": {
"line1": "742 Evergreen Terrace",
"town": "Springfield",
"state": "CA",
"postcode": "12345",
"country": "US"
},
"memo": "Thanks",
"paymentOptions": ["BANK_TRANSFER"],
"billingPeriod": {
"start": "2022-10-01",
"endInclusive": "2022-10-30"
},
"metadata": [
{
"key": "example-label",
"value": "label-value"
}
],
"creditBalances": "Verification 2 credit balance: 7/7 (expiring on 4 May 2023)",
"billingRunId": "53ff21c8-4872-46c4-83bf-517d54876945",
"accountingDate": "2022-09-30",
"attachmentAssetIds": ["99874519-25ce-46ff-8823-093115aa7222"]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dueDate: '2022-09-30',
purchaseOrderNumber: 'PO123',
reference: 'ref',
customerEmails: ['customer.user.a@example.com', 'customer.user.b@example.com'],
customerLegalCompanyName: 'Facebook',
customerBillingAddress: {
line1: 'Flat 1',
line2: '15 Yemen Road',
town: 'Yemen',
state: 'CA',
postcode: 'YE1 2YE',
country: 'YE'
},
customerShippingAddress: {
line1: '742 Evergreen Terrace',
town: 'Springfield',
state: 'CA',
postcode: '12345',
country: 'US'
},
memo: 'Thanks',
paymentOptions: ['BANK_TRANSFER'],
billingPeriod: {start: '2022-10-01', endInclusive: '2022-10-30'},
metadata: [{key: 'example-label', value: 'label-value'}],
creditBalances: 'Verification 2 credit balance: 7/7 (expiring on 4 May 2023)',
billingRunId: '53ff21c8-4872-46c4-83bf-517d54876945',
accountingDate: '2022-09-30',
attachmentAssetIds: ['99874519-25ce-46ff-8823-093115aa7222']
})
};
fetch('https://eu.sequencehq.com/api/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://eu.sequencehq.com/api/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'dueDate' => '2022-09-30',
'purchaseOrderNumber' => 'PO123',
'reference' => 'ref',
'customerEmails' => [
'customer.user.a@example.com',
'customer.user.b@example.com'
],
'customerLegalCompanyName' => 'Facebook',
'customerBillingAddress' => [
'line1' => 'Flat 1',
'line2' => '15 Yemen Road',
'town' => 'Yemen',
'state' => 'CA',
'postcode' => 'YE1 2YE',
'country' => 'YE'
],
'customerShippingAddress' => [
'line1' => '742 Evergreen Terrace',
'town' => 'Springfield',
'state' => 'CA',
'postcode' => '12345',
'country' => 'US'
],
'memo' => 'Thanks',
'paymentOptions' => [
'BANK_TRANSFER'
],
'billingPeriod' => [
'start' => '2022-10-01',
'endInclusive' => '2022-10-30'
],
'metadata' => [
[
'key' => 'example-label',
'value' => 'label-value'
]
],
'creditBalances' => 'Verification 2 credit balance: 7/7 (expiring on 4 May 2023)',
'billingRunId' => '53ff21c8-4872-46c4-83bf-517d54876945',
'accountingDate' => '2022-09-30',
'attachmentAssetIds' => [
'99874519-25ce-46ff-8823-093115aa7222'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://eu.sequencehq.com/api/invoices/{id}"
payload := strings.NewReader("{\n \"dueDate\": \"2022-09-30\",\n \"purchaseOrderNumber\": \"PO123\",\n \"reference\": \"ref\",\n \"customerEmails\": [\n \"customer.user.a@example.com\",\n \"customer.user.b@example.com\"\n ],\n \"customerLegalCompanyName\": \"Facebook\",\n \"customerBillingAddress\": {\n \"line1\": \"Flat 1\",\n \"line2\": \"15 Yemen Road\",\n \"town\": \"Yemen\",\n \"state\": \"CA\",\n \"postcode\": \"YE1 2YE\",\n \"country\": \"YE\"\n },\n \"customerShippingAddress\": {\n \"line1\": \"742 Evergreen Terrace\",\n \"town\": \"Springfield\",\n \"state\": \"CA\",\n \"postcode\": \"12345\",\n \"country\": \"US\"\n },\n \"memo\": \"Thanks\",\n \"paymentOptions\": [\n \"BANK_TRANSFER\"\n ],\n \"billingPeriod\": {\n \"start\": \"2022-10-01\",\n \"endInclusive\": \"2022-10-30\"\n },\n \"metadata\": [\n {\n \"key\": \"example-label\",\n \"value\": \"label-value\"\n }\n ],\n \"creditBalances\": \"Verification 2 credit balance: 7/7 (expiring on 4 May 2023)\",\n \"billingRunId\": \"53ff21c8-4872-46c4-83bf-517d54876945\",\n \"accountingDate\": \"2022-09-30\",\n \"attachmentAssetIds\": [\n \"99874519-25ce-46ff-8823-093115aa7222\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.patch("https://eu.sequencehq.com/api/invoices/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"dueDate\": \"2022-09-30\",\n \"purchaseOrderNumber\": \"PO123\",\n \"reference\": \"ref\",\n \"customerEmails\": [\n \"customer.user.a@example.com\",\n \"customer.user.b@example.com\"\n ],\n \"customerLegalCompanyName\": \"Facebook\",\n \"customerBillingAddress\": {\n \"line1\": \"Flat 1\",\n \"line2\": \"15 Yemen Road\",\n \"town\": \"Yemen\",\n \"state\": \"CA\",\n \"postcode\": \"YE1 2YE\",\n \"country\": \"YE\"\n },\n \"customerShippingAddress\": {\n \"line1\": \"742 Evergreen Terrace\",\n \"town\": \"Springfield\",\n \"state\": \"CA\",\n \"postcode\": \"12345\",\n \"country\": \"US\"\n },\n \"memo\": \"Thanks\",\n \"paymentOptions\": [\n \"BANK_TRANSFER\"\n ],\n \"billingPeriod\": {\n \"start\": \"2022-10-01\",\n \"endInclusive\": \"2022-10-30\"\n },\n \"metadata\": [\n {\n \"key\": \"example-label\",\n \"value\": \"label-value\"\n }\n ],\n \"creditBalances\": \"Verification 2 credit balance: 7/7 (expiring on 4 May 2023)\",\n \"billingRunId\": \"53ff21c8-4872-46c4-83bf-517d54876945\",\n \"accountingDate\": \"2022-09-30\",\n \"attachmentAssetIds\": [\n \"99874519-25ce-46ff-8823-093115aa7222\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.sequencehq.com/api/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dueDate\": \"2022-09-30\",\n \"purchaseOrderNumber\": \"PO123\",\n \"reference\": \"ref\",\n \"customerEmails\": [\n \"customer.user.a@example.com\",\n \"customer.user.b@example.com\"\n ],\n \"customerLegalCompanyName\": \"Facebook\",\n \"customerBillingAddress\": {\n \"line1\": \"Flat 1\",\n \"line2\": \"15 Yemen Road\",\n \"town\": \"Yemen\",\n \"state\": \"CA\",\n \"postcode\": \"YE1 2YE\",\n \"country\": \"YE\"\n },\n \"customerShippingAddress\": {\n \"line1\": \"742 Evergreen Terrace\",\n \"town\": \"Springfield\",\n \"state\": \"CA\",\n \"postcode\": \"12345\",\n \"country\": \"US\"\n },\n \"memo\": \"Thanks\",\n \"paymentOptions\": [\n \"BANK_TRANSFER\"\n ],\n \"billingPeriod\": {\n \"start\": \"2022-10-01\",\n \"endInclusive\": \"2022-10-30\"\n },\n \"metadata\": [\n {\n \"key\": \"example-label\",\n \"value\": \"label-value\"\n }\n ],\n \"creditBalances\": \"Verification 2 credit balance: 7/7 (expiring on 4 May 2023)\",\n \"billingRunId\": \"53ff21c8-4872-46c4-83bf-517d54876945\",\n \"accountingDate\": \"2022-09-30\",\n \"attachmentAssetIds\": [\n \"99874519-25ce-46ff-8823-093115aa7222\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "ba37a392-7054-4dae-ab37-6fee9e23fe06",
"sequenceAccountId": "af9b5988-1d7b-45f6-a188-326df5e59b24",
"status": "DRAFT",
"currency": "GBP",
"invoiceNumber": "INV2",
"dueDate": "2022-11-05",
"purchaseOrderNumber": "PO123",
"reference": "ref",
"customerEmails": [
"customer@example.com"
],
"customerLegalCompanyName": "Facebook",
"customerBillingAddress": {
"line1": "Flat 1",
"line2": "15 Yemen Road",
"town": "Yemen",
"state": "CA",
"postcode": "YE1 2YE",
"country": "YE"
},
"customerShippingAddress": {
"line1": "742 Evergreen Terrace",
"line2": "",
"town": "Springfield",
"state": "CA",
"postcode": "12345",
"country": "US"
},
"memo": "Thanks",
"paymentOptions": [
"BANK_TRANSFER"
],
"billingPeriod": {
"start": "2022-10-01",
"endInclusive": "2022-10-30"
},
"customerId": "b3c0cf23-6717-4cdc-b190-acf8aa6ccd8a",
"totalTax": "2",
"netTotal": "12",
"grossTotal": "10",
"metadata": [
{
"key": "example-label",
"value": "label-value"
}
],
"paymentStatus": "UNPAID",
"createdAt": "2022-10-30T00:00:00Z",
"creditNoteIds": [
"941272d1-f840-4e16-b698-0cd455c81e0e"
],
"linkedServices": [
{
"externalId": "ID",
"externalService": "Xero",
"syncTime": "2022-06-28T16:47:00Z",
"externalUrl": "https://invoicing.xero.com/view/85e52542-3e54-4f0d-872b-33bba11a0504"
}
],
"merchantDetails": {
"address": {
"line1": "Flat 1",
"line2": "123 Fake Street",
"town": "New York",
"state": "NY",
"postcode": "AB1 2EF",
"country": "US"
},
"phoneNumber": "0800001066",
"email": "donald@example.com",
"taxId": "TAX",
"iban": "GB33BUKB20201555555555",
"ukAccountDetails": {
"sortCode": "123456",
"accountNumber": "12345678"
},
"usAchDetails": {
"accountNumber": "12345678",
"accountName": "John Doe",
"bankName": "Chase",
"bankRoutingNumber": "123456789"
},
"usWireDetails": {
"accountNumber": "12345678",
"accountName": "John Doe",
"bankName": "Chase",
"bankRoutingNumber": "123456789",
"swiftCode": "CHASUS33",
"bankAddress": {
"line1": "JP Morgan Chase",
"town": "New York City",
"state": "NY",
"postcode": "10017",
"country": "US"
}
},
"swedishBankgiroDestination": {
"bankgiroNumber": "123-4567",
"accountName": "The Merchant"
},
"legalCompanyName": "The Merchant",
"customFields": [],
"includeBeneficiaryAddressInPaymentDetails": false
},
"accountingDate": "2022-10-05",
"customerTaxStatus": "TAXED",
"renderSettings": {
"paymentLinkDisplay": "HIDE_PAYMENT_LINK"
},
"isCustomerArchived": false,
"updatedAt": "2022-10-30T00:00:00Z"
}This response has no body data.This response has no body data.This response has no body data.Headers
Your API credentials. Eg. Basic {credentials}.
Use this header to select an API version
2024-07-30 Path Parameters
Invoice ID
Body
Due date
"2022-09-30"
Purchase order number
"PO123"
Reference
"ref"
Customer email addresses, used for sending the Invoice if provided
[
"customer.user.a@example.com",
"customer.user.b@example.com"
]
Customer's legal company name
"Facebook"
Customer's billing address
Show child attributes
Show child attributes
{
"line1": "Flat 1",
"line2": "15 Yemen Road",
"town": "Yemen",
"state": "CA",
"postcode": "YE1 2YE",
"country": "YE"
}
Customer's billing address
Show child attributes
Show child attributes
{
"line1": "Flat 1",
"line2": "15 Yemen Road",
"town": "Yemen",
"state": "CA",
"postcode": "YE1 2YE",
"country": "YE"
}
Invoice memo
"Thanks"
Invoice payment options
BANK_TRANSFER, LINK ["BANK_TRANSFER"]
Billing period
Show child attributes
Show child attributes
{
"start": "2022-10-01",
"endInclusive": "2022-10-30"
}
Mapping of key-value pairs to attach to the Invoice. These are not interpreted by Sequence; they are present for your use alone.
Show child attributes
Show child attributes
[
{
"key": "example-label",
"value": "label-value"
}
]
Credit balances
"Verification 2 credit balance: 7/7 (expiring on 4 May 2023)"
Billing Run ID
"53ff21c8-4872-46c4-83bf-517d54876945"
Accounting date
"2022-09-30"
Attachment asset IDs
["99874519-25ce-46ff-8823-093115aa7222"]
Response
OK
Invoice ID
"ba37a392-7054-4dae-ab37-6fee9e23fe06"
Sequence Account ID
"af9b5988-1d7b-45f6-a188-326df5e59b24"
Invoice status
IN_PROGRESS, DRAFT, FINAL, SENT, VOIDED "SENT"
Invoice currency
AED, ARS, AUD, BRL, BGN, CAD, CHF, CLP, CNY, COP, CZK, DKK, EGP, EUR, GBP, HKD, ILS, INR, ISK, JPY, KRW, MXN, NOK, NZD, PLN, SAR, SEK, SGD, THB, USD, UYU, ZAR "GBP"
Customer email addresses, used for sending the Invoice if provided
["customer@example.com"]
Customer's legal company name
"Facebook"
Customer's billing address
Show child attributes
Show child attributes
{
"line1": "Flat 1",
"line2": "15 Yemen Road",
"town": "Yemen",
"state": "CA",
"postcode": "YE1 2YE",
"country": "YE"
}
Customer's billing address
Show child attributes
Show child attributes
{
"line1": "Flat 1",
"line2": "15 Yemen Road",
"town": "Yemen",
"state": "CA",
"postcode": "YE1 2YE",
"country": "YE"
}
The ID of the Customer this invoice is linked to
"b3c0cf23-6717-4cdc-b190-acf8aa6ccd8a"
Total tax, in decimal format of the Invoice's currency
"2"
Net total, in decimal format of the Invoice's currency
"12"
Gross total, in decimal format of the Invoice's currency
"10"
Mapping of key-value pairs to attach to the Invoice. These are not interpreted by Sequence; they are present for your use alone.
Show child attributes
Show child attributes
[
{
"key": "example-label",
"value": "label-value"
}
]
Invoice payment status
UNPAID, PARTIALLY_PAID, PAID, UNCOLLECTIBLE "UNPAID"
Creation time
"2022-10-30T00:00:00Z"
IDs of linked credit notes (if any)
["941272d1-f840-4e16-b698-0cd455c81e0e"]
External services which are linked to this invoice
Show child attributes
Show child attributes
[
{
"externalId": "ID",
"externalService": "Xero",
"syncTime": "2022-06-28T16:47:00Z",
"externalUrl": "https://invoicing.xero.com/view/85e52542-3e54-4f0d-872b-33bba11a0504"
}
]
Accounting date
"2022-10-05"
Settings that control how the invoice is rendered.
Show child attributes
Show child attributes
{ "paymentLinkDisplay": "HIDE_PAYMENT_LINK" }
false
Last updated time
"2022-10-30T00:00:00Z"
Invoice number
"INV2"
Due date
"2022-11-05"
Purchase order number
"PO123"
Reference
"ref"
Invoice memo
"Thanks"
Invoice payment options
BANK_TRANSFER, LINK ["BANK_TRANSFER"]
Billing period
Show child attributes
Show child attributes
{
"start": "2022-10-01",
"endInclusive": "2022-10-30"
}
Merchant details
Show child attributes
Show child attributes
{
"address": {
"line1": "Flat 1",
"line2": "123 Fake Street",
"town": "New York",
"state": "NY",
"postcode": "AB1 2EF",
"country": "US"
},
"phoneNumber": "0800001066",
"email": "donald@example.com",
"taxId": "TAX",
"iban": "GB33BUKB20201555555555",
"ukAccountDetails": {
"sortCode": "123456",
"accountNumber": "12345678"
},
"usAchDetails": {
"accountNumber": "12345678",
"accountName": "John Doe",
"bankName": "Chase",
"bankRoutingNumber": "123456789"
},
"usWireDetails": {
"accountNumber": "12345678",
"accountName": "John Doe",
"bankName": "Chase",
"bankRoutingNumber": "123456789",
"swiftCode": "CHASUS33",
"bankAddress": {
"line1": "JP Morgan Chase",
"town": "New York City",
"state": "NY",
"postcode": "10017",
"country": "US"
}
},
"swedishBankgiroDestination": {
"bankgiroNumber": "123-4567",
"accountName": "The Merchant"
},
"legalCompanyName": "The Merchant",
"customFields": [],
"includeBeneficiaryAddressInPaymentDetails": false
}
Customer tax status
TAXED, TAX_EXEMPT, REVERSE_CHARGED "TAXED"
Billing Schedule ID
"fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95"
Issue date
"2022-09-15"
Customer's tax ID
"TAX123"
Credit balances
"Verification 2 credit balance: 7/7 (expiring on 4 May 2023)"
Dunning status
SCHEDULED, OVERDUE_CHECK_SCHEDULED, COMPLETED, FAILED, NOT_REQUIRED "SCHEDULED"
Time this invoice was last calculated (applicable for invoices generated by billing engine only)
"2022-09-30T00:00:00Z"