Skip to main content
To participate in Gateway Just-in-Time (JIT) Funding decisions, your system must handle messages sent by the Marqeta platform and return the appropriate response. The Marqeta platform and your system exchange messages of the following types:
  • JIT Funding requests are actionable messages sent by the Marqeta platform to an endpoint on your system referred to as the JIT Funding gateway. These synchronous messages request permission to fund a specific transaction or to answer a balance inquiry.
  • JIT Funding responses are sent by your JIT Funding gateway to the Marqeta platform in response to a funding request or balance inquiry. Your gateway endpoint must respond to each funding request by approving or denying funding for the associated transaction. Your gateway must respond to each balance inquiry with the currently available balance for the account associated with the specified card. If you deny funding for the associated transaction, your JIT Funding response can include a descriptive decline reason. In addition, you can inject custom metadata into each response. Messages sent to the Marqeta platform must use the HTTPS protocol.
  • JIT Funding notifications are informative messages sent by the Marqeta platform to your webhook endpoint (not the JIT Funding gateway endpoint). These asynchronous messages contain the entire transaction and inform you about its ultimate outcome. Use JIT Funding notifications to validate that the Marqeta platform receives and correctly processes each of your funding responses.
These messages apply only to Gateway JIT Funding setups. For more information about JIT Funding, see About Just-in-Time Funding. For all transaction response fields, see Transactions.

The jit_funding object

Each JIT Funding message sent to your system contains a jit_funding object embedded in a gpa_order or gpa_order_unload object. Messages containing the gpa_order object indicate a load event, where funds are loaded into an account, while those containing the gpa_order_unload object indicate an unload event, where funds are removed from an account. The jit_funding object contains information about the funding event, including the associated user token and transaction amount. The method field indicates the type of transaction and whether the message is an actionable funding request sent to your gateway endpoint or an informative message sent to your webhook endpoint. Your gateway’s JIT Funding response must include the jit_funding object with the method found in the matching request. The following table summarizes the available methods: The jit_funding object also contains an address_verification object. This object stores address data provided by the purchaser and address data held on the Marqeta platform, as well as the address match determination made by the Marqeta platform. You can use this data to help make funding decisions in response to JIT Funding requests. For more information on how to use this object, see Using AVS with JIT Funding.

JIT Funding requests

The Marqeta platform sends JIT Funding requests to your gateway endpoint. Each request includes an abbreviated form of the related transaction (unless it is a non-financial balance inquiry, in which case there is no associated transaction). The request’s gpa_order.jit_funding object contains the details necessary for JIT Funding, including the amount of requested funding (note that other amount fields within the body might indicate different values).
Note
Each transaction and related JIT Funding request include only a subset of available fields, depending on the merchant, card network, or product/service purchased. For information about transaction fields, see Transactions.

Partial approval

The JIT Funding request message includes the partial_approval_capable field of the associated transaction. This field indicates whether your JIT Funding response can approve some amount less than the requested amount (partial_approval_capable is true) or must approve the entire amount (partial_approval_capable is false). For example, if you receive a JIT Funding request for 100,andpartialapprovalcapableistrue,yourresponsecanapproveasmalleramount,suchas100, and `partial_approval_capable` is `true`, your response can approve a smaller amount, such as 50. In your response, include the partial approval amount in the jit_funding.amount field, just as you would when approving the whole amount.
Note
Support for partial approval is dependent on the merchant.

Headers

Each JIT Funding request includes the following HTTP headers that inform your system about the details of the incoming request.

The gpa_order.jit_funding object

The gpa_order.jit_funding.address_verification object

The gpa_order.jit_funding.address_verification.request object

The gpa_order.jit_funding.address_verification.issuer object

The gpa_order.jit_funding.address_verification.issuer.on_file object

The gpa_order.jit_funding.address_verification.issuer.response object

Sample request (returned fields)

The following sample JIT Funding request contains only returned fields. These fields are present in every JIT Funding request.
JSON

Sample request (with selection of conditionally returned fields)

The following sample JIT Funding request contains returned fields, plus a selection of conditionally returned objects and fields such as gpa_order.jit_funding.original_jit_funding_token, gpa_order.jit_funding.address_verification, and digital_wallet_token.
JSON

