Invoices

Invoices are bills that need to be paid by your customers. The Invoice API allows you to create, retrieve, update, and delete invoices, including managing line items for products and services being billed.

The Invoice object

Attributes
idstring

Unique identifier for the invoice.

customerobject

The customer who will be billed.

objectstring

String representing the object's type.

totalinteger

The total amount of the invoice in cents.

currencystring

Three-letter ISO currency code, in lowercase. Must be a supported currency.

statusenum

Current status of the invoice. Can be one of: draft, outstanding, due, overdue, paid, written_off, voided.

collection_methodenum

The collection method for this invoice.

auto_chargestring

Automatically charge the customer's payment method when the invoice is issued.

request_paymentstring

Send a payment request to the customer when the invoice is issued.

net_termsinteger

Number of days before the invoice is due. Default is 0 (due immediately).

invoice_numberstring

Unique number that identifies this invoice. If not provided, will be auto-generated.

descriptionstring

An arbitrary string attached to the invoice. Often useful for displaying to customers.

memostring

Internal notes for the invoice (not visible to customers).

livemodeboolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadatadictionary

A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.

line_itemsarray

A list of line items that make up the invoice. Each line item represents a product with quantity and price.

createdtimestamp

Time at which the invoice was created.

updatedtimestamp

Time at which the invoice was last updated.

THE INVOICE OBJECT
{
  "id": "f131cfbb-7fcf-4c72-8aab-958375a35830",
  "object": "invoice",
  "invoice_number": "804D5557-0001",
  "customer": {
    "object": "customer",
    "id": "605f1a98-f329-4210-939a-1e06f3b0da8b",
    "name": "Jane Doe"
  },
  "total": 10000,
  "currency": "USD",
  "status": "draft",
  "collection_method": "auto_charge",
  "net_terms": 0,
  "description": "Monthly subscription",
  "memo": "Internal notes",
  "livemode": false,
  "metadata": {
    "order_id": "6735"
  },
  "line_items": [
    {
      "object": "line_item",
      "id": "li_1234567890",
      "quantity": 2,
      "product": {
        "object": "product",
        "id": "prod_1234567890",
        "name": "T-shirt",
        "price": 2000
      }
    }
  ],
  "created": 1633046400,
  "updated": 1633046400
}

List All Invoices

Retrieves a list of invoices for your merchant account, with optional filtering by customer and status.

Parameters
per_pageinteger

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

pageinteger

The page offset at which you'd like to resume fetching data.

customerstring

Filter invoices by customer ID.

statusenum

Filter invoices by status. Can be one or more of: draft, outstanding, due, overdue, paid, written_off, voided.

Returns

A dictionary with a data property that contains an array of up to limit Invoice objects. Each entry in the array is a separate Invoice object. If no more Invoices are available, the resulting array will be empty.

GET/v1/invoices
curl --request GET \
    --url https://api.framepayments.com/v1/invoices \
    --header 'Authorization: Bearer API_KEY'
Response
{
  "meta": {
    "page": 1,
    "url": "/v1/invoices",
    "has_more": false,
    "prev": null,
    "next": null
  },
  "data": [
    {
      "id": "f131cfbb-7fcf-4c72-8aab-958375a35830",
      "object": "invoice",
      "invoice_number": "804D5557-0001",
      "customer": {
        "object": "customer",
        "id": "605f1a98-f329-4210-939a-1e06f3b0da8b",
        "name": "Jane Doe"
      },
      "total": 240000,
      "currency": "USD",
      "status": "draft",
      "collection_method": "request_payment",
      "net_terms": 10,
      "description": "description",
      "memo": "memo",
      "livemode": false,
      "created": 1713435744,
      "updated": 1713435744,
      "metadata": {
        "key": "test_key",
        "value": "test_value"
      },
      "line_items": []
    }
  ]
}

Create an Invoice

Creates a new invoice with the specified parameters.

Parameters
customerREQUIREDstring

The ID of the customer who will be billed.

collection_methodREQUIREDenum

The collection method for this invoice.

auto_chargestring

Automatically charge the customer's payment method when the invoice is issued.

request_paymentstring

Send a payment request to the customer when the invoice is issued.

net_termsinteger

Number of days before the invoice is due. Default is 0 (due immediately).

numberstring

Unique number that identifies this invoice. If not provided, will be auto-generated.

descriptionstring

An arbitrary string attached to the invoice. Often useful for displaying to customers.

memostring

Internal notes for the invoice (not visible to customers).

metadatadictionary

A metadata object consists of key-value pairs that can be attached to Frame object. Use metadata to store structured, additional information about the object for your reference. Learn more about storing information in metadata.

line_itemsarray

Array of line items to be added to the invoice.

productREQUIREDstring

The ID of the product to be added to the invoice.

quantityREQUIREDinteger

The quantity of the product to be added to the invoice.

Returns

Returns the created Invoice object if the request was successful.

POST/v1/invoices
curl --request POST \
  --url https://api.framepayments.com/v1/invoices \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "customer": "a793a06e-e2d5-4dd0-b495-f1fc0b0a9eb3",
    "collection_method": "request_payment",
    "metadata": {
      "test": "test"
    }
  }'
