Skip to main content
POST
/
credit-notes
/
{creditnote}
/
line-items
Create a new Credit Note Line Item
curl --request POST \
  --url https://eu.sequencehq.com/api/credit-notes/{creditnote}/line-items \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "creditNoteId": "af60cab3-812d-4250-a051-0fb7133a00c7",
  "groupId": "cd11218d-fa00-4faa-8684-a43113d076a8",
  "lineItemId": "af60cab3-812d-4250-a051-0fb7133a00c7",
  "title": "Ferraris",
  "description": "Red",
  "quantity": "2",
  "rate": "20000.10",
  "taxRate": "0.2",
  "rateDisplay": "ABSOLUTE",
  "externalIds": [
    {
      "key": "Xero",
      "value": "123"
    }
  ],
  "servicePeriod": {
    "start": "2025-10-01",
    "endInclusive": "2025-10-30"
  },
  "revenueRecognitionMethod": "POINT_IN_TIME",
  "revenueClassification": "EARNED",
  "productId": "fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95",
  "invoiceLineItemIds": [
    "af60cab3-812d-4250-a051-0fb7133a00c7"
  ]
}
'
import requests

url = "https://eu.sequencehq.com/api/credit-notes/{creditnote}/line-items"

payload = {
"creditNoteId": "af60cab3-812d-4250-a051-0fb7133a00c7",
"groupId": "cd11218d-fa00-4faa-8684-a43113d076a8",
"lineItemId": "af60cab3-812d-4250-a051-0fb7133a00c7",
"title": "Ferraris",
"description": "Red",
"quantity": "2",
"rate": "20000.10",
"taxRate": "0.2",
"rateDisplay": "ABSOLUTE",
"externalIds": [
{
"key": "Xero",
"value": "123"
}
],
"servicePeriod": {
"start": "2025-10-01",
"endInclusive": "2025-10-30"
},
"revenueRecognitionMethod": "POINT_IN_TIME",
"revenueClassification": "EARNED",
"productId": "fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95",
"invoiceLineItemIds": ["af60cab3-812d-4250-a051-0fb7133a00c7"]
}
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({
creditNoteId: 'af60cab3-812d-4250-a051-0fb7133a00c7',
groupId: 'cd11218d-fa00-4faa-8684-a43113d076a8',
lineItemId: 'af60cab3-812d-4250-a051-0fb7133a00c7',
title: 'Ferraris',
description: 'Red',
quantity: '2',
rate: '20000.10',
taxRate: '0.2',
rateDisplay: 'ABSOLUTE',
externalIds: [{key: 'Xero', value: '123'}],
servicePeriod: {start: '2025-10-01', endInclusive: '2025-10-30'},
revenueRecognitionMethod: 'POINT_IN_TIME',
revenueClassification: 'EARNED',
productId: 'fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95',
invoiceLineItemIds: ['af60cab3-812d-4250-a051-0fb7133a00c7']
})
};

