-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update deposits REST API docs with decoupled deposit changes #7848
Update deposits REST API docs with decoupled deposit changes #7848
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.27 MB ℹ️ View Unchanged
|
introduced in #7828
Thanks @shendy-a8c – updated 7.0.0 → 7.1.0 in dc9227b. Changes visible on docs preview here. |
To update this PR's progress: I'll be:
|
I've validated the docs against the production server deployment of decouple deposits API changes. I've removed the deprecated fields and values as per the discussion above. See preview here. Ready for re-review. |
@@ -481,7 +413,7 @@ Fetches a deposit by ID. | |||
|
|||
If a deposit is found for the provided ID, the response will return a [**Deposit**](#deposit-object) object. | |||
|
|||
If no deposit is found for the provided ID, the response will be an empty array. | |||
If no deposit is found for the provided ID, the response will return a `500` status code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: The HTTP response code was changed to 404
on the server, the client still responds with 500
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting … I like the idea that we work towards no 500 errors from any of our APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh this came up in #4342 which implemented the server returning 404
, only for client to swap it to a 500
.
For now, the docs should reflect the current state of the REST API but we can open a new issue to ensure 404
's are passed through to client REST API responses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, yea I'm thinking long term here. Also might be a cool way into more monitoring of our APIs – e.g. monitoring can tell us when we return 500, we can work toward no 500s (maybe in API paths that we own).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed test site and removals. 👍
Suggestions have been applied – relevant fields have been removed from the docs.
Docs deployed to https://automattic.github.io/woocommerce-payments/#deposits, workflow https://github.com/Automattic/woocommerce-payments/actions/runs/7661809270 was automatically triggered. |
Co-authored-by: Shendy <[email protected]>
Fixes #7847
Changes proposed in this Pull Request
This PR updates the deposits REST API documentation to reflect the "decoupled deposits" changes deployed on Jan 23 2024 in server PR 4500.
Note
I've uploaded a preview of this PR's version of the docs here.
GET deposits/overview-all
deposit.next_scheduled
is no longer returned.balance.pending[].deposits_count
is no longer returned.balance.instant[].transaction_ids
is no longer returned.GET deposits/overview
next_deposit
is no longer returned.balance.pending.deposits_count
is no longer returned.instant_balance.transaction_ids
is no longer returned.GET deposits
estimated
deposits are no longer returned.status_is
andstatus_not_is
filter params no longer filter byestimated
.GET deposits/summary
estimated
deposits are no longer returned.status_is
andstatus_not_is
filter params no longer filter byestimated
.GET deposits/(?P<deposit_id>\w+)
estimated
deposits are no longer returned, will return status404
in this case.POST deposits
transaction_ids
property is deprecated.currency
property.POST deposits/download
estimated
deposits are no longer included in CSV export.status_is
andstatus_not_is
filter params no longer filter byestimated
.See project thread: paJDYF-aY6-p2
See discussion on removing estimated deposits: paJDYF-bD7-p2
Testing instructions
cd docs/rest-api
./build.sh
to build the docs via a Docker container.npx serve build
to serve the built HTML atlocalhost:3000
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge