/

10 minute read

September 4, 2020

Program Gateway Funding Sources

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 Just-in-Time (JIT) Funding transactions. For more information about JIT Funding, see About Just-in-Time Funding.

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 all rules and regulations. Contact Marqeta for more information.

Create program gateway source

Action: POST
Endpoint: /fundingsources/programgateway

Develop Now!

Sign in and use your sandbox to access the API Explorer

Creates a program gateway funding source. A program gateway funding source is a transaction relay that, when configured, allows you to approve or decline transactions in real time.

Body field details

Fields Description

token

string
Optional

The 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:

36 char max

url

string
Required

The URL of the gateway endpoint hosted in your environment, to which POST messages are submitted by the Marqeta platform.

Allowable Values:

  • 250 char max

  • Must be HTTPS

  • Empty string not allowed

basic_auth_username

string
Required

Username for authenticating your environment.

Allowable Values:

50 char max

basic_auth_password

string
Required

Password for authenticating your environment.

Allowable Values:

  • 20-100 characters

  • 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: @#$%!^&*()\_+~`-=[]{},;:'",./<>?

name

string
Required

The name of the program gateway funding source.

Allowable Values:

50 char max

timeout_millis

integer
Optional

Total timeout in milliseconds for gateway processing.

Allowable Values:

3000 max

Default value:
3000

custom_header

object
Optional

Contains information about custom HTTP headers that supply additional details required for the program gateway funding source’s outgoing call.

Allowable Values:

active

boolean
Optional

Indicates whether the program gateway funding source is active.

Allowable Values:

true, false

Default value:
true

The custom_header object

Fields Description

my_header_name_1
my_header_name_2
my_header_name_3

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. These custom headers also appear in the associated webhook’s notifications.

You can define the name and value of up to three headers, as shown below:

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

Is this helpful?

Allowable Values:

  • Up to three name-value pairs

  • 500 char max per name

  • 500 char max per value

Sample request body

{
  "token": "my_pgfs_token",
  "basic_auth_username": "my_username",
  "basic_auth_password": "My_20-character-min_password",
  "url": "https://my_secure_domain.com/my_gateway",
  "name": "my_pgfs_name"
}

Is this helpful?

Sample response body

{
  "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": "2019-11-30T20:00:51Z",
  "last_modified_time": "2019-11-30T20:00:51Z",
  "basic_auth_username": "my_username",
  "basic_auth_password": "My_20-character-min_password",
  "timeout_millis": 3000
}

Is this helpful?

Update program gateway source

Action: PUT
Endpoint: /fundingsources/programgateway/{token}

Develop Now!

Sign in and use your sandbox to access the API Explorer

Updates a program gateway funding source. Only the values of parameters specified in the request are modified; all others are left unchanged.

URL path parameters

Fields Description

token

string
Required

Identifies the program gateway funding source to retrieve.

Allowable Values:

Existing program gateway funding source token.

Send a GET request to /fundingsources/user/{user_token} to retrieve existing funding source tokens for a user or to /fundingsources/business/{business_token} to retrieve existing funding source tokens for a business.

Body field details

Fields Description

url

string
Required

The URL of the gateway endpoint hosted in your environment, to which POST messages are submitted by the Marqeta platform.

Allowable Values:

  • 250 char max

  • Must be HTTPS

  • Empty string not allowed

timeout_millis

integer
Optional

Total timeout in milliseconds for gateway processing.

Allowable Values:

3000 max

Default value:
3000

custom_header

object
Optional

Contains information about custom HTTP headers that supply additional details required for the program gateway funding source’s outgoing call.

Allowable Values:

basic_auth_username

string
Required

Username for authenticating your environment.

Allowable Values:

50 char max

basic_auth_password

string
Required

Password for authenticating your environment.

Allowable Values:

  • 20-100 characters

  • 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: @#$%!^&*()\_+~`-=[]{},;:'",./<>?

active

boolean
Optional

Indicates whether the program gateway funding source is active.

Allowable Values:

true, false

Default value:
true

name

string
Optional

The name of the program gateway funding source.

Allowable Values:

50 char max

The custom_header object

Fields Description

my_header_name_1
my_header_name_2
my_header_name_3

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. These custom headers also appear in the associated webhook’s notifications.

You can define the name and value of up to three headers, as shown below:

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

Is this helpful?

Allowable Values:

  • Up to three name-value pairs

  • 500 char max per name

  • 500 char max per value

Sample request body

{
  "active": false
}

Is this helpful?

Sample response body