fetch('https://eu.sequencehq.com/api/credit-notes/{creditnote}/line-items', 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/{creditnote}/line-items",
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([
'creditNoteId' => 'af60cab3-812d-4250-a051-0fb7133a00c7',
'groupId' => 'cd11218d-fa00-4faa-8684-a43113d076a8',
'lineItemId' => 'af60cab3-812d-4250-a051-0fb7133a00c7',
'title' => 'Ferraris',
'description' => 'Red',
'quantity' => '2',
'rate' => '20000.10',
'taxRate' => '0.2',
'rateDisplay' => 'ABSOLUTE',
'externalIds' => [
[
'key' => 'Xero',
'value' => '123'
]
],
'servicePeriod' => [
'start' => '2025-10-01',
'endInclusive' => '2025-10-30'
],
'revenueRecognitionMethod' => 'POINT_IN_TIME',
'revenueClassification' => 'EARNED',
'productId' => 'fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95',
'invoiceLineItemIds' => [
'af60cab3-812d-4250-a051-0fb7133a00c7'
]
]),
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/{creditnote}/line-items"

payload := strings.NewReader("{\n \"creditNoteId\": \"af60cab3-812d-4250-a051-0fb7133a00c7\",\n \"groupId\": \"cd11218d-fa00-4faa-8684-a43113d076a8\",\n \"lineItemId\": \"af60cab3-812d-4250-a051-0fb7133a00c7\",\n \"title\": \"Ferraris\",\n \"description\": \"Red\",\n \"quantity\": \"2\",\n \"rate\": \"20000.10\",\n \"taxRate\": \"0.2\",\n \"rateDisplay\": \"ABSOLUTE\",\n \"externalIds\": [\n {\n \"key\": \"Xero\",\n \"value\": \"123\"\n }\n ],\n \"servicePeriod\": {\n \"start\": \"2025-10-01\",\n \"endInclusive\": \"2025-10-30\"\n },\n \"revenueRecognitionMethod\": \"POINT_IN_TIME\",\n \"revenueClassification\": \"EARNED\",\n \"productId\": \"fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95\",\n \"invoiceLineItemIds\": [\n \"af60cab3-812d-4250-a051-0fb7133a00c7\"\n ]\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/{creditnote}/line-items")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"creditNoteId\": \"af60cab3-812d-4250-a051-0fb7133a00c7\",\n \"groupId\": \"cd11218d-fa00-4faa-8684-a43113d076a8\",\n \"lineItemId\": \"af60cab3-812d-4250-a051-0fb7133a00c7\",\n \"title\": \"Ferraris\",\n \"description\": \"Red\",\n \"quantity\": \"2\",\n \"rate\": \"20000.10\",\n \"taxRate\": \"0.2\",\n \"rateDisplay\": \"ABSOLUTE\",\n \"externalIds\": [\n {\n \"key\": \"Xero\",\n \"value\": \"123\"\n }\n ],\n \"servicePeriod\": {\n \"start\": \"2025-10-01\",\n \"endInclusive\": \"2025-10-30\"\n },\n \"revenueRecognitionMethod\": \"POINT_IN_TIME\",\n \"revenueClassification\": \"EARNED\",\n \"productId\": \"fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95\",\n \"invoiceLineItemIds\": [\n \"af60cab3-812d-4250-a051-0fb7133a00c7\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://eu.sequencehq.com/api/credit-notes/{creditnote}/line-items")

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 \"creditNoteId\": \"af60cab3-812d-4250-a051-0fb7133a00c7\",\n \"groupId\": \"cd11218d-fa00-4faa-8684-a43113d076a8\",\n \"lineItemId\": \"af60cab3-812d-4250-a051-0fb7133a00c7\",\n \"title\": \"Ferraris\",\n \"description\": \"Red\",\n \"quantity\": \"2\",\n \"rate\": \"20000.10\",\n \"taxRate\": \"0.2\",\n \"rateDisplay\": \"ABSOLUTE\",\n \"externalIds\": [\n {\n \"key\": \"Xero\",\n \"value\": \"123\"\n }\n ],\n \"servicePeriod\": {\n \"start\": \"2025-10-01\",\n \"endInclusive\": \"2025-10-30\"\n },\n \"revenueRecognitionMethod\": \"POINT_IN_TIME\",\n \"revenueClassification\": \"EARNED\",\n \"productId\": \"fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95\",\n \"invoiceLineItemIds\": [\n \"af60cab3-812d-4250-a051-0fb7133a00c7\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": "af60cab3-812d-4250-a051-0fb7133a00c7",
  "creditNoteId": "af60cab3-812d-4250-a051-0fb7133a00c7",
  "groupId": "cd11218d-fa00-4faa-8684-a43113d076a8",
  "lineItemId": "af60cab3-812d-4250-a051-0fb7133a00c7",
  "title": "Ferraris",
  "description": "Red",
  "quantity": "2",
  "rate": "20000.10",
  "taxRate": "0.2",
  "index": 2,
  "priceId": "fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95",
  "netTotal": "20000.00",
  "totalTax": "2000.00",
  "grossTotal": "22000.00",
  "rateDisplay": "ABSOLUTE",
  "externalIds": [
    {
      "key": "Xero",
      "value": "123"
    }
  ],
  "servicePeriod": {
    "start": "2025-10-01",
    "endInclusive": "2025-10-30"
  },
  "revenueRecognitionMethod": "STRAIGHT_LINE",
  "revenueClassification": "EARNED",
  "productId": "fe2fcd0b-4c53-45c7-b2ae-b6c1a7d21e95"
}
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

