Skip to main content

The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the GraphQL Admin API. For details and migration steps, visit our migration guide.

PaymentGateway

Requires payment_gateways access scope.

A payment gateway is a configuration that connects a shop to a payment provider, allowing the provider to authorize, capture, refund, and void payment transactions on behalf of the shop. Merchants use the Payment providers page in the Shopify admin to install and configure their payment gateways.

The PaymentGateway resource includes the shop's credentials for accessing the provider. An app can use this resource to install a payment gateway that enables the app to communicate with a payment provider. For example, an app that imports orders from an external marketplace can install a payment gateway to allow the marketplace to execute refund transactions through the app.

Was this section helpful?
#

Endpoints


Anchor to

The PaymentGateway resource

Anchor to

Properties


attachment

A large, encrypted credential used by some payment providers. If a value is provided for this property during gateway creation, then it isn't returned in the response. If no value is provided, then this property returns null.


created_at

The date and time (ISO 8601 format) when the payment gateway was created.


credential1

An encrypted credential, such as a username, a password, or an API key, that can be used to communicate with a payment provider. If a value is provided for this property during gateway creation, then it isn't returned in the response. If no value is provided, then this property returns null.


credential2

An encrypted credential, such as a username, a password, or an API key, that can be used to communicate with a payment provider. If a value is provided for this property during gateway creation, then it isn't returned in the response. If no value is provided, then this property returns null.


credential3

An encrypted credential, such as a username, a password, or an API key, that can be used to communicate with a payment provider. If a value is provided for this property during gateway creation, then it isn't returned in the response. If no value is provided, then this property returns null.


credential4

An encrypted credential, such as a username, a password, or an API key, that can be used to communicate with a payment provider. If a value is provided for this property during gateway creation, then it isn't returned in the response. If no value is provided, then this property returns null.


disabled

Whether the payment gateway is currently disabled. A gateway must be enabled for the payment provider to process transactions.


enabled_card_brands

The credit card brands that can be used with the payment provider.


id

The ID for the payment gateway.


name

The name of the payment provider.


processing_method

The type of payment processing that the payment provider uses. Valid values: checkout, direct, manual, offsite or express.


provider_id

The ID of the payment provider. Payment providers are configured in the Partner Dashboard.


Was this section helpful?
{}

The PaymentGateway resource

{
"attachment": null,
"created_at": "2025-07-01 18:03:22 UTC",
"credential1": "QUxpFfkMo78ITaNfojJ5oJXWHbzPJunqCYm",
"credential2": null,
"credential3": null,
"credential4": null,
"disabled": false,
"enabled_card_brands": [
"visa",
"master",
"american_express"
],
"id": 450789469,
"name": "shopify_payments",
"processing_method": "direct",
"provider_id": 1000001,
"sandbox": false,
"service_name": "Shopify Payments",
"supports_network_tokenization": false,
"type": "DirectPaymentGateway",
"updated_at": "2025-07-01 18:03:22 UTC"
}

Anchor to POST request, Creates a payment gateway, specifying the ID of the payment provider
post
Creates a payment gateway, specifying the ID of the payment provider

Creates a payment gateway, specifying the ID of the payment provider

Anchor to Parameters of Creates a payment gateway, specifying the ID of the payment providerParameters


api_version
string
required

Was this section helpful?

Anchor to post-payment-gateways-examplesExamples

Create a payment gateway

Request body
payment_gateway
Payment_gateway resource
Show payment_gateway properties
payment_gateway.credential1:"someone@example.com"

An encrypted credential, such as a username, a password, or an API key, that can be used to communicate with a payment provider. If a value is provided for this property during gateway creation, then it isn't returned in the response. If no value is provided, then this property returns null.

payment_gateway.provider_id:7

The ID of the payment provider. Payment providers are configured in the Partner Dashboard.

Was this section helpful?
post

/admin/api/2025-07/payment_gateways.json

curl -d '{"payment_gateway":{"credential1":"someone@example.com","provider_id":7}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2025-07/payment_gateways.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

{}

Response

JSON
HTTP/1.1 201 Created
{
"payment_gateway": {
"disabled": false,
"id": 1071179973,
"name": "authorize_net",
"provider_id": 7,
"sandbox": false,
"supports_network_tokenization": null,
"type": "DirectPaymentGateway",
"enabled_card_brands": [
"visa",
"master",
"american_express",
"discover",
"diners_club",
"jcb"
],
"processing_method": "direct",
"service_name": "Authorize.net",
"metadata": {},
"created_at": "2025-07-01T14:31:45-04:00",
"updated_at": "2025-07-01T14:31:45-04:00",
"credential1": "someone@example.com",
"credential3": null,
"credential4": null,
"attachment": null
}
}

