Skip to main content
POST
/
credit-notes
Create a new Credit Note
curl --request POST \
  --url https://eu.sequencehq.com/api/credit-notes \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "invoiceId": "af60cab3-812d-4250-a051-0fb7133a00c7",
  "currency": "GBP",
  "billingPeriodStart": "2022-10-01T00:00:00Z",
  "billingPeriodEnd": "2022-10-30T00:00:00Z",
  "purchaseOrderNumber": "PO123",
  "customerId": "61b083e0-1faa-47ca-9aeb-6205da8f6c47",
  "customerEmails": [
    "customer@example.com",
    "customer.alias@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",
  "metadata": [
    {
      "key": "example-label",
      "value": "label-value"
    }
  ],
  "customerTaxId": "TAX123",
  "accountingDate": "2025-08-29"
}
'
import requests

url = "https://eu.sequencehq.com/api/credit-notes"

payload = {
    "invoiceId": "af60cab3-812d-4250-a051-0fb7133a00c7",
    "currency": "GBP",
    "billingPeriodStart": "2022-10-01T00:00:00Z",
    "billingPeriodEnd": "2022-10-30T00:00:00Z",
    "purchaseOrderNumber": "PO123",
    "customerId": "61b083e0-1faa-47ca-9aeb-6205da8f6c47",
    "customerEmails": ["customer@example.com", "customer.alias@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",
    "metadata": [
        {
            "key": "example-label",
            "value": "label-value"
        }
    ],
    "customerTaxId": "TAX123",
    "accountingDate": "2025-08-29"
}
headers = {
    "Authorization": "<authorization>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    invoiceId: 'af60cab3-812d-4250-a051-0fb7133a00c7',
    currency: 'GBP',
    billingPeriodStart: '2022-10-01T00:00:00Z',
    billingPeriodEnd: '2022-10-30T00:00:00Z',
    purchaseOrderNumber: 'PO123',
    customerId: '61b083e0-1faa-47ca-9aeb-6205da8f6c47',
    customerEmails: ['customer@example.com', 'customer.alias@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',
    metadata: [{key: 'example-label', value: 'label-value'}],
    customerTaxId: 'TAX123',
    accountingDate: '2025-08-29'
  })
};