{
  "name": "my_pgfs_name",
  "active": false,
  "token": "my_pgfs_token",
  "account": "12.003.001.000155",
  "url": "https://my_secure_domain.com/my_gateway",
  "created_time": "2019-11-30T20:00:51Z",
  "last_modified_time": "2019-11-30T23:39:10Z",
  "basic_auth_username": "my_username",
  "basic_auth_password": "My_20-character-min_password",
  "timeout_millis": 3000
}

Is this helpful?

Retrieve program gateway source

Action: GET
Endpoint: /fundingsources/programgateway/{token}

Develop Now!

Sign in and use your sandbox to access the API Explorer

Retrieves a specific program gateway funding source.

URL path parameters

Fields Description

token

string
Required

Identifies the program gateway funding source to retrieve.

Allowable Values:

Existing program gateway funding source token.

Send a GET request to /fundingsources/user/{user_token} to retrieve existing funding source tokens for a user or to /fundingsources/business/{business_token} to retrieve existing funding source tokens for a business.

Sample response body

{
  "name": "my_pgfs_name",
  "active": false,
  "token": "my_pgfs_token",
  "account": "12.003.001.000155",
  "url": "https://my_secure_domain.com/my_gateway",
  "created_time": "2019-11-30T20:00:51Z",
  "last_modified_time": "2019-11-30T23:39:10Z",
  "basic_auth_username": "my_username",
  "basic_auth_password": "My_20-character-min_password",
  "timeout_millis": 3000
}

Is this helpful?

Update program gateway source custom headers

Action: PUT
Endpoint: fundingsources/programgateway/customheaders/{programgateway_token}

Develop Now!

Sign in and use your sandbox to access the API Explorer

Adds or updates custom HTTP headers for a specific program gateway funding source.

URL path parameters (request)

Fields Description

token

string
Required

Identifies the program gateway funding source whose HTTP headers you want to update.

Allowable Values:

Existing program gateway funding source token.

Send a GET request to /fundingsources/user/{user_token} to retrieve existing funding source tokens for a user or to /fundingsources/business/{business_token} to retrieve existing funding source tokens for a business.

Body field details (request)

Fields Description

custom_header

object
Required

Contains information about custom HTTP headers that supply additional details required for the program gateway funding source’s outgoing call.

  • If no custom headers are present, calling this endpoint adds the values in the custom_header object.

  • If custom headers are present, calling this endpoint overwrites them with the values in the custom_header object.

Allowable Values:

The custom_header object

Fields Description

my_header_name_1
my_header_name_2
my_header_name_3

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. These custom headers also appear in the associated webhook’s notifications.

You can define the name and value of up to three headers, as shown below:

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

Is this helpful?

Allowable Values:

  • Up to three name-value pairs

  • 500 char max per name

  • 500 char max per value

Body field details (response)

Fields Description

name

string
Returned

The name of the program gateway funding source.

Allowable Values:

50 char max

active

boolean
Returned

Indicates whether the program gateway funding source is active.

Allowable Values:

true, false

Default value:
true

token

string
Returned

Identifies the program gateway funding source.

Allowable Values:

Existing program gateway funding source token.

url

string
Returned

The URL of the gateway endpoint hosted in your environment, to which POST messages are submitted by the Marqeta platform.

Allowable Values:

  • 250 char max

  • Must be HTTPS

  • Empty string not allowed

created_time

datetime
Returned

Time when the program gateway funding source was created.

Allowable Values:

Valid timestamp

last_modified_time

datetime
Returned

Time when the program gateway funding source was last modified.

Allowable Values:

Valid timestamp

basic_auth_username

string
Returned

Username for authenticating your environment.

Allowable Values:

50 char max

basic_auth_password

string
Returned

Password for authenticating your environment.

Allowable Values:

  • 20-100 characters

  • 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: @#$%!^&*()\_+~`-=[]{},;:'",./<>?

timeout_millis

integer
Returned

Total timeout in milliseconds for gateway processing.

Allowable Values:

3000 max

Default value:
3000

custom_header

object
Returned

Contains information about custom HTTP headers that supply additional details required for the program funding source’s outgoing call.

Allowable Values:

Sample request body

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

Is this helpful?

Sample response body

{
  "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": "2020-03-30T20:00:51Z",
  "last_modified_time": "2020-03-30T23:39:10Z",
  "basic_auth_username": "my_username",
  "basic_auth_password": "My_20-character-min_password",
  "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"
  }
}

Is this helpful?

Have any feedback on this page?

If you feel we can do anything better, please let our team know.

We strive for the best possible developer experience.