# Create an Apple Pay Session

Create an apple_pay_session to process Apple Pay transactions on the web.

To create an Apple Pay Session, pass the unique validation_url (provided by Apple) while creating an apple_pay_sessions resource. Finix returns a merchantSession object that you can use to create a payment. For more information, see Apple Pay.

**Endpoint:** POST /apple_pay_sessions  
**Security:** BasicAuth

## Header parameters:

- `Finix-Version` (string)  
    Specify the API version of your request. For more details, see Versioning.  
    Example: "2022-02-01"

- `Content-Type` (string)  
    The data type being sent in the request body must be application/json.  
    Example: "application/json"

## Request fields (application/json):

- `display_name` (string)  
    This will be the merchant name shown to users when making a purchase via Apple Pay.

- `domain` (string)  
    The domain (or website) where the buyer is initiating the payment.

- `merchant_identity` (string)  
    The merchant_identity_id used when registering the business with Apple Pay through our registration API.

- `validation_url` (string)  
    A unique validation URL that will be provided by the Apple SDK front-end for every payment.

## Response 201 fields (application/json):

- `id` (string)  
    The ID of the resource.

- `created_at` (string)  
    Timestamp of when the object was created.

- `updated_at` (string)  
    Timestamp of when the object was last updated.

- `session_details` (string)  
    Details about the apple_pay_session that was created.

- `_links` (object)  
    For your convenience, every response includes several URLs which link to resources relevant to the request. You can use these _links to make your follow-up requests and quickly access relevant IDs.

- `_links.self` (object)  
    Link to the resource that was used in the request.

- `_links.self.href` (string)

## Response 400 fields (application/json):

- `total` (integer, required)  
    Total number of errors returned.

- `_embedded` (object, required)  
    Container for embedded error objects.

- `_embedded.errors` (array)  
    List of individual error objects.

- `_embedded.errors.code` (string)  
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

- `_embedded.errors.logref` (string)  
    A log reference identifier for the error, useful for debugging and support purposes.

- `_embedded.errors.message` (string)  
    A human-friendly error message.

- `_embedded.errors._links` (object)  
    Links related to this error.

- `_embedded.errors._links.self` (object)  
    Link to the resource related to the error.

- `_embedded.errors._links.self.href` (string)  
    URL of the related resource.

## Response 401 fields (application/json):

- `total` (integer, required)  
    Total number of errors returned.

- `_embedded` (object, required)  
    Container for embedded error objects.

- `_embedded.errors` (array)  
    List of individual error objects.

- `_embedded.errors.code` (string)  
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

- `_embedded.errors.logref` (string)  
    A log reference identifier for the error, useful for debugging and support purposes.

- `_embedded.errors.message` (string)  
    A human-friendly error message.

- `_embedded.errors._links` (object)  
    Links related to this error.

- `_embedded.errors._links.self` (object)  
    Link to the resource related to the error.

- `_embedded.errors._links.self.href` (string)  
    URL of the related resource.

## Response 403 fields (application/json):

- `total` (integer, required)  
    Total number of errors returned.

- `_embedded` (object, required)  
    Container for embedded error objects.

- `_embedded.errors` (array)  
    List of individual error objects.

- `_embedded.errors.code` (string)  
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

- `_embedded.errors.logref` (string)  
    A log reference identifier for the error, useful for debugging and support purposes.

- `_embedded.errors.message` (string)  
    A human-friendly error message.

- `_embedded.errors._links` (object)  
    Links related to this error.

- `_embedded.errors._links.self` (object)  
    Link to the resource related to the error.

- `_embedded.errors._links.self.href` (string)  
    URL of the related resource.

## Response 404 fields (application/json):

- `total` (integer, required)  
    Total number of errors returned.

- `_embedded` (object, required)  
    Container for embedded error objects.

- `_embedded.errors` (array)  
    List of individual error objects.

- `_embedded.errors.code` (string)  
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

- `_embedded.errors.logref` (string)  
    A log reference identifier for the error, useful for debugging and support purposes.

- `_embedded.errors.message` (string)  
    A human-friendly error message.

- `_embedded.errors._links` (object)  
    Links related to this error.

- `_embedded.errors._links.self` (object)  
    Link to the resource related to the error.

- `_embedded.errors._links.self.href` (string)  
    URL of the related resource.

## Response 406 fields (application/json):

- `total` (integer, required)  
    Total number of errors returned.

- `_embedded` (object, required)  
    Container for embedded error objects.

- `_embedded.errors` (array)  
    List of individual error objects.

- `_embedded.errors.code` (string)  
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

- `_embedded.errors.logref` (string)  
    A log reference identifier for the error, useful for debugging and support purposes.

- `_embedded.errors.message` (string)  
    A human-friendly error message.

- `_embedded.errors._links` (object)  
    Links related to this error.

- `_embedded.errors._links.self` (object)  
    Link to the resource related to the error.

- `_embedded.errors._links.self.href` (string)  
    URL of the related resource.

## Response 422 fields (application/json):

- `total` (integer, required)  
    Total number of errors returned.

- `_embedded` (object, required)  
    Container for embedded error objects.

- `_embedded.errors` (array)  
    List of individual error objects.

- `_embedded.errors.code` (string)  
    The error code. The UNKNOWN error code is returned for a 401 Unauthorized or 403 Forbidden request.

- `_embedded.errors.logref` (string)  
    A log reference identifier for the error, useful for debugging and support purposes.

- `_embedded.errors.message` (string)  
    A human-friendly error message.

- `_embedded.errors._links` (object)  
    Links related to this error.

- `_embedded.errors._links.self` (object)  
    Link to the resource related to the error.

- `_embedded.errors._links.self.href` (string)  
    URL of the related resource.
