How do we know if the subscription plan has been paid?

I have two test accounts, one of which I paid for a subscription, the other has signed up for a subscription, but have yet to complete the invoice.

When I retrieve the subscriptions, it gives me back a “paid_until_date” on both accounts, even though one of them has not actually been paid yet.

What can we run to ensure that the user is paid up to date? I can see on the dashboard that it shows paid for one and unpaid on the other, so the data is somewhere, I’m just not sure which command to run to find it.

Can you share the unpaid subscription id? As far as I know paid_until_date should ideally be the way to ensure it has been paid for, so it’s odd that it’s present when it hasn’t been paid for yet.

1 Like

OK, so the invoice ID is 1bDj1AgKEwShRSa8E6UwSA; It returns:

{
  "invoice": {
    "id": "1bDj1AgKEwShRSa8E6UwSA",
    "version": 1,
    "location_id": "L0R3KD1SXNRZB",
    "order_id": "NBv0eMXfmsVtIeA4PHct7ixKGWfZY",
    "payment_requests": [
      {
        "uid": "95a0b264-d27f-49f1-8fc1-8d18c59da98b",
        "request_method": "EMAIL",
        "request_type": "BALANCE",
        "due_date": "2021-01-19",
        "computed_amount_money": {
          "amount": 300,
          "currency": "USD"
        },
        "total_completed_amount_money": {
          "amount": 0,
          "currency": "USD"
        }
      }
    ],
    "invoice_number": "000001",
    "title": "Toilet Bar 1 Month Subscription Subscription",
    "public_url": "https://squareup.com/pay-invoice/1bDj1AgKEwShRSa8E6UwSA",
    "status": "UNPAID",
    "timezone": "America/New_York",
    "created_at": "2021-01-19T19:40:39Z",
    "updated_at": "2021-01-19T19:40:39Z",
    "primary_recipient": {
      "customer_id": "FJ7D11H0S0V9DCTYP31KXRXDJM",
      "given_name": "Toilet",
      "family_name": "Bar Customer 001",
      "email_address": "zacharyrharner@outlook.com"
    },
    "next_payment_amount_money": {
      "amount": 300,
      "currency": "USD"
    }
  }
}

So I can get the unpaid status from that, however, that is MASSIVELY inconvenient as it will need to be checked upon EVERY new invoice sent out…

The sub ID is acd1b86e-7b17-42ce-af28-7558c9c22c2e, and it returns:

{
  "subscription": {
    "id": "acd1b86e-7b17-42ce-af28-7558c9c22c2e",
    "location_id": "L0R3KD1SXNRZB",
    "plan_id": "CWHE652YFJEFNJFDC5VHGBFB",
    "customer_id": "FJ7D11H0S0V9DCTYP31KXRXDJM",
    "start_date": "2021-01-19",
    "charged_through_date": "2021-02-19",
    "status": "ACTIVE",
    "invoice_ids": [
      "1bDj1AgKEwShRSa8E6UwSA"
    ],
    "version": 1611085239006,
    "created_at": "2021-01-19T14:40:38-05:00",
    "paid_until_date": "2021-02-19",
    "timezone": "America/New_York"
  }
}

This shows a paid until date, despite the invoice saying unpaid. There has to be an easier way to get the unpaid status, without having to go through each and every invoice upon its new release each month.

Another thing to note, is that on the subscription creation, it returns null on the invoice IDs, so once you have that sub id, you have to go back in to find the invoice id. I’m sure it takes some time get the invoice sent out, but maybe getting the invoice’s id created first upon sub creation would help, OR completely removing the need to even check the invoice at all for paid status.

Thanks for the information. I checked in with our Subscriptions team, and it looks like paid_until_date is actually an incorrect name, and it’s really how far the subscription has been invoiced for. Currently, you are correct: you will need to check the status of the invoice to see if it actually has been paid for.

So, I will have to constantly check the system for new invoices to find out if they have paid the following months subscription??