Create an invoice for an existing order in the authenticated account. The order and numeration must belong to this account; missing or foreign resources return 404.
Generates an invoice for the specified order using the provided numeration.
Path Parameters
Order ID
Header Parameters
Your API Key for authentication
Request Body
application/json
Invoice numeration and optional payment; the order ID comes from the route
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/orders/string/invoice" \ -H "X-Api-Key: string" \ -H "Content-Type: application/json" \ -d '{}'{ "order": { "id": "string", "accountId": "string", "organizationId": "string", "accountUserId": "string", "lastAccountUserId": "string", "documentType": "string", "documentNumber": "string", "documentReferenceId": "string", "number": 0, "customerId": "string", "contactSellerId": "string", "orderChannelId": "string", "warehouseId": "string", "allowLogisticsService": true, "shipment": { "id": "string", "accountId": "string", "orderId": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "statusUpdatedAt": "2019-08-24T14:15:22Z", "shipFromId": "string", "shipFrom": { "id": "string", "street": "string", "city": "string", "state": "string", "stateCode": "string", "postalCode": "string", "country": "string", "countryCode": "string", "contactName": "string", "contactEmail": "string", "contactPhoneCode": "string", "contactPhone": "string", "additionalInformation": "string", "lat": 0.1, "lng": 0.1, "locationInfo": { "inputAddress": "string", "formattedAddress": "string", "lat": 0.1, "lng": 0.1, "type": "string" } }, "shipToId": "string", "shipTo": { "id": "string", "street": "string", "city": "string", "state": "string", "stateCode": "string", "postalCode": "string", "country": "string", "countryCode": "string", "contactName": "string", "contactEmail": "string", "contactPhoneCode": "string", "contactPhone": "string", "additionalInformation": "string", "lat": 0.1, "lng": 0.1, "locationInfo": { "inputAddress": "string", "formattedAddress": "string", "lat": 0.1, "lng": 0.1, "type": "string" } }, "courierId": "string", "archived": true, "cashOnDeliveryOrder": true, "stockProcessed": true, "isGift": true, "shippingLabel": { "comment": "string", "customerDocumentNumber": true, "organizationPhone": true, "organizationAddress": true, "observation": true, "orderNumber": true, "invoiceNumber": true, "orderValue": true, "shippingValue": true, "paymentStatus": true, "paymentMethod": true, "trackingNumber": true, "trackingQr": true, "contactSeller": true }, "statusLogs": [ { "statusId": "string", "date": "2019-08-24T14:15:22Z", "comments": [ { "key": "string", "comment": "string", "visibility": "string", "date": "2019-08-24T14:15:22Z" } ] } ], "statusId": "string", "status": { "id": "string", "accountId": "string", "aliasName": "string", "name": "string", "icon": "string", "active": true, "requiredNotification": true, "index": 0, "color": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "stockAction": "string" }, "outOfOrderCosts": true, "includesAccountsPayable": true, "shippingCost": 0.1, "costItems": [ { "name": "string", "value": 0.1 } ], "shippingMethod": "string", "totalWeight": 0.1, "isInsured": true, "insuranceValue": 0, "customDetails": { "property1": {}, "property2": {} }, "shippingTrackingLink": "string", "shippingTrackingNumber": "string" }, "dateCreated": "2019-08-24T14:15:22Z", "dateUpdated": "2019-08-24T14:15:22Z", "billingDate": "2019-08-24T14:15:22Z", "dateCreatedCustom": "2019-08-24T14:15:22Z", "lastPaymentDate": "2019-08-24T14:15:22Z", "totalAmount": 0.1, "totalAmountItems": 0.1, "totalItemsDiscount": 0.1, "totalManualPercentageDiscountItems": 0.1, "totalTaxItems": 0.1, "itemsCount": 0, "itemsQuantityCount": 0.1, "subTotal": 0.1, "totalDiscount": 0.1, "totalTip": 0.1, "totalDelivery": 0.1, "percentageTip": 0.1, "percentageDiscount": 0.1, "tipBeforeTax": true, "discountBeforeTax": true, "totalAmountReturns": 0.1, "totalPaid": 0.1, "totalPayment": 0.1, "totalRefund": 0.1, "paymentTermsDays": 0, "paymentTermsDescription": "string", "invoiceNumber": "string", "invoiceCreatedAt": "2019-08-24T14:15:22Z", "invoiceAvailable": true, "isBilled": true, "eBillingResolutionId": "string", "eBillingOperationModeId": "string", "eBillingUrl": "string", "eBillingCUFE": "string", "eBillingGenerated": true, "eBillingNumber": "string", "eBillingDocumentType": "string", "eBillingCreatedAt": "2019-08-24T14:15:22Z", "includesTaxWithholding": true, "totalTaxWithholdings": 0.1, "taxType": "string", "status": "string", "internalStatus": "string", "pickingAvailable": true, "hasReturns": true, "hasDocumentReturns": true, "commentsCount": 0, "takeoutOrder": true, "isRestaurant": true, "isRestaurantClose": true, "isDelivery": true, "isDeliveryClose": true, "comment": "string", "clientIpAddress": "string", "deviceId": "string", "lastCashRegisterId": "string", "source": "string", "trackingNumber": "string", "hasNotifications": true, "ecommerceId": "string", "defaultPrice": "string", "currency": "string", "includeInvoice": true, "items": [ { "id": "string", "orderId": "string", "productId": "string", "accountId": "string", "organizationId": "string", "productVariantId": "string", "productCategoryId": "string", "warehouseId": "string", "locationCode": "string", "quantity": 0.1, "quantityReturned": 0.1, "unitPrice": 0.1, "basePrice": 0.1, "subTotal": 0.1, "total": 0.1, "manualPercentageDiscount": 0.1, "manualPercentageDiscountValue": 0.1, "totalDiscount": 0.1, "totalTax": 0.1, "totalTaxPercentage": 0.1, "costWeightedAverage": 0.1, "costBaseWeightedAverage": 0.1, "costAverage": 0.1, "costBaseAverage": 0.1, "costLastPurchase": 0.1, "costBaseLastPurchase": 0.1, "comment": "string", "accountUserId": "string", "position": 0, "isCustomItem": true, "customItemName": "string", "hasReturns": true, "lastReturnDate": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "preparationStatus": "string", "serials": [ "string" ], "optionalsConfig": {}, "taxes": [ { "id": "string", "taxId": "string", "accountId": "string", "organizationId": "string", "taxTributeType": "string", "taxName": "string", "taxDescription": "string", "taxValue": 0.1, "totalTaxValue": 0.1, "taxPercentage": 0.1, "taxIsInclude": true, "taxIsPercentage": true, "accountingAccountId": "f3e64b12-41a1-4e56-bcb3-2be49ce78e91", "orderItemId": "string" } ], "discounts": [ { "id": "string", "valueBase": 0.1, "discountId": "string", "discountType": "string", "discountCode": "string", "discountName": "string", "discountDescription": "string", "discountPercentage": 0.1, "value": 0.1, "orderItemId": "string" } ], "details": { "property1": {}, "property2": {} }, "customFields": { "property1": {}, "property2": {} } } ], "taxWithholdings": [ {} ], "taxTotalCalculations": [ {} ], "files": [ {} ], "errorMessages": [ {} ], "additionalDetails": { "property1": {}, "property2": {} }, "customFields": { "property1": {}, "property2": {} }, "orderInvoiceNumerationId": "string" }}Get Order By Id GET
Get an order by ID in the account associated with your API key. Requires orders:read. The account is taken from the authenticated key; account selectors in headers, query or body cannot change it. Unknown and foreign-account orders return the same 404. Service and network failures remain errors; there is no unscoped fallback.
Create product POST
Create a product in the account associated with the API key. name and custom_category_id are required; the category must belong to that account. Use optional tax_ids with IDs from GET /v1/taxes to associate existing taxes from this account. Omitted, null or [] creates without taxes; has_taxes is derived, not an input. Unknown or foreign tax IDs return 404. Optional variants creates the supplied combinations with code, sku, base_price, price, price_2 through price_10 and options [{name,value}]. Use the same option names and order for every variant. No IDs, stock or calculated costs are accepted for variants. includes_variants is derived from the list; is_parent refers to composite products, not variant ownership. Do not send account_id or a product ID. This operation is not idempotent; reconcile an uncertain result before retrying.