Registrar un pago (abono) de un viaje
POST
/teams/{teamId}/trips/{tripId}/payments
const url = 'https://api.dev.lade.com.mx/teams/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/trips/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/payments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"amount":5000,"paidAt":"2026-07-26T10:00:00Z","method":"TRANSFERENCIA","reference":"SPEI-123456","notes":"Anticipo del 50%"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Sección titulada «Authorizations»Parameters
Sección titulada «Parameters»Path Parameters
Sección titulada «Path Parameters»teamId
required
string format: uuid
ID del equipo (UUID)
tripId
required
string format: uuid
ID del viaje (UUID)
Header Parameters
Sección titulada «Header Parameters»X-Idempotency-Key
string
Clave opcional para evitar duplicar el pago en reintentos
Request Bodyrequired
Sección titulada «Request Bodyrequired»Media typeapplication/json
object
amount
required
number
paidAt
required
string format: date-time
method
required
Forma en que se cobró el pago
string
reference
string
notes
string
Example
{ "amount": 5000, "paidAt": "2026-07-26T10:00:00Z", "method": "TRANSFERENCIA", "reference": "SPEI-123456", "notes": "Anticipo del 50%"}Responses
Sección titulada «Responses»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
clientName
string
amount
number
paidAt
string format: date-time
method
Forma en que se cobró el pago
string
reference
string
notes
string
registeredBy
string format: uuid
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"}