Ir al contenido

Registrar un pago (abono) de un viaje

POST
/teams/{teamId}/trips/{tripId}/payments
curl --request POST \
--url https://api.dev.lade.com.mx/teams/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/trips/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "amount": 5000, "paidAt": "2026-07-26T10:00:00Z", "method": "TRANSFERENCIA", "reference": "SPEI-123456", "notes": "Anticipo del 50%" }'

Registra un abono de cliente contra el saldo de un viaje. Denormaliza clientId/clientName del viaje al momento de crear el pago. Publica el evento de dominio PaymentRecorded. Soporta idempotencia opcional vía el header X-Idempotency-Key.

teamId
required
string format: uuid

ID del equipo (UUID)

tripId
required
string format: uuid

ID del viaje (UUID)

X-Idempotency-Key
string

Clave opcional para evitar duplicar el pago en reintentos

Media typeapplication/json
object
amount
required
number
> 0 <= 99999999
paidAt
required
string format: date-time
method
required

Forma en que se cobró el pago

string
Allowed values: EFECTIVO TRANSFERENCIA CHEQUE TARJETA OTRO
reference
string
<= 100 characters
notes
string
<= 500 characters
Example
{
"amount": 5000,
"paidAt": "2026-07-26T10:00:00Z",
"method": "TRANSFERENCIA",
"reference": "SPEI-123456",
"notes": "Anticipo del 50%"
}

Pago registrado

Media typeapplication/json
object
payment

Abono/pago registrado contra el saldo de un viaje (no confundir con el CFDI de Invoice)

object
id
string format: uuid
paymentId
string format: uuid
teamId
string format: uuid
tripId
string format: uuid
clientId
string
nullable
clientName
string
amount
number
> 0
paidAt
string format: date-time
method

Forma en que se cobró el pago

string
Allowed values: EFECTIVO TRANSFERENCIA CHEQUE TARJETA OTRO
reference
string
notes
string
registeredBy
string format: uuid
nullable
createdAt
string format: date-time
updatedAt
string format: date-time
Example
{
"payment": {
"id": "aa0e8400-e29b-41d4-a716-446655440005",
"paymentId": "aa0e8400-e29b-41d4-a716-446655440005",
"teamId": "550e8400-e29b-41d4-a716-446655440000",
"tripId": "880e8400-e29b-41d4-a716-446655440003",
"amount": 5000,
"paidAt": "2026-07-26T10:00:00Z",
"method": "TRANSFERENCIA"
}
}

Solicitud inválida

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Validation failed",
"field": "email",
"message": "Invalid email format"
}

Sin permisos

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Forbidden",
"message": "You don't have permission to access this resource"
}

Recurso no encontrado

Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{
"error": "Not found",
"message": "Resource not found"
}