# Apple Pay for Web

## Get Validated Apple Pay Merchant 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 Apple Pay Merchant 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":"An 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/ErrorResult"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorResult"}}}},"401":{"description":"Authorization is invalid. Check your public-key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResult"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorResult"}}}}}}}},"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}}}},"ErrorResult":{"type":"object","properties":{"errorResults":{"type":"array","items":{"$ref":"#/components/schemas/Error"}}}},"Error":{"type":"object","properties":{"errorMessage":{"type":"string","description":"Describes the reason for the error."},"resultCode":{"type":"integer","description":"Numeric code that identifies the type of error returned by the request.","format":"int32"},"timeStamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}}}}}}
```

## Get Apple Pay Merchant 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 Apple Pay Merchant 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/ErrorResult"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorResult"}}}},"404":{"description":"Failed to retrieve registered domains for merchant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResult"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorResult"}}}}}}}},"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"},"ErrorResult":{"type":"object","properties":{"errorResults":{"type":"array","items":{"$ref":"#/components/schemas/Error"}}}},"Error":{"type":"object","properties":{"errorMessage":{"type":"string","description":"Describes the reason for the error."},"resultCode":{"type":"integer","description":"Numeric code that identifies the type of error returned by the request.","format":"int32"},"timeStamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}}}}}}
```

## Register Apple Pay Merchant 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 Apple Pay Merchant 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/ErrorResult"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorResult"}}}},"401":{"description":"Authorization is invalid. Check your api-key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResult"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorResult"}}}}}}}},"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"},"ErrorResult":{"type":"object","properties":{"errorResults":{"type":"array","items":{"$ref":"#/components/schemas/Error"}}}},"Error":{"type":"object","properties":{"errorMessage":{"type":"string","description":"Describes the reason for the error."},"resultCode":{"type":"integer","description":"Numeric code that identifies the type of error returned by the request.","format":"int32"},"timeStamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}}}}}}
```

## Deregister Apple Pay Merchant 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 Apple Pay Merchant 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 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/ErrorResult"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorResult"}}}},"401":{"description":"Authorization is invalid. Check your api-key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResult"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorResult"}}}}}}}},"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"},"ErrorResult":{"type":"object","properties":{"errorResults":{"type":"array","items":{"$ref":"#/components/schemas/Error"}}}},"Error":{"type":"object","properties":{"errorMessage":{"type":"string","description":"Describes the reason for the error."},"resultCode":{"type":"integer","description":"Numeric code that identifies the type of error returned by the request.","format":"int32"},"timeStamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}}}}}}
```

## Get Apple Pay 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 Apple Pay 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/ErrorResult"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorResult"}}}},"401":{"description":"Authorization is invalid. Check your api-key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResult"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorResult"}}}}}}}},"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"},"ErrorResult":{"type":"object","properties":{"errorResults":{"type":"array","items":{"$ref":"#/components/schemas/Error"}}}},"Error":{"type":"object","properties":{"errorMessage":{"type":"string","description":"Describes the reason for the error."},"resultCode":{"type":"integer","description":"Numeric code that identifies the type of error returned by the request.","format":"int32"},"timeStamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}}}}}}
```
