Skip to main content
Note
This feature requires additional activation steps. To learn more about this feature and activating it for your program, contact your Marqeta representative.
Use the Credit Program Gateways endpoints to create, retrieve, and update Program Gateways for your credit program. A Program Gateway allows you to exchange messages with Marqeta’s credit platform regarding decisions on transaction authorizations. For more on Program Gateways, see About Credit Program Gateways.

Create Program Gateway

Action: POST
Endpoint: /credit/programgateways
Create a new Credit Program Gateway. Use this endpoint to configure your Program Gateway to receive gateway requests from Marqeta’s credit platform. You can create multiple Program Gateways, but only one can be active per credit program.
Note
To create a Program Gateway, you must have consumer or admin credentials.

Request body

FieldsDescription
token

string

Optional
Unique identifier of the Program Gateway.

If you do not include a token, the system generates one automatically. As this token is necessary for use in other calls, it is recommended 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
name

string

Required
Name of the Program Gateway.

Allowable Values:

255 char max
url

string

Required
URL of the Program Gateway endpoint hosted in your environment and configured to receive authorization requests made by the Marqeta platform. Must be HTTPS.

Allowable Values:

250 char max
basic_auth_username

string

Required
Basic Authentication username for authenticating your environment.

Allowable Values:

50 char max
basic_auth_password

string

Required
Basic Authentication password for authenticating your environment.

Allowable Values:

20–50 chars
timeout_millis

integer

Optional
Total timeout for Program Gateway calls, in milliseconds.

Allowable Values:

1–2000
active

boolean

Optional
Indicates whether the Program Gateway is active.

Allowable Values:

true, false
mtls

boolean

Optional
Indicates whether the Program Gateway uses mutual Transport Layer Security (mTLS).

Allowable Values:

true, false
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 Program Gateway 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

Example:

json JSON { "custom_header": { "customer_header_key_1": "customer_header_value_1", "customer_header_key_2": "customer_header_value_2", "customer_header_key_3": "customer_header_value_3" } }

Sample request body

JSON
{
  "name": "My Program Gateway",
  "url": "https://my-url",
  "basic_auth_username": "my_username",
  "basic_auth_password": "my_20-50_character_password",
  "custom_header": {
    "my_header_name_1": "my_value_1"
  }
}

Response body

FieldsDescription
token

string

Conditionally returned
Unique identifier of the Program Gateway.

Allowable Values:

36 char max
name

string

Conditionally returned
Name of the Program Gateway.

Allowable Values:

255 char max
url

string

Conditionally returned
URL of the Program Gateway endpoint hosted in your environment and configured to receive authorization requests made by the Marqeta platform.

Allowable Values:

250 char max
basic_auth_username

string

Conditionally returned
Basic Authentication username for authenticating your environment.

Allowable Values:

50 char max
basic_auth_password

string

Conditionally returned
Basic Authentication password for authenticating your environment.

Allowable Values:

20–50 chars
timeout_millis

integer

Conditionally returned
Total timeout for Program Gateway calls, in milliseconds.

Allowable Values:

2000 max
active

boolean

Conditionally returned
Indicates whether the Program Gateway is active.

Allowable Values:

true, false
custom_header

object

Conditionally 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
mtls

boolean

Conditionally returned
Indicates whether the Program Gateway uses mutual Transport Layer Security (mTLS).

Allowable Values:

true, false
created_time

datetime

Conditionally returned
Date and time when the Program Gateway was created on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ
updated_time

datetime

Conditionally returned
Date and time when the Program Gateway was last updated on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ

List Program Gateways

Action: GET
Endpoint: /credit/programgateways
Retrieve an array of existing Credit Program Gateways. This endpoint supports sorting and pagination.

URL query parameters

FieldsDescription
count

integer

Optional
Number of Program Gateway resources to retrieve.

Allowable Values:

1–100
start_index

integer

Optional
Sort order index of the first resource in the returned array.

Allowable Values:

0 min
sort_by

string

Optional
Field on which to sort. Prefix the field name with a hyphen (-) to sort in descending order. Omit the hyphen to sort in ascending order.

NOTE: You must sort using system field names such as lastModifiedTime, and not by the field names appearing in response bodies such as last_modified_time.

Allowable Values:

lastModifiedTime, -lastModifiedTime

Response body

FieldsDescription
count

integer

Returned
Number of resources returned.

Allowable Values:

1-10
start_index

integer

Returned
Sort order index of the first resource in the returned array.

Allowable Values:

Any integer
end_index

integer

Returned
Sort order index of the last resource in the returned array.

Allowable Values:

Any integer
is_more

boolean

Returned
A value of true indicates that more unreturned resources exist.

Allowable Values:

true, false
data

array of objects

Returned
Contains one or more Program Gateway objects.

Allowable Values:

One or more Program Gateway objects
data[].token

string

Conditionally returned
Unique identifier of the Program Gateway.

Allowable Values:

36 char max
data[].name

string

Conditionally returned
Name of the Program Gateway.

Allowable Values:

255 char max
data[].url

string

Conditionally returned
URL of the Program Gateway endpoint hosted in your environment and configured to receive authorization requests made by the Marqeta platform.

Allowable Values:

250 char max
data[].basic_auth_username

string

Conditionally returned
Basic Authentication username for authenticating your environment.

Allowable Values:

50 char max
data[].basic_auth_password

string

Conditionally returned
Basic Authentication password for authenticating your environment.

Allowable Values:

20–50 chars
data[].timeout_millis

integer

Conditionally returned
Total timeout for Program Gateway calls, in milliseconds.

Allowable Values:

2000 max
data[].active

boolean

Conditionally returned
Indicates whether the Program Gateway is active.

Allowable Values:

true, false
data[].custom_header

object

Conditionally 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
data[].mtls

boolean

Conditionally returned
Indicates whether the Program Gateway uses mutual Transport Layer Security (mTLS).

Allowable Values:

true, false
data[].created_time

datetime

Conditionally returned
Date and time when the Program Gateway was created on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ
data[].updated_time

datetime

Conditionally returned
Date and time when the Program Gateway was last updated on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ

Retrieve Program Gateway

Action: GET
Endpoint: /credit/programgateways/{token}
Retrieve an existing Credit Program Gateway.

URL path parameters

FieldsDescription
token

string

Required
Unique identifier of the Program Gateway to retrieve.

Send a GET request to /credit/programgateways to retrieve existing Program Gateway tokens.

Allowable Values:

Existing Program Gateway token

Response body

FieldsDescription
token

string

Conditionally returned
Unique identifier of the Program Gateway.

Allowable Values:

36 char max
name

string

Conditionally returned
Name of the Program Gateway.

Allowable Values:

255 char max
url

string

Conditionally returned
URL of the Program Gateway endpoint hosted in your environment and configured to receive authorization requests made by the Marqeta platform.

Allowable Values:

250 char max
basic_auth_username

string

Conditionally returned
Basic Authentication username for authenticating your environment.

Allowable Values:

50 char max
basic_auth_password

string

Conditionally returned
Basic Authentication password for authenticating your environment.

Allowable Values:

20–50 chars
timeout_millis

integer

Conditionally returned
Total timeout for Program Gateway calls, in milliseconds.

Allowable Values:

2000 max
active

boolean

Conditionally returned
Indicates whether the Program Gateway is active.

Allowable Values:

true, false
custom_header

object

Conditionally 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
mtls

boolean

Conditionally returned
Indicates whether the Program Gateway uses mutual Transport Layer Security (mTLS).

Allowable Values:

true, false
created_time

datetime

Conditionally returned
Date and time when the Program Gateway was created on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ
updated_time

datetime

Conditionally returned
Date and time when the Program Gateway was last updated on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ

Sample response body

JSON
{
  "name": "My Program Gateway Name",
  "active": false,
  "token": "my_pg_token_1234",
  "url": "https://my_secure_domain.com/my_gateway",
  "created_time": "2024-11-30T20:00:51Z",
  "last_modified_time": "2024-11-30T23:39:10Z",
  "basic_auth_username": "my_username",
  "basic_auth_password": "my_20-50_character_password",
  "timeout_millis": 2000
}

Update Program Gateway

Action: PUT
Endpoint: /credit/programgateways/{token}
Update an existing Credit Program Gateway. You may want to update a Program Gateway if you are switching it to active or inactive, updating the URL, username, or password, and more.

URL path parameters

FieldsDescription
token

string

Required
Unique identifier of the Program Gateway to update.

Allowable Values:

Existing Program Gateway token

Request body

FieldsDescription
token

string

Optional
Unique identifier of the Program Gateway.

Allowable Values:

36 char max
name

string

Optional
Name of the Program Gateway.

Allowable Values:

255 char max
url

string

Optional
URL of the Program Gateway endpoint hosted in your environment and configured to receive authorization requests made by the Marqeta platform. Must be HTTPS.

Allowable Values:

250 char max
basic_auth_username

string

Optional
Basic Authentication username for authenticating your environment.

Allowable Values:

50 char max
basic_auth_password

string

Optional
Basic Authentication password for authenticating your environment.

Allowable Values:

20–50 chars
timeout_millis

integer

Optional
Total timeout for Program Gateway calls, in milliseconds.

Allowable Values:

2000 max
active

boolean

Optional
Indicates whether the Program Gateway is active.

Allowable Values:

true, false
mtls

boolean

Optional
Indicates whether the Program Gateway uses mutual Transport Layer Security (mTLS).

Allowable Values:

true, false
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 Program Gateway 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

Example:

json JSON lines wrap { "custom_header": { "customer_header_key_1": "customer_header_value_1", "customer_header_key_2": "customer_header_value_2", "customer_header_key_3": "customer_header_value_3" } }

Response body

FieldsDescription
token

string

Conditionally returned
Unique identifier of the Program Gateway.

Allowable Values:

36 char max
name

string

Conditionally returned
Name of the Program Gateway.

Allowable Values:

255 char max
url

string

Conditionally returned
URL of the Program Gateway endpoint hosted in your environment and configured to receive authorization requests made by the Marqeta platform.

Allowable Values:

250 char max
basic_auth_username

string

Conditionally returned
Basic Authentication username for authenticating your environment.

Allowable Values:

50 char max
basic_auth_password

string

Conditionally returned
Basic Authentication password for authenticating your environment.

Allowable Values:

20–50 chars
timeout_millis

integer

Conditionally returned
Total timeout for Program Gateway calls, in milliseconds.

Allowable Values:

2000 max
active

boolean

Conditionally returned
Indicates whether the Program Gateway is active.

Allowable Values:

true, false
custom_header

object

Conditionally 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
mtls

boolean

Conditionally returned
Indicates whether the Program Gateway uses mutual Transport Layer Security (mTLS).

Allowable Values:

true, false
created_time

datetime

Conditionally returned
Date and time when the Program Gateway was created on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ
updated_time

datetime

Conditionally returned
Date and time when the Program Gateway was last updated on Marqeta’s credit platform, in UTC.

Allowable Values:

Format: yyyy-MM-ddThh:mm:ssZ