Search…
Testing API
At Swan, we are eager to provide a Sandbox that's as close as possible to real life. Our simulation API lets you trigger events happening outside of Swan, and our system reacts as it would in real life, displaying the right information at the right time.
The β€œdevelopers” section in the Dashboard provides some tools to help you perform tests easily by creating sandbox users and simulating external events that aren't generated by our APIs:
  • Sandbox users
    • Partner creates multiple pretend users and selects the one they want to impersonate in the Sandbox
  • Event simulator
    • Provides a list of external events which can be simulated.
If you want to manually test a scenario, or mock a behavior before implementing it, you'll use those 2 tools. To improve your integration experience with Swan, you can also simulate operations with the API; you can call them programmatically and perform end-to-end tests without connecting to the Dashboard.
This separate GraphQL API is called "Testing API", and it's available only in Sandbox. This API has two types of mutations and queries:
  • Sandbox User: these queries and mutations allow you to create a new sandbox user, update it, and endorse their identity
  • Event Simulator: these mutations allow you to test external events by simulating SEPA Transfers coming to the swan account, card payments, etc.
You can always call this API using a User Access Token (Your user in the dashboard), and sometimes using a Project Access Token.
This API has a different endpoint.

Sandbox User API

Create Sandbox User

To create a Sandbox user, call createSandboxUser.
This mutation must be called with a User Access Token from the Sandbox environment.
Request
Input
Response
1
mutation Mutation($input: CreateSandboxUserInput!) {
2
createSandboxUser(input: $input) {
3
... on CreateSandboxUserSuccessPayload {
4
sandboxUser {
5
id
6
mobilePhoneNumber
7
lastName
8
firstName
9
birthDate
10
nationalityCCA3
11
idVerified
12
autoConsent
13
preferredNotificationChannel
14
verificationStatus
15
identificationStatus
16
isActive
17
}
18
}
19
... on NationalityNotFoundRejection {
20
message
21
identifier
22
__typename
23
}
24
... on ForbiddenRejection {
25
message
26
__typename
27
}
28
}
29
}
Copied!
1
{
2
"input": {
3
"firstName": "Partner",
4
"lastName": "Admin",
5
"birthDate": "1999-01-01",
6
"nationalityCCA3": "FRA",
7
"verificationStatus": "Verified",
8
"identificationStatus": "ValidIdentity",
9
"autoConsent": false
10
}
11
}
Copied!
1
{
2
"data": {
3
"createSandboxUser": {
4
"sandboxUser": {
5
"id": "8f9b8c5a-ba7a-4b4e-9e14-aacab38bfef1",
6
"mobilePhoneNumber": null,
7
"lastName": "Admin",
8
"firstName": "Partner",
9
"birthDate": "1999-01-01",
10
"nationalityCCA3": "FRA",
11
"idVerified": true,
12
"autoConsent": false,
13
"preferredNotificationChannel": null,
14
"verificationStatus": "Verified",
15
"identificationStatus": "ValidIdentity",
16
"isActive": false
17
}
18
}
19
}
20
}
Copied!
You can use this mutation when you want to create a new user, for example, just before finalizing an onboarding, or when adding a new account membership.

Update a sandbox user

