Links

API Integration

How to integrate Nector APIs?
API calls can be made from app, website or backend systems. We have detailed API reference documentation at API Reference or you can import the Open API Reference in the Postman collection.
In order to make API calls, API Key is needed. Create API Key

Rewarding without Triggers

Before rewarding the user, soft entry of that user needs to be created on nector platform. For soft user creation refer the below API.
post
https://platform.nector.io/api/v2/merchant
/leads
Create User
Example
Create User
Create User with existing referral code
Create User referred by another User
Create User with badge
curl --location --request POST 'https://platform.nector.io/api/v2/merchant/leads' \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data-raw '{
"customer_id": "customer-id"
}'
curl --location --request POST 'https://platform.nector.io/api/v2/merchant/leads' \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data-raw '{
"customer_id": "customer-id",
"referral_code": "referral_code"
}'
curl --location --request POST 'https://platform.nector.io/api/v2/merchant/leads' \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data-raw '{
"customer_id": "customer-id",
"referred_by_referral_code": "referred_by_referral_code"
}'
curl --location --request POST 'https://platform.nector.io/api/v2/merchant/leads' \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data-raw '{
"customer_id": "customer-id",
"badge": "bronze"
}'
Once the user is created call the Wallet Reward API or Scratch Card Reward API based on your business needs (how, where, what, when to reward is totally the business's call)
post
https://platform.nector.io/api/v2/merchant
/wallettransactions
Reward WalletPoint
Example
Reward wallet points
Redeem wallet points
curl --request POST \
--url https://platform.nector.io/api/v2/merchant/wallettransactions \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data '{
"customer_id": "customer_id",
"amount": "10",
"hash": "uniquehash",
"operation": "cr"
}'
curl --request POST \
--url https://platform.nector.io/api/v2/merchant/wallettransactions \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data '{
"customer_id": "customer_id",
"amount": "10",
"hash": "uniquehash",
"operation": "dr"
}'
post
https://platform.nector.io/api/v2/merchant
/dealrewards
Reward Deal
Example
curl --request POST \
--url https://platform.nector.io/api/v2/merchant/dealrewards \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data '{
"customer_id": "customer_id"
}'

Using Triggers

Rewarding using actions and rules is very straightforward. Just call the Trigger Activity API to reward your customers (soft creation of customer is automatic)
post
https://platform.nector.io/api/v2/merchant
/triggeractivities
Reward Using Trigger
Example
Trigger activity
Trigger activity (user with existing referral code)
Trigger activity (user referred by other user)
Action activity (user with badge)
curl --request POST \
--url https://platform.nector.io/api/v2/merchant/actionactivities \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data '{
"trigger_id": "trigger_id",
"customer_id": "customer_id"
}'
curl --request POST \
--url https://platform.nector.io/api/v2/merchant/actionactivities \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data '{
"trigger_id": "trigger_id",
"customer_id": "customer_id",
"referral_code": "referral_code"
}'
curl --request POST \
--url https://platform.nector.io/api/v2/merchant/actionactivities \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data '{
"trigger_id": "trigger_id",
"customer_id": "customer_id",
"referred_by_referral_code": "referred_by_referral_code"
}'
curl --request POST \
--url https://platform.nector.io/api/v2/merchant/actionactivities \
--header 'x-apikey: <api-key-in-plain-format>' \
--header 'x-source: <source>' \
--header 'Content-Type: application/json' \
--data '{
"trigger_id": "trigger_id",
"customer_id": "customer_id",
"badge": "silver"
}'