fetch('https://eu.sequencehq.com/api/credit-notes', 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/credit-notes",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'invoiceId' => 'af60cab3-812d-4250-a051-0fb7133a00c7',
    'currency' => 'GBP',
    'billingPeriodStart' => '2022-10-01T00:00:00Z',
    'billingPeriodEnd' => '2022-10-30T00:00:00Z',
    'purchaseOrderNumber' => 'PO123',
    'customerId' => '61b083e0-1faa-47ca-9aeb-6205da8f6c47',
    'customerEmails' => [
        'customer@example.com',
        'customer.alias@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',
    'metadata' => [
        [
                'key' => 'example-label',
                'value' => 'label-value'
        ]
    ],
    'customerTaxId' => 'TAX123',
    'accountingDate' => '2025-08-29'
  ]),
  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/credit-notes"

	payload := strings.NewReader("{\n  \"invoiceId\": \"af60cab3-812d-4250-a051-0fb7133a00c7\",\n  \"currency\": \"GBP\",\n  \"billingPeriodStart\": \"2022-10-01T00:00:00Z\",\n  \"billingPeriodEnd\": \"2022-10-30T00:00:00Z\",\n  \"purchaseOrderNumber\": \"PO123\",\n  \"customerId\": \"61b083e0-1faa-47ca-9aeb-6205da8f6c47\",\n  \"customerEmails\": [\n    \"customer@example.com\",\n    \"customer.alias@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  \"metadata\": [\n    {\n      \"key\": \"example-label\",\n      \"value\": \"label-value\"\n    }\n  ],\n  \"customerTaxId\": \"TAX123\",\n  \"accountingDate\": \"2025-08-29\"\n}")

	req, _ := http.NewRequest("POST", 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.post("https://eu.sequencehq.com/api/credit-notes")
  .header("Authorization", "<authorization>")
  .header("Content-Type", "application/json")
  .body("{\n  \"invoiceId\": \"af60cab3-812d-4250-a051-0fb7133a00c7\",\n  \"currency\": \"GBP\",\n  \"billingPeriodStart\": \"2022-10-01T00:00:00Z\",\n  \"billingPeriodEnd\": \"2022-10-30T00:00:00Z\",\n  \"purchaseOrderNumber\": \"PO123\",\n  \"customerId\": \"61b083e0-1faa-47ca-9aeb-6205da8f6c47\",\n  \"customerEmails\": [\n    \"customer@example.com\",\n    \"customer.alias@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  \"metadata\": [\n    {\n      \"key\": \"example-label\",\n      \"value\": \"label-value\"\n    }\n  ],\n  \"customerTaxId\": \"TAX123\",\n  \"accountingDate\": \"2025-08-29\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://eu.sequencehq.com/api/credit-notes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"invoiceId\": \"af60cab3-812d-4250-a051-0fb7133a00c7\",\n  \"currency\": \"GBP\",\n  \"billingPeriodStart\": \"2022-10-01T00:00:00Z\",\n  \"billingPeriodEnd\": \"2022-10-30T00:00:00Z\",\n  \"purchaseOrderNumber\": \"PO123\",\n  \"customerId\": \"61b083e0-1faa-47ca-9aeb-6205da8f6c47\",\n  \"customerEmails\": [\n    \"customer@example.com\",\n    \"customer.alias@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  \"metadata\": [\n    {\n      \"key\": \"example-label\",\n      \"value\": \"label-value\"\n    }\n  ],\n  \"customerTaxId\": \"TAX123\",\n  \"accountingDate\": \"2025-08-29\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "af60cab3-812d-4250-a051-0fb7133a00c7",
  "sequenceAccountId": "68233908-402a-43b4-8952-1c2ab0ef0b25",
  "status": "SENT",
  "invoiceId": "af60cab3-812d-4250-a051-0fb7133a00c7",
  "invoiceNumber": "INV00001",
  "billingScheduleId": "fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95",
  "currency": "GBP",
  "issueDate": "2022-09-15",
  "billingPeriodStart": "2022-10-01T00:00:00Z",
  "billingPeriodEnd": "2022-10-30T00:00:00Z",
  "creditNoteNumber": "CN00001",
  "purchaseOrderNumber": "PO123",
  "customerId": "61b083e0-1faa-47ca-9aeb-6205da8f6c47",
  "customerEmails": [
    "customer@example.com",
    "customer.alias@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",
  "totalTax": "2.50",
  "netTotal": "51.20",
  "grossTotal": "101.23",
  "metadata": [
    {
      "key": "example-label",
      "value": "label-value"
    }
  ],
  "customerTaxId": "TAX123",
  "linkedServices": [
    {
      "externalId": "123",
      "externalService": "Xero",
      "syncTime": "2022-06-28T16:47:00Z",
      "externalUrl": "https://invoicing.xero.com/view/85e52542-3e54-4f0d-872b-33bba11a0504"
    }
  ],
  "applicationStatus": "UNAPPLIED",
  "merchantDetails": {
    "address": {
      "line1": "The White House",
      "line2": "1600 Pennsylvania Avenue",
      "town": "Washington, D.C.",
      "state": "CA",
      "postcode": "20500",
      "country": "US"
    },
    "phoneNumber": "0800001066",
    "email": "donald@example.com",
    "taxId": "TAX60",
    "iban": "GB33BUKB20201555555555",
    "ukAccountDetails": {
      "sortCode": "000000",
      "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"
      }
    },
    "caBankAccountDetails": {
      "transitNumber": "123",
      "institutionNumber": "12345",
      "accountNumber": "1234567"
    },
    "canadianInternationalDestination": {
      "legalName": "John Doe",
      "accountNumber": "12345678",
      "transitNumber": "12345",
      "bankName": "Chase",
      "bankAddress": {
        "line1": "JP Morgan Chase",
        "town": "New York City",
        "state": "NY",
        "postcode": "10017",
        "country": "US"
      },
      "institutionNumber": "123",
      "swiftCode": "CHASUS33",
      "intermediaryBank": {
        "bankName": "Chase",
        "bankAddress": {
          "line1": "JP Morgan Chase",
          "town": "New York City",
          "state": "NY",
          "postcode": "10017",
          "country": "US"
        },
        "swiftCode": "CHASUS33",
        "routingNumber": "123456789"
      }
    },
    "australianDestination": {
      "legalName": "John Doe",
      "accountNumber": "12345678",
      "swiftCode": "CHASUS33",
      "bsb": "123456"
    },
    "swedishBankgiroDestination": {
      "bankgiroNumber": "123-4567",
      "accountName": "12345678"
    },
    "logoUrl": "logo",
    "legalCompanyName": "The Merchant",
    "primaryColour": "#000000",
    "customFields": [
      {
        "key": "example-label",
        "value": "label-value"
      }
    ],
    "includeBeneficiaryAddressInPaymentDetails": true
  },
  "settings": {
    "generateCashCreditGrant": "ENABLED"
  },
  "accountingDate": "2022-09-30"
}
This response has no body data.
This response has no body data.
This response has no body data.

Headers

Authorization
string
required

Your API credentials. Eg. Basic {credentials}.

sequence-version
enum<string>

Use this header to select an API version

Available options:
2024-07-30

Body

application/json
currency
enum<string>
required

Credit Note currency

Available options:
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
Example:

"GBP"

customerId
string
required

The ID of the Customer this Credit Note is linked to

Example:

"61b083e0-1faa-47ca-9aeb-6205da8f6c47"

invoiceId
string

Invoice ID

Example:

"af60cab3-812d-4250-a051-0fb7133a00c7"

billingPeriodStart
string

Billing period start

Example:

"2022-10-01T00:00:00Z"

billingPeriodEnd
string

Billing period end

Example:

"2022-10-30T00:00:00Z"

purchaseOrderNumber
string

Purchase order number

Example:

"PO123"

customerEmails
string[]

Customer's email addresses, used for sending the Credit Note if provided

Example:
[
  "customer@example.com",
  "customer.alias@example.com"
]

Customer's legal company name

Example:

"Facebook"

customerBillingAddress
object

Customer's billing address

Example:
{
  "line1": "Flat 1",
  "line2": "15 Yemen Road",
  "town": "Yemen",
  "state": "CA",
  "postcode": "YE1 2YE",
  "country": "YE"
}
customerShippingAddress
object

Customer's billing address

Example:
{
  "line1": "Flat 1",
  "line2": "15 Yemen Road",
  "town": "Yemen",
  "state": "CA",
  "postcode": "YE1 2YE",
  "country": "YE"
}
memo
string

Credit Note memo

Example:

"Thanks"

metadata
object[]

Mapping of key-value pairs to attach to the Credit Note. These are not interpreted by Sequence; they are present for your use alone.

Example:
[
  {
    "key": "example-label",
    "value": "label-value"
  }
]
customerTaxId
string

Customer's tax ID

Example:

"TAX123"

accountingDate
string

Accounting date

Example:

"2025-08-29"

Response

Created

id
string
required

Credit Note ID

Example:

"af60cab3-812d-4250-a051-0fb7133a00c7"

sequenceAccountId
string
required

Sequence Account ID

Example:

"68233908-402a-43b4-8952-1c2ab0ef0b25"

status
enum<string>
required

Credit Note status

Available options:
DRAFT,
FINAL,
IN_PROGRESS,
SENT,
VOIDED
Example:

"DRAFT"

currency
enum<string>
required

Credit Note currency

Available options:
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
Example:

"GBP"

customerId
string
required

The ID of the Customer this Credit Note is linked to

Example:

"61b083e0-1faa-47ca-9aeb-6205da8f6c47"

customerEmails
string[]
required

Customer's email addresses, used for sending the Credit Note if provided

Example:
[
  "customer@example.com",
  "customer.alias@example.com"
]

Customer's legal company name

Example:

"Facebook"

customerBillingAddress
object
required

Customer's billing address

Example:
{
  "line1": "Flat 1",
  "line2": "15 Yemen Road",
  "town": "Yemen",
  "state": "CA",
  "postcode": "YE1 2YE",
  "country": "YE"
}
customerShippingAddress
object
required

Customer's billing address

Example:
{
  "line1": "Flat 1",
  "line2": "15 Yemen Road",
  "town": "Yemen",
  "state": "CA",
  "postcode": "YE1 2YE",
  "country": "YE"
}
totalTax
string
required

Total tax, in decimal format of the Credit Note's currency

Example:

"2.50"

netTotal
string
required

Net total, in decimal format of the Credit Note's currency

Example:

"51.20"

grossTotal
string
required

Gross total, in decimal format of the Invoice's currency

Example:

"101.23"

metadata
object[]
required

Mapping of key-value pairs to attach to the Credit Note. These are not interpreted by Sequence; they are present for your use alone.

Example:
[
  {
    "key": "example-label",
    "value": "label-value"
  }
]
linkedServices
object[]
required

External services which are linked to this credit note

Example:
[
  {
    "externalId": "123",
    "externalService": "Xero",
    "syncTime": "2022-06-28T16:47:00Z",
    "externalUrl": "https://invoicing.xero.com/view/85e52542-3e54-4f0d-872b-33bba11a0504"
  }
]
settings
object
required

Credit note settings

Example:
{ "generateCashCreditGrant": "ENABLED" }
invoiceId
string

Invoice ID

Example:

"af60cab3-812d-4250-a051-0fb7133a00c7"

invoiceNumber
string

Invoice Number

Example:

"INV00001"

billingScheduleId
string

Subscription ID

Example:

"fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95"

issueDate
string

Issue date

Example:

"2022-09-15"

billingPeriodStart
string

Billing period start

Example:

"2022-10-01T00:00:00Z"

billingPeriodEnd
string

Billing period end

Example:

"2022-10-30T00:00:00Z"

creditNoteNumber
string

Credit Note number

Example:

"CN00001"

purchaseOrderNumber
string

Purchase order number

Example:

"PO123"

memo
string

Credit Note memo

Example:

"Thanks"

customerTaxId
string

Customer's tax ID

Example:

"TAX123"

applicationStatus
enum<string>

Application status derived from the ledger account balance. Omitted for credit notes that are not in a terminal status

Available options:
UNAPPLIED,
PARTIALLY_APPLIED,
FULLY_APPLIED,
UNKNOWN
Example:

"UNAPPLIED"

merchantDetails
object

Merchant details

Example:
{
  "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
string

Accounting date

Example:

"2022-09-30"