Skip to content
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
53 changes: 53 additions & 0 deletions docs/topics/merchants/online/sdd/guide-get-mandate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Get mandate URL
---

After a SEPA Direct Debit (SDD) B2B mandate has been declared, you may need to retrieve the mandate information.
You can retrieve a specific mandate using the **payment mandate ID**.

:::tip Prerequisites
1. **Mandate declaration:** A SEPA Direct Debit mandate must have been previously declared using the `addSepaDirectDebitPaymentMandate` mutation.
1. **Mandate ID:** You must know the **unique payment mandate ID** of the mandate you want to retrieve.
:::

## API {#api}

Queries are highly customizable. This guide focuses solely on using the `paymentMandate` query to get the mandate URL.

1. Call the `paymentMandate` query.
2. Check the boxes for `id` (line 2) and `SEPAPaymentDirectDebitMandate` (line 3).
3. Under `SEPAPaymentDirectDebitMandate`, check the boxes for `id`, `name` and `mandateDocumentUrl` (lines 4-6).
* `mandateDocumentUrl` allows you to receive a **download URL** in the payload.

### Query {#query}

<a href="https://explorer.swan.io/?query=cXVlcnkgR2V0TWFuZGF0ZSB7CiAgcGF5bWVudE1hbmRhdGUoaWQ6ICIkWU9VUl9NQU5EQVRFX0lEIikgewogICAgLi4uIG9uIFNFUEFQYXltZW50RGlyZWN0RGViaXRNYW5kYXRlIHsKICAgICAgaWQKICAgICAgbmFtZQogICAgICBtYW5kYXRlRG9jdW1lbnRVcmwKICAgIH0KICB9Cn0K&tab=api" className="explorer-badge">Open in API Explorer</a>

```graphql {2,3,4-6} showLineNumbers
query GetMandate {
paymentMandate(id: "$YOUR_MANDATE_ID") {
... on SEPAPaymentDirectDebitMandate {
id
name
mandateDocumentUrl
}
}
}
```

### Payload {#payload}

1. The response includes a mandate name (line 5), and the download URL (line 6).
1. Paste the URL into your browser, then press enter. This triggers the download of your PDF.

```json {5,6} showLineNumbers
{
"data": {
"paymentMandate": {
"id": "$YOUR_MANDATE_ID",
"name": "B2B/Core SEPA Direct Debit Mandate",
"mandateDocumentUrl": "$YOUR_MANDATE_URL"
}
}
}
```
1 change: 1 addition & 0 deletions docs/topics/merchants/online/sdd/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ They can investigate the reason for return and take whatever action is necessary
- [Accept payments with SEPA Direct Debit (step-by-step)](./guide-sdd.mdx)
- [Request SEPA Direct Debit payment method](./guide-request.mdx)
- [Declare a payment mandate](./guide-declare.mdx)
- [Get SEPA Direct Debit mandate URL](./guide-get-mandate.mdx)
- [Initiate a SEPA Direct Debit transaction](./guide-initiate.mdx)
- [Update SEPA Direct Debit payment method](./guide-update.mdx)
- [Sandbox](./sandbox.mdx)
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ module.exports = {
"topics/merchants/online/sdd/guide-sdd",
"topics/merchants/online/sdd/guide-request",
"topics/merchants/online/sdd/guide-declare",
"topics/merchants/online/sdd/guide-get-mandate",
"topics/merchants/online/sdd/guide-initiate",
"topics/merchants/online/sdd/guide-update",
"topics/merchants/online/sdd/guide-create-link",
Expand Down