# Create embedded payments connection

When your App is first initialised, a request is sent to your server to establish a Tyro Embedded Payments connection. This is required to connect to the Embedded Payments reader. Upon receiving the client request, authenticate your user and send the request to Tyro with the readerId in the request body.

Endpoint: POST /tap-to-pay/connections
Version: 1.0
Security: JWT

## Header parameters:

  - `Authorization` (string, required)

  - `Content-Type` (string, required)
    Enum: "application/json"

## Request fields (application/json):

  - `readerId` (string, required)
    The ID of the reader to be used to establish the connection.
    Example: "0f448ac1-862a-4c7b-bdb4-a3b7cdbf6149"

## Response 201 fields (application/json):

  - `id` (string)
    The ID of this connection
    Example: "2688fcf2-44dd-4c72-88ac-79d0910f2983"

  - `connectionSecret` (string)
    The connectionSecret must be returned to your frontend to which is required for Embedded Payments transaction with the SDK. Do not cache or hardcode the connectionSecret. Tyro already manages the lifecycle of this secret.
    Example: "$2a$10$OjXTE/Ul4UVVlW8RtKNtcuV3NdoP8sFc.5Lqov0N5wp6vU8Dmj8H3"

  - `createdDate` (string)
    The time the connection was created. The format of the date time is the notation as defined by [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6)
    Example: "2023-05-02T08:28:13+10:00"

  - `readerId` (string)
    The ID of the reader for this connection.
    Example: "0f448ac1-862a-4c7b-bdb4-a3b7cdbf6149"

  - `readerName` (string)
    The name of the reader for this connection.
    Example: "Reader 1 - Example Shop Sydney"

  - `locationId` (string)
    The ID of the location for this connection.
    Example: "tc-exampleshop-3000"

  - `locationName` (string)
    The name of the location, this could be a description or address for the location
    Example: "Example Shop Melbourne"

## Response 400 fields (application/json):

  - `error` (string)
    The validation error message.

  - `errorCode` (string)
    The unique error code for message.


## Response 403 fields

## Response 404 fields
