Skip to main content
A CargoWise payment receipt can produce one REP with one or many related income invoices. Lambda includes only eligible PPD parents and stamps the complete remaining REP when every included parent is consistent.

Resolve each parent

Lambda uses the strongest available parent evidence:
  1. A matching Lambda income invoice found by the CargoWise DataSource/Key.
  2. An embedded sibling AccountingInvoice in the receipt, including its Government Number and balance evidence.
  3. Exact provider evidence when the parent is known but the local record is not enough.
  4. A durable dependency wait when the parent is still missing or not stamped.
A parent that is healthy but not yet available shows Waiting for parent. It continues when the parent becomes usable. A failed, cancelled, contradictory, or stamped-without-UUID parent is not a healthy wait. It blocks the complete payment and records the reason.

Choose the complete REP set

Lambda never stamps a partial REP by silently dropping a failed PPD parent. EXX exchange-difference lines are a separate exception described below. For a mixed receipt, the REP total covers the included PPD applications. The omitted PUE amount stays in the CargoWise accounting evidence and is not silently treated as a REP application.

REP eligibility window

The optional REP eligibility window can treat a parent as PUE for a short period after its CargoWise PostDate:
  1. Lambda reads the parent PostDate in Mexico City time.
  2. It adds the configured number of calendar days.
  3. It compares the cutoff with the day Lambda received the payment.
  4. A payment received on or before the cutoff omits that parent as PUE.
  5. A payment received after the cutoff includes the parent as PPD when reconciliation succeeds.
The default is disabled. Lambda snapshots the setting, reference time, cutoff, and decision with the payment intent. A later setting change does not rewrite an in-flight or historical REP.

Installments and balances

For each included parent, Lambda checks:
  • parent SAT UUID and document currency
  • parent total and the amount paid in document currency
  • previous and remaining balance
  • installment number and earlier installment history
  • tax evidence for the paid amount
The SAT chain is:
For the first installment, ImpSaldoAnt is the parent total. One receipt can pay several parents or part of one parent. Each parent keeps its own installment chain. When Lambda stamped the parent, Lambda owns the installment counter and running SAT balance. CargoWise remains the accounting authority on the wire. If prior payments are evident but the exact installment cannot be proven, Lambda stops with a history failure. It does not guess a partialidad. If a REP was issued but its payment-ledger provenance could not be finalized, Lambda protects the REP from another stamp until support repairs the provenance.

Currency

Same-currency payments need no conversion. A cross-currency parent needs:
  • a valid payment exchange rate
  • the explicit MXN amount applied at payment time
  • a document-currency amount that reconciles with the receipt
Lambda derives TipoCambioP and EquivalenciaDR from those CargoWise facts and verifies the returned REP. See Currency for the formula and examples.

EXX exchange-difference lines

CargoWise can send a match line with an EXX reference for an exchange difference. It changes the accounting result but does not represent money applied to a SAT parent. Lambda excludes EXX lines from the REP. Ordinary PPD lines on the same receipt still reconcile and stamp. Lambda does not delete the EXX value from CargoWise accounting evidence.

Common payment stops

  • A PUE parent cannot receive a REP.
  • A payment amount cannot exceed the current parent balance.
  • Missing OutstandingAmount in an embedded parent is a source-data failure when no ledger evidence can prove the previous balance. It is not a dependency wait.
  • A parent currency, total, UUID, tax, or exchange value that conflicts with the saved fiscal result stops the REP.
See Failures for the public failure type and Recovery for the next safe action.