To update a Sandbox User, call updateSandboxUser.
This mutation must be called with a User Access Token from the Sandbox environment.
Request
Input
Response
1
mutation UpdateSandboxUser($input: UpdateSandboxUserInput!) {
2
updateSandboxUser(input: $input) {
3
... on UpdateSandboxUserSuccessPayload {
4
sandboxUser {
5
id
6
mobilePhoneNumber
7
lastName
8
firstName
9
birthDate
10
idVerified
11
nationalityCCA3
12
autoConsent
13
preferredNotificationChannel
14
verificationStatus
15
identificationStatus
16
isActive
17
}
18
}
19
... on ForbiddenRejection {
20
message
21
__typename
22
}
23
... on NationalityNotFoundRejection {
24
message
25
identifier
26
__typename
27
}
28
... on SandboxUserNotFoundRejection {
29
message
30
userId
31
__typename
32
}
33
}
34
}
Copied!
1
{
2
"input": {
3
"id": "f1043808-40d9-4ecf-b3a2-b5c0c96768c0",
4
"firstName": "Partner updated",
5
"lastName": "Admin updated",
6
"birthDate": "1999-01-02",
7
"nationalityCCA3": "MAR",
8
"verificationStatus": "NotStarted",
9
"identificationStatus": "Uninitiated",
10
"autoConsent": true
11
}
12
}
Copied!
1
{
2
"data": {
3
"updateSandboxUser": {
4
"sandboxUser": {
5
"id": "f1043808-40d9-4ecf-b3a2-b5c0c96768c0",
6
"mobilePhoneNumber": null,
7
"lastName": "Admin updated",
8
"firstName": "Partner updated",
9
"birthDate": "1999-01-02",
10
"idVerified": false,
11
"nationalityCCA3": "MAR",
12
"autoConsent": true,
13
"preferredNotificationChannel": null,
14
"verificationStatus": "NotStarted",
15
"identificationStatus": "Uninitiated",
16
"isActive": false
17
}
18
}
19
}
20
}
Copied!
Use this mutation when you want to update an existing user. This can happen when they verify their identity and the information they provided was doesn't match what we have on record (extracted from their ID document). It's also used to simulate updates of the identificationStatus.

Endorse a sandbox user

To switch the sandbox user you are logged in as, call endorseSandboxUser
This mutation must be called with a User Access Token from the Sandbox environment.
Request
Input
Response
1
mutation Mutation($input: EndorseSandboxUserInput!) {
2
endorseSandboxUser(input: $input) {
3
... on EndorseSandboxUserSuccessPayload {
4
sandboxUser {
5
id
6
lastName
7
firstName
8
nationalityCCA3
9
mobilePhoneNumber
10
birthDate
11
autoConsent
12
preferredNotificationChannel
13
verificationStatus
14
identificationStatus
15
isActive
16
idVerified
17
}
18
}
19
... on ForbiddenRejection {
20
message
21
__typename
22
}
23
... on SandboxUserNotFoundRejection {
24
message
25
userId
26
__typename
27
}
28
}
29
}
Copied!
1
{
2
"input": {
3
"id": "fc8b4e44-5380-4c5e-b912-4b3871ecca3b"
4
}
5
}
Copied!
1
{
2
"data": {
3
"endorseSandboxUser": {
4
"sandboxUser": {
5
"id": "fc8b4e44-5380-4c5e-b912-4b3871ecca3b",
6
"lastName": "Doe",
7
"firstName": "Joe",
8
"nationalityCCA3": "FRA",
9
"mobilePhoneNumber": "+33673660996",
10
"birthDate": "2022-02-02",
11
"autoConsent": false,
12
"preferredNotificationChannel": null,
13
"verificationStatus": "Verified",
14
"identificationStatus": "ValidIdentity",
15
"isActive": true,
16
"idVerified": true,
17
"authenticators": [
18
{
19
"os": null,
20
"brand": null,
21
"model": null,
22
"type": "SwanWeb",
23
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/97.0.4692.84 Mobile/15E148 Safari/604.1",
24
"acceptLanguage": null,
25
"status": "Enabled"
26
}
27
]
28
}
29
}
30
}
31
}
Copied!
You can use this mutation to act as a different Sandbox user. For example, you can create a membership using the Sandbox User Alice, and accept the membership using Sandbox User Bob - all in the same flow.

Delete a sandbox user

If you created a sandbox user by error and want to delete it, use deleteSandboxUser.
This mutation must be called with a User Access Token from the Sandbox environment.
Request
Input
Response
1
mutation DeleteSandboxUser($input: DeleteSandboxUserInput!) {
2
deleteSandboxUser(input: $input) {
3
... on DeleteSandboxUserSuccessPayload {
4
success
5
}
6
... on ForbiddenRejection {
7
message
8
__typename
9
}
10
... on LastSandboxUserCannotBeDeletedRejection {
11
message
12
userId
13
__typename
14
}
15
... on SandboxUserNotFoundRejection {
16
message
17
userId
18
__typename
19
}
20
}
21
}
Copied!
1
{
2
"input": {
3
"id": "fc8b4e44-5380-4c5e-b912-4b3871ecca3b"
4
}
5
}
Copied!
1
{
2
"data": {
3
"deleteSandboxUser": {
4
"success": true
5
}
6
}
7
}
Copied!
This is possible only if you haven't yet used the sandbox user. A Sandbox user can't be deleted if they've already been used to accept a membership, create an account, consent, login, etc.
There is no real usage for this in Live since it's not possible to delete a user in real life.

