Originate a Push to Card Payment

If you want to send funds to a debit or prepaid card, you can send a card Payment Order in Modern Treasury, like any other payment rail.

The External Account receiving the funds must have a card added to it- you can see an overview of how to do that here.

Before making requests, you'll need your API Key and Organization ID. Follow this guide to retrieve them: Retrieve your API Key. Ensure your Program has the entitlements and limits to send Push to Card as well.

Send*Send ReversiblePullPull Reversible
YesNoNoN/A

*Card payments can be sent to debit cards only.

1. Retrieve your Internal Account ID

📘

Internal Accounts

Modern Treasury uses the term Internal Account to refer to your accounts. Your customers', vendors', and employees' bank accounts are called External Accounts.

When you create a payment order, you must specify which account you want the transaction to originate from. If you are sending someone money, this is the account that the money will be taken out of.

To get an Internal Account ID, you can pick one from your accounts page. Any of the IDs will work for testing, although you can refer to Internal Accounts to see the differences in how the test banks process payments.

If you want to get all the internal accounts using the API , you can issue the following request:

curl --request GET \
  -u ORGANIZATION_ID:API_KEY \
  --url https://app.moderntreasury.com/api/internal_accounts

You will receive an array of all your Internal Accounts. For this example, we'll just use one of the account IDs to originate the Payment Order from. In this response, we'll use the first one, 0f8e3719-3dfd-4613-9bbf-c0333781b59f.

📘

Sandbox Setup

For more information on how we've set up your accounts, visit our Sandbox Details guide.


2. Create a Counterparty and External Account with a Card

Follow details here.

3. Create a Push to Card Payment Order

To create a push to card Payment Order, you will use your Internal Account ID (0f8e3719-3dfd-4613-9bbf-c0333781b59f) as the originating_account_id and the External Account with a card (5acec2ef-987b-4260-aa97-b719eeb0a8d5) as the receiving_account_id.

curl --request POST \
  -u ORGANIZATION_ID:API_KEY \
  --url https://app.moderntreasury.com/api/payment_orders \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "card",
    "amount": 1000,
    "direction": "credit",
    "currency": "USD",
    "originating_account_id": "0f8e3719-3dfd-4613-9bbf-c0333781b59f",
    "receiving_account_id": "5acec2ef-987b-4260-aa97-b719eeb0a8d5"
  }'
[
  {
    "id": "0f8e3719-3dfd-4613-9bbf-c0333781b59f",
    "object": "internal_account",
    "account_type": null,
    "party_name": "Modern Treasury",
    "party_type": null,
    "party_address": null,
    "account_details": [
      {
        "id": "aaf74f7e-d697-4a73-95a3-05bede2edce6",
        "object": "account_details",
        "account_number_safe": "2971",
        "account_number_type": null,
        "created_at": "2019-11-09T00:11:07Z",
        "updated_at": "2019-11-09T00:11:07Z"
      }
    ],
    "routing_details": [
      {
        "id": "a3649136-f8d2-46e8-8b41-327bd7da3110",
        "object": "routing_details",
        "payment_type": null,
        "routing_number": "021000021",
        "routing_number_type": "aba",
        "created_at": "2019-11-09T00:11:07Z",
        "updated_at": "2019-11-09T00:11:07Z"
      }
    ],
    "connection": {
      "id": "05487db0-e234-4ae8-914a-c627f76c987f",
      "object": "connection",
      "vendor_id": "example1",
      "vendor_name": "Gringotts Wizarding Bank",
      "created_at": "2019-11-09T00:11:07Z",
      "updated_at": "2019-11-09T00:11:07Z"
    },
    "created_at": "2019-11-09T00:11:07Z",
    "updated_at": "2019-11-09T00:11:07Z"
  }
]

This is the response you will see. It contains the ID of the Payment Order, b8f42a67-3c91-4d5e-a0f7-6e29c8b41d53, as well as additional details about it.

Optional: Handle post-creation events

Modern Treasury sends a number of useful events once your Payment Order is created. Use the Dashboard, Webhooks, or a third party solution to receive these events and perform actions like notifying the counterparty of the transfer, knowing when the Payment Order is complete, or determining when and why a return occurred.