Listing Payments

Let your Vendors see what Payments they have received

📘

This step is optional

You don't need to do this if you're looking for simple payout functionality only. However, viewing payment history is fairly important for many businesses as they maintain their records, so adding this functionality to your application is recommended.

Great! We've paid our Vendors, and they've just received their money. They're excited, and so are you, because it was so easy! Our vendors might still like to look at their historical payments, though. In this optional step, we'll show you how to build a simple payment history view.

The user interface

In your view markup, you'll want to create a grid or table view similar to the example in the image below.

An example payment listing user interface.An example payment listing user interface.

An example payment listing user interface.

You can optionally add additional controls to open the payment to view more details, search, or sort payments, but this functionality is outside of the scope of this tutorial.

Populating the view

To view payables, we'll use the List Payables endpoint. For this example, we'll assume that we're viewing payables for a single Company, because we're logged into your application as a representative of that Company.

We'll call the List Payables endpoint with a Routable Company ID, which you should be storing alongside other company-centric information in your application. Requests to this endpoint are passed in the query string, so our request URI will look something like GET https://api.sandbox.routable.com/v1/payables/?page=1&page_size=10&company=91a006ce-e143-4af0-905b-8e01892a60bd.

The response we get will look something like this:

{
  "object": "List",
  "links": {
    "self": "https://api.sandbox.routable.com/v1/payables?page=1&page_size=10",
    "next": null,
    "prev": null
  },
  "results": [
    {
      "object": "Payable",
      "id": "06b698e6-39b2-4458-9b08-27247dbbca45",
      "amount": "38.00",
      "amount_due": "0.00",
      "amount_paid": "38.00",
      "bill_number": null,
      "created_at": "2021-05-05T03:52:23.967572+00:00",
      "due_on": "2021-05-05",
      "expected_on": null,
      "issued_on": "2021-05-05",
      "delivery_method": null,
      "reference": null,
      "send_on": null,
      "status": "externally_paid",
      "status_changed_at": "2021-05-05T03:52:23.967572+00:00",
      "links": {
        "self": "https://api.sandbox.routable.com/v1/payables/06b698e6-39b2-4458-9b08-27247dbbca45"
      },
      "type": "external",
      "pay_to_company": {
        "object": "Company",
        "id": "91a006ce-e143-4af0-905b-8e01892a60bd",
        "display_name": "Jones Co",
        "links": {
          "self": "https://api.sandbox.routable.com/v1/companies/91a006ce-e143-4af0-905b-8e01892a60bd",
          "contacts": "https://api.sandbox.routable.com/v1/companies/91a006ce-e143-4af0-905b-8e01892a60bd/contacts",
          "payment_methods": "https://api.sandbox.routable.com/v1/companies/91a006ce-e143-4af0-905b-8e01892a60bd/payment-methods",
          "payables": "https://api.sandbox.routable.com/v1/payables?company=91a006ce-e143-4af0-905b-8e01892a60bd"
        }
      },
      "withdraw_from_account": {
        "object": "Account",
        "id": "01c4039a-644a-4f60-9085-23890208336e",
        "type": "bank",
        "type_details": {
          "account_number": "100000001234",
          "account_type": "checking",
          "institution_name": "Silicon Valley Bank",
          "routing_number": "121140399"
        },
        "links": {
          "self": "https://api.sandbox.routable.com/v1/settings/accounts/01c4039a-644a-4f60-9085-23890208336e"
        }
      }
    },
    {
      "object": "Payable",
      "id": "b83c71cd-9121-4a17-a3f9-6b2c4d9ff733",
      "amount": "594.40",
      "amount_due": "594.40",
      "amount_paid": "0.00",
      "bill_number": "6992",
      "created_at": "2021-05-05T03:51:03.905707+00:00",
      "due_on": "2021-05-05",
      "expected_on": null,
      "issued_on": "2021-05-05",
      "delivery_method": null,
      "reference": "10928",
      "send_on": null,
      "status": "ready_to_send",
      "status_changed_at": "2021-05-05T03:51:03.905707+00:00",
      "links": {
        "self": "https://api.sandbox.routable.com/v1/payables/b83c71cd-9121-4a17-a3f9-6b2c4d9ff733"
      },
      "type": "vendor_choice",
      "pay_to_company": {
        "object": "Company",
        "id": "77b898d7-0aa8-4b13-8ce3-97f9c67e3a6b",
        "display_name": "Joes Burgers",
        "links": {
          "self": "https://api.sandbox.routable.com/v1/companies/77b898d7-0aa8-4b13-8ce3-97f9c67e3a6b",
          "contacts": "https://api.sandbox.routable.com/v1/companies/77b898d7-0aa8-4b13-8ce3-97f9c67e3a6b/contacts",
          "payment_methods": "https://api.sandbox.routable.com/v1/companies/77b898d7-0aa8-4b13-8ce3-97f9c67e3a6b/payment-methods",
          "payables": "https://api.sandbox.routable.com/v1/payables?company=77b898d7-0aa8-4b13-8ce3-97f9c67e3a6b"
        }
      },
      "withdraw_from_account": {
        "object": "Account",
        "id": "01c4039a-644a-4f60-9085-23890208336e",
        "type": "bank",
        "type_details": {
          "account_number": "100000001234",
          "account_type": "checking",
          "institution_name": "Silicon Valley Bank",
          "routing_number": "121140399"
        },
        "links": {
          "self": "https://api.sandbox.routable.com/v1/settings/accounts/01c4039a-644a-4f60-9085-23890208336e"
        }
      }
    },
    {
      "object": "Payable",
      "id": "4fbcf06f-0849-453c-9910-124786d237b0",
      "amount": "22.40",
      "amount_due": "22.40",
      "amount_paid": "0.00",
      "created_at": "2021-05-05T03:49:53.299680+00:00",
      "bill_number": "1887",
      "due_on": "2021-05-05",
      "expected_on": null,
      "issued_on": "2021-05-05",
      "delivery_method": "check_standard",
      "reference": "2440",
      "send_on": "2021-05-05",
      "status": "scheduled",
      "status_changed_at": "2021-05-05T03:49:53.299680+00:00",
      "links": {
        "self": "https://api.sandbox.routable.com/v1/payables/4fbcf06f-0849-453c-9910-124786d237b0"
      },
      "type": "check",
      "pay_to_company": {
        "object": "Company",
        "id": "daef7925-2e07-4700-bddd-510f46743e35",
        "display_name": "Vance Refrigeration",
        "links": {
          "self": "https://api.sandbox.routable.com/v1/companies/daef7925-2e07-4700-bddd-510f46743e35",
          "contacts": "https://api.sandbox.routable.com/v1/companies/daef7925-2e07-4700-bddd-510f46743e35/contacts",
          "payment_methods": "https://api.sandbox.routable.com/v1/companies/daef7925-2e07-4700-bddd-510f46743e35/payment-methods",
          "payables": "https://api.sandbox.routable.com/v1/payables?company=daef7925-2e07-4700-bddd-510f46743e35"
        }
      },
      "withdraw_from_account": {
        "object": "Account",
        "id": "01c4039a-644a-4f60-9085-23890208336e",
        "type": "bank",
        "type_details": {
          "account_number": "100000001234",
          "account_type": "checking",
          "institution_name": "Silicon Valley Bank",
          "routing_number": "121140399"
        },
        "links": {
          "self": "https://api.sandbox.routable.com/v1/settings/accounts/01c4039a-644a-4f60-9085-23890208336e"
        }
      }
    },
    {
      "object": "Payable",
      "id": "2ac3b429-9f5b-4b69-a21d-a86792636bab",
      "amount": "233.38",
      "amount_due": "0.00",
      "amount_paid": "233.38",
      "created_at": "2021-05-05T03:53:02.867591+00:00",
      "bill_number": "1337",
      "due_on": "2021-05-05",
      "expected_on": "2021-05-05",
      "issued_on": "2021-05-05",
      "delivery_method": "ach_same_day",
      "reference": "1991",
      "send_on": null,
      "status": "completed",
      "status_changed_at": "2021-05-05T03:53:02.867591+00:00",
      "links": {
        "self": "https://api.sandbox.routable.com/v1/payables/2ac3b429-9f5b-4b69-a21d-a86792636bab"
      },
      "type": "ach",
      "pay_to_company": {
        "object": "Company",
        "id": "daef7925-2e07-4700-bddd-510f46743e35",
        "display_name": "Vance Refrigeration",
        "links": {
          "self": "https://api.sandbox.routable.com/v1/companies/daef7925-2e07-4700-bddd-510f46743e35",
          "contacts": "https://api.sandbox.routable.com/v1/companies/daef7925-2e07-4700-bddd-510f46743e35/contacts",
          "payment_methods": "https://api.sandbox.routable.com/v1/companies/daef7925-2e07-4700-bddd-510f46743e35/payment-methods",
          "payables": "https://api.sandbox.routable.com/v1/payables?company=daef7925-2e07-4700-bddd-510f46743e35"
        }
      },
      "withdraw_from_account": {
        "object": "Account",
        "id": "01c4039a-644a-4f60-9085-23890208336e",
        "type": "bank",
        "type_details": {
          "account_number": "100000001234",
          "account_type": "checking",
          "institution_name": "Silicon Valley Bank",
          "routing_number": "121140399"
        },
        "links": {
          "self": "https://api.sandbox.routable.com/v1/settings/accounts/01c4039a-644a-4f60-9085-23890208336e"
        }
      }
    }
  ]
}

Each Payable in the List you receive will look very much like a Payable returned from the Create a Payable endpoint.

Of particular note is the links object in the root response. Note that we support pagination in the list endpoint. You may use the page and page_size parameters to specify the page number and page size requested, respectively. The next and prev fields are links to an API call that will return the next and previous pages of this same query, if that page exists.

Advanced filtering and sorting

You can filter and sort Payables using this endpoint as well. For a full list of filter and sorting options, see the documentation for the List Payables endpoint.


Did this page help you?