API reference
Payment Method Domains
A payment method domain represents a web domain that you have registered with Stripe. Stripe Elements use registered payment method domains to control where certain payment methods are shown. Related guide: Payment method domains.
Create a payment method domain
POST/v1/payment_method_domains
Creates a payment method domain.
Body parameters
domain_namestringRequiredThe domain name that this payment method domain object represents.
enabledbooleanWhether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements or Embedded Checkout.
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The payment_method_domain object.
curl https://api.knoxapi.com/v1/payment_method_domains \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d domain_name=example.comconst Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const paymentMethodDomain = await stripe.paymentMethodDomains.create({
domain_name: 'example.com',
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
payment_method_domain = client.v1.payment_method_domains.create(params={
"domain_name": "example.com",
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
payment_method_domain = Stripe::PaymentMethodDomain.create({
domain_name: 'example.com',
}){
"apple_pay": {
"status": "active"
},
"created": 1234567890,
"domain_name": "example.com",
"enabled": true,
"google_pay": {
"status": "active"
},
"id": "pmd_1Pgc79B7WZ01zgkWHKCqwAQo",
"link": {
"status": "active"
},
"livemode": false,
"object": "payment_method_domain",
"paypal": {
"status": "active"
},
"amazon_pay": {
"status": "active"
},
"klarna": {
"status": "active"
}
}List payment method domains
GET/v1/payment_method_domains
Lists the details of existing payment method domains.
Query parameters
domain_namestringThe domain name that this payment method domain object represents.
enabledbooleanWhether this payment method domain is enabled. If the domain is not enabled, payment methods will not appear in Elements or Embedded Checkout
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of payment_method_domain objects.
curl -G https://api.knoxapi.com/v1/payment_method_domains \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const page = await stripe.paymentMethodDomains.list({
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
page = client.v1.payment_method_domains.list(params={
"limit": 3,
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
page = Stripe::PaymentMethodDomain.list({
limit: 3,
}){
"object": "list",
"url": "/v1/payment_method_domains",
"has_more": false,
"data": [
{
"apple_pay": {
"status": "active"
},
"created": 1234567890,
"domain_name": "example.com",
"enabled": true,
"google_pay": {
"status": "active"
},
"id": "pmd_1Pgc79B7WZ01zgkWHKCqwAQo",
"link": {
"status": "active"
},
"livemode": false,
"object": "payment_method_domain",
"paypal": {
"status": "active"
},
"amazon_pay": {
"status": "active"
},
"klarna": {
"status": "active"
}
}
]
}Update a payment method domain
POST/v1/payment_method_domains/{payment_method_domain}
Updates an existing payment method domain.
Path parameters
payment_method_domainstringRequired
Body parameters
enabledbooleanWhether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements or Embedded Checkout.
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The payment_method_domain object.
curl -X POST https://api.knoxapi.com/v1/payment_method_domains/pmd_1Pgc79B7WZ01zgkWHKCqwAQo \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const paymentMethodDomain = await stripe.paymentMethodDomains.update('pmd_1Pgc79B7WZ01zgkWHKCqwAQo');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
payment_method_domain = client.v1.payment_method_domains.update("pmd_1Pgc79B7WZ01zgkWHKCqwAQo")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
payment_method_domain = Stripe::PaymentMethodDomain.update('pmd_1Pgc79B7WZ01zgkWHKCqwAQo'){
"apple_pay": {
"status": "active"
},
"created": 1234567890,
"domain_name": "example.com",
"enabled": true,
"google_pay": {
"status": "active"
},
"id": "pmd_1Pgc79B7WZ01zgkWHKCqwAQo",
"link": {
"status": "active"
},
"livemode": false,
"object": "payment_method_domain",
"paypal": {
"status": "active"
},
"amazon_pay": {
"status": "active"
},
"klarna": {
"status": "active"
}
}Retrieve a payment method domain
GET/v1/payment_method_domains/{payment_method_domain}
Retrieves the details of an existing payment method domain.
Path parameters
payment_method_domainstringRequired
Query parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The payment_method_domain object.
curl https://api.knoxapi.com/v1/payment_method_domains/pmd_1Pgc79B7WZ01zgkWHKCqwAQo \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const paymentMethodDomain = await stripe.paymentMethodDomains.retrieve('pmd_1Pgc79B7WZ01zgkWHKCqwAQo');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
payment_method_domain = client.v1.payment_method_domains.retrieve("pmd_1Pgc79B7WZ01zgkWHKCqwAQo")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
payment_method_domain = Stripe::PaymentMethodDomain.retrieve('pmd_1Pgc79B7WZ01zgkWHKCqwAQo'){
"apple_pay": {
"status": "active"
},
"created": 1234567890,
"domain_name": "example.com",
"enabled": true,
"google_pay": {
"status": "active"
},
"id": "pmd_1Pgc79B7WZ01zgkWHKCqwAQo",
"link": {
"status": "active"
},
"livemode": false,
"object": "payment_method_domain",
"paypal": {
"status": "active"
},
"amazon_pay": {
"status": "active"
},
"klarna": {
"status": "active"
}
}Validate an existing payment method domain
POST/v1/payment_method_domains/{payment_method_domain}/validate
Some payment methods might require additional steps to register a domain. If the requirements weren’t satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn’t appear in Elements or Embedded Checkout for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: Payment method domains.
Path parameters
payment_method_domainstringRequired
Body parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The payment_method_domain object.
curl -X POST https://api.knoxapi.com/v1/payment_method_domains/pmd_1Pgc79B7WZ01zgkWHKCqwAQo/validate \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const paymentMethodDomain = await stripe.paymentMethodDomains.validate('pmd_1Pgc79B7WZ01zgkWHKCqwAQo');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
payment_method_domain = client.v1.payment_method_domains.validate("pmd_1Pgc79B7WZ01zgkWHKCqwAQo")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
payment_method_domain = Stripe::PaymentMethodDomain.validate('pmd_1Pgc79B7WZ01zgkWHKCqwAQo'){
"apple_pay": {
"status": "active"
},
"created": 1234567890,
"domain_name": "example.com",
"enabled": true,
"google_pay": {
"status": "active"
},
"id": "pmd_1Pgc79B7WZ01zgkWHKCqwAQo",
"link": {
"status": "active"
},
"livemode": false,
"object": "payment_method_domain",
"paypal": {
"status": "active"
},
"amazon_pay": {
"status": "active"
},
"klarna": {
"status": "active"
}
}Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.