# Verify domain POST https://api-sandbox.payabli.com/api/PaymentMethodDomain/{domainId}/verify Verify a new payment method domain. If verification is successful, Apple Pay is automatically activated for the domain. Reference: https://docs.payabli.com/developers/api-reference/paymentmethoddomain/paymentmethoddomain-verify ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Verify a payment method domain version: endpoint_paymentMethodDomain.VerifyPaymentMethodDomain paths: /PaymentMethodDomain/{domainId}/verify: post: operationId: verify-payment-method-domain summary: Verify a payment method domain description: >- Verify a new payment method domain. If verification is successful, Apple Pay is automatically activated for the domain. tags: - - subpackage_paymentMethodDomain parameters: - name: domainId in: path description: The payment method domain's ID in Payabli. required: true schema: type: string - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_:PaymentMethodDomainGeneralResponse' components: schemas: type_:IsSuccess: type: boolean type_:PageIdentifier: type: string type_:ApplePayMetadata: type: object properties: isFileAvailable: type: boolean description: >- When `true`, indicates whether the domain verification file is available at the expected path. When `false`, Payabli was unable to find the file at the expected path. If the file is missing, make sure it's hosted at the correct path: `/.well-known/apple-developer-merchantid-domain-association` isFileContentValid: type: boolean description: >- Indicates whether the domain verification file content is valid. If the file is invalid, try downloading it and hosting it again. redirectDomainName: type: string description: The domain name if the domain verification URL returns a redirect. redirectUrl: type: string description: >- If the domain verification URL is redirected, this is the URL it's redirected to. For example, www.partner.com could redirect to www.partners-new-home-page.com. In this case, you should add www.partners-new-home-page.com as a domain instead of www.partner.com. statusCode: type: integer description: The status code return by the domain verification URL. type_:ApplePayStatusData: type: object properties: errorMessage: type: string description: Any error message related to Apple Pay's activation status. metadata: $ref: '#/components/schemas/type_:ApplePayMetadata' type_:IsEnabled: type: boolean type_:ApplePayData: type: object properties: data: $ref: '#/components/schemas/type_:ApplePayStatusData' description: >- This object is only returned when the domain verification check fails. If a domain has failed validation, this object contains information about the failure. isEnabled: $ref: '#/components/schemas/type_:IsEnabled' description: When `true`, Apple Pay is enabled. type_:GooglePayMetadata: type: object properties: statusCode: type: integer description: The status code return by the domain verification URL. redirectUrl: type: string description: >- If the domain verification URL is redirected, this is the URL it's redirected to. For example, www.partner.com could redirect to www.partners-new-home-page.com. In this case, you should add www.partners-new-home-page.com as a domain instead of www.partner.com. redirectDomainName: type: string description: The domain name if the domain verification URL returns a redirect. type_:GooglePayStatusData: type: object properties: errorMessage: type: string description: Any error message related to Google Pay's activation status. metadata: $ref: '#/components/schemas/type_:GooglePayMetadata' type_:GooglePayData: type: object properties: data: $ref: '#/components/schemas/type_:GooglePayStatusData' description: >- This object is only returned when the domain verification check fails. If a domain has failed validation, this object contains information about the failure. isEnabled: $ref: '#/components/schemas/type_:IsEnabled' description: When `true`, Google Pay is enabled. type_:CreatedAt: type: string format: date-time type_:JobId: type: string type_:JobStatus: type: string type_:LastModified: type: string format: date-time type_:CascadeJobDetails: type: object properties: createdAt: $ref: '#/components/schemas/type_:CreatedAt' jobErrorMessage: type: string description: Error message for a failed cascade process. jobId: $ref: '#/components/schemas/type_:JobId' jobStatus: $ref: '#/components/schemas/type_:JobStatus' updatedAt: $ref: '#/components/schemas/type_:LastModified' type_:DomainName: type: string type_:EntityId: type: integer format: int64 type_:EntityType: type: string type_:PaymentMethodDomainId: type: string type_:OwnerEntityId: type: integer format: int64 type_:OwnerEntityType: type: string type_:PaymentMethodDomainApiResponse: type: object properties: type: type: - string - 'null' description: >- The record type. For payment method domains, this is always `PaymentMethodDomain`. applePay: $ref: '#/components/schemas/type_:ApplePayData' googlePay: $ref: '#/components/schemas/type_:GooglePayData' cascades: type: array items: $ref: '#/components/schemas/type_:CascadeJobDetails' description: Data about the domain's cascade status. createdAt: $ref: '#/components/schemas/type_:CreatedAt' domainName: $ref: '#/components/schemas/type_:DomainName' entityId: $ref: '#/components/schemas/type_:EntityId' entityType: $ref: '#/components/schemas/type_:EntityType' id: $ref: '#/components/schemas/type_:PaymentMethodDomainId' ownerEntityId: $ref: '#/components/schemas/type_:OwnerEntityId' ownerEntityType: $ref: '#/components/schemas/type_:OwnerEntityType' updatedAt: $ref: '#/components/schemas/type_:LastModified' required: - type - applePay - googlePay - createdAt - domainName - entityId - entityType - id - ownerEntityId - ownerEntityType - updatedAt type_:PaymentMethodDomainGeneralResponse: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' pageidentifier: $ref: '#/components/schemas/type_:PageIdentifier' responseData: $ref: '#/components/schemas/type_:PaymentMethodDomainApiResponse' responseText: type: string required: - responseText ``` ## SDK Code Examples ```python VerifySuccess from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.payment_method_domain.verify_payment_method_domain( domain_id="pmd_b8237fa45c964d8a9ef27160cd42b8c5", ) ``` ```typescript VerifySuccess import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.paymentMethodDomain.verifyPaymentMethodDomain("pmd_b8237fa45c964d8a9ef27160cd42b8c5"); ``` ```go VerifySuccess import ( context "context" option "github.com/payabli/sdk-go/option" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.PaymentMethodDomain.VerifyPaymentMethodDomain( context.TODO(), "pmd_b8237fa45c964d8a9ef27160cd42b8c5", ) ``` ```csharp VerifySuccess using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.PaymentMethodDomain.VerifyPaymentMethodDomainAsync( "pmd_b8237fa45c964d8a9ef27160cd42b8c5" ); ``` ```ruby VerifySuccess require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5/verify") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java VerifySuccess HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5/verify") .header("requestToken", "") .asString(); ``` ```php VerifySuccess request('POST', 'https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5/verify', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift VerifySuccess import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5/verify")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ```python VerifyFailure from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.payment_method_domain.verify_payment_method_domain( domain_id="pmd_b8237fa45c964d8a9ef27160cd42b8c5", ) ``` ```typescript VerifyFailure import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.paymentMethodDomain.verifyPaymentMethodDomain("pmd_b8237fa45c964d8a9ef27160cd42b8c5"); ``` ```go VerifyFailure import ( context "context" option "github.com/payabli/sdk-go/option" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.PaymentMethodDomain.VerifyPaymentMethodDomain( context.TODO(), "pmd_b8237fa45c964d8a9ef27160cd42b8c5", ) ``` ```csharp VerifyFailure using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.PaymentMethodDomain.VerifyPaymentMethodDomainAsync( "pmd_b8237fa45c964d8a9ef27160cd42b8c5" ); ``` ```ruby VerifyFailure require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5/verify") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java VerifyFailure HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5/verify") .header("requestToken", "") .asString(); ``` ```php VerifyFailure request('POST', 'https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5/verify', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift VerifyFailure import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5/verify")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```