curl --request POST \
--url https://api.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"reasonCode": "<string>",
"issueDate": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note"
payload = {
"reasonCode": "<string>",
"issueDate": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reasonCode: '<string>', issueDate: '2023-11-07T05:31:56Z'})
};
fetch('https://api.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note', 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.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note",
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([
'reasonCode' => '<string>',
'issueDate' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note"
payload := strings.NewReader("{\n \"reasonCode\": \"<string>\",\n \"issueDate\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://api.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reasonCode\": \"<string>\",\n \"issueDate\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reasonCode\": \"<string>\",\n \"issueDate\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"creditNoteId": "<string>",
"documentNumber": "<string>",
"contractId": "<string>",
"customerId": "<string>",
"invoiceIds": [
"<string>"
],
"reasonCode": "<string>",
"state": "<string>",
"currency": "<string>",
"total": 123,
"issueDate": "<string>"
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "CustomerNotFound"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Issue credit note
Issues a credit note crediting the invoice in full. This is how a change to a contract that can no longer be amended — one whose invoices have been sent or carry usage reports — gets settled. Usage-based lines are skipped, as they carry no fixed amount to credit against; crediting part of an invoice is a dashboard operation.
curl --request POST \
--url https://api.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"reasonCode": "<string>",
"issueDate": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note"
payload = {
"reasonCode": "<string>",
"issueDate": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reasonCode: '<string>', issueDate: '2023-11-07T05:31:56Z'})
};
fetch('https://api.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note', 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.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note",
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([
'reasonCode' => '<string>',
'issueDate' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note"
payload := strings.NewReader("{\n \"reasonCode\": \"<string>\",\n \"issueDate\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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://api.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reasonCode\": \"<string>\",\n \"issueDate\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stigg.io/api/v1/customers/{id}/invoices/{invoiceRef}/credit-note")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reasonCode\": \"<string>\",\n \"issueDate\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"creditNoteId": "<string>",
"documentNumber": "<string>",
"contractId": "<string>",
"customerId": "<string>",
"invoiceIds": [
"<string>"
],
"reasonCode": "<string>",
"state": "<string>",
"currency": "<string>",
"total": 123,
"issueDate": "<string>"
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "CustomerNotFound"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Authorizations
Server API Key
Headers
Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.
Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).
Path Parameters
External ID of the customer the invoice belongs to: your customer ref when mapped, otherwise the Received customer ID
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$The billing provider (Received) invoice ID
255Body
Response
The issued credit note.
Response object
A credit note raised against one or more invoices — how a change to a contract that can no longer be amended gets settled.
Show child attributes
Show child attributes
Related topics
Adjust credit balanceCredits webhooksNetworking, security, and data flowBilling integrationMonetize my product using credits