> ## 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.

# Create program gateway source

> Creates a program gateway funding source.

POST/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 boolean  Optional | Indicates whether the program gateway funding source is active. **Allowable Values:**  `true`, `false` **Default value:** `false` |
| basic\_auth\_password string  Required | Password for authenticating your environment. **Allowable Values:**  20–50 chars  - Must contain at least one numeral  - Must contain at least one lowercase letter  - Must contain at least one uppercase letter  - Must contain at least one of these symbols: ``@ # $ % ! ^ & * ( ) \ _ + ~ ` - = [ ]  , ; : ' " , . / < > ?`` |
| basic\_auth\_username string  Required | Username for authenticating your environment. **Allowable Values:**  1–50 chars |
| custom\_header object  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. **Allowable Values:**  Up to three name-value pairs: 500 char max per name, 500 char max per value |
| name string  Required | Name of the program gateway funding source. **Allowable Values:**  1–50 chars |
| timeout\_millis integer  Optional | Total timeout in milliseconds for gateway processing. **Allowable Values:**  1000–3000 **Default value:** 3000 |
| token string  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. **Allowable Values:**  1–36 chars |
| url string  Required | URL of the gateway endpoint hosted in your environment, to which `POST` requests are submitted by the Marqeta platform. **Allowable Values:**  250 char max  Must be HTTPS |
| use\_mtls boolean  Optional | Specifies whether or not to use mutual transport layer security (mTLS) authentication for the funding request. 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. **Allowable Values:**  `true`, `false` **Default value:** `false` |

## Sample request body

```json JSON lines wrap theme={null}
{
  "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 string  Returned | Bank account number. **Allowable Values:**  36 char max |
| active boolean  Conditionally returned | Indicates whether the program gateway funding source is active. This field is returned if it exists in the resource. **Allowable Values:**  `true`, `false` |
| basic\_auth\_password string  Returned | Password for authenticating your environment. **Allowable Values:**  Existing `basic_auth` password |
| basic\_auth\_username string  Returned | Username for authenticating your environment. **Allowable Values:**  Existing `basic_auth` username |
| created\_time datetime  Returned | Date and time when the resource was created, in UTC. **Allowable Values:**  datetime **Format:** yyyy-MM-ddThh:mm:ssZ |
| custom\_header object  Returned | Additional custom information included in the HTTP header. **Allowable Values:**  Up to three name-value pairs: 500 char max per name, 500 char max per value |
| last\_modified\_time datetime  Returned | Date and time when the resource was last modified, in UTC. **Allowable Values:**  datetime **Format:** yyyy-MM-ddThh:mm:ssZ |
| name string  Returned | Name of the program gateway funding source. **Allowable Values:**  1–50 chars |
| timeout\_millis integer  Returned | Total timeout in milliseconds for gateway processing. **Allowable Values:**  1000-3000 |
| token string  Returned | Unique identifier of the program gateway funding source. **Allowable Values:**  1–36 chars |
| url string  Returned | URL of the gateway endpoint hosted in your environment, to which `POST` requests are submitted by the Marqeta platform. **Allowable Values:**  Existing URL |
| use\_mtls boolean  Returned | Specifies whether or not to use mutual transport layer security (mTLS) authentication for the funding request. 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. **Allowable Values:**  `true`, `false` |
| version string  Returned | Program gateway funding source object version. **Allowable Values:**  255 char max |

## Sample response body

```json JSON lines wrap theme={null}
{
  "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"
}
```


## Related topics

- [Program Gateway Funding Sources Overview](https://www.marqeta.com/docs/core-api/program-gateway-funding-sources.md)
- [Configuring Gateway JIT Funding](https://www.marqeta.com/docs/developer-guides/configuring-gateway-jit-funding.md)
- [Retrieve program gateway source](https://www.marqeta.com/docs/core-api/program-gateway-funding-sources/retrieve-program-gateway-source.md)
- [Update program gateway source](https://www.marqeta.com/docs/core-api/program-gateway-funding-sources/update-program-gateway-source.md)
- [Program Gateway Funding Sources Object](https://www.marqeta.com/docs/core-api/program-gateway-funding-sources/program-gateway-funding-sources-object.md)
