## Documentation Index

Fetch the complete documentation index at: [/docs/llms.txt](/content/docs/llms.txt)

Use this file to discover all available pages before exploring further.

Use the `/fundingsources/programgateway` endpoint to create a program gateway funding source. A program gateway funding source represents a bank account from which funds are drawn for Gateway Just-in-Time (JIT) Funding transactions. For more information about JIT Funding, see [About Just-in-Time Funding](/content/docs/developer-guides/about-jit-funding/index.html). In a sandbox environment, you can create a program gateway funding source that simulates funds for use in 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**  
If you are using a third-party service to collect user funds, Marqeta and the issuing bank require specific reporting to ensure compliance with applicable rules and regulations. Contact Marqeta for more information.

## Create program gateway source

**Action:** `POST`  
**Endpoint:** `/fundingsources/programgateway`  
Creates a program gateway funding source. A program gateway funding source is a transaction relay that allows you to approve or decline transactions in real time.

### Request body

| Fields | Description |
| --- | --- |
| active<br>boolean<br>Optional | Indicates whether the program gateway funding source is active.<br>**Allowable Values:**<br>`true`, `false`<br>**Default value:**<br>`false` |
| basic_auth_password<br>string<br>Required | Password for authenticating your environment.<br>**Allowable Values:**<br>20–100 chars<br>\- Must contain at least one numeral<br>\- Must contain at least one lowercase letter<br>\- Must contain at least one uppercase letter<br>\- Must contain at least one of these symbols: ``@ # $ % ! ^ & * ( ) \ _ + ~ ` - = [ ]  , ; : ’ ” , . / < > ?`` |
| basic_auth_username<br>string<br>Required | Username for authenticating your environment.<br>**Allowable Values:**<br>1–50 chars |
| custom_header<br>object<br>Optional | Additional custom information included in the HTTP header. For example, this might contain security information, along with Basic Authentication, when making a JIT Funding request. Custom headers also appear in the associated webhook’s notifications.<br>**Allowable Values:**<br>Up to three name-value pairs: 500 char max per name, 500 char max per value |
| name<br>string<br>Required | Name of the program gateway funding source.<br>**Allowable Values:**<br>1–50 chars |
| timeout_millis<br>integer<br>Optional | Total timeout in milliseconds for gateway processing.<br>**Allowable Values:**<br>1000–3000<br>**Default value:**<br>3000 |
| token<br>string<br>Optional | Unique identifier of the program gateway funding source. If you do not include a token, the system will generate one automatically. As this token is necessary for use in other calls, we recommend that you define a simple and easy to remember string rather than letting the system generate a token for you. This value cannot be updated.<br>**Allowable Values:**<br>1–36 chars |
| url<br>string<br>Required | URL of the gateway endpoint hosted in your environment, to which `POST` requests are submitted by the Marqeta platform.<br>**Allowable Values:**<br>250 char max<br>Must be HTTPS |
| use_mtls<br>boolean<br>Optional | Specifies whether or not to use mutual transport layer security (mTLS) authentication for the funding request.<br>mTLS authentication is in the beta testing phase, and is not yet generally available. Contact your Marqeta representative for more information about using mTLS authentication.<br>**Allowable Values:**<br>`true`, `false`<br>**Default value:**<br>`false` |

### Sample request body

JSON

```json
{
  "token": "my_pgfs_token",
  "basic_auth_username": "my_username",
  "basic_auth_password": "my_20-to-100-character_password",
  "url": "https://my_secure_domain.com/my_gateway",
  "name": "my_pgfs_name"
}
```

### Response body

