> ## Documentation Index
> Fetch the complete documentation index at: https://www.marqeta.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Gateway JIT Funding Resources

> Learn about the program gateway funding source, card product, gateway endpoint, and webhook endpoint that Gateway JIT Funding requires.

This page describes the resources and endpoints that a Gateway Just-in-Time (JIT) Funding setup requires.
To create and test these resources in the sandbox, follow the [Configuring Gateway JIT Funding](https://www.marqeta.com/docs/developer-guides/configuring-gateway-jit-funding.md) tutorial.

## JIT Funding

JIT Funding automates the loading of funds into accounts in real time during the transaction process. In a Gateway JIT Funding setup, the Marqeta platform and your system both participate in authorization decisions. Funds are drawn from the program gateway funding source defined by the card product.

The Marqeta platform and your system exchange messages of the following types:

* **JIT Funding requests** are actionable messages sent by the Marqeta platform requesting permission to fund a specific transaction.
* **JIT Funding responses** are sent by your gateway to the Marqeta platform in response to a funding request.
* **JIT Funding notifications** are transaction event messages sent by the Marqeta platform to your webhook endpoint (not your gateway endpoint). These asynchronous messages contain the entire transaction and inform you about its ultimate outcome.

For more information about JIT Funding, see [About Just-in-Time Funding](https://www.marqeta.com/docs/developer-guides/about-jit-funding.md).

## Program gateway funding source

A program gateway funding source represents a bank account from which funds are drawn for JIT-funded transactions. In the public and private sandbox environments, you can create a program gateway funding source that simulates funds for your test transactions. In a production environment, you must work with a Marqeta representative to define the bank account from which the program gateway funding source draws funds.

> [!NOTE]
>
> **Note**\
> If you are using a third-party service to collect user funds, Marqeta and the issuing bank require specific reporting to ensure compliance with all rules and regulations. Contact your Marqeta representative for more information.

For a complete description of the `/fundingsources/programgateway` endpoint, see [Program Gateway Funding Sources](https://www.marqeta.com/docs/core-api/program-gateway-funding-sources/).

## Card product configuration

A card product defines attributes and behaviors for a set of cards. Each card product has a single funding source, which funds all transactions conducted using an associated card. Gateway JIT Funding setups require you to create a card product associated with a program gateway funding source.

> [!NOTE]
>
> **Note**\
> You can create and configure card products in the public and private sandbox environments. To create a new card product for production, contact your Marqeta representative for more information.

For a complete description of the `/cardproducts` endpoint, see [Card Products](https://www.marqeta.com/docs/core-api/card-products/).

## Your gateway endpoint

To participate in Gateway JIT Funding decisions, your system must respond to requests sent by the Marqeta platform. Your system can respond to a funding request in the following ways:

* To approve, set the HTTP response code to `200 OK`.
* To deny, set the HTTP response code to `402 Request Failed`.

For more information on handling Gateway JIT Funding events, see [Gateway JIT Funding Messages](https://www.marqeta.com/docs/core-api/gateway-jit-funding-messages.md).

## Your webhook endpoint

To handle informative Gateway JIT Funding messages, your system must include an endpoint for receiving event notifications. Within seconds of each transaction, the Marqeta platform sends webhook notifications to your endpoint to enable you to track requests, maintain balances, and resolve timeout issues.

Your system must respond to each informative JIT Funding request using the `200 OK` HTTP response code. If your system does not respond with the `200 OK` HTTP response code, the Marqeta platform will try to resend the message. For more information about the Marqeta platform webhook system, see [About Webhooks](https://www.marqeta.com/docs/developer-guides/about-webhooks.md).


## Related topics

- [Configuring Gateway JIT Funding](https://www.marqeta.com/docs/developer-guides/configuring-gateway-jit-funding.md)
- [Using AVS with JIT Funding](https://www.marqeta.com/docs/developer-guides/using-avs-with-jit-funding.md)
- [Gateway JIT Funding Implementation Sample Code](https://www.marqeta.com/docs/developer-guides/gateway-jit-funding-implementation-sample-code.md)
- [Gateway JIT Funding Scenarios](https://www.marqeta.com/docs/developer-guides/gateway-jit-funding-scenarios.md)
- [Gateway JIT Funding Messages](https://www.marqeta.com/docs/core-api/gateway-jit-funding-messages.md)
