CAPI - PT2U

Introduction

This document guides the developer on how to use CAPI services to purchase a PT2U. ​ The reader is advised to familiarise himself/herself with the PT2U process by reading CReME™-PT2U before this. This process consists of the following processes:

  1. Select a Trainer Package
  2. Input Delivery Address
  3. Verify Computed Delivery Address
  4. Proceed to Checkout

The user is also assumed to be familiar with CAPI - Introduction.

1) Select a Trainer Package

To display the Personal Trainer list, the following request is submitted:

[
{
"PersonId": 20012,
"ImageBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD…[truncated]...PLiCotVpbUi+pzG"
"Fullname": "Guru Twoo",
"Description": "A dedicated fitness trainer with a passion for improving client health, wellness and quality of life. Deliver high-energy training using latest techniques in exercise science, cardio programmes and strength training.\r\nBody transformation specialist adept in helping diverse populations achieve their fitness, weight loss and conditioning goals faster than they ever thought possible. ",
"Packages": [
{
"Title": "PT 1",
"Price": 120,
"PackagePersonalTrainerId": 2079361
},
{
"Title": "PT 10",
"Price": 1100,
"PackagePersonalTrainerId": 2079362
}
]
},
{
"PersonId": 20481,
"ImageBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/…[truncated]...75mdFBe8D+dWE"
"Fullname": "Guru Ampat ",
"Description": "Personal trainer with 4+ years of health and wellness experience across multiple fitness centres. Possesses proven track record in helping clients achieve fitness goals through customised exercise programmes and diet plans.",
"Packages": [
{
"Title": "PT 10",
"Price": 1100,
"PackagePersonalTrainerId": 2079363
}
]
},
{
"PersonId": 20482,
"ImageBase64": "/9j/4AAQSkZJRgABAQEBLAEsAAD/…[truncated]...5rhPB+teTY2e4sNoUY/Krj+K"
"Fullname": "Guru Lima ",
"Description": "Energetic and passionate fitness instructor and trainer with several years of experience teaching one on one classes. Highly trained and experienced in the areas of Yoga, Pilates, Flexibility Training and Aerobics.",
"Packages": [
{
"Title": "PT 1",
"Price": 120,
"PackagePersonalTrainerId": 2079364
}
]
}
]

The response consists of an array of trainers. In the above example, there are 3 Personal Trainers listed. Each Personal Trainer has the following attributes:

2) Input Delivery Address

There are two types of Delivery Address: DeliveryAddressInputted> and DeliveryAddressComputed>. After the user inputs the Delivery Address, CReME calculates the distance between that address and the home club of the member.

{
"Status": "OK",
"AddressOrigin": "241, Suria KLCC, Kuala Lumpur City Centre, 50088 Kuala Lumpur, Wilayah Persekutuan Kuala Lumpur, Malaysia",
"AddressDestination": "1, Jalan SS 7/26a, Ss 7, 47301 Petaling Jaya, Selangor, Malaysia",
"DistanceInKmTo": 21.429,
"DistanceInKmFrom": 23.333,
"TravelDurationInMinutesTo": 28,
"TravelDurationInMinutesFrom": 26
}

The response consists of the following attributes:

3) Checkout

If the status of the response is "OK", the user can proceed to Checkout. Checkout can be initiated by issuing the following request:

{
"Code": "128.50.0",
"Description": "DeliveryCharges successfully calculated",
"Payload": "46.00"
}

A successful response contains "DeliveryCharges successfully calculated" as the response. Any other response indicates the request failed. The Payload value is the cost of the Delivery Charges. In this example, it is RM46.00

4) Shopping Cart

There are two types of Delivery Address: DeliveryAddressInputted> and DeliveryAddressComputed>. After the user inputs the Delivery Address, CReME calculates the distance between that address and the home club of the member.

After "Delivery Charges successfully calculated", the contents of the Shopping Cart can be read by issuing the following request:

[
{
"Selected": true,
"Id": 2079413,
"PackageTitle": "PT 1",
"PriceByCash": 127.2,
"PriceByCreditCard": 127.2,
"PriceByDirectDebit": 127.2,
"PriceByCHIPS": 127.2,
"PriceByCheque": 127.2,
"PriceByFundsTransfer": 127.2,
"TermsAndConditionStatus": null
},
{
"Selected": true,
"Id": 2079414,
"PackageTitle": "Delivery Charges",
"PriceByCash": 46,
"PriceByCreditCard": 46,
"PriceByDirectDebit": 46,
"PriceByCHIPS": 46,
"PriceByCheque": 46,
"PriceByFundsTransfer": 46,
"TermsAndConditionStatus": null
}
]

The above response consists of the following fields:

For further information on how to process the items in Shopping Cart, please refer to CAPI-Purchase beginning at https://capi.bizt.my:8888/v1/ShoppingCart/SelectedItems/Value.