Event simulator API

SEPA Credit Transfer

Receive an incoming Transfer
To create a new SepaCreditTransferIn transaction from outside of Swan toward a Swan account, call simulateIncomingSepaCreditTransferReception.
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: IncomingSepaCreditTransferInput!) {
2
simulateIncomingSepaCreditTransferReception(input: $input) {
3
... on SimulateIncomingSepaCreditTransferReceptionSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
__typename
9
}
10
}
11
}
Copied!
1
{
2
"input": {
3
"amount": {
4
"value": 10000,
5
"currency": "EUR"
6
},
7
"creditorAddress": {
8
"addressLine1": "Address line 1",
9
"addressLine2": "Address line 2",
10
"city": "Paris",
11
"postalCode": "75020",
12
"state": null,
13
"country": "FRA"
14
},
15
"creditorIban": "FR76 9999 9001 0012 4271 2152 906",
16
"creditorName": "Coucou account",
17
"debtorAddress": {
18
"addressLine1": "Address line 1",
19
"addressLine2": "Address line 2",
20
"city": "Paris",
21
"postalCode": "75020",
22
"state": null,
23
"country": "FRA"
24
},
25
"debtorIban": "FR2730003000706315734174B93",
26
"debtorName": "Debtor",
27
"endToEndId": "EtoE Ref",
28
"label": "Label to display"
29
}
30
}
Copied!
1
{
2
"data": {
3
"simulateIncomingSepaCreditTransferReception": {
4
"transactionId": "bosci_b78071d503b29f4ace0da21bc34798fc"
5
}
6
}
7
}
Copied!
You can use this mutation to transfer money onto a newly created Swan account, to simulate a recurring SEPA coming into the Swan account, ...
Return an Incoming Transfer
To create a new SepaCreditTransferInReturn transaction, based on an original SepaCreditTransferIn transaction, call simulateIncomingSepaCreditTransferReturn
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateIncomingSepaCreditTransferReturnInput!) {
2
simulateIncomingSepaCreditTransferReturn(input: $input) {
3
... on SimulateIncomingSepaCreditTransferReturnSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
}
14
}
Copied!
1
{
2
"input": {
3
"reasonCode": "NotSpecifiedByBeneficiary",
4
"transactionId": "bosci_a67f2deb76f847bf9a9c6f95685f0d57"
5
}
6
}
Copied!
1
{
2
"data": {
3
"simulateIncomingSepaCreditTransferReturn": {
4
"transactionId": "rtsci_3965337265208d2d570ba18f95871f06"
5
}
6
}
7
}
Copied!
Try it now on the API Explorer
You can use this mutation to simulate when a SEPA Credit Transfer credits a Swan account and then Swan or the Swan debtor returned the funds.
Accept an Incoming Transfer Recall
To create a new SepaCreditTransferInRecall transaction, based on an original SepaCreditTransferIn transaction, call simulateIncomingSepaCreditTransferRecall
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateIncomingSepaCreditTransferAcceptedRecallInput!) {
2
simulateIncomingSepaCreditTransferAcceptedRecall(input: $input) {
3
... on SimulateIncomingSepaCreditTransferAcceptedRecallSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
}
14
}
Copied!
1
{
2
"input": {
3
"reasonCode": "NotSpecifiedByOriginator",
4
"transactionId": "bosci_d4de882efffb5becffacc50e64b40467"
5
}
6
}
Copied!
1
{
2
"data": {
3
"simulateIncomingSepaCreditTransferAcceptedRecall": {
4
"transactionId": "rcsci_93dafc5609cac7721bbb5916d9dc56b3"
5
}
6
}
7
}
Copied!
You can use this mutation to simulate when a Sepa Credit Transfer credited a Swan account, the debtor bank or the debtor asked for a recall of the transaction, and then Swan or the Swan creditor accepted the recall request.
Book an outgoing transfer
To change the status of an outgoing SepaCreditTransferOut into Booked call simulateOutgoingSepaCreditTransferBooking .
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingSepaCreditTransferBookingInput!) {
2
simulateOutgoingSepaCreditTransferBooking(input: $input) {
3
... on SimulateOutgoingSepaCreditTransferBookingSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
}
14
}
Copied!
1
{
2
"input": {
3
"transactionId": "bosco_32bfec4ebf6a0cffa098659118dfd7f4"
4
}
5
}
Copied!
1
{
2
"data": {
3
"simulateOutgoingSepaCreditTransferBooking": {
4
"transactionId": "bosco_817628c9eb4547fab3603d6a8f2a26f9"
5
}
6
}
7
}
Copied!
You can use this mutation to simulate when a SepaCreditTransferOut was initiated and is Pending, and you want to simulate the approval of the transfer.
Reject an outgoing transfer
To change the status of an outgoing SepaCreditTransferOut into Rejected call simulateOutgoingSepaCreditTransferRejection .
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingSepaCreditTransferRejectionInput!) {
2
simulateOutgoingSepaCreditTransferRejection(input: $input) {
3
... on SimulateOutgoingSepaCreditTransferRejectionSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
}
14
}
Copied!
1
{
2
"input": {
3
"reasonCode": "BeneficiaryBankBicInvalid",
4
"transactionId": "bosco_0b4a4ca71d4420ae8033cd3f36054318"
5
}
6
}
Copied!
1
{
2
"data": {
3
"simulateOutgoingSepaCreditTransferRejection": {
4
"transactionId": "bosco_ae6fb6734c0b912601119b49adfc5b9b"
5
}
6
}
7
}
Copied!
You can use this mutation to simulate when a SepaCreditTransferOut was initiated and is Pending, and you want to simulate the rejection of the transfer.
Receive an outgoing transfer return
To create a new SepaCreditTransferOutReturn transaction, based on an original SepaCreditTransferOut transaction, call simulateOutgoingSepaCreditTransferReturn
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingSepaCreditTransferReturnInput!) {
2
simulateOutgoingSepaCreditTransferReturn(input: $input) {
3
... on SimulateOutgoingSepaCreditTransferReturnSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
}
14
}
Copied!
1
{
2
"input": {
3
"reasonCode": "BankOperationCodeInvalid",
4
"transactionId": "bosco_244c399377dd7ce3b645de9a7b6221f4"
5
}
6
}
Copied!
1
{
2
"data": {
3
"simulateOutgoingSepaCreditTransferReturn": {
4
"transactionId": "rtsco_b4403f54b259fbb1b5bde4dc476d459d"
5
}
6
}
7
}
Copied!
You can use this mutation to simulate when a Sepa Credit Transfer debited a Swan account and the creditor bank or the creditor returned the funds.
Receive an Accepted Outgoing Transfer Recall
To create a new SepaCreditTransferOutRecall transaction, based on an original SepaCreditTransferOut transaction, call simulateOutgoingSepaCreditTransferAcceptedRecall
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingSepaCreditTransferAcceptedRecallInput!) {
2
simulateOutgoingSepaCreditTransferAcceptedRecall(input: $input) {
3
... on SimulateOutgoingSepaCreditTransferAcceptedRecallSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
}
14
}
Copied!
1
{
2
"input": {
3
"reasonCode": "NotSpecifiedByOriginator",
4
"transactionId": "bosco_32bfec4ebf6a0cffa098659118dfd7f4"
5
}
6
}
Copied!
1
{
2
"data": {
3
"simulateOutgoingSepaCreditTransferAcceptedRecall": {
4
"transactionId": "rcsco_6a844e5eb63cfa8dee585dd9c1afb36d"
5
}
6
}
7
}
Copied!
You can use this mutation to simulate when a Sepa Credit Transfer debited a Swan account, Swan or the Swan debtor asked for a recall of the transaction, and then the creditor bank or the creditor accepted the recall request.

