> ## 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 Implementation Sample Code

> Use this code sample to learn more about how Gateway JIT works with your system.

<h2 id="_gateway_jit_funding_implementation_sample_code">
  Gateway JIT Funding implementation sample code
</h2>

Marqeta offers Java sample code to demonstrate how to implement Gateway Just-in-Time (JIT) Funding. You can also use the sample code to learn about how real-world transactions work, even if you do not plan to implement JIT Funding in your program.

The sample code creates a user, card product, card, webhook endpoint, and JIT gateway endpoint for you to use in your public or private sandbox environment. The sample code uses these resources to simulate several common transaction scenarios so that you can view their results and better understand how each component works during a JIT Funding transaction.

The sample code uses [Simulations 2.0](/core-api/simulations-card-transactions/) to simulate several common transaction scenarios such as authorization and clearing, PIN debit transactions, and various error-handling scenarios, including:

* Basic authorization and clearing

* Authorization and clearing with multiple clearings for a single authorization

* Authorization and clearing with clearing amount greater than authorization amount

* Authorization, followed by advice and clearing

* Initial authorization, followed by incremental authorization and clearing

* Clearing only (i.e., force post)

* Basic PIN debit scenario

* Various error-handling scenarios

The preceding list is not exhaustive, because new scenarios are added to the sample code regularly.

You can download the JIT Funding implementation sample code from the [Marqeta GitHub repository](https://github.com/marqeta/reference-app).

Contact your Marqeta representative for more information. If you do not yet have a Marqeta representative, [contact us here](https://www.marqeta.com/contact-us).


## Related topics

- [Configuring Gateway JIT Funding](/docs/developer-guides/configuring-gateway-jit-funding.md)
- [About Just-in-Time Funding](/docs/developer-guides/about-jit-funding.md)
- [Gateway JIT Funding Messages](/docs/core-api/gateway-jit-funding-messages.md)
- [Gateway JIT Funding Scenarios](/docs/developer-guides/gateway-jit-funding-scenarios.md)
- [Using AVS with JIT Funding](/docs/developer-guides/using-avs-with-jit-funding.md)
