Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document account deletion #217

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions _accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,37 @@ Retrieves the details about a specific account.
### Response

Returns a fully formed [Account Object](#account-object) representing the requested account.

## Remove Account

```bash
curl https://api.uphold.com/v0/me/accounts/18843b6d-5a43-480f-8e2b-73b27d726bf0 \
-X DELETE
-H "Authorization: Bearer <token>"
```

> The above command returns a response with no body, and HTTP status code `204`
([No Content](https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.5)).

Deletes a specific account.

### Request

`DELETE https://api.uphold.com/v0/me/accounts/:id`

<aside class="notice">
Requires the <code>accounts:write</code> scope for Uphold Connect applications.
</aside>
<aside class="notice">
The account id must be owned by the user performing the API call.
</aside>

### Response

In case of success, returns a response with no body and an HTTP status code of `204`
([No Content](https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.5)).

If the account doesn't exist under the authorization-granting user, returns a <a href="#errors">404 HTTP error</a>.

If the token lacks the `accounts:write` scope, returns a <a href="#errors">404 HTTP error</a>
with the JSON body `{ "error": "invalid_scope" }`.
9 changes: 5 additions & 4 deletions _entities.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Entities

## Account Object

> An example account encoded in JSON looks like this:

```json
Expand All @@ -20,12 +21,12 @@
Property | Description
-------- | -----------------------------------------------------------------------
billing | The relevant billing details associated with the account.
brand | The brand of the `card` account.
brand | The brand of the account (if it is of type `card`).
currency | The currency in which the account is denominated.
id | A unique ID associated with the account.
label | The display name of the account as chosen by the user.
status | The current status of the account. Possible values are `ok` and `failed`.
type | The type of the account. Possible values are `card` and `sepa`.
status | The current status of the account. Possible values are `blocked`, `expired`, `failed`, `ok` and `pending`.
type | The type of the account. Possible values are `ach`, `card` and `sepa`.

## Authentication Method Object

Expand Down Expand Up @@ -150,7 +151,7 @@ pair | The currency pair AB represents moving from A to B.

> An example phone encoded in JSON looks like this:

```
```json
{
"e164Masked": "+XXXXXXXXX04",
"id": "1d78aeb5-43ac-4ee8-8d28-1291b5d8355c",
Expand Down
3 changes: 2 additions & 1 deletion _totp.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,5 @@ curl https://api.uphold.com/v0/me/authentication_methods/3f8f8264-2f5e-4b2b-8333

### Response

Returns an HTTP status code of <code>204</code> and no JSON body, in case of success.
Returns an HTTP status code of `204` ([No Content](https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.5))
and no JSON body, in case of success.