https://webhook.site
{
"crm_key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"method": "createCustomer",
"customer": {
"name": "Joe",
"surname": "Master",
"middlename": "Remaster",
"email": "joe@passquare.com",
"phone": "+420000000001",
"birthday": "1980-01-25",
"cardNumbers": ["120"],
"cardTracks": [{"card": "120", "track": "7862374687"}],
"extra": {
"sex": "male", //optional parameter
"promo": "BBBBB" //promo code entered by the customer during registration
},
"balance": 300.00,
"bonus": 10.00,
"discount": 25.00,
"promo": "AAAAA", //customer's referral promo code
"referCustomerPhone": "+420000000002"
}
}
{"customerId": "6d2845ff-0a07-11e7-25df-d8d18565926f"}
{"error": "Detailed error description..."}
https://webhook.site
{
"crm_key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"method": "readBalance",
"customer": {
"phone": "+420000000001",
"cardNumbers": ["120"]
}
}
{
"success": true,
"bonus" : 12.5,
"balance": 5,
"discount": 17.88
}
https://webhook.site
{
"crm_key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"method": "addBalance",
"customer": {
"phone": "+420000000001",
"cardNumbers": ["120"],
"sum": 50.00,
"transactionId": "id/guid",
"lifetime": 14 //optional, bonus lifetime in days (24h)
}
}
{
"success": true
}
https://core.passquare.com/api/v2/status
{
"app_key": "private_key"
}
{
"app": "account_name",
"balance": 980.00
}
https://core.passquare.com/api/v2/crm/user_create_or_update
{
"app_key": "private_key",
"name": "name",
"phone": "customer's mobile phone",
"email": "email address", //optional
"surname": "surname", //optional
"middlename": "patronymic", //optional
"birthday": "date of birth dd.mm.yyyy", //optional
"discount": "discount percentage", //float, default 0
"bonus": "bonus percentage", //float, default 0
"balance": "amount of bonuses", //float, default 0
"card_track": "...", //new card track, when changing the track the card is overwritten in your CRM
"template_uuid": "...", //uuid of the card design template
"customerId": "customer identifier in your CRM",
"link": "link to the card issuance form",
"sms": "Your card: %link%" //SMS to send to the customer
}
{
"success": "message about customer creation", //bool
"sms_send": "message about SMS sending", //bool
"card": "message about card creation", //bool
"card_number": "created card number", //string
"card_track": "created card track", //string
"card_url": "personalized link to Apple Wallet card", //url
"card_gpay_url": "personalized link to Google Pay card", //url
"form_url": "personalized link to the form", //url
"user_hash": "hash for form personalization" //hash
}
https://core.passquare.com/api/v2/crm/user_create_or_update
{
"app_key" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"phone" : "+420000000001",
"email" : "joe@passquare.com",
"name" : "Joe",
"surname" : "Master",
"middlename" : "Remaster",
"birthday" : "11.11.1980",
"discount" : 0,
"bonus" : 3.50,
"balance" : 100,
"link" : "https://form.passquare.com/00000000-0000-0000-0000-000000000000",
"sms" : "Your card: %link%"
}
"Your card: https://form.passquare.com/00000000-0000-0000-0000/?hash=2f10171a33f66f3bc425335690ec880c"
https://core.passquare.com/api/v2/crm/user_create_or_update
{
"app_key" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"phone" : "+420000000001",
"balance" : 120
}
https://core.passquare.com/api/v2/crm/user_create_or_update
{
"app_key" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"phone" : "420000000001",
"push" : "Your order is ready for pickup!"
}
https://core.passquare.com/api/v2/crm/user_create_or_update
{
"app_key" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"phone" : "+420000000001",
"send_webpush" : "Your order is ready for pickup!"
}
https://core.passquare.com/api/v2/crm/user_create_or_update
{
"app_key" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"phone" : "+420000000001",
"send_telegram" : "Your order is ready for pickup!"
}
https://core.passquare.com/api/v2/crm/read_customer
{
"app_key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"phone": "", //phone number
"card": "", //card number
"invites": bool, //whether referral information is needed
"installs": bool //whether information about card installations is needed
}
{
"customer": {
"phone": "+420000000001",
"email": "joe@passquare.com",
"name": "Joe",
"surname": "Master",
"middlename": "Remaster",
"birthday": "11.11.1980",
"cardNumbers": ["120"],
"cardTracks": [{"card": "120", "track": "78374598987"}],
"cardInstalls": [{"card": "120", "install": true}], //the flag for card installations
"discount": 4.5,
"bonus": 0,
"balance": 0,
"template_uuid": "...", //uuid of card design template
"remoteId": "6326", //ID in the external CRM system
"invitedBy": "+420000000000",
"invites": [ //referral information
"+420000000011",
"+420000000012"
]
}
}
https://core.passquare.com/api/v2/crm/read_customers
{
"app_key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"start_date": "datetime", //01.01.2020
"end_date": "datetime", //31.12.2020 23:59:59
"installed": true,
"offset": 0
}
{
"customers":
[
"+420000000011",
"+420000000012"
]
}
https://core.passquare.com/api/v2/crm/push/create
{
"app_key": "", //private key
"message": "", //message text
"type": "", //message type - text, webpush, telegram
"name": "", //name, displayed in the dashboard, optional parameter
"segment_uuid": "" //segment identifier, optional parameter
}
{
"result": {
"name": "Push#0000",
"uuid": "00000000-0000-0000-0000-000000000000",
"message": "Test push!"
}
}
https://core.passquare.com/api/v2/crm/push/send
{
"app_key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"push_uuid": "00000000-0000-0000-0000-000000000000" //push campaign identifier
}
curl -d '{"app_key":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "phone":"+420000000001", "email":"joe@passquare.com", "name":"Joe", "surname":"Master", "middlename":"Remaster", "birthday":"03.05.1980", "discount":0, "bonus":5, "balance":200}' -H "Content-Type: application/json" -X POST https://core.passquare.com/api/v2/crm/user_create_or_update
<?php
$url = 'https://core.passquare.com/api/v2/crm/user_create_or_update';
$post = [
'app_key' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'phone' => '+420000000001',
'email' => 'joe@passquare.com',
'name' => 'Joe',
'surname' => 'Master',
'middlename' => 'Remaster',
'birthday' => '03.05.1980',
'discount' => 0,
'bonus' => 4.5,
'balance' => 100
];
$data_string = json_encode($post);
$options = [
CURLOPT_TIMEOUT => 30,
CURLOPT_POST => 1,
CURLOPT_HEADER => 0,
CURLOPT_URL => $url,
CURLOPT_FRESH_CONNECT => 1,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FORBID_REUSE => 1,
CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_POSTFIELDS => $data_string,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Content-Length: '.strlen($data_string)
]
];
$ch = curl_init();
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
print_r($result);
?>