Get Abonnement


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


Point de terminaison

The following endpoint can be used to retrieve a Abonnement. 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}
Demande
Aucun corps n'est requis pour cet appel API
Réponse
Champ
Type
Requis
Description
external_id
String
The unique subscription id from the source system/database. If we detect a record with the same `external_id`, it will be updated, otherwise it will be added.
description
String
Une brève description des produits/services sur l'abonnement utilisé dans la demande de paiement affichée au client.
amount
Number
Le montant à facturer pour chaque période de facturation. Format = 0.00
frequency
String
La fréquence de facturation.
One of `Daily`, `Weekly`, `Bi-Weekly`, `Semi-Monthly`, `Monthly`, `Quarterly`, `Semi-Annually`, `Yearly`
customer
Une référence au dossier du client.
start_date
Date
--
La date de début de l'abonnement. Si laissée vide, elle sera définie lorsque le client confirme son mode de paiement. Format = YYYY-MM-DD
number_of_payments
Number
--
Le nombre de versements à effectuer. Si laissé vide, l'abonnement se poursuit indéfiniment ou jusqu'à ce qu'il soit fermé manuellement.
status
String
--
Le statut actuel de l'abonnement.
One of `pending`, `active`, `paused`, `failed`, `closed`
active
Boolean
--
Whether the subscription is active. Setting to `false` will irreversibly close the subscription if the customer has already accepted it.
Default = `true`
webhook_url
String
--
L'URL où envoyer les données lorsque certaines actions sont effectuées sur l'abonnement.
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,
        "taxes": 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": 9997,
          "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"
}