curl --request PATCH \
--url https://api.whop.com/api/v1/invoices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"automatically_finalizes_at": "2023-12-01T05:00:00.401Z",
"billing_address": {
"city": "<string>",
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"name": "<string>",
"phone": "<string>",
"postal_code": "<string>",
"state": "<string>",
"tax_id_type": "ad_nrt",
"tax_id_value": "<string>"
},
"charge_buyer_fee": true,
"collection_method": "send_invoice",
"customer_name": "<string>",
"due_date": "2023-12-01T05:00:00.401Z",
"email_address": "<string>",
"line_items": [
{
"label": "<string>",
"unit_price": 6.9,
"quantity": 6.9
}
],
"mailing_address_id": "ma_xxxxxxxxxxxxxxx",
"member_id": "mber_xxxxxxxxxxxxx",
"payment_method_id": "pmt_xxxxxxxxxxxxxx",
"plan": {
"billing_period": 42,
"custom_fields": [
{
"field_type": "<string>",
"name": "<string>",
"id": "<string>",
"order": 42,
"placeholder": "<string>",
"required": true
}
],
"description": "<string>",
"expiration_days": 42,
"initial_price": 6.9,
"internal_notes": "<string>",
"legacy_payment_method_controls": true,
"payment_method_configuration": {
"disabled": [
"acss_debit"
],
"enabled": [
"acss_debit"
],
"include_platform_defaults": true
},
"plan_type": "renewal",
"release_method": "buy_now",
"renewal_price": 6.9,
"stock": 42,
"trial_period_days": 42,
"unlimited_stock": true,
"visibility": "visible"
}
}
'{
"id": "inv_xxxxxxxxxxxxxx",
"created_at": "2023-12-01T05:00:00.401Z",
"status": "draft",
"number": "#0001",
"due_date": "2023-12-01T05:00:00.401Z",
"email_address": "customer@example.com",
"fetch_invoice_token": "eyJhbGciOiJIUzI1NiJ9...",
"current_plan": {
"id": "plan_xxxxxxxxxxxxx",
"formatted_price": "$10.00",
"currency": "usd"
},
"user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
}
}Update a draft invoice’s details.
Required permissions:
invoice:updatecurl --request PATCH \
--url https://api.whop.com/api/v1/invoices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"automatically_finalizes_at": "2023-12-01T05:00:00.401Z",
"billing_address": {
"city": "<string>",
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"name": "<string>",
"phone": "<string>",
"postal_code": "<string>",
"state": "<string>",
"tax_id_type": "ad_nrt",
"tax_id_value": "<string>"
},
"charge_buyer_fee": true,
"collection_method": "send_invoice",
"customer_name": "<string>",
"due_date": "2023-12-01T05:00:00.401Z",
"email_address": "<string>",
"line_items": [
{
"label": "<string>",
"unit_price": 6.9,
"quantity": 6.9
}
],
"mailing_address_id": "ma_xxxxxxxxxxxxxxx",
"member_id": "mber_xxxxxxxxxxxxx",
"payment_method_id": "pmt_xxxxxxxxxxxxxx",
"plan": {
"billing_period": 42,
"custom_fields": [
{
"field_type": "<string>",
"name": "<string>",
"id": "<string>",
"order": 42,
"placeholder": "<string>",
"required": true
}
],
"description": "<string>",
"expiration_days": 42,
"initial_price": 6.9,
"internal_notes": "<string>",
"legacy_payment_method_controls": true,
"payment_method_configuration": {
"disabled": [
"acss_debit"
],
"enabled": [
"acss_debit"
],
"include_platform_defaults": true
},
"plan_type": "renewal",
"release_method": "buy_now",
"renewal_price": 6.9,
"stock": 42,
"trial_period_days": 42,
"unlimited_stock": true,
"visibility": "visible"
}
}
'{
"id": "inv_xxxxxxxxxxxxxx",
"created_at": "2023-12-01T05:00:00.401Z",
"status": "draft",
"number": "#0001",
"due_date": "2023-12-01T05:00:00.401Z",
"email_address": "customer@example.com",
"fetch_invoice_token": "eyJhbGciOiJIUzI1NiJ9...",
"current_plan": {
"id": "plan_xxxxxxxxxxxxx",
"formatted_price": "$10.00",
"currency": "usd"
},
"user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
}
}A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
The unique identifier of the invoice to update.
"inv_xxxxxxxxxxxxxx"
Parameters for UpdateInvoice
The date and time when the invoice will be automatically finalized and charged.
"2023-12-01T05:00:00.401Z"
Inline billing address to create or update a mailing address for this invoice.
Show child attributes
Whether to charge the customer a buyer fee on this invoice.
How the invoice should be collected.
send_invoice, charge_automatically The name of the customer.
The date by which the invoice must be paid.
"2023-12-01T05:00:00.401Z"
The email address of the customer.
Line items that break down the invoice total.
Show child attributes
The unique identifier of an existing mailing address to attach.
"ma_xxxxxxxxxxxxxxx"
The unique identifier of a member to assign as the customer.
"mber_xxxxxxxxxxxxx"
The unique identifier of the payment method to charge.
"pmt_xxxxxxxxxxxxxx"
Updated plan attributes.
Show child attributes
A successful response
An invoice represents an itemized bill sent by a company to a customer for a specific product and plan, tracking the amount owed, due date, and payment status.
The unique identifier for the invoice.
"inv_xxxxxxxxxxxxxx"
The datetime the invoice was created.
"2023-12-01T05:00:00.401Z"
The current payment status of the invoice, such as draft, open, paid, or void.
draft, open, paid, past_due, uncollectible, void The sequential invoice number for display purposes.
"#0001"
The deadline by which payment is expected. Null if the invoice is collected automatically.
"2023-12-01T05:00:00.401Z"
The email address of the customer this invoice is addressed to. Null if no email is on file.
"customer@example.com"
A signed token that allows fetching invoice data publicly without authentication.
"eyJhbGciOiJIUzI1NiJ9..."
The plan that this invoice charges for.
Show child attributes
The user this invoice is addressed to. Null if the user account has been removed.
Show child attributes
Was this page helpful?