| Fields | Description |
| --- | --- |
| account<br>string<br>Returned | Bank account number.<br>**Allowable Values:**<br>36 char max |
| active<br>boolean<br>Conditionally returned | Indicates whether the program gateway funding source is active. This field is returned if it exists in the resource.<br>**Allowable Values:**<br>`true`, `false` |
| basic_auth_password<br>string<br>Returned | Password for authenticating your environment.<br>**Allowable Values:**<br>Existing `basic_auth` password |
| basic_auth_username<br>string<br>Returned | Username for authenticating your environment.<br>**Allowable Values:**<br>Existing `basic_auth` username |
| created_time<br>datetime<br>Returned | Date and time when the resource was created, in UTC.<br>**Allowable Values:**<br>datetime<br>**Format:**<br>yyyy-MM-ddThh:mm:ssZ |
| custom_header<br>object<br>Returned | Additional custom information included in the HTTP header.<br>**Allowable Values:**<br>Up to three name-value pairs: 500 char max per name, 500 char max per value |
| last_modified_time<br>datetime<br>Returned | Date and time when the resource was last modified, in UTC.<br>**Allowable Values:**<br>datetime<br>**Format:**<br>yyyy-MM-ddThh:mm:ssZ |
| name<br>string<br>Returned | Name of the program gateway funding source.<br>**Allowable Values:**<br>1–50 chars |
| timeout_millis<br>integer<br>Returned | Total timeout in milliseconds for gateway processing.<br>**Allowable Values:**<br>1000-3000 |
| token<br>string<br>Returned | Unique identifier of the program gateway funding source.<br>**Allowable Values:**<br>1–36 chars |
| url<br>string<br>Returned | URL of the gateway endpoint hosted in your environment, to which `POST` requests are submitted by the Marqeta platform.<br>**Allowable Values:**<br>Existing URL |
| use_mtls<br>boolean<br>Returned | Specifies whether or not to use mutual transport layer security (mTLS) authentication for the funding request.<br>mTLS authentication is in the beta testing phase, and is not yet generally available. Contact your Marqeta representative for more information about using mTLS authentication.<br>**Allowable Values:**<br>`true`, `false` |
| version<br>string<br>Returned | Program gateway funding source object version.<br>**Allowable Values:**<br>255 char max |

### Sample response body

JSON

```json
{
  "name": "my_pgfs_name",
  "active": true,
  "token": "my_pgfs_token",
  "account": "12.003.001.000155",
  "url": "https://my_secure_domain.com/my_gateway",
  "created_time": "2023-02-28T20:00:00Z",
  "last_modified_time": "2023-02-28T20:00:00Z",
  "basic_auth_username": "my_username",
  "basic_auth_password": "my_20-to-100-character_password",
  "use_mtls": false,
  "timeout_millis": 3000,
  "custom_header": {
    "my_header_name_1": "my_value_1",
    "my_header_name_2": "my_value_2",
    "my_header_name_3": "my_value_3"
  },
  "version": "2"
}
```

### Update program gateway source custom headers

**Action:** `PUT`  
**Endpoint:** `/fundingsources/programgateway/customheaders/{token}`  
Adds or updates custom HTTP headers for a specific program gateway funding source.

### URL path parameters

| Fields | Description |
| --- | --- |
| token<br>string<br>Required | Unique identifier of the program gateway funding source.<br>**Allowable Values:**<br>Existing program gateway funding source token |

### Request body

| Fields | Description |
| --- | --- |
| custom_header<br>object<br>Optional | Additional custom information included in the HTTP header. For example, this might contain security information, along with Basic Authentication, when making a JIT Funding request. Custom headers also appear in the associated webhook’s notifications.<br>**Allowable Values:**<br>Up to three name-value pairs: 500 char max per name, 500 char max per value |

### Sample request body

JSON

```json
{
  "custom_header": {
    "my_header_name_1": "my_value_1",
    "my_header_name_2": "my_value_2",
    "my_header_name_3": "my_value_3"
  }
}
```

### Response body

### Sample response body

JSON

### Retrieve program gateway source

**Action:** `GET`  
**Endpoint:** `/fundingsources/programgateway/{token}`  
Retrieves a specific program gateway funding source.

### URL path parameters

### Response body

### Sample response body

JSON

### Update program gateway source

**Action:** `PUT`  
**Endpoint:** `/fundingsources/programgateway/{token}`  
Update a program gateway funding source.
