Shipping to Peru
Ship to Peru: the two-letter department code, the city as free text, and what you can test in sandbox.
Peru's departments have two codes each, and only the two-letter one is unique: LIM is both Lima and Lima Capital. Send two letters, and the rest is an ordinary address.
At a glance
| Postal code | Required by the API: 15001 |
| Department | A two-letter code, in state. Lima Capital is LR |
| City | Free text: Miraflores |
| House number | number, required to create a label |
| Tax ID | RUC or DNI, in identificationNumber. Optional |
| Currency | Quote in PEN. The label is charged in your account's currency |
| In sandbox | No carrier completes the cycle |
What an address to Peru needs
The fields of a Peruvian address. Where the address form (GET /generic-form?country_code=PE&form=address_info) differs, the table says so:
| Field | Required | What goes in it |
|---|---|---|
street | yes | Av. Larco |
state | yes | A two-letter department code — LR, AR. Never the name |
city | yes | Miraflores — free text, no catalog |
postalCode | yes | Required by the API, although the form hides it: 15001 |
number | yes, for the label | Building number |
identificationNumber | no | RUC or DNI |
reference | no | Free text for the carrier |
Send the house number as
number. The sandbox's address form calls itstreetNumber; production and the API usenumber. Thirteen countries differ this way: see Address Rules by Country.
The department code
API reference → Get states by country
curl https://queries.envia.com/state?country_code=PE26 departments, each with a two-letter and a three-letter code:
{ "name": "Amazonas", "code_2_digits": "AM", "code_3_digits": "AMA", "country_code": "PE" }Both are accepted. Send code_2_digits: it is the only unique one. LIM is both Lima (LP) and Lima Capital (LR), and GET /state/PE/LIM answers with the two. Miraflores, San Isidro and the rest of the metropolitan area are LR.
A name in state fails:
{ "meta": "error", "error": { "code": 400, "message": "String is too long at #->properties:origin->$ref[#/definitions/address]->properties:state" } }
statetakes 2 to 3 characters. The error names the schema path, not the problem: when you see it, a name went where a code belongs.
All 26 departments and their codes
| Send | Also in the catalog | Name |
|---|---|---|
AM | AMA | Amazonas |
AN | ANC | Ancash |
AP | APU | Apurimac |
AR | ARE | Arequipa |
AY | AYA | Ayacucho |
CJ | CAJ | Cajamarca |
CL | CAL | Callao |
CS | CUS | Cusco |
HV | HUV | Huancavelica |
HC | HUC | Huanuco |
IC | ICA | Ica |
JU | JUN | Junin |
LL | LAL | La Libertad |
LB | LAM | Lambayeque |
LP | LIM | Lima |
LR | LIM | Lima Capital |
LO | LOR | Loreto |
MD | MDD | Madre de Dios |
MQ | MOQ | Moquegua |
PA | PAS | Pasco |
PI | PIU | Piura |
PU | PUN | Puno |
SM | SAM | San Martin |
TA | TAC | Tacna |
TU | TUM | Tumbes |
UC | UCA | Ucayali |
Repeated codes. LIM is both Lima and Lima Capital — send the two-letter code, which is unique (LP, LR).
The list comes from GET /state?country_code=PE.
A complete address
{
"name": "Carlos Quispe",
"email": "[email protected]",
"phone": "+51 900 000 000",
"street": "Av. Larco",
"number": "345",
"city": "Miraflores",
"state": "LR",
"postalCode": "15001",
"country": "PE"
}GET /provinces/{state_code} does not help here: /provinces/LR returns an empty list. Peruvian cities are free text.
Ship it
The calls are the same in every country. Shipping to Chile walks through all five — carriers, quote, label, track and cancel — under Ship it, end to end; use them with the Peruvian address above. Check which carriers your account has for Peru with Carriers by country.
International, into and out of Peru
A shipment that crosses the Peruvian border is an ordinary international shipment: see International Shipping & Customs. The RUC or DNI in identificationNumber stays optional.
Testing in sandbox
Why Peru cannot be tested end to end in sandbox
- Olva Courier is the only carrier the test account has for a domestic Peruvian lane, and it answers
1102 There is no coverage for the selected addressesfor Lima and Arequipa. - Other carrier names answer
1101, which means not enabled on the account. - Sandbox does check the address: a
statethat is too long or a missingpostalCodefails with400before any carrier is asked. The address above passes that check.
In production you use the carriers enabled on your account.
Next steps
Ship to Chile: a region code, the commune as free text, and no postal code.
Crossing a border adds three things: a declaration of the contents, a code that classifies them, and who pays the duties.
What an address needs in each country, where each value comes from, and five rules that apply everywhere.
Updated 18 days ago