Skip to main content
Use this guide after your customer connects a checking account through Mastercard Open Finance. Straddle uses that connection to retrieve account data, verify ownership, and return a paykey for charges and payouts. Straddle calls the following values from one Mastercard consent receipt a Mastercard token:
  • Receipt ID.
  • Mastercard customer ID.
  • Mastercard account ID.
Need a Mastercard token? See Create a Mastercard token for Straddle.

Before you begin

Confirm the following:
  • Create a customer in Straddle. The customer cannot be inactive or rejected.
  • Use a Mastercard consent receipt that includes moneyTransferDetails, accountOwner, and availableBalanceLive for the same account.
Mastercard does not include the account type in the consent receipt. Straddle records a paykey created from a Mastercard token as a checking account.

Create the paykey

Send the following IDs to POST /v1/bridge/mastercard. The Mastercard values must come from the same consent receipt.
Create a paykey from a Mastercard token
For retry behavior, see Idempotency keys for safe API retries. inline processing is the default. If Straddle returns a pending paykey, processing continues asynchronously and Straddle sends status changes through paykey webhook events.

Read the response

An inline request that creates an active paykey returns 201 Created.
Store data.paykey for charges and payouts. Straddle uses the available balance returned by Mastercard and falls back to the cleared balance when Mastercard does not return an available balance. Store the Mastercard token with the account connection. You’ll need the consent receipt ID to revoke Mastercard access.

Act on the paykey status

Use data.status to decide the next action. For a review result, follow the manual review process. See Paykey status details for the full lifecycle.

Recover from errors

For an inline request, use the HTTP status code to decide how to handle the error. For asynchronous processing, use the paykey status from paykey webhook events.
Treat error.detail and status_details.message as diagnostic text. Do not match their contents in code.
Recognized Mastercard token failures return 422 Unprocessable Entity during inline processing. Straddle maps them to these diagnostic messages: During asynchronous processing, a failure listed in the table changes the paykey to rejected and sends a paykey webhook event. Other failures leave the paykey in pending while Straddle retries. During inline processing, a Mastercard failure that is not listed in the table returns 500 Internal Server Error. Contact Straddle before retrying and include meta.api_request_id.

Keep the Mastercard token available

When you create the Mastercard token, set maxCalls and accessPeriod for each product. Mastercard’s Generate Third Party Access Key example uses maxCalls: 200. See Set the token scope.
Unless your use case has a set expiration date, set accessPeriod.endTime as far into the future as your Mastercard configuration allows. Contact Mastercard for more information about access periods and call limits.
If the Mastercard token expires, is revoked, or reaches a call limit, Straddle cannot request a new balance. The paykey can remain active and keeps its last bank data and balance. If Straddle cannot refresh the balance for a charge:
  • disabled: Straddle does not request a balance.
  • enabled: The charge can continue without a completed balance check.
  • required: The charge fails because Straddle cannot verify the balance.
You cannot replace the Mastercard token on an existing paykey. If Mastercard returns a new consent receipt, create a new paykey and cancel the old paykey.

Test in sandbox

Create the Mastercard token in Mastercard’s sandbox, then send the Bridge request to https://sandbox.straddle.com. Name matching runs when config.sandbox_outcome is standard. Set config.sandbox_outcome to active, rejected, or review to force that paykey status. Use expired, revoked, under-scoped, and exhausted Mastercard tokens to test the recovery paths. See Sandbox testing for Pay by Bank for more scenarios.

Disconnect the account

Complete both actions when the customer disconnects the account:
  1. Call Mastercard’s Revoke Third Party Access operation with the consent receipt ID.
  2. Cancel the Straddle paykey.
Mastercard revocation stops future account data requests. Paykey cancellation stops future payment use through Straddle. Revoking the consent receipt alone does not cancel the paykey.