SEPA Direct Debit

Receive SDD instruction
To create a new SepaDirectDebitOut transaction call simulateOutgoingSepaDirectDebitReception. For SDD Core, the transaction will be Enabled, and SDD B2B the transaction will be in ConsentPending. Learn more about the consent process and mandate on here.
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingSepaDirectDebitReceptionInput!) {
2
simulateOutgoingSepaDirectDebitReception(input: $input) {
3
... on SimulateOutgoingSepaDirectDebitReceptionSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
}
10
}
Copied!
1
{
2
"input": {
3
"amount": {
4
"value": 1000,
5
"currency": "EUR"
6
},
7
"creditor": {
8
"address": {
9
"addressLine1": "Address line 1",
10
"addressLine2": "Address line 2",
11
"city": "Paris",
12
"postalCode": "75020",
13
"state": null,
14
"country": "FRA"
15
},
16
"iban": "FR8814508000302986428271O12",
17
"name": "Creditor Inc",
18
"identifier": "FR11ABC123456",
19
"ultimateName": "UFC"
20
},
21
"debtorIban": "FR76 9999 9001 0012 4271 2152 906",
22
"endToEndId": "E2E ref",
23
"executionDate": "2022-02-10T16:00:00.000Z",
24
"mandateAmendment": {
25
"previousCreditorIdentifier": null,
26
"previousDebtorIban": null,
27
"previousMandateReference": null
28
},
29
"mandateReference": "8db058cc58ea4be792fef4370aa86e50",
30
"mandateSequence": "OneOff",
31
"mandateType": "Core",
32
"label": "Label SDD In"
33
}
34
}
Copied!
1
{
2
"data": {
3
"simulateOutgoingSepaDirectDebitReception": {
4
"transactionId": "scsdo_b51e7028ebc287c4b8b061e575623a83"
5
}
6
}
7
}
Copied!
You can use this mutation to simulate when a Swan account receives a SEPA Direct Debit instruction and is debited at the executionDate.
Receive SDD instruction cancellation
To cancel a SepaDirectDebitOut transaction in Pending status, call simulateOutgoingSepaDirectDebitCancel.
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingSepaDirectDebitCancelInput!) {
2
simulateOutgoingSepaDirectDebitCancel(input: $input) {
3
... on SimulateOutgoingSepaDirectDebitCancelSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
}
14
}
Copied!
1
{
2
"data": {
3
"simulateOutgoingSepaDirectDebitCancel": {
4
"transactionId": "casdo_3192893f7202bae8e0d4160f1fd9d3cc"
5
}
6
}
7
}
Copied!
1
{
2
"input": {
3
"reasonCode": "NotSpecifiedByOriginator",
4
"transactionId": "scsdo_c76c04aa6cb82c6ca3e41bbc4cc0e239"
5
}
6
}
Copied!
You can use this mutation to simulate a creditor canceling an incoming SEPA Direct Debit instruction sent to debit a Swan account, before the execution/debit date.
Receive a Direct Debit Refund
To create a new SepaDirectDebitOutReturn transaction, based on a SepaDirectDebitOut call simulateOutgoingSepaDirectDebitReturn.
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingSepaDirectDebitReturnInput!) {
2
simulateOutgoingSepaDirectDebitReturn(input: $input) {
3
... on SimulateOutgoingSepaDirectDebitReturnSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
}
14
}
Copied!
1
{
2
"input": {
3
"reasonCode": "NotSpecifiedByPayer",
4
"transactionId": "bosdo_ea1d04c475af41ac74c1f1b2e676fe83"
5
}
6
}
Copied!
1
{
2
"data": {
3
"simulateOutgoingSepaDirectDebitReturn": {
4
"transactionId": "rtsdo_94b6ab01e8e33860867b85ab7aff42b9"
5
}
6
}
7
}
Copied!
You can use this mutation to simulate when a SEPA Direct Debit instruction has been received and the transaction was booked on a Swan debtor account, then simulate a refund request by an authorized account member and the subsequent return of funds to their account.
Receive a Direct Debit Reversal
To create a new SepaDirectDebitOutReversal transaction, based on a SepaDirectDebitOut call simulateOutgoingSepaDirectDebitReverse.
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingSepaDirectDebitReverseInput!) {
2
simulateOutgoingSepaDirectDebitReverse(input: $input) {
3
... on SimulateOutgoingSepaDirectDebitReverseSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
}
14
}
Copied!
1
{
2
"input": {
3
"reasonCode": "NotSpecifiedByPayer",
4
"transactionId": "bosdo_ea1d04c475af41ac74c1f1b2e676fe83"
5
}
6
}
Copied!
1
{
2
"data": {
3
"simulateOutgoingSepaDirectDebitReverse": {
4
"transactionId": "rvsdo_d19ed87b4fa679ac4742bbef29ea34a8"
5
}
6
}
7
}
Copied!
You can use this mutation to simulate when a SEPA Direct Debit instruction has been received and the transaction was booked on a Swan debtor account, then simulate the creditor reversing the transaction and the subsequent return of funds to the Swan account.
Reject a Direct Debit
To reject a SepaDirectDebitOut transaction in the Pending status, call simulateOutgoingSepaDirectDebitReject.
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingSepaDirectDebitRejectInput!) {
2
simulateOutgoingSepaDirectDebitReject(input: $input) {
3
... on SimulateOutgoingSepaDirectDebitRejectSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
}
14
}
Copied!
1
{
2
"input": {
3
"reasonCode": "NotSpecifiedByPayer",
4
"transactionId": "scsdo_9bfa7c5ecbce4adfffe806f34fe06c36"
5
}
6
}
Copied!
1
{
2
"data": {
3
"simulateOutgoingSepaDirectDebitReject": {
4
"transactionId": "rjsdo_2cfcc368951c5345678e5597bef5aef9"
5
}
6
}
7
}
Copied!
​Try it now on the API Explorer. You can use this mutation to simulate a Swan debtor rejecting a SEPA Direct Debit instruction they've already received, before the execution/debit date.

