Skip to content

Commit 8aa688e

Browse files
authored
Merge pull request #504 from swan-io/DOC-892/get-a-payment-mandate-for-merchant-payments-sdd
New guide get mandate
2 parents 3f45da7 + 7550e88 commit 8aa688e

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Get mandate URL
3+
---
4+
5+
After a SEPA Direct Debit (SDD) mandate has been declared, you may need to retrieve the mandate information.
6+
You can retrieve a specific mandate using the **payment mandate ID**.
7+
8+
:::tip Prerequisites
9+
1. **Mandate declaration:** A SEPA Direct Debit mandate must have been previously declared using the [`addSepaDirectDebitPaymentMandate`](./guide-declare) mutation.
10+
1. **Mandate ID:** You must know the **unique payment mandate ID** of the mandate you want to retrieve.
11+
:::
12+
13+
## API {#api}
14+
15+
Queries are customizable. This guide focuses solely on using the `paymentMandate` query to get the mandate URL.
16+
17+
1. Call the `paymentMandate` query.
18+
2. Add your payment mandate ID (line 2). Include the `SEPAPaymentDirectDebitMandate` fragment with the fields you need (line 3).
19+
3. Under `SEPAPaymentDirectDebitMandate`, check the boxes for `id`, `name` and `mandateDocumentUrl` (lines 4-6).
20+
* `mandateDocumentUrl` allows you to receive a **download URL** in the payload.
21+
22+
### Query {#query}
23+
24+
<a href="https://explorer.swan.io/?query=cXVlcnkgR2V0TWFuZGF0ZSB7CiAgcGF5bWVudE1hbmRhdGUoaWQ6ICIkWU9VUl9NQU5EQVRFX0lEIikgewogICAgLi4uIG9uIFNFUEFQYXltZW50RGlyZWN0RGViaXRNYW5kYXRlIHsKICAgICAgaWQKICAgICAgbmFtZQogICAgICBtYW5kYXRlRG9jdW1lbnRVcmwKICAgIH0KICB9Cn0K&tab=api" className="explorer-badge">Open in API Explorer</a>
25+
26+
```graphql {2,3,4-6} showLineNumbers
27+
query GetMandate {
28+
paymentMandate(id: "$YOUR_MANDATE_ID") {
29+
... on SEPAPaymentDirectDebitMandate {
30+
id
31+
name
32+
mandateDocumentUrl
33+
}
34+
}
35+
}
36+
```
37+
38+
### Payload {#payload}
39+
40+
1. The response includes a mandate name (line 5), and the download URL (line 6).
41+
1. Paste the URL into your browser, then press enter. This triggers the download of your PDF.
42+
43+
```json {5,6} showLineNumbers
44+
{
45+
"data": {
46+
"paymentMandate": {
47+
"id": "$YOUR_MANDATE_ID",
48+
"name": "B2B/Core SEPA Direct Debit Mandate",
49+
"mandateDocumentUrl": "$YOUR_MANDATE_URL"
50+
}
51+
}
52+
}
53+
```

docs/topics/merchants/online/sdd/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ They can investigate the reason for return and take whatever action is necessary
280280
- [Accept payments with SEPA Direct Debit (step-by-step)](./guide-sdd.mdx)
281281
- [Request SEPA Direct Debit payment method](./guide-request.mdx)
282282
- [Declare a payment mandate](./guide-declare.mdx)
283+
- [Get SEPA Direct Debit mandate URL](./guide-get-mandate.mdx)
283284
- [Initiate a SEPA Direct Debit transaction](./guide-initiate.mdx)
284285
- [Update SEPA Direct Debit payment method](./guide-update.mdx)
285286
- [Sandbox](./sandbox.mdx)

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ module.exports = {
321321
"topics/merchants/online/sdd/guide-sdd",
322322
"topics/merchants/online/sdd/guide-request",
323323
"topics/merchants/online/sdd/guide-declare",
324+
"topics/merchants/online/sdd/guide-get-mandate",
324325
"topics/merchants/online/sdd/guide-initiate",
325326
"topics/merchants/online/sdd/guide-update",
326327
"topics/merchants/online/sdd/guide-create-link",

0 commit comments

Comments
 (0)