question

angelm avatar image
angelm asked bryanvargas answered

How to get transactions related to recurring payments subscriptions?

We are going to implement recurring payments with our system, but we want to get the transactions related to those recurring payment plans created for the customers in order to have accurate data in our system, so we can tell them detailed info about their plan.

Also which is the next billing date? and What happen with months like February when the subscription was created on 31st of a month?

Payments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
bryanvargas avatar image
bryanvargas answered

So when a recurring payment happens, its logs as a paid order with a transaction UUID. You can do an example call of the orders and expand the payments. If you had a note for your plan you will see it in the JSON output.

{ {baseUrl}}/v3/merchants/{ {merchantId}}/orders?expand=onlineOrder&expand=payments


Leap year day doesn't affect it as you can configure the frequency, if it is monthly its is ~30 days. Take a look at our Interval Matrix example: https://docs.clover.com/docs/working-with-recurring-payments-and-subscriptions#interval-matrix

Here is an example of a call that I did, you can see my recurring plan note is "This is your first plan" and the payment UUID and order UUID are both present.

If you have a general note for for your recurring plans, you can even use the filter query in your call.

{
            "href": "{baseUrl}/v3/merchants/{mId}/orders/{orderId}",
            "id": "{orderId}",
            "currency": "USD",
            "customers": {
                "elements": [
                    {
                        "href": "{baseUrl}/v3/merchants/{mId}/customers/{customerId}",
                        "id": "{customerId}"
                    }
                ]
            },
            "total": 1000,
            "paymentState": "PAID",
            "note": "This is your first plan",
            "taxRemoved": false,
            "isVat": false,
            "state": "locked",
            "manualTransaction": false,
            "groupLineItems": true,
            "testMode": false,
            "payType": "FULL",
            "createdTime": 1647734415000,
            "clientCreatedTime": 1647734415000,
            "modifiedTime": 1647799202000,
            "payments": {
                "elements": [
                    {
                        "id": "NFEYR780NBSH0",
                        "order": {
                            "id": "4SJZQENHN4CK2"
                        },
                        "tender": {
                            "href": "{baseUrl}/v3/merchants/{mId}/tenders/{tenderId}",
                            "id": "{tenderId}"
                        },
                        "amount": 1000,
                        "tipAmount": 100,
                        "taxAmount": 0,
                        "cashbackAmount": 0,
                        "employee": {
                            "id": "DFLTEMPLOYEE"
                        },
                        "createdTime": 1647799203000,
                        "clientCreatedTime": 1647799203000,
                        "modifiedTime": 1647799202000,
                        "offline": false,
                        "result": "SUCCESS"
                    }
                ]
            }
        },
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community