Response
{
  "id": "a8b4735a-c441-4c6c-88bb-4bd8666c6c89",
  "object": "invoice",
  "invoice_number": "804D5557-DRAFT",
  "customer": {
    "object": "customer",
    "id": "a793a06e-e2d5-4dd0-b495-f1fc0b0a9eb3",
    "name": "Tamala Abshire LLD"
  },
  "total": 0,
  "currency": "USD",
  "livemode": false,
  "created": 1748357861,
  "updated": 1748357861,
  "line_items": [],
  "collection_method": "request_payment",
  "status": "draft",
  "metadata": {
    "test": "test"
  },
  "due_date": null,
  "description": null,
  "memo": null,
  "net_terms": 0
}

Update an Invoice

Updates an existing invoice with the specified parameters.

Parameters
collection_methodenum

The collection method for this invoice.

auto_chargestring

Automatically charge the customer's payment method when the invoice is issued.

request_paymentstring

Send a payment request to the customer when the invoice is issued.

net_termsinteger

Number of days before the invoice is due.

numberstring

Unique number that identifies this invoice.

descriptionstring

An arbitrary string attached to the invoice. Often useful for displaying to customers.

memostring

Internal notes for the invoice (not visible to customers).

metadataobject

Set of key-value pairs that you can attach to an invoice.

line_itemsarray

Array of line items to be added or updated in the invoice.

productREQUIREDstring

The ID of the product to be added to the invoice.

quantityREQUIREDinteger

The quantity of the product to be added to the invoice.

Returns

Returns the updated Invoice object if the request was successful.

PATCH/v1/invoices/:id
curl --request PATCH \
  --url https://api.framepayments.com/v1/invoices/inv_6113c3cb-2304-45e1-9551-fa7fb804418f \
  --header 'Authorization: Bearer API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "description": "Updated description",
    "line_items": [
      {
        "product": "prod_1234567890",
        "quantity": 2
      }
    ]
  }'
Response
{
  "id": "f131cfbb-7fcf-4c72-8aab-958375a35830",
  "object": "invoice",
  "invoice_number": "804D5557-0001",
  "customer": {
    "object": "customer",
    "id": "605f1a98-f329-4210-939a-1e06f3b0da8b",
    "name": "Jane Doe"
  },
  "total": 400000,
  "currency": "USD",
  "status": "draft",
  "collection_method": "request_payment",
  "net_terms": 10,
  "number": "INV-0001",
  "description": "Updated description",
  "memo": "memo",
  "livemode": false,
  "created": 1713435744,
  "updated": 1713436000,
  "metadata": {
    "key": "test_key",
    "value": "test_value"
  },
  "line_items": [
    {
      "object": "line_item",
      "id": "li_1234567890",
      "quantity": 2,
      "product": {
        "object": "product",
        "id": "prod_1234567890",
        "name": "T-shirt",
        "price": 2000
      }
    }
  ]
}

Retrieve an Invoice

Retrieves the details of an existing invoice by ID.

Parameters

No parameters.

Returns

Returns an Invoice object if a valid ID was provided.

GET/v1/invoices/:id
curl --request GET \
  --url https://api.framepayments.com/v1/invoices/inv_6113c3cb-2304-45e1-9551-fa7fb804418f \
  --header 'Authorization: Bearer API_KEY'
Response
{
  "id": "f131cfbb-7fcf-4c72-8aab-958375a35830",
  "object": "invoice",
  "invoice_number": "804D5557-0001",
  "customer": {
    "object": "customer",
    "id": "605f1a98-f329-4210-939a-1e06f3b0da8b",
    "name": "Jane Doe"
  },
  "total": 240000,
  "currency": "USD",
  "status": "draft",
  "collection_method": "request_payment",
  "net_terms": 10,
  "number": "INV-0001",
  "description": "description",
  "memo": "memo",
  "livemode": false,
  "created": 1713435744,
  "updated": 1713435744,
  "metadata": {
    "key": "test_key",
    "value": "test_value"
  },
  "line_items": []
}

Delete an Invoice

Deletes a draft invoice. Only invoices in draft status can be deleted.

Parameters

No parameters.

Returns

Returns a confirmation that the invoice has been deleted.

DELETE/v1/invoices/:id
curl --request DELETE \
  --url https://api.framepayments.com/v1/invoices/inv_6113c3cb-2304-45e1-9551-fa7fb804418f \
  --header 'Authorization: Bearer API_KEY'
Response
{
  "object": "invoice",
  "deleted": true
}

Issue an Invoice

Issues a draft invoice to the customer, changing its status from draft to open.

Parameters

No parameters.

Returns

Returns the Invoice object with updated status if the request was successful.

POST/v1/invoices/:id/issue
curl --request POST \
  --url https://api.framepayments.com/v1/invoices/inv_6113c3cb-2304-45e1-9551-fa7fb804418f/issue \
  --header 'Authorization: Bearer API_KEY'
Response
{
  "id": "f131cfbb-7fcf-4c72-8aab-958375a35830",
  "object": "invoice",
  "invoice_number": "804D5557-0001",
  "customer": {
    "object": "customer",
    "id": "605f1a98-f329-4210-939a-1e06f3b0da8b",
    "name": "Jane Doe"
  },
  "total": 400000,
  "currency": "USD",
  "status": "open",
  "collection_method": "request_payment",
  "net_terms": 10,
  "number": "INV-0001",
  "description": "Updated description",
  "memo": "memo",
  "livemode": false,
  "created": 1713435744,
  "updated": 1713436200,
  "metadata": {
    "key": "test_key",
    "value": "test_value"
  },
  "line_items": []
}