Skip to content

Process Pre-Alert β€” Peru πŸ‡΅πŸ‡ͺ ​

Country-specific rules. Auth, routing (air/ground), request shape, the completeness contract, and the error envelope are the same for every country β€” see the main endpoint page: Process Pre-Alert (JSON). This page covers only what's specific to Peru.

A manifest is routed to Peru when its destination resolves to PE (destination_airport: "LIM" for air, or destination_country: "PE" for ground) and PE is in your allowed_countries.

Required fields (Peru) ​

On top of the shared required fields, Peru needs:

FieldRule
consignee_rutThe document number. RUC (11 digits, validated) or DNI (8 digits) or passport/other (any non-empty value).
consignee_stateRequired, non-empty (region/department).
consignee_zip_codeRequired, non-empty.
weight_kg, fob_usd, freight_usdMust be > 0 (all three). A zero or missing freight rejects the manifest β€” the Peru gate checks it just like CL and AR.
internal_numberRequired. Peru does not consume it β€” it is demanded so that CL and PE share one row shape.
iva_overrideRequired β€” an explicit true or false. It has no effect on the current PE customs model; same reason as above.
order_created_atRequired β€” ISO 8601 purchase date. Accepted but not yet persisted on PE; same reason as above.

Peru and Chile share the same row contract. The three fields above are only consumed by the Chilean pipeline, but they are required on Peru too so that one payload works for Santiago and Lima without branching. Argentina is the exception β€” see its page.

A bad document or a missing consignee_state/consignee_zip_code rejects the whole manifest with 400 manifest_validation_failed (see invalid_rows[]).

Optional but consequential (Peru) ​

Not required by the contract β€” LogirAI files nothing with SUNAT, so nothing here blocks ingestion. Your customs broker is the one who needs them:

FieldIf omitted
shipper_name, shipper_address, shipper_city, shipper_countryThe guide is stored without a sender, and the broker has no sender record to declare.
insurance_usdNot part of the Peru duty base (IGV is computed on FOB), but the broker loses the figure.

Argentina does require both groups β€” it writes them into the AIDA customs file. Chile and Peru do not.

Request example (Peru) ​

bash
curl -X POST https://api.logirai.com/api/manifests/process-pre-alert-json \
  -H "Authorization: Bearer $API_PASSWORD" \
  -H "Content-Type: application/json" \
  -d @body-pe.json
json
{
  "mawbNumber": "245-55667788",
  "transportMode": "air",
  "flightData": {
    "flight_number": "LA2480",
    "origin_airport": "PVG",
    "destination_airport": "LIM",
    "origin_country": "CN",
    "scheduled_departure": "2026-06-10T02:00:00+08:00",
    "scheduled_arrival": "2026-06-10T16:00:00-05:00"
  },
  "dispatcherDocument": null,
  "cargoReference": null,
  "licensePlate": null,
  "guideRows": [
    {
      "hawb": "PE-AWB-001",
      "consignee_name": "MarΓ­a Quispe",
      "consignee_rut": "20100070970",
      "consignee_address": "Av. Javier Prado Este 4200",
      "consignee_city": "Lima",
      "consignee_state": "Lima",
      "consignee_zip_code": "15036",
      "consignee_phone": "+51987654321",
      "consignee_email": "maria.quispe@example.pe",
      "consignee_country": "PE",
      "shipper_name": "Shanghai Trading Co.",
      "shipper_address": "123 Nanjing Road",
      "shipper_city": "Shanghai",
      "shipper_country": "CN",
      "packages_count": 1,
      "weight_kg": 1.2,
      "description_original": "Wireless bluetooth earphones",
      "hs_code": "8518.30.0000",
      "fob_usd": 150.0,
      "product_value": 150.0,
      "freight_usd": 7.0,
      "insurance_usd": 1.0,
      "currency": "USD",
      "order_created_at": "2026-06-08T09:15:00-05:00",
      "internal_number": "BBX-PE-001",
      "iva_override": false,
      "extra_data": {}
    }
  ]
}

consignee_document_type is optional: send "PASSPORT" (or "OTHER") for a foreign document to skip the RUC/DNI digit check.

Customs categories (SUNAT) ​

Every guide is classified into a category (1–4) by its declared value. You get pe_category (the number) and a Peru-specific customs_status:

Parcel value (FOB, USD)pe_categorycustoms_statusTaxable?
Documents1PE-EXEMPTNo
≀ US$2002PE-EXEMPTNo (de minimis)
US$200 – 2,0003PE-TAXABLEYes
> US$2,0004PE-RETAINEDYes β€” held

These PE-* codes are Peru-only. They are not the Chilean customs_status codes.

Anti-split rule (important) ​

If you send more than one parcel to the same person/company (same consignee_rut) in one manifest, the small (≀US$200) parcels lose the exemption and become Category 3 (taxable). This is a SUNAT requirement β€” don't split a single shipment into several parcels to stay under US$200.

Category 4 β€” held parcels ​

A parcel over US$2,000 is accepted and stored, but blocked from dispatch (a retention hold is placed on it). It can only be released by a specialized customs broker. You still get the guide and tracking code; track its status via the read endpoints.

With products[] the FOB used for categories (and the US$2,000 Category-4 threshold) is the summed product value β€” so a HAWB whose products add up to more than US$2,000 is held, even if no single line exceeds it.

Duties ​

For taxable guides (Category 3, and Category 2 that lost the exemption):

estimated_duties = FOB Γ— 18%        (IGV; base is FOB, not CIF)

This is an internal estimate for your reference. LogirAI does not file anything with SUNAT β€” your customs broker handles the official declaration. Peru has no prepaid IGV. If you send tax_override, it must go inside extra_data (it is not a guide-level field); it is stored as metadata and never changes the calculation.

Response (Peru) ​

201 Created:

json
{
  "success": true,
  "guides_created": 3,
  "guides": [{ "hawb": "PE-AWB-001", "tracking_code": "TP-A1B2C3" }],
  "flight_id": "uuid",
  "transport_mode": "air",
  "parser_used": "json",
  "pe_category_counts": { "2": 1, "3": 1, "4": 1 },
  "retained_count": 1,
  "holds_emitted": 1,
  "errors": [],
  "warnings": []
}
FieldMeaning
pe_category_countsHow many guides landed in each category.
retained_countCategory-4 guides that were held (FOB > US$2,000).
holds_emittedRetention holds actually placed (matches retained_count).

LogirAI β€” Cross-Border Logistics API for Retailers and Marketplaces