Pay API
Pay API (0.9)
Request
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.
Details about the financial institution that processed the payment.
Contains information about the partner that created the Pay Request.
An identifier that has been generated by the origin. This can be used for reconciliation of orders in the app partner’s system.
When the payMethod.id and payMethod.customerId are provided. An action can be executed immediately without prompting the customer for input.
The total amount (in smallest currency unit)
Statement descriptors are used to explain to a customer the charges that appear on their bank statement. There is a maximum of 21 characters and special characters such as {}<>'" are disallowed. The descriptor should be as clear and recognisable as possible. The descriptor can be dynamic and include invoice numbers or other references to help the customer recognise the charge.
- Productionhttps://api.tyro.com/connect/pay/requests
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://api.tyro.com/connect/pay/requests \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"locationId": "tc-cool-3000",
"origin": {
"orderId": "0f448ac1-862a-4c7b-bdb4-a3b7cdbf444"
},
"provider": {
"name": "TYRO",
"method": "CARD"
},
"total": {
"amount": 10000,
"currency": "AUD"
}
}'Created
The Pay Secret associated with this Pay Request. This is used by the frontend to submit the Pay Request. Pay Secret expire after 24 hours from the time the Pay Request was created. It’s recommended to avoid logging or storing the pay secret for security reasons.
The current status of this Pay Request managed by Tyro.
List of supported card type/brand/networks for this Pay Request. If null it is unrestricted.
{ "id": "0f448ac1-862a-4c7b-bdb4-a3b7cdbf6149", "locationId": "tc-cool-3000", "provider": { "name": "TYRO", "method": "CARD" }, "origin": { "orderId": "1f448ac1-862a-4c7b-bdb4-a3b7cdbf6145" }, "status": "AWAITING_PAYMENT_INPUT", "supportedNetworks": [ "visa", "mastercard" ], "action": null, "capture": { "method": "AUTOMATIC" }, "paySecret": "$2a$10$20qRi3XjN1PkTlEVDiYjHefra7c6i2i7yVNu9o5GGTO7ADsWNDuya", "total": { "amount": 10000, "currency": "AUD" } }
- Productionhttps://api.tyro.com/connect/pay/requests/{payRequestId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api.tyro.com/connect/pay/requests/{payRequestId}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'The Pay Request response
The Pay Secret associated with this Pay Request. This is used by the frontend to submit the Pay Request. Pay Secret expire after 24 hours from the time the Pay Request was created. It’s recommended to avoid logging or storing the pay secret for security reasons.
The current status of this Pay Request managed by Tyro.
List of supported card type/brand/networks for this Pay Request. If null it is unrestricted.
{ "id": "string", "paySecret": "string", "locationId": "string", "provider": { "name": "TYRO", "method": "CARD" }, "origin": { "orderId": "string", "orderReference": "string", "name": "string" }, "payMethod": { "id": "string", "customerId": "string", "save": true }, "capture": { "method": "AUTOMATIC", "total": { … } }, "status": "AWAITING_PAYMENT_INPUT", "supportedNetworks": [ "visa" ], "total": { "amount": 12520, "currency": "AUD" }, "transactionResults": [ { … } ], "threeDSecureDetails": { "status": "AWAITING_3DS_METHOD" }, "additionalData": { "customerIP": "127.0.0.1" } }
The capture total can be provided if the capture method is MANUAL and the action is CAPTURE.
The total amount (in smallest currency unit). The total can be updated without performing an action.
- Productionhttps://api.tyro.com/connect/pay/requests/{payRequestId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
- Perform Capture Action
- Cancel a Pay Request
- Update Pay Total
curl -i -X PATCH \
'https://api.tyro.com/connect/pay/requests/{payRequestId}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"action": "CAPTURE"
}'The Pay Request response
The Pay Secret associated with this Pay Request. This is used by the frontend to submit the Pay Request. Pay Secret expire after 24 hours from the time the Pay Request was created. It’s recommended to avoid logging or storing the pay secret for security reasons.
The current status of this Pay Request managed by Tyro.
List of supported card type/brand/networks for this Pay Request. If null it is unrestricted.
{ "id": "string", "paySecret": "string", "locationId": "string", "provider": { "name": "TYRO", "method": "CARD" }, "origin": { "orderId": "string", "orderReference": "string", "name": "string" }, "payMethod": { "id": "string", "customerId": "string", "save": true }, "capture": { "method": "AUTOMATIC", "total": { … } }, "status": "AWAITING_PAYMENT_INPUT", "supportedNetworks": [ "visa" ], "total": { "amount": 12520, "currency": "AUD" }, "transactionResults": [ { … } ], "threeDSecureDetails": { "status": "AWAITING_3DS_METHOD" }, "additionalData": { "customerIP": "127.0.0.1" } }