Fund an Account

When the Organization is approved, Mural creates an Account for it. Get the Account ID, then simulate a payin to fund it.

Get the Account

Use the get Accounts endpoint with the on-behalf-of header.

Example request

curl --request GET \
     --url https://api-staging.muralpay.com/api/accounts \
     --header "accept: application/json" \
     --header "authorization: Bearer $MURAL_API_KEY" \
     --header "on-behalf-of: $ORGANIZATION_ID"

Save the Account id from the response. You use it to fund the Account and as the source of the payout:

export ACCOUNT_ID="<id from the response>"

accountDetails.payinMethods lists the bank details your end user sends fiat to in production. This Account uses the autoOnramp settlement strategy, shown in the USD payin method's payinRailDetails.settlementStrategy. With autoOnramp, Mural converts each fiat payin to the Account's destination token, USDC on Polygon, as soon as it settles. The Account holds the stablecoin balance that you pay out from in the next steps. To learn about the other strategy, see Settlement Strategies.

Simulate a payin

Use the simulate payin endpoint to deposit test funds into the Account. Send amount.value in cents. The example deposits 50 USD over ACH, the sandbox maximum for that rail.

Example request

curl --request POST \
     --url https://api-staging.muralpay.com/api/sandbox/simulate/payin \
     --header "accept: application/json" \
     --header "authorization: Bearer $MURAL_API_KEY" \
     --header "content-type: application/json" \
     --header "on-behalf-of: $ORGANIZATION_ID" \
     --data @- <<EOF
{
  "destinationAccountId": "$ACCOUNT_ID",
  "rail": {
    "type": "ach",
    "amount": {
      "value": "5000",
      "currencySymbol": "USD"
    }
  }
}
EOF

The payin settles in about 3 to 4 minutes. Call the get Accounts endpoint again to see the new balance in accountDetails.balancesV2. The USDC balance grows by the payin amount less the onramp fee.

The USDC balance does not start at zero. In the sandbox, Mural deposits 100 USDC of test funds into the first Account created for each Organization, shortly after it is created.

Some amounts make a simulated payin fail or settle slowly. To test those outcomes, see Simulated Payments.


What’s Next

Did this page help you?