Create invoices
curl --request POST \
--url https://api.hyperline.co/v2/invoices/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invoices": [
{
"customer_id": "cus_Typ0px2W0aiEtl",
"line_items": [
{
"name": "Platform access",
"unit_amount": 24000,
"description": "Access fee for the period of November 2024",
"units_count": 1,
"tax_rate": 20,
"period_start": "2024-10-13T00:00:00.000Z",
"period_end": "2024-11-13T00:00:00.000Z",
"display_unit_amount": true,
"display_service_period": true,
"product_id": "itm_KbLcWt2qm5p1S2"
}
],
"batch_invoice_id": "invoice-123",
"currency": "EUR",
"status": "paid",
"invoicing_entity_id": "ive_47484fjdhy5",
"number": "INV-35",
"type": "invoice",
"document_name": "<string>",
"reference": "V0KAHOU6J3",
"purchase_order": "PO-12345",
"custom_note": "Thank you for your purchase!",
"additional_info": "This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.",
"footer": "ACME (Acme SAS) is a company registered in France | SIREN N°123456",
"tax_rate": 50,
"tax_scheme": "auto",
"payment_method_strategy": "external",
"payment_method_id": "pm_1ryTrMj4TTAT1N",
"bank_account_id": "bac_KJyPrMA1toAqRG",
"subscription_id": "sub_amiaWZ3lzDIWaoT",
"emitted_at": "2024-10-13T00:00:00.000Z",
"due_at": "2024-11-12T00:00:00.000Z",
"settled_at": "2024-10-15T14:01:56.000Z",
"properties": {},
"custom_properties": {},
"transactions": [
{
"amount": 31500,
"process_at": "2024-11-12T07:38:39.222Z",
"payment_method_id": "pm_1xMpj5bwRqN7LM"
}
],
"coupons": [
{
"coupon_id": "cou_1eTaiytfA0i2Vb",
"name": "Black Friday 2023",
"discount_amount": 500,
"line_item_indexes": [
0,
1
]
}
]
}
],
"batch_id": "f65f58f3-ecb0-4711-be22-1e64102a380d"
}
'import requests
url = "https://api.hyperline.co/v2/invoices/batch"
payload = {
"invoices": [
{
"customer_id": "cus_Typ0px2W0aiEtl",
"line_items": [
{
"name": "Platform access",
"unit_amount": 24000,
"description": "Access fee for the period of November 2024",
"units_count": 1,
"tax_rate": 20,
"period_start": "2024-10-13T00:00:00.000Z",
"period_end": "2024-11-13T00:00:00.000Z",
"display_unit_amount": True,
"display_service_period": True,
"product_id": "itm_KbLcWt2qm5p1S2"
}
],
"batch_invoice_id": "invoice-123",
"currency": "EUR",
"status": "paid",
"invoicing_entity_id": "ive_47484fjdhy5",
"number": "INV-35",
"type": "invoice",
"document_name": "<string>",
"reference": "V0KAHOU6J3",
"purchase_order": "PO-12345",
"custom_note": "Thank you for your purchase!",
"additional_info": "This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.",
"footer": "ACME (Acme SAS) is a company registered in France | SIREN N°123456",
"tax_rate": 50,
"tax_scheme": "auto",
"payment_method_strategy": "external",
"payment_method_id": "pm_1ryTrMj4TTAT1N",
"bank_account_id": "bac_KJyPrMA1toAqRG",
"subscription_id": "sub_amiaWZ3lzDIWaoT",
"emitted_at": "2024-10-13T00:00:00.000Z",
"due_at": "2024-11-12T00:00:00.000Z",
"settled_at": "2024-10-15T14:01:56.000Z",
"properties": {},
"custom_properties": {},
"transactions": [
{
"amount": 31500,
"process_at": "2024-11-12T07:38:39.222Z",
"payment_method_id": "pm_1xMpj5bwRqN7LM"
}
],
"coupons": [
{
"coupon_id": "cou_1eTaiytfA0i2Vb",
"name": "Black Friday 2023",
"discount_amount": 500,
"line_item_indexes": [0, 1]
}
]
}
],
"batch_id": "f65f58f3-ecb0-4711-be22-1e64102a380d"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoices: [
{
customer_id: 'cus_Typ0px2W0aiEtl',
line_items: [
{
name: 'Platform access',
unit_amount: 24000,
description: 'Access fee for the period of November 2024',
units_count: 1,
tax_rate: 20,
period_start: '2024-10-13T00:00:00.000Z',
period_end: '2024-11-13T00:00:00.000Z',
display_unit_amount: true,
display_service_period: true,
product_id: 'itm_KbLcWt2qm5p1S2'
}
],
batch_invoice_id: 'invoice-123',
currency: 'EUR',
status: 'paid',
invoicing_entity_id: 'ive_47484fjdhy5',
number: 'INV-35',
type: 'invoice',
document_name: '<string>',
reference: 'V0KAHOU6J3',
purchase_order: 'PO-12345',
custom_note: 'Thank you for your purchase!',
additional_info: 'This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.',
footer: 'ACME (Acme SAS) is a company registered in France | SIREN N°123456',
tax_rate: 50,
tax_scheme: 'auto',
payment_method_strategy: 'external',
payment_method_id: 'pm_1ryTrMj4TTAT1N',
bank_account_id: 'bac_KJyPrMA1toAqRG',
subscription_id: 'sub_amiaWZ3lzDIWaoT',
emitted_at: '2024-10-13T00:00:00.000Z',
due_at: '2024-11-12T00:00:00.000Z',
settled_at: '2024-10-15T14:01:56.000Z',
properties: {},
custom_properties: {},
transactions: [
{
amount: 31500,
process_at: '2024-11-12T07:38:39.222Z',
payment_method_id: 'pm_1xMpj5bwRqN7LM'
}
],
coupons: [
{
coupon_id: 'cou_1eTaiytfA0i2Vb',
name: 'Black Friday 2023',
discount_amount: 500,
line_item_indexes: [0, 1]
}
]
}
],
batch_id: 'f65f58f3-ecb0-4711-be22-1e64102a380d'
})
};
fetch('https://api.hyperline.co/v2/invoices/batch', 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.hyperline.co/v2/invoices/batch",
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([
'invoices' => [
[
'customer_id' => 'cus_Typ0px2W0aiEtl',
'line_items' => [
[
'name' => 'Platform access',
'unit_amount' => 24000,
'description' => 'Access fee for the period of November 2024',
'units_count' => 1,
'tax_rate' => 20,
'period_start' => '2024-10-13T00:00:00.000Z',
'period_end' => '2024-11-13T00:00:00.000Z',
'display_unit_amount' => true,
'display_service_period' => true,
'product_id' => 'itm_KbLcWt2qm5p1S2'
]
],
'batch_invoice_id' => 'invoice-123',
'currency' => 'EUR',
'status' => 'paid',
'invoicing_entity_id' => 'ive_47484fjdhy5',
'number' => 'INV-35',
'type' => 'invoice',
'document_name' => '<string>',
'reference' => 'V0KAHOU6J3',
'purchase_order' => 'PO-12345',
'custom_note' => 'Thank you for your purchase!',
'additional_info' => 'This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.',
'footer' => 'ACME (Acme SAS) is a company registered in France | SIREN N°123456',
'tax_rate' => 50,
'tax_scheme' => 'auto',
'payment_method_strategy' => 'external',
'payment_method_id' => 'pm_1ryTrMj4TTAT1N',
'bank_account_id' => 'bac_KJyPrMA1toAqRG',
'subscription_id' => 'sub_amiaWZ3lzDIWaoT',
'emitted_at' => '2024-10-13T00:00:00.000Z',
'due_at' => '2024-11-12T00:00:00.000Z',
'settled_at' => '2024-10-15T14:01:56.000Z',
'properties' => [
],
'custom_properties' => [
],
'transactions' => [
[
'amount' => 31500,
'process_at' => '2024-11-12T07:38:39.222Z',
'payment_method_id' => 'pm_1xMpj5bwRqN7LM'
]
],
'coupons' => [
[
'coupon_id' => 'cou_1eTaiytfA0i2Vb',
'name' => 'Black Friday 2023',
'discount_amount' => 500,
'line_item_indexes' => [
0,
1
]
]
]
]
],
'batch_id' => 'f65f58f3-ecb0-4711-be22-1e64102a380d'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.hyperline.co/v2/invoices/batch"
payload := strings.NewReader("{\n \"invoices\": [\n {\n \"customer_id\": \"cus_Typ0px2W0aiEtl\",\n \"line_items\": [\n {\n \"name\": \"Platform access\",\n \"unit_amount\": 24000,\n \"description\": \"Access fee for the period of November 2024\",\n \"units_count\": 1,\n \"tax_rate\": 20,\n \"period_start\": \"2024-10-13T00:00:00.000Z\",\n \"period_end\": \"2024-11-13T00:00:00.000Z\",\n \"display_unit_amount\": true,\n \"display_service_period\": true,\n \"product_id\": \"itm_KbLcWt2qm5p1S2\"\n }\n ],\n \"batch_invoice_id\": \"invoice-123\",\n \"currency\": \"EUR\",\n \"status\": \"paid\",\n \"invoicing_entity_id\": \"ive_47484fjdhy5\",\n \"number\": \"INV-35\",\n \"type\": \"invoice\",\n \"document_name\": \"<string>\",\n \"reference\": \"V0KAHOU6J3\",\n \"purchase_order\": \"PO-12345\",\n \"custom_note\": \"Thank you for your purchase!\",\n \"additional_info\": \"This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.\",\n \"footer\": \"ACME (Acme SAS) is a company registered in France | SIREN N°123456\",\n \"tax_rate\": 50,\n \"tax_scheme\": \"auto\",\n \"payment_method_strategy\": \"external\",\n \"payment_method_id\": \"pm_1ryTrMj4TTAT1N\",\n \"bank_account_id\": \"bac_KJyPrMA1toAqRG\",\n \"subscription_id\": \"sub_amiaWZ3lzDIWaoT\",\n \"emitted_at\": \"2024-10-13T00:00:00.000Z\",\n \"due_at\": \"2024-11-12T00:00:00.000Z\",\n \"settled_at\": \"2024-10-15T14:01:56.000Z\",\n \"properties\": {},\n \"custom_properties\": {},\n \"transactions\": [\n {\n \"amount\": 31500,\n \"process_at\": \"2024-11-12T07:38:39.222Z\",\n \"payment_method_id\": \"pm_1xMpj5bwRqN7LM\"\n }\n ],\n \"coupons\": [\n {\n \"coupon_id\": \"cou_1eTaiytfA0i2Vb\",\n \"name\": \"Black Friday 2023\",\n \"discount_amount\": 500,\n \"line_item_indexes\": [\n 0,\n 1\n ]\n }\n ]\n }\n ],\n \"batch_id\": \"f65f58f3-ecb0-4711-be22-1e64102a380d\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.hyperline.co/v2/invoices/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoices\": [\n {\n \"customer_id\": \"cus_Typ0px2W0aiEtl\",\n \"line_items\": [\n {\n \"name\": \"Platform access\",\n \"unit_amount\": 24000,\n \"description\": \"Access fee for the period of November 2024\",\n \"units_count\": 1,\n \"tax_rate\": 20,\n \"period_start\": \"2024-10-13T00:00:00.000Z\",\n \"period_end\": \"2024-11-13T00:00:00.000Z\",\n \"display_unit_amount\": true,\n \"display_service_period\": true,\n \"product_id\": \"itm_KbLcWt2qm5p1S2\"\n }\n ],\n \"batch_invoice_id\": \"invoice-123\",\n \"currency\": \"EUR\",\n \"status\": \"paid\",\n \"invoicing_entity_id\": \"ive_47484fjdhy5\",\n \"number\": \"INV-35\",\n \"type\": \"invoice\",\n \"document_name\": \"<string>\",\n \"reference\": \"V0KAHOU6J3\",\n \"purchase_order\": \"PO-12345\",\n \"custom_note\": \"Thank you for your purchase!\",\n \"additional_info\": \"This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.\",\n \"footer\": \"ACME (Acme SAS) is a company registered in France | SIREN N°123456\",\n \"tax_rate\": 50,\n \"tax_scheme\": \"auto\",\n \"payment_method_strategy\": \"external\",\n \"payment_method_id\": \"pm_1ryTrMj4TTAT1N\",\n \"bank_account_id\": \"bac_KJyPrMA1toAqRG\",\n \"subscription_id\": \"sub_amiaWZ3lzDIWaoT\",\n \"emitted_at\": \"2024-10-13T00:00:00.000Z\",\n \"due_at\": \"2024-11-12T00:00:00.000Z\",\n \"settled_at\": \"2024-10-15T14:01:56.000Z\",\n \"properties\": {},\n \"custom_properties\": {},\n \"transactions\": [\n {\n \"amount\": 31500,\n \"process_at\": \"2024-11-12T07:38:39.222Z\",\n \"payment_method_id\": \"pm_1xMpj5bwRqN7LM\"\n }\n ],\n \"coupons\": [\n {\n \"coupon_id\": \"cou_1eTaiytfA0i2Vb\",\n \"name\": \"Black Friday 2023\",\n \"discount_amount\": 500,\n \"line_item_indexes\": [\n 0,\n 1\n ]\n }\n ]\n }\n ],\n \"batch_id\": \"f65f58f3-ecb0-4711-be22-1e64102a380d\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v2/invoices/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoices\": [\n {\n \"customer_id\": \"cus_Typ0px2W0aiEtl\",\n \"line_items\": [\n {\n \"name\": \"Platform access\",\n \"unit_amount\": 24000,\n \"description\": \"Access fee for the period of November 2024\",\n \"units_count\": 1,\n \"tax_rate\": 20,\n \"period_start\": \"2024-10-13T00:00:00.000Z\",\n \"period_end\": \"2024-11-13T00:00:00.000Z\",\n \"display_unit_amount\": true,\n \"display_service_period\": true,\n \"product_id\": \"itm_KbLcWt2qm5p1S2\"\n }\n ],\n \"batch_invoice_id\": \"invoice-123\",\n \"currency\": \"EUR\",\n \"status\": \"paid\",\n \"invoicing_entity_id\": \"ive_47484fjdhy5\",\n \"number\": \"INV-35\",\n \"type\": \"invoice\",\n \"document_name\": \"<string>\",\n \"reference\": \"V0KAHOU6J3\",\n \"purchase_order\": \"PO-12345\",\n \"custom_note\": \"Thank you for your purchase!\",\n \"additional_info\": \"This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.\",\n \"footer\": \"ACME (Acme SAS) is a company registered in France | SIREN N°123456\",\n \"tax_rate\": 50,\n \"tax_scheme\": \"auto\",\n \"payment_method_strategy\": \"external\",\n \"payment_method_id\": \"pm_1ryTrMj4TTAT1N\",\n \"bank_account_id\": \"bac_KJyPrMA1toAqRG\",\n \"subscription_id\": \"sub_amiaWZ3lzDIWaoT\",\n \"emitted_at\": \"2024-10-13T00:00:00.000Z\",\n \"due_at\": \"2024-11-12T00:00:00.000Z\",\n \"settled_at\": \"2024-10-15T14:01:56.000Z\",\n \"properties\": {},\n \"custom_properties\": {},\n \"transactions\": [\n {\n \"amount\": 31500,\n \"process_at\": \"2024-11-12T07:38:39.222Z\",\n \"payment_method_id\": \"pm_1xMpj5bwRqN7LM\"\n }\n ],\n \"coupons\": [\n {\n \"coupon_id\": \"cou_1eTaiytfA0i2Vb\",\n \"name\": \"Black Friday 2023\",\n \"discount_amount\": 500,\n \"line_item_indexes\": [\n 0,\n 1\n ]\n }\n ]\n }\n ],\n \"batch_id\": \"f65f58f3-ecb0-4711-be22-1e64102a380d\"\n}"
response = http.request(request)
puts response.read_body{
"batch_id": "f65f58f3-ecb0-4711-be22-1e64102a380d"
}Invoices
Create invoices
Create invoices async in batch. Results can be tracked via webhooks with the invoice.batch.creation_succeeded and invoice.batch.creation_failed events.
POST
/
v2
/
invoices
/
batch
Create invoices
curl --request POST \
--url https://api.hyperline.co/v2/invoices/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invoices": [
{
"customer_id": "cus_Typ0px2W0aiEtl",
"line_items": [
{
"name": "Platform access",
"unit_amount": 24000,
"description": "Access fee for the period of November 2024",
"units_count": 1,
"tax_rate": 20,
"period_start": "2024-10-13T00:00:00.000Z",
"period_end": "2024-11-13T00:00:00.000Z",
"display_unit_amount": true,
"display_service_period": true,
"product_id": "itm_KbLcWt2qm5p1S2"
}
],
"batch_invoice_id": "invoice-123",
"currency": "EUR",
"status": "paid",
"invoicing_entity_id": "ive_47484fjdhy5",
"number": "INV-35",
"type": "invoice",
"document_name": "<string>",
"reference": "V0KAHOU6J3",
"purchase_order": "PO-12345",
"custom_note": "Thank you for your purchase!",
"additional_info": "This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.",
"footer": "ACME (Acme SAS) is a company registered in France | SIREN N°123456",
"tax_rate": 50,
"tax_scheme": "auto",
"payment_method_strategy": "external",
"payment_method_id": "pm_1ryTrMj4TTAT1N",
"bank_account_id": "bac_KJyPrMA1toAqRG",
"subscription_id": "sub_amiaWZ3lzDIWaoT",
"emitted_at": "2024-10-13T00:00:00.000Z",
"due_at": "2024-11-12T00:00:00.000Z",
"settled_at": "2024-10-15T14:01:56.000Z",
"properties": {},
"custom_properties": {},
"transactions": [
{
"amount": 31500,
"process_at": "2024-11-12T07:38:39.222Z",
"payment_method_id": "pm_1xMpj5bwRqN7LM"
}
],
"coupons": [
{
"coupon_id": "cou_1eTaiytfA0i2Vb",
"name": "Black Friday 2023",
"discount_amount": 500,
"line_item_indexes": [
0,
1
]
}
]
}
],
"batch_id": "f65f58f3-ecb0-4711-be22-1e64102a380d"
}
'import requests
url = "https://api.hyperline.co/v2/invoices/batch"
payload = {
"invoices": [
{
"customer_id": "cus_Typ0px2W0aiEtl",
"line_items": [
{
"name": "Platform access",
"unit_amount": 24000,
"description": "Access fee for the period of November 2024",
"units_count": 1,
"tax_rate": 20,
"period_start": "2024-10-13T00:00:00.000Z",
"period_end": "2024-11-13T00:00:00.000Z",
"display_unit_amount": True,
"display_service_period": True,
"product_id": "itm_KbLcWt2qm5p1S2"
}
],
"batch_invoice_id": "invoice-123",
"currency": "EUR",
"status": "paid",
"invoicing_entity_id": "ive_47484fjdhy5",
"number": "INV-35",
"type": "invoice",
"document_name": "<string>",
"reference": "V0KAHOU6J3",
"purchase_order": "PO-12345",
"custom_note": "Thank you for your purchase!",
"additional_info": "This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.",
"footer": "ACME (Acme SAS) is a company registered in France | SIREN N°123456",
"tax_rate": 50,
"tax_scheme": "auto",
"payment_method_strategy": "external",
"payment_method_id": "pm_1ryTrMj4TTAT1N",
"bank_account_id": "bac_KJyPrMA1toAqRG",
"subscription_id": "sub_amiaWZ3lzDIWaoT",
"emitted_at": "2024-10-13T00:00:00.000Z",
"due_at": "2024-11-12T00:00:00.000Z",
"settled_at": "2024-10-15T14:01:56.000Z",
"properties": {},
"custom_properties": {},
"transactions": [
{
"amount": 31500,
"process_at": "2024-11-12T07:38:39.222Z",
"payment_method_id": "pm_1xMpj5bwRqN7LM"
}
],
"coupons": [
{
"coupon_id": "cou_1eTaiytfA0i2Vb",
"name": "Black Friday 2023",
"discount_amount": 500,
"line_item_indexes": [0, 1]
}
]
}
],
"batch_id": "f65f58f3-ecb0-4711-be22-1e64102a380d"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoices: [
{
customer_id: 'cus_Typ0px2W0aiEtl',
line_items: [
{
name: 'Platform access',
unit_amount: 24000,
description: 'Access fee for the period of November 2024',
units_count: 1,
tax_rate: 20,
period_start: '2024-10-13T00:00:00.000Z',
period_end: '2024-11-13T00:00:00.000Z',
display_unit_amount: true,
display_service_period: true,
product_id: 'itm_KbLcWt2qm5p1S2'
}
],
batch_invoice_id: 'invoice-123',
currency: 'EUR',
status: 'paid',
invoicing_entity_id: 'ive_47484fjdhy5',
number: 'INV-35',
type: 'invoice',
document_name: '<string>',
reference: 'V0KAHOU6J3',
purchase_order: 'PO-12345',
custom_note: 'Thank you for your purchase!',
additional_info: 'This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.',
footer: 'ACME (Acme SAS) is a company registered in France | SIREN N°123456',
tax_rate: 50,
tax_scheme: 'auto',
payment_method_strategy: 'external',
payment_method_id: 'pm_1ryTrMj4TTAT1N',
bank_account_id: 'bac_KJyPrMA1toAqRG',
subscription_id: 'sub_amiaWZ3lzDIWaoT',
emitted_at: '2024-10-13T00:00:00.000Z',
due_at: '2024-11-12T00:00:00.000Z',
settled_at: '2024-10-15T14:01:56.000Z',
properties: {},
custom_properties: {},
transactions: [
{
amount: 31500,
process_at: '2024-11-12T07:38:39.222Z',
payment_method_id: 'pm_1xMpj5bwRqN7LM'
}
],
coupons: [
{
coupon_id: 'cou_1eTaiytfA0i2Vb',
name: 'Black Friday 2023',
discount_amount: 500,
line_item_indexes: [0, 1]
}
]
}
],
batch_id: 'f65f58f3-ecb0-4711-be22-1e64102a380d'
})
};
fetch('https://api.hyperline.co/v2/invoices/batch', 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.hyperline.co/v2/invoices/batch",
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([
'invoices' => [
[
'customer_id' => 'cus_Typ0px2W0aiEtl',
'line_items' => [
[
'name' => 'Platform access',
'unit_amount' => 24000,
'description' => 'Access fee for the period of November 2024',
'units_count' => 1,
'tax_rate' => 20,
'period_start' => '2024-10-13T00:00:00.000Z',
'period_end' => '2024-11-13T00:00:00.000Z',
'display_unit_amount' => true,
'display_service_period' => true,
'product_id' => 'itm_KbLcWt2qm5p1S2'
]
],
'batch_invoice_id' => 'invoice-123',
'currency' => 'EUR',
'status' => 'paid',
'invoicing_entity_id' => 'ive_47484fjdhy5',
'number' => 'INV-35',
'type' => 'invoice',
'document_name' => '<string>',
'reference' => 'V0KAHOU6J3',
'purchase_order' => 'PO-12345',
'custom_note' => 'Thank you for your purchase!',
'additional_info' => 'This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.',
'footer' => 'ACME (Acme SAS) is a company registered in France | SIREN N°123456',
'tax_rate' => 50,
'tax_scheme' => 'auto',
'payment_method_strategy' => 'external',
'payment_method_id' => 'pm_1ryTrMj4TTAT1N',
'bank_account_id' => 'bac_KJyPrMA1toAqRG',
'subscription_id' => 'sub_amiaWZ3lzDIWaoT',
'emitted_at' => '2024-10-13T00:00:00.000Z',
'due_at' => '2024-11-12T00:00:00.000Z',
'settled_at' => '2024-10-15T14:01:56.000Z',
'properties' => [
],
'custom_properties' => [
],
'transactions' => [
[
'amount' => 31500,
'process_at' => '2024-11-12T07:38:39.222Z',
'payment_method_id' => 'pm_1xMpj5bwRqN7LM'
]
],
'coupons' => [
[
'coupon_id' => 'cou_1eTaiytfA0i2Vb',
'name' => 'Black Friday 2023',
'discount_amount' => 500,
'line_item_indexes' => [
0,
1
]
]
]
]
],
'batch_id' => 'f65f58f3-ecb0-4711-be22-1e64102a380d'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.hyperline.co/v2/invoices/batch"
payload := strings.NewReader("{\n \"invoices\": [\n {\n \"customer_id\": \"cus_Typ0px2W0aiEtl\",\n \"line_items\": [\n {\n \"name\": \"Platform access\",\n \"unit_amount\": 24000,\n \"description\": \"Access fee for the period of November 2024\",\n \"units_count\": 1,\n \"tax_rate\": 20,\n \"period_start\": \"2024-10-13T00:00:00.000Z\",\n \"period_end\": \"2024-11-13T00:00:00.000Z\",\n \"display_unit_amount\": true,\n \"display_service_period\": true,\n \"product_id\": \"itm_KbLcWt2qm5p1S2\"\n }\n ],\n \"batch_invoice_id\": \"invoice-123\",\n \"currency\": \"EUR\",\n \"status\": \"paid\",\n \"invoicing_entity_id\": \"ive_47484fjdhy5\",\n \"number\": \"INV-35\",\n \"type\": \"invoice\",\n \"document_name\": \"<string>\",\n \"reference\": \"V0KAHOU6J3\",\n \"purchase_order\": \"PO-12345\",\n \"custom_note\": \"Thank you for your purchase!\",\n \"additional_info\": \"This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.\",\n \"footer\": \"ACME (Acme SAS) is a company registered in France | SIREN N°123456\",\n \"tax_rate\": 50,\n \"tax_scheme\": \"auto\",\n \"payment_method_strategy\": \"external\",\n \"payment_method_id\": \"pm_1ryTrMj4TTAT1N\",\n \"bank_account_id\": \"bac_KJyPrMA1toAqRG\",\n \"subscription_id\": \"sub_amiaWZ3lzDIWaoT\",\n \"emitted_at\": \"2024-10-13T00:00:00.000Z\",\n \"due_at\": \"2024-11-12T00:00:00.000Z\",\n \"settled_at\": \"2024-10-15T14:01:56.000Z\",\n \"properties\": {},\n \"custom_properties\": {},\n \"transactions\": [\n {\n \"amount\": 31500,\n \"process_at\": \"2024-11-12T07:38:39.222Z\",\n \"payment_method_id\": \"pm_1xMpj5bwRqN7LM\"\n }\n ],\n \"coupons\": [\n {\n \"coupon_id\": \"cou_1eTaiytfA0i2Vb\",\n \"name\": \"Black Friday 2023\",\n \"discount_amount\": 500,\n \"line_item_indexes\": [\n 0,\n 1\n ]\n }\n ]\n }\n ],\n \"batch_id\": \"f65f58f3-ecb0-4711-be22-1e64102a380d\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.hyperline.co/v2/invoices/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoices\": [\n {\n \"customer_id\": \"cus_Typ0px2W0aiEtl\",\n \"line_items\": [\n {\n \"name\": \"Platform access\",\n \"unit_amount\": 24000,\n \"description\": \"Access fee for the period of November 2024\",\n \"units_count\": 1,\n \"tax_rate\": 20,\n \"period_start\": \"2024-10-13T00:00:00.000Z\",\n \"period_end\": \"2024-11-13T00:00:00.000Z\",\n \"display_unit_amount\": true,\n \"display_service_period\": true,\n \"product_id\": \"itm_KbLcWt2qm5p1S2\"\n }\n ],\n \"batch_invoice_id\": \"invoice-123\",\n \"currency\": \"EUR\",\n \"status\": \"paid\",\n \"invoicing_entity_id\": \"ive_47484fjdhy5\",\n \"number\": \"INV-35\",\n \"type\": \"invoice\",\n \"document_name\": \"<string>\",\n \"reference\": \"V0KAHOU6J3\",\n \"purchase_order\": \"PO-12345\",\n \"custom_note\": \"Thank you for your purchase!\",\n \"additional_info\": \"This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.\",\n \"footer\": \"ACME (Acme SAS) is a company registered in France | SIREN N°123456\",\n \"tax_rate\": 50,\n \"tax_scheme\": \"auto\",\n \"payment_method_strategy\": \"external\",\n \"payment_method_id\": \"pm_1ryTrMj4TTAT1N\",\n \"bank_account_id\": \"bac_KJyPrMA1toAqRG\",\n \"subscription_id\": \"sub_amiaWZ3lzDIWaoT\",\n \"emitted_at\": \"2024-10-13T00:00:00.000Z\",\n \"due_at\": \"2024-11-12T00:00:00.000Z\",\n \"settled_at\": \"2024-10-15T14:01:56.000Z\",\n \"properties\": {},\n \"custom_properties\": {},\n \"transactions\": [\n {\n \"amount\": 31500,\n \"process_at\": \"2024-11-12T07:38:39.222Z\",\n \"payment_method_id\": \"pm_1xMpj5bwRqN7LM\"\n }\n ],\n \"coupons\": [\n {\n \"coupon_id\": \"cou_1eTaiytfA0i2Vb\",\n \"name\": \"Black Friday 2023\",\n \"discount_amount\": 500,\n \"line_item_indexes\": [\n 0,\n 1\n ]\n }\n ]\n }\n ],\n \"batch_id\": \"f65f58f3-ecb0-4711-be22-1e64102a380d\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v2/invoices/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoices\": [\n {\n \"customer_id\": \"cus_Typ0px2W0aiEtl\",\n \"line_items\": [\n {\n \"name\": \"Platform access\",\n \"unit_amount\": 24000,\n \"description\": \"Access fee for the period of November 2024\",\n \"units_count\": 1,\n \"tax_rate\": 20,\n \"period_start\": \"2024-10-13T00:00:00.000Z\",\n \"period_end\": \"2024-11-13T00:00:00.000Z\",\n \"display_unit_amount\": true,\n \"display_service_period\": true,\n \"product_id\": \"itm_KbLcWt2qm5p1S2\"\n }\n ],\n \"batch_invoice_id\": \"invoice-123\",\n \"currency\": \"EUR\",\n \"status\": \"paid\",\n \"invoicing_entity_id\": \"ive_47484fjdhy5\",\n \"number\": \"INV-35\",\n \"type\": \"invoice\",\n \"document_name\": \"<string>\",\n \"reference\": \"V0KAHOU6J3\",\n \"purchase_order\": \"PO-12345\",\n \"custom_note\": \"Thank you for your purchase!\",\n \"additional_info\": \"This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.\",\n \"footer\": \"ACME (Acme SAS) is a company registered in France | SIREN N°123456\",\n \"tax_rate\": 50,\n \"tax_scheme\": \"auto\",\n \"payment_method_strategy\": \"external\",\n \"payment_method_id\": \"pm_1ryTrMj4TTAT1N\",\n \"bank_account_id\": \"bac_KJyPrMA1toAqRG\",\n \"subscription_id\": \"sub_amiaWZ3lzDIWaoT\",\n \"emitted_at\": \"2024-10-13T00:00:00.000Z\",\n \"due_at\": \"2024-11-12T00:00:00.000Z\",\n \"settled_at\": \"2024-10-15T14:01:56.000Z\",\n \"properties\": {},\n \"custom_properties\": {},\n \"transactions\": [\n {\n \"amount\": 31500,\n \"process_at\": \"2024-11-12T07:38:39.222Z\",\n \"payment_method_id\": \"pm_1xMpj5bwRqN7LM\"\n }\n ],\n \"coupons\": [\n {\n \"coupon_id\": \"cou_1eTaiytfA0i2Vb\",\n \"name\": \"Black Friday 2023\",\n \"discount_amount\": 500,\n \"line_item_indexes\": [\n 0,\n 1\n ]\n }\n ]\n }\n ],\n \"batch_id\": \"f65f58f3-ecb0-4711-be22-1e64102a380d\"\n}"
response = http.request(request)
puts response.read_body{
"batch_id": "f65f58f3-ecb0-4711-be22-1e64102a380d"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Create invoices payload.
Response
202 - application/json
Identifier of the batch request.
Example:
"f65f58f3-ecb0-4711-be22-1e64102a380d"
Was this page helpful?
⌘I

