{"components":{"schemas":{"Address":{"properties":{"city":{"type":"string"},"country":{"type":"string"},"line1":{"type":"string"},"line2":{"type":"string"},"line3":{"type":"string"},"postal_code":{"type":"string"},"state":{"type":"string"}},"type":"object"},"Customer":{"properties":{"address":{"$ref":"#/components/schemas/Address"},"ap_contact":{"properties":{"email":{"format":"email","type":"string"},"name":{"type":"string"}},"type":"object"},"billing_entity":{"type":"string"},"cc_emails":{"items":{"format":"email","type":"string"},"type":"array"},"code":{"readOnly":true,"type":"string"},"company":{"type":"string"},"contact":{"properties":{"email":{"format":"email","type":"string"},"name":{"type":"string"}},"type":"object"},"id":{"readOnly":true,"type":"integer"},"notes":{"type":"string"},"po_required":{"type":"boolean"}},"required":["company"],"type":"object"},"Error":{"properties":{"error":{"type":"string"},"field":{"nullable":true,"type":"string"}},"type":"object"},"Invoice":{"properties":{"created_at":{"format":"date-time","readOnly":true,"type":"string"},"currency":{"default":"USD","type":"string"},"customer_id":{"nullable":true,"type":"integer"},"discount":{"oneOf":[{"properties":{"type":{"const":"percent"},"value":{"type":"number"}}},{"properties":{"type":{"const":"flat"},"value_cents":{"type":"integer"}}}],"type":"object"},"due_date":{"format":"date","type":"string"},"footer_note":{"type":"string"},"id":{"description":"Invoice number, e.g. ACME-0001","readOnly":true,"type":"string"},"issue_date":{"format":"date","type":"string"},"line_items":{"items":{"$ref":"#/components/schemas/LineItem"},"type":"array"},"paid_at":{"format":"date-time","readOnly":true,"type":"string"},"po_number":{"type":"string"},"recipient":{"$ref":"#/components/schemas/Recipient"},"sent_at":{"format":"date-time","readOnly":true,"type":"string"},"share_token":{"readOnly":true,"type":"string"},"share_url":{"readOnly":true,"type":"string"},"status":{"enum":["draft","sent","viewed","change_requested","updated","approved","paid","cancelled"],"type":"string"},"subscription_context":{"type":"string"},"subtotal_cents":{"readOnly":true,"type":"integer"},"tax":{"properties":{"amount_cents":{"readOnly":true,"type":"integer"},"label":{"type":"string"},"rate":{"description":"Percentage, e.g. 20.0 for 20%","type":"number"}},"type":"object"},"terms_text":{"type":"string"},"total_cents":{"readOnly":true,"type":"integer"},"updated_at":{"format":"date-time","readOnly":true,"type":"string"}},"required":["due_date","line_items"],"type":"object"},"LineItem":{"properties":{"description":{"type":"string"},"discount":{"oneOf":[{"properties":{"type":{"const":"percent"},"value":{"type":"number"}}},{"properties":{"type":{"const":"flat"},"value_cents":{"type":"integer"}}}],"type":"object"},"line_total_cents":{"readOnly":true,"type":"integer"},"quantity":{"default":1,"type":"number"},"unit_price_cents":{"description":"Cents (or smallest currency unit)","type":"integer"}},"required":["description","unit_price_cents"],"type":"object"},"Recipient":{"properties":{"address":{"$ref":"#/components/schemas/Address"},"ap":{"properties":{"email":{"format":"email","type":"string"},"name":{"type":"string"}},"type":"object"},"cc_emails":{"items":{"format":"email","type":"string"},"type":"array"},"company":{"type":"string"},"email":{"format":"email","type":"string"},"name":{"type":"string"},"tax_id":{"type":"string"}},"type":"object"},"Webhook":{"properties":{"active":{"type":"boolean"},"created_at":{"format":"date-time","readOnly":true,"type":"string"},"description":{"type":"string"},"event_types":{"description":"Empty array = all events","items":{"type":"string"},"type":"array"},"id":{"readOnly":true,"type":"integer"},"last_delivered_at":{"format":"date-time","readOnly":true,"type":"string"},"last_status":{"readOnly":true,"type":"integer"},"secret":{"description":"Signing secret. Returned only on POST /webhooks; store immediately.","type":"string"},"url":{"format":"uri","type":"string"}},"type":"object"},"WebhookDelivery":{"properties":{"attempt":{"type":"integer"},"created_at":{"format":"date-time","type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"failed_permanently":{"type":"boolean"},"id":{"readOnly":true,"type":"integer"},"last_attempt_at":{"format":"date-time","nullable":true,"type":"string"},"last_error":{"nullable":true,"type":"string"},"last_latency_ms":{"nullable":true,"type":"integer"},"last_status":{"nullable":true,"type":"integer"},"max_attempts":{"type":"integer"},"next_attempt_at":{"format":"date-time","type":"string"},"subscription_id":{"type":"integer"},"succeeded":{"type":"boolean"}},"type":"object"}},"securitySchemes":{"BearerAuth":{"bearerFormat":"API key (jk_live_*)","description":"Mint a key from the sender profile page. Shown once.","scheme":"bearer","type":"http"}}},"info":{"contact":{"url":"https://jupiterinvoice.com/contact"},"description":"Programmatic access to JupiterInvoice. Create and manage invoices and customers from your code, an LLM agent, or an MCP tool.\n\nMoney is always integer cents (or the smallest unit of the currency). Quantities are JSON numbers (1.5 = one and a half). Dates are ISO (YYYY-MM-DD). Timestamps are ISO 8601 in UTC.","license":{"name":"Proprietary"},"title":"JupiterInvoice API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/customers":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Customer"},"type":"array"}},"type":"object"}}},"description":"List of customers"}},"summary":"List customers"},"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"description":"Customer created"},"400":{"description":"Validation error"}},"summary":"Create a customer"}},"/customers/{customer_id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"description":"Customer"},"404":{"description":"Not found"}},"summary":"Get a customer by id"},"parameters":[{"in":"path","name":"customer_id","required":true,"schema":{"type":"integer"}}]},"/invoices":{"get":{"parameters":[{"in":"query","name":"limit","schema":{"default":25,"maximum":100,"type":"integer"}},{"description":"Opaque cursor from previous response","in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Invoice"},"type":"array"},"next_cursor":{"nullable":true,"type":"string"}},"type":"object"}}},"description":"List of invoices"}},"summary":"List invoices"},"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"description":"Invoice created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation error"},"401":{"description":"Missing or invalid API key"},"422":{"description":"Sender profile incomplete"}},"summary":"Create an invoice"}},"/invoices/anonymous":{"post":{"description":"Mirrors the public anonymous /new flow. No API key required. Anti-abuse: per-IP rate limit (5/min, 30/hour, 100/day), honeypot, Cloudflare Turnstile when configured. The response sets a ji_anon_session cookie so a subsequent sign-in claims the invoice.","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Invoice"},{"properties":{"cf_turnstile_response":{"description":"Required when Turnstile is configured server-side","type":"string"},"sender":{"properties":{"account_name":{"type":"string"},"account_number":{"type":"string"},"address_line1":{"type":"string"},"bank_name":{"type":"string"},"city":{"type":"string"},"company":{"type":"string"},"country":{"type":"string"},"email":{"format":"email","type":"string"},"iban":{"type":"string"},"routing_number":{"type":"string"},"swift_code":{"type":"string"},"tax_id":{"type":"string"}},"required":["company"],"type":"object"},"website":{"description":"Honeypot. Leave empty.","type":"string"}},"type":"object"}]}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"description":"Invoice created"},"400":{"description":"Validation error"},"401":{"description":"Turnstile failure"},"429":{"description":"Rate limit exceeded"}},"security":[],"summary":"Create an invoice without authentication"}},"/invoices/{invoice_number}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"description":"Invoice"},"404":{"description":"Not found"}},"summary":"Get an invoice by number"},"parameters":[{"in":"path","name":"invoice_number","required":true,"schema":{"type":"string"}}],"patch":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}},"description":"Updated invoice"},"404":{"description":"Not found"},"409":{"description":"Invoice is locked (paid/cancelled/approved)"}},"summary":"Partially update an invoice"}},"/webhooks":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Webhook"},"type":"array"}},"type":"object"}}},"description":"List"}},"summary":"List webhook subscriptions"},"post":{"description":"Creates a subscription that will receive HMAC-SHA256-signed POSTs for matching events. Response includes the signing `secret` exactly once -- store it for HMAC verification.","requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"type":"string"},"event_types":{"description":"Empty array means all events.","items":{"enum":["invoice.created","invoice.sent","invoice.viewed","invoice.edited","invoice.forwarded"],"type":"string"},"type":"array"},"url":{"format":"uri","type":"string"}},"required":["url"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}},"description":"Created (response body includes one-time `secret`)"},"400":{"description":"Invalid url or payload"}},"summary":"Create a webhook subscription"}},"/webhooks/{id}":{"delete":{"responses":{"204":{"description":"Deleted"},"404":{"description":"Not found"}},"summary":"Delete (unsubscribe)"},"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}},"description":"OK"},"404":{"description":"Not found"}},"summary":"Get a webhook subscription"},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}]},"/webhooks/{id}/deliveries":{"get":{"description":"Persistent log of every delivery attempt. Useful for debugging why a webhook never fired or why retries kept failing.","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookDelivery"},"type":"array"}},"type":"object"}}},"description":"OK"}},"summary":"List delivery attempts for a subscription"},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}]}},"security":[{"BearerAuth":[]}],"servers":[{"description":"Live","url":"https://jupiterinvoice.com/api/v1"}]}