Card payments

Create an authorization request from a merchant
To create a new CardOutAuthorization transaction in Pending status, call simulateOutgoingCardAuthorization.
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingCardAuthorizationInput!) {
2
simulateOutgoingCardAuthorization(input: $input) {
3
... on SimulateOutgoingCardAuthorizationSuccessPayload {
4
transactionId
5
}
6
... on SimulateOutgoingCardAuthorizationRejectPayload {
7
transactionId
8
reason
9
}
10
... on CardNotFoundRejection {
11
id
12
message
13
}
14
... on ForbiddenRejection {
15
message
16
}
17
}
18
}
Copied!
1
{
2
"input": {
3
"amount": {
4
"value": 10,
5
"currency": "EUR"
6
},
7
"authorizationType": "Classic",
8
"cardId": "639a8a64-1517-4a6d-9114-f14adf0bfe65",
9
"cardTransactionCategory": "InStore",
10
"cardType": "Virtual",
11
"merchant": {
12
"city": null,
13
"code": null,
14
"country": null,
15
"id": null,
16
"name": null
17
},
18
"originalAmount": {
19
"value": 10,
20
"currency": "EUR"
21
},
22
"outcome": null,
23
"terminalId": null
24
}
25
}
Copied!
1
{
2
"data": {
3
"simulateOutgoingCardAuthorization": {
4
"transactionId": "aucao_5b063c885ac8486133ae0a98bd6616a2"
5
}
6
}
7
}
Copied!
You can use this mutation to simulate a Swan cardholder making a payment at a POS, a merchant making an authorization request on a card a recurring subscription, a card being added into a wallet for later payments, etc.
Debit an authorization
To create a new CardOutDebit transaction, based on a previously created CardOutAuthorization, call simulateOutgoingCardDebit.
This mutation can be called with a User Access Token or a Project Access Token.
Request
Input
Response
1
mutation Mutation($input: SimulateOutgoingCardDebitInput!) {
2
simulateOutgoingCardDebit(input: $input) {
3
... on SimulateOutgoingCardDebitSuccessPayload {
4
transactionId
5
}
6
... on ForbiddenRejection {
7
message
8
}
9
... on TransactionNotFoundRejection {
10
transactionId
11
message
12
}
13
... on CardNotFoundRejection {
14
id
15
message
16
}
17
}
18
}
Copied!
1
{
2
"input": {
3
"amount": {
4
"value": 10,
5
"currency": "EUR"