Skip to content
Indiana
Dashboard
Docs
Browse docs / Manage an Invoice

Manage an Invoice

POST/api/v1/invoices/manage

Use a Server Key to finalize, send, pay, void or reissue an Invoice. Retain the original requestId for retries.

API v1Updated

Make the request

Use a Server Key to finalize, send, pay, void or reissue an Invoice. Retain the original requestId for retries.

Credential
Server API key only. Call from your trusted backend.
Permission
billing:write
Set the base URL and App ID from SDK setup. These examples use placeholders and do not execute requests. Never put a server key in browser code.
For this Web Beta, configure the Stripe Sandbox test account and fixed Product Prices before checkout. Redirects do not confirm payment.
request.shShell
curl -X POST "$INDIANA_BASE_URL/api/v1/invoices/manage" \  -H "Authorization: Bearer $INDIANA_SECRET_KEY" \  -H "X-Indiana-Project: $INDIANA_PROJECT_ID" \  -H "X-Indiana-Protocol: 0.5" \  -H "X-Indiana-Environment: sandbox" \  -H "Content-Type: application/json" \  -d '{  "customerId": "00000000-0000-4000-8000-000000000001",  "command": {    "action": "finalize",    "requestId": "00000000-0000-4000-8000-000000000001",    "invoiceId": "00000000-0000-4000-8000-000000000001"  }}'

The response tab lists field types, not an example payload. Actual values depend on customer state.

Request parameters

JSON body

customerIduuidRequired

Indiana customer ID mapped from a verified identity on the server. Omit for customer-token calls, which use the token-bound customer.

commandobject | object | objectRequired

The command value for this operation. Its accepted type and constraints are listed above and below.

Show child fields
action"create" | enum | "reissue"Required

Business action. Target fields and quantity requirements vary by action; see the request structure and example.

requestIduuid | uuid | uuidRequired

Business request UUID. Reuse for retries of one operation; generate a new value for a new operation.

paramsobject | objectOptional

The params value for this operation. Its accepted type and constraints are listed above and below.

Show child fields
customer_idstringOptional

The customer_id value for this operation. Its accepted type and constraints are listed above and below.

plansarrayOptional

The plans value for this operation. Its accepted type and constraints are listed above and below.

Show child fields
plan_idstringRequired

The plan_id value for this operation. Its accepted type and constraints are listed above and below.

versionnumberOptional

The version value for this operation. Its accepted type and constraints are listed above and below.

customizeobjectOptional

The customize value for this operation. Its accepted type and constraints are listed above and below.

feature_quantitiesarrayOptional

The feature_quantities value for this operation. Its accepted type and constraints are listed above and below.

license_quantitiesarrayOptional

The license_quantities value for this operation. Its accepted type and constraints are listed above and below.

discountsarrayOptional

The discounts value for this operation. Its accepted type and constraints are listed above and below.

proratebooleanOptional

The prorate value for this operation. Its accepted type and constraints are listed above and below.

custom_line_itemsarrayOptional

The custom_line_items value for this operation. Its accepted type and constraints are listed above and below.

Show child fields
amountnumberRequired

Credit or ledger amount, using the field’s decimal-string or integer type.

descriptionstringRequired

The description value for this operation. Its accepted type and constraints are listed above and below.

discountsarrayOptional

The discounts value for this operation. Its accepted type and constraints are listed above and below.

Show child fields
reward_idstringOptional

The reward_id value for this operation. Its accepted type and constraints are listed above and below.

promotion_codestringOptional

The promotion_code value for this operation. Its accepted type and constraints are listed above and below.

invoice_template_idstring | stringOptional

The invoice_template_id value for this operation. Its accepted type and constraints are listed above and below.

net_terms_daysinteger | integerOptional

The net_terms_days value for this operation. Its accepted type and constraints are listed above and below.

tax_rate_idstringOptional

The tax_rate_id value for this operation. Its accepted type and constraints are listed above and below.

