Get Subscription


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


Endpoint

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

GET
{base_url}/api/v4/site/{site_id}/subscription/{_id}
Request
No body is required for this API call
Response
Field
Type
Description
id
String
The id of the subscription. This field is auto generated by the system and is not required when creating a new subscription, but it is required when updating an existing subscription.
frequency
String
The billing frequency.
One of `Daily`, `Weekly`, `Bi-Weekly`, `Semi-Monthly`, `Monthly`, `Quarterly`, `Semi-Annually`, `Yearly`
customer
A reference to the customer record.
startDate
Date
The start date of the subscription. If left blank, it will be set when the customer confirms their payment method. Format = YYYY-MM-DD
numberOfPayments
Number
The number of installments to be made. If left blank, the subscription continues indefinitely or until manually closed.
status
String
The current status of the subscription.
One of `pending`, `active`, `paused`, `failed`, `closed`
webhookUrl
String
The url to post to when certain actions are performed on the subscription.
attachmentRefs
A list of attachments.
billToCustomer
The customer to bill, if different than the customer.
billTo
Optional overrides for the Bill To section of the invoice. If bill_to_customer is provided, this object will be merged with the customer's information and can be used to override specific fields. If bill_to_customer is not provided, the fields in this object will be used as the Bill To information on the invoice.
soldTo
Optional overrides for the Sold To / Customer section of the invoice.
deleted
Boolean
This flag represents whether the record is deleted and no longer available to be used.
Sample Response
			
{
  "_id": "61f32dc2f62bdc6a48945067",
  "description": "Gold+ Plan",
  "amount": 9.97,
  "frequency": "Weekly",
  "start_date": "2022-02-23",
  "number_of_payments": "",
  "end_date": null,
  "invoices": [
    {
      "_id": "61f32dc2f62bdc6a48951255",
      "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": [
        {
          "_id": "62166eda3a8c0517866b9b46",
          "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": {
    "_id": "62166eda3a8c0517866b9r23",
    "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"
}