Can I get all active ARB subscription in a single API call

175 views Asked by At

Current I'm exporting all ARB data by calling API to get all active ARB ids then go through each ARB id to get info stored in each ID. But this process is too long and it makes lots of requests. Is there any way so that I can get all active ARB ids data in one request like that of any database?

https://developer.authorize.net/api/reference/index.html#recurring-billing-get-a-list-of-subscriptions

This function gives only small amount data while I need complete data stored in a profile like this one: https://developer.authorize.net/api/reference/index.html#recurring-billing-get-subscription But this function only works for single ID.

1

There are 1 answers

3
John Conde On

New Answer

No. The ARBGetSubscriptionListRequest only returns a limited amount of information. If you want detailed information you would need to call ARBGetSubscriptionListRequest and then loop through the results and make an API call for each subscription to get the more granular data.

Due to the potentially large amount of results, you probably should store the results in a database and then have a bunch of scheduled scripts make the subsequent API calls.

Old Answer

Yes. You can call ARBGetSubscriptionListRequest.

Request:

{
    "ARBGetSubscriptionListRequest": {
        "merchantAuthentication": {
            "name": "5KP3u95bQpv",
            "transactionKey": "346HZ32z3fP4hTG2"
        },
        "refId": "123456",
        "searchType": "subscriptionActive",
        "sorting": {
            "orderBy": "id",
            "orderDescending": "false"
        },
        "paging": {
            "limit": "1000",
            "offset": "1"
        }
    }
}

Response:

{
    "totalNumInResultSet": 1273,
    "totalNumInResultSetSpecified": true,
    "subscriptionDetails": [
        {
            "id": 100188,
            "name": "subscription",
            "status": "canceled",
            "createTimeStampUTC": "2004-04-28T23:59:47.33",
            "firstName": "Joe",
            "lastName": "Tester",
            "totalOccurrences": 12,
            "pastOccurrences": 6,
            "paymentMethod": "creditCard",
            "accountNumber": "XXXX5454",
            "invoice": "42820041325496571",
            "amount": 10,
            "currencyCode": "USD"
        },
        {
            "id": 100222,
            "name": "",
            "status": "canceled",
            "createTimeStampUTC": "2004-10-22T21:00:15.503",
            "firstName": "asdf",
            "lastName": "asdf",
            "totalOccurrences": 12,
            "pastOccurrences": 0,
            "paymentMethod": "creditCard",
            "accountNumber": "XXXX1111",
            "invoice": "",
            "amount": 1,
            "currencyCode": "USD"
        },
        {
            "id": 100223,
            "name": "",
            "status": "canceled",
            "createTimeStampUTC": "2004-10-22T21:01:27.69",
            "firstName": "asdf",
            "lastName": "asdf",
            "totalOccurrences": 12,
            "pastOccurrences": 1,
            "paymentMethod": "eCheck",
            "accountNumber": "XXXX3888",
            "invoice": "",
            "amount": 10,
            "currencyCode": "USD"
        }
    ],
    "refId": "123456",
    "messages": {
        "resultCode": "Ok",
        "message": [
            {
                "code": "I00001",
                "text": "Successful."
            }
        ]
    }
}