period_startintegerOptional

The period_start value for this operation. Its accepted type and constraints are listed above and below.

min: 0 · max: 9007199254740991

period_endintegerOptional

The period_end value for this operation. Its accepted type and constraints are listed above and below.

min: 0 · max: 9007199254740991

previewbooleanOptional

The preview value for this operation. Its accepted type and constraints are listed above and below.

invoice_idstringOptional

The invoice_id value for this operation. Its accepted type and constraints are listed above and below.

update_customer_emailemailOptional

The update_customer_email value for this operation. Its accepted type and constraints are listed above and below.

invoiceIduuid | uuidOptional

The invoiceId value for this operation. Its accepted type and constraints are listed above and below.

Response fields

Successful responses include requestId and scope. Use the actual business status or accepted field to determine the result. Optional fields are omitted when unavailable.

HTTP 200 · application/json

requestIduuidRequired

Server-generated HTTP request UUID. Include it when reporting a failed request.

scopeobjectRequired

The App and environment of this response. Headers only verify scope; they cannot switch key scope.

Show child fields
projectIdstringRequired

App ID bound to the credential.

minLength: 1

environmentenumRequired

Separate data scope: sandbox or live.

Show allowed values

"sandbox""live"

operationobjectRequired

The operation value for this operation. Its accepted type and constraints are listed above and below.

Show child fields
taskIduuidRequired

The taskId value for this operation. Its accepted type and constraints are listed above and below.

statusenumRequired

The status value for this operation. Its accepted type and constraints are listed above and below.

Show allowed values

"ready""running""done""dead"

invoiceobject | nullRequired

The invoice value for this operation. Its accepted type and constraints are listed above and below.

Show child fields
iduuidRequired

The id value for this operation. Its accepted type and constraints are listed above and below.

customerIduuidRequired

Indiana customer ID mapped from a verified identity on the server. Omit for customer-token calls, which use the token-bound customer.

providerInvoiceIdstring | nullRequired

The providerInvoiceId value for this operation. Its accepted type and constraints are listed above and below.

statusenumRequired

The status value for this operation. Its accepted type and constraints are listed above and below.

Show allowed values

"draft""open""paid""void""uncollectible"

currencystringRequired

Currency code supported by the published price.

totalMinorstringRequired

The totalMinor value for this operation. Its accepted type and constraints are listed above and below.

pattern: ^-?\d+$

paidMinorstringRequired

The paidMinor value for this operation. Its accepted type and constraints are listed above and below.

pattern: ^\d+$

refundedMinorstringRequired

The refundedMinor value for this operation. Its accepted type and constraints are listed above and below.

pattern: ^\d+$

hostedInvoiceUrluri | nullRequired

The hostedInvoiceUrl value for this operation. Its accepted type and constraints are listed above and below.

createdAtnumberRequired

ISO 8601 UTC time when the record was created.

collectionMethodenum | nullRequired

The collectionMethod value for this operation. Its accepted type and constraints are listed above and below.

errorCodestring | nullRequired

The errorCode value for this operation. Its accepted type and constraints are listed above and below.

Handle errors

Common failures
CodeRecovery
UNAUTHENTICATEDVerify the key or refresh the expired customer token once.
FORBIDDENCheck current key permissions and customer access.
INVALID_REQUESTCheck field types, UUIDs, decimal strings and mutually exclusive fields.
SCOPE_MISMATCHUse the App and environment bound to the credential.

Common failures

  • UNAUTHENTICATED

    Recovery
    Verify the key or refresh the expired customer token once.
  • FORBIDDEN

    Recovery
    Check current key permissions and customer access.
  • INVALID_REQUEST

    Recovery
    Check field types, UUIDs, decimal strings and mutually exclusive fields.
  • SCOPE_MISMATCH

    Recovery
    Use the App and environment bound to the credential.

Related:All request and error conventions·Back to endpoint index