This call is executed to obtain the customer transactions by the IDs generated for the customers.
Request elements
Requires either the phone number or email ID of the customer.
Parameter |
Type |
Required |
Description
|
receipt |
String |
Yes |
Receipt for the transaction
|
openTime |
Date |
Yes |
Opentime of the transaction
|
Error messages
Error Code
|
Error Message
|
400
|
Bad request
|
401
|
Not authorized
|
500
|
Internal server error
|
|
|
EXAMPLE REQUEST:
DELETE http://[subdomain].urbanbuz.com/transaction/transactions
{
"receipt": "123987",
"openTime": "2017-05-14 10:33:15"
}
EXAMPLE RESPONSE:
class="wikitable"
{
"status": " SUCCESS"
}
|
|
Transaction
Submit Transactions
This call is executed to allow to submit the transactions of customers.
Request elements
Parameter |
Type |
Required |
Description
|
customer.accountId |
String |
Yes |
Unique ID generated for the customer
|
customer.phone |
String |
Yes |
Phone number of the customer
|
customer.email |
String |
Yes |
Email ID of the customer
|
customer.first |
String |
Yes |
First name of the customer
|
customer.last |
String |
Yes |
Last name of the customer
|
receipt |
String |
Yes |
Transaction’s unique identity
|
openTime |
Date |
Yes |
Transaction’s open time
|
closeTime |
Date |
Yes |
Transaction’s time of closing
|
operatorId |
String |
No |
Cashier’s unique identity
|
operatorName |
String |
No |
Cashier’s name
|
deviceId |
String |
No |
POS terminal’s unique identity
|
deviceName |
String |
No |
POS terminal’s name
|
billed |
Decimal |
Yes |
Transaction’s gross total
|
paid |
Decimal |
Yes |
Transaction’s net paid
|
redeemed |
Decimal |
Yes |
Transaction’s net paid in loyalty redemption
|
billDiscount |
Decimal |
Yes |
Transaction’s total bill level discount
|
itemDiscountTotal |
Decimal |
Yes |
Transaction’s total item level discount
|
billTax |
Decimal |
Yes |
Transaction’s total bill level tax
|
itemTaxTotal |
Decimal |
Yes |
Transaction’s total item level tax
|
sku |
String |
Yes |
Line item’s unique identifier
|
qty |
Decimal |
Yes |
Line item’s quantity
|
unitPrice |
Decimal |
Yes |
Line item’s gross unit price
|
payments.name |
String |
Yes |
Currency type (e.g. UAE currency)
|
payments.typeName |
String |
Yes |
Payment type (e.g. Cash)
|
payments.amount |
Decimal |
Yes |
Payment amount
|
payments.referenceId |
String |
Yes |
Unique identity of the voucher if voucher is set to true
|
voucher.name |
Boolean |
Yes |
Voucher reward title
|
voucher.typeName |
String |
Yes |
Type of redemption
|
voucher.referenceId |
String |
Yes |
Voucher code
|
voucher.amount |
Decimal |
Yes |
Value of the voucher
|
voucher.redemption |
Boolean |
Yes |
True: Indicates that the voucher is redeemable
|
voucher.voucher |
Boolean |
Yes |
True: Indicates that the voucher has been assigned to the customer
|
loyalty.name |
Boolean |
Yes |
Loyalty reward title
|
loyalty.typeName |
String |
Yes |
Type of redemption
|
loyalty.amount |
Decimal |
Yes |
Amount to be awarded on
|
loyalty.redemption |
Boolean |
Yes |
True: Indicates that the loyalty points are redeemable
|
loyalty.voucher |
Boolean |
Yes |
False: Indicates that no voucher has been assigned to the customer
|
extras.name |
String |
Yes |
Type of additional amount charged to the customer, which is not a product or a service. For example, delivery charges, shipping charges etc
|
extras.amount |
Decimal |
Yes |
Additional amount charged to the customer, which is not a product purchased. For example: USD 20 as delivery charge indicates charging 20 dollars for delivering the purchased product. Assigning '0' value here indicates there is no extra amount charged to the customer
|
API Validations on the values
Field |
Description
|
itemTaxTotal |
This should be the total of all the taxes in the items (Sum of items.tax*items.qty)
|
itemDiscountTotal |
This should be the total of all the discounts in the items (Sum of items.discount.amount*items.qty)
|
billed |
This should be a sum of all items, taxes and extras, that is,
Sum(items.unitPrice*qty)+
Sum(extras.amount)+
billTax+
itemTaxTotal
|
paid |
This should be billed-billDiscount-itemDiscountTotal-redeemed
|
Error messages
Error Code
|
Error Message
|
1004
|
The following field is not unique
|
1006
|
The following fields are invalid
|
1002
|
Fields are empty
|
|
|
EXAMPLE REQUEST:
PUT http://[subdomain].urbanbuz.com/transaction/orders/submit
{
"customer": {
"accountId": "BSNS-10249",
"phone": "971581111148",
"email": "john2091@email.com",
"first": "John",
"last": "Samuel"
},
"receipt": "BSNS-201705141056",
"openTime": "2017-05-14 10:33:15",
"closeTime": "2017-05-14 10:33:15",
"billed": 1300,
"paid": 900,
"redeemed": 200,
"billDiscount": 0,
"itemDiscountTotal": 200,
"billTax": 0,
"itemTaxTotal": 50,
"operatorId" : "STAFF001",
"operatorName" : "Catherine",
"deviceId" : "POS001",
"deviceName" : "Front-desk",
"items": [
{
"sku": "SKU-001",
"name": "Service Name",
"description": "Service Desc",
"type": "Service",
"qty": 1,
"unit": "Service",
"unitPrice": 1200,
"tax": 50,
"discount": {
"name": "Name for the Discount",
"description": "Description for the Discount",
"amount": 200,
"groupId": "Discount GroupId",
"groupName": "Discount Group name",
"type": "Discount Type",
"reason": "Discount Reason",
"authorizedBy": "Branch-Manager"
}
},
{
"sku": "Zero-001",
"name": "Zero",
"description": "Zero level desc",
"type": "Service",
"qty": 1,
"unit": "Service",
"unitPrice": 0,
"tax": 0
}
],
"payments": [
{
"name": "Cash",
"typeName": "Cash",
"amount": 900,
"date": "2019-05-14 10:33:15",
"redemption": false,
"voucher": false,
"referenceId": "12685988"
},
{
"name": "50 AED VOUCHER REDEMPTION",
"typeName": "Voucher",
"referenceId": "7kwPsl",
"amount": 50,
"redemption": true,
"voucher": true
},
{
"name": "100 LOYALTY REDEMPTION",
"typeName": "Loyalty Points",
"amount": 150,
"redemption": true,
"voucher": false
}
],
"extras": [
{
"name": "Delivery Charge",
"amount": 50
}
]
}
EXAMPLE RESPONSE:
{
"status" : "success"
}
|
|
Get transactions by ID
This call is executed to obtain the customer transactions by the IDs generated for the customers.
Request elements
Requires either phone number or email ID of the customer.
Parameter |
Type |
Required |
Description
|
accountId |
String |
Yes |
Unique ID generated for the customer
|
phone |
Date |
Yes |
Phone number of the customer
|
email |
Date |
Yes |
Email ID of the customer
|
Error messages
Error Code
|
Error Message
|
1005
|
Data Not Found
|
|
|
EXAMPLE REQUEST:
GET http://[subdomain].urbanbuz.com/program/accounts/transactions?
accountId=f64f2940&phone=971520000000&page=1&size=10
EXAMPLE RESPONSE:
{
"pageNumber": null,
"pageSize": null,
"totalCount": 19,
"offset": null,
"totalPages": null,
"data": [
{
"id": null,
"txnId": "17596956t",
"receipt": "971551184261-000002",
"openTime": null,
"openedAt": "2019-12-09T20:01:04.000+0000",
"closeTime": null,
"closedAt": "2019-12-09T20:01:04.000+0000",
"billed": 500,
"paid": 500,
"redeemed": 0,
"billDiscount": 0,
"itemDiscountTotal": 0,
"billTax": 0,
"itemTaxTotal": 0,
"status": null,
"operatorId": null,
"operatorName": null,
"deviceId": null,
"deviceName": null,
"revision": null,
"items": [
{
"categories": null,
"custom_properties": null,
"area_id": "405",
"area_name": "Area 1",
"branch_id": "111",
"branch_name": "Branch 1",
"brand_category_id": "101",
"brand_category_label": "ABC",
"brand_id": "10",
"brand_name": "AAA",
"city": "City 1",
"city_iso": "CT-01-12345",
"country": "country 1",
"country_iso": "CN",
"channel_name": "PoS",
"sku": "0001111110",
"item_name": "65051774:LADY MILLION EDP 50ML",
"item_description": "NULL",
"item_category_id": "NULL",
"item_category_name": "NULL",
"item_sub_category_id": "NULL",
"item_sub_category_name": "NULL",
"item_type": "P",
"item_qty": "1.000",
"item_unit": null,
"item_unit_price": "100.000",
"item_eq_unit_price": "27.0",
"item_tax": "0.000",
"item_eq_tax": "0.0",
"item_total_amount": "100.000",
"item_eq_total_amount": "27.0",
"item_total_amount_wo_tax": "100.000",
"item_eq_total_amount_wo_tax": "27.0",
"item_discount": "0.000",
"item_eq_discount": "0.0",
"item_sold_on": "2019-12-09 20:01:04",
"item_sold_on_year": "2019",
"item_sold_on_month": "December",
"item_sold_on_day": "Monday",
"inv_item_color": "NULL",
"inv_item_gender": "NULL",
"inv_country": "NULL",
"inv_brand": "NULL",
"inv_type": "NULL",
"inv_item_name": "NULL",
"inv_item_link": "NULL",
"inv_item_description": "NULL",
"inv_item_size": null,
"product_id": null
}
],
"payments": [
{
"type_name": "Cash",
"amount": "500.000",
"reference_id": null,
"redemption": "false",
"type_id": null,
"name": null,
"payment_at": null
}
],
"modification": null,
"linesChanged": null,
"paymentsChanged": null,
"oldItems": null,
"brand": "AAA",
"branch": "Branch 1",
"country": "country 1"
},
{
"id": null,
"txnId": "17596957t",
"receipt": "971551184261-000003",
"openTime": null,
"openedAt": "2019-12-09T20:01:04.000+0000",
"closeTime": null,
"closedAt": "2019-12-09T20:01:04.000+0000",
"billed": 500,
"paid": 500,
"redeemed": 0,
"billDiscount": 0,
"itemDiscountTotal": 0,
"billTax": 0,
"itemTaxTotal": 0,
"status": null,
"operatorId": null,
"operatorName": null,
"deviceId": null,
"deviceName": null,
"revision": null,
"items": [
{
"categories": null,
"custom_properties": null,
"area_id": "405",
"area_name": "Area 1",
"branch_id": "111",
"branch_name": "Branch 1",
"brand_category_id": "101",
"brand_category_label": "ABC",
"brand_id": "10",
"brand_name": "AAA",
"city": "City 1",
"city_iso": "CT-01-12345",
"country": "country 1",
"country_iso": "CN",
"channel_name": "PoS",
"sku": "0001111110",
"item_name": "65051774:LADY MILLION EDP 50ML",
"item_description": "NULL",
"item_category_id": "NULL",
"item_category_name": "NULL",
"item_sub_category_id": "NULL",
"item_sub_category_name": "NULL",
"item_type": "P",
"item_qty": "1.000",
"item_unit": null,
"item_unit_price": "100.000",
"item_eq_unit_price": "27.0",
"item_tax": "0.000",
"item_eq_tax": "0.0",
"item_total_amount": "100.000",
"item_eq_total_amount": "27.0",
"item_total_amount_wo_tax": "100.000",
"item_eq_total_amount_wo_tax": "27.0",
"item_discount": "0.000",
"item_eq_discount": "0.0",
"item_sold_on": "2019-12-09 20:01:04",
"item_sold_on_year": "2019",
"item_sold_on_month": "December",
"item_sold_on_day": "Monday",
"inv_item_color": "NULL",
"inv_item_gender": "NULL",
"inv_country": "NULL",
"inv_brand": "NULL",
"inv_type": "NULL",
"inv_item_name": "NULL",
"inv_item_link": "NULL",
"inv_item_description": "NULL",
"inv_item_size": null,
"product_id": null
},
{
"categories": null,
"custom_properties": null,
"area_id": "405",
"area_name": "Area 1",
"branch_id": "111",
"branch_name": "Branch 1",
"brand_category_id": "101",
"brand_category_label": "ABC",
"brand_id": "10",
"brand_name": "AAA",
"city": "City 1",
"city_iso": "CT-01-12345",
"country": "country 1",
"country_iso": "CN",
"channel_name": "PoS",
"sku": "005310035898",
"item_name": "82270:JASMIN NOIR EDP 50ML",
"item_description": "NULL",
"item_category_id": "NULL",
"item_category_name": "NULL",
"item_sub_category_id": "NULL",
"item_sub_category_name": "NULL",
"item_type": "P",
"item_qty": "2.000",
"item_unit": null,
"item_unit_price": "200.000",
"item_eq_unit_price": "54.0",
"item_tax": "0.000",
"item_eq_tax": "0.0",
"item_total_amount": "400.000",
"item_eq_total_amount": "108.0",
"item_total_amount_wo_tax": "400.000",
"item_eq_total_amount_wo_tax": "108.0",
"item_discount": "0.000",
"item_eq_discount": "0.0",
"item_sold_on": "2019-12-09 20:01:04",
"item_sold_on_year": "2019",
"item_sold_on_month": "December",
"item_sold_on_day": "Monday",
"inv_item_color": "NULL",
"inv_item_gender": "NULL",
"inv_country": "NULL",
"inv_brand": "NULL",
"inv_type": "NULL",
"inv_item_name": "NULL",
"inv_item_link": "NULL",
"inv_item_description": "NULL",
"inv_item_size": null,
"product_id": null
}
],
"payments": [
{
"type_name": "Cash",
"amount": "500.000",
"reference_id": null,
"redemption": "false",
"type_id": null,
"name": null,
"payment_at": null
}
],
"modification": null,
"linesChanged": null,
"paymentsChanged": null,
"oldItems": null,
"brand": "AAA",
"branch": "Branch 1",
"country": "country 1"
},
{
"id": null,
"txnId": "17596959t",
"receipt": "971551184261-000004",
"openTime": null,
"openedAt": "2019-12-09T20:01:04.000+0000",
"closeTime": null,
"closedAt": "2019-12-09T20:01:04.000+0000",
"billed": 500,
"paid": 500,
"redeemed": 0,
"billDiscount": 0,
"itemDiscountTotal": 0,
"billTax": 0,
"itemTaxTotal": 0,
"status": null,
"operatorId": null,
"operatorName": null,
"deviceId": null,
"deviceName": null,
"revision": null,
"items": [
{
"categories": null,
"custom_properties": null,
"area_id": "405",
"area_name": "Area 1",
"branch_id": "111",
"branch_name": "Branch 1",
"brand_category_id": "101",
"brand_category_label": "ABC",
"brand_id": "10",
"brand_name": "AAA",
"city": "City 1",
"city_iso": "CT-01-12345",
"country": "country 1",
"country_iso": "CN",
"channel_name": "PoS",
"sku": "000110051010",
"item_name": "65051774:LADY MILLION EDP 50ML",
"item_description": "NULL",
"item_category_id": "NULL",
"item_category_name": "NULL",
"item_sub_category_id": "NULL",
"item_sub_category_name": "NULL",
"item_type": "P",
"item_qty": "1.000",
"item_unit": null,
"item_unit_price": "100.000",
"item_eq_unit_price": "27.0",
"item_tax": "0.000",
"item_eq_tax": "0.0",
"item_total_amount": "100.000",
"item_eq_total_amount": "27.0",
"item_total_amount_wo_tax": "100.000",
"item_eq_total_amount_wo_tax": "27.0",
"item_discount": "0.000",
"item_eq_discount": "0.0",
"item_sold_on": "2019-12-09 20:01:04",
"item_sold_on_year": "2019",
"item_sold_on_month": "December",
"item_sold_on_day": "Monday",
"inv_item_color": "NULL",
"inv_item_gender": "NULL",
"inv_country": "NULL",
"inv_brand": "NULL",
"inv_type": "NULL",
"inv_item_name": "NULL",
"inv_item_link": "NULL",
"inv_item_description": "NULL",
"inv_item_size": null,
"product_id": null
}
],
"payments": [
{
"type_name": "Cash",
"amount": "500.000",
"reference_id": null,
"redemption": "false",
"type_id": null,
"name": null,
"payment_at": null
}
],
"modification": null,
"linesChanged": null,
"paymentsChanged": null,
"oldItems": null,
"brand": "AAA",
"branch": "Branch 1",
"country": "country 1"
}
]
}
|
|
Cancel transaction
This call is executed to allow to cancel/delete an existing transaction. The transaction receipt will be the key for the cancellation.
Request elements
Parameter |
Type |
Required |
Description
|
receipt |
String |
Yes |
Receipt for the transaction
|
openTime |
Date |
Yes |
Opentime of the transaction
|
Error messages
Error Code
|
Error Message
|
400
|
Bad request
|
401
|
Not authorized
|
500
|
Internal server error
|
|
|
EXAMPLE REQUEST:
DELETE http://[subdomain].urbanbuz.com/transaction/transactions
{
"receipt": "123987",
"openTime": "2017-05-14 10:33:15"
}
EXAMPLE RESPONSE:
{
"status": " SUCCESS"
}
|
|
Loyalty
Get loyalty posting by account ID
A loyalty posting is a record of the points credited and debited to an account.
This call is executed to obtain the list of points credited and debited to an account, and also the tier details of the member. The parameters of this call are dynamic based on the business setup of the account’s profile.
Request elements
Requires either phone number or email ID of the customer.
Parameter
|
Type
|
Required
|
Description
|
accountId
|
String
|
Yes
|
Unique ID generated for the customer
|
Error messages
Error Code
|
Error Message
|
400
|
Bad request
|
401
|
Not authorized
|
500
|
Internal server error
|
|
|
EXAMPLE REQUEST:
GET http://[subdomain].urbanbuz.com/program/loyalty/
posting?accountId=f64f2940-fae4-11e7-8c5f-ef697603
EXAMPLE RESPONSE:
[
{
"id": 697603,
"tierOrder": 1,
"progId": 11,
"userId": 6459979,
"triggerId": 11,
"triggerName": "Visits",
"tierName": "Tier name",
"credit": 500,
"creditValue": 10,
"debit": 0,
"debitValue": 0,
"currency": "AED",
"postingDate": "2018-05-25 07:30:16 UTC",
"txnDate": "2018-05-25 00:00:00 UTC",
"receipt": "585720",
"branchId": 838,
"branchName": "Branch name",
"brandId": 76,
"brandName": "Brand name",
"countryIso": "AE",
"country": "United Arab Emirates",
"type": 2
}
]
|
|
Send OTP and validate redemption
This call is executed to generate OTP for validating the redemption.
Request elements
Parameter |
Type |
Required |
Description
|
accountId |
String |
Yes |
Unique ID generated for the customer
|
redemption.value |
BigDecimal |
Yes |
Value of the Redemption
|
Error messages
Error Code
|
Error Message
|
1006
|
The following fields are invalid
|
|
|
EXAMPLE REQUEST:
POST http://[subdomain].urbanbuz.com/program/accounts/otp/loyalty
{
"accountId": "ba215440-430d-11e8-842f-0ed5f89f718b",
"redemption": {
"value": "16.5"
}
}
EXAMPLE RESPONSE:
{
"status": "success",
"otp": "2459",
"redemption": {
"point": "1650",
"value": "16.5"
},
"loyalty": {
"program": {
"name": "Loyalty Program Name",
"logo": "URL path to image.jpg"
},
"tier": {
"name": "Loyalty Tier 1",
"logo": "URL path to image.jpg",
"order": 1,
"expiry": "2019-01-01"
},
"wallets": [
{
"countryIso": "AE",
"currency": "AED",
"point": 1570,
"value": 15.75
}
],
"redeemable": {
"point": 1000,
"value": 10,
"currency": "AED"
},
"expiry": {
"point": 256,
"date": "2018-07-03"
},
"reason": null
}
EXAMPLE RESPONSE (FAILURE)
{
"status": "failure",
"reason": {
"errorCode": "1017",
"errorMessage": "Insufficient points"
},
"otp": null,
"loyalty": {
"program": {
"name": "Loyalty Program Name",
"logo": "URL path to image.jpg"
},
"tier": {
"name": "Loyalty Tier 1",
"logo": "URL path to image.jpg",
"order": 1,
"expiry": "2018-01-01"
},
"wallets": [
{
"countryIso": "AE",
"currency": "AED",
"point": 1575,
"value": 15.75,
"expiry": "2018-05-03"
}
]
}
}
|
|
Vouchers
Get vouchers of customer
This call is executed to obtain the list of all vouchers associated with a particular customer, which includes Available, Expired, and Already Used vouchers for that customer.
Request elements
Parameter
|
Type
|
Required
|
Description
|
token
|
String
|
Yes
|
Customer’s token received as a query parameter
|
Error messages
Error Code
|
Error Message
|
400
|
Bad request
|
401
|
Not authorized
|
500
|
Internal server error
|
|
|
EXAMPLE REQUEST:
GET http://[subdomain].urbanbuz.com/online/{token}/vouchers
EXAMPLE RESPONSE:
{
"title" : "Voucher A",
"icon" : "https://urbanbuz.com/images/vouchera.jpg",
"code" : "7bf147",
"issued" : "2018-01-01",
"expires" : "2018-02-01",
"value" : "20",
"valueType" : "percentage",
"status" : "active"
}, {
"title" : "Voucher B",
"icon" : "https://urbanbuz.com/images/voucherb.jpg",
"code" : "e3a962",
"issued" : "2017-01-01",
"expires" : "2018-01-01",
"value" : "100",
"valueType" : "fixed",
"status" : "expired"
}, {
"title" : "Voucher C",
"icon" : "https://urbanbuz.com/images/voucherc.jpg",
"code" : "5b103c",
"issued" : "2017-01-01",
"expires" : "2018-01-01",
"value" : "10",
"valueType" : "percentage",
"status" : "redeemed",
"redeemed" : "2017-12-30 12:34:56",
"redeemedBranch" : {
"name" : "Dubai Mall",
"brandName" : "Brand A"
}
}
|
|
Get vouchers by account ID
This call is executed to obtain the list of vouchers by account ID. The parameters of this call are dynamic based on the business setup of the account’s profile.
Request elements
Requires either phone number or email.
Parameter
|
Type
|
Required
|
Description
|
accountId
|
String
|
Yes
|
Unique ID generated for the customer
|
Error messages
Error Code
|
Error Message
|
400
|
Bad request
|
401
|
Not authorized
|
500
|
Internal server error
|
|
|
EXAMPLE REQUEST:
GET http://[subdomain].urbanbuz.com/program/vouchers?accountId=f64f2940
EXAMPLE RESPONSE:
[{
"title" : "Voucher A",
"icon" : "https://urbanbuz.com/images/vouchera.jpg",
"code" : "7bf147",
"issued" : "2018-01-01",
"expires" : "2018-02-01",
"value" : "20",
"valueType" : "percentage",
"status" : "active"
}, {
"title" : "Voucher B",
"icon" : "https://urbanbuz.com/images/voucherb.jpg",
"code" : "e3a962",
"issued" : "2017-01-01",
"expires" : "2018-01-01",
"value" : "100",
"valueType" : "fixed",
"status" : "expired"
}, {
"title" : "Voucher C",
"icon" : "https://urbanbuz.com/images/voucherc.jpg",
"code" : "5b103c",
"issued" : "2017-01-01",
"expires" : "2018-01-01",
"value" : "10",
"valueType" : "percentage",
"status" : "redeemed",
"redeemed" : "2017-12-30 12:34:56",
"redeemedBranch" : {
"name" : "Dubai Mall",
"brandName" : "Brand A"
}
}]
|
|
Order
Submit order
This call is executed to allow to submit a new order.
Request elements
Parameter |
Type |
Required |
Description
|
customer.accountId |
String |
Yes |
Unique ID generated for the customer
|
customer.phone |
String |
Yes |
Phone number of the customer
|
customer.email |
String |
Yes |
Email ID of the customer
|
customer.first |
String |
Yes |
First name of the customer
|
customer.last |
String |
Yes |
Last name of the customer
|
receipt |
String |
Yes |
Transaction’s unique identity
|
openTime |
Date |
Yes |
Transaction’s open time
|
closeTime |
Date |
Yes |
Transaction’s time of closing
|
operatorId |
String |
No |
Cashier’s unique identity
|
operatorName |
String |
No |
Cashier’s name
|
deviceId |
String |
No |
POS terminal’s unique identity
|
deviceName |
String |
No |
POS terminal’s name
|
billed |
Decimal |
Yes |
Transaction’s gross total
|
paid |
Decimal |
Yes |
Transaction’s net paid
|
redeemed |
Decimal |
Yes |
Transaction’s net paid in loyalty redemption
|
billDiscount |
Decimal |
Yes |
Transaction’s total bill level discount
|
itemDiscountTotal |
Decimal |
Yes |
Transaction’s total item level discount
|
billTax |
Decimal |
Yes |
Transaction’s total bill level tax
|
itemTaxTotal |
Decimal |
Yes |
Transaction’s total item level tax
|
sku |
String |
Yes |
Line item’s unique identifier
|
qty |
Decimal |
Yes |
Line item’s quantity
|
unitPrice |
Decimal |
Yes |
Line item’s gross unit price
|
payments.name |
String |
Yes |
Currency type (e.g. UAE currency)
|
payments.typeName |
String |
Yes |
Payment type (e.g. Cash)
|
payments.amount |
Decimal |
Yes |
Payment amount
|
payments.referenceId |
String |
Yes |
Unique identity of the voucher if voucher is set to true
|
voucher.name |
Boolean |
Yes |
Voucher reward title
|
voucher.typeName |
String |
Yes |
Type of redemption
|
voucher.referenceId |
String |
Yes |
Voucher code
|
voucher.amount |
Decimal |
Yes |
Value of the voucher
|
voucher.redemption |
Boolean |
Yes |
True: Indicates that the voucher is redeemable
|
voucher.voucher |
Boolean |
Yes |
True: Indicates that the voucher has been assigned to the customer
|
loyalty.name |
Boolean |
Yes |
Loyalty reward title
|
loyalty.typeName |
String |
Yes |
Type of redemption
|
loyalty.amount |
Decimal |
Yes |
Amount to be awarded on
|
loyalty.redemption |
Boolean |
Yes |
True: Indicates that the loyalty points are redeemable
|
loyalty.voucher |
Boolean |
Yes |
False: Indicates that no voucher has been assigned to the customer
|
extras.name |
String |
Yes |
Type of additional amount charged to the customer, which is not a product or a service. For example, delivery charges, shipping charges etc
|
extras.amount |
Decimal |
Yes |
Additional amount charged to the customer, which is not a product purchased. For example: USD 20 as delivery charge indicates charging 20 dollars for delivering the purchased product. Assigning '0' value here indicates there is no extra amount charged to the customer
|
API Validations on the values
Field |
Description
|
itemTaxTotal |
This should be the total of all the taxes in the items (Sum of items.tax*items.qty)
|
itemDiscountTotal |
This should be the total of all the discounts in the items (Sum of items.discount.amount*items.qty)
|
billed |
This should be a sum of all items, taxes and extras, that is,
Sum(items.unitPrice*qty)+
Sum(extras.amount)+
billTax+
itemTaxTotal
|
paid |
This should be billed-billDiscount-itemDiscountTotal-redeemed
|
Error messages
Error Code
|
Error Message
|
1004
|
The following field is not unique
|
1006
|
The following fields are invalid
|
1002
|
Fields are empty
|
|
|
EXAMPLE REQUEST:
PUT http://[subdomain].urbanbuz.com/transaction/orders/submit
{
"customer": {
"accountId": "BSNS-10249",
"phone": "971581111148",
"email": "john2091@email.com",
"first": "John",
"last": "Samuel"
},
"receipt": "BSNS-201705141056",
"openTime": "2017-05-14 10:33:15",
"closeTime": "2017-05-14 10:33:15",
"billed": 1300,
"paid": 900,
"redeemed": 200,
"billDiscount": 0,
"itemDiscountTotal": 200,
"billTax": 0,
"itemTaxTotal": 50,
"operatorId" : "STAFF001",
"operatorName" : "Catherine",
"deviceId" : "POS001",
"deviceName" : "Front-desk",
"items": [
{
"sku": "SKU-001",
"name": "Service Name",
"description": "Service Desc",
"type": "Service",
"qty": 1,
"unit": "Service",
"unitPrice": 1200,
"tax": 50,
"discount": {
"name": "Name for the Discount",
"description": "Description for the Discount",
"amount": 200,
"groupId": "Discount GroupId",
"groupName": "Discount Group name",
"type": "Discount Type",
"reason": "Discount Reason",
"authorizedBy": "Branch-Manager"
}
},
{
"sku": "Zero-001",
"name": "Zero",
"description": "Zero level desc",
"type": "Service",
"qty": 1,
"unit": "Service",
"unitPrice": 0,
"tax": 0
}
],
"payments": [
{
"name": "Cash",
"typeName": "Cash",
"amount": 900,
"date": "2019-05-14 10:33:15",
"redemption": false,
"voucher": false,
"referenceId": "12685988"
},
{
"name": "50 AED VOUCHER REDEMPTION",
"typeName": "Voucher",
"referenceId": "7kwPsl",
"amount": 50,
"redemption": true,
"voucher": true
},
{
"name": "100 LOYALTY REDEMPTION",
"typeName": "Loyalty Points",
"amount": 150,
"redemption": true,
"voucher": false
}
],
"extras": [
{
"name": "Delivery Charge",
"amount": 50
}
]
}
EXAMPLE RESPONSE:
{
"status" : "success"
}
|
|
Update order status
This call is executed to allow to update the status of the order placed (Confirmed/Dispatched/Delivered/Canceled).
Request elements
Parameter |
Type |
Required |
Description
|
receipt |
String |
Yes |
Transaction’s unique identifier
|
status |
Decimal |
Yes |
Status of the placed order
|
Error messages
Error Code
|
Error Message
|
1004
|
The following field is not unique
|
1006
|
The following fields are invalid
|
1002
|
Fields are empty
|
|
|
EXAMPLE REQUEST:
PUT http://[subdomain].urbanbuz.com/transaction/orders/status
{
"receipt" : "REC-001",
"status" : "confirmed"
}
EXAMPLE RESPONSE:
{
"status" : "success"
}
|
|
Appointment
Submit appointment
This call is executed to allow to submit the appointment that has been made.
Validations:
- Reference number should be mandatory and unique across branches.
- Customer object should have any of the following identifiers: phone/email/customerId
- Line items of the appointment should be added to the “items” array of line item object.
- “Sku” should be mandatory for each line item.
Request elements
Parameter |
Type |
Required |
Description
|
customer_id |
String |
Yes |
Unique identity assigned to the customer
|
phone |
String |
Yes |
Phone number of the customer
|
email |
String |
Yes |
Email ID of the customer
|
referenceNumber |
String |
Yes |
Reference number for the appointment made
|
generated |
Date |
Yes |
Date and time when the appointment was made and registered
|
start |
Date |
Yes |
Start date and time of the appointment
|
end |
Date |
Yes |
End date and time of the appointment
|
rebooking |
Boolean |
Yes |
False indicates no rebooking is permitted for the booked appointment
|
operatorId |
String |
Yes |
ID of the staff who recorded the appointment
|
operatorName |
String |
Yes |
Name of the staff who recorded the appointment
|
deviceId |
String |
Yes |
ID of the device that was used to register the appointment
|
deviceName |
String |
Yes |
Name of the device that was used to register the appointment
|
status |
Boolean |
Yes |
open/confirmed/closed/canceled/no-show/deleted: Status of the booked appointment
|
receipt |
String |
Yes |
The appointment receipt
|
source |
String |
Yes |
The medium through which the appointment was made (online booking)
|
sku |
String |
Yes |
Unique identifier for the service purchased (appointment)
|
name |
String |
Yes |
Name of the consulting doctor
|
duration |
String |
Yes |
Duration of the appointment
|
consultantId |
String |
Yes |
Unique identity of the consulting doctor
|
consultantName |
String |
Yes |
Name of the consulting doctor
|
consultantType |
String |
Yes |
Type of consultant (doctor)
|
Error messages
Error Code
|
Error Message
|
400
|
Bad request
|
401
|
Not authorized
|
500
|
Internal server error
|
|
|
EXAMPLE REQUEST:
POST http://[subdomain].urbanbuz.com//appointments/submit
{
"customer": {
"customer_id": "BSNS-10249",
"phone": "971581111148",
"email": "jhon2@email.com"
},
"referenceNumber": "APPO-2017-10-19-001",
"generated": "2017-10-22 10:33:15",
"start": "2017-11-14 10:00:00",
"end": "2017-11-14 11:00:00",
"rebooking": false,
"operatorId": "Moo-Foo",
"operatorName": "Moo Operator",
"deviceId": "Foo Device",
"deviceName": "Foo Device Name",
"status": "open/confirmed/closed/canceled/no-show/deleted",
"checkin": "2017-05-14 10:33:15",
"receipt": "BSNS-201705141056",
"source": "Online Booking",
"items": [
{
"sku": "DR-CONSU-001",
"name": "Doctor Consultant",
"start": "2017-11-14 10:00:00",
"end": "2017-11-14 11:00:00",
"duration": 30,
"consultantId": "DR-001",
"consultantName": "John",
"consultantType": "Doctor"
}
]
}
}
EXAMPLE RESPONSE:
{
"status" : "success"
}
|
|
Update appointment status
This call is executed to change the status of an existing transaction. The reference number will be the key for the update.
Request elements
Parameter |
Type |
Required |
Description
|
customer_id |
String |
Yes |
Unique identity assigned to the customer
|
phone |
String |
Yes |
Phone number of the customer
|
email |
String |
Yes |
Email ID of the customer
|
referenceNumber |
String |
Yes |
Reference number for the appointment made
|
checkin |
String |
Yes |
Checkin by the customer
|
status |
String |
Yes |
Status of the appointment (closed)
|
Error messages
Error Code
|
Error Message
|
400
|
Bad request
|
401
|
Not authorized
|
500
|
Internal server error
|
|
|
EXAMPLE REQUEST:
PUT http://[subdomain].urbanbuz.com//appointments/submit
{
"customer": {
"customer_id": "BSNS-10249",
"phone": "971581111148",
"email": "jhon2@email.com"
},
"referenceNumber": "BSNS-201705141033",
"checkin": "2017-05-14 10:33:15",
"status": "closed"
}
|}
EXAMPLE RESPONSE:
{
"status" : "success"
}
|
|
Reports
The following sections describe the reporting API calls.
Fetch accounts
This call lets you obtain the list of accounts (with the details of the account) within a given time range.
Request elements
Parameter
|
Type
|
Required
|
Description
|
start
|
Date
|
Yes
|
Start date and start time of retrieving data
|
end
|
Date
|
Yes
|
End date and end time of retrieving data
|
Error messages
Error Code
|
Error Message
|
1005
|
No data found in the database for the sent request parameters
|
|
|
EXAMPLE REQUEST:
POST http://[subdomain].urbanbuz.com/program/
reports/accounts?page=1&size=10
{
"start": "2017-05-14 10:33:15",
"end": "2017-05-14 10:33:15
}
EXAMPLE RESPONSE:
{
"pageNumber": 1,
"pageSize": 3,
"totalCount": 2242,
"data": [
{
"profile": {
"phone": "971500000000",
"email": null,
"accountId": "ABCD",
"first": "John",
"last": "Brit",
"birthdate": "1986-04-05",
"gender": "M",
"city": null,
"country": null,
"nationality": null,
"language": null,
"businessFields": {
"title": "Mr.",
"ethnicity": "America"
}
},
"originated": {
"brand": "ABC",
"name": "ABC-Mall",
"branchCode": "2000",
"countryName": "United Arab Emirates",
"countryIso": "AE"
}
}
]
}
|
|
Fetch vouchers
Voucher is a type of a reward provided to customers. You can create vouchers to award your customers based on different criteria and to encourage a certain behavior. This API fetches the voucher issued/redeemed/expired within a given time range.
Request elements
Parameter |
Type |
Required |
Description
|
start |
String |
Yes |
Start date to fetch the vouchers
|
end |
String |
Yes |
End date to fetch the vouchers
|
Response elements
Parameter |
Type |
Required |
Description
|
code |
String |
Yes |
This is the voucher code
|
issued |
Date |
Yes |
Issued date of the voucher
|
redeemed |
Date |
No |
Redeemed date if the voucher is redeemed
|
expiry |
Date |
Yes |
Expiry date of the voucher
|
enabled |
boolean |
Yes |
True for enabled, false for disabled
|
issuedBranch |
Object |
Yes |
Details of the branch issuing the voucher
|
redeemedBranch |
Object |
No |
Branch details where the voucher was redeemed
|
campaign |
Object |
No |
Campaign title for which the voucher was issued
|
reward |
Object |
No |
Reward title for which the voucher was issued
|
voucher |
Object |
Yes |
Voucher details
|
voucher.title |
String |
Yes |
Voucher title
|
valueFixed |
Integer |
No |
Value if it is a fixed value voucher
|
valueDiscount |
Integer |
No |
Discount in percentage
|
redeemableBranchList |
Object |
No |
List of branches where voucher can be redeemed
|
country |
Object |
Yes |
Country for which the voucher was setup
|
brand |
Object |
Yes |
Brands for which the voucher was setup
|
customer |
Object |
Yes |
Details of the customer (phone/email/customer ID) to whom the voucher is issued
|
Error messages
Error Code
|
Error Message
|
400
|
Bad request
|
404
|
Given Resource not found
|
|
|
EXAMPLE REQUEST:
POST http://api3.urbanbuz.com/program/reports/vouchers?page=1&size=100
{
"start" : "2018-04-24 16:00:00",
"end" : "2018-04-24 16:10:00"
}
EXAMPLE RESPONSE:
{
"pageNumber": 1,
"pageSize": 100,
"totalCount": 8,
"offset": 0,
"data": [
{
"id": 0,
"code": "2cJRhV",
"issued": "2018-04-24 16:07:00",
"redeemed": null,
"expires": "2019-04-24 16:07:00",
"enabled": true,
"issuedBranch": {
"brand": "ABC",
"name": "ABC-Mall",
"branchCode": "2000",
"countryIso": "AE",
},
"redeemedBranch": null,
"campaign": {
"title": "First Shopping voucher"
}
"reward": {
"title": "First Shopping reward"
},
"voucher": {
"title": "AED 100 Voucher UAE",
"icon": "https://newcem.urbanbuz.com/upload/images/xxx.png",
"valueFixed": 0,
"valueDiscount": 10,
"redeemableBranchList": [
{
"brand": "ABC",
"name": "ABC-Mall",
"branchCode": "S069",
"countryIso": "AE",
},
{
"brand": "ABC",
"name": "ABC-Mall2",
"branchCode": "2001",
"countryIso": "AE",
}
],
"country": {
"countryIso": "AE",
"countryName": "United Arab Emirates"
},
"brands": [
"Brands",
"POP"
]
},
"customer": {
"phone": "971500000000",
"email": "ABC@hotmail.com",
"customerId": "10000"
}
}
]
}
|
|
Fetch transactions
This call lets you obtain the transaction report for the specified time range.
Request elements
Parameter |
Type |
Required |
Description
|
start |
Date |
Yes |
Start date and time
|
end |
Date |
Yes |
End date and time
|
Error messages
Error Code
|
Error Message
|
1005
|
Data not found
|
|
|
EXAMPLE REQUEST:
POST http://[subdomain].urbanbuz.com/program/
reports/transactions?page=1&size=10
{
"start": "2017-05-14 10:33:15",
"end": "2017-05-14 10:33:15
}
EXAMPLE RESPONSE:
{
"pageNumber": 1,
"pageSize": 1,
"totalCount": 28,
"offset": 0,
"data": [
{
"transaction": {
"receipt": "971552456810-18",
"openedAt": "2018-01-22 13:59:00",
"closedAt": null,
"billed": 210,
"paid": 100,
"redeemed": 0,
"billDiscount": 0,
"itemDiscountTotal": 0,
"billTax": 0,
"itemTaxTotal": 0,
"operatorId": null,
"operatorName": null,
"deviceId": "T004",
"deviceName": "ABC COUNTER 1",
"items": [
{
"id": null,
"sku": "S2597",
"name": "SUIT2/375",
"description": null,
"type": "P",
"inventoryId": null,
"inventoryCategoryId": null,
"qty": 1,
"unit": null,
"unitPrice": 60,
"tax": null,
"lineAmount": 60,
"discount": null,
"customFields": null
},
{
"id": null,
"sku": "S2600",
"name": "SUIT2/895",
"description": null,
"type": "P",
"inventoryId": null,
"inventoryCategoryId": null,
"qty": 1,
"unit": null,
"unitPrice": 100,
"tax": null,
"lineAmount": 100,
"discount": null,
"customFields": null
},
{
"id": null,
"sku": "S2599",
"name": "SUIT2/585",
"description": null,
"type": "P",
"inventoryId": null,
"inventoryCategoryId": null,
"qty": 2,
"unit": null,
"unitPrice": 25,
"tax": null,
"lineAmount": 50,
"discount": null,
"customFields": null
}
],
"payments": [
{
"id": null,
"name": null,
"typeId": null,
"typeName": "Master Card",
"date": null,
"paymentAt": null,
"amount": 100,
"referenceId": null,
"redemption": false,
"customFields": null
}
],
"extras": null,
"customFields": null
}
}
]
}
|
|
Fetch and export campaigns
This call is executed to retrieve all the details pertaining to a scheduled campaign (SMS campaign or Email campaign) and export these details to obtain the statistics of the scheduled campaigns. The campaign details mainly include:
- Campaign scheduled date
- Location where the campaign is scheduled
- Count of sent, delivered and undelivered campaigns, and so on.
Request elements
Parameter
|
Type
|
Required
|
Description
|
start
|
Date
|
Yes
|
Start date and start time of the SMS/Email campaign schedule
|
end
|
Date
|
Yes
|
End date and end time of the SMS/Email campaign schedule
|
resultEndPoint
|
String
|
Yes
|
The endpoint to update when the result is ready
|
export
|
Boolean
|
Yes
|
To obtain the statistics of the scheduled campaign in the form of a csv file structure.
|
Error messages
Error Code
|
Error Message
|
1005
|
No data found in the database for the sent request parameters
|
|
|
EXAMPLE REQUEST:
POST http://[subdomain].urbanbuz.com/program/reports/campaigns?export=true
{
"start": "2018-09-10 00:00:00",
"end": "2018-09-10 23:59:59,
"resultEndPoint": "https://[subdomain].urbanbuz.com/campaigns/results"
}
'''Example request''' that generates the csv file
(displaying the details of the campaign) when the parameter value
'''export''' is set to be '''true'''.
POST http://company.com/campaigns/results
{
"jobId": "a1fTstz347",
"status": "Generated",
"fileName": Campaign_SMS_a1fTstz347_20180909.csv",
}
EXAMPLE RESPONSE:
{
"totalCount": 6,
"status": "Generating",
"fileName": "Campaign_SMS_a1fTstz347_20180909.csv",
"jobId":1246789454645,
"data": [
{
"campaignId": "a1fTstz347",
"campaignDescription":"Discount on bags"
"channel": "SMS",
"scheduled": "2018-09-09 14:00:00",
"lastUpdated":"2018-09-10 11:25:00",
"timeZone": "Asia/Dubai",
"sent": "15000",
"delivered": "13000",
"undelivered": "2000",
"filters": {
"location": {
"country": [{
"countryIso": "AE",
"name": "United Arab Emirates"
}
],
"brand": [{
"name": "Elann"
}
],
"profile": [{
"phoneCountry": "AE"
},
{
"gender": "M"
}
],
"transaction": [{
"active": {
"from": "2017-01-01"
}
}
]
}
}
}
]
}
|
|
Status code and error messages
API requests can at times result in errors and return appropriate status code that help you identify the error type.
The following table describes standard error codes returned by the APIs:
Status code
|
Text
|
Description
|
200
|
OK
|
Indicates that the request was correct and sent to the core for further processing.
|
400
|
Bad request
|
Indicates that the request does not contain all the information/ parameters in order to proceed. This
error is returned from the Resource class.
Domain validation errors, missing data, etc. are some examples.
|
401
|
Not authorized
|
Indicates that the request was not authorized and cannot proceed. This error code is
returned from Authentication Filter class.
|
500
|
Internal server error
|
The server encountered an unexpected condition which prevented it from fulfilling the request.
This need to be analyzed further.
|
The following table describes the standard error codes returned by UrbanBuz APIs.
Error code
|
Description
|
1001
|
The request payload is empty
|
1002
|
Certain field values are empty
|
1003
|
Internal Server Error
|
1004
|
Certain fields are not unique
|
1005
|
No data found in the database for the sent request parameters
|
1009
|
No data found in the database for the sent request parameters
|
1010
|
At least one of the fields required to be filled
|
Timestamp
Timestamps are returned in the UTC format: YYYY-MM-DDTHH:MM:SSZ
|