Reimbursement Mutations
CreateReembolsoA
Create a new reimbursement request. Mutation:Catalog ID for reimbursement classification/type
Employee identification number (ID card)
Employee first name(s)
Employee last name(s)
Employee email address
Location/city where expenses were incurred
Department or business area
Start date of the trip or expense period
End date of the trip or expense period
Detailed description of the reimbursement purpose
User ID of the designated approver
Company ID (for multi-company support)
User ID of the employee creating the request
Comma-separated list of related advance payment IDs
Initial status (typically “INGRESADO” for new requests)
Name of the director in the approval chain
Unique identifier assigned to the new reimbursement
Timestamp when the reimbursement was created (UTC-5)
- The
fechaCreacionfield is automatically set to the current timestamp (UTC-5) - All other provided fields are stored as-is
UpdateReembolso
Update an existing reimbursement request. Mutation:The ID of the reimbursement to update
Updated catalog classification
Updated status (INGRESADO, EN_VALIDACIÓN, APROBADO, RECHAZADO, DEVUELTO)
Additional notes or comments
- Returns
IndReReembolsoDTO_NOT_FOUNDerror if the reimbursement ID doesn’t exist
UpdateReembolsoIngreso
Update a reimbursement and trigger notification email. Mutation:Complete reimbursement object with updates
Name of the person processing the update
Reason for the update/status change
Total value of the reimbursement
Email address for notification
- This mutation updates the reimbursement and sends an automated email notification
- Generates a PDF report of the reimbursement
- Used for status transitions that require stakeholder notification
Expense Detail Mutations
CreateDetallesA
Create multiple expense details for a reimbursement request. Mutation:Array of expense detail objects to create
Catalog ID for expense type (meals, transport, lodging, etc.)
Parent reimbursement request ID
Date the expense was registered in the system
Date on the receipt/invoice document
Total amount on the invoice/receipt
Document type catalog ID (invoice, receipt, ticket, etc.)
Document group catalog ID
Expense group catalog ID for categorization
Base amount subject to 0% IVA/VAT rate
Base amount subject to standard IVA/VAT rate
Total IVA/VAT amount
Document/invoice number (format: 001-001-000123456)
Tax authorization number from the receipt
Vendor’s tax identification number (RUC)
File path to the uploaded receipt/invoice image or PDF
Description of the business activity
Name of guest/client (for meal expenses)
Ticket number (for transportation expenses)
Additional notes or observations
Distance in kilometers (for mileage reimbursements)
Starting location (for transportation expenses)
Destination location (for transportation expenses)
Vehicle license plate (for personal vehicle use)
- Creates multiple expense line items in a single operation
- Each detail is individually validated and saved
- All details must belong to the same parent reimbursement
UpdateDetalle
Update an existing expense detail. Mutation:The ID of the expense detail to update
Optional second file attachment (for multi-page receipts)
- Returns
IndReDetalleDTO_NOT_FOUNDerror if the detail ID doesn’t exist
DeleteDetalles
Delete all expense details for a reimbursement request. Mutation:The reimbursement ID whose details should be deleted
- Deletes all expense details associated with the reimbursement
- Also deletes related percentage distribution records (porcentajes)
- This is a cascading delete operation
DeleteDetalles2
Delete specific expense details by their IDs. Mutation:Array of expense detail IDs to delete
- Allows selective deletion of specific expense items
- Also removes related percentage distributions
- Useful for removing individual line items without affecting the entire reimbursement
Best Practices
Creating a Complete Reimbursement
- Create the Reimbursement: Use
CreateReembolsoAto create the main reimbursement record - Add Expense Details: Use
CreateDetallesAto add all expense line items with receipts - Validate: System automatically validates against business rules
- Submit for Approval: Update status to trigger approval workflow
Status Workflow
Typical status transitions:Expense Categories
Common expense types (id_tipo_gasto):
- Meals and entertainment
- Transportation (taxi, bus, flight)
- Lodging
- Mileage reimbursement
- Office supplies
- Client gifts
Document Requirements
For each expense detail:- Valid receipt or invoice (
archivo) - Complete tax information (
ruc,autorizacion,numDocumento) - Proper categorization (
id_tipo_gasto,id_grupo_gasto) - Accurate IVA/VAT breakdown
Error Handling
Common validation errors:- Missing required receipts
- Expenses outside business rules limits
- Invalid approver assignments
- Duplicate document numbers
- Expenses outside date range