Typescript (SDK)
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.invoices.insert({
invoices: [
{
customerId: "cus_123",
planIds: [
"pro",
],
stripeId: "in_legacy_123",
status: "paid",
total: 29.99,
amountPaid: 29.99,
currency: "usd",
createdAt: 1451606400000,
hostedInvoiceUrl: "https://billing.example.com/invoices/legacy-123",
},
],
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.invoices.insert(
invoices=[
{
"customer_id": "cus_123",
"plan_ids": [
"pro",
],
"stripe_id": "in_legacy_123",
"status": "paid",
"total": 29.99,
"amount_paid": 29.99,
"currency": "usd",
"created_at": 1451606400000,
"hosted_invoice_url": "https://billing.example.com/invoices/legacy-123",
},
],
)curl --request POST \
--url https://api.useautumn.com/v1/invoices.insert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"invoices": [
{
"customer_id": "cus_123",
"plan_ids": [
"pro"
],
"stripe_id": "in_legacy_123",
"processor_type": "stripe",
"status": "paid",
"total": 29.99,
"amount_paid": 29.99,
"refunded_amount": 0,
"currency": "usd",
"created_at": 1451606400000,
"hosted_invoice_url": "https://billing.example.com/invoices/legacy-123"
}
]
}
'{
"invoices": [
{
"id": "inv_2b3c4d5e6f7g8h",
"customer_id": "cus_123",
"plan_ids": [
"pro"
],
"stripe_id": "in_legacy_123",
"processor_type": "stripe",
"status": "paid",
"total": 29.99,
"amount_paid": 29.99,
"refunded_amount": 0,
"currency": "usd",
"created_at": 1451606400000,
"hosted_invoice_url": "https://billing.example.com/invoices/legacy-123"
}
]
}
Customers
Insert Invoices
Inserts or updates up to 500 historical invoices without reading or mutating the billing processor.
POST
/
v1
/
invoices.insert
Typescript (SDK)
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.invoices.insert({
invoices: [
{
customerId: "cus_123",
planIds: [
"pro",
],
stripeId: "in_legacy_123",
status: "paid",
total: 29.99,
amountPaid: 29.99,
currency: "usd",
createdAt: 1451606400000,
hostedInvoiceUrl: "https://billing.example.com/invoices/legacy-123",
},
],
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.invoices.insert(
invoices=[
{
"customer_id": "cus_123",
"plan_ids": [
"pro",
],
"stripe_id": "in_legacy_123",
"status": "paid",
"total": 29.99,
"amount_paid": 29.99,
"currency": "usd",
"created_at": 1451606400000,
"hosted_invoice_url": "https://billing.example.com/invoices/legacy-123",
},
],
)curl --request POST \
--url https://api.useautumn.com/v1/invoices.insert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"invoices": [
{
"customer_id": "cus_123",
"plan_ids": [
"pro"
],
"stripe_id": "in_legacy_123",
"processor_type": "stripe",
"status": "paid",
"total": 29.99,
"amount_paid": 29.99,
"refunded_amount": 0,
"currency": "usd",
"created_at": 1451606400000,
"hosted_invoice_url": "https://billing.example.com/invoices/legacy-123"
}
]
}
'{
"invoices": [
{
"id": "inv_2b3c4d5e6f7g8h",
"customer_id": "cus_123",
"plan_ids": [
"pro"
],
"stripe_id": "in_legacy_123",
"processor_type": "stripe",
"status": "paid",
"total": 29.99,
"amount_paid": 29.99,
"refunded_amount": 0,
"currency": "usd",
"created_at": 1451606400000,
"hosted_invoice_url": "https://billing.example.com/invoices/legacy-123"
}
]
}
Body Parameters
Response
{
"invoices": [
{
"id": "inv_2b3c4d5e6f7g8h",
"customer_id": "cus_123",
"plan_ids": [
"pro"
],
"stripe_id": "in_legacy_123",
"processor_type": "stripe",
"status": "paid",
"total": 29.99,
"amount_paid": 29.99,
"refunded_amount": 0,
"currency": "usd",
"created_at": 1451606400000,
"hosted_invoice_url": "https://billing.example.com/invoices/legacy-123"
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
Invoices to insert or update, in response order.
Maximum array length:
500Show child attributes
Show child attributes
Response
200 - application/json
OK
Inserted or updated invoices in request order.
Show child attributes
Show child attributes
⌘I