From cf0f973c8a08a7d37e74202535d42bb91f95fde5 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:05:12 +1000 Subject: [PATCH 01/48] Add Deposits overview all docs --- .gitignore | 3 + .../source/includes/wp-api-v3/deposits.md | 154 ++++++++++++++++++ docs/rest-api/source/index.html.md | 1 + 3 files changed, 158 insertions(+) create mode 100644 docs/rest-api/source/includes/wp-api-v3/deposits.md diff --git a/.gitignore b/.gitignore index 9749d5a27ba..4aabb410301 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,6 @@ tests/e2e/screenshots # E2E Performance test results tests/e2e/reports + +# Slate docs +docs/rest-api/build/* diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md new file mode 100644 index 00000000000..541219e1f0e --- /dev/null +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -0,0 +1,154 @@ +# Deposits + +The Deposits API endpoints provide access to an account's deposits data, including an overview of account balances, deposit schedule and deposit history. + +## Deposit overview for all account deposit currencies + +Fetch an overview of account deposits for all deposit currencies. This includes details for the last paid deposit, next scheduled deposit, and last manual deposits. + +### HTTP request + +
+
+ GET +
/wp-json/wc/v3/payments/deposits/overview-all
+
+
+ +### Returns + +- `deposit` _object_ + - `last_paid` _array_ - The last deposit that has been paid for each deposit currency. + - `next_scheduled` _array_ - The next scheduled deposit for each deposit currency. + - `last_manual_deposits` _array_ - Manual deposits that have been paid in the last 24 hours. +- `balance` _object_ + - `pending` _array_ - The pending balance for each deposit currency. + - `available` _array_ - The available balance for each deposit currency. + - `instant` _array_ - The instant balance for each deposit currency. +- `account` _object_ + - `deposits_enabled` _bool_ - Whether deposits are enabled for the account. + - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. + - `deposits_schedule` _object_ + - `delay_days` _int_ - The number of days after a charge is created that the payment is paid out. + - `interval` _string_ - The interval at which payments are paid out. `manual` `daily` `weekly` `monthly` + - `weekly_anchor` _string_ - The day of the week that payments are paid out, e.g. `monday`. + - `monthly_anchor` _int_ - The day of the month that payments are paid out. Specified as a number between 1–31. 29-31 will instead use the last day of a shorter month. + - `default_currency` _string_ - The default currency for the account. + +```shell +curl -X POST https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ + -u consumer_key:consumer_secret +``` + +> JSON response example: + +```json +{ + "deposit": { + "last_paid": [ + { + "id": "po_1OJ466CBu6Jj8nBr38JRxdNE", + "date": 1701648000000, + "type": "deposit", + "amount": 802872, + "status": "paid", + "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", + "currency": "eur", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1701648000 + }, + { + "id": "po_1OHylNCBu6Jj8nBr95tE8scS", + "date": 1701302400000, + "type": "deposit", + "amount": 471784, + "status": "paid", + "bankAccount": "STRIPE TEST BANK •••• 6789 (USD)", + "currency": "usd", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1701302400 + } + ], + "next_scheduled": [ + { + "id": "wcpay_estimated_weekly_eur_1702598400", + "date": 1702598400000, + "type": "deposit", + "amount": 458784, + "status": "estimated", + "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", + "currency": "eur", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1702598400 + }, + { + "id": "wcpay_estimated_weekly_usd_1701993600", + "date": 1701993600000, + "type": "deposit", + "amount": 823789, + "status": "estimated", + "bankAccount": "STRIPE TEST BANK •••• 6789 (USD)", + "currency": "usd", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1701993600 + } + ], + "last_manual_deposits": [] + }, + "balance": { + "pending": [ + { + "amount": -114696, + "currency": "eur", + "source_types": { + "card": -114696 + }, + "deposits_count": 1 + }, + { + "amount": 707676, + "currency": "usd", + "source_types": { + "card": 707676 + }, + "deposits_count": 2 + } + ], + "available": [ + { + "amount": 573480, + "currency": "eur", + "source_types": { + "card": 573480 + } + }, + { + "amount": 587897, + "currency": "usd", + "source_types": { + "card": 587897 + } + } + ], + "instant": [] + }, + "account": { + "deposits_enabled": true, + "deposits_blocked": false, + "deposits_schedule": { + "delay_days": 7, + "interval": "weekly", + "weekly_anchor": "friday" + }, + "default_currency": "eur" + } +} +``` diff --git a/docs/rest-api/source/index.html.md b/docs/rest-api/source/index.html.md index 33ed0f81641..d4ad854df8a 100644 --- a/docs/rest-api/source/index.html.md +++ b/docs/rest-api/source/index.html.md @@ -17,6 +17,7 @@ includes: - wp-api-v3/customer - wp-api-v3/intent - wp-api-v3/reports + - wp-api-v3/deposits search: false --- From cc62461292519e30aab105fb34b24844ab489528 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:14:23 +1000 Subject: [PATCH 02/48] Add `/deposits/overview` docs --- .../source/includes/wp-api-v3/deposits.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 541219e1f0e..cb2bf890f2a 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -152,3 +152,100 @@ curl -X POST https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ } } ``` + +## Deposit overview for single account deposit currency + +Fetch an overview of account deposits for a single deposit currency. This includes details for the last paid deposit, next scheduled deposit, and last manual deposits. + +### HTTP request + +
+
+ GET +
/wp-json/wc/v3/payments/deposits/overview
+
+
+ +### Returns + +- `last_deposit` _object_|_null_- The last deposit that has been paid for the deposit currency. +- `next_deposit` _object_|_null_ - The next scheduled deposit for the deposit currency. +- `balance` _object_ + - `pending` _object_ - The pending balance for the deposit currency. + - `available` _object_ - The available balance for the deposit currency. +- `instant_balance` _object_|_null_ - The instant balance for the deposit currency. +- `account` _object_ + - `deposits_disabled` _bool_ - Whether deposits are enabled for the account. + - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. + - `deposits_schedule` _object_ + - `delay_days` _int_ - The number of days after a charge is created that the payment is paid out. + - `interval` _string_ - The interval at which payments are paid out. `manual` `daily` `weekly` `monthly` + - `weekly_anchor` _string_ - The day of the week that payments are paid out, e.g. `monday`. + - `monthly_anchor` _int_ - The day of the month that payments are paid out. Specified as a number between 1–31. 29-31 will instead use the last day of a shorter month. +- `default_currency` _string_ - The default currency for the account. + +```shell +curl -X POST https://example.com/wp-json/wc/v3/payments/deposits/overview \ + -u consumer_key:consumer_secret +``` + +> JSON response example: + +```json +{ + "last_deposit": { + "id": "po_1OJ466CBu6Jj8nBr38JRxdNE", + "date": 1701648000000, + "type": "deposit", + "amount": 802872, + "status": "paid", + "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", + "currency": "eur", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1701648000 + }, + "next_deposit": { + "id": "wcpay_estimated_weekly_eur_1702598400", + "date": 1702598400000, + "type": "deposit", + "amount": 458784, + "status": "estimated", + "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", + "currency": "eur", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1702598400 + }, + "balance": { + "available": { + "amount": 573480, + "currency": "eur", + "source_types": { + "card": 573480 + } + }, + "pending": { + "amount": -114696, + "currency": "eur", + "source_types": { + "card": -114696 + }, + "deposits_count": 1 + } + }, + "instant_balance": null, + "account": { + "deposits_disabled": false, + "deposits_blocked": false, + "deposits_schedule": { + "delay_days": 7, + "interval": "weekly", + "weekly_anchor": "friday" + }, + "default_currency": "eur" + } +} +``` From b76e9d37492ae7ba3a1e504851febb5582d8eb65 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:28:07 +1000 Subject: [PATCH 03/48] Add GET `/deposits` docs --- .../source/includes/wp-api-v3/deposits.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index cb2bf890f2a..36e93c66970 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -249,3 +249,106 @@ curl -X POST https://example.com/wp-json/wc/v3/payments/deposits/overview \ } } ``` + +## List deposits + +Fetch a list of deposits. + +### HTTP request + +
+
+ GET +
/wp-json/wc/v3/payments/deposits
+
+
+ +### Required parameters + +- `sort` _string_ - Field on which to sort, e.g. `date` + +### Optional parameters + +- `match` _string_ +- `store_currency_is` _string_ +- `date_before` _string_ +- `date_after` _string_ +- `date_between` _array_ +- `status_is` _string_ +- `status_is_not` _string_ +- `sort` _string_ +- `direction` _string_ +- `page` _integer_ +- `pagesize` _integer_ + +### Returns + +- `data` _array_ - List of deposit objects. + - `id` _string_ - The deposit ID. + - `date` _int_ - The date the deposit was paid in unix timestamp format. + - `type` _string_ - The type of deposit. `deposit` `withdrawal` + - `amount` _int_ - The amount of the deposit. + - `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` `estimated` + - `bankAccount` _string_ - The bank account the deposit was paid to. + - `currency` _string_ - The currency of the deposit. E.g. `eur` + - `automatic` _bool_ - Whether the deposit was paid automatically. + - `fee` _int_ - The fee amount of the deposit. + - `fee_percentage` _int_ - The fee percentage of the deposit. + - `created` _int_ - The date the deposit was created in unix timestamp format. +- `total_count` _int_ - The total number of deposits matching the query. + +```shell +curl -X POST https://example.com/wp-json/wc/v3/payments/deposits?sort=date \ + -u consumer_key:consumer_secret +``` + +> JSON response example: + +```json +{ + "data": [ + { + "id": "wcpay_estimated_weekly_eur_1702598400", + "date": 1702598400000, + "type": "deposit", + "amount": 458784, + "status": "estimated", + "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", + "currency": "eur", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1702598400 + }, + { + "id": "po_1OJ466CBu6Jj8nBr38JRxdNE", + "date": 1701648000000, + "type": "deposit", + "amount": 802872, + "status": "paid", + "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", + "currency": "eur", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1701648000 + }, + { + "id": "po_1OHylNCBu6Jj8nBr95tE8scS", + "date": 1701302400000, + "type": "deposit", + "amount": 471784, + "status": "paid", + "bankAccount": "STRIPE TEST BANK •••• 6789 (USD)", + "currency": "usd", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1701302400 + } + ], + "total_count": 3 +} +``` + +/wp-json/wc/v3/payments/deposits/overview-all From df00b61075272d4cccf4c463f46cd43e4adeb825 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:42:06 +1000 Subject: [PATCH 04/48] Add changelog entry --- changelog/fix-7839-deposits-rest-api-docs | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/fix-7839-deposits-rest-api-docs diff --git a/changelog/fix-7839-deposits-rest-api-docs b/changelog/fix-7839-deposits-rest-api-docs new file mode 100644 index 00000000000..b50f1644a81 --- /dev/null +++ b/changelog/fix-7839-deposits-rest-api-docs @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Added documentation for deposits REST API endpoints. From ef008fa843ca3a66128d6970fc44678a4ea8d01b Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:58:48 +1000 Subject: [PATCH 05/48] Fix incorrect POST in cURL command examples --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 36e93c66970..acee42a6dcf 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -36,7 +36,7 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `default_currency` _string_ - The default currency for the account. ```shell -curl -X POST https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ +curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ -u consumer_key:consumer_secret ``` @@ -185,7 +185,7 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `default_currency` _string_ - The default currency for the account. ```shell -curl -X POST https://example.com/wp-json/wc/v3/payments/deposits/overview \ +curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ -u consumer_key:consumer_secret ``` @@ -298,7 +298,7 @@ Fetch a list of deposits. - `total_count` _int_ - The total number of deposits matching the query. ```shell -curl -X POST https://example.com/wp-json/wc/v3/payments/deposits?sort=date \ +curl -X GET https://example.com/wp-json/wc/v3/payments/deposits?sort=date \ -u consumer_key:consumer_secret ``` From ae0266fb259c9b7446bfd8343c81635e72c9a6f2 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:09:49 +1000 Subject: [PATCH 06/48] Add GET `/deposits/summary` docs --- .../source/includes/wp-api-v3/deposits.md | 53 +++++++++++++++++-- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index acee42a6dcf..d900575d3c9 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -274,9 +274,8 @@ Fetch a list of deposits. - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ -- `status_is_not` _string_ -- `sort` _string_ +- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` `estimated` +- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` `estimated` - `direction` _string_ - `page` _integer_ - `pagesize` _integer_ @@ -351,4 +350,50 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits?sort=date \ } ``` -/wp-json/wc/v3/payments/deposits/overview-all +## List deposits summary + +Fetches a summary of deposits matching the query. This includes the total number of deposits matching the query and a list of deposits. + +Useful in combination with the **List deposits** endpoint to get a summary of deposits matching the query without having to fetch the full list of deposits. + +### HTTP request + +
+
+ GET +
/wp-json/wc/v3/payments/deposits/summary
+
+
+ +### Optional parameters + +- `match` _string_ +- `store_currency_is` _string_ +- `date_before` _string_ +- `date_after` _string_ +- `date_between` _array_ +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` `estimated` +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` `estimated` + +### Returns + +- `count` _int_ - The total number of deposits matching the query. +- `store_currencies` _array_ - The currencies of the deposits matching the query. +- `total` _int_ - The total amount of the deposits matching the query. +- `currency` _string_ - The currency as provided by `store_currency_is` or the default currency of the account. + +```shell +curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/summary \ + -u consumer_key:consumer_secret +``` + +> JSON response example: + +```json +{ + "count": 42, + "store_currencies": [ "chf", "eur", "gbp", "nok", "sek", "usd", "dkk" ], + "total": 5744395, + "currency": "eur" +} +``` From 66d1f229650d7f2b70e64d3c2c6cee342afc30e1 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:21:00 +1000 Subject: [PATCH 07/48] Add GET `/deposits/{deposit_id}` docs --- .../source/includes/wp-api-v3/deposits.md | 52 ++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index d900575d3c9..fcad82451d3 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -350,7 +350,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits?sort=date \ } ``` -## List deposits summary +## Get deposits summary Fetches a summary of deposits matching the query. This includes the total number of deposits matching the query and a list of deposits. @@ -397,3 +397,53 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/summary \ "currency": "eur" } ``` + +## Get deposit + +Fetches a deposit by ID. + +### HTTP request + +
+
+ GET +
/wp-json/wc/v3/payments/deposits/{deposit_id}
+
+
+ +### Returns + +- `id` _string_ - The deposit ID. +- `date` _int_ - The date the deposit was paid in unix timestamp format. +- `type` _string_ - The type of deposit. `deposit` `withdrawal` +- `amount` _int_ - The amount of the deposit. +- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` `estimated` +- `bankAccount` _string_ - The bank account the deposit was paid to. +- `currency` _string_ - The currency of the deposit. E.g. `eur` +- `automatic` _bool_ - Whether the deposit was paid automatically. +- `fee` _int_ - The fee amount of the deposit. +- `fee_percentage` _int_ - The fee percentage of the deposit. +- `created` _int_ - The date the deposit was created in unix timestamp format. + +```shell +curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/po_123abc \ + -u consumer_key:consumer_secret +``` + +> JSON response example: + +```json +{ + "id": "po_1OGAFOCBu6Jj8nBruJbMbGqD", + "date": 1701043200000, + "type": "deposit", + "amount": 114696, + "status": "paid", + "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", + "currency": "eur", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1701043200 +} +``` From b5f56a8dd3aa333aae0a83201a6a2a54ee7e6ab8 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:57:29 +1000 Subject: [PATCH 08/48] Add POST `/deposits` docs --- .../source/includes/wp-api-v3/deposits.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index fcad82451d3..b7ec8182e79 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -447,3 +447,33 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/po_123abc \ "created": 1701043200 } ``` + +## Submit an instant deposit + +Submit an instant deposit for a list of transactions. Only for eligible accounts. See [Instant Deposits with WooPayments](https://woo.com/document/woopayments/deposits/instant-deposits/) for more information. + +### HTTP request + +
+
+ POST +
/wp-json/wc/v3/payments/deposits
+
+
+ +### Required body properties + +- `type`: _string_ - The type of deposit. `instant` +- `transaction_ids`: _array_ - The list of transaction IDs to deposit. + +```shell +curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ + -u consumer_key:consumer_secret + --data '{ + "type": "instant", + "transaction_ids": [ + "txn_3OHyIxCIHGKp1UAi0aVyDQ5D", + "txn_3OJSuOCIHGKp1UAi1mRA2lL5" + ] + }' +``` From 9b62e9d30eaa06accfde9604b1f308e3053a6ecd Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:03:38 +1000 Subject: [PATCH 09/48] Add slate docs readme --- docs/rest-api/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/rest-api/README.md diff --git a/docs/rest-api/README.md b/docs/rest-api/README.md new file mode 100644 index 00000000000..1296a86b062 --- /dev/null +++ b/docs/rest-api/README.md @@ -0,0 +1,12 @@ +# REST API Docs + +- Generated by [Slate](https://github.com/slatedocs/slate). +- Published via the [`deploy-api-docs.yml` GH action](https://github.com/Automattic/woocommerce-payments/actions/workflows/deploy-api-docs.yml) to https://automattic.github.io/woocommerce-payments/ once merged to `develop`. + +### Local development + +- Requires Docker and Node.js. +- `cd docs/rest-api` to change to this directory. +- `./build.sh` to build the docs via a Docker container. +- `npx serve build` to serve the built HTML at `localhost:3000`. +- `npx nodemon -w ./source -e "md" --exec ./build.sh` to watch and rebuild the docs on change. From ba1094ede25b42560f2155f4c4b6e067f464b61a Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:22:49 +1000 Subject: [PATCH 10/48] Add POST `/deposits/download` docs --- .../source/includes/wp-api-v3/deposits.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index b7ec8182e79..36a3a27c676 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -477,3 +477,50 @@ curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ ] }' ``` + +## Request a CSV export of deposits + +Request a CSV export of deposits matching the query. A link to the exported CSV will be emailed to the provided email address or the account's primary email address if no email address is provided. + +### HTTP request + +
+
+ POST +
/wp-json/wc/v3/payments/deposits/download
+
+
+ +### Optional body properties + +- `user_email`: _string_ - The email address to send the CSV export link to. If not provided, the account's primary email address will be used. + +### Optional parameters + +- `match` _string_ +- `store_currency_is` _string_ +- `date_before` _string_ +- `date_after` _string_ +- `date_between` _array_ +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` `estimated` +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` `estimated` + +### Returns + +- `exported_deposits` _int_ - The number of deposits exported. + +```shell +curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits/download?status_is=paid' \ + -u consumer_key:consumer_secret + --data '{ + "user_email": "name@example.woo.com", + }' +``` + +> JSON response example: + +```json +{ + "exported_deposits": 42 +} +``` From e1cb5bbffa013f3995e2e39ae570d1dd36df4eb8 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:32:00 +1000 Subject: [PATCH 11/48] Use consistent naming for titles --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 36a3a27c676..acd390459cd 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -2,7 +2,7 @@ The Deposits API endpoints provide access to an account's deposits data, including an overview of account balances, deposit schedule and deposit history. -## Deposit overview for all account deposit currencies +## Get deposits overview for all account deposit currencies Fetch an overview of account deposits for all deposit currencies. This includes details for the last paid deposit, next scheduled deposit, and last manual deposits. @@ -153,7 +153,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ } ``` -## Deposit overview for single account deposit currency +## Get deposits overview for single account deposit currency Fetch an overview of account deposits for a single deposit currency. This includes details for the last paid deposit, next scheduled deposit, and last manual deposits. From 35e79370763e65f9561163c6b38de5c94d0e3e14 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:37:20 +1000 Subject: [PATCH 12/48] Expand overview-all balances response --- .../source/includes/wp-api-v3/deposits.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index acd390459cd..ff939f13c11 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -23,8 +23,21 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `last_manual_deposits` _array_ - Manual deposits that have been paid in the last 24 hours. - `balance` _object_ - `pending` _array_ - The pending balance for each deposit currency. + - `amount` _int_ - The amount of the balance. + - `currency` _string_ - The currency of the balance. E.g. `usd`. + - `source_types` _object_ - The amount of the balance from each source type, e.g. `card` or `financing`. + - `deposits_count` _int_ - The number of deposits that make up the balance. - `available` _array_ - The available balance for each deposit currency. + - `amount` _int_ - The amount of the balance. + - `currency` _string_ - The currency of the balance. E.g. `usd`. + - `source_types` _object_ - The amount of the balance from each source type, e.g. `card` or `financing`. - `instant` _array_ - The instant balance for each deposit currency. + - `amount` _int_ - The amount of the balance. + - `currency` _string_ - The currency of the balance. E.g. `usd`. + - `fee` _int_ - The fee amount of the balance. + - `fee_percentage` _int_ - The fee percentage of the balance. + - `net` _int_ - The net amount of the balance. + - `transaction_ids` _array_ - The list of transaction IDs that make up the balance. - `account` _object_ - `deposits_enabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. @@ -138,7 +151,19 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ } } ], - "instant": [] + "instant": [ + { + "amount": 12345, + "currency": "usd", + "fee": 185, + "fee_percentage": 1.5, + "net": 0, + "transaction_ids": [ + "txn_3OHyIxCIHGKp1UAi0aVyDQ5D", + "txn_3OJSuOCIHGKp1UAi1mRA2lL5" + ] + } + ] }, "account": { "deposits_enabled": true, From 44703f93923ef4901d3021fe9eab14d05bfc8157 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:41:08 +1000 Subject: [PATCH 13/48] Expand overview balances response --- .../source/includes/wp-api-v3/deposits.md | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index ff939f13c11..b4cdd5ac734 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -197,8 +197,21 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `next_deposit` _object_|_null_ - The next scheduled deposit for the deposit currency. - `balance` _object_ - `pending` _object_ - The pending balance for the deposit currency. + - `amount` _int_ - The amount of the balance. + - `currency` _string_ - The currency of the balance. E.g. `usd`. + - `source_types` _object_ - The amount of the balance from each source type, e.g. `card` or `financing`. + - `deposits_count` _int_ - The number of deposits that make up the balance. - `available` _object_ - The available balance for the deposit currency. + - `amount` _int_ - The amount of the balance. + - `currency` _string_ - The currency of the balance. E.g. `usd`. + - `source_types` _object_ - The amount of the balance from each source type, e.g. `card` or `financing`. - `instant_balance` _object_|_null_ - The instant balance for the deposit currency. + - `amount` _int_ - The amount of the balance. + - `currency` _string_ - The currency of the balance. E.g. `usd`. + - `fee` _int_ - The fee amount of the balance. + - `fee_percentage` _int_ - The fee percentage of the balance. + - `net` _int_ - The net amount of the balance. + - `transaction_ids` _array_ - The list of transaction IDs that make up the balance. - `account` _object_ - `deposits_disabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. @@ -261,7 +274,14 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ "deposits_count": 1 } }, - "instant_balance": null, + "instant_balance": { + "amount": 0, + "currency": "usd", + "fee": 0, + "fee_percentage": 1.5, + "net": 0, + "transaction_ids": [] + }, "account": { "deposits_disabled": false, "deposits_blocked": false, From dcafa7567311d2e957651c6e5adbd2b293c914da Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:44:40 +1000 Subject: [PATCH 14/48] Show monthly/weekly anchors as potentially undefined --- .../rest-api/source/includes/wp-api-v3/deposits.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index b4cdd5ac734..06d66cc7c3a 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -44,8 +44,8 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `deposits_schedule` _object_ - `delay_days` _int_ - The number of days after a charge is created that the payment is paid out. - `interval` _string_ - The interval at which payments are paid out. `manual` `daily` `weekly` `monthly` - - `weekly_anchor` _string_ - The day of the week that payments are paid out, e.g. `monday`. - - `monthly_anchor` _int_ - The day of the month that payments are paid out. Specified as a number between 1–31. 29-31 will instead use the last day of a shorter month. + - `weekly_anchor` _string_ | _undefined_ - The day of the week that payments are paid out, e.g. `monday`. + - `monthly_anchor` _int_ | _undefined_ - The day of the month that payments are paid out. Specified as a number between 1–31. 29-31 will instead use the last day of a shorter month. - `default_currency` _string_ - The default currency for the account. ```shell @@ -193,8 +193,8 @@ Fetch an overview of account deposits for a single deposit currency. This includ ### Returns -- `last_deposit` _object_|_null_- The last deposit that has been paid for the deposit currency. -- `next_deposit` _object_|_null_ - The next scheduled deposit for the deposit currency. +- `last_deposit` _object_ | _null_- The last deposit that has been paid for the deposit currency. +- `next_deposit` _object_ | _null_ - The next scheduled deposit for the deposit currency. - `balance` _object_ - `pending` _object_ - The pending balance for the deposit currency. - `amount` _int_ - The amount of the balance. @@ -205,7 +205,7 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - `source_types` _object_ - The amount of the balance from each source type, e.g. `card` or `financing`. -- `instant_balance` _object_|_null_ - The instant balance for the deposit currency. +- `instant_balance` _object_ | _null_ - The instant balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - `fee` _int_ - The fee amount of the balance. @@ -218,8 +218,8 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `deposits_schedule` _object_ - `delay_days` _int_ - The number of days after a charge is created that the payment is paid out. - `interval` _string_ - The interval at which payments are paid out. `manual` `daily` `weekly` `monthly` - - `weekly_anchor` _string_ - The day of the week that payments are paid out, e.g. `monday`. - - `monthly_anchor` _int_ - The day of the month that payments are paid out. Specified as a number between 1–31. 29-31 will instead use the last day of a shorter month. + - `weekly_anchor` _string_ | _undefined_ - The day of the week that payments are paid out, e.g. `monday`. + - `monthly_anchor` _int_ | _undefined_ - The day of the month that payments are paid out. Specified as a number between 1–31. 29-31 will instead use the last day of a shorter month. - `default_currency` _string_ - The default currency for the account. ```shell From 379d51be272a08cd3e4f68f786915e3dd12aa385 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:46:46 +1000 Subject: [PATCH 15/48] Fix nesting within `overview` return docs --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 06d66cc7c3a..bd042579f62 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -220,7 +220,7 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `interval` _string_ - The interval at which payments are paid out. `manual` `daily` `weekly` `monthly` - `weekly_anchor` _string_ | _undefined_ - The day of the week that payments are paid out, e.g. `monday`. - `monthly_anchor` _int_ | _undefined_ - The day of the month that payments are paid out. Specified as a number between 1–31. 29-31 will instead use the last day of a shorter month. -- `default_currency` _string_ - The default currency for the account. + - `default_currency` _string_ - The default currency for the account. ```shell curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ From 32c4bfd5a698ef0b8326e379b179dc4072bb25d7 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:25:09 +1000 Subject: [PATCH 16/48] Deprecate return values for `/deposits/overview-all` --- .../source/includes/wp-api-v3/deposits.md | 38 ++----------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index bd042579f62..99f574b597a 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -19,7 +19,7 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `deposit` _object_ - `last_paid` _array_ - The last deposit that has been paid for each deposit currency. - - `next_scheduled` _array_ - The next scheduled deposit for each deposit currency. + - ~~`next_scheduled`~~ _array_ ⚠️ - **Deprecated since `7.0.0`, now returns an empty array.** The next scheduled deposit for each deposit currency. - `last_manual_deposits` _array_ - Manual deposits that have been paid in the last 24 hours. - `balance` _object_ - `pending` _array_ - The pending balance for each deposit currency. @@ -37,7 +37,7 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `fee` _int_ - The fee amount of the balance. - `fee_percentage` _int_ - The fee percentage of the balance. - `net` _int_ - The net amount of the balance. - - `transaction_ids` _array_ - The list of transaction IDs that make up the balance. + - ~~`transaction_ids`~~ _array_ - **Deprecated since `7.0.0`, now returns an empty array.** The list of transaction IDs that make up the balance. - `account` _object_ - `deposits_enabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. @@ -86,34 +86,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ "created": 1701302400 } ], - "next_scheduled": [ - { - "id": "wcpay_estimated_weekly_eur_1702598400", - "date": 1702598400000, - "type": "deposit", - "amount": 458784, - "status": "estimated", - "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", - "currency": "eur", - "automatic": true, - "fee": 0, - "fee_percentage": 0, - "created": 1702598400 - }, - { - "id": "wcpay_estimated_weekly_usd_1701993600", - "date": 1701993600000, - "type": "deposit", - "amount": 823789, - "status": "estimated", - "bankAccount": "STRIPE TEST BANK •••• 6789 (USD)", - "currency": "usd", - "automatic": true, - "fee": 0, - "fee_percentage": 0, - "created": 1701993600 - } - ], + "next_scheduled": [], "last_manual_deposits": [] }, "balance": { @@ -158,10 +131,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ "fee": 185, "fee_percentage": 1.5, "net": 0, - "transaction_ids": [ - "txn_3OHyIxCIHGKp1UAi0aVyDQ5D", - "txn_3OJSuOCIHGKp1UAi1mRA2lL5" - ] + "transaction_ids": [] } ] }, From 46b6d39ccd360079df7f7448f13721a81e49709e Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:52:42 +1000 Subject: [PATCH 17/48] Deprecate return values for `/deposits/overview` --- .../source/includes/wp-api-v3/deposits.md | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 99f574b597a..37c95759d85 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -19,7 +19,7 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `deposit` _object_ - `last_paid` _array_ - The last deposit that has been paid for each deposit currency. - - ~~`next_scheduled`~~ _array_ ⚠️ - **Deprecated since `7.0.0`, now returns an empty array.** The next scheduled deposit for each deposit currency. + - ~~`next_scheduled`~~ _array_ - **Deprecated since `7.0.0`, now returns an empty array.** The next scheduled deposit for each deposit currency. - `last_manual_deposits` _array_ - Manual deposits that have been paid in the last 24 hours. - `balance` _object_ - `pending` _array_ - The pending balance for each deposit currency. @@ -164,7 +164,7 @@ Fetch an overview of account deposits for a single deposit currency. This includ ### Returns - `last_deposit` _object_ | _null_- The last deposit that has been paid for the deposit currency. -- `next_deposit` _object_ | _null_ - The next scheduled deposit for the deposit currency. +- ~~`next_deposit`~~ _object_ | _null_ - **Deprecated since `7.0.0`, now returns _null_** - The next scheduled deposit for the deposit currency. - `balance` _object_ - `pending` _object_ - The pending balance for the deposit currency. - `amount` _int_ - The amount of the balance. @@ -181,7 +181,7 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `fee` _int_ - The fee amount of the balance. - `fee_percentage` _int_ - The fee percentage of the balance. - `net` _int_ - The net amount of the balance. - - `transaction_ids` _array_ - The list of transaction IDs that make up the balance. + - ~~`transaction_ids`~~ _array_ - **Deprecated since `7.0.0`, now returns an empty array.** The list of transaction IDs that make up the balance. - `account` _object_ - `deposits_disabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. @@ -214,19 +214,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ "fee_percentage": 0, "created": 1701648000 }, - "next_deposit": { - "id": "wcpay_estimated_weekly_eur_1702598400", - "date": 1702598400000, - "type": "deposit", - "amount": 458784, - "status": "estimated", - "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", - "currency": "eur", - "automatic": true, - "fee": 0, - "fee_percentage": 0, - "created": 1702598400 - }, + "next_deposit": null, "balance": { "available": { "amount": 573480, From 627d5c3eb9fce3c0d3b269c421f2254bb3bc284b Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:58:44 +1000 Subject: [PATCH 18/48] Deprecate return values for GET `/deposits` and `deposits/summary` --- .../source/includes/wp-api-v3/deposits.md | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 37c95759d85..ae20624f9cf 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -257,6 +257,8 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ Fetch a list of deposits. +_Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter._ + ### HTTP request
@@ -277,8 +279,8 @@ Fetch a list of deposits. - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` `estimated` -- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` `estimated` +- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) +- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) - `direction` _string_ - `page` _integer_ - `pagesize` _integer_ @@ -290,7 +292,7 @@ Fetch a list of deposits. - `date` _int_ - The date the deposit was paid in unix timestamp format. - `type` _string_ - The type of deposit. `deposit` `withdrawal` - `amount` _int_ - The amount of the deposit. - - `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` `estimated` + - `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) - `bankAccount` _string_ - The bank account the deposit was paid to. - `currency` _string_ - The currency of the deposit. E.g. `eur` - `automatic` _bool_ - Whether the deposit was paid automatically. @@ -309,19 +311,6 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits?sort=date \ ```json { "data": [ - { - "id": "wcpay_estimated_weekly_eur_1702598400", - "date": 1702598400000, - "type": "deposit", - "amount": 458784, - "status": "estimated", - "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", - "currency": "eur", - "automatic": true, - "fee": 0, - "fee_percentage": 0, - "created": 1702598400 - }, { "id": "po_1OJ466CBu6Jj8nBr38JRxdNE", "date": 1701648000000, @@ -349,7 +338,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits?sort=date \ "created": 1701302400 } ], - "total_count": 3 + "total_count": 2 } ``` @@ -359,6 +348,8 @@ Fetches a summary of deposits matching the query. This includes the total number Useful in combination with the **List deposits** endpoint to get a summary of deposits matching the query without having to fetch the full list of deposits. +_Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter._ + ### HTTP request
@@ -375,8 +366,8 @@ Useful in combination with the **List deposits** endpoint to get a summary of de - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` `estimated` -- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` `estimated` +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) ### Returns From 46b347e3ab6137b63f73122920fb9db5c43ae7a8 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:12:44 +1000 Subject: [PATCH 19/48] Deprecate return values for GET `/deposits/id` --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index ae20624f9cf..98c7dd5feb4 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -396,6 +396,8 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/summary \ Fetches a deposit by ID. +_Since `7.0.0`, `estimated` deposits are no longer returned._ + ### HTTP request
@@ -411,7 +413,7 @@ Fetches a deposit by ID. - `date` _int_ - The date the deposit was paid in unix timestamp format. - `type` _string_ - The type of deposit. `deposit` `withdrawal` - `amount` _int_ - The amount of the deposit. -- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` `estimated` +- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) - `bankAccount` _string_ - The bank account the deposit was paid to. - `currency` _string_ - The currency of the deposit. E.g. `eur` - `automatic` _bool_ - Whether the deposit was paid automatically. From d3d4c16632567df0b4d1d81a4b0995de9e08fe2f Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:13:09 +1000 Subject: [PATCH 20/48] Fix text formatting --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 98c7dd5feb4..1f4bac6a6de 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -279,8 +279,8 @@ _Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a fil - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) -- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) +- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) +- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) - `direction` _string_ - `page` _integer_ - `pagesize` _integer_ @@ -292,7 +292,7 @@ _Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a fil - `date` _int_ - The date the deposit was paid in unix timestamp format. - `type` _string_ - The type of deposit. `deposit` `withdrawal` - `amount` _int_ - The amount of the deposit. - - `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) + - `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) - `bankAccount` _string_ - The bank account the deposit was paid to. - `currency` _string_ - The currency of the deposit. E.g. `eur` - `automatic` _bool_ - Whether the deposit was paid automatically. @@ -366,8 +366,8 @@ _Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a fil - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) -- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) ### Returns @@ -413,7 +413,7 @@ _Since `7.0.0`, `estimated` deposits are no longer returned._ - `date` _int_ - The date the deposit was paid in unix timestamp format. - `type` _string_ - The type of deposit. `deposit` `withdrawal` - `amount` _int_ - The amount of the deposit. -- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`.**) +- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) - `bankAccount` _string_ - The bank account the deposit was paid to. - `currency` _string_ - The currency of the deposit. E.g. `eur` - `automatic` _bool_ - Whether the deposit was paid automatically. From a3724d3f60abbd993e8da07cd85af62a232b2cb3 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:28:45 +1000 Subject: [PATCH 21/48] Update POST `/deposits` docs with new params introduced in #7828 --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 1f4bac6a6de..332f04aec54 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -460,17 +460,15 @@ Submit an instant deposit for a list of transactions. Only for eligible accounts ### Required body properties - `type`: _string_ - The type of deposit. `instant` -- `transaction_ids`: _array_ - The list of transaction IDs to deposit. +- `currency`: _string_ - The currency of the balance to deposit. E.g. `usd` +- ~~`transaction_ids`~~: _array_ - **Deprecated since `7.0.0`, use `currency` instead.** The list of transaction IDs to deposit. ```shell curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ -u consumer_key:consumer_secret --data '{ "type": "instant", - "transaction_ids": [ - "txn_3OHyIxCIHGKp1UAi0aVyDQ5D", - "txn_3OJSuOCIHGKp1UAi1mRA2lL5" - ] + "currency": "usd" }' ``` From 2405ff31d4ab8a5577aa30b36f4efd81df0b965f Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:29:54 +1000 Subject: [PATCH 22/48] Update POST `/deposits/download` docs with deprecated params --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 332f04aec54..62b4b008f13 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -476,6 +476,8 @@ curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ Request a CSV export of deposits matching the query. A link to the exported CSV will be emailed to the provided email address or the account's primary email address if no email address is provided. +_Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter._ + ### HTTP request
@@ -496,8 +498,8 @@ Request a CSV export of deposits matching the query. A link to the exported CSV - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` `estimated` -- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` `estimated` +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) ### Returns @@ -507,7 +509,7 @@ Request a CSV export of deposits matching the query. A link to the exported CSV curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits/download?status_is=paid' \ -u consumer_key:consumer_secret --data '{ - "user_email": "name@example.woo.com", + "user_email": "name@example.woo.com" }' ``` From c50324f1d6898398ff6eab4224cde12fcb54afe2 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:31:58 +1000 Subject: [PATCH 23/48] Tweak formatting --- .../source/includes/wp-api-v3/deposits.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 62b4b008f13..0f93847afa3 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -257,7 +257,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ Fetch a list of deposits. -_Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter._ +Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter. ### HTTP request @@ -279,8 +279,8 @@ _Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a fil - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) -- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) +- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) +- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) - `direction` _string_ - `page` _integer_ - `pagesize` _integer_ @@ -292,7 +292,7 @@ _Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a fil - `date` _int_ - The date the deposit was paid in unix timestamp format. - `type` _string_ - The type of deposit. `deposit` `withdrawal` - `amount` _int_ - The amount of the deposit. - - `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) + - `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) - `bankAccount` _string_ - The bank account the deposit was paid to. - `currency` _string_ - The currency of the deposit. E.g. `eur` - `automatic` _bool_ - Whether the deposit was paid automatically. @@ -348,7 +348,7 @@ Fetches a summary of deposits matching the query. This includes the total number Useful in combination with the **List deposits** endpoint to get a summary of deposits matching the query without having to fetch the full list of deposits. -_Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter._ +Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter. ### HTTP request @@ -366,8 +366,8 @@ _Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a fil - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) -- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) ### Returns @@ -413,7 +413,7 @@ _Since `7.0.0`, `estimated` deposits are no longer returned._ - `date` _int_ - The date the deposit was paid in unix timestamp format. - `type` _string_ - The type of deposit. `deposit` `withdrawal` - `amount` _int_ - The amount of the deposit. -- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) +- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) - `bankAccount` _string_ - The bank account the deposit was paid to. - `currency` _string_ - The currency of the deposit. E.g. `eur` - `automatic` _bool_ - Whether the deposit was paid automatically. @@ -476,7 +476,7 @@ curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ Request a CSV export of deposits matching the query. A link to the exported CSV will be emailed to the provided email address or the account's primary email address if no email address is provided. -_Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter._ +Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter. ### HTTP request @@ -498,8 +498,8 @@ _Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a fil - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) -- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ **deprecated since `7.0.0`**) +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) ### Returns From 55b97a4933e6aaa217f9d2fa3f7c326105c1903a Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:33:06 +1000 Subject: [PATCH 24/48] Update CSV export deprecation comment --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 0f93847afa3..63d7fabb2db 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -476,7 +476,7 @@ curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ Request a CSV export of deposits matching the query. A link to the exported CSV will be emailed to the provided email address or the account's primary email address if no email address is provided. -Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter. +Since `7.0.0`, `estimated` deposits are no longer included in the CSV export or accepted as a filter parameter. ### HTTP request From dc5eaf52d197034732d84565593c62a8aece64b3 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:43:42 +1000 Subject: [PATCH 25/48] Add changelog entry --- .../fix-7847-update-deposits-api-docs-estimated-deposits-rm | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog/fix-7847-update-deposits-api-docs-estimated-deposits-rm diff --git a/changelog/fix-7847-update-deposits-api-docs-estimated-deposits-rm b/changelog/fix-7847-update-deposits-api-docs-estimated-deposits-rm new file mode 100644 index 00000000000..cd0f0e04d8d --- /dev/null +++ b/changelog/fix-7847-update-deposits-api-docs-estimated-deposits-rm @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Update REST API documentation for deposits endpoints with changes to estimated and instant deposits From 02fc498bf99abd3eda3236f9813c788a0b399ff2 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:00:06 +1000 Subject: [PATCH 26/48] Update `transaction_ids` to show `undefined`/no longer present --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 63d7fabb2db..c7a073e2be7 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -37,7 +37,7 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `fee` _int_ - The fee amount of the balance. - `fee_percentage` _int_ - The fee percentage of the balance. - `net` _int_ - The net amount of the balance. - - ~~`transaction_ids`~~ _array_ - **Deprecated since `7.0.0`, now returns an empty array.** The list of transaction IDs that make up the balance. + - ~~`transaction_ids`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** - `account` _object_ - `deposits_enabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. @@ -130,8 +130,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ "currency": "usd", "fee": 185, "fee_percentage": 1.5, - "net": 0, - "transaction_ids": [] + "net": 0 } ] }, @@ -181,7 +180,7 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `fee` _int_ - The fee amount of the balance. - `fee_percentage` _int_ - The fee percentage of the balance. - `net` _int_ - The net amount of the balance. - - ~~`transaction_ids`~~ _array_ - **Deprecated since `7.0.0`, now returns an empty array.** The list of transaction IDs that make up the balance. + - ~~`transaction_ids`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** - `account` _object_ - `deposits_disabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. @@ -237,8 +236,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ "currency": "usd", "fee": 0, "fee_percentage": 1.5, - "net": 0, - "transaction_ids": [] + "net": 0 }, "account": { "deposits_disabled": false, From dac0ba76d3473a46fb632e4f5fe77eda8741da17 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:19:38 +1000 Subject: [PATCH 27/48] Add not found response for GET `/deposits/id` --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index bd042579f62..b7a3fea5014 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -458,6 +458,10 @@ Fetches a deposit by ID. ### Returns +If no deposit is found for the provided ID, the response will be an empty array. + +If a deposit is found for the provided ID, the response will include the following properties: + - `id` _string_ - The deposit ID. - `date` _int_ - The date the deposit was paid in unix timestamp format. - `type` _string_ - The type of deposit. `deposit` `withdrawal` From c4f4244c481742757f4572d516a707a7f9b2fecc Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 12:40:11 +1000 Subject: [PATCH 28/48] No longer return `next_scheduled` --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 38088724adc..7a520692c5f 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -19,7 +19,7 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `deposit` _object_ - `last_paid` _array_ - The last deposit that has been paid for each deposit currency. - - ~~`next_scheduled`~~ _array_ - **Deprecated since `7.0.0`, now returns an empty array.** The next scheduled deposit for each deposit currency. + - ~~`next_scheduled`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** - `last_manual_deposits` _array_ - Manual deposits that have been paid in the last 24 hours. - `balance` _object_ - `pending` _array_ - The pending balance for each deposit currency. @@ -86,7 +86,6 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ "created": 1701302400 } ], - "next_scheduled": [], "last_manual_deposits": [] }, "balance": { From 1a27029b197e9e8deb5c64f6db99df7cdb677def Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 12:41:02 +1000 Subject: [PATCH 29/48] No longer return `next_deposit` --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 7a520692c5f..d2354ddcb66 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -162,7 +162,7 @@ Fetch an overview of account deposits for a single deposit currency. This includ ### Returns - `last_deposit` _object_ | _null_- The last deposit that has been paid for the deposit currency. -- ~~`next_deposit`~~ _object_ | _null_ - **Deprecated since `7.0.0`, now returns _null_** - The next scheduled deposit for the deposit currency. +- ~~`next_deposit`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** - `balance` _object_ - `pending` _object_ - The pending balance for the deposit currency. - `amount` _int_ - The amount of the balance. @@ -212,7 +212,6 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ "fee_percentage": 0, "created": 1701648000 }, - "next_deposit": null, "balance": { "available": { "amount": 573480, From 94551834726f9e803aeb4b2eb316f4851185f620 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 12:42:46 +1000 Subject: [PATCH 30/48] Show `404` response if deposit not found --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index d2354ddcb66..b66cb32d049 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -392,7 +392,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/summary \ Fetches a deposit by ID. -_Since `7.0.0`, `estimated` deposits are no longer returned._ +_Since `7.0.0`, `estimated` deposits are no longer returned and will return a `404` status code._ ### HTTP request @@ -405,7 +405,7 @@ _Since `7.0.0`, `estimated` deposits are no longer returned._ ### Returns -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 `404` status code. If a deposit is found for the provided ID, the response will include the following properties: From 38daf7dca4aa2076603d1401f1ad9f2e8bc1cd8d Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:39:06 +1000 Subject: [PATCH 31/48] Add Deposit object and update deposit overview --- .../source/includes/wp-api-v3/deposits.md | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index b7a3fea5014..10939e85157 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -2,6 +2,22 @@ The Deposits API endpoints provide access to an account's deposits data, including an overview of account balances, deposit schedule and deposit history. +## Deposit object + +### Properties + +- `id` _string_ - The deposit ID. +- `date` _int_ - The arrival date of the deposit in unix timestamp milliseconds. +- `type` _string_ - The type of deposit. `deposit` `withdrawal` +- `amount` _int_ - The amount of the deposit. +- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` `estimated` +- `bankAccount` _string_ - The bank account the deposit was/will be paid to. +- `currency` _string_ - The currency of the deposit. E.g. `eur` +- `automatic` _bool_ - Returns `true` if the payout is created by an automated schedule and `false` if it’s requested manually. +- `fee` _int_ - The fee amount of the deposit. +- `fee_percentage` _int_ - The fee percentage of the deposit. +- `created` _int_ - The arrival date of the deposit in unix timestamp seconds. + ## Get deposits overview for all account deposit currencies Fetch an overview of account deposits for all deposit currencies. This includes details for the last paid deposit, next scheduled deposit, and last manual deposits. @@ -18,9 +34,9 @@ Fetch an overview of account deposits for all deposit currencies. This includes ### Returns - `deposit` _object_ - - `last_paid` _array_ - The last deposit that has been paid for each deposit currency. - - `next_scheduled` _array_ - The next scheduled deposit for each deposit currency. - - `last_manual_deposits` _array_ - Manual deposits that have been paid in the last 24 hours. + - `last_paid` _array_ of [**Deposit**](#deposit-object) - The last deposit that has been paid for each deposit currency. + - `next_scheduled` _array_ of [**Deposit**](#deposit-object) - The next scheduled deposit for each deposit currency. + - `last_manual_deposits` _array_ of [**Deposit**](#deposit-object) - Manual deposits that have been paid in the last 24 hours. - `balance` _object_ - `pending` _array_ - The pending balance for each deposit currency. - `amount` _int_ - The amount of the balance. From d633b2d08ab4e4105a95df7865fc8a0db487276f Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:40:34 +1000 Subject: [PATCH 32/48] Update deposit return types in `deposits/overview` --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 10939e85157..51569f5bf73 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -209,8 +209,8 @@ Fetch an overview of account deposits for a single deposit currency. This includ ### Returns -- `last_deposit` _object_ | _null_- The last deposit that has been paid for the deposit currency. -- `next_deposit` _object_ | _null_ - The next scheduled deposit for the deposit currency. +- `last_deposit` _object_ [**Deposit**](#deposit-object) | _null_- The last deposit that has been paid for the deposit currency. +- `next_deposit` _object_ [**Deposit**](#deposit-object) | _null_ - The next scheduled deposit for the deposit currency. - `balance` _object_ - `pending` _object_ - The pending balance for the deposit currency. - `amount` _int_ - The amount of the balance. From e3f1c7bb634b42cb071f65794fbdc99561836bf9 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:42:24 +1000 Subject: [PATCH 33/48] Add deposit object example --- .../source/includes/wp-api-v3/deposits.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 51569f5bf73..e7c41a012c3 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -4,6 +4,22 @@ The Deposits API endpoints provide access to an account's deposits data, includi ## Deposit object +```json +{ + "id": "po_1OJ466CBu6Jj8nBr38JRxdNE", + "date": 1701648000000, + "type": "deposit", + "amount": 802872, + "status": "paid", + "bankAccount": "STRIPE TEST BANK •••• 3000 (EUR)", + "currency": "eur", + "automatic": true, + "fee": 0, + "fee_percentage": 0, + "created": 1701648000 +} +``` + ### Properties - `id` _string_ - The deposit ID. From fd2924c224b55f04e7c5091e5ca3aa42a060b2e2 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:44:05 +1000 Subject: [PATCH 34/48] Use deposit object return type in list deposits --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index e7c41a012c3..a57ec56c7fe 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -359,18 +359,7 @@ Fetch a list of deposits. ### Returns -- `data` _array_ - List of deposit objects. - - `id` _string_ - The deposit ID. - - `date` _int_ - The date the deposit was paid in unix timestamp format. - - `type` _string_ - The type of deposit. `deposit` `withdrawal` - - `amount` _int_ - The amount of the deposit. - - `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` `estimated` - - `bankAccount` _string_ - The bank account the deposit was paid to. - - `currency` _string_ - The currency of the deposit. E.g. `eur` - - `automatic` _bool_ - Whether the deposit was paid automatically. - - `fee` _int_ - The fee amount of the deposit. - - `fee_percentage` _int_ - The fee percentage of the deposit. - - `created` _int_ - The date the deposit was created in unix timestamp format. +- `data` _array_ of [**Deposit**](#deposit-object) - The list of deposits matching the query. - `total_count` _int_ - The total number of deposits matching the query. ```shell From 8d9a3b5e01e4dd243a75a533dc6ff5fa076c0880 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:45:25 +1000 Subject: [PATCH 35/48] Use deposit object return type in GET single deposit --- .../source/includes/wp-api-v3/deposits.md | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index a57ec56c7fe..b0fae8bfb8d 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -479,21 +479,9 @@ Fetches a deposit by ID. ### Returns -If no deposit is found for the provided ID, the response will be an empty array. - -If a deposit is found for the provided ID, the response will include the following properties: +If a deposit is found for the provided ID, the response will return a [**Deposit**](#deposit-object) object. -- `id` _string_ - The deposit ID. -- `date` _int_ - The date the deposit was paid in unix timestamp format. -- `type` _string_ - The type of deposit. `deposit` `withdrawal` -- `amount` _int_ - The amount of the deposit. -- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` `estimated` -- `bankAccount` _string_ - The bank account the deposit was paid to. -- `currency` _string_ - The currency of the deposit. E.g. `eur` -- `automatic` _bool_ - Whether the deposit was paid automatically. -- `fee` _int_ - The fee amount of the deposit. -- `fee_percentage` _int_ - The fee percentage of the deposit. -- `created` _int_ - The date the deposit was created in unix timestamp format. +If no deposit is found for the provided ID, the response will be an empty array. ```shell curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/po_123abc \ From 64648dc111bd559031b687325e61ea3b6229f373 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:50:46 +1000 Subject: [PATCH 36/48] Update balance `source_types` response description --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index b0fae8bfb8d..f075242ea5f 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -57,12 +57,12 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `pending` _array_ - The pending balance for each deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - - `source_types` _object_ - The amount of the balance from each source type, e.g. `card` or `financing`. + - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - `deposits_count` _int_ - The number of deposits that make up the balance. - `available` _array_ - The available balance for each deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - - `source_types` _object_ - The amount of the balance from each source type, e.g. `card` or `financing`. + - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - `instant` _array_ - The instant balance for each deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. @@ -231,12 +231,12 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `pending` _object_ - The pending balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - - `source_types` _object_ - The amount of the balance from each source type, e.g. `card` or `financing`. + - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - `deposits_count` _int_ - The number of deposits that make up the balance. - `available` _object_ - The available balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - - `source_types` _object_ - The amount of the balance from each source type, e.g. `card` or `financing`. + - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - `instant_balance` _object_ | _null_ - The instant balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. From 61e29100380d5efd056872942984fabf986e9d08 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 16:12:24 +1000 Subject: [PATCH 37/48] Deprecate `estimated` status from Deposit Object --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 3ee34d4021b..b0cbc78c15c 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -26,7 +26,7 @@ The Deposits API endpoints provide access to an account's deposits data, includi - `date` _int_ - The arrival date of the deposit in unix timestamp milliseconds. - `type` _string_ - The type of deposit. `deposit` `withdrawal` - `amount` _int_ - The amount of the deposit. -- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` `estimated` +- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) - `bankAccount` _string_ - The bank account the deposit was/will be paid to. - `currency` _string_ - The currency of the deposit. E.g. `eur` - `automatic` _bool_ - Returns `true` if the payout is created by an automated schedule and `false` if it’s requested manually. From 4e252208b7996daeca56e48bffc0aae559db72d0 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 16:13:28 +1000 Subject: [PATCH 38/48] Deprecated `balance.deposits_count` --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index b0cbc78c15c..71b41671a5b 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -58,7 +58,7 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - - `deposits_count` _int_ - The number of deposits that make up the balance. + - ~~`deposits_count`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** - `available` _array_ - The available balance for each deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. @@ -127,16 +127,14 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview-all \ "currency": "eur", "source_types": { "card": -114696 - }, - "deposits_count": 1 + } }, { "amount": 707676, "currency": "usd", "source_types": { "card": 707676 - }, - "deposits_count": 2 + } } ], "available": [ @@ -200,7 +198,7 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - - `deposits_count` _int_ - The number of deposits that make up the balance. + - ~~`deposits_count`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** - `available` _object_ - The available balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. @@ -257,8 +255,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ "currency": "eur", "source_types": { "card": -114696 - }, - "deposits_count": 1 + } } }, "instant_balance": { From 08b4515a7bcc3d124dbb203d37fdc26a967e7ae7 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Fri, 8 Dec 2023 16:16:14 +1000 Subject: [PATCH 39/48] Tweak formatting --- .../rest-api/source/includes/wp-api-v3/deposits.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 71b41671a5b..ff43d266cc6 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -51,14 +51,14 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `deposit` _object_ - `last_paid` _array_ of [**Deposit**](#deposit-object) - The last deposit that has been paid for each deposit currency. - - ~~`next_scheduled`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** + - ~~`next_scheduled`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. - `last_manual_deposits` _array_ of [**Deposit**](#deposit-object) - Manual deposits that have been paid in the last 24 hours. - `balance` _object_ - `pending` _array_ - The pending balance for each deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - - ~~`deposits_count`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** + - ~~`deposits_count`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. - `available` _array_ - The available balance for each deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. @@ -69,7 +69,7 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `fee` _int_ - The fee amount of the balance. - `fee_percentage` _int_ - The fee percentage of the balance. - `net` _int_ - The net amount of the balance. - - ~~`transaction_ids`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** + - ~~`transaction_ids`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. - `account` _object_ - `deposits_enabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. @@ -192,13 +192,13 @@ Fetch an overview of account deposits for a single deposit currency. This includ ### Returns - `last_deposit` _object_ [**Deposit**](#deposit-object) | _null_- The last deposit that has been paid for the deposit currency. -- ~~`next_deposit`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** +- ~~`next_deposit`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. - `balance` _object_ - `pending` _object_ - The pending balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - - ~~`deposits_count`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** + - ~~`deposits_count`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. - `available` _object_ - The available balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. @@ -209,7 +209,7 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `fee` _int_ - The fee amount of the balance. - `fee_percentage` _int_ - The fee percentage of the balance. - `net` _int_ - The net amount of the balance. - - ~~`transaction_ids`~~ _undefined_ - **Deprecated since `7.0.0`, no longer included in response.** + - ~~`transaction_ids`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. - `account` _object_ - `deposits_disabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. @@ -467,7 +467,7 @@ Submit an instant deposit for a list of transactions. Only for eligible accounts - `type`: _string_ - The type of deposit. `instant` - `currency`: _string_ - The currency of the balance to deposit. E.g. `usd` -- ~~`transaction_ids`~~: _array_ - **Deprecated since `7.0.0`, use `currency` instead.** The list of transaction IDs to deposit. +- ~~`transaction_ids`~~: _array_ - Deprecated since `7.0.0`, use `currency` instead. The list of transaction IDs to deposit. ```shell curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ From dc9227bd9c37309381f3bce9c3eda81fb3b70fcb Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Tue, 9 Jan 2024 09:59:39 +1000 Subject: [PATCH 40/48] =?UTF-8?q?Change=20est=20deposit=20deprecation=20ve?= =?UTF-8?q?rsion=207.0.0=20=E2=86=92=207.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/includes/wp-api-v3/deposits.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index ff43d266cc6..63abb03d4c2 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -26,7 +26,7 @@ The Deposits API endpoints provide access to an account's deposits data, includi - `date` _int_ - The arrival date of the deposit in unix timestamp milliseconds. - `type` _string_ - The type of deposit. `deposit` `withdrawal` - `amount` _int_ - The amount of the deposit. -- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) +- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) - `bankAccount` _string_ - The bank account the deposit was/will be paid to. - `currency` _string_ - The currency of the deposit. E.g. `eur` - `automatic` _bool_ - Returns `true` if the payout is created by an automated schedule and `false` if it’s requested manually. @@ -51,14 +51,14 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `deposit` _object_ - `last_paid` _array_ of [**Deposit**](#deposit-object) - The last deposit that has been paid for each deposit currency. - - ~~`next_scheduled`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. + - ~~`next_scheduled`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `last_manual_deposits` _array_ of [**Deposit**](#deposit-object) - Manual deposits that have been paid in the last 24 hours. - `balance` _object_ - `pending` _array_ - The pending balance for each deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - - ~~`deposits_count`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. + - ~~`deposits_count`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `available` _array_ - The available balance for each deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. @@ -69,7 +69,7 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `fee` _int_ - The fee amount of the balance. - `fee_percentage` _int_ - The fee percentage of the balance. - `net` _int_ - The net amount of the balance. - - ~~`transaction_ids`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. + - ~~`transaction_ids`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `account` _object_ - `deposits_enabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. @@ -192,13 +192,13 @@ Fetch an overview of account deposits for a single deposit currency. This includ ### Returns - `last_deposit` _object_ [**Deposit**](#deposit-object) | _null_- The last deposit that has been paid for the deposit currency. -- ~~`next_deposit`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. +- ~~`next_deposit`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `balance` _object_ - `pending` _object_ - The pending balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - - ~~`deposits_count`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. + - ~~`deposits_count`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `available` _object_ - The available balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. @@ -209,7 +209,7 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `fee` _int_ - The fee amount of the balance. - `fee_percentage` _int_ - The fee percentage of the balance. - `net` _int_ - The net amount of the balance. - - ~~`transaction_ids`~~ _undefined_ - Deprecated since `7.0.0`, no longer included in response. + - ~~`transaction_ids`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `account` _object_ - `deposits_disabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. @@ -282,7 +282,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ Fetch a list of deposits. -Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter. +Since `7.1.0`, `estimated` deposits are no longer returned or accepted as a filter parameter. ### HTTP request @@ -304,8 +304,8 @@ Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filt - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) -- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) +- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) +- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) - `direction` _string_ - `page` _integer_ - `pagesize` _integer_ @@ -362,7 +362,7 @@ Fetches a summary of deposits matching the query. This includes the total number Useful in combination with the **List deposits** endpoint to get a summary of deposits matching the query without having to fetch the full list of deposits. -Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filter parameter. +Since `7.1.0`, `estimated` deposits are no longer returned or accepted as a filter parameter. ### HTTP request @@ -380,8 +380,8 @@ Since `7.0.0`, `estimated` deposits are no longer returned or accepted as a filt - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) -- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) ### Returns @@ -410,7 +410,7 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/summary \ Fetches a deposit by ID. -_Since `7.0.0`, `estimated` deposits are no longer returned and will return a `404` status code._ +_Since `7.1.0`, `estimated` deposits are no longer returned and will return a `404` status code._ ### HTTP request @@ -467,7 +467,7 @@ Submit an instant deposit for a list of transactions. Only for eligible accounts - `type`: _string_ - The type of deposit. `instant` - `currency`: _string_ - The currency of the balance to deposit. E.g. `usd` -- ~~`transaction_ids`~~: _array_ - Deprecated since `7.0.0`, use `currency` instead. The list of transaction IDs to deposit. +- ~~`transaction_ids`~~: _array_ - Deprecated since `7.1.0`, use `currency` instead. The list of transaction IDs to deposit. ```shell curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ @@ -482,7 +482,7 @@ curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ Request a CSV export of deposits matching the query. A link to the exported CSV will be emailed to the provided email address or the account's primary email address if no email address is provided. -Since `7.0.0`, `estimated` deposits are no longer included in the CSV export or accepted as a filter parameter. +Since `7.1.0`, `estimated` deposits are no longer included in the CSV export or accepted as a filter parameter. ### HTTP request @@ -504,8 +504,8 @@ Since `7.0.0`, `estimated` deposits are no longer included in the CSV export or - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) -- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.0.0`) +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) ### Returns From 4e44254b66c5a8a509c6cd8c42bc5d82f097aa52 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:34:07 +1000 Subject: [PATCH 41/48] Remove deposit status `estimated` value --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 63abb03d4c2..82cf0e39198 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -26,7 +26,7 @@ The Deposits API endpoints provide access to an account's deposits data, includi - `date` _int_ - The arrival date of the deposit in unix timestamp milliseconds. - `type` _string_ - The type of deposit. `deposit` `withdrawal` - `amount` _int_ - The amount of the deposit. -- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) +- `status` _string_ - The status of the deposit. `paid` `pending` `in_transit` `canceled` `failed` - `bankAccount` _string_ - The bank account the deposit was/will be paid to. - `currency` _string_ - The currency of the deposit. E.g. `eur` - `automatic` _bool_ - Returns `true` if the payout is created by an automated schedule and `false` if it’s requested manually. From 0c8f6f3ad49e4cda5d74d6694be4545248cb3b55 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:36:37 +1000 Subject: [PATCH 42/48] Remove deprecated overview-all fields --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 82cf0e39198..527069ecb1b 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -51,14 +51,12 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `deposit` _object_ - `last_paid` _array_ of [**Deposit**](#deposit-object) - The last deposit that has been paid for each deposit currency. - - ~~`next_scheduled`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `last_manual_deposits` _array_ of [**Deposit**](#deposit-object) - Manual deposits that have been paid in the last 24 hours. - `balance` _object_ - `pending` _array_ - The pending balance for each deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - - ~~`deposits_count`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `available` _array_ - The available balance for each deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. @@ -69,7 +67,6 @@ Fetch an overview of account deposits for all deposit currencies. This includes - `fee` _int_ - The fee amount of the balance. - `fee_percentage` _int_ - The fee percentage of the balance. - `net` _int_ - The net amount of the balance. - - ~~`transaction_ids`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `account` _object_ - `deposits_enabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. From 1cc7a42bcac46f1d631fa82e182d204fe7ac93d3 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:37:25 +1000 Subject: [PATCH 43/48] Remove deprecated overview fields --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 527069ecb1b..2af0d41d4d8 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -189,13 +189,11 @@ Fetch an overview of account deposits for a single deposit currency. This includ ### Returns - `last_deposit` _object_ [**Deposit**](#deposit-object) | _null_- The last deposit that has been paid for the deposit currency. -- ~~`next_deposit`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `balance` _object_ - `pending` _object_ - The pending balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. - `source_types` _object_ | _null_ - The amount of the balance from each source type, e.g. `{ "card": 12345 }` - - ~~`deposits_count`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `available` _object_ - The available balance for the deposit currency. - `amount` _int_ - The amount of the balance. - `currency` _string_ - The currency of the balance. E.g. `usd`. @@ -206,7 +204,6 @@ Fetch an overview of account deposits for a single deposit currency. This includ - `fee` _int_ - The fee amount of the balance. - `fee_percentage` _int_ - The fee percentage of the balance. - `net` _int_ - The net amount of the balance. - - ~~`transaction_ids`~~ _undefined_ - Deprecated since `7.1.0`, no longer included in response. - `account` _object_ - `deposits_disabled` _bool_ - Whether deposits are enabled for the account. - `deposits_blocked` _bool_ - Whether deposits are blocked for the account. From 96f48c0a65deed44f5bc61554da11e4a31e357d0 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:38:28 +1000 Subject: [PATCH 44/48] Remove deprecated deposit list values --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index 2af0d41d4d8..a647f68d583 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -276,8 +276,6 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/overview \ Fetch a list of deposits. -Since `7.1.0`, `estimated` deposits are no longer returned or accepted as a filter parameter. - ### HTTP request
@@ -298,8 +296,8 @@ Since `7.1.0`, `estimated` deposits are no longer returned or accepted as a filt - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) -- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) +- `status_is` _string_ `paid` `pending` `in_transit` `canceled` `failed` +- `status_is_not` _string_ `paid` `pending` `in_transit` `canceled` `failed` - `direction` _string_ - `page` _integer_ - `pagesize` _integer_ From 3d6cb986e7ec6e70089ccccd47264d81cb2f08f2 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:39:27 +1000 Subject: [PATCH 45/48] Remove deprecated deposit summary values --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index a647f68d583..e9919ec4233 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -354,8 +354,6 @@ Fetches a summary of deposits matching the query. This includes the total number Useful in combination with the **List deposits** endpoint to get a summary of deposits matching the query without having to fetch the full list of deposits. -Since `7.1.0`, `estimated` deposits are no longer returned or accepted as a filter parameter. - ### HTTP request
@@ -372,8 +370,8 @@ Since `7.1.0`, `estimated` deposits are no longer returned or accepted as a filt - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) -- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` ### Returns From 0370a3a0357970b7142aea26b3066aed6fc461a9 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:40:53 +1000 Subject: [PATCH 46/48] Update get deposit description --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index e9919ec4233..f551feaa2b3 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -400,8 +400,6 @@ curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/summary \ Fetches a deposit by ID. -_Since `7.1.0`, `estimated` deposits are no longer returned and will return a `404` status code._ - ### HTTP request
@@ -415,7 +413,7 @@ _Since `7.1.0`, `estimated` deposits are no longer returned and will return a `4 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 return a `404` status code. +If no deposit is found for the provided ID, the response will return a `500` status code. ```shell curl -X GET https://example.com/wp-json/wc/v3/payments/deposits/po_123abc \ From 9d443778c42d47d14576235904a719ccc9686441 Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:41:39 +1000 Subject: [PATCH 47/48] Remove deprecated POST instant deposit field --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index f551feaa2b3..c85c687f3d6 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -455,7 +455,6 @@ Submit an instant deposit for a list of transactions. Only for eligible accounts - `type`: _string_ - The type of deposit. `instant` - `currency`: _string_ - The currency of the balance to deposit. E.g. `usd` -- ~~`transaction_ids`~~: _array_ - Deprecated since `7.1.0`, use `currency` instead. The list of transaction IDs to deposit. ```shell curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ From 809796e9daa1fdcedc57b7c9fe82bd7ae1d724af Mon Sep 17 00:00:00 2001 From: Eric Jinks <3147296+Jinksi@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:42:26 +1000 Subject: [PATCH 48/48] Remove deprecated POST deposit download values --- docs/rest-api/source/includes/wp-api-v3/deposits.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/rest-api/source/includes/wp-api-v3/deposits.md b/docs/rest-api/source/includes/wp-api-v3/deposits.md index c85c687f3d6..4d1d8a07607 100644 --- a/docs/rest-api/source/includes/wp-api-v3/deposits.md +++ b/docs/rest-api/source/includes/wp-api-v3/deposits.md @@ -469,8 +469,6 @@ curl -X POST 'https://example.com/wp-json/wc/v3/payments/deposits' \ Request a CSV export of deposits matching the query. A link to the exported CSV will be emailed to the provided email address or the account's primary email address if no email address is provided. -Since `7.1.0`, `estimated` deposits are no longer included in the CSV export or accepted as a filter parameter. - ### HTTP request
@@ -491,8 +489,8 @@ Since `7.1.0`, `estimated` deposits are no longer included in the CSV export or - `date_before` _string_ - `date_after` _string_ - `date_between` _array_ -- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) -- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` (~~`estimated`~~ deprecated since `7.1.0`) +- `status_is` _string_ - `paid` `pending` `in_transit` `canceled` `failed` +- `status_is_not` _string_ - `paid` `pending` `in_transit` `canceled` `failed` ### Returns