Get Suscripción


The following endpoint can be used to retrieve the details of a Suscripción within the Hyfin application.


Punto Final

The following endpoint can be used to retrieve a Suscripción. You must replace the {base_url} , {external_id} and {site_id} variables with the appropriate values.

GET
{base_url}/api/v3.1/site/{site_id}/subscription/{external_id}
Solicitud
Ningún cuerpo es necesario para esta llamada de API
Respuesta
Campo
Tipo
Descripción
external_id
String
El identificador de suscripción único del sistema/base de datos fuente. Si detectamos un registro con el mismo external_id, se actualizará; de lo contrario, se agregará.
description
String
Una breve descripción de los productos/servicios en la suscripción utilizada en la solicitud de pago mostrada al cliente.
amount
Number
El monto a cobrar por cada período de facturación. Format = 0.00
frequency
String
La frecuencia de facturación.
One of Daily, Weekly, Bi-Weekly, Semi-Monthly, Monthly, Quarterly, Semi-Annually, Yearly
customer
Una referencia al registro del cliente.
start_date
Date
La fecha de inicio de la suscripción. Si se deja en blanco, se establecerá cuando el cliente confirme su método de pago. Format = YYYY-MM-DD
number_of_payments
Number
El número de pagos a realizar. Si se deja en blanco, la suscripción continúa indefinidamente o hasta que se cierre manualmente.
status
String
El estado actual de la suscripción.
One of pending, active, paused, failed, closed
active
Boolean
Si la suscripción está activa. Establecer en false cerrará de forma irreversible la suscripción si el cliente ya la ha aceptado.
Default = true
webhook_url
String
La URL a la que se enviará la publicación cuando se realicen ciertas acciones en la suscripción.
Sample Response
			
{
  "_id": "61f32dc2f62bdc6a48945067",
  "external_id": "439772921",
  "description": "Gold+ Plan",
  "amount": 9.97,
  "frequency": "Weekly",
  "start_date": "2022-02-23",
  "number_of_payments": "",
  "end_date": null,
  "invoices": [
    {
      "external_id": "39772634",
      "invoice_number": "",
      "totals": {
        "total": 9.97,
        "tax": 0
      },
      "notifications": [],
      "lines": [],
      "description": "Gold+ Plan",
      "invoice_date": "2022-02-23",
      "due_date": "2022-02-23",
      "customer_memo": "",
      "internal_memo": "",
      "active": true,
      "payments": [
        {
          "external_id": "62331255",
          "gateway_transaction_id": "574823902",
          "display_name": "Visa **** 4279",
          "amount": 9.97,
          "tip": 0,
          "paid_on": "2022-02-23T11:29:01-06:00",
          "payment_type": "payment_card",
          "transaction_type": "capture",
          "tax": 0
        }
      ]
    }
  ],
  "status": "active",
  "customer": {
    "external_id": "72345322",
    "first_name": "John",
    "last_name": "Doe",
    "account_name": null,
    "mobile_phone": "111-222-3333",
    "email": "johndoe@abc.com",
    "notification_options": {
      "notify_phone": true,
      "notify_email": false
    }
  },
  "active": true,
  "webhook_url": "https://yourcompany.com/webhook"
}