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.
Payment Gateway
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.
Endpoints
- post/admin/api/latest/payment_
gateways. json Creates a payment gateway, specifying the ID of the payment provider - get/admin/api/latest/payment_
gateways. json Retrieves a list of all of a shop's payment gateways - get/admin/api/latest/payment_
gateways/{payment_ gateway_ id}. json Retrieves a specific payment gateway - put/admin/api/latest/payment_
gateways/{payment_ gateway_ id}. json Updates a payment gateway - del/admin/api/latest/payment_
gateways/{payment_ gateway_ id}. json Deletes a payment gateway
The PaymentGateway resource
Properties
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
.
The date and time (ISO 8601 format) when the payment gateway was created.
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
.
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
.
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
.
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
.
Whether the payment gateway is currently disabled. A gateway must be enabled for the payment provider to process transactions.
The credit card brands that can be used with the payment provider.
The ID for the payment gateway.
The name of the payment provider.
The type of payment processing that the payment provider uses. Valid values: checkout
, direct
, manual
, offsite
or express
.
The ID of the payment provider. Payment providers are configured in the Partner Dashboard.
The PaymentGateway resource
Anchor to POST request, Creates a payment gateway, specifying the ID of the payment providerpostCreates a payment gateway, specifying the ID of the payment provider
Creates a payment gateway, specifying the ID of the payment provider
Create a payment gateway
Create a payment gateway
Show payment_gateway properties
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
.
The ID of the payment provider. Payment providers are configured in the Partner Dashboard.
/admin/api/2025-07/payment_ gateways. json
Response
examples
Create a payment gateway
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"
const { admin, session } = await authenticate.admin(request); const payment_gateway = new admin.rest.resources.PaymentGateway({session: session}); payment_gateway.credential1 = "someone@example.com"; payment_gateway.provider_id = 7; await payment_gateway.save({ update: true, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session payment_gateway = ShopifyAPI::PaymentGateway.new(session: test_session) payment_gateway.credential1 = "someone@example.com" payment_gateway.provider_id = 7 payment_gateway.save!
// Session is built by the OAuth process const payment_gateway = new shopify.rest.PaymentGateway({session: session}); payment_gateway.credential1 = "someone@example.com"; payment_gateway.provider_id = 7; await payment_gateway.save({ update: true, });
response
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 gatewaysgetRetrieves a list of all of a shop's payment gateways
Retrieves a list of configured payment gateways
Retrieve a list of payment gateways
Retrieve a list of payment gateways
Retrieve a list of the enabled payment gateways
Retrieve a list of the enabled payment gateways
Whether the payment gateway is currently disabled. A gateway must be enabled for the payment provider to process transactions.
/admin/api/2025-07/payment_ gateways. json
Response
examples
Retrieve a list of payment gateways
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/payment_gateways.json" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.PaymentGateway.all({ session: session, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::PaymentGateway.all( session: test_session, )
// Session is built by the OAuth process await shopify.rest.PaymentGateway.all({ session: session, });
response
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}]}
Retrieve a list of the enabled payment gateways
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/payment_gateways.json?disabled=false" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.PaymentGateway.all({ session: session, disabled: "false", });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::PaymentGateway.all( session: test_session, disabled: "false", )
// Session is built by the OAuth process await shopify.rest.PaymentGateway.all({ session: session, disabled: "false", });
response
HTTP/1.1 200 OK{"payment_gateways":[{"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:40-04:00","credential4":null,"attachment":null}]}
Anchor to GET request, Retrieves a specific payment gatewaygetRetrieves a specific payment gateway
Retrieves a specific payment gateway
Get a representation of a single payment gateway
Get a representation of a single payment gateway
/admin/api/2025-07/payment_ gateways/431363653. json
Response
examples
Get a representation of a single payment gateway
curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-07/payment_gateways/431363653.json" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.PaymentGateway.find({ session: session, id: 431363653, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::PaymentGateway.find( session: test_session, id: 431363653, )
// Session is built by the OAuth process await shopify.rest.PaymentGateway.find({ session: session, id: 431363653, });
response
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}}
Anchor to PUT request, Updates a payment gatewayputUpdates a payment gateway
Updates a payment gateway
Update the payment gateway's sandbox status to true
Update the payment gateway's sandbox status to true
Show payment_gateway properties
The ID for the payment gateway.
Whether the payment gateway is operating in sandbox mode for testing purposes.
/admin/api/2025-07/payment_ gateways/170508070. json
Response
examples
Update the payment gateway's sandbox status to true
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"
const { admin, session } = await authenticate.admin(request); const payment_gateway = new admin.rest.resources.PaymentGateway({session: session}); payment_gateway.id = 170508070; payment_gateway.sandbox = true; await payment_gateway.save({ update: true, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session payment_gateway = ShopifyAPI::PaymentGateway.new(session: test_session) payment_gateway.id = 170508070 payment_gateway.sandbox = true payment_gateway.save!
// Session is built by the OAuth process const payment_gateway = new shopify.rest.PaymentGateway({session: session}); payment_gateway.id = 170508070; payment_gateway.sandbox = true; await payment_gateway.save({ update: true, });
response
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"}}
Anchor to DELETE request, Deletes a payment gatewaydelDeletes a payment gateway
Deletes a payment gateway
Delete a payment gateway
Delete a payment gateway
/admin/api/2025-07/payment_ gateways/170508070. json
Response
examples
Delete a payment gateway
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-07/payment_gateways/170508070.json" \ -H "X-Shopify-Access-Token: {access_token}"
await admin.rest.resources.PaymentGateway.delete({ session: session, id: 170508070, });
# Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::PaymentGateway.delete( session: test_session, id: 170508070, )
// Session is built by the OAuth process await shopify.rest.PaymentGateway.delete({ session: session, id: 170508070, });
response
HTTP/1.1 204 No Content