Add/Update Payment


The following endpoint can be used to add or update a payment within the Hyfin application that were already processed.


Punto Final

The following endpoint can be used to add or update a payment. You must replace the {base_url} and {site_id} variable with the site id that was provided when the site was created.

POST
{base_url}/api/v3.1/site/{site_id}/payment/addUpdate

Solicitud
Campo
Tipo
Descripción
external_id
String
El identificador de pago único del sistema/base de datos fuente. Si detectamos un registro con el mismo external_id, se actualizará; de lo contrario, se agregará.
gateway_transaction_id
String
El identificador único que se asignó al registro de pago desde la pasarela cuando se procesó el pago.
display_name
String
El nombre de visualización seguro y amigable del método de pago. Ejemplo: VISA **** 3421.
amount
Number
El monto que se pagó. Format = 0.00
paid_on
Date
La fecha y hora en que se realizó el pago. Format = YYYY-MM-DDTHH:mm:ssZ
tip
Number
La cantidad de propina que se agregó. Format = 0.00
tax
Number
El monto de impuestos que se agregó. Format = 0.00
fee
Number
La cantidad de la tarifa que se agregó. Format = 0.00
invoice
Una referencia al registro de la orden de compra.
payment_type
String
El tipo de método de pago utilizado para realizar el pago.
One of payment_card, ach, cash, check
payment_sub_type
String
El subtipo del método de pago utilizado para realizar el pago.
One of checking, savings, visa, mastercard, discover, amex, cash, other
status
String
El estado actual del pago.
Default = captured | One of declined, authorized, captured, voided, settled, returned, refundFailed, refunded, refundSettled
active
Boolean
Esta bandera representa si el registro de pago está activo.
Default = true
Sample Request
			
{
  "external_id": "65432325",
  "gateway_transaction_id": "53912387124235234",
  "payment_type": "payment_card",
  "payment_sub_type": "visa",
  "display_name": "VISA **** 5123",
  "amount": 35.15,
  "paid_on": "2021-01-01T14:32:18Z",
  "status": "captured",
  "invoice": {
    "external_id": "65432661"
  }
}


		
Respuesta
Campo
Tipo
Descripción
success
Boolean
Whether the record was added or updated successfully.
action
String
Informs whether the record was added or updated. Will only be returned if success is true.
One of added, updated
_id
String
The auto generated id assigned to the record.
errors
String [ ]
A list of errors. Will only be returned if success is false.
Sample Response (Successful)
			
{
  "success": true,
  "action": "added",
  "_id": "60f720d248f143332af022e0"
}


		
Sample Response (Failed)
			
{
  "success": false,
  "errors": [
    "invalid field2",
    "missing field_name"
  ]
}