Skip to main content

Testing API

Overview

Swan's testing, or simulation, API lets you trigger events that happen outside of Swan. Swan's API reacts as it would in real life, displaying the right information at the right time.

When using the Testing API and your Sandbox environment, you can perform end-to-end tests without the user's intervention and without connecting to the Dashboard.

Testing API mutations function in the same way as the Live API, except they don't trigger events in real life—only in Sandbox. You'll need a user access token to use most Testing API mutations, though sometimes a project access token is enough.

Go to API Explorer > Testing API to see all available mutations.

Image of Testing API

Testing API & Event Simulator

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.

Example mutations

The following links lead to examples to personalize and test with the Testing API Explorer. As a reminder, this list isn't exhaustive.

  1. SEPA Credit Transfers
    1. Simulate receiving an incoming SEPA Credit Transfer
    2. Simulate an accepted recall of an Incoming SEPA Credit Transfer
    3. Simulate booking an outgoing SEPA Credit Transfer
  2. SEPA Direct Debit
    1. Simulate the reception of an outgoing SEPA Direct Debit
    2. Simulate reversing an outgoing SEPA Direct Debit
    3. Simulate releasing reserved balance from a SEPA Direct Debit
  3. Card payments
    1. Simulate creating an authorization request from a merchant
    2. Simulate reversing a card debit
    3. Simulate crediting a card
  4. Billing
    1. Simulate generating an invoice
    2. Simulate creating a FeesOut transaction