GET
/
invoices
/
{id}
JavaScript
import Whopsdk from 'whopsdk';

const client = new Whopsdk({
  apiKey: 'My API Key',
});

const invoice = await client.invoices.retrieve('inv_xxxxxxxxxxxxxx');

console.log(invoice.id);
{
  "id": "inv_xxxxxxxxxxxxxx",
  "created_at": 1701406800,
  "status": "open",
  "number": "<string>",
  "due_date": 1701406800,
  "email_address": "<string>",
  "fetch_invoice_token": "<string>",
  "current_plan": {
    "id": "plan_xxxxxxxxxxxxx",
    "formatted_price": "<string>",
    "currency": "usd"
  },
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "name": "<string>",
    "username": "<string>"
  }
}

Path Parameters

id
string
required
Example:

"inv_xxxxxxxxxxxxxx"

Response

A successful response

A statement that defines an amount due by a customer.

id
string
required

The ID of the invoice.

Example:

"inv_xxxxxxxxxxxxxx"

created_at
integer
required

The date the invoice was created.

Example:

1701406800

status
enum<string> | null
required

The status of the invoice.

Available options:
open,
paid,
past_due,
void
number
string
required

The number of the invoice.

due_date
integer | null
required

The date the invoice is due.

Example:

1701406800

email_address
string | null
required

The email address that the invoice was created for.

fetch_invoice_token
string
required

The token to fetch the invoice.

current_plan
object
required

The plan that the invoice was created for.

user
object | null
required

The user that the invoice was created for.