Wahio Developers
Orders
POST
/v1/orders/{id}/invoice

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

id*string

Order ID

Header Parameters

X-Api-Key*string

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"  }}