invoice_type field is required. All other fields are optional, allowing you to build the invoice incrementally:invoice_type)team parameter.curl --location --request POST 'https://api.gigstack.io/v2/invoices/draft?team' \
--header 'Content-Type: application/json' \
--data-raw '{
"invoice_type": "I",
"currency": "MXN",
"use": "G03",
"payment_form": "03",
"payment_method": "PUE",
"client": {
"id": "client_1234567890"
},
"items": [
{
"quantity": 1,
"description": "Servicio de consultoría",
"product_key": "80141503",
"unit_key": "ACT",
"unit_name": "Actividad",
"unit_price": 5000,
"taxes": [
{
"type": "IVA",
"rate": 0.16,
"factor": "Tasa",
"withholding": false,
"inclusive": false
}
]
}
],
"metadata": {
"project_id": "PROJ-2024-001"
}
}'{
"message": "Draft created",
"data": {
"id": "abc123def456",
"draft": true,
"invoice_type": "I",
"client": {
"id": "client_1234567890",
"address": {
"country": "MEX",
"street": "Av. Insurgentes Sur",
"zip": "03100",
"city": "Ciudad de México",
"state": "CDMX",
"exterior": "123",
"interior": "4B",
"municipality": "Benito Juárez",
"neighborhood": "Del Valle"
},
"name": "Juan Pérez García",
"company": "Empresa SA de CV",
"phone": "+52 55 1234 5678",
"email": "juan.perez@ejemplo.com",
"bcc": [
"admin@empresa.com"
],
"metadata": {
"custom_field": "value"
},
"is_valid": true,
"from": "api",
"legal_name": "Juan Pérez García",
"livemode": true,
"owner": "user_1234567890",
"tax_id": "PEGJ800101ABC",
"use": "P01",
"tax_system": "601",
"team": "team_1234567890",
"created_at": 1677651234,
"efos": {
"is_valid": true
},
"defaults": {
"keep_full_legal_name": false,
"issue_automatic_invoices": false,
"issue_invoiceable_receipts": true
}
},
"created_at": 1677651234000,
"updated_at": 1677651234000,
"currency": "MXN",
"exchange_rate": 1,
"total": 5800,
"subtotal": 5000,
"discount": 0,
"series": "A",
"folio_number": 0,
"use": "G03",
"payment_form": "03",
"payment_method": "PUE",
"date": 0,
"livemode": true,
"owner": "string",
"from": "api",
"status": "draft",
"items": [
{}
],
"addenda": "string",
"exports": "string",
"invoice_pdf_notes": "string",
"global": {},
"related_documents": [
{}
],
"complements": [
{}
],
"metadata": {
"property1": "string",
"property2": "string"
},
"emails": [
"string"
]
}
}