# Apple Pay for Web

## Get validated session

> Validate a registered merchant domain and returns an Apple Pay merchant session for initiating Apple Pay web transactions.

```json
{"openapi":"3.0.1","info":{"title":"Apple Merchant","version":"2.0"},"paths":{"/rest/v2/apple/merchants/validation":{"post":{"tags":["Apple Pay for Web"],"summary":"Get validated session","description":"Validate a registered merchant domain and returns an Apple Pay merchant session for initiating Apple Pay web transactions.","operationId":"getMerchantSession","parameters":[{"name":"public-key","in":"header","description":"A public API key issued to you by Xplor Pay.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateMerchantRequest"}}},"required":true},"responses":{"200":{"description":"Successfully obtained Apple Pay session from Apple.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppleMerchantSessionResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AppleMerchantSessionResponsePayload"}}}},"400":{"description":"Failed to get Apple Pay session from Apple.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}}}},"401":{"description":"Authorization is invalid. Check your public-key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}}}}}}}},"components":{"schemas":{"ValidateMerchantRequest":{"required":["domain","initiatedFrom","validationURL"],"type":"object","properties":{"initiatedFrom":{"type":"string","description":"The Apple Pay initiative value based on the platform."},"validationURL":{"type":"string","description":"The Apple Pay URL used to request a merchant validation session."},"domain":{"type":"string","description":"The merchant domain registered with Apple Pay."}}},"AppleMerchantSessionResponsePayload":{"type":"object","properties":{"merchantSession":{"type":"string","description":"The merchant session returned by Apple to process an Apple Pay for Web transaction."},"payloadType":{"type":"string","description":"The type of payload returned in the response.","xml":{"name":"type","attribute":true}}}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```

## Get domains

> Retrieve the list of domains currently registered and enabled for Apple Pay web transactions for the merchant.

```json
{"openapi":"3.0.1","info":{"title":"Apple Merchant","version":"2.0"},"paths":{"/rest/v2/apple/merchants/domains":{"get":{"tags":["Apple Pay for Web"],"summary":"Get domains","description":"Retrieve the list of domains currently registered and enabled for Apple Pay web transactions for the merchant.","operationId":"getMerchantDomains","parameters":[{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true}],"responses":{"200":{"description":"Successfully obtained merchant's registered domains.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantDomainsPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/MerchantDomainsPayload"}}}},"401":{"description":"Authorization is invalid. Check your api-key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}}}},"404":{"description":"Failed to retrieve registered domains for merchant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}}}}}}}},"components":{"schemas":{"MerchantDomainsPayload":{"type":"object","properties":{"merchant-domains":{"type":"array","description":"The list of domains registered for Apple Pay web transactions.","items":{"$ref":"#/components/schemas/merchant-domains"}},"payloadType":{"type":"string","description":"The type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"payload"},"merchant-domains":{"type":"object","properties":{"merchantId":{"type":"string","description":"The merchant's unique identification number."},"domain":{"type":"string","description":"The merchant's Apple Pay registered domain."},"isEnabled":{"type":"boolean","description":"Indicates whether the merchant domain is registered for Apple Pay transactions."}},"description":"Merchant domain registration information"},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```

## Register domains

> Register one or more merchant domains for Apple Pay web transactions.

```json
{"openapi":"3.0.1","info":{"title":"Apple Merchant","version":"2.0"},"paths":{"/rest/v2/apple/merchants/domains":{"post":{"tags":["Apple Pay for Web"],"summary":"Register domains","description":"Register one or more merchant domains for Apple Pay web transactions.","operationId":"registerMerchantDomains","parameters":[{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantDomainsRequest"}}},"required":true},"responses":{"200":{"description":"Successfully registered merchant domain(s).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantDomainsPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/MerchantDomainsPayload"}}}},"400":{"description":"Failed to register merchant domain(s).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}}}},"401":{"description":"Authorization is invalid. Check your api-key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}}}}}}}},"components":{"schemas":{"MerchantDomainsRequest":{"required":["domainNames"],"type":"object","properties":{"domainNames":{"type":"array","description":"The list of merchant domains to register or deregister for Apple Pay web transactions.","items":{"type":"string","description":"The list of merchant domains to register or deregister for Apple Pay web transactions."}}},"description":"Request Body"},"MerchantDomainsPayload":{"type":"object","properties":{"merchant-domains":{"type":"array","description":"The list of domains registered for Apple Pay web transactions.","items":{"$ref":"#/components/schemas/merchant-domains"}},"payloadType":{"type":"string","description":"The type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"payload"},"merchant-domains":{"type":"object","properties":{"merchantId":{"type":"string","description":"The merchant's unique identification number."},"domain":{"type":"string","description":"The merchant's Apple Pay registered domain."},"isEnabled":{"type":"boolean","description":"Indicates whether the merchant domain is registered for Apple Pay transactions."}},"description":"Merchant domain registration information"},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```

