Skip to main content

Create Guide

Create one or multiple shipping guides in a single request.

POST /api/guias/crear

Required permission: guias.create

Request Body

{
"TipoServicio": "Ocurre",
"Guia": [
{
"Remitente": {
"Nombre": "Juan Perez",
"Telefono": "5551234567",
"Celular": "5559876543",
"Email": "juan@email.com"
},
"Destinatario": {
"Nombre": "Maria Lopez",
"Email": "maria@email.com",
"Telefono": "3331234567",
"Celular": "3339876543",
"RazonSocial": "Company SA de CV",
"RFC": "EMP123456ABC",
"Referencias": "In front of the park",
"CodigoPostal": "44100",
"Estado": "Jalisco",
"Municipio": "Guadalajara",
"Colonia": "Centro",
"Calle": "Av. Juarez",
"Numero_exterior": "123",
"Numero_interior": "4B",
"DestinoCode": "GDLGL"
},
"Producto": {
"TipoEnvio": "Paquete",
"ValorDeclarado": 500.00,
"Contenido": "Electronics",
"InformacionAdicional": "Fragile",
"Peso": 2.5,
"Largo": 30,
"Alto": 20,
"Ancho": 15
},
"Creado_por": {
"Nombre": "Web System",
"Agencia": "Online Store"
}
}
]
}

Important Fields

TipoServicio (Required)

ValueDescription
OcurreRecipient picks up at branch
DomicilioHome delivery to recipient

DestinoCode or CodigoPostal (One Required)

You have two options to specify the destination:

FieldDescription
DestinoCodeDirect destination branch code
CodigoPostalThe system gets the branch automatically

:::tip Recommendation Use only CodigoPostal and the system resolves the branch automatically. If there's no coverage for that postal code, you'll receive a descriptive error. :::

To get branch codes manually: GET /api/sucursales/destinos

To verify coverage before creating: GET /api/sucursales/cobertura/{cp}

Origin

:::info Note The origin is automatically determined by the branch assigned to your API user. It's not sent in the JSON. :::

Successful Response

{
"response": "OK",
"message": "Guias creadas: 1",
"data": [
{
"SEND_GUIA": "URU030857",
"SEND_SUCU_ORIG": "URU",
"SEND_SUCU_DEST": "GDLGL",
"SEND_ESTATUS": "Documentado",
"SEND_FECHA": "2026-07-05T10:30:00",
"SEND_REMITENTE": "Juan Perez",
"SEND_DESTINATARIO": "Maria Lopez",
"SEND_FLETE": 0,
"SEND_TOTAL": 0
}
]
}

Example with Auto-Resolution of Branch

If you only send CodigoPostal without DestinoCode, the system finds the branch automatically:

{
"TipoServicio": "Ocurre",
"Guia": [
{
"Remitente": {
"Nombre": "Juan Perez",
"Telefono": "5551234567"
},
"Destinatario": {
"Nombre": "Maria Lopez",
"CodigoPostal": "44100",
"Estado": "Jalisco",
"Municipio": "Guadalajara",
"Colonia": "Centro",
"Calle": "Av. Juarez",
"Numero_exterior": "123"
},
"Producto": {
"Contenido": "Electronics"
},
"Creado_por": {}
}
]
}

The system detects that postal code 44100 corresponds to branch GDLGL and assigns it automatically.

Create Multiple Guides

You can create multiple guides in a single request by adding more elements to the Guia array:

{
"TipoServicio": "Ocurre",
"Guia": [
{ /* Guide 1 */ },
{ /* Guide 2 */ },
{ /* Guide 3 */ }
]
}

Common Errors

ErrorCause
El campo 'TipoServicio' es requeridoMissing TipoServicio field
TipoServicio solo acepta: Domicilio, OcurreInvalid value
Usuario API no tiene sucursal asignadaYour user has no origin configured
DestinoCode no corresponde a sucursal válidaIncorrect destination code
No hay cobertura para el código postal: XXXXXPostal code has no assigned branch
Se requiere DestinoCode o CodigoPostalMissing destination info

cURL Example

curl -X POST "https://ws-api.masaprisaoperativo.com/api/guias/crear" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"TipoServicio": "Ocurre",
"Guia": [{
"Remitente": {"Nombre": "Juan Perez"},
"Destinatario": {"Nombre": "Maria Lopez", "DestinoCode": "GDLGL"},
"Producto": {"Contenido": "Documents"},
"Creado_por": {}
}]
}'