Path Parameters

creditnote
string
required

The CreditNote ID

Body

application/json
creditNoteId
string
required

Credit Note Line Item ID

Example:

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

title
string
required

Item Title

Example:

"Ferraris"

quantity
string
required

Quantity

Example:

"2"

rate
string
required

Rate per Item

Example:

"20000.10"

taxRate
string
required

Tax Rate

Example:

"0.2"

externalIds
object[]
required

IDs in external integrations

Example:
[{ "key": "Xero", "value": "123" }]
groupId
string

Credit Note Line Item Group ID

Example:

"cd11218d-fa00-4faa-8684-a43113d076a8"

lineItemId
string

Line Item ID

Example:

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

description
string

Item Description

Example:

"Red"

rateDisplay
enum<string>

Determines whether rate is displayed as an absolute value or percentage

Available options:
ABSOLUTE,
PERCENTAGE
Example:

"ABSOLUTE"

servicePeriod
object

Billing period

Example:
{
"start": "2022-10-01",
"endInclusive": "2022-10-30"
}
revenueRecognitionMethod
enum<string>

Revenue recognition method. Valid values are: STRAIGHT_LINE, POINT_IN_TIME

Available options:
STRAIGHT_LINE,
USAGE,
MILESTONE,
POINT_IN_TIME
Example:

"STRAIGHT_LINE"

revenueClassification
enum<string>

Revenue classification

Available options:
PREPAYMENT,
EARNED,
BURNDOWN
Example:

"EARNED"

productId
string

Product ID

Example:

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

invoiceLineItemIds
string[]

Invoice line items that will be refunded by the created credit note line item. Defaults to list of lineItemId if left empty

Example:
["af60cab3-812d-4250-a051-0fb7133a00c7"]

Response

Created

id
string
required

Credit Note Line Item ID

Example:

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

creditNoteId
string
required

Credit Note Line Item ID

Example:

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

title
string
required

Item Title

Example:

"Ferraris"

quantity
string
required

Quantity

Example:

"2"

rate
string
required

Rate per Item

Example:

"20000.10"

taxRate
string
required

Tax Rate

Example:

"0.2"

index
integer
required

Index (for maintaining order)

Example:

2

netTotal
string
required

Net Total

Example:

"20000.00"

totalTax
string
required

Total Tax

Example:

"2000.00"

grossTotal
string
required

Gross Total

Example:

"22000.00"

rateDisplay
enum<string>
required

Determines whether rate is displayed as an absolute value or percentage

Available options:
ABSOLUTE,
PERCENTAGE
Example:

"ABSOLUTE"

externalIds
object[]
required

IDs in external integrations

Example:
[{ "key": "Xero", "value": "123" }]
groupId
string

Credit Note Line Item Group ID

Example:

"cd11218d-fa00-4faa-8684-a43113d076a8"

lineItemId
string

Line Item ID

Example:

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

description
string

Item Description

Example:

"Red"

priceId
string

Price ID

Example:

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

servicePeriod
object

Billing period

Example:
{
"start": "2022-10-01",
"endInclusive": "2022-10-30"
}
revenueRecognitionMethod
enum<string>

Revenue recognition method

Available options:
STRAIGHT_LINE,
USAGE,
MILESTONE,
POINT_IN_TIME
Example:

"STRAIGHT_LINE"

revenueClassification
enum<string>

Revenue classification

Available options:
PREPAYMENT,
EARNED,
BURNDOWN
Example:

"EARNED"

productId
string

Product ID

Example:

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