Skip to content

Add Prettier + run formatter #128

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
indent_size = 2
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"mdx.server.enable": false
}
"mdx.server.enable": false
}
2 changes: 1 addition & 1 deletion changelog/2024/2024-03-15.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ This will remove current friction when receiving SEPA Credit Transfers from the
### Upcoming breaking changes

💥 In **4 weeks**, the Ultimate Beneficial Owner's residency country becomes mandatory in our no-code onboarding form.
In **4 months**, our API will enforce this change as well.
In **4 months**, our API will enforce this change as well.
7 changes: 4 additions & 3 deletions changelog/2024/2024-03-28.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Learn more about the [supporting document collection](/topics/onboarding/documen
⏸️ Suspending an account now triggers an `Account.Updated` webhook.

### Upcoming breaking changes
⚠️ In **2 weeks**, we'll reject any input of the "_" character in the `reference` field, and sanitize it in the `label` field within the `initiateCreditTransfers` mutation, as it's not authorized in SEPA messages.
For the `reference` field, ensure that the content:

⚠️ In **2 weeks**, we'll reject any input of the "\_" character in the `reference` field, and sanitize it in the `label` field within the `initiateCreditTransfers` mutation, as it's not authorized in SEPA messages.
For the `reference` field, ensure that the content:

- Doesn't start or end with a "/"
- Doesn't have "//"
Expand All @@ -23,4 +24,4 @@ For the `reference` field, ensure that the content:
💸 The `beneficiaryId` input field for the mutation `initiateCreditTransfers` has been deprecated, and will be removed in 4 weeks.

ℹ️ In the upcoming months, we'll remove the requirement of one unique phone number per user.
While each phone number will remain linked to only one user at a time, it can **later** be reused by different users, like employees, at **separate** times.
While each phone number will remain linked to only one user at a time, it can **later** be reused by different users, like employees, at **separate** times.
4 changes: 2 additions & 2 deletions changelog/2024/2024-04-04.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type: release

### New features

🌎 Account holders can now send [International Credit Transfers](/topics/payments/credit-transfers/international) to:
🌎 Account holders can now send [International Credit Transfers](/topics/payments/credit-transfers/international) to:

- Exchange euros for another currency and transfer it.
- Transfer euros outside of SEPA.
Expand All @@ -15,4 +15,4 @@ Please contact your Account Manager if you're interested.

### Improvements

✅ [Beneficiary verification](/topics/payments/credit-transfers/sepa/#beneficiary-verification) between two Dutch accounts is now available on Swan's Web Banking.
✅ [Beneficiary verification](/topics/payments/credit-transfers/sepa/#beneficiary-verification) between two Dutch accounts is now available on Swan's Web Banking.
2 changes: 1 addition & 1 deletion changelog/2024/2024-04-11.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ In **4 weeks**, we will use the new value `CapitalDepositReason`.

### Breaking changes

⚠️ The Ultimate Beneficial Owner's (UBO) residency country is now mandatory in our **no-code onboarding form**.
⚠️ The Ultimate Beneficial Owner's (UBO) residency country is now mandatory in our **no-code onboarding form**.
3 changes: 1 addition & 2 deletions changelog/2024/2024-04-18.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: 18 April 2024
type: release
---


### New features

💸 Offer bulk credit transfer capabilities to your end users.
Expand All @@ -17,4 +16,4 @@ Contact your Account Manager if you're interested in this feature.
### Upcoming breaking changes

🙅🏾 In 4 weeks, the status `Canceled` will be added to `CapitalDepositCase`, and the status `CapitalDepositCanceled` to `Shareholder`.
Learn more about statuses for your [capital deposit cases](/topics/capital-deposits/#case-statuses) and [shareholders](/topics/capital-deposits/#shareholders-statuses).
Learn more about statuses for your [capital deposit cases](/topics/capital-deposits/#case-statuses) and [shareholders](/topics/capital-deposits/#shareholders-statuses).
1 change: 0 additions & 1 deletion changelog/2024/2024-04-26.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: 26 April 2024
type: release
---


### Improvements

💰 We're supporting additional fees to provide a more flexible billing solution for our partners.
Expand Down
2 changes: 1 addition & 1 deletion changelog/2024/2024-05-24.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Use the API to create webhooks dynamically, retry failed events automatically, a
🪪 In **4 weeks**, we will deprecate the `notStarted` [identification status](/topics/users/identifications/#statuses) and replace it with `Started` to streamline identification flows and reduce confusion.

💳 In **4 weeks**, we will start using the new following issued card [rejection reason codes](https://api-reference.swan.io/enums/rejected-reason-code/): `ThreeDsError`, `PeriodTransactionNumberLimitExceeded`, `MissingExpirationDate`, `MissingPin`, `DigitalWalletDeactivated`, `DigitalWalletEnrolmentInvalid`, `DigitalWalletTokenInvalid`, `DigitalWalletRefusal`, `DigitalWalletSuspended`, `InvalidAmount`, and `CardholderCancellation`.
The new rejection reasons are available in Sandbox using the [Event Simulator](/developers/tools/event-simulator).
The new rejection reasons are available in Sandbox using the [Event Simulator](/developers/tools/event-simulator).
2 changes: 1 addition & 1 deletion changelog/2024/2024-05-31.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ type: release
- The available languages are: Dutch `nl`, English `en`, French `fr`, German `de`, Italian `it`, Portuguese `pt`, and Spanish `es`.
- Finnish `fi` won't be supported for the account membership language yet.
- If you're subscribed to the `AccountMembership.Updated` webhook, you'll receive a webhook notification when `AccountMembership.language` is live.
- If you've already used the `updateAccountMembership` mutation to choose the language for an account membership, it won't change with this update.
- If you've already used the `updateAccountMembership` mutation to choose the language for an account membership, it won't change with this update.
2 changes: 1 addition & 1 deletion changelog/coming-up.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:::tip Coming up
Beneficiary management for credit transfers, accepting online card payments, and more!<br />
Check out [**Swan's public roadmap**](https://swanio.notion.site/Swan-Public-Roadmap-385e4b2e91b3409786a6c8e885654a22) to see what's in the works. :rocket:
:::
:::
6 changes: 3 additions & 3 deletions docs/_contact.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* For sales or services related questions: [Contact form](https://www.swan.io/talk-to-expert)
* For technical or product related questions: [email protected]
* For daily operations: [email protected]
- For sales or services related questions: [Contact form](https://www.swan.io/talk-to-expert)
- For technical or product related questions: [email protected]
- For daily operations: [email protected]
5 changes: 3 additions & 2 deletions docs/developers/contact.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: Contact Swan
---
import PartialExample from '../_contact.mdx';

import PartialExample from "../_contact.mdx";

# Contact Swan

<PartialExample/>
<PartialExample />
21 changes: 11 additions & 10 deletions docs/developers/graphql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ Consider this [query example from onboarding](../topics/onboarding/overview/guid
You can also explore all of Swan's queries in [API Explorer](https://explorer.swan.io/).

```graphql title="Query" showLineNumbers
query {
user(id: "$SWAN_USER_ID") { #query name
query {
#query name
user(id: "$SWAN_USER_ID") {
mobilePhoneNumber #field
}
}
Expand All @@ -78,16 +79,16 @@ Swan often has two query options per object, such as `user` and `users`.

- `user` requires an `id` and returns data about a single user.
- `users` doesn't require an `id` and returns data about all of your users.
:::
:::

### Mutations {#graphql-mutations}

There are entry points to a GraphQL API to make requests, which both take inputs.

| Request type | Purpose | `REST` comparison |
|---|---|---|
| Mutations | Make a change | `PUT` or `POST` |
| Queries | Fetch data from the remote API | `GET` |
| Request type | Purpose | `REST` comparison |
| ------------ | ------------------------------ | ----------------- |
| Mutations | Make a change | `PUT` or `POST` |
| Queries | Fetch data from the remote API | `GET` |

Each request starts with the keyword `query` or `mutation`, then specifies the field or fields you want to get back in the response.

Expand All @@ -106,15 +107,15 @@ mutation ChangeLanguage {
updateAccount( #mutation name
input: { accountId: "$YOUR_ACCOUNT_ID", language: en } #input information
) {
... on UpdateAccountSuccessPayload { #validation
#validation
... on UpdateAccountSuccessPayload {
__typename
account {
language #returns account language in payload
}
}
}
}

```

```json title="Payload" {4,6} showLineNumbers
Expand Down Expand Up @@ -187,4 +188,4 @@ query {
}
}
}
```
```
34 changes: 17 additions & 17 deletions docs/developers/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ In short, **test in Sandbox, build in Live**—and remember, you can't move anyt

### Endpoints {#endpoints}

| Name | Endpoint |
| --- | --- |
| Server OAuth 2.0 | https://oauth.swan.io/oauth2 |
| Sandbox | https://api.swan.io/sandbox-partner/graphql |
| Name | Endpoint |
| --------------------- | ------------------------------------------------- |
| Server OAuth 2.0 | https://oauth.swan.io/oauth2 |
| Sandbox | https://api.swan.io/sandbox-partner/graphql |
| Sandbox (Testing API) | https://api.swan.io/sandbox-partner-admin/graphql |
| Live | https://api.swan.io/live-partner/graphql |
| Live | https://api.swan.io/live-partner/graphql |

### Rate limiting {#rate-limits}

Expand All @@ -53,7 +53,7 @@ The default limit for each IP is **2,000 requests every 5 minutes**.
If you send over 2,000 requests for a single endpoint, you'll receive an HTTP 429 Too Many Requests response.
This limit applies to all endpoints.

If you need to increase the rate limits for your use case, request it through email: [email protected].
If you need to increase the rate limits for your use case, request it through email: [email protected].

### Backend communication {#backend}

Expand All @@ -78,18 +78,18 @@ curl -X POST https://api.swan.io/sandbox-partner/graphql \

```json title="Response" {4} showLineNumbers
{
"data": {
"accounts": {
"edges": [
{
"node": {
"id": "$YOUR_ID",
"IBAN": "$YOUR_IBAN"
}
}
]
"data": {
"accounts": {
"edges": [
{
"node": {
"id": "$YOUR_ID",
"IBAN": "$YOUR_IBAN"
}
}
]
}
}
}
```

Expand All @@ -106,4 +106,4 @@ If you experience an issue or a bug working with Swan's API, complete the follow

1. **Check the [status page](https://status.swan.io/)** to see if there's planned maintenance or an outage that could impact services.
1. **Search the documentation** with keywords about your specific problem. It could be an expected behavior or something else explained in the docs.
1. Otherwise, **submit a ticket** through your Dashboard, or **send an email** to [email protected].
1. Otherwise, **submit a ticket** through your Dashboard, or **send an email** to [email protected].
2 changes: 1 addition & 1 deletion docs/developers/tools/_testing-simulator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
The **Testing API** and the **Event Simulator** are essentially the same tool with two access points.

Though you'll test some actions from the API and others with the simulator, both share the goal of **triggering events that happen outside of Swan**.
:::
:::
26 changes: 13 additions & 13 deletions docs/developers/tools/api-explorer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ The API Explorer can be broken up into **three main blocks**:
## Block 1: Top navigation {#top-nav}

1. Swan exposes two APIs:
- Use the **Live API** to perform all of your real work with Swan.
- Use the [**Testing API**](./testing-api.mdx) in partnership with the [**Event Simulator**](./event-simulator.mdx) to simulate events that must include other people, such as consent and authentications.
- Use the **Live API** to perform all of your real work with Swan.
- Use the [**Testing API**](./testing-api.mdx) in partnership with the [**Event Simulator**](./event-simulator.mdx) to simulate events that must include other people, such as consent and authentications.

**Open the menu to switch** between tokens and projects by clicking around your logo or user type:

2. Switch between [**access tokens**](../using-api/authentication/index.mdx#tokens):
- **Project** uses a project access token.
- **Sandbox user** selected in your dashboard uses the user access token associated with the chosen user. Change this user on **Dashboard** > **Developers** > **Sandbox users**.
- **Project** uses a project access token.
- **Sandbox user** selected in your dashboard uses the user access token associated with the chosen user. Change this user on **Dashboard** > **Developers** > **Sandbox users**.
1. Toggle between projects you have access to. If you think a project is missing from this list, talk to the project's admin.

![Focused screenshot of top navigation with project and token menu open](../../images/developers/tools/explorer-top-nav.png)
Expand All @@ -37,21 +37,21 @@ The API Explorer can be broken up into **three main blocks**:
1. **Builder**: Add mutations and queries, as well as all fields, objects, responses, and more.
1. **Documentation**: Refer to the [API Reference](https://api-reference.swan.io/) without leaving the Explorer.
1. **History**: Review your exploration history. You can:
- Edit the names of your mutations and queries for easy reference.
- Star mutations and queries you use frequently.
- Delete items from the history if they're not helpful anymore. You can also clear all of your local data by clicking the settings icon (not pictured).
- Edit the names of your mutations and queries for easy reference.
- Star mutations and queries you use frequently.
- Delete items from the history if they're not helpful anymore. You can also clear all of your local data by clicking the settings icon (not pictured).

![Focused screenshot of three side modules](../../images/developers/tools/explorer-module-options.png)

## Block 3: Body {#body}

1. Edit your query or mutation in the **primary terminal**.
- All of the fields, objects, rejections, and more that you select in the **builder** will appear in this terminal.
- You'll need to **input all information in the terminal**, such as IDs, addresses, IBANs, and all other required and optional content.
- All of the fields, objects, rejections, and more that you select in the **builder** will appear in this terminal.
- You'll need to **input all information in the terminal**, such as IDs, addresses, IBANs, and all other required and optional content.
1. Inside of the primary terminal, you have buttons to:
- **Run** your query or mutation.
- **Prettify** (or clean up) the formatting of your content.
- **Share** the exact query or mutation.
- **Run** your query or mutation.
- **Prettify** (or clean up) the formatting of your content.
- **Share** the exact query or mutation.
1. Payloads and responses are displayed in a non-editable **secondary terminal**.
1. Your **recently-used queries and mutations** appear at the top of the body block of the API Explorer. Click one to autofill the primary terminal.

Expand All @@ -63,4 +63,4 @@ To maximize performance and keep the Explorer secure, please work within the fol

- Maximum of 10 nested fields per object
- Maximum of 1000 fields per query
- Maximum of 3 root fields per Explorer operation (you can call up to 3 mutations or queries at the same time)
- Maximum of 3 root fields per Explorer operation (you can call up to 3 mutations or queries at the same time)
2 changes: 1 addition & 1 deletion docs/developers/tools/event-simulator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Go to **Dashboard** > **Developers** > **Event Simulator** to open the simulator

![Image of Dashboard Event Simulator page](../../images/developers/tools/event-simulator.png)

import TestingApiEventSimulator from './_testing-simulator.mdx';
import TestingApiEventSimulator from "./_testing-simulator.mdx";

<TestingApiEventSimulator />

Expand Down
4 changes: 1 addition & 3 deletions docs/developers/tools/guide-test-tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ You can now perform operations with this Sandbox user.

![Image of Event Simulator SEPA Credit Transfers section](../../images/developers/tools/test-validate-3.png)


## Step 3: Testing API → Simulate receiving a transfer {#receive-transfer}

1. Call the `simulateIncomingSepaCreditTransferReception` mutation to [simulate receiving an incoming SEPA Credit Transfer](https://explorer.swan.io?query=bXV0YXRpb24gU2ltdWxhdGVSZWNlaXZpbmdUcmFuc2ZlciB7CiAgc2ltdWxhdGVJbmNvbWluZ1NlcGFDcmVkaXRUcmFuc2ZlclJlY2VwdGlvbigKICAgIGlucHV0OiB7CiAgICAgIGFtb3VudDogeyB2YWx1ZTogIjEwMCIsIGN1cnJlbmN5OiAiRVVSIiB9CiAgICAgIGNyZWRpdG9ySWJhbjogIiRTV0FOX0FDQ09VTlRfSUJBTiIKICAgICAgY3JlZGl0b3JOYW1lOiAiTWFsaWthIE5nb21hIgogICAgICBkZWJ0b3JJYmFuOiAiRlIyNzMwMDAzMDAwNzA2MzE1NzM0MTc0QjkzIgogICAgICBkZWJ0b3JOYW1lOiAiSnVsZXMgRmxldXJ5IgogICAgICBjcmVkaXRvckFkZHJlc3M6IHsKICAgICAgICBhZGRyZXNzTGluZTE6ICIxMjMgYXZlbnVlIGRlIFBhcmlzIgogICAgICAgIGNpdHk6ICJQYXJpcyIKICAgICAgICBwb3N0YWxDb2RlOiAiNzUwMDAiCiAgICAgICAgY291bnRyeTogIkZSQSIKICAgICAgfQogICAgICBkZWJ0b3JBZGRyZXNzOiB7CiAgICAgICAgYWRkcmVzc0xpbmUxOiAiODc2IGF2ZW51ZSBkZSBUb3Vsb3VzZSIKICAgICAgICBjaXR5OiAiUGFyaXMiCiAgICAgICAgY291bnRyeTogIkZSQSIKICAgICAgICBwb3N0YWxDb2RlOiAiNzUwMDAiCiAgICAgIH0KICAgICAgZW5kVG9FbmRJZDogIkV0b0UgUmVmIgogICAgICBsYWJlbDogIkxhYmVsIHRvIGRpc3BsYXkiCiAgICB9CiAgKSB7CiAgICAuLi4gb24gU2ltdWxhdGVJbmNvbWluZ1NlcGFDcmVkaXRUcmFuc2ZlclJlY2VwdGlvblN1Y2Nlc3NQYXlsb2FkIHsKICAgICAgdHJhbnNhY3Rpb25JZAogICAgfQogICAgLi4uIG9uIEZvcmJpZGRlblJlamVjdGlvbiB7CiAgICAgIG1lc3NhZ2UKICAgICAgX190eXBlbmFtZQogICAgfQogIH0KfQo%3D&tab=test-api).
Expand Down Expand Up @@ -84,7 +83,6 @@ mutation SimulateReceivingTransfer {
}
}
}

```

```json title="Payload" {4} showLineNumbers
Expand All @@ -108,4 +106,4 @@ mutation SimulateReceivingTransfer {
1. Click **Simulate**.
1. The status changes to `Success` and a new transaction ID appears for the return transaction.

![Image of Event Simulator SEPA Credit Transfers section](../../images/developers/tools/test-simulator-return-2.png)
![Image of Event Simulator SEPA Credit Transfers section](../../images/developers/tools/test-simulator-return-2.png)
4 changes: 2 additions & 2 deletions docs/developers/tools/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ In addition to your **Dashboard**, several key tools work together in harmony to
- [Testing API](./testing-api.mdx)
- [Event Simulator](./event-simulator.mdx)
- [Sandbox users](./sandbox-users.mdx)
- [Postman collection](./postman-collection.mdx) *(optional)*
- [Postman collection](./postman-collection.mdx) _(optional)_

Use these tools to test scenarios manually, test behavior before implementation, simulate operations with the API, and more.
You can also call the Testing API programmatically and perform end-to-end tests without connecting to the Dashboard.

:::tip tutorial
See how all of these tools work together in the [**Work with Swan tools**](./guide-test-tools.mdx) tutorial.
:::
:::
3 changes: 1 addition & 2 deletions docs/developers/tools/postman-collection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ You can cancel authentication if needed.

![Image of Postman guiding user to use the new project access token](../../images/developers/tools/implementation-token-project-use.png)


### 5.2 User access token

Getting a new user access token requires consent from the user associated with the token.
Expand All @@ -94,4 +93,4 @@ The user needs to use their phone to consent to your user access token before yo

6. After the user consents, a modal with all information about your user access token appears on the screen. Click **Use Token**.

![Image of Postman guiding user to use the new user access token](../../images/developers/tools/implementation-token-user-use.png)
![Image of Postman guiding user to use the new user access token](../../images/developers/tools/implementation-token-user-use.png)
Loading