Create a Pay 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.

Request
Security:
header Parameters
Authorization
required
string
Default: Bearer {$$.env.access_token}
Content-Type
required
string
Value: "application/json"
Request Body schema: application/json
locationId
required
string

The id of the location as specified by the Tyro Connect system

required
object

Details about the financial institution that processed the payment.

required
object

Contains information about the partner that created the Pay Request.

object

The Pay Method associated with the Pay Request

action
string

When the payMethod.id and payMethod.customerId are provided. An action can be executed immediately without prompting the customer for input.

Value: "SUBMIT"
object

Optional field that can be used to specify how the funds will be captured.

required
object

The total amount (in smallest currency unit)

statementDescriptor
string

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.

statementDescriptorLocation
string

This is the city or web address where the transaction occurred. There is a maximum of 13 characters and special characters such as {}<>'" are disallowed.

Responses
201

Created

400

When the provided payload is not valid.

403

When you don't have the right permissions to create a Pay Request for the provided location.

post/pay/requests
Request samples
application/json
{
  • "locationId": "tc-cool-3000",
  • "origin": {
    },
  • "provider": {
    },
  • "total": {
    }
}
Response samples
application/json
{
  • "id": "0f448ac1-862a-4c7b-bdb4-a3b7cdbf6149",
  • "locationId": "tc-cool-3000",
  • "provider": {
    },
  • "origin": {
    },
  • "status": "AWAITING_PAYMENT_INPUT",
  • "supportedNetworks": [
    ],
  • "action": null,
  • "capture": {
    },
  • "paySecret": "$2a$10$20qRi3XjN1PkTlEVDiYjHefra7c6i2i7yVNu9o5GGTO7ADsWNDuya",
  • "total": {
    }
}
Copyright © Tyro Payments 2019-2024. All right reserved.