--- title: PaymentGateway description: Connect a shop to a payment provider api_version: 2025-10 api_name: admin-rest api_type: rest source_url: html: https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway md: https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway.md --- ![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg) 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](https://shopify.dev/docs/api/admin-graphql). For details and migration steps, visit our [migration guide](https://shopify.dev/docs/apps/build/graphql/migrate). # Payment​Gateway 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. \# ## Endpoints * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway#post-payment-gateways) [/admin/api/latest/payment\_​gateways.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway#post-payment-gateways) Creates a payment gateway, specifying the ID of the payment provider * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway#get-payment-gateways) [/admin/api/latest/payment\_​gateways.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway#get-payment-gateways) Retrieves a list of all of a shop's payment gateways * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway#get-payment-gateways-payment-gateway-id) [/admin/api/latest/payment\_​gateways/{payment\_​gateway\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway#get-payment-gateways-payment-gateway-id) Retrieves a specific payment gateway * [put](https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway#put-payment-gateways-payment-gateway-id) [/admin/api/latest/payment\_​gateways/{payment\_​gateway\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway#put-payment-gateways-payment-gateway-id) Updates a payment gateway * [del](https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway#delete-payment-gateways-payment-gateway-id) [/admin/api/latest/payment\_​gateways/{payment\_​gateway\_​id}.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/paymentgateway#delete-payment-gateways-payment-gateway-id) Deletes a payment gateway *** ## The PaymentGateway resource ### 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](https://en.wikipedia.org/wiki/ISO_8601)) 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](https://partners.shopify.com/organizations). *** {} ## The PaymentGateway resource ```json { "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" } ``` *** ## postCreates a payment gateway, specifying the ID of the payment provider Creates a payment gateway, specifying the ID of the payment provider ### Parameters *** api\_version string required *** ### Examples 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](https://partners.shopify.com/organizations). post ## /admin/api/2025-10/payment\_​gateways.​json ```bash curl -d '{"payment_gateway":{"credential1":"someone@example.com","provider_id":7}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```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 } } ``` ### examples * #### Create a payment gateway ##### ```curl curl -d '{"payment_gateway":{"credential1":"someone@example.com","provider_id":7}}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix 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, }); ``` ##### ```ruby # 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! ``` ##### ```node // 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 ```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}} ``` *** ## getRetrieves a list of all of a shop's payment gateways Retrieves a list of configured payment gateways ### Parameters *** api\_version string required *** ### Examples 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. get ## /admin/api/2025-10/payment\_​gateways.​json ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```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 } ] } ``` ### examples * #### Retrieve a list of payment gateways ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.PaymentGateway.all({ session: session, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::PaymentGateway.all( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.PaymentGateway.all({ session: session, }); ``` #### 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}]} ``` * #### Retrieve a list of the enabled payment gateways ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways.json?disabled=false" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.PaymentGateway.all({ session: session, disabled: "false", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::PaymentGateway.all( session: test_session, disabled: "false", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.PaymentGateway.all({ session: session, disabled: "false", }); ``` #### response ```json 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}]} ``` *** ## getRetrieves a specific payment gateway Retrieves a specific payment gateway ### Parameters *** api\_version string required *** payment\_gateway\_id string required *** ### Examples Get a representation of a single payment gateway Path parameters payment\_​gateway\_​id=​431363653 string required get ## /admin/api/2025-10/payment\_​gateways/431363653.​json ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways/431363653.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```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 } } ``` ### examples * #### Get a representation of a single payment gateway ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways/431363653.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.PaymentGateway.find({ session: session, id: 431363653, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::PaymentGateway.find( session: test_session, id: 431363653, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.PaymentGateway.find({ session: session, id: 431363653, }); ``` #### 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}} ``` *** ## putUpdates a payment gateway Updates a payment gateway ### Parameters *** api\_version string required *** payment\_gateway\_id string required *** ### Examples 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. put ## /admin/api/2025-10/payment\_​gateways/170508070.​json ```bash curl -d '{"payment_gateway":{"id":170508070,"sandbox":true}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways/170508070.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```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" } } ``` ### examples * #### Update the payment gateway's sandbox status to true ##### ```curl curl -d '{"payment_gateway":{"id":170508070,"sandbox":true}}' \ -X PUT "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways/170508070.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix 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, }); ``` ##### ```ruby # 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! ``` ##### ```node // 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 ```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"}} ``` *** ## delDeletes a payment gateway Deletes a payment gateway ### Parameters *** api\_version string required *** payment\_gateway\_id string required *** ### Examples Delete a payment gateway Path parameters payment\_​gateway\_​id=​170508070 string required del ## /admin/api/2025-10/payment\_​gateways/170508070.​json ```bash curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways/170508070.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 204 No Content ``` ### examples * #### Delete a payment gateway ##### ```curl curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-10/payment_gateways/170508070.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.PaymentGateway.delete({ session: session, id: 170508070, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::PaymentGateway.delete( session: test_session, id: 170508070, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.PaymentGateway.delete({ session: session, id: 170508070, }); ``` #### response ```json HTTP/1.1 204 No Content ```