https://api.genuka.com · Auth Authorization: Bearer <token> + X-Company: <companyId> · See Getting Started for shared conventions, pagination & error formats.
Endpoints at a glance
Orders
GET /2023-11/admin/orders
List orders with rich filtering, sorting, and optional relationship includes.
- Query parameters:
Request example:
200 OK:
400MissingX-Companyheader:{"message":"Company id required","error":"company_id_required","code":400}401Invalid or missing token.403Token lacks order read permission.
POST /2023-11/admin/orders
Create a new order. Triggers UpsertOrderProcess which handles customer upsert, product creation, address linking, and—if billing status is already paid—runs payment processing automatically.
- Request body:
Request example:
200 OK — returns an OrderDetailResource:
400MissingX-Companyheader.401Unauthorized.500Internal error withmessagedescribing the failure.
POST /2023-11/admin/orders/export
Enqueue an asynchronous export of the current order query. Accepts the same filter and include parameters as the list endpoint, plus:
- Request body:
Request example:
200 OK — binary file download. Content-Type is application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for XLSX, text/csv for CSV, or application/pdf for PDF. No JSON body.
Async (≥ 500 orders): 202 Accepted — the export is queued; the user will receive an email with the download link.
401User not authenticated.422Unsupported format:{"message":"The given data was invalid.","errors":{"format":["Unsupported export format."]}}500Export failure.
GET /2023-11/admin/orders/export/fields
Return the list of column names available for order exports.
Request example:
200 OK:
POST /2023-11/admin/orders/import
Import orders from a spreadsheet file (single-request upload).
- Request body (multipart/form-data):
Request example:
200 OK:
422Validation failure — file missing or wrong MIME type.500Import processing error.
POST /2023-11/admin/orders/import-chunk
Upload a single chunk of a large import file (for chunked/resumable uploads). All chunks for a single upload share the same uploadId.
- Request body (multipart/form-data):
Success response
200 OK:
400File not found or file is empty.422Validation failure.
POST /2023-11/admin/orders/merge-chunk
Merge previously uploaded chunks into a single file and run the import.
- Request body:
Success response
200 OK:
422Validation failure.500Merge or import error withmessage.
GET /2023-11/admin/orders/overview
Return order KPI metrics for the given date range — used to populate the orders dashboard overview.
- Query parameters:
Request example:
200 OK:
422Invalid date format.
PUT /2023-11/admin/orders/status/bulk-update
Update the shipping and/or billing status for multiple orders in one call. For billing status transitions to paid, the unpaid remainder is resolved automatically.
- Request body:
Request example:
200 OK:
400Ghost order detected (Cannot update a ghost order).500Business exception during processing.
GET /2023-11/admin/orders/{orderId}
Retrieve full details of a single order, including all relationships.
- Path parameters:
Request example:
200 OK:
404Order not found:{"status":"error","code":404,"data":null,"message":"The order does not exist"}401Unauthorized.
PUT /2023-11/admin/orders/{orderId}
Update an existing order. Runs the same UpsertOrderProcess as creation. Cannot remove products or decrease quantities if a final paid invoice exists.
- Path parameters:
- Request body: All fields are optional (partial update). Pass
"type": "simple"with"metadata"to perform a lightweight metadata-only patch without full order reprocessing.
Request example:
200 OK — returns full OrderDetailResource:
400Cannot update an invoiced order that has a final paid invoice if products are being removed or quantities decreased.404Order not found.
DELETE /2023-11/admin/orders/{orderId}
Cancel (soft-delete) an order. Orders with invoices or payments are transitioned to CANCELLED state; their invoices are undone. Pass force=true to permanently delete an order with no invoices, payments, or returns.
- Path parameters:
- Query parameters:
Request example:
200 OK — soft-delete returns OrderDetailResource with deleted_at populated:
?force=true (permanent delete with no related documents), returns:
404Order not found.500Processing error.
GET /2023-11/admin/orders/{orderId}/activities
List the activity log for an order (paginated).
- Path parameters:
- Query parameters:
Request example:
200 OK:
404Order not found.
GET /2023-11/admin/orders/{orderId}/products
Return all order product lines for an order, including their pivot metadata and linked product records.
- Path parameters:
Request example:
200 OK — raw array of OrderProduct models with eager-loaded product:
404Order not found.500Internal error.
PATCH /2023-11/admin/orders/{orderId}/products/{orderProductId}/status
Update the fulfillment status of a single order product line.
- Path parameters:
- Request body:
Request example:
200 OK:
404Order or order product not found.500Internal error.
POST /2023-11/admin/orders/{orderId}/restore
Restore a cancelled order by duplicating it as a new active order with a fresh reference. Billing/shipping statuses are reset to pending.
- Path parameters:
Request example:
Request body: None — no body required for this action endpoint.
200 OK — returns OrderDetailResource of the newly created order:
400Order is not cancelled.404Order not found.500Internal error.
PUT /2023-11/admin/orders/{orderId}/state
Transition an order to a different document state. Valid states: 1 (Invoice), 2 (Quotation), 3 (Sales Order). Converting a Sales Order to an Invoice creates a new linked invoice-state order. Converting to Invoice also deducts stock if stock tracking is enabled.
- Path parameters:
- Request body:
Request example:
200 OK — returns OrderDetailResource:
400Invalid state value, or insufficient stock when transitioning to Invoice state (includes descriptive message about which product/warehouse).404Order not found.
POST /2023-11/admin/orders/{order}/notify
Send an order confirmation notification to the customer (email) and to all shop users who have the VIEW_ORDERS permission.
- Path parameters:
- Query parameters / request body (optional):
Request example:
200 OK:
500Notification delivery error withmessage.
POST /2023-11/admin/orders/{order}/payments
Record a payment against an order. Runs PaidOrderProcess which updates the billing status, creates accounting book entries, and optionally generates a credit note.
- Path parameters:
- Request body:
Request example:
200 OK:
500Payment processing error withmessage.
PUT /2023-11/admin/orders/{order}/payments/{payment}
Update an existing payment on an order (e.g. correct amount, method, or date). Runs UpdatePaymentProcess and logs an activity entry.
- Path parameters:
- Request body:
Request example:
200 OK — returns OrderDetailResource:
400Processing error withmessage.
DELETE /2023-11/admin/orders/{order}/payments/{payment}
Soft-delete a payment from an order. Runs DeletePaymentProcess which reverses billing status changes and logs an activity entry.
- Path parameters:
Request example:
200 OK — returns OrderDetailResource:
400Processing error withmessage.
POST /2023-11/admin/orders/{order}/payments/{payment}/restore
Restore a previously soft-deleted payment. Runs RestorePaymentProcess and logs an activity entry.
- Path parameters:
Request example:
Request body: None — no body required for this action endpoint.
200 OK — returns OrderDetailResource:
400Processing error withmessage.
PUT /2023-11/admin/orders/{order}/status
Update shipping and/or billing status for a single order. Billing status changes to pending automatically create a credit note reversing existing inbound payments.
- Path parameters:
- Request body:
Allowed shipping statuses:
pending, taken_in_charge, delivered, partial_delivery.
Allowed billing statuses: pending, paid, partially_paid, unpaid, canceled.
Request example:
200 OK — returns OrderDetailResource:
400Invalid shipping status or business rule violation.500BusinessExceptionwith message.
Order Subscriptions
GET /2023-11/admin/order_subscriptions
List order-to-subscription link records (paginated).
- Query parameters:
Request example:
200 OK:
Invoices
GET /2023-11/admin/invoices
List invoices with filtering and sorting (paginated).
- Query parameters:
Request example:
200 OK:
POST /2023-11/admin/invoices
Create an invoice from an existing order or from a set of delivery IDs. The order must have at least one product, and the deliveries must contain at least one item.
- Request body:
Request example:
200 OK — returns full InvoiceResource:
400Neitherorder_idnordelivery_idsprovided.404Order not found.422Order has no products, or deliveries contain no items.500Internal error.
GET /2023-11/admin/invoices/{invoice}
Retrieve a single invoice with its company, order, order shop/customer, lines, and credit notes.
- Path parameters:
Request example:
200 OK:
404Invoice not found.
PUT /2023-11/admin/invoices/{invoice}
Update invoice status.
- Path parameters:
- Request body:
Request example:
200 OK — returns full InvoiceResource:
DELETE /2023-11/admin/invoices/{invoice}
Delete a pending invoice (soft-delete). Only invoices with status = pending can be deleted.
- Path parameters:
Request example:
204 No Content.
Error responses:
403Invoice is not inpendingstatus:{"message":"You can only delete pending invoices."}
DELETE /2023-11/admin/invoices/{invoice}/payments/{payment}
Remove a payment from an invoice. Runs DeletePaymentProcess.
- Path parameters:
Request example:
204 No Content.
Error responses:
404Invoice or payment not found.
Invoice Rendering (Public)
These endpoints are publicly accessible (noAuthorization header required) and return HTML views or PDF files rather than JSON.
GET /2023-11/invoices/{orderId}
Render the order invoice as an HTML page. Supports ?receipt=1 to switch to a compact receipt view with a QR code.
- Path parameters:
- Query parameters:
Success response
200 OK — HTML content (text/html).
GET /2023-11/invoices/{orderId}/invoice
Render the order invoice as a downloadable PDF (A4 format). Supports ?receipt=1 for a receipt HTML view instead.
- Path parameters:
Same query parameters as the HTML view above.
Success response
200 OK — PDF binary (application/pdf) or HTML if ?receipt is present.
GET /2023-11/invoice/{orderId}
Public alias for GET /admin/orders/{orderId} — returns the same OrderDetailResource JSON. Used by external pages (e.g. customer-facing invoice portal).
- Path parameters:
Request example:
200 OK — same shape as GET /2023-11/admin/orders/{orderId}:
404Order not found.
PUT /2023-11/invoice/{order}/signature
Attach a base64-encoded signature image to an order. The signature is stored in the signature Spatie media collection and metadata is recorded on the order.
- Path parameters:
- Request body:
Request example:
200 OK — returns full OrderDetailResource with signature populated:
Invoice Generator (Public)
A lightweight stateless invoice generator that accepts arbitrary data, caches it for 30 minutes behind a token, and renders a printable HTML page.POST /2023-11/invoice-generator/prepare
Store invoice data in cache and return a short-lived token and URL.
- Request body: Any JSON object. Recognized top-level keys:
Request example:
200 OK:
GET /2023-11/invoice-generator/{token}
Render the previously prepared invoice as a printable HTML page (auto-prints via JavaScript). The token expires after 30 minutes.
- Path parameters:
Success response
200 OK — HTML content (text/html).
Error responses:
404Token not found or expired.
Credit Notes
GET /2023-11/admin/credit-notes
List credit notes (paginated), with filtering and sorting.
- Query parameters:
Request example:
200 OK:
GET /2023-11/admin/credit-notes/{creditNote}
Retrieve full details of a single credit note, including lines, taxes, book entries, and refund payments.
- Path parameters:
Request example:
200 OK — same shape as the list item above, with lines fully populated:
404Credit note not found.
Checkout
GET /2023-11/checkout
Render the Mamoni payment checkout HTML page for a given order. This is a public page loaded in a browser; it is not a JSON API endpoint.
- Query parameters:
Success response
200 OK — HTML content (text/html), renders the Mamoni payment form.
Error responses:
404Order not found or order does not belong to the specified company.
