Upload an invoice for a subscription
POST/subscriptions/:code/invoices
Uploads an invoice file for a subscription. The file must be a PDF, an image (PNG, JPEG, TIFF, WebP) or an e-invoice XML; its content is validated, not just its name. Returns the created invoice. Returns 409 Conflict if a file with the same content already exists for the subscription's purchase order, or if that order's workflow status does not accept an invoice upload.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 429
- 500
Invoice uploaded successfully
Bad request - invalid subscription code, or the file is not a PDF, image or e-invoice XML (type invoice-unsupported-file)
Unauthorized - no authenticated user
Forbidden - no access to this subscription
Subscription not found
Duplicate invoice file (type invoice-duplicate-file; carries existing_invoice_code and existing_purchase_order_code), or the purchase order's status does not accept an upload (type purchase-order-not-accepting-invoices; carries allowed_states)
Too many requests - rate limited by the API firewall; wait out the Retry-After delay before retrying
Response Headers
Delay in seconds a client must wait before retrying the request
Internal server error