Counterparties

Sandbox behavior for counterparties

You may create counterparties in your sandbox with the same data you would use in production. All routing details on external accounts are run through the exact same validations that are run in production.

Your sandbox will also be automatically seeded with counterparties that enable you to quickly create and test payments and workflows. These counterparties can be used to simulate successful and returned payments.

Default Counterparties

Counterparty NameEffect
Harry PotterWill result in successful ACH, Wire, Check and RTP payment orders.
Voldemort (ACH/Wire Return) - R01 Insufficient FundsWill result in an ACH return with code R01.
Snape (ACH/Wire Return) - R03 No Account/Unable to Locate AccountWill result in an ACH return with code R03.
Lucius (General Failure)Will fail ACH, Wire, and RTP payment orders.
Bellatrix (Check Failure)Will fail Check payment orders.
Draco (EFT Return) - 901 NSFWill result in an EFT return with code 901.

🚧

Warning

You can edit these counterparties, which may change their behavior for future payment orders. We recommend not modifying these counterparties and instead prefer creating new counterparties to test your workflows.

Creating Default Counterparties Manually

If you do not have these default Counterparties already, you can create them through the API below.

Note: Remember to use your Sandbox API key to create these Counterparties.

curl --request POST \
  -u ORGANIZATION_ID:API_KEY \
  --url https://app.moderntreasury.com/api/counterparties \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Harry Potter",
    "accounts": [
      {
        "account_type": "checking",
        "party_address": {
            "line1": "7 Hogsmeade Ave.",
            "locality": "San Francisco",
            "region": "California",
            "postal_code": "94108",
            "country": "US",
            "live_mode": false
        },
        "routing_details": [
          {
            "routing_number_type": "aba",
            "routing_number": "121141822"
          }
        ],
        "account_details": [
          {
            "account_number": "123456789"
          }
        ]
      }
    ]
  }'
curl --request POST \
  -u ORGANIZATION_ID:API_KEY \
  --url https://app.moderntreasury.com/api/counterparties \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Voldemort (ACH/Wire Return) - R01 Insufficient Funds",
    "accounts": [
      {
        "account_type": "checking",
        "routing_details": [
          {
            "routing_number_type": "aba",
            "routing_number": "121141822"
          }
        ],
        "account_details": [
          {
            "account_number": "10001"
          }
        ]
      }
    ]
  }'
curl --request POST \
  -u ORGANIZATION_ID:API_KEY \
  --url https://app.moderntreasury.com/api/counterparties \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Snape (ACH/Wire Return) - R03 No Account/Unable to Locate Account",
    "accounts": [
      {
        "account_type": "checking",
        "routing_details": [
          {
            "routing_number_type": "aba",
            "routing_number": "121141822"
          }
        ],
        "account_details": [
          {
            "account_number": "10003"
          }
        ]
      }
    ]
  }'
curl --request POST \
  -u ORGANIZATION_ID:API_KEY \
  --url https://app.moderntreasury.com/api/counterparties \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Lucius (General Failure)",
    "accounts": [
      {
        "account_type": "checking",
        "routing_details": [
          {
            "routing_number_type": "aba",
            "routing_number": "121141822"
          }
        ],
        "account_details": [
          {
            "account_number": "1111111110"
          }
        ]
      }
    ]
  }'
curl --request POST \
  -u ORGANIZATION_ID:API_KEY \
  --url https://app.moderntreasury.com/api/counterparties \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Bellatrix (Check Failure)",
    "accounts": [
      {
        "account_type": "other",
        "party_address": {
            "line1": "1111 Azkaban Unit 321",
            "locality": "San Francisco",
            "region": "California",
            "postal_code": "94108",
            "country": "US",
            "live_mode": false
        }
      }
    ]
  }'
curl --request POST \
  -u ORGANIZATION_ID:API_KEY \
  --url https://app.moderntreasury.com/api/counterparties \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Draco (EFT Return) - 901 NSF",
    "accounts": [
      {
        "account_type": "checking",
        "routing_details": [
          {
            "routing_number_type": "ca_cpa",
            "routing_number": "000100022"
          }
        ],
        "account_details": [
          {
            "account_number": "10101"
          }
        ]
      }
    ]
  }'