Sample request for account verification

The following sample is a JIT Funding request for account verification, also known as a “zero-dollar authorization.”
JSON

JIT Funding responses

Your JIT Funding gateway must respond to each JIT Funding request and either approve or deny the requested funding. Ensure that your response body adheres to the specifications in this section. You must include all required fields regardless of whether you approve or deny the transaction. Balance inquiries require an additional balances object in the response.

Approving or denying the request

Use the following HTTP response codes to indicate whether you approve or deny the funding request.
  • To approve funding for the JIT Funding request: Set the HTTP response code to “200 OK”.
  • To deny funding for the JIT Funding request: Set the HTTP response code to “402 Request Failed”.

Response body field details

The jit_funding object

The jit_funding.address_verification.gateway object

The jit_funding.address_verification.gateway.on_file object

The jit_funding.address_verification.gateway.response object

The jit_funding.balances object

The balances object contains one or more objects for each currency of funds held by the associated account. For example, if an account only holds a balance in USD, there is one sub-object: USD. When responding to balance inquiries, you must include the jit_funding.balances object containing fields matching the request’s gpa.balances object. In the case of an ATM withdrawal, you should include the jit_funding.balances object in your JIT Funding response to display the current account balance, otherwise a balance of $0 is shown to the cardholder. You must populate the balances object with the correct amounts from your ledger. You should not include the amount field in your response.
Note
Your gateway must handle scenarios where cardholders make purchases and balance inquiries in quick succession.
Each currency-specific sub-object of jit_funding.balances contains the following fields:

Sample responses for authorizations

JSON
JSON

Sample response for balance inquiries

JSON

Sample response for an ATM withdrawal

JSON

JIT Funding notifications

The transaction that triggered the JIT Funding request and all associated transactions are sent to your system as webhook notifications. The JIT Funding notification body contains the entire transaction. To implement JIT Funding notifications, you must complete the following tasks:
  • Set up a webhook endpoint in your system to receive JIT Funding notifications.
  • Respond to each notification message with an HTTP response code of “200 OK” and an empty response body. (The Marqeta platform resends the message until it receives the appropriate response.)
You should use JIT Funding notifications to validate that the Marqeta platform receives and correctly processes each of your JIT Funding responses. Doing so safeguards against a situation where the Marqeta platform times out because of a delayed JIT Funding response and declines an authorization for which you already approved JIT Funding. In a case such as this, you need to know that the authorization was not approved and ensure that your cardholder is not debited for the transaction.

The gpa_order.jit_funding object

The gpa_order.jit_funding.address_verification object

The gpa_order.jit_funding.address_verification.issuer object

The gpa_order.jit_funding.address_verification.issuer.on_file object

The gpa_order.jit_funding.address_verification.issuer.response object

The gpa_order.jit_funding.address_verification.gateway object

The gpa_order.jit_funding.address_verification.gateway.on_file object

The gpa_order.jit_funding.address_verification.gateway.response object

The gpa_order.jit_funding.address_verification.request object

The gpa_order_unload.jit_funding object

Sample notification

JSON

Reconciliation with custom mapping

Through customization of the JIT Funding response, you can facilitate end-to-end reconciliation of JIT Funding-related activities in your system. The JIT Funding response originates from your system. The response contains two optional fields that you can use to inject custom metadata from your system into your JIT Funding-enabled authorization and authorization completion transactions. This mechanism enables you to map elements of your system (such as order numbers, invoice numbers, loan identifiers) to purchases (as represented by transactions).
Note
These two optional fields only appear in the transaction notifications for certain transaction events: authorizations and authorization completion.
The following sample code snippet shows these two optional fields in the JIT Funding response. The tags field is intended for holding a comma-delimited list of tags, whereas the memo field is intended for holding a free-form note containing additional information you would like included in your transaction data. Do not put personally identifiable information (PII) data here.
JSON
The authorization or authorization completion transaction stores the custom metadata contained in these fields for access throughout the transaction’s lifecycle. You can access this metadata via webhook notifications or by querying the /transactions endpoint (see Webhooks and Transactions). The following sample code snippet shows these fields in the context of a transaction:
JSON