Anchor to GET request, Retrieves a list of all of a shop's payment gateways
get
Retrieves a list of all of a shop's payment gateways

Retrieves a list of configured payment gateways


api_version
string
required

Was this section helpful?

Retrieve a list of payment gateways

Retrieve a list of the enabled payment gateways

Query parameters
disabled=false

Whether the payment gateway is currently disabled. A gateway must be enabled for the payment provider to process transactions.

Was this section helpful?
get

/admin/api/2025-07/payment_gateways.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/payment_gateways.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"payment_gateways": [
{
"disabled": true,
"id": 170508070,
"name": "Cash on Delivery (COD)",
"provider_id": 140,
"sandbox": false,
"supports_network_tokenization": null,
"type": "ManualPaymentGateway",
"enabled_card_brands": [],
"processing_method": "manual",
"service_name": "Cash on Delivery (COD)",
"metadata": {},
"created_at": "2025-07-01T14:28:21-04:00",
"updated_at": "2025-07-01T14:28:21-04:00"
},
{
"disabled": false,
"id": 431363653,
"name": "shopify_payments",
"provider_id": 87,
"sandbox": false,
"supports_network_tokenization": null,
"type": "DirectPaymentGateway",
"enabled_card_brands": [
"visa",
"master",
"american_express",
"discover",
"diners_club"
],
"processing_method": "direct",
"service_name": "Shopify Payments",
"metadata": {
"google_pay_merchant_id": 548380009
},
"created_at": "2011-12-31T19:00:00-05:00",
"updated_at": "2025-07-01T14:31:44-04:00",
"credential4": null,
"attachment": null
}
]
}

Retrieves a specific payment gateway


api_version
string
required

payment_gateway_id
string
required

Was this section helpful?

Get a representation of a single payment gateway

Path parameters
payment_gateway_id=431363653
string
required
Was this section helpful?
get

/admin/api/2025-07/payment_gateways/431363653.json

curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/payment_gateways/431363653.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 200 OK
{
"payment": {
"disabled": false,
"id": 431363653,
"name": "shopify_payments",
"provider_id": 87,
"sandbox": false,
"supports_network_tokenization": null,
"type": "DirectPaymentGateway",
"enabled_card_brands": [
"visa",
"master",
"american_express",
"discover",
"diners_club"
],
"processing_method": "direct",
"service_name": "Shopify Payments",
"metadata": {
"google_pay_merchant_id": 548380009
},
"created_at": "2011-12-31T19:00:00-05:00",
"updated_at": "2025-07-01T14:31:43-04:00",
"credential4": null,
"attachment": null
}
}

Updates a payment gateway


api_version
string
required

payment_gateway_id
string
required

Was this section helpful?

Update the payment gateway's sandbox status to true

Path parameters
payment_gateway_id=170508070
string
required
Request body
payment_gateway
Payment_gateway resource
Show payment_gateway properties
payment_gateway.id:170508070

The ID for the payment gateway.

payment_gateway.sandbox:true

Whether the payment gateway is operating in sandbox mode for testing purposes.

Was this section helpful?
put

/admin/api/2025-07/payment_gateways/170508070.json

curl -d '{"payment_gateway":{"id":170508070,"sandbox":true}}' \
-X PUT "https://your-development-store.myshopify.com/admin/api/2025-07/payment_gateways/170508070.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

{}

Response

JSON
HTTP/1.1 200 OK
{
"payment_gateway": {
"disabled": false,
"id": 170508070,
"name": "Cash on Delivery (COD)",
"provider_id": 140,
"sandbox": true,
"supports_network_tokenization": null,
"type": "ManualPaymentGateway",
"enabled_card_brands": [],
"processing_method": "manual",
"service_name": "Cash on Delivery (COD)",
"metadata": {},
"created_at": "2025-07-01T14:28:21-04:00",
"updated_at": "2025-07-01T14:31:47-04:00"
}
}

Deletes a payment gateway


api_version
string
required

payment_gateway_id
string
required

Was this section helpful?

Delete a payment gateway

Path parameters
payment_gateway_id=170508070
string
required
Was this section helpful?
del

/admin/api/2025-07/payment_gateways/170508070.json

curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-07/payment_gateways/170508070.json" \
-H "X-Shopify-Access-Token: {access_token}"

{}

Response

JSON
HTTP/1.1 204 No Content