Retrieving transaction list from decline recovery

Background
Before starting this tutorial, make sure you understand the following topics from the Quick start section:

You can obtain a list of declined and recovered transactions and their recovery status for a specified date range.

To retrieve transactions by recovery status, do the following:

  1. Send a GET request to the View recoveries endpoint.

    In addition to limit and offset, you can specify a start and end date as part of the request. You can also specify to retrieve transactions of a specific recoveryStatus. To learn about the possible statuses, see the recoveryStatus table.

    For example, in the following, the request is to retrieve all declined or recovered transactions regardless of status for the second quarter of 2021, starting with the first one and showing only 10 at a time.

    curl -X GET 'https://api.nexiopaysandbox.com/recovery/v3?startDate=2021-03-01&endDate=2021-06-30&offset=0&limit=10' \
      -H 'Authorization: Basic [Base64_encoded_login]'
    
  2. Note the recoveryStatus of the transactions in the response.

    The response includes a rows array with each transaction that matches the request parameters. The information for each item in the array includes a recoveryStatus.

    This example response shows 3 resulting transactions. Note that the first one has a recoveryStatus of 30, indicating that the retry attempt is scheduled. The second one has a recoveryStatus of 50, indicating that the retry of the transaction was successful. The third one has a recoveryStatus of 40, indicating that the declined transaction cannot be retried.

    {
      "offset": 0,
      "limit": 10,
      "rows": [
        {
          "id": 62641,
          "retryDate": "2021-06-08T19:00:00.000Z",
          "transactionDate": "2021-05-25T14:08:20.000Z",
          "originalAmount": 77.65,
          "originalDeclinePaymentId": "eyJuYW1lIjoiIiwibWVyY2hhbnRJZCI6IjEwMDI2MCIsInJlZk51bWJlciI6IjQwMDY1OTkyNDM3IiwicmFuZG9tIjowLCJjdXJyZW5jeSI6InVzZCJ9",
          "orderNumber": "210058A",
          "recoveryStatus": 30,
          "retryCount": 13,
          "merchantId": "100260",
          "userName": "[email protected]",
          "isEnabledForRecovery": true,
          "updatedAt": "2021-06-07T19:01:28.000Z",
          "declineMessage": "This transaction has been declined."
        },
        {
          "id": 61829,
          "retryDate": "2021-05-24T15:13:26.000Z",
          "transactionDate": "2021-05-24T21:09:22.000Z",
          "originalAmount": 77.58,
          "originalDeclinePaymentId": "eyJuYW1lIjoiIiwibWVyY2hhbnRJZCI6IjEwMDI2MCIsInJlZk51bWJlciI6IjQwMDY1OTM3MzAyIiwicmFuZG9tIjowLCJjdXJyZW5jeSI6InVzZCJ9",
          "orderNumber": "210058A",
          "recoveryStatus": 50,
          "retryCount": 5,
          "merchantId": "100039",
          "userName": "[email protected]",
          "isEnabledForRecovery": true,
          "updatedAt": "2021-05-27T21:15:26.000Z",
          "declineMessage": "This transaction has been declined."
        },
        {
          "id": 35343,
          "retryDate": null,
          "transactionDate": "2021-04-09T16:00:48.000Z",
          "originalAmount": 109.33,
          "originalDeclinePaymentId": "eyJuYW1lIjoiIiwibWVyY2hhbnRJZCI6IjEwMDI2MCIsInJlZk51bWJlciI6ImNoXzFJVDd6SUtHTVRlYmRqQjR2bm5RbkVPWCIsInJhbmRvbSI6MCwiY3VycmVuY3kiOiJhdWQifQ==",
          "orderNumber": "1234567",
          "recoveryStatus": 40,
          "retryCount": 0,
          "merchantId": "100039",
          "userName": "[email protected]",
          "isEnabledForRecovery": false,
          "updatedAt": "2021-04-09T16:01:25.000Z",
          "declineMessage": "Your card was declined. This transaction requires authentication."
        }
      ],
      "hasMore": false
    }