Skip to content

Loyalty Data API (1.0)

The Loyalty Data API provides App partners with the ability to access data regarding members sales to help aggregate loyalty points. Currently the API allows apps to register their members and are notified on every transaction performed.

Overview
Languages
Servers
Production
https://api.tyro.com/connect

Registered Card

Operations

Member

Operations

Register member for loyalty

Request

This endpoint registers a member for a participating location with the loyalty API. This notifies you of all future payments performed by the members at locations you have access to. The payment should have taken place within a 60 minute window of the registration.

Security
JWT
Headers
Authorizationstringrequired
Default Bearer {$$.env.access_token}
Bodyapplication/json
originobjectrequired
origin.​memberIdstringrequired

Member's Identifier on the app.

paymentIdstringrequired

Payment Identifier generated from the payment source. It refers to the transaction.receipt (from Tyro eCommerce APIs) or otherwise referred to as the RRN.

paymentSourcestringrequired

Source of payment.

Enum"EFTPOS""ONLINE"
locationIdstringrequired

Tyro Connect's identifier for the location.

memberReferencestring

The reference provided by the terminal via the QR code sign-up flow. By passing this value back to us here it allows us to more accurately identify the payment instrument(s) used by the customer. This field is optional and relevant only for on-terminal integrations.

curl -i -X POST \
  https://api.tyro.com/connect/loyalty/members \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "origin": {
      "memberId": "member-1"
    },
    "paymentId": "6940871887d8",
    "paymentSource": "EFTPOS",
    "locationId": "cafe-on-main-steet"
  }'

Responses

The request has been accepted. The member will be registered when a matching payment is found.

Response
No content

Deregister a member for loyalty.

Request

This endpoint deregisters a member from all participating locations with the loyalty API. You will no longer receive notifications about the payments performed by the members at locations you have access to.

Security
JWT
Headers
Authorizationstringrequired
Default Bearer {$$.env.access_token}
Bodyapplication/json
originobjectrequired
origin.​memberIdstringrequired

Member's Identifier on the app.

curl -i -X DELETE \
  https://api.tyro.com/connect/loyalty/members \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "origin": {
      "memberId": "string"
    }
  }'

Responses

No body content. Member has been successfully deregistered.

Response
No content

Get loyalty activity by Id

Request

This endpoint retrieves a loyalty activity for a registered member.

Security
JWT
Path
loyaltyActivityIdstringrequired

ID of loyalty activity to retrieve

Headers
Authorizationstringrequired
Default Bearer {$$.env.access_token}
curl -i -X GET \
  'https://api.tyro.com/connect/loyalty/activities/{loyaltyActivityId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Bodyapplication/json
idstringrequired

The Id of the loyalty activitiy in the Tyro Connect system.

Example: "0f448ac1-862a-4c7b-bdb4-a3b7cdbf6149"
locationIdstringrequired

The Id of the location as specified by the Tyro Connect system.

memberIdstring

The identifier of the member who is associated with this activity. This value corresponds to the origin.memberId provided during member registration.

paymentobjectrequired
payment.​originobject
payment.​typestring
Enum"PURCHASE""REFUND""CASHOUT""OPEN_PRE_AUTH""CLOSE_PRE_AUTH""VOID"
payment.​modestring

EFTPOS integration type. It will always be NOT_APPLICABLE for ONLINE payments.

Enum"INTEGRATED""STANDALONE""NOT_APPLICABLE"
payment.​zonedDateTimestring(date-time)
payment.​breakdownobject
payment.​totalobject(Money Positive Amount)

The total amount that was paid by the cardholder.

saleobject
Response
application/json
{ "id": "99fdaa02-4cb4-4948-a79e-4b69e4008feb", "locationId": "e429f245-4dcb-4961-9d27-c40538e990b2", "memberId": "foo@bar.com", "payment": { "origin": {}, "type": "PURCHASE", "zonedDateTime": "2021-10-11T11:00:01+11:00", "breakdown": {}, "total": {} }, "sale": null }

Create a test payment

Request

This endpoint is for creating fake payments that can be used to test your integration with our system. After registering a member, payments can be generated for that member by providing the memberId that you specified during registration.

Security
JWT
Headers
Authorizationstringrequired
Default Bearer {$$.env.access_token}
Bodyapplication/json
locationIdstringrequired

Tyro Connect's identifier for the location.

Example: "tc-testlocation-2000"
memberIdstringrequired

The identifier of the member who should be associated with this payment. This value corresponds to the origin.memberId provided during member registration.

paymentTypestringrequired

The type of payment being made

Enum"PURCHASE""REFUND""CASHOUT""OPEN_PRE_AUTH""CLOSE_PRE_AUTH""VOID"
paymentSourcestringrequired

The method used to make the payment

Enum"EFTPOS""ONLINE"
goodsAndServicesAmountnumber

The amount paid for goods and services

tipAmountnumber

The amount paid as part of a tip

surchargeAmountnumber

The amount paid as part of a surcharge

cashoutAmountnumber

The amount paid as part of a cash withdrawal

useNewCardboolean

This will simulate the member registering a new card and will trigger corresponding event NEW_REGISTERED_CARD

curl -i -X POST \
  https://api.tyro.com/connect/payments/test \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "locationId": "tc-testlocation-2000",
    "memberId": "some-member-id",
    "paymentType": "PURCHASE",
    "paymentSource": "EFTPOS",
    "goodsAndServicesAmount": 100
  }'

Responses

Created

Bodyapplication/json
string
Response
application/json
"Created"