REST API around subtransactions and payments
Opened this issue · 1 comments
Discussed in #719
Originally posted by wwahammy September 7, 2021
I'm looking into developing the REST API around subtransactions and payments. As implemented in #684, you can list the transactions for a nonprofit by calling:
GET /api/nonprofits/:nonprofit_id/transactions
Or you can get the information about a specific transaction by calling
GET /api/nonprofits/:nonprofit_id/transactions/:id
How should we get subtransactions though? Or payments?
Proposal
To get the subtransactions for a transaction:
GET /api/nonprofits/:nonprofit_id/transactions/:transaction_id/subtransaction
To get all payments for a subtransaction:
GET /api/nonprofits/:nonprofit_id/transactions/:transaction_id/subtransaction/payments
To get a payment on a subtransaction:
GET /api/nonprofits/:nonprofit_id/transactions/:transaction_id/subtransaction/payments/:id
**NOTE: this is the canonical URL for a payment.
To get all payments on a transaction:
GET /api/nonprofits/:nonprofit_id/transactions/:transaction_id/payments
NOTE: the urls in the JSON will display the canoncial URLs.
To get a payment on a transaction:
GET /api/nonprofits/:nonprofit_id/transactions/:transaction_id/payments/:id
NOTE: the url in the JSON will display the canonical URL for the payment, NOT this URL
What do folks think? Does this make sense? @clarissalimab?
I edited this because I remembered: you can't have multiple subtransactions on a transaction, only one.