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.

Knox answers these operations with the same requests and responses as Stripe's API. Authenticate with your secret key, Authorization: Bearer sk_test_..., from your server, and send form-encoded bodies. Test mode only: live processing is currently disabled.

Create a payment method domain

POST/v1/payment_method_domains

Creates a payment method domain.

Body parameters

  • domain_namestringRequired

    The domain name that this payment method domain object represents.

  • enabledboolean

    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 of strings

    Specifies which fields in the response should be expanded.

Returns

The payment_method_domain object.

POST /v1/payment_method_domains
curl https://api.knoxapi.com/v1/payment_method_domains \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  -d domain_name=example.com
Response
{
  "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_namestring

    The domain name that this payment method domain object represents.

  • enabledboolean

    Whether this payment method domain is enabled. If the domain is not enabled, payment methods will not appear in Elements or Embedded Checkout

  • ending_beforestring

    A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • starting_afterstring

    A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Returns

A list of payment_method_domain objects.

GET /v1/payment_method_domains
curl -G https://api.knoxapi.com/v1/payment_method_domains \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "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

  • enabledboolean

    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 of strings

    Specifies which fields in the response should be expanded.

Returns

The payment_method_domain object.

POST /v1/payment_method_domains/{payment_method_domain}
curl -X POST https://api.knoxapi.com/v1/payment_method_domains/pmd_1Pgc79B7WZ01zgkWHKCqwAQo \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "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 strings

    Specifies which fields in the response should be expanded.

Returns

The payment_method_domain object.

GET /v1/payment_method_domains/{payment_method_domain}
curl https://api.knoxapi.com/v1/payment_method_domains/pmd_1Pgc79B7WZ01zgkWHKCqwAQo \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "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 strings

    Specifies which fields in the response should be expanded.

Returns

The payment_method_domain object.

POST /v1/payment_method_domains/{payment_method_domain}/validate
curl -X POST https://api.knoxapi.com/v1/payment_method_domains/pmd_1Pgc79B7WZ01zgkWHKCqwAQo/validate \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "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.