## Deregister domains

> Remove or deregister one or more merchant domains from Apple Pay web transactions.

```json
{"openapi":"3.0.1","info":{"title":"Apple Merchant","version":"2.0"},"paths":{"/rest/v2/apple/merchants/domains":{"delete":{"tags":["Apple Pay for Web"],"summary":"Deregister domains","description":"Remove or deregister one or more merchant domains from Apple Pay web transactions.","operationId":"deleteMerchantDomains","parameters":[{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantDomainsRequest"}}},"required":true},"responses":{"200":{"description":"Successfully de-registered merchant domain(s).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantDomainsPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/MerchantDomainsPayload"}}}},"400":{"description":"Failed to unregister merchant domain(s).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}}}},"401":{"description":"Authorization is invalid. Check your api-key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}}}}}}}},"components":{"schemas":{"MerchantDomainsRequest":{"required":["domainNames"],"type":"object","properties":{"domainNames":{"type":"array","description":"The list of merchant domains to register or deregister for Apple Pay web transactions.","items":{"type":"string","description":"The list of merchant domains to register or deregister for Apple Pay web transactions."}}},"description":"Request Body"},"MerchantDomainsPayload":{"type":"object","properties":{"merchant-domains":{"type":"array","description":"The list of domains registered for Apple Pay web transactions.","items":{"$ref":"#/components/schemas/merchant-domains"}},"payloadType":{"type":"string","description":"The type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"payload"},"merchant-domains":{"type":"object","properties":{"merchantId":{"type":"string","description":"The merchant's unique identification number."},"domain":{"type":"string","description":"The merchant's Apple Pay registered domain."},"isEnabled":{"type":"boolean","description":"Indicates whether the merchant domain is registered for Apple Pay transactions."}},"description":"Merchant domain registration information"},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```

## Get merchant details

> Retrieve the details for merchants registered with Apple Pay for web-based transactions.

```json
{"openapi":"3.0.1","info":{"title":"Apple Merchant","version":"2.0"},"paths":{"/rest/v2/apple/merchants":{"get":{"tags":["Apple Pay for Web"],"summary":"Get merchant details","description":"Retrieve the details for merchants registered with Apple Pay for web-based transactions.","operationId":"getAppleMerchant","parameters":[{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true}],"responses":{"200":{"description":"Successfully obtained Apple Pay merchant details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppleMerchantDetails"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AppleMerchantDetails"}}}},"400":{"description":"Failed to retrieve merchant details from Apple.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}}}},"401":{"description":"Authorization is invalid. Check your api-key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayload"}}}}}}}},"components":{"schemas":{"AppleMerchantDetails":{"required":["partnerMerchantName"],"type":"object","properties":{"domainNames":{"type":"array","description":"The domain names registered for Apple Pay web transactions.","items":{"type":"string","description":"The domain names registered for Apple Pay web transactions."}},"encryptTo":{"type":"string","description":"The Apple Pay encryption destination identifier for the merchant."},"merchantUrl":{"type":"string","description":"The primary domain associated with the Apple Pay merchant."},"partnerInternalMerchantIdentifier":{"type":"string","description":"The internal identifier assigned to the merchant."},"partnerMerchantName":{"type":"string","description":"The registered merchant name used for Apple Pay transactions."}},"description":"Details returned for an Apple Pay merchant"},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xplorpay.com/api-reference/api/payments/mobile/apple-pay-for-web/apple-pay-for-web.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
