curl https://invoice.horizonpay.co/api/v1/prices \
-H "Authorization: Bearer $INVOICE_AI_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"product": "prod_Hy7Rq2Lm9Xc4Vb8Nt3Kd6Pw1",
"nickname": "Monthly",
"unit_amount": 2500000,
"currency": "USD",
"type": "recurring",
"recurring": { "interval": "month", "interval_count": 1 },
"tax_rate": 0
}'import InvoiceAI from '@horizonpay/invoice-ai'
const invoiceai = new InvoiceAI() // reads INVOICE_AI_API_KEY
const price = await invoiceai.prices.create({
product: 'prod_Hy7Rq2Lm9Xc4Vb8Nt3Kd6Pw1',
nickname: 'Monthly',
unit_amount: 2500000,
currency: 'USD',
type: 'recurring',
recurring: { interval: 'month', interval_count: 1 },
tax_rate: 0,
})
console.log(price.id)from invoice_ai import InvoiceAI
client = InvoiceAI() # reads INVOICE_AI_API_KEY
price = client.prices.create(
product="prod_Hy7Rq2Lm9Xc4Vb8Nt3Kd6Pw1",
nickname="Monthly",
unit_amount=2500000,
currency="USD",
type="recurring",
recurring={"interval": "month", "interval_count": 1},
tax_rate=0,
)
print(price.id)Create a price
Adds a price to a product. unit_amount is in integer minor units. A recurring price needs recurring.interval; it is stored for reporting — nothing auto-bills yet.
Scope: products:write
Idempotency: Idempotency-Key optional. With one, a retry with the same key and body replays the first response (Idempotent-Replayed: true); the same key with a different body is a 422 idempotency_mismatch.
curl https://invoice.horizonpay.co/api/v1/prices \
-H "Authorization: Bearer $INVOICE_AI_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"product": "prod_Hy7Rq2Lm9Xc4Vb8Nt3Kd6Pw1",
"nickname": "Monthly",
"unit_amount": 2500000,
"currency": "USD",
"type": "recurring",
"recurring": { "interval": "month", "interval_count": 1 },
"tax_rate": 0
}'import InvoiceAI from '@horizonpay/invoice-ai'
const invoiceai = new InvoiceAI() // reads INVOICE_AI_API_KEY
const price = await invoiceai.prices.create({
product: 'prod_Hy7Rq2Lm9Xc4Vb8Nt3Kd6Pw1',
nickname: 'Monthly',
unit_amount: 2500000,
currency: 'USD',
type: 'recurring',
recurring: { interval: 'month', interval_count: 1 },
tax_rate: 0,
})
console.log(price.id)from invoice_ai import InvoiceAI
client = InvoiceAI() # reads INVOICE_AI_API_KEY
price = client.prices.create(
product="prod_Hy7Rq2Lm9Xc4Vb8Nt3Kd6Pw1",
nickname="Monthly",
unit_amount=2500000,
currency="USD",
type="recurring",
recurring={"interval": "month", "interval_count": 1},
tax_rate=0,
)
print(price.id)Authorizations
An Invoice-AI API key sent as Authorization: Bearer inv_live_….
Create keys in Settings → API keys; the secret is shown once. Each key carries scopes, and every operation lists the scope it needs (x-required-scope):
business:read— Read your business profile, tax ID and bank detailsclients:read— List and read your clientsclients:write— Create, update and archive clientsproducts:read— List and read products and pricesproducts:write— Create, update and archive products and pricesinvoices:read— List and read invoices, including PDFsinvoices:write— Create, edit and delete draftsinvoices:finalize— Finalize invoices and void theminvoices:send— Email invoices to your clientspayments:write— Mark invoices as paidwebhooks:manage— Manage webhook endpoints
Keys cannot be created or revoked through the API, so a leaked key cannot mint more keys.
Headers
A unique key per distinct operation (a UUID works), reused only when retrying that same request. Up to 255 characters; stored for 24 hours.
255"6f1c2d9e-8a4b-4c3f-9e7d-2b5a1c8f4e30"
Body
The parent product, prod_… or UUID.
1"prod_Hy7Rq2Lm9Xc4Vb8Nt3Kd6Pw1"
Price per unit in integer minor units (2500000 is $25,000.00).
0 <= x <= 90071992547409912500000
ISO 4217 code, three letters (uppercased for you). Must match the invoice currency when billed.
3^[A-Z]{3}$"USD"
Internal label, e.g. "Monthly".
one_time (default) or recurring. recurring requires recurring.interval.
one_time, recurring "recurring"
Required when type is recurring; must be omitted for one_time.
Show child attributes
Show child attributes
Default tax percentage, 0–100, for lines billed from this price. Defaults to 0.
0 <= x <= 1000
Whether the price is available. Defaults to true.
true
Response
The created price.
The created price.
Show child attributes
Show child attributes