Skip to Content
Docs
Apple Pay sessions

Create an Apple Pay session

POST/sessions/applepay

Creates an Apple Pay session for merchant validation. Returns session data required for Apple Pay web payments.

Headers

AuthorizationstringRequired
HTTP Basic auth: your API key as the password, with an empty username. See Authentication.
idempotency-keystring

A unique key, such as a UUID, that makes a POST or DELETE request safe to retry. Pay.com keeps each key for 24 hours, separately for each workspace.

  • A retry with the same key, endpoint and body gets the first request's stored status and body, without running the request again.
  • If the first request is still being processed, a retry gets 409 idempotency_error (request_in_progress).
  • The same key on another endpoint, or with another body, gets 400 idempotency_error (invalid_parameters).
  • GET, PUT and PATCH requests ignore the key.

The response repeats the key in its Idempotency-Key header.

Parameters

domainstringRequired

The domain URL for Apple Pay merchant validation.

Returns

Returns the Apple Pay session object.

displayNamestring

Merchant display name.

domainNamestring

Merchant domain name.

epochTimestampinteger

Timestamp in epoch milliseconds.

expiresAtinteger

Session expiration timestamp.

merchantSessionIdentifierstring

Apple Pay session identifier.

noncestring

Cryptographic nonce for validation.

signaturestring

Cryptographic signature.

Errors

400
Invalid request parameters, or Apple rejected the merchant validation (for example because the domain is not registered). Errors returned by Apple are passed through with their own status code, so other 4xx codes are possible.
401
The API key or access token is missing, unknown or no longer works (invalid_key, invalid_token, legacy_keys_ended, legacy_keys_off or permission_denied).
403
The request was refused: the API key may not make it (for example resource_not_allowed, key_disabled, network_not_allowed, pci_required or merchant_required), or this resource isn't enabled for your account (permission_denied). code says why.
409
Another request with the same idempotency-key is still being processed (request_in_progress). Wait, then retry with the same key.
500
Internal server error.
503
Service unavailable. Retry after the number of seconds in Retry-After, or after a few seconds when there's none.
Was this page helpful?