# Pay API

Pay API

Version: 0.9

## Servers

Production
```
https://api.tyro.com/connect
```

## Security

### JWT

Type: openIdConnect
OpenID Connect URL: https://auth.connect.tyro.com/.well-known/openid-configuration

## Download OpenAPI description

[Pay API](https://docs.connect.tyro.com/_bundle/app/apis/pay/0.9/index.yaml)

## Pay Requests

### Create a Pay Request

 - [POST /pay/requests](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-requests/create-pay-request.md): This endpoint is used for creating a Pay Request. Your server should create a Pay Request as soon as the total payment amount is known. Once the Pay Request is created, your frontend will use Tyro.js to collect the customer's payment details and invoke submit() to execute the payment.

### Retrieve a Pay Request

 - [GET /pay/requests/{payRequestId}](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-requests/get-pay-request.md): This endpoint is for fetching Pay Requests.

### Update or execute actions on the Pay Request

 - [PATCH /pay/requests/{payRequestId}](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-requests/patch-pay-request.md): This endpoint is for updating a Pay Request or executing actions on the Pay Request.

## Pay Methods

### Create a Pay Method

 - [POST /pay/methods](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-methods/create-pay-method.md): This endpoint is used for creating a Pay Method to store customer card details for future payments. Note: This feature is only enabled on request and may not be enabled by default for your account.

### List Pay Methods

 - [GET /pay/methods](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-methods/list-pay-methods.md): This endpoint is for fetching Pay Methods

### Retrieve a Pay Method

 - [GET /pay/methods/{payMethodId}](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-methods/get-pay-method.md): Retrieve a Pay Method

### Update Pay Method Default Status

 - [PATCH /pay/methods/{payMethodId}](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-methods/update-pay-method.md): Update a Pay Method's default status. Set isDefault to true to make it the default, or false to unset it as default. Note that responses only include the isDefault field when it's true. Note: This feature is only enabled on request and may not be enabled by default for your account.

### Delete a Pay Method

 - [DELETE /pay/methods/{payMethodId}](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-methods/delete-pay-method.md): Delete a Pay Method. If this is the last PayMethod for the customer, the customer will also be deleted.

## Pay Refunds

### Create a Refund Request

 - [POST /pay/refunds](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-refunds/create-refund-request.md): This endpoint is used to create a Refund Request.

Refunds can only be created for successful payments made via a Pay Request. If a Pay Request has not yet been captured, then void the Pay Request instead.

Refunds can be made for the total or partial amount of the Pay Request. Multiple refunds can be created for the same Pay Request as long as the total refunds amount does not exceed the original Pay Request total.

Refunds can only be sent back to the original payment method used.

### List all Refunds

 - [GET /pay/refunds](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-refunds/list-all-refunds.md): Returns a list of refunds.

### Retrieve a Refund Request

 - [GET /pay/refunds/{refundRequestId}](https://docs.connect.tyro.com/app/apis/pay/0.9/pay-refunds/get-refund-request.md): Retrieve a Refund Request.

