About Just-in-Time Funding

Just-in-Time (JIT) Funding is a method of automatically funding accounts in real time during the transaction process.

The standard funding model requires you to pre-load funds into individual accounts and maintain sufficient balances for each card holder's transactions. You must manage each account balance to avoid under-funded or over-funded accounts.

With JIT Funding, accounts do not need to carry a balance. Instead, the Marqeta platform automatically moves funds from your funding source into the account at transaction time. The Marqeta platform makes programmatic funding decisions based on the details of the transaction. You can also directly participate in the decision-making process by configuring an endpoint on your system to receive and respond to JIT Funding requests originating on the Marqeta platform. When a transaction is approved, the Marqeta platform moves funds from the funding source to the account.

At the end of this guide, you should understand:

  • The role of JIT Funding in transactions on the Marqeta platform.
  • The available types of JIT Funding.
  • How to implement JIT Funding.

Managed vs. Gateway JIT Funding

Marqeta supports the following types of JIT Funding:

  • Managed JIT Funding – The Marqeta platform applies spend controls to make authorization decisions.
  • Gateway JIT Funding – The Marqeta platform applies spend controls to make authorization decisions and forwards funding requests to your system (the gateway) to make funding decisions.

Managed JIT Funding simplifies the funding task by handling all authorization decisions on the Marqeta platform, but limits the level of control you have over the funding approval process.

Gateway JIT Funding enables your system to participate in each transaction. When a card holder with a JIT-funded account attempts to spend, the Marqeta platform sends a funding request containing details about the transaction to the gateway endpoint on your system. Your system makes a decision to allow or deny the funds based on your own business rules and returns the appropriate response to the Marqeta platform. This allows you to have a higher level of control over transactions, but requires your system to respond quickly and accurately to every funding request.

Note: The Marqeta platform only sends funding requests to your gateway endpoint if they are actionable (such as authorizations). For the remainder, the Marqeta platform sends a non-actionable notification to your webhook endpoint. You can use this data to update your account balances according to the transaction type–some transactions impact account balances and some do not. For more information, see Event Types.

Gateway JIT Funding also enables you to add metadata to your gateway's response that populates the transaction record with additional details, such as an order number. This metadata can facilitate correlation between records on your system and the Marqeta platform, and simplify reconciliation.

For more information on Gateway JIT Funding requests, responses, and notifications, see the Gateway JIT Funding Messages page.

The following table compares Managed JIT Funding with Gateway JIT Funding:

Managed JIT Funding Gateway JIT Funding
Authorization decisions Handled by the Marqeta platform based on spend controls. Handled by the Marqeta platform based on spend controls and your system's authorization logic.
Metadata injection No Yes
Sample use cases Non-reloadable cards; virtual cards for e-commerce.

See more about the Virtual solution.
Reloadable, multi-use cards; additional access to funds available to cards not issued by Marqeta; additional controls on top of those supported by the Marqeta platform.

See more about the Delivery solution.

JIT Funding at transaction time

The transaction approval process differs between Managed and Gateway JIT Funding. Notably, Managed JIT Funding does not interact with your system at all, while Gateway JIT Funding requires your system to respond to each funding request.

Managed JIT Funding process

When a card holder attempts to make a payment using an account configured for Managed JIT Funding, the following process occurs:

  1. The merchant sends an authorization message to the card network.
  2. The card network sends an authorization message to the Marqeta platform.
  3. The Marqeta platform uses spend controls to validate the authorization.
  4. If the authorization is valid, the Marqeta platform moves funds from the funding source into the card holder's account.
  5. The Marqeta platform returns an authorization response to the card network.
  6. The card network sends an authorization response to the merchant.

Gateway JIT Funding process

When a card holder attempts to make a payment using an account configured for Gateway JIT Funding, the following process occurs:

  1. The merchant sends an authorization message to the card network.
  2. The card network sends an authorization message to the Marqeta platform.
  3. The Marqeta platform uses spend controls to validate the authorization.
  4. If the authorization is valid, the Marqeta platform sends a funding request to your gateway endpoint.
  5. Your system approves or denies the funding request.
  6. Your system returns a funding response to the Marqeta platform.
  7. If the funding request is approved by your system, the Marqeta platform moves funds from the funding source into the card holder's account.
  8. The Marqeta platform returns an authorization response to the card network and sends an authorization notification to your webhook endpoint for validation.
  9. The card network sends an authorization response to the merchant.

For more examples of the Gateway JIT Funding process, see the Gateway JIT Funding Scenarios page.


JIT Funding implementation

You will work with Marqeta to enable JIT Funding for your program. Whether you use Managed or Gateway JIT Funding, Marqeta handles the creation of the following required objects on your behalf:

  • A funding source configured for JIT Funding; when using Gateway JIT Funding, the funding source also defines the endpoint on your system where the Marqeta platform sends funding requests.
  • A card product configured for JIT Funding associated with the above funding source.
  • Spend controls that define which transactions are approved or denied by the Marqeta platform.

Gateway JIT Funding requires additional setup. You must complete Marqeta's Gateway JIT Funding certification and implement the following on your system:

  • An endpoint on your system for receiving and responding to funding requests from the Marqeta platform. Communication between the Marqeta platform and your system requires TLS v1.2 or greater. Your endpoint must not allow communication using unencrypted HTTP or accept connections on port 80.
  • One or more funding-decision algorithms on your system that decides whether to approve or deny the request and returns the appropriate response to the Marqeta platform.
  • An endpoint on your system for receiving event notifications; the Marqeta platform sends webhook notifications to your endpoint within seconds of each transaction that enable you to track requests, maintain balances, and resolve time-out issues.

Gateway JIT Funding certification

When you use Gateway JIT Funding, you directly participate in the card network's authorization process. For this reason, it is essential for your gateway to respond both promptly and correctly in every supported transaction scenario.

Before enabling Gateway JIT Funding in your production environment, a Marqeta Customer Success representative works with you in a sandbox environment to ensure your gateway endpoint responds appropriately in each scenario. The sandbox environment provides real-time simulations of the transaction scenarios encountered in a production environment and provides the feedback necessary for resolving issues of accuracy and responsiveness.

Contact your Marqeta Customer Success representative for more information on Gateway JIT Funding certification.

Handling failures

There are multiple fallback measures for ensuring that cards continue to function in the event of a system failure during the transaction process. You can check the standin_approved_by field of a transaction record to see if Stand-in Processing (STIP) was necessary and who handled the transaction instead.

If the card network cannot connect to the Marqeta platform, it performs STIP. The card network makes authorization decisions as necessary and notifies the Marqeta platform later with information about transactions that occurred while STIP was enabled. The standin_approved_by field of the transaction will have a value of "NETWORK".

If your system cannot respond to a Gateway JIT Funding request, the Marqeta platform uses Commando Mode to make a decision in your place based on defined business rules. The Marqeta platform stores any unsent webhooks for later transmission, ensuring that card state and account balances on your system correspond with activity that occurred while Commando Mode was in effect. The standin_approved_by field of the transaction will have a value of "COMMANDO_AUTO" or "COMMANDO_MANUAL", depending on what triggered Commando Mode to be enabled.