Sample - Stripe API
POST/v1/payment_method_domains

Create a payment method domain

Creates a payment method domain that you have registered for payment-method display. Supply domain_name and optionally set enabled to control whether eligible payment methods appear in Elements or Embedded Checkout. The response includes the domain's status for supported payment methods.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 body fields

Payment method domain details used to register and configure a web domain.

domain_namestringrequired
The domain name that this payment method domain object represents.
enabledbooleanoptional
Whether 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<string>optional
Specifies which fields in the response should be expanded.

2 status codes
200Returns the created payment method domain, including its identifier, domain name, enabled state, creation time, live-mode state, and supported payment-method statuses.
amazon_payobjectrequired
Indicates the status of a specific payment method on a payment method domain.
apple_payobjectrequired
Indicates the status of a specific payment method on a payment method domain.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
domain_namestringrequired
The domain name that this payment method domain object represents.
enabledbooleanrequired
Whether 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.
google_payobjectrequired
Indicates the status of a specific payment method on a payment method domain.
idstringrequired
Unique identifier for the object.
klarnaobjectrequired
Indicates the status of a specific payment method on a payment method domain.
linkobjectrequired
Indicates the status of a specific payment method on a payment method domain.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:payment_method_domain
paypalobjectrequired
Indicates the status of a specific payment method on a payment method domain.
defaultError response.
errorobjectrequired

Error handling

domain_name is required and must not exceed 5000 characters. enabled must be a boolean when provided, and expand values must